UNPKG

@paraboly/pwc-multi-filter

Version:

A wrapper over pwc-tabview and pwc-filter. Provides means of dynamically managing multiple filters via a single component.

43 lines (38 loc) 1.2 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const core = require('./core-d69cee64.js'); require('./_commonjsHelpers-ab75601c.js'); require('./linq-23ba6bed.js'); const utils = require('./utils-54b3bea2.js'); const PwcDynamicFormButtons = class { constructor(hostRef) { core.registerInstance(this, hostRef); this.resolvedItems = []; this.defaultItems = []; this.items = this.defaultItems; } onItemsChanged(newValue) { if (newValue === null || newValue === undefined) { this.items = this.defaultItems; } else { this.resolvedItems = utils.resolveJson(newValue); } } componentWillLoad() { this.onItemsChanged(this.items); } constructButton(button) { return core.h("input", Object.assign({}, button)); } render() { return this.resolvedItems ? this.resolvedItems.map(button => this.constructButton(button)) : ""; } static get watchers() { return { "items": ["onItemsChanged"] }; } static get style() { return ""; } }; exports.pwc_dynamic_form_buttons = PwcDynamicFormButtons;