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.

42 lines (37 loc) 1.45 kB
/*! * NENT 2022 */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-1829aebc.js'); const stateSubscriber = require('./state-subscriber-0ded559f.js'); const interfaces = require('./interfaces-95d0415a.js'); const interfaces$1 = require('./interfaces-1da33056.js'); const state = require('./state-f97ff0e6.js'); require('./index-637e8c28.js'); require('./index-96f3ab3f.js'); const ContentShow = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.show = false; } componentWillLoad() { this.dataSubscription = new stateSubscriber.CommonStateSubscriber(this, 'dataEnabled', interfaces.DATA_EVENTS.DataChanged); this.routeSubscription = new stateSubscriber.CommonStateSubscriber(this, 'routingEnabled', interfaces$1.ROUTE_EVENTS.RouteChanged); } async componentWillRender() { if (state.state.dataEnabled) { const { evaluatePredicate } = await Promise.resolve().then(function () { return require('./expressions-531d82f5.js'); }).then(function (n) { return n.expressions; }); this.show = await evaluatePredicate(this.when); } } disconnectedCallback() { this.dataSubscription.destroy(); this.routeSubscription.destroy(); } render() { return (index.h(index.Host, { hidden: !this.show }, index.h("slot", null))); } get el() { return index.getElement(this); } }; exports.n_content_show = ContentShow;