@shoper/phoenix_design_system 1.11.11-6 → 1.11.11-8
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/cjs/packages/phoenix/src/components/dropdown/dropdown.js +112 -38
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js +0 -5
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js +13 -24
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +95 -292
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +0 -5
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +9 -22
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +1 -15
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js +1 -8
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +4 -9
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +4 -9
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +4 -11
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +5 -12
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +2 -3
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js +13 -2
- package/build/cjs/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +12 -12
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +12 -4
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +113 -39
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.d.ts +0 -2
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js +0 -5
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +14 -25
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +5 -23
- package/build/esm/packages/phoenix/src/components/form/search/search.js +96 -293
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search_types.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +0 -5
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.d.ts +2 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +9 -22
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +2 -16
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js +1 -8
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +4 -9
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +4 -9
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +4 -11
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +5 -12
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.js +2 -3
- package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.d.ts +2 -1
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js +13 -2
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller_types.d.ts +1 -0
- package/build/esm/packages/phoenix/src/index.js +2 -2
- package/package.json +2 -2
|
@@ -11,19 +11,15 @@ import { BehaviorSubject } from '../../../core/classes/behavior_subject/behavior
|
|
|
11
11
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
12
12
|
import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
|
|
13
13
|
import { BREAKPOINTS } from '../../../global_constants.js';
|
|
14
|
-
import v4 from '../../../../../../external/uuid/dist/esm-browser/v4.js';
|
|
15
14
|
import { when as n } from '../../../../../../external/lit/external/lit-html/directives/when.js';
|
|
16
|
-
import { DEFAULT_VIEW, SEARCH_CLASS_NAMES,
|
|
15
|
+
import { DEFAULT_VIEW, SEARCH_CLASS_NAMES, SCROLL_DIRECTIONS, SEARCH_CONFIGURATION, SEARCH_COMPONENT_NAMES, SEARCH_CONTEXT_NAMES, SEARCH_CUSTOM_EVENT_NAMES } from './search_constants.js';
|
|
17
16
|
|
|
18
17
|
let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
19
18
|
constructor() {
|
|
20
19
|
super(...arguments);
|
|
21
20
|
this.view = DEFAULT_VIEW;
|
|
22
|
-
this._id = v4();
|
|
23
|
-
this._searchContentContainerId = v4();
|
|
24
21
|
this._searchResultsRef = createRef();
|
|
25
22
|
this._searchHistoryRef = createRef();
|
|
26
|
-
this._searchMessageRef = createRef();
|
|
27
23
|
this._shouldShowHistory = false;
|
|
28
24
|
this._shouldShowResults = false;
|
|
29
25
|
this._shouldShowMessage = false;
|
|
@@ -33,237 +29,84 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
33
29
|
this._historyContext = new BehaviorSubject({
|
|
34
30
|
showLoadMore: false
|
|
35
31
|
});
|
|
36
|
-
this._activeItemId =
|
|
32
|
+
this._activeItemId = -1;
|
|
37
33
|
this._translations = {};
|
|
38
|
-
this._containerRole = 'grid';
|
|
39
34
|
this._bindKeys = (ev) => {
|
|
35
|
+
var _a;
|
|
40
36
|
switch (ev.key) {
|
|
41
37
|
case 'ArrowDown':
|
|
42
38
|
ev.preventDefault();
|
|
43
|
-
this.
|
|
39
|
+
this._focusOutsideActiveItemsForward();
|
|
40
|
+
this._scroll(SCROLL_DIRECTIONS.down);
|
|
44
41
|
break;
|
|
45
42
|
case 'ArrowUp':
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (this._containerRole === 'grid') {
|
|
50
|
-
ev.preventDefault();
|
|
51
|
-
this._handleBackwardGridFocus();
|
|
52
|
-
}
|
|
53
|
-
if (this._containerRole === 'listbox')
|
|
54
|
-
this._handleMoveToInputField();
|
|
55
|
-
break;
|
|
56
|
-
case 'ArrowRight':
|
|
57
|
-
if (this._containerRole === 'grid') {
|
|
58
|
-
ev.preventDefault();
|
|
59
|
-
this._handleForwardGridFocus();
|
|
60
|
-
}
|
|
61
|
-
if (this._containerRole === 'listbox')
|
|
62
|
-
this._handleMoveToInputField();
|
|
43
|
+
ev.preventDefault();
|
|
44
|
+
this._focusOutsideActiveItemsBackward();
|
|
45
|
+
this._scroll(SCROLL_DIRECTIONS.up);
|
|
63
46
|
break;
|
|
64
47
|
case 'Enter':
|
|
65
48
|
ev.preventDefault();
|
|
66
|
-
if (this._activeItemId ===
|
|
49
|
+
if (this._activeItemId === -1 || !this._shouldShowResults)
|
|
67
50
|
return;
|
|
68
51
|
this._handleChooseSearchItem();
|
|
69
52
|
break;
|
|
70
53
|
case 'Escape':
|
|
71
54
|
ev.preventDefault();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this._shouldShowMessage = false;
|
|
75
|
-
this._hideHistorySuggestionsAndResults();
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
this._inputField.value = '';
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
case 'End':
|
|
82
|
-
ev.preventDefault();
|
|
83
|
-
this._handleFocusOnInputWithCaretEnd();
|
|
84
|
-
break;
|
|
85
|
-
case 'Home':
|
|
86
|
-
ev.preventDefault();
|
|
87
|
-
this._handleFocusOnInputWithCaretStart();
|
|
88
|
-
break;
|
|
89
|
-
case 'Backspace':
|
|
90
|
-
this._handleMoveToInputField();
|
|
55
|
+
this._inputField.blur();
|
|
56
|
+
this._resetSearchView();
|
|
91
57
|
break;
|
|
92
58
|
case 'Tab':
|
|
93
|
-
const isFocusedOnSearchInput = document.activeElement ===
|
|
94
|
-
if (!isFocusedOnSearchInput)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this._handleWriteableCharacter(ev);
|
|
59
|
+
const isFocusedOnSearchInput = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.matches('input[type="search"]'));
|
|
60
|
+
if (!isFocusedOnSearchInput) {
|
|
61
|
+
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
62
|
+
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(SEARCH_CLASS_NAMES.outline);
|
|
63
|
+
this._resetSearchView();
|
|
64
|
+
document.removeEventListener('keyup', this._bindKeys);
|
|
65
|
+
}
|
|
101
66
|
break;
|
|
102
67
|
}
|
|
103
68
|
};
|
|
104
|
-
this.
|
|
105
|
-
if (ev.key !== 'Tab')
|
|
106
|
-
return;
|
|
107
|
-
const isFocusedOnSearchInput = document.activeElement === this._inputField;
|
|
108
|
-
if (ev.shiftKey && !isFocusedOnSearchInput) {
|
|
109
|
-
this._focusOnPreviousElementBeforeSearchInput(ev);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (!isFocusedOnSearchInput) {
|
|
113
|
-
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
114
|
-
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(SEARCH_CLASS_NAMES.outline);
|
|
115
|
-
this._resetSearchView();
|
|
116
|
-
document.removeEventListener('keydown', this._bindKeys);
|
|
117
|
-
document.removeEventListener('keyup', this._handleSearchTabNavigation);
|
|
118
|
-
this._focusOnNextElementAfterSearchInput(ev);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
this._focusOnPreviousElementBeforeSearchInput = async (ev) => {
|
|
122
|
-
ev.preventDefault();
|
|
123
|
-
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
124
|
-
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(SEARCH_CLASS_NAMES.outline);
|
|
125
|
-
this._resetSearchView();
|
|
126
|
-
document.removeEventListener('keydown', this._bindKeys);
|
|
127
|
-
document.removeEventListener('keyup', this._handleSearchTabNavigation);
|
|
128
|
-
UiDomUtils.getPreviousFocusableElement(this._inputField).focus();
|
|
129
|
-
};
|
|
130
|
-
this._focusOnNextElementAfterSearchInput = async (ev) => {
|
|
131
|
-
ev.preventDefault();
|
|
132
|
-
UiDomUtils.getNextFocusableElement(this._inputField).focus();
|
|
133
|
-
};
|
|
134
|
-
this._preventScrollingOnSearchContentBrowsing = (ev) => {
|
|
69
|
+
this._focusOutsideActiveItemsForward = () => {
|
|
135
70
|
var _a;
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
const hasSearchContainerParent = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest('.search__container'));
|
|
139
|
-
if ((hasArrowBeenPressed || hasHomeOrEndBeenPressed) && hasSearchContainerParent) {
|
|
140
|
-
ev.preventDefault();
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
this._handleForwardListFocus = () => {
|
|
144
|
-
var _a, _b;
|
|
145
|
-
const containers = [
|
|
146
|
-
this._searchHistoryRef.value,
|
|
147
|
-
this._searchResultsRef.value,
|
|
148
|
-
this._searchMessageRef.value
|
|
149
|
-
];
|
|
150
|
-
const $searchItemsContainer = containers.find(container => container && !UiDomUtils.isElementEmpty(container));
|
|
151
|
-
if (!$searchItemsContainer)
|
|
152
|
-
return;
|
|
153
|
-
const isActiveElementASearchItem = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.getAttribute('data-search-item-id'));
|
|
154
|
-
const isActiveElementAGridSearchItem = isActiveElementASearchItem && !!((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.getAttribute('data-search-grid-item'));
|
|
155
|
-
const $listSearchItems = UiDomUtils.getFocusableElements($searchItemsContainer).filter(($el) => {
|
|
156
|
-
const searchItemId = $el.getAttribute('data-search-item-id');
|
|
157
|
-
const isListSearchItem = !!searchItemId && !$el.getAttribute('data-search-grid-item');
|
|
158
|
-
const isGridSearchItem = !!searchItemId && $el.getAttribute('data-search-grid-item');
|
|
159
|
-
return isActiveElementAGridSearchItem ? isGridSearchItem : isListSearchItem;
|
|
160
|
-
});
|
|
161
|
-
this._handleForwardFocus($listSearchItems);
|
|
162
|
-
};
|
|
163
|
-
this._handleForwardGridFocus = () => {
|
|
164
|
-
const containers = [
|
|
165
|
-
this._searchHistoryRef.value,
|
|
166
|
-
this._searchResultsRef.value,
|
|
167
|
-
this._searchMessageRef.value
|
|
168
|
-
];
|
|
169
|
-
const $searchItemsContainer = containers.find(container => container && !UiDomUtils.isElementEmpty(container));
|
|
71
|
+
const $activeElement = document.activeElement;
|
|
72
|
+
const $searchItemsContainer = this._searchHistoryRef.value || this._searchResultsRef.value;
|
|
170
73
|
if (!$searchItemsContainer)
|
|
171
74
|
return;
|
|
172
|
-
const $
|
|
75
|
+
const $searchItems = UiDomUtils.getFocusableElements($searchItemsContainer).filter(($el) => {
|
|
173
76
|
return !!$el.getAttribute('data-search-item-id');
|
|
174
77
|
});
|
|
175
|
-
this._handleForwardFocus($gridSearchItems);
|
|
176
|
-
};
|
|
177
|
-
this._handleForwardFocus = ($searchItems) => {
|
|
178
|
-
var _a;
|
|
179
|
-
const $activeElement = document.activeElement;
|
|
180
78
|
const indexOfCurrentElement = $searchItems.indexOf($activeElement);
|
|
181
79
|
const indexOfNextElement = indexOfCurrentElement === $searchItems.length - 1 ? 0 : indexOfCurrentElement + 1;
|
|
182
80
|
const $nextSearchItemElement = $searchItems[indexOfNextElement];
|
|
183
81
|
$nextSearchItemElement.focus();
|
|
184
|
-
this.
|
|
185
|
-
};
|
|
186
|
-
this._handleMoveToInputField = () => {
|
|
187
|
-
const isFocusedOnSearchInput = document.activeElement === this._inputField;
|
|
188
|
-
if (isFocusedOnSearchInput)
|
|
189
|
-
return;
|
|
190
|
-
this._inputField.focus();
|
|
82
|
+
this._activeItemId = (_a = Number($nextSearchItemElement.getAttribute('data-search-item-id'))) !== null && _a !== void 0 ? _a : -1;
|
|
191
83
|
};
|
|
192
|
-
this.
|
|
193
|
-
var _a
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
if (isFocusedOnSearchInput || !hasPopup)
|
|
197
|
-
return;
|
|
198
|
-
ev.preventDefault();
|
|
199
|
-
const containers = [
|
|
200
|
-
this._searchHistoryRef.value,
|
|
201
|
-
this._searchResultsRef.value,
|
|
202
|
-
this._searchMessageRef.value
|
|
203
|
-
];
|
|
204
|
-
const $searchItemsContainer = containers.find(container => container && !UiDomUtils.isElementEmpty(container));
|
|
205
|
-
if (!$searchItemsContainer)
|
|
206
|
-
return;
|
|
207
|
-
const isActiveElementASearchItem = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.getAttribute('data-search-item-id'));
|
|
208
|
-
const isActiveElementAGridSearchItem = isActiveElementASearchItem && !!((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.getAttribute('data-search-grid-item'));
|
|
209
|
-
const $listSearchItems = UiDomUtils.getFocusableElements($searchItemsContainer).filter(($el) => {
|
|
210
|
-
const searchItemId = $el.getAttribute('data-search-item-id');
|
|
211
|
-
const isListSearchItem = !!searchItemId && !$el.getAttribute('data-search-grid-item');
|
|
212
|
-
const isGridSearchItem = !!searchItemId && $el.getAttribute('data-search-grid-item');
|
|
213
|
-
return isActiveElementAGridSearchItem ? isGridSearchItem : isListSearchItem;
|
|
214
|
-
});
|
|
215
|
-
this._handleBackwardFocus($listSearchItems);
|
|
216
|
-
};
|
|
217
|
-
this._handleBackwardGridFocus = () => {
|
|
218
|
-
const containers = [
|
|
219
|
-
this._searchHistoryRef.value,
|
|
220
|
-
this._searchResultsRef.value,
|
|
221
|
-
this._searchMessageRef.value
|
|
222
|
-
];
|
|
223
|
-
const $searchItemsContainer = containers.find(container => container && !UiDomUtils.isElementEmpty(container));
|
|
84
|
+
this._focusOutsideActiveItemsBackward = () => {
|
|
85
|
+
var _a;
|
|
86
|
+
const $activeElement = document.activeElement;
|
|
87
|
+
const $searchItemsContainer = this._searchHistoryRef.value || this._searchResultsRef.value;
|
|
224
88
|
if (!$searchItemsContainer)
|
|
225
89
|
return;
|
|
226
|
-
const $
|
|
90
|
+
const $searchItems = UiDomUtils.getFocusableElements($searchItemsContainer).filter(($el) => {
|
|
227
91
|
return !!$el.getAttribute('data-search-item-id');
|
|
228
92
|
});
|
|
229
|
-
this._handleBackwardFocus($gridSearchItems);
|
|
230
|
-
};
|
|
231
|
-
this._handleBackwardFocus = ($searchItems) => {
|
|
232
|
-
var _a;
|
|
233
|
-
const $activeElement = document.activeElement;
|
|
234
93
|
const indexOfCurrentElement = $searchItems.indexOf($activeElement);
|
|
235
94
|
const indexOfPreviousElement = indexOfCurrentElement === 0 ? $searchItems.length - 1 : indexOfCurrentElement - 1;
|
|
236
95
|
const $previousSearchItemElement = $searchItems[indexOfPreviousElement];
|
|
237
96
|
$previousSearchItemElement.focus();
|
|
238
|
-
this.
|
|
97
|
+
this._activeItemId = (_a = Number($previousSearchItemElement.getAttribute('data-search-item-id'))) !== null && _a !== void 0 ? _a : -1;
|
|
239
98
|
};
|
|
240
|
-
this.
|
|
241
|
-
this.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return;
|
|
250
|
-
this._inputField.focus();
|
|
251
|
-
const endPosition = this._inputField.value.length;
|
|
252
|
-
this._inputField.setSelectionRange(endPosition, endPosition);
|
|
253
|
-
};
|
|
254
|
-
this._handleFocusOnInputWithCaretStart = () => {
|
|
255
|
-
this._inputField.focus();
|
|
256
|
-
this._inputField.setSelectionRange(0, 0);
|
|
257
|
-
};
|
|
258
|
-
this._handleWriteableCharacter = (ev) => {
|
|
259
|
-
const isFocusedOnSearchInput = document.activeElement === this._inputField;
|
|
260
|
-
if (isFocusedOnSearchInput)
|
|
261
|
-
return;
|
|
262
|
-
this._inputField.focus();
|
|
263
|
-
const isAPrintableCharacter = ev.key.match(/\P{C}/u);
|
|
264
|
-
if (ev.key.length !== 1 || !isAPrintableCharacter) {
|
|
265
|
-
ev.preventDefault();
|
|
99
|
+
this._getSearchItemsCount = () => {
|
|
100
|
+
if (this._shouldShowHistory)
|
|
101
|
+
return this._historyLimitedContent.length;
|
|
102
|
+
let searchItemsCount = this._searchResults.products.length +
|
|
103
|
+
this._searchResults.categories.length +
|
|
104
|
+
this._searchResults.suggestions.length +
|
|
105
|
+
this._searchResults.producers.length;
|
|
106
|
+
if (this._searchResults.products.length && this._searchResults.suggestions.length) {
|
|
107
|
+
searchItemsCount += 1;
|
|
266
108
|
}
|
|
109
|
+
return searchItemsCount;
|
|
267
110
|
};
|
|
268
111
|
this._hideSuggesterOnClickOutside = (ev) => {
|
|
269
112
|
const outsideClick = typeof ev.composedPath === 'function' && !ev.composedPath().includes(this);
|
|
@@ -278,12 +121,6 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
278
121
|
? this.classList.remove(SEARCH_CLASS_NAMES.mobileOpened)
|
|
279
122
|
: this.classList.add(SEARCH_CLASS_NAMES.mobileOpened);
|
|
280
123
|
};
|
|
281
|
-
this._preventSubmitOnSearchClear = (ev) => {
|
|
282
|
-
const $searchClear = this.querySelector(SEARCH_COMPONENT_NAMES.clearButton);
|
|
283
|
-
if (ev.key === 'Enter' && ev.target === $searchClear) {
|
|
284
|
-
ev.preventDefault();
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
124
|
}
|
|
288
125
|
async connectedCallback() {
|
|
289
126
|
super.connectedCallback();
|
|
@@ -322,9 +159,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
322
159
|
disconnectedCallback() {
|
|
323
160
|
super.disconnectedCallback();
|
|
324
161
|
document.removeEventListener('click', this._hideSuggesterOnClickOutside);
|
|
325
|
-
document.removeEventListener('keydown', this._preventScrollingOnSearchContentBrowsing);
|
|
326
162
|
window.removeEventListener('resize', this._switchTypeOfSearchView);
|
|
327
|
-
this._searchForm.removeEventListener('keydown', this._preventSubmitOnSearchClear);
|
|
328
163
|
}
|
|
329
164
|
_setupContext() {
|
|
330
165
|
this._historyContextProvider = new ContextProviderController(this);
|
|
@@ -333,11 +168,8 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
333
168
|
_setupInitialSearchPhrase() {
|
|
334
169
|
var _a;
|
|
335
170
|
const searchInput = this.querySelector('input[type="search"]');
|
|
336
|
-
const searchForm = this.closest('form');
|
|
337
171
|
if (searchInput)
|
|
338
172
|
this._inputField = searchInput;
|
|
339
|
-
if (searchForm)
|
|
340
|
-
this._searchForm = searchForm;
|
|
341
173
|
if (!((_a = this._inputField) === null || _a === void 0 ? void 0 : _a.value))
|
|
342
174
|
return;
|
|
343
175
|
this._searchPhrase = this._inputField.value;
|
|
@@ -356,17 +188,11 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
356
188
|
}
|
|
357
189
|
_setupListeners() {
|
|
358
190
|
this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.focusin, (ev) => {
|
|
359
|
-
var _a, _b, _c;
|
|
360
|
-
const $target = (_a = ev.detail) === null || _a === void 0 ? void 0 : _a.relatedTarget;
|
|
361
|
-
if ($target === null || $target === void 0 ? void 0 : $target.closest(`[id="${this._searchContentContainerId}"]`))
|
|
362
|
-
return;
|
|
363
191
|
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
364
192
|
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.add(SEARCH_CLASS_NAMES.outline);
|
|
365
|
-
const shouldShowMessage =
|
|
366
|
-
this._updateSearchView(
|
|
367
|
-
document.addEventListener('
|
|
368
|
-
document.addEventListener('keyup', this._handleSearchTabNavigation);
|
|
369
|
-
document.addEventListener('keydown', this._preventScrollingOnSearchContentBrowsing);
|
|
193
|
+
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
194
|
+
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage, false);
|
|
195
|
+
document.addEventListener('keyup', this._bindKeys);
|
|
370
196
|
});
|
|
371
197
|
this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.keyup, (ev) => {
|
|
372
198
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
@@ -377,7 +203,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
377
203
|
this._updateSearchView('', false);
|
|
378
204
|
});
|
|
379
205
|
this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.submit, () => {
|
|
380
|
-
if (this._activeItemId !==
|
|
206
|
+
if (this._activeItemId !== -1)
|
|
381
207
|
return;
|
|
382
208
|
if (this._inputField.value === '') {
|
|
383
209
|
this._updateSearchView(this._inputField.value, true);
|
|
@@ -401,12 +227,10 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
401
227
|
});
|
|
402
228
|
document.addEventListener('click', this._hideSuggesterOnClickOutside);
|
|
403
229
|
window.addEventListener('resize', this._switchTypeOfSearchView);
|
|
404
|
-
this._searchForm.addEventListener('keydown', this._preventSubmitOnSearchClear);
|
|
405
230
|
}
|
|
406
231
|
_updateSearchView(searchPhrase, shouldShowMessage, shouldUpdateSearchPhrase = true) {
|
|
407
232
|
this._shouldShowMessage = shouldShowMessage;
|
|
408
|
-
this.
|
|
409
|
-
this._inputField.setAttribute('aria-activedescendant', '');
|
|
233
|
+
this._activeItemId = -1;
|
|
410
234
|
this._displaySuggester(searchPhrase);
|
|
411
235
|
if (!shouldUpdateSearchPhrase)
|
|
412
236
|
return;
|
|
@@ -444,59 +268,57 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
444
268
|
_handleToggleHistoryAndResults({ shouldShowHistory, shouldShowResults }) {
|
|
445
269
|
this._shouldShowHistory = shouldShowHistory;
|
|
446
270
|
this._shouldShowResults = shouldShowResults;
|
|
447
|
-
this.
|
|
448
|
-
this._toggleSearchContainerAttributes(shouldShowHistory, shouldShowResults);
|
|
271
|
+
this._toggleSearchInputAria(shouldShowHistory, shouldShowResults);
|
|
449
272
|
}
|
|
450
|
-
|
|
273
|
+
_toggleSearchInputAria(shouldShowHistory, shouldShowResults) {
|
|
451
274
|
var _a;
|
|
452
275
|
const $input = (_a = this._searchInput) === null || _a === void 0 ? void 0 : _a.input;
|
|
453
276
|
if (!$input)
|
|
454
277
|
return;
|
|
455
278
|
if (!shouldShowHistory && !shouldShowResults) {
|
|
456
279
|
$input.removeAttribute('aria-label');
|
|
457
|
-
$input.setAttribute('aria-activedescendant', '');
|
|
458
280
|
return;
|
|
459
281
|
}
|
|
460
282
|
$input.setAttribute('aria-expanded', 'true');
|
|
461
|
-
if (shouldShowHistory)
|
|
283
|
+
if (shouldShowHistory)
|
|
462
284
|
$input.setAttribute('aria-label', this.settings.historyGuideAriaLabel);
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
if (shouldShowResults) {
|
|
285
|
+
if (shouldShowResults)
|
|
466
286
|
$input.setAttribute('aria-label', this.settings.suggesterGuideAriaLabel);
|
|
467
|
-
this._inputField.removeAttribute('aria-haspopup');
|
|
468
|
-
}
|
|
469
287
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
288
|
+
_scroll(direction) {
|
|
289
|
+
const searchContainer = this.querySelector(`.${SEARCH_CLASS_NAMES.container}`);
|
|
290
|
+
const maxScrollTop = searchContainer.scrollHeight - searchContainer.clientHeight;
|
|
291
|
+
const activeItem = this.querySelector(`[data-search-item-id="${this._activeItemId}"]`);
|
|
292
|
+
const activeItemHeight = (activeItem === null || activeItem === void 0 ? void 0 : activeItem.getBoundingClientRect().height) || 0;
|
|
293
|
+
let top;
|
|
294
|
+
if (direction === SCROLL_DIRECTIONS.up) {
|
|
295
|
+
top = searchContainer.scrollTop == 0 ? 0 : searchContainer.scrollTop + 30 - activeItemHeight;
|
|
473
296
|
}
|
|
474
|
-
|
|
475
|
-
|
|
297
|
+
else {
|
|
298
|
+
top = searchContainer.scrollTop == maxScrollTop ? maxScrollTop : activeItemHeight + searchContainer.scrollTop - 30;
|
|
476
299
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const $activeSearchItem = this.querySelector(`[data-search-item-id="${this._activeItemId}"]`);
|
|
480
|
-
if (!$activeSearchItem)
|
|
481
|
-
return;
|
|
482
|
-
const $linkElement = $activeSearchItem.querySelector('a');
|
|
483
|
-
const $suggestedElement = $linkElement || $activeSearchItem;
|
|
484
|
-
const $elementToClick = $activeSearchItem.dataset.suggestedValue ? $suggestedElement : $linkElement;
|
|
485
|
-
if (!$elementToClick) {
|
|
486
|
-
$activeSearchItem.click();
|
|
300
|
+
if (this._activeItemId === this._getSearchItemsCount() - 1) {
|
|
301
|
+
top = maxScrollTop;
|
|
487
302
|
}
|
|
488
|
-
|
|
489
|
-
|
|
303
|
+
if (this._activeItemId === 0) {
|
|
304
|
+
top = 0;
|
|
490
305
|
}
|
|
306
|
+
searchContainer === null || searchContainer === void 0 ? void 0 : searchContainer.scrollTo({ top, behavior: 'smooth' });
|
|
307
|
+
}
|
|
308
|
+
_handleChooseSearchItem() {
|
|
309
|
+
const activeSearchItem = this.querySelector(`[data-search-item-id="${this._activeItemId}"]`);
|
|
310
|
+
const elementToClick = activeSearchItem.dataset.suggestedValue
|
|
311
|
+
? activeSearchItem
|
|
312
|
+
: activeSearchItem.querySelector('a');
|
|
313
|
+
elementToClick.click();
|
|
491
314
|
}
|
|
492
315
|
_resetSearchView() {
|
|
493
316
|
this._shouldShowMessage = false;
|
|
494
|
-
this.
|
|
317
|
+
this._activeItemId = -1;
|
|
495
318
|
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
496
319
|
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(SEARCH_CLASS_NAMES.outline);
|
|
497
320
|
this._hideHistorySuggestionsAndResults();
|
|
498
|
-
document.removeEventListener('
|
|
499
|
-
document.removeEventListener('keyup', this._handleSearchTabNavigation);
|
|
321
|
+
document.removeEventListener('keyup', this._bindKeys);
|
|
500
322
|
}
|
|
501
323
|
_submitSearchPhrase(searchPhrase) {
|
|
502
324
|
this._dispatchEventWithSearchPhrase(SEARCH_CUSTOM_EVENT_NAMES.searchPhraseSubmitted, searchPhrase);
|
|
@@ -531,48 +353,33 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
531
353
|
<div class="labeled-icon__signature">${this._translations.search}</div>
|
|
532
354
|
</div>
|
|
533
355
|
|
|
534
|
-
${n(this._isSuggesterLayerVisible(), () => html
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
356
|
+
${n(this._isSuggesterLayerVisible(), () => html `<div class="${SEARCH_CLASS_NAMES.container}">
|
|
357
|
+
${n(this._shouldShowMessage, () => html `<h-search-message
|
|
358
|
+
.history="${this._historyLimitedContent}"
|
|
359
|
+
.results="${this._searchResults}"
|
|
360
|
+
.translations="${this._translations}"
|
|
361
|
+
search-phrase="${this._searchPhrase}"
|
|
362
|
+
module-instance-id="${this.moduleInstanceId}"
|
|
363
|
+
></h-search-message>`)}
|
|
364
|
+
${n(this._shouldShowHistory, () => html `<h-search-history
|
|
365
|
+
${ref(this._searchHistoryRef)}
|
|
542
366
|
.history="${this._historyLimitedContent}"
|
|
543
|
-
.results="${this._searchResults}"
|
|
544
367
|
.translations="${this._translations}"
|
|
368
|
+
active-item-id="${this._activeItemId}"
|
|
369
|
+
module-instance-id="${this.moduleInstanceId}"
|
|
370
|
+
></h-search-history>`)}
|
|
371
|
+
${n(this._shouldShowResults, () => html `<h-search-results
|
|
372
|
+
${ref(this._searchResultsRef)}
|
|
373
|
+
.results="${this._searchResults}"
|
|
545
374
|
search-phrase="${this._searchPhrase}"
|
|
375
|
+
.settings="${this.settings}"
|
|
376
|
+
locale="${this.locale}"
|
|
377
|
+
view="${this.view}"
|
|
378
|
+
.translations="${this._translations}"
|
|
379
|
+
active-item-id="${this._activeItemId}"
|
|
546
380
|
module-instance-id="${this.moduleInstanceId}"
|
|
547
|
-
></h-search-
|
|
548
|
-
|
|
549
|
-
${ref(this._searchHistoryRef)}
|
|
550
|
-
.history="${this._historyLimitedContent}"
|
|
551
|
-
.translations="${this._translations}"
|
|
552
|
-
active-item-id="${this._activeItemId}"
|
|
553
|
-
search-id="${this._id}"
|
|
554
|
-
module-instance-id="${this.moduleInstanceId}"
|
|
555
|
-
></h-search-history>`)}
|
|
556
|
-
${n(this._shouldShowResults, () => html `<h-search-results
|
|
557
|
-
${ref(this._searchResultsRef)}
|
|
558
|
-
.results="${this._searchResults}"
|
|
559
|
-
search-phrase="${this._searchPhrase}"
|
|
560
|
-
.settings="${this.settings}"
|
|
561
|
-
locale="${this.locale}"
|
|
562
|
-
view="${this.view}"
|
|
563
|
-
.translations="${this._translations}"
|
|
564
|
-
active-item-id="${this._activeItemId}"
|
|
565
|
-
search-id="${this._id}"
|
|
566
|
-
module-instance-id="${this.moduleInstanceId}"
|
|
567
|
-
></h-search-results>`)}
|
|
568
|
-
</div>
|
|
569
|
-
`, () => html `
|
|
570
|
-
<div
|
|
571
|
-
class="${SEARCH_CLASS_NAMES.container}"
|
|
572
|
-
id="${this._searchContentContainerId}"
|
|
573
|
-
role="${this._containerRole}"
|
|
574
|
-
hidden
|
|
575
|
-
></div>`)}
|
|
381
|
+
></h-search-results>`)}
|
|
382
|
+
</div>`)}
|
|
576
383
|
`;
|
|
577
384
|
}
|
|
578
385
|
};
|
|
@@ -626,16 +433,12 @@ __decorate([
|
|
|
626
433
|
], HSearch.prototype, "_historyContext", void 0);
|
|
627
434
|
__decorate([
|
|
628
435
|
state(),
|
|
629
|
-
__metadata("design:type",
|
|
436
|
+
__metadata("design:type", Number)
|
|
630
437
|
], HSearch.prototype, "_activeItemId", void 0);
|
|
631
438
|
__decorate([
|
|
632
439
|
state(),
|
|
633
440
|
__metadata("design:type", Object)
|
|
634
441
|
], HSearch.prototype, "_translations", void 0);
|
|
635
|
-
__decorate([
|
|
636
|
-
state(),
|
|
637
|
-
__metadata("design:type", String)
|
|
638
|
-
], HSearch.prototype, "_containerRole", void 0);
|
|
639
442
|
HSearch = __decorate([
|
|
640
443
|
phoenixCustomElement(SEARCH_COMPONENT_NAMES.search)
|
|
641
444
|
], HSearch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAA6E;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
2
|
import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
3
|
export declare class HSearchClear extends PhoenixLightLitElement {
|
|
4
4
|
private _btnController;
|
|
@@ -10,7 +10,6 @@ export declare class HSearchClear extends PhoenixLightLitElement {
|
|
|
10
10
|
private _searchContextObserver;
|
|
11
11
|
constructor();
|
|
12
12
|
connectedCallback(): void;
|
|
13
|
-
protected updated(_changedProperties: PropertyValues): void;
|
|
14
13
|
private _dispatchClearEvent;
|
|
15
14
|
private _searchContextSetup;
|
|
16
15
|
protected render(): TemplateResult;
|
package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js
CHANGED
|
@@ -28,11 +28,6 @@ let HSearchClear = class HSearchClear extends PhoenixLightLitElement {
|
|
|
28
28
|
this._searchContextSetup();
|
|
29
29
|
this.addEventListener('click', this._dispatchClearEvent);
|
|
30
30
|
}
|
|
31
|
-
updated(_changedProperties) {
|
|
32
|
-
super.updated(_changedProperties);
|
|
33
|
-
const newTabIndex = this._shouldShow ? '0' : '-1';
|
|
34
|
-
this.setAttribute('tabindex', newTabIndex);
|
|
35
|
-
}
|
|
36
31
|
async _searchContextSetup() {
|
|
37
32
|
try {
|
|
38
33
|
this._searchContextConsumer = new ContextConsumerController(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,9 +8,9 @@ export declare class HSearchHistory extends PhoenixLightLitElement {
|
|
|
8
8
|
private _historyContext$;
|
|
9
9
|
private _historyContextObserver;
|
|
10
10
|
buttonRef: Ref<HSearchHistoryLoadMore>;
|
|
11
|
+
private _loadMoreButtonId;
|
|
11
12
|
history: TSearchHistoryItem[];
|
|
12
|
-
activeItemId:
|
|
13
|
-
searchId: string;
|
|
13
|
+
activeItemId: number;
|
|
14
14
|
translations: Record<string, string>;
|
|
15
15
|
moduleInstanceId: string;
|
|
16
16
|
connectedCallback(): Promise<void>;
|