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.

47 lines (46 loc) 1.65 kB
import { r as registerInstance, h } from './core-fe9cb4ce.js'; import { r as resolveJson } from './utils-d2f4109d.js'; var PwcDynamicFormButtons = /** @class */ (function () { function PwcDynamicFormButtons(hostRef) { registerInstance(this, hostRef); this.resolvedItems = []; this.defaultItems = []; this.items = this.defaultItems; } PwcDynamicFormButtons.prototype.onItemsChanged = function (newValue) { if (newValue === null || newValue === undefined) { this.items = this.defaultItems; } else { this.resolvedItems = resolveJson(newValue); } }; PwcDynamicFormButtons.prototype.componentWillLoad = function () { this.onItemsChanged(this.items); }; PwcDynamicFormButtons.prototype.constructButton = function (button) { return h("input", Object.assign({}, button)); }; PwcDynamicFormButtons.prototype.render = function () { var _this = this; return this.resolvedItems ? this.resolvedItems.map(function (button) { return _this.constructButton(button); }) : ""; }; Object.defineProperty(PwcDynamicFormButtons, "watchers", { get: function () { return { "items": ["onItemsChanged"] }; }, enumerable: true, configurable: true }); Object.defineProperty(PwcDynamicFormButtons, "style", { get: function () { return ""; }, enumerable: true, configurable: true }); return PwcDynamicFormButtons; }()); export { PwcDynamicFormButtons as pwc_dynamic_form_buttons };