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