@fluid-topics/ft-filter 1.0.36 → 1.0.38
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.js +40 -36
- package/build/ft-filter.js +15 -13
- package/build/ft-filter.light.js +110 -110
- package/build/ft-filter.min.js +96 -96
- package/package.json +10 -10
package/build/ft-filter-level.js
CHANGED
|
@@ -52,48 +52,52 @@ class FtFilterLevel extends FtLitElement {
|
|
|
52
52
|
return html `
|
|
53
53
|
<div class="ft-filter-level--container ${this.disabled ? "ft-filter--disabled" : ""}">
|
|
54
54
|
${this.parent == null ? null : html `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
<div tabindex="0"
|
|
56
|
+
part="controls go-back"
|
|
57
|
+
class="ft-filter-level--go-back"
|
|
58
|
+
?disabled=${this.disabled}
|
|
59
|
+
@keyup=${this.goBackOnKeyPress}
|
|
60
|
+
@click=${this.goBackOnClick}>
|
|
61
|
+
<ft-ripple></ft-ripple>
|
|
62
|
+
<ft-icon>thin_arrow_left</ft-icon>
|
|
63
|
+
<ft-typography variant="body2">${this.parent.label}</ft-typography>
|
|
64
|
+
</div>
|
|
65
|
+
`}
|
|
66
66
|
${this.options.length === 0 && this.noValuesLabel ? html `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
<ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
|
|
68
|
+
${this.noValuesLabel}
|
|
69
|
+
</ft-typography>
|
|
70
|
+
` : nothing}
|
|
71
71
|
${repeat(limitedOptions, option => option.value, option => {
|
|
72
72
|
var _a;
|
|
73
73
|
return html `
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
<div class="ft-filter-level--option" part="options">
|
|
75
|
+
${this.multivalued
|
|
76
|
+
? this.buildMultiValuedOption(option)
|
|
77
|
+
: this.buildMonoValuedOption(option)}
|
|
78
|
+
${this.preventNavigation || option.selected || ((_a = option.subOptions) !== null && _a !== void 0 ? _a : []).length === 0
|
|
79
|
+
? nothing
|
|
80
|
+
: html `
|
|
81
|
+
<ft-button icon="thin_arrow_right"
|
|
82
|
+
part="controls navigate-hierarchy"
|
|
83
|
+
label="${option.label}"
|
|
84
|
+
?disabled=${this.disabled}
|
|
85
|
+
tooltipPosition="left"
|
|
86
|
+
@click=${() => this.displayLevel(option)}></ft-button>
|
|
87
|
+
`}
|
|
88
|
+
</div>
|
|
89
|
+
`;
|
|
86
90
|
})}
|
|
87
91
|
${limitedOptions.length < options.length ? html `
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
<ft-button
|
|
93
|
+
class="ft-filter-level--display-more"
|
|
94
|
+
icon="thin_arrow"
|
|
95
|
+
dense trailingIcon
|
|
96
|
+
part="controls display-more"
|
|
97
|
+
@click=${this.displayMore}>
|
|
98
|
+
${this.moreValuesButtonLabel}
|
|
99
|
+
</ft-button>
|
|
100
|
+
` : nothing}
|
|
97
101
|
</div>
|
|
98
102
|
`;
|
|
99
103
|
}
|
package/build/ft-filter.js
CHANGED
|
@@ -126,22 +126,24 @@ class FtFilter extends FtLitElement {
|
|
|
126
126
|
renderLevels() {
|
|
127
127
|
const allOptions = this.flatOptions;
|
|
128
128
|
const selectedOptions = allOptions.filter(o => o.selected);
|
|
129
|
-
const currentLevelIndex = (this.slideIn || this.slideOut)
|
|
129
|
+
const currentLevelIndex = (this.slideIn || this.slideOut)
|
|
130
|
+
? this.displayedLevels.length - 2
|
|
131
|
+
: this.displayedLevels.length - 1;
|
|
130
132
|
const rootOptionsClass = currentLevelIndex < 0 ? "ft-filter--level-center" : "ft-filter--level-left";
|
|
131
133
|
return html `
|
|
132
134
|
${this.raiseSelectedOptions && selectedOptions.length > 0 ? html `
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
<ft-filter-level
|
|
136
|
+
filterId="${this.id}"
|
|
137
|
+
?multivalued=${this.multivalued}
|
|
138
|
+
?disabled=${this.disabled}
|
|
139
|
+
preventNavigation
|
|
140
|
+
.options=${selectedOptions}
|
|
141
|
+
@change=${this.onChange}
|
|
142
|
+
part="values selected-values"
|
|
143
|
+
.exportpartsPrefixes=${["values", "selected-values"]}
|
|
144
|
+
></ft-filter-level>
|
|
145
|
+
<div class="ft-filter--separator">
|
|
146
|
+
` : null}
|
|
145
147
|
<ft-snap-scroll horizontal hideScrollbar
|
|
146
148
|
class="ft-filter--levels"
|
|
147
149
|
@current-element-change=${(e) => this.levelsScrollDebouncer.run(() => {
|