@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.
@@ -11,6 +11,5 @@ export declare class DesktopSearchBarManager {
11
11
  private renderSearchBarLeftAction;
12
12
  private renderDesktopSearchBarButtons;
13
13
  private onSearchBarKeyDown;
14
- private onSearchBarKeyUp;
15
14
  private onInput;
16
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
- onSearchBarKeyUp(e) {
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) {
@@ -9,6 +9,6 @@ export declare class MobileSearchBarManager {
9
9
  static styles: import("lit").CSSResult;
10
10
  render(): import("lit-html").TemplateResult<1>;
11
11
  private renderMobileSearchBarButtons;
12
- private onSearchBarKeyUp;
12
+ private onSearchBarKeyDown;
13
13
  private onInput;
14
14
  }
@@ -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
- @keyup=${(e) => this.onSearchBarKeyUp(e)}
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
- onSearchBarKeyUp(e) {
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 currentFocuseElement = e.target.closest("[part='suggestion-container']");
106
- const thingToFocus = (_d = (_b = (_a = currentFocuseElement === null || currentFocuseElement === void 0 ? void 0 : currentFocuseElement.previousElementSibling) === null || _a === void 0 ? void 0 : _a.querySelector("[part='suggestions']")) !== null && _b !== void 0 ? _b : (_c = currentFocuseElement === null || currentFocuseElement === void 0 ? void 0 : currentFocuseElement.nextElementSibling) === null || _c === void 0 ? void 0 : _c.querySelector("[part='suggestions']")) !== null && _d !== void 0 ? _d : this.searchBar.input;
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.59",
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.59",
23
- "@fluid-topics/ft-app-context": "1.2.59",
24
- "@fluid-topics/ft-button": "1.2.59",
25
- "@fluid-topics/ft-chip": "1.2.59",
26
- "@fluid-topics/ft-filter": "1.2.59",
27
- "@fluid-topics/ft-icon": "1.2.59",
28
- "@fluid-topics/ft-select": "1.2.59",
29
- "@fluid-topics/ft-size-watcher": "1.2.59",
30
- "@fluid-topics/ft-skeleton": "1.2.59",
31
- "@fluid-topics/ft-snap-scroll": "1.2.59",
32
- "@fluid-topics/ft-tooltip": "1.2.59",
33
- "@fluid-topics/ft-typography": "1.2.59",
34
- "@fluid-topics/ft-wc-utils": "1.2.59",
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": "ca70918bd99da1a41e1d5ee71f9e9156ac58289f"
40
+ "gitHead": "5acbf0235057ab34c306052ddba1e8f500f710bc"
41
41
  }