refactor(all): update to one (part 3) (#18874)

This commit is contained in:
Manu MA
2019-07-25 20:22:44 +02:00
committed by GitHub
parent 9b85e13493
commit e82648bda2
105 changed files with 1249 additions and 1388 deletions

View File

@ -1,4 +1,4 @@
import { Build, Component, ComponentInterface, Element, Event, EventEmitter, Listen, Method, Prop, State, Watch, h } from '@stencil/core';
import { Build, Component, ComponentInterface, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';
import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global';
@ -497,37 +497,36 @@ export class Menu implements ComponentInterface, MenuI {
this.afterAnimation(false);
}
hostData() {
const { isEndSide, type, disabled, isPaneVisible } = this;
return {
role: 'navigation',
class: {
[`${this.mode}`]: true,
[`menu-type-${type}`]: true,
'menu-enabled': !disabled,
'menu-side-end': isEndSide,
'menu-side-start': !isEndSide,
'menu-pane-visible': isPaneVisible
}
};
}
render() {
return [
<div
class="menu-inner"
ref={el => this.menuInnerEl = el}
const { isEndSide, type, disabled, mode, isPaneVisible } = this;
return (
<Host
role="navigation"
class={{
[mode]: true,
[`menu-type-${type}`]: true,
'menu-enabled': !disabled,
'menu-side-end': isEndSide,
'menu-side-start': !isEndSide,
'menu-pane-visible': isPaneVisible
}}
>
<slot></slot>
</div>,
<ion-backdrop
ref={el => this.backdropEl = el}
class="menu-backdrop"
tappable={false}
stopPropagation={false}
/>
];
<div
class="menu-inner"
ref={el => this.menuInnerEl = el}
>
<slot></slot>
</div>
<ion-backdrop
ref={el => this.backdropEl = el}
class="menu-backdrop"
tappable={false}
stopPropagation={false}
/>
</Host>
);
}
}