mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
refactor(all): updating to newest stencil apis (#18578)
* chore(): update ionicons * refactor(all): updating to newest stencil apis * fix lint issues * more changes * moreee * fix treeshaking * fix config * fix checkbox * fix stuff * chore(): update ionicons * fix linting errors
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Prop, State, Watch } from '@stencil/core';
|
||||
import { Build, Component, ComponentInterface, Element, Event, EventEmitter, Prop, State, Watch } from '@stencil/core';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
|
||||
@ -27,9 +27,6 @@ export class SplitPane implements ComponentInterface {
|
||||
@Element() el!: HTMLElement;
|
||||
@State() visible = false;
|
||||
|
||||
@Prop({ context: 'isServer' }) isServer!: boolean;
|
||||
@Prop({ context: 'window' }) win!: Window;
|
||||
|
||||
/**
|
||||
* The content `id` of the split-pane's main content.
|
||||
* This property can be used instead of the `[main]` attribute to select the `main`
|
||||
@ -75,7 +72,7 @@ export class SplitPane implements ComponentInterface {
|
||||
@Watch('disabled')
|
||||
@Watch('when')
|
||||
protected updateState() {
|
||||
if (this.isServer) {
|
||||
if (!Build.isBrowser) {
|
||||
return;
|
||||
}
|
||||
if (this.rmL) {
|
||||
@ -105,13 +102,13 @@ export class SplitPane implements ComponentInterface {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this.win as any).matchMedia) {
|
||||
if ((window as any).matchMedia) {
|
||||
// Listen on media query
|
||||
const callback = (q: MediaQueryList) => {
|
||||
this.visible = q.matches;
|
||||
};
|
||||
|
||||
const mediaList = this.win.matchMedia(mediaQuery);
|
||||
const mediaList = window.matchMedia(mediaQuery);
|
||||
(mediaList as any).addListener(callback as any);
|
||||
this.rmL = () => (mediaList as any).removeListener(callback as any);
|
||||
this.visible = mediaList.matches;
|
||||
@ -127,7 +124,7 @@ export class SplitPane implements ComponentInterface {
|
||||
}
|
||||
|
||||
private styleChildren() {
|
||||
if (this.isServer) {
|
||||
if (!Build.isBrowser) {
|
||||
return;
|
||||
}
|
||||
const contentId = this.contentId;
|
||||
@ -156,7 +153,7 @@ export class SplitPane implements ComponentInterface {
|
||||
|
||||
return {
|
||||
class: {
|
||||
[`${mode}`]: true,
|
||||
[mode]: true,
|
||||
|
||||
// Used internally for styling
|
||||
[`split-pane-${mode}`]: true,
|
||||
|
||||
Reference in New Issue
Block a user