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.

50 lines (45 loc) 1.24 kB
/*! * NENT 2022 */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-1829aebc.js'); const service = require('./service-18bf7431.js'); require('./index-637e8c28.js'); require('./logging-37c154cf.js'); require('./state-f97ff0e6.js'); require('./index-96f3ab3f.js'); const PresentationAction = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.valid = true; this.sent = false; this.actionService = new service.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 index.h(index.Host, null); } get el() { return index.getElement(this); } }; exports.n_presentation_action = PresentationAction;