@nent/core
Version:
68 lines (64 loc) • 1.74 kB
JavaScript
/*!
* NENT 2022
*/
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { A as ActionService } from './service.js';
const PresentationAction = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.valid = true;
this.sent = false;
this.actionService = new ActionService(this, 'n-presentation-action');
}
/**
* Get the underlying actionEvent instance. Used by the n-action-activator element.
*/
getAction() {
return this.actionService.getAction();
}
/**
* Send this action to the action messaging system.
*/
async sendAction(data) {
if (this.sent)
return;
await this.actionService.sendAction(data);
this.sent = true;
}
get childScript() {
return this.el.querySelector('script');
}
get childInputs() {
return this.el.querySelectorAll('input,select,textarea');
}
render() {
return h(Host, null);
}
get el() { return this; }
}, [0, "n-presentation-action", {
"topic": [1],
"command": [1],
"time": [8],
"when": [1],
"valid": [32],
"sent": [32],
"getAction": [64],
"sendAction": [64]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["n-presentation-action"];
components.forEach(tagName => { switch (tagName) {
case "n-presentation-action":
if (!customElements.get(tagName)) {
customElements.define(tagName, PresentationAction);
}
break;
} });
}
const NPresentationAction = PresentationAction;
const defineCustomElement = defineCustomElement$1;
export { NPresentationAction, defineCustomElement };