mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
- updates components to use shadow DOM or scoped if they require css variables - moves global styles to an external stylesheet that needs to be imported - adds support for additional colors and removes the Sass loops to generate colors for each component - several property renames, bug fixes, and test updates Co-authored-by: Manu Mtz.-Almeida <manu.mtza@gmail.com> Co-authored-by: Adam Bradley <adambradley25@gmail.com> Co-authored-by: Cam Wiegert <cam@camwiegert.com>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import { Component, Element, Prop, QueueApi } from '@stencil/core';
|
|
import { Config } from '../../interface';
|
|
import { isDevice, isHybrid, needInputShims } from '../../utils/platform';
|
|
|
|
@Component({
|
|
tag: 'ion-app',
|
|
styleUrl: 'app.scss'
|
|
})
|
|
export class App {
|
|
|
|
@Element() el!: HTMLElement;
|
|
|
|
@Prop({ context: 'window' }) win!: Window;
|
|
@Prop({ context: 'config' }) config!: Config;
|
|
@Prop({ context: 'queue' }) queue!: QueueApi;
|
|
|
|
componentDidLoad() {
|
|
importInputShims(this.win, this.config);
|
|
importStatusTap(this.win, this.config, this.queue);
|
|
}
|
|
|
|
hostData() {
|
|
const hybrid = isHybrid(this.win);
|
|
const statusBar = this.config.getBoolean('statusbarPadding', hybrid);
|
|
|
|
return {
|
|
class: {
|
|
'statusbar-padding': statusBar
|
|
}
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return [
|
|
<ion-tap-click></ion-tap-click>,
|
|
<slot></slot>
|
|
];
|
|
}
|
|
}
|
|
|
|
async function importStatusTap(win: Window, config: Config, queue: QueueApi) {
|
|
const device = config.getBoolean('isDevice', isDevice(win));
|
|
if (device) {
|
|
(await import('../../utils/status-tap')).startStatusTap(win, queue);
|
|
}
|
|
}
|
|
|
|
async function importInputShims(win: Window, config: Config) {
|
|
const inputShims = config.getBoolean('inputShims', needInputShims(win));
|
|
if (inputShims) {
|
|
(await import('../../utils/input-shims/input-shims')).startInputShims(win.document, config);
|
|
}
|
|
}
|