@fluid-topics/ft-filter 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/build/ft-filter-level.d.ts +32 -0
- package/build/ft-filter-level.js +288 -0
- package/build/ft-filter-option.d.ts +17 -0
- package/build/ft-filter-option.js +48 -0
- package/build/ft-filter.d.ts +62 -0
- package/build/ft-filter.js +398 -0
- package/build/ft-filter.min.js +487 -0
- package/build/utils.d.ts +2 -0
- package/build/utils.js +4 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Flat selector for multivalued or monovalued filters
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
npm install @fluid-topics/ft-filter
|
|
7
|
+
yarn add @fluid-topics/ft-filter
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import { html } from "lit"
|
|
14
|
+
import "@fluid-topics/ft-filter"
|
|
15
|
+
|
|
16
|
+
function render() {
|
|
17
|
+
return html`
|
|
18
|
+
<ft-filter
|
|
19
|
+
label="Filter"
|
|
20
|
+
@change=${ (e) => console.log("Selected options:", e.detail) }
|
|
21
|
+
>
|
|
22
|
+
<ft-filter-option value="1" label="Option 1"></ft-filter-option>
|
|
23
|
+
<ft-filter-option value="2" label="Option 2" selected></ft-filter-option>
|
|
24
|
+
<ft-filter-option value="3" label="Option 3"></ft-filter-option>
|
|
25
|
+
<ft-filter-option value="4" label="Option 4"></ft-filter-option>
|
|
26
|
+
</ft-filter>
|
|
27
|
+
`
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { FtFilterOptionProperties } from "./ft-filter-option";
|
|
3
|
+
export declare class FtFilterLevel extends FtLitElement {
|
|
4
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
5
|
+
protected getStyles(): import("lit").CSSResult[];
|
|
6
|
+
id: string;
|
|
7
|
+
parent?: FtFilterOptionProperties;
|
|
8
|
+
options: Array<FtFilterOptionProperties>;
|
|
9
|
+
multivalued: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
hideSelectedOptions: boolean;
|
|
12
|
+
preventNavigation: boolean;
|
|
13
|
+
private filter;
|
|
14
|
+
private moreValuesButtonLabel;
|
|
15
|
+
displayedValuesLimit: number;
|
|
16
|
+
private container?;
|
|
17
|
+
private displayedPages;
|
|
18
|
+
get hasHiddenValues(): boolean;
|
|
19
|
+
private get limit();
|
|
20
|
+
get height(): number;
|
|
21
|
+
protected getTemplate(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
private goBackOnKeyPress;
|
|
23
|
+
private goBackOnClick;
|
|
24
|
+
private displayMore;
|
|
25
|
+
private buildMultiValuedOption;
|
|
26
|
+
private toggleMultiValuedOption;
|
|
27
|
+
private buildMonoValuedOption;
|
|
28
|
+
private toggleMonoValuedOption;
|
|
29
|
+
private optionsChanged;
|
|
30
|
+
private displayLevel;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ft-filter-level.d.ts.map
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html, nothing } from "lit";
|
|
8
|
+
import { property, query, state } from "lit/decorators.js";
|
|
9
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
10
|
+
import { customElement, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
11
|
+
import { Checkbox } from "@material/mwc-checkbox";
|
|
12
|
+
import { flatDeep } from "./utils";
|
|
13
|
+
import { FtButton } from "@fluid-topics/ft-button";
|
|
14
|
+
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
15
|
+
import { Formfield } from "@material/mwc-formfield";
|
|
16
|
+
import { Radio } from "@material/mwc-radio";
|
|
17
|
+
import { Icon } from "@material/mwc-icon";
|
|
18
|
+
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
19
|
+
let FtFilterLevel = class FtFilterLevel extends FtLitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.id = "";
|
|
23
|
+
this.options = [];
|
|
24
|
+
this.multivalued = false;
|
|
25
|
+
this.disabled = false;
|
|
26
|
+
this.hideSelectedOptions = false;
|
|
27
|
+
this.preventNavigation = false;
|
|
28
|
+
this.filter = "";
|
|
29
|
+
this.moreValuesButtonLabel = "More";
|
|
30
|
+
this.displayedValuesLimit = 0;
|
|
31
|
+
this.displayedPages = 1;
|
|
32
|
+
}
|
|
33
|
+
// language=CSS
|
|
34
|
+
getStyles() {
|
|
35
|
+
return [
|
|
36
|
+
css `
|
|
37
|
+
.ft-filter-level--container {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ft-filter-level--container > * {
|
|
43
|
+
padding: 0 10px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ft-filter-level--go-back {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
position: relative;
|
|
50
|
+
border-radius: var(--ft-border-radius-M, 8px);
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
padding: 4px 4px;
|
|
55
|
+
gap: 4px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
color: var(--ft-color-on-surface, rgba(0, 0, 0, 0.87));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ft-filter-level--go-back:focus {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ft-filter-level--go-back mwc-icon {
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ft-filter-level--go-back ft-typography {
|
|
69
|
+
display: block;
|
|
70
|
+
flex-grow: 1;
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ft-filter-level--option {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ft-filter-level--option ft-button {
|
|
81
|
+
margin-right: -10px;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ft-button {
|
|
86
|
+
--ft-color-primary: var(--ft-color-on-surface, rgba(0, 0, 0, 0.87));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
mwc-formfield {
|
|
90
|
+
flex-shrink: 1;
|
|
91
|
+
flex-grow: 1;
|
|
92
|
+
display: block;
|
|
93
|
+
max-width: calc(100% + 10px);
|
|
94
|
+
margin-left: -10px;
|
|
95
|
+
word-break: break-word;
|
|
96
|
+
|
|
97
|
+
--mdc-theme-secondary: var(--ft-color-primary, #2196F3);
|
|
98
|
+
|
|
99
|
+
--mdc-radio-unchecked-color: var(--ft-color-on-surface-medium, rgba(0, 0, 0, 0.60));
|
|
100
|
+
--mdc-checkbox-unchecked-color: var(--ft-color-on-surface-medium, rgba(0, 0, 0, 0.60));
|
|
101
|
+
--mdc-checkbox-ink-color: var(--ft-color-on-primary, #FFFFFF);
|
|
102
|
+
|
|
103
|
+
--mdc-radio-disabled-color: var(--ft-color-on-surface-disabled, rgba(0, 0, 0, 0.38));
|
|
104
|
+
--mdc-checkbox-disabled-color: var(--ft-color-on-surface-disabled, rgba(0, 0, 0, 0.38));
|
|
105
|
+
|
|
106
|
+
--mdc-theme-on-surface: var(--ft-color-primary, #2196F3);
|
|
107
|
+
|
|
108
|
+
--mdc-typography-body2-font-family: var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans')), system-ui, sans-serif;
|
|
109
|
+
--mdc-typography-body2-font-size: var(--ft-typography-font-size, 14px);
|
|
110
|
+
--mdc-typography-body2-font-weight: var(--ft-typography-font-weight, normal);
|
|
111
|
+
--mdc-typography-body2-letter-spacing: var(--ft-typography-letter-spacing, 0.252px);
|
|
112
|
+
--mdc-typography-body2-line-height: var(--ft-typography-line-height, 20px);
|
|
113
|
+
--mdc-typography-body2-text-transform: var(--ft-typography-text-transform, inherit);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ft-filter--disabled {
|
|
117
|
+
--mdc-theme-text-primary-on-background: var(--ft-color-on-surface-disabled, rgba(0, 0, 0, 0.38));
|
|
118
|
+
}
|
|
119
|
+
`
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
get hasHiddenValues() {
|
|
123
|
+
let limit = this.limit;
|
|
124
|
+
return limit != null && limit < this.options.length;
|
|
125
|
+
}
|
|
126
|
+
get limit() {
|
|
127
|
+
return this.displayedValuesLimit > 0 ? this.displayedPages * this.displayedValuesLimit : undefined;
|
|
128
|
+
}
|
|
129
|
+
get height() {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
return (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0;
|
|
132
|
+
}
|
|
133
|
+
getTemplate() {
|
|
134
|
+
let options = this.options;
|
|
135
|
+
if (this.hideSelectedOptions) {
|
|
136
|
+
options = options.filter(o => !o.selected);
|
|
137
|
+
}
|
|
138
|
+
if (this.filter) {
|
|
139
|
+
options = options.filter(o => o.label.toLowerCase().includes(this.filter.toLowerCase()));
|
|
140
|
+
}
|
|
141
|
+
const limitedOptions = options.slice(0, this.limit);
|
|
142
|
+
return html `
|
|
143
|
+
<div class="ft-filter-level--container ${this.disabled ? "ft-filter--disabled" : ""}">
|
|
144
|
+
${this.parent == null ? null : html `
|
|
145
|
+
<div tabindex="0"
|
|
146
|
+
class="ft-filter-level--go-back"
|
|
147
|
+
?disabled=${this.disabled}
|
|
148
|
+
@keyup=${this.goBackOnKeyPress}
|
|
149
|
+
@click=${this.goBackOnClick}>
|
|
150
|
+
<ft-ripple></ft-ripple>
|
|
151
|
+
<mwc-icon>chevron_left</mwc-icon>
|
|
152
|
+
<ft-typography variant="body2">${this.parent.label}</ft-typography>
|
|
153
|
+
</div>
|
|
154
|
+
`}
|
|
155
|
+
${repeat(limitedOptions, option => option.value, option => {
|
|
156
|
+
var _a;
|
|
157
|
+
return html `
|
|
158
|
+
<div class="ft-filter-level--option" part="options">
|
|
159
|
+
${this.multivalued ? this.buildMultiValuedOption(option) : this.buildMonoValuedOption(option)}
|
|
160
|
+
${this.preventNavigation || option.selected || ((_a = option.subOptions) !== null && _a !== void 0 ? _a : []).length === 0 ? nothing : html `
|
|
161
|
+
<ft-button icon="chevron_right"
|
|
162
|
+
label="${option.label}"
|
|
163
|
+
?disabled=${this.disabled}
|
|
164
|
+
tooltipPosition="left"
|
|
165
|
+
@click=${() => this.displayLevel(option)}></ft-button>
|
|
166
|
+
`}
|
|
167
|
+
</div>
|
|
168
|
+
`;
|
|
169
|
+
})}
|
|
170
|
+
${limitedOptions.length < options.length ? html `
|
|
171
|
+
<ft-button
|
|
172
|
+
class="ft-filter-level--display-more"
|
|
173
|
+
icon="expand_more"
|
|
174
|
+
dense trailingIcon
|
|
175
|
+
@click=${this.displayMore}>
|
|
176
|
+
${this.moreValuesButtonLabel}
|
|
177
|
+
</ft-button>
|
|
178
|
+
` : nothing}
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
goBackOnKeyPress(e) {
|
|
183
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
184
|
+
this.dispatchEvent(new CustomEvent("go-back", { detail: this.parent }));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
goBackOnClick(e) {
|
|
188
|
+
e.stopPropagation();
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
this.dispatchEvent(new CustomEvent("go-back", { detail: this.parent }));
|
|
191
|
+
}
|
|
192
|
+
displayMore() {
|
|
193
|
+
this.displayedPages++;
|
|
194
|
+
}
|
|
195
|
+
buildMultiValuedOption(option) {
|
|
196
|
+
var _a;
|
|
197
|
+
return html `
|
|
198
|
+
<mwc-formfield label="${option.label}">
|
|
199
|
+
<mwc-checkbox
|
|
200
|
+
reducedTouchTarget
|
|
201
|
+
?checked=${option.selected}
|
|
202
|
+
?disabled=${this.disabled}
|
|
203
|
+
?indeterminate=${flatDeep((_a = option.subOptions) !== null && _a !== void 0 ? _a : [], o => { var _a; return (_a = o.subOptions) !== null && _a !== void 0 ? _a : []; }).some(o => o.selected)}
|
|
204
|
+
@change=${(e) => this.toggleMultiValuedOption(e, option)}
|
|
205
|
+
></mwc-checkbox>
|
|
206
|
+
</mwc-formfield>
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
toggleMultiValuedOption(e, option) {
|
|
210
|
+
var _a;
|
|
211
|
+
flatDeep((_a = option.subOptions) !== null && _a !== void 0 ? _a : [], o => { var _a; return (_a = o.subOptions) !== null && _a !== void 0 ? _a : []; }).forEach(o => o.selected = false);
|
|
212
|
+
this.optionsChanged(e, option);
|
|
213
|
+
}
|
|
214
|
+
buildMonoValuedOption(option) {
|
|
215
|
+
return html `
|
|
216
|
+
<mwc-formfield label="${option.label}">
|
|
217
|
+
<mwc-radio
|
|
218
|
+
reducedTouchTarget
|
|
219
|
+
name="${this.id}"
|
|
220
|
+
?checked=${option.selected}
|
|
221
|
+
?disabled=${this.disabled}
|
|
222
|
+
@click=${(e) => this.toggleMonoValuedOption(e, option)}
|
|
223
|
+
></mwc-radio>
|
|
224
|
+
</mwc-formfield>
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
toggleMonoValuedOption(e, option) {
|
|
228
|
+
this.optionsChanged(e, option);
|
|
229
|
+
}
|
|
230
|
+
optionsChanged(e, option) {
|
|
231
|
+
e.stopPropagation();
|
|
232
|
+
option.selected = !option.selected;
|
|
233
|
+
this.dispatchEvent(new CustomEvent("change", { detail: option }));
|
|
234
|
+
}
|
|
235
|
+
displayLevel(option) {
|
|
236
|
+
this.dispatchEvent(new CustomEvent("display-level", { detail: option }));
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
FtFilterLevel.elementDefinitions = {
|
|
240
|
+
"ft-button": FtButton,
|
|
241
|
+
"ft-ripple": FtRipple,
|
|
242
|
+
"ft-typography": FtTypography,
|
|
243
|
+
"mwc-checkbox": Checkbox,
|
|
244
|
+
"mwc-formfield": Formfield,
|
|
245
|
+
"mwc-icon": Icon,
|
|
246
|
+
"mwc-radio": Radio,
|
|
247
|
+
};
|
|
248
|
+
__decorate([
|
|
249
|
+
property({ type: String })
|
|
250
|
+
], FtFilterLevel.prototype, "id", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
property({ type: Object })
|
|
253
|
+
], FtFilterLevel.prototype, "parent", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
property({ type: Array })
|
|
256
|
+
], FtFilterLevel.prototype, "options", void 0);
|
|
257
|
+
__decorate([
|
|
258
|
+
property({ type: Boolean })
|
|
259
|
+
], FtFilterLevel.prototype, "multivalued", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
property({ type: Boolean })
|
|
262
|
+
], FtFilterLevel.prototype, "disabled", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
property({ type: Boolean })
|
|
265
|
+
], FtFilterLevel.prototype, "hideSelectedOptions", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
property({ type: Boolean })
|
|
268
|
+
], FtFilterLevel.prototype, "preventNavigation", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
property({ type: String })
|
|
271
|
+
], FtFilterLevel.prototype, "filter", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
property({ type: String })
|
|
274
|
+
], FtFilterLevel.prototype, "moreValuesButtonLabel", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property({ type: Number })
|
|
277
|
+
], FtFilterLevel.prototype, "displayedValuesLimit", void 0);
|
|
278
|
+
__decorate([
|
|
279
|
+
query(".ft-filter-level--container")
|
|
280
|
+
], FtFilterLevel.prototype, "container", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
state()
|
|
283
|
+
], FtFilterLevel.prototype, "displayedPages", void 0);
|
|
284
|
+
FtFilterLevel = __decorate([
|
|
285
|
+
customElement("ft-filter-level")
|
|
286
|
+
], FtFilterLevel);
|
|
287
|
+
export { FtFilterLevel };
|
|
288
|
+
//# sourceMappingURL=ft-filter-level.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
export interface FtFilterOptionProperties {
|
|
3
|
+
label: string;
|
|
4
|
+
value: any;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
subOptions?: Array<FtFilterOptionProperties>;
|
|
7
|
+
}
|
|
8
|
+
export declare class FtFilterOption extends FtLitElement implements FtFilterOptionProperties {
|
|
9
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
10
|
+
label: string;
|
|
11
|
+
value: any;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
subOptions: Array<FtFilterOptionProperties>;
|
|
14
|
+
protected getTemplate(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
private updateSubOptionsFromSlot;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ft-filter-option.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
8
|
+
import { property } from "lit/decorators.js";
|
|
9
|
+
import { html } from "lit";
|
|
10
|
+
let FtFilterOption = class FtFilterOption extends FtLitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.label = "";
|
|
14
|
+
this.value = null;
|
|
15
|
+
this.selected = false;
|
|
16
|
+
this.subOptions = [];
|
|
17
|
+
}
|
|
18
|
+
getTemplate() {
|
|
19
|
+
return html `
|
|
20
|
+
<slot @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
updateSubOptionsFromSlot(e) {
|
|
24
|
+
const slot = e.composedPath()[0];
|
|
25
|
+
this.subOptions = slot.assignedElements().map(n => n);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
FtFilterOption.elementDefinitions = {};
|
|
29
|
+
__decorate([
|
|
30
|
+
property({ type: String })
|
|
31
|
+
], FtFilterOption.prototype, "label", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
property({
|
|
34
|
+
type: Object,
|
|
35
|
+
converter: value => value
|
|
36
|
+
})
|
|
37
|
+
], FtFilterOption.prototype, "value", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ type: Boolean, reflect: true })
|
|
40
|
+
], FtFilterOption.prototype, "selected", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ type: Object })
|
|
43
|
+
], FtFilterOption.prototype, "subOptions", void 0);
|
|
44
|
+
FtFilterOption = __decorate([
|
|
45
|
+
customElement("ft-filter-option")
|
|
46
|
+
], FtFilterOption);
|
|
47
|
+
export { FtFilterOption };
|
|
48
|
+
//# sourceMappingURL=ft-filter-option.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropertyValues } from "lit";
|
|
2
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtFilterOptionProperties } from "./ft-filter-option";
|
|
4
|
+
export * from "./ft-filter-option";
|
|
5
|
+
export interface FtFilterProperties {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
filterPlaceHolder?: string;
|
|
9
|
+
clearButtonLabel?: string;
|
|
10
|
+
moreValuesButtonLabel?: string;
|
|
11
|
+
options: Array<FtFilterOptionProperties>;
|
|
12
|
+
multivalued?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
raiseSelectedOptions?: boolean;
|
|
15
|
+
displayedValuesLimit?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface FtFilterCssVariables {
|
|
18
|
+
}
|
|
19
|
+
export declare class FtFilterChangeEvent extends CustomEvent<Array<any>> {
|
|
20
|
+
constructor(selectedValues: any[]);
|
|
21
|
+
}
|
|
22
|
+
export declare class FtFilter extends FtLitElement implements FtFilterProperties {
|
|
23
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
24
|
+
protected getStyles(): import("lit").CSSResult[];
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
filterPlaceHolder: string;
|
|
28
|
+
clearButtonLabel: string;
|
|
29
|
+
moreValuesButtonLabel: string;
|
|
30
|
+
options: Array<FtFilterOptionProperties>;
|
|
31
|
+
multivalued: boolean;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
raiseSelectedOptions: boolean;
|
|
34
|
+
displayedValuesLimit: number;
|
|
35
|
+
private container?;
|
|
36
|
+
private valuesContainer?;
|
|
37
|
+
private levelsContainer?;
|
|
38
|
+
private lastLevel?;
|
|
39
|
+
private levels?;
|
|
40
|
+
private withScroll;
|
|
41
|
+
private filter;
|
|
42
|
+
private displayedLevels;
|
|
43
|
+
private slideIn?;
|
|
44
|
+
private slideOut?;
|
|
45
|
+
private scrollResizeObserver;
|
|
46
|
+
private get flatOptions();
|
|
47
|
+
protected getTemplate(): import("lit-html").TemplateResult<1>;
|
|
48
|
+
protected update(props: PropertyValues): void;
|
|
49
|
+
protected contentAvailableCallback(props: PropertyValues): void;
|
|
50
|
+
private levelsScrollDebouncer;
|
|
51
|
+
private renderLevels;
|
|
52
|
+
private renderLevel;
|
|
53
|
+
private goBack;
|
|
54
|
+
private onDisplayLevel;
|
|
55
|
+
private clear;
|
|
56
|
+
private onChange;
|
|
57
|
+
private optionsChanged;
|
|
58
|
+
private updateOptionsFromSlot;
|
|
59
|
+
private onFilterChange;
|
|
60
|
+
private updateScroll;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=ft-filter.d.ts.map
|