@fluid-topics/ft-search-bar 1.2.59 → 1.2.60
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-search-bar.light.js +41 -38
- package/build/ft-search-bar.min.js +101 -98
- package/build/managers/DesktopSearchBarManager.d.ts +0 -1
- package/build/managers/DesktopSearchBarManager.js +5 -9
- package/build/managers/MobileSearchBarManager.d.ts +1 -1
- package/build/managers/MobileSearchBarManager.js +2 -2
- package/build/managers/SuggestManager.js +2 -2
- package/package.json +15 -15
|
@@ -31,8 +31,7 @@ class DesktopSearchBarManager {
|
|
|
31
31
|
placeholder="${this.searchBar.labelResolver.resolve("inputPlaceHolder")}"
|
|
32
32
|
value="${this.searchBar.query}"
|
|
33
33
|
@input=${(e) => this.onInput(e)}
|
|
34
|
-
@keydown=${(e) => this.onSearchBarKeyDown(e)}
|
|
35
|
-
@keyup=${(e) => this.onSearchBarKeyUp(e)}>
|
|
34
|
+
@keydown=${(e) => this.onSearchBarKeyDown(e)}>
|
|
36
35
|
</div>
|
|
37
36
|
${this.suggestManager.render()}
|
|
38
37
|
</div>
|
|
@@ -117,7 +116,7 @@ class DesktopSearchBarManager {
|
|
|
117
116
|
`;
|
|
118
117
|
}
|
|
119
118
|
onSearchBarKeyDown(e) {
|
|
120
|
-
var _a;
|
|
119
|
+
var _a, _b;
|
|
121
120
|
switch (e.key) {
|
|
122
121
|
case "Escape":
|
|
123
122
|
this.searchBar.mobileMenuOpen = false;
|
|
@@ -128,12 +127,9 @@ class DesktopSearchBarManager {
|
|
|
128
127
|
e.preventDefault();
|
|
129
128
|
this.suggestManager.focusFirstSuggestion();
|
|
130
129
|
break;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var _a;
|
|
135
|
-
if (e.key === "Enter") {
|
|
136
|
-
(_a = this.searchBar.launchSearchButton) === null || _a === void 0 ? void 0 : _a.click();
|
|
130
|
+
case "Enter":
|
|
131
|
+
(_b = this.searchBar.launchSearchButton) === null || _b === void 0 ? void 0 : _b.click();
|
|
132
|
+
break;
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
135
|
onInput(e) {
|
|
@@ -26,7 +26,7 @@ class MobileSearchBarManager {
|
|
|
26
26
|
placeholder="${this.searchBar.labelResolver.resolve("inputPlaceHolder")}"
|
|
27
27
|
value="${this.searchBar.query}"
|
|
28
28
|
@input=${(e) => this.onInput(e)}
|
|
29
|
-
@
|
|
29
|
+
@keydown=${(e) => this.onSearchBarKeyDown(e)}
|
|
30
30
|
@focus=${() => {
|
|
31
31
|
this.searchBar.mobileMenuOpen = true;
|
|
32
32
|
this.searchBar.displayFacets = false;
|
|
@@ -89,7 +89,7 @@ class MobileSearchBarManager {
|
|
|
89
89
|
</div>
|
|
90
90
|
`;
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
onSearchBarKeyDown(e) {
|
|
93
93
|
var _a;
|
|
94
94
|
if (e.key === "Enter") {
|
|
95
95
|
(_a = this.searchBar.launchSearchButton) === null || _a === void 0 ? void 0 : _a.click();
|
|
@@ -102,8 +102,8 @@ class SuggestManager {
|
|
|
102
102
|
var _a, _b, _c, _d;
|
|
103
103
|
e.preventDefault();
|
|
104
104
|
e.stopPropagation();
|
|
105
|
-
let
|
|
106
|
-
const thingToFocus = (_d = (_b = (_a =
|
|
105
|
+
let currentFocusElement = e.target.closest("[part='suggestion-container']");
|
|
106
|
+
const thingToFocus = (_d = (_b = (_a = currentFocusElement === null || currentFocusElement === void 0 ? void 0 : currentFocusElement.previousElementSibling) === null || _a === void 0 ? void 0 : _a.querySelector("[part='remove-suggestion']")) !== null && _b !== void 0 ? _b : (_c = currentFocusElement === null || currentFocusElement === void 0 ? void 0 : currentFocusElement.nextElementSibling) === null || _c === void 0 ? void 0 : _c.querySelector("[part='remove-suggestion']")) !== null && _d !== void 0 ? _d : this.searchBar.input;
|
|
107
107
|
thingToFocus === null || thingToFocus === void 0 ? void 0 : thingToFocus.focus();
|
|
108
108
|
this.searchBar.recentSearches = this.searchBar.recentSearches.filter(q => q.toLowerCase() !== query.toLowerCase());
|
|
109
109
|
this.searchBar.saveRecentSearches();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-bar",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.60",
|
|
4
4
|
"description": "Search bar component using Fluid Topics public API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-accordion": "1.2.
|
|
23
|
-
"@fluid-topics/ft-app-context": "1.2.
|
|
24
|
-
"@fluid-topics/ft-button": "1.2.
|
|
25
|
-
"@fluid-topics/ft-chip": "1.2.
|
|
26
|
-
"@fluid-topics/ft-filter": "1.2.
|
|
27
|
-
"@fluid-topics/ft-icon": "1.2.
|
|
28
|
-
"@fluid-topics/ft-select": "1.2.
|
|
29
|
-
"@fluid-topics/ft-size-watcher": "1.2.
|
|
30
|
-
"@fluid-topics/ft-skeleton": "1.2.
|
|
31
|
-
"@fluid-topics/ft-snap-scroll": "1.2.
|
|
32
|
-
"@fluid-topics/ft-tooltip": "1.2.
|
|
33
|
-
"@fluid-topics/ft-typography": "1.2.
|
|
34
|
-
"@fluid-topics/ft-wc-utils": "1.2.
|
|
22
|
+
"@fluid-topics/ft-accordion": "1.2.60",
|
|
23
|
+
"@fluid-topics/ft-app-context": "1.2.60",
|
|
24
|
+
"@fluid-topics/ft-button": "1.2.60",
|
|
25
|
+
"@fluid-topics/ft-chip": "1.2.60",
|
|
26
|
+
"@fluid-topics/ft-filter": "1.2.60",
|
|
27
|
+
"@fluid-topics/ft-icon": "1.2.60",
|
|
28
|
+
"@fluid-topics/ft-select": "1.2.60",
|
|
29
|
+
"@fluid-topics/ft-size-watcher": "1.2.60",
|
|
30
|
+
"@fluid-topics/ft-skeleton": "1.2.60",
|
|
31
|
+
"@fluid-topics/ft-snap-scroll": "1.2.60",
|
|
32
|
+
"@fluid-topics/ft-tooltip": "1.2.60",
|
|
33
|
+
"@fluid-topics/ft-typography": "1.2.60",
|
|
34
|
+
"@fluid-topics/ft-wc-utils": "1.2.60",
|
|
35
35
|
"lit": "3.1.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@fluid-topics/public-api": "1.0.94"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "5acbf0235057ab34c306052ddba1e8f500f710bc"
|
|
41
41
|
}
|