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:
Manu MA
2019-06-23 11:26:42 +02:00
committed by GitHub
parent 78e477b2a7
commit 34dfc3ce98
112 changed files with 1229 additions and 1233 deletions

View File

@ -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,