@paraboly/pwc-multi-filter
Version:
A wrapper over pwc-tabview and pwc-filter. Provides means of dynamically managing multiple filters via a single component.
36 lines (33 loc) • 1.34 kB
JavaScript
import { r as registerInstance, c as createEvent, d as getElement } from './core-ba89e169.js';
const PwcTabviewHandle = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.defaultActive = false;
this.active = this.defaultActive;
this.handleClicked = createEvent(this, "handleClicked", 7);
}
activeWatchHandler(newValue) {
if (newValue === null || newValue === undefined) {
this.active = this.defaultActive;
}
}
clickEventHandler(event) {
this.handleClicked.emit({
originalEvent: event,
handle: this.root,
title: this.title
});
}
componentWillRender() {
this.activeWatchHandler(this.active);
}
render() {
return this.title;
}
get root() { return getElement(this); }
static get watchers() { return {
"active": ["activeWatchHandler"]
}; }
static get style() { return "pwc-tabview-handle {\n display: block;\n border: 1px solid black;\n padding: 10px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-color: #ddd;\n}\n\npwc-tabview-handle[active] {\n background-color: #fff;\n}"; }
};
export { PwcTabviewHandle as pwc_tabview_handle };