UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

62 lines (58 loc) 1.51 kB
/*! * NENT 2022 */ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client'; import { A as ActionService } from './service.js'; const Action = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement { constructor() { super(); this.__registerHost(); this.valid = true; this.actionService = new ActionService(this, 'n-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. */ sendAction(data) { return this.actionService.sendAction(data); } 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-action", { "topic": [1], "command": [1], "when": [1], "valid": [32], "getAction": [64], "sendAction": [64] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["n-action"]; components.forEach(tagName => { switch (tagName) { case "n-action": if (!customElements.get(tagName)) { customElements.define(tagName, Action); } break; } }); } const NAction = Action; const defineCustomElement = defineCustomElement$1; export { NAction, defineCustomElement };