feat(popover): popover can now be used inline (#23231)

BREAKING CHANGE: Converted `ion-popover` to use the Shadow DOM.
This commit is contained in:
Liam DeBeasi
2021-05-03 12:02:22 -04:00
committed by GitHub
parent 6fcb3a62b1
commit 308fa1c0dd
29 changed files with 826 additions and 170 deletions

View File

@@ -5,14 +5,15 @@ import { componentOnReady } from './helpers';
export const attachComponent = async (
delegate: FrameworkDelegate | undefined,
container: Element,
component: ComponentRef,
component?: ComponentRef,
cssClasses?: string[],
componentProps?: { [key: string]: any }
componentProps?: { [key: string]: any },
inline?: boolean
): Promise<HTMLElement> => {
if (delegate) {
return delegate.attachViewToDom(container, component, componentProps, cssClasses);
}
if (typeof component !== 'string' && !(component instanceof HTMLElement)) {
if (!inline && typeof component !== 'string' && !(component instanceof HTMLElement)) {
throw new Error('framework delegate is missing');
}
@@ -28,6 +29,7 @@ export const attachComponent = async (
}
container.appendChild(el);
await new Promise(resolve => componentOnReady(el, resolve));
return el;