refactor(dom): attachComponent()

This commit is contained in:
Manu Mtz.-Almeida
2018-03-21 16:22:59 +01:00
parent c03afabc0f
commit ee27549c84
9 changed files with 63 additions and 76 deletions

View File

@ -1,8 +1,9 @@
import { Component, Element, Event, EventEmitter, Listen, Method, Prop } from '@stencil/core';
import { Animation, AnimationBuilder, Config, FrameworkDelegate } from '../../index';
import { createThemedClasses, getClassMap } from '../../utils/theme';
import { BACKDROP, OverlayEventDetail, OverlayInterface, attachComponent, detachComponent, dismiss, eventMethod, present } from '../../utils/overlays';
import { createThemedClasses, getClassList } from '../../utils/theme';
import { BACKDROP, OverlayEventDetail, OverlayInterface, dismiss, eventMethod, present } from '../../utils/overlays';
import { attachComponent, detachComponent } from '../../utils/framework-delegate';
import iosEnterAnimation from './animations/ios.enter';
import iosLeaveAnimation from './animations/ios.leave';
@ -172,10 +173,10 @@ export class Modal implements OverlayInterface {
...this.data,
modal: this.el
};
const classes = {
...getClassMap(this.cssClass),
'ion-page': true
};
const classes = [
...getClassList(this.cssClass),
'ion-page'
];
return attachComponent(this.delegate, container, this.component, classes, data)
.then(el => this.usersElement = el)
.then(() => present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation));