@fluid-topics/ft-filter 1.2.50 → 1.2.51
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 +7 -4
- package/build/ft-filter.d.ts +1 -0
- package/build/ft-filter.js +11 -1
- package/build/ft-filter.light.js +173 -173
- package/build/ft-filter.min.js +60 -60
- package/package.json +10 -10
|
@@ -23,6 +23,7 @@ export declare class FtFilterLevel extends FtLitElement {
|
|
|
23
23
|
get height(): number;
|
|
24
24
|
focusOnBackButton(): void;
|
|
25
25
|
focusOnExpandButton(value: string): void;
|
|
26
|
+
focusOnFirstOption(): void;
|
|
26
27
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
27
28
|
private goBackOnKeyPress;
|
|
28
29
|
private goBackOnClick;
|
package/build/ft-filter-level.js
CHANGED
|
@@ -44,14 +44,17 @@ class FtFilterLevel extends FtLitElement {
|
|
|
44
44
|
focusOnBackButton() {
|
|
45
45
|
this.elementToFocus = {
|
|
46
46
|
selector: `.ft-filter-level--go-back`,
|
|
47
|
-
isKeyboardNavigation: true,
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
focusOnExpandButton(value) {
|
|
51
50
|
// Find the correct expand button associated with the checkbox value
|
|
52
51
|
this.elementToFocus = {
|
|
53
52
|
selector: `.ft-filter-level--option ft-button[part="controls navigate-hierarchy"][data-value="${value}"]`,
|
|
54
|
-
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
focusOnFirstOption() {
|
|
56
|
+
this.elementToFocus = {
|
|
57
|
+
selector: `.ft-filter-level--option [part~="option"]`,
|
|
55
58
|
};
|
|
56
59
|
}
|
|
57
60
|
render() {
|
|
@@ -131,11 +134,11 @@ class FtFilterLevel extends FtLitElement {
|
|
|
131
134
|
displayMore() {
|
|
132
135
|
var _a;
|
|
133
136
|
const previousLimit = (_a = this.limit) !== null && _a !== void 0 ? _a : 0;
|
|
137
|
+
const hasGoBackButton = this.parent != null;
|
|
134
138
|
this.displayedPages++;
|
|
135
139
|
// Wait for the component update before focusing on the first new option
|
|
136
140
|
this.elementToFocus = {
|
|
137
|
-
selector: `.ft-filter-level--option:nth-child(${previousLimit + 2}) [part~="option"]`,
|
|
138
|
-
isKeyboardNavigation: true,
|
|
141
|
+
selector: `.ft-filter-level--option:nth-child(${previousLimit + (hasGoBackButton ? 2 : 1)}) [part~="option"]`,
|
|
139
142
|
};
|
|
140
143
|
}
|
|
141
144
|
buildMultiValuedOption(option) {
|
package/build/ft-filter.d.ts
CHANGED
package/build/ft-filter.js
CHANGED
|
@@ -68,7 +68,10 @@ class FtFilter extends FtLitElement {
|
|
|
68
68
|
<slot name="label"></slot>
|
|
69
69
|
</div>
|
|
70
70
|
${valuesSelected && !this.hideClearButton ? html `
|
|
71
|
-
<ft-button icon="close" dense @click=${
|
|
71
|
+
<ft-button icon="close" dense @click=${() => {
|
|
72
|
+
this.clear();
|
|
73
|
+
this.focusOnFirstOption();
|
|
74
|
+
}} part="clear-button">
|
|
72
75
|
${this.clearButtonLabel}
|
|
73
76
|
</ft-button>
|
|
74
77
|
` : null}
|
|
@@ -216,6 +219,13 @@ class FtFilter extends FtLitElement {
|
|
|
216
219
|
newLevel === null || newLevel === void 0 ? void 0 : newLevel.focusOnBackButton();
|
|
217
220
|
});
|
|
218
221
|
}
|
|
222
|
+
focusOnFirstOption() {
|
|
223
|
+
waitUntil(() => this.slideOut === undefined).then(() => {
|
|
224
|
+
var _a;
|
|
225
|
+
const firstLevel = (_a = this.levelsContainer) === null || _a === void 0 ? void 0 : _a.querySelector(".ft-filter--level-center");
|
|
226
|
+
firstLevel === null || firstLevel === void 0 ? void 0 : firstLevel.focusOnFirstOption();
|
|
227
|
+
});
|
|
228
|
+
}
|
|
219
229
|
clear() {
|
|
220
230
|
this.flatOptions.forEach(o => o.selected = false);
|
|
221
231
|
if (this.displayedLevels.length > 0) {
|