@fluid-topics/ft-filter 0.2.16 → 0.2.19
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/build/ft-filter-level.d.ts +1 -0
- package/build/ft-filter-level.js +18 -0
- package/build/ft-filter.d.ts +2 -0
- package/build/ft-filter.js +14 -4
- package/build/ft-filter.light.js +69 -49
- package/build/ft-filter.min.js +239 -220
- package/package.json +10 -10
- package/build/ft-filter.inline-styles.js +0 -1306
- package/build/inline-styles.d.ts +0 -2
- package/build/inline-styles.js +0 -6
package/build/ft-filter-level.js
CHANGED
|
@@ -68,6 +68,7 @@ export class FtFilterLevel extends FtLitElement {
|
|
|
68
68
|
<div class="ft-filter-level--container ${this.disabled ? "ft-filter--disabled" : ""}">
|
|
69
69
|
${this.parent == null ? null : html `
|
|
70
70
|
<div tabindex="0"
|
|
71
|
+
part="controls go-back"
|
|
71
72
|
class="ft-filter-level--go-back"
|
|
72
73
|
?disabled=${this.disabled}
|
|
73
74
|
@keyup=${this.goBackOnKeyPress}
|
|
@@ -77,6 +78,11 @@ export class FtFilterLevel extends FtLitElement {
|
|
|
77
78
|
<ft-typography variant="body2">${this.parent.label}</ft-typography>
|
|
78
79
|
</div>
|
|
79
80
|
`}
|
|
81
|
+
${this.options.length === 0 && this.noValuesLabel ? html `
|
|
82
|
+
<ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
|
|
83
|
+
${this.noValuesLabel}
|
|
84
|
+
</ft-typography>
|
|
85
|
+
` : nothing}
|
|
80
86
|
${repeat(limitedOptions, option => option.value, option => {
|
|
81
87
|
var _a;
|
|
82
88
|
return html `
|
|
@@ -84,6 +90,7 @@ export class FtFilterLevel extends FtLitElement {
|
|
|
84
90
|
${this.multivalued ? this.buildMultiValuedOption(option) : this.buildMonoValuedOption(option)}
|
|
85
91
|
${this.preventNavigation || option.selected || ((_a = option.subOptions) !== null && _a !== void 0 ? _a : []).length === 0 ? nothing : html `
|
|
86
92
|
<ft-button icon="chevron_right"
|
|
93
|
+
part="controls navigate-hierarchy"
|
|
87
94
|
label="${option.label}"
|
|
88
95
|
?disabled=${this.disabled}
|
|
89
96
|
tooltipPosition="left"
|
|
@@ -97,6 +104,7 @@ export class FtFilterLevel extends FtLitElement {
|
|
|
97
104
|
class="ft-filter-level--display-more"
|
|
98
105
|
icon="expand_more"
|
|
99
106
|
dense trailingIcon
|
|
107
|
+
part="controls display-more"
|
|
100
108
|
@click=${this.displayMore}>
|
|
101
109
|
${this.moreValuesButtonLabel}
|
|
102
110
|
</ft-button>
|
|
@@ -121,6 +129,7 @@ export class FtFilterLevel extends FtLitElement {
|
|
|
121
129
|
var _a;
|
|
122
130
|
return html `
|
|
123
131
|
<ft-checkbox name="${this.id}"
|
|
132
|
+
part="multivalued-option"
|
|
124
133
|
.checked=${option.selected}
|
|
125
134
|
.disabled=${this.disabled}
|
|
126
135
|
.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)}
|
|
@@ -132,6 +141,7 @@ export class FtFilterLevel extends FtLitElement {
|
|
|
132
141
|
buildMonoValuedOption(option) {
|
|
133
142
|
return html `
|
|
134
143
|
<ft-radio name="${this.id + Math.round(Math.random() * 1000000)}"
|
|
144
|
+
part="monovalued-option"
|
|
135
145
|
.checked=${option.selected}
|
|
136
146
|
?disabled=${this.disabled}
|
|
137
147
|
@click=${(e) => this.optionsChanged(e, option)}
|
|
@@ -226,6 +236,11 @@ FtFilterLevel.styles = [
|
|
|
226
236
|
margin-left: -10px;
|
|
227
237
|
word-break: break-word;
|
|
228
238
|
}
|
|
239
|
+
|
|
240
|
+
.ft-filter-level--no-values {
|
|
241
|
+
margin: 10px 0;
|
|
242
|
+
color: ${FtFilterLevelCssVariables.colorOnSurfaceMedium};
|
|
243
|
+
}
|
|
229
244
|
`
|
|
230
245
|
];
|
|
231
246
|
__decorate([
|
|
@@ -255,6 +270,9 @@ __decorate([
|
|
|
255
270
|
__decorate([
|
|
256
271
|
property({ type: String })
|
|
257
272
|
], FtFilterLevel.prototype, "moreValuesButtonLabel", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
property({ type: String })
|
|
275
|
+
], FtFilterLevel.prototype, "noValuesLabel", void 0);
|
|
258
276
|
__decorate([
|
|
259
277
|
property({ type: Number })
|
|
260
278
|
], FtFilterLevel.prototype, "displayedValuesLimit", void 0);
|
package/build/ft-filter.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface FtFilterProperties {
|
|
|
7
7
|
filterPlaceHolder?: string;
|
|
8
8
|
clearButtonLabel?: string;
|
|
9
9
|
moreValuesButtonLabel?: string;
|
|
10
|
+
noValuesLabel?: string;
|
|
10
11
|
options: Array<FtFilterOptionProperties>;
|
|
11
12
|
multivalued?: boolean;
|
|
12
13
|
disabled?: boolean;
|
|
@@ -33,6 +34,7 @@ export declare class FtFilter extends FtLitElement implements FtFilterProperties
|
|
|
33
34
|
filterPlaceHolder: string;
|
|
34
35
|
clearButtonLabel: string;
|
|
35
36
|
moreValuesButtonLabel: string;
|
|
37
|
+
noValuesLabel: string;
|
|
36
38
|
options: Array<FtFilterOptionProperties>;
|
|
37
39
|
multivalued: boolean;
|
|
38
40
|
disabled: boolean;
|
package/build/ft-filter.js
CHANGED
|
@@ -34,6 +34,7 @@ export class FtFilter extends FtLitElement {
|
|
|
34
34
|
this.filterPlaceHolder = "Filter {0}";
|
|
35
35
|
this.clearButtonLabel = "Clear";
|
|
36
36
|
this.moreValuesButtonLabel = "More";
|
|
37
|
+
this.noValuesLabel = "No values available";
|
|
37
38
|
this.options = [];
|
|
38
39
|
this.multivalued = false;
|
|
39
40
|
this.disabled = false;
|
|
@@ -134,7 +135,8 @@ export class FtFilter extends FtLitElement {
|
|
|
134
135
|
preventNavigation
|
|
135
136
|
.options=${selectedOptions}
|
|
136
137
|
@change=${this.onChange}
|
|
137
|
-
part="selected-values"
|
|
138
|
+
part="values selected-values"
|
|
139
|
+
.exportpartsPrefixes=${["values", "selected-values"]}
|
|
138
140
|
></ft-filter-level>
|
|
139
141
|
<div class="ft-filter--separator">
|
|
140
142
|
` : null}
|
|
@@ -177,7 +179,9 @@ export class FtFilter extends FtLitElement {
|
|
|
177
179
|
@change=${this.onChange}
|
|
178
180
|
@go-back=${this.goBack}
|
|
179
181
|
@display-level=${this.onDisplayLevel}
|
|
180
|
-
part="values"
|
|
182
|
+
part="values available-values"
|
|
183
|
+
.exportpartsPrefixes=${["values", "available-values"]}
|
|
184
|
+
noValuesLabel="${this.noValuesLabel}"
|
|
181
185
|
></ft-filter-level>
|
|
182
186
|
`;
|
|
183
187
|
}
|
|
@@ -264,7 +268,6 @@ FtFilter.styles = [
|
|
|
264
268
|
max-height: 100%;
|
|
265
269
|
max-width: 100%;
|
|
266
270
|
color: ${FtFilterCssVariables.colorOnSurface};
|
|
267
|
-
background: ${FtFilterCssVariables.colorSurface};
|
|
268
271
|
}
|
|
269
272
|
|
|
270
273
|
.ft-filter--header {
|
|
@@ -317,10 +320,14 @@ FtFilter.styles = [
|
|
|
317
320
|
border: 1px solid ${FtFilterCssVariables.colorOutline};
|
|
318
321
|
padding: 4px;
|
|
319
322
|
background-color: ${FtFilterCssVariables.colorSurface};
|
|
320
|
-
color: ${FtFilterCssVariables.
|
|
323
|
+
color: ${FtFilterCssVariables.colorOnSurface};
|
|
321
324
|
outline-color: ${FtFilterCssVariables.colorPrimary};
|
|
322
325
|
}
|
|
323
326
|
|
|
327
|
+
input::placeholder {
|
|
328
|
+
color: ${FtFilterCssVariables.colorOnSurfaceMedium};
|
|
329
|
+
}
|
|
330
|
+
|
|
324
331
|
.ft-filter--values {
|
|
325
332
|
flex-grow: 1;
|
|
326
333
|
flex-shrink: 1;
|
|
@@ -372,6 +379,9 @@ __decorate([
|
|
|
372
379
|
__decorate([
|
|
373
380
|
property({ type: String })
|
|
374
381
|
], FtFilter.prototype, "moreValuesButtonLabel", void 0);
|
|
382
|
+
__decorate([
|
|
383
|
+
property({ type: String })
|
|
384
|
+
], FtFilter.prototype, "noValuesLabel", void 0);
|
|
375
385
|
__decorate([
|
|
376
386
|
jsonProperty([])
|
|
377
387
|
], FtFilter.prototype, "options", void 0);
|