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.

46 lines (43 loc) 1.18 kB
/*! * NENT 2022 */ import { r as registerInstance, h, a as getElement, H as Host } from './index-916ca544.js'; import { A as ActionService } from './service-9338e502.js'; import './index-f7016b94.js'; import './logging-5a93c8af.js'; import './state-27a8a5bc.js'; import './index-4bfabbbd.js'; const PresentationAction = class { constructor(hostRef) { registerInstance(this, hostRef); 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 getElement(this); } }; export { PresentationAction as n_presentation_action };