@larva.io/webcomponents
Version:
Fentrica SmartUnits WebComponents package
26 lines (25 loc) • 956 B
JavaScript
/*!
* (C) Fentrica http://fentrica.com - Seee LICENSE.md
*/
import { assignComponentProps } from "../../../utils/helpers";
import { getAppRoot } from "../../../utils/theme";
export async function createNotify(opts) {
if (typeof customElements !== 'undefined') {
await customElements.whenDefined('lar-notify');
const element = document.createElement('lar-notify');
assignComponentProps(element, opts);
// append the overlay element to the document body
// @TODO: re-position notify from top how manuy active notfy's there are
getAppRoot(document).appendChild(element);
if (element.componentOnReady) {
await element.componentOnReady();
}
element.addEventListener('larnotifydiddismiss', () => {
element.remove();
});
return element;
}
throw new Error('WebComponents not available');
}
;
//# sourceMappingURL=notify-controller.js.map