@paraboly/pwc-multi-filter
Version:
A wrapper over pwc-tabview and pwc-filter. Provides means of dynamically managing multiple filters via a single component.
39 lines (36 loc) • 1.14 kB
JavaScript
import { r as registerInstance, h } from './core-42e50cf3.js';
import './_commonjsHelpers-4ab098b6.js';
import './linq-c2ddb1d7.js';
import { r as resolveJson } from './utils-9d98a97b.js';
const PwcDynamicFormButtons = class {
constructor(hostRef) {
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 = resolveJson(newValue);
}
}
componentWillLoad() {
this.onItemsChanged(this.items);
}
constructButton(button) {
return 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 ""; }
};
export { PwcDynamicFormButtons as pwc_dynamic_form_buttons };