@shoper/phoenix_design_system 1.11.9-0 → 1.11.9-2
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 +38 -104
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js +5 -0
- 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 +24 -13
- 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 +2 -2
- package/build/cjs/packages/phoenix/src/components/form/search/search_constants.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +2 -2
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +3 -2
- 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 +2 -13
- package/build/cjs/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +4 -12
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +39 -105
- 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 +2 -0
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js +5 -0
- 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 +2 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +25 -14
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.js +2 -2
- package/build/esm/packages/phoenix/src/components/form/search/search_constants.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search_constants.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +2 -2
- package/build/esm/packages/phoenix/src/components/form/select/select.js +3 -2
- 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 +1 -2
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js +2 -13
- 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 +0 -1
- package/package.json +2 -2
|
@@ -12,7 +12,6 @@ var litHtml = require('lit-html');
|
|
|
12
12
|
var global_constants = require('../../global_constants.js');
|
|
13
13
|
var dropdown_constants = require('./dropdown_constants.js');
|
|
14
14
|
var relative_position_controller_constants = require('../../controllers/relative_position_controller/relative_position_controller_constants.js');
|
|
15
|
-
var v4 = require('../../../../../external/uuid/dist/esm-browser/v4.js');
|
|
16
15
|
var portal_constants = require('../portal/portal_constants.js');
|
|
17
16
|
var backdrop_controller = require('../backdrop/controller/backdrop_controller.js');
|
|
18
17
|
var click_outside_controller = require('../../controllers/click_outside_controller/click_outside_controller.js');
|
|
@@ -30,8 +29,6 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
30
29
|
this.transition = 'direction';
|
|
31
30
|
this.offset = 0;
|
|
32
31
|
this.portalTarget = dropdown_constants.DEFAULT_DROPDOWN_PORTAL_NAME;
|
|
33
|
-
this.id = v4['default']();
|
|
34
|
-
this.preventFocusTrap = false;
|
|
35
32
|
this._backdropController = new backdrop_controller.BackdropController();
|
|
36
33
|
this._handleClickOutside = async (target) => {
|
|
37
34
|
var _a, _b;
|
|
@@ -48,7 +45,7 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
48
45
|
return;
|
|
49
46
|
}
|
|
50
47
|
await this.show();
|
|
51
|
-
|
|
48
|
+
utilities.UiDomUtils.setFocusToFirstFocusableElementInContainer(this.$dropdownContent);
|
|
52
49
|
};
|
|
53
50
|
this.show = async () => {
|
|
54
51
|
if (this.opened)
|
|
@@ -139,24 +136,44 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
139
136
|
return;
|
|
140
137
|
await this.hide();
|
|
141
138
|
};
|
|
142
|
-
this.
|
|
143
|
-
if (
|
|
139
|
+
this._handleForwardFocus = async (ev) => {
|
|
140
|
+
// if (!this.opened) this._handleFocusOnNextElement(ev);
|
|
141
|
+
if (!this.opened || ev.shiftKey)
|
|
144
142
|
return;
|
|
145
|
-
const $
|
|
146
|
-
this.
|
|
147
|
-
|
|
143
|
+
const $focusableElementsWithinDropdownContent = utilities.UiDomUtils.getFocusableElements(this.$dropdownContent).filter((element) => element.closest(dropdown_constants.DROPDOWN_CONTENT_NAME) === this.$dropdownContent);
|
|
144
|
+
const doesNotHaveFocusableElementsInsideContent = $focusableElementsWithinDropdownContent.length <= 0 && this.opened;
|
|
145
|
+
const indexOfCurrentlyFocusedElement = $focusableElementsWithinDropdownContent.indexOf(document.activeElement);
|
|
146
|
+
const isActiveElementLastFocusableElement = indexOfCurrentlyFocusedElement === $focusableElementsWithinDropdownContent.length - 1;
|
|
147
|
+
if (doesNotHaveFocusableElementsInsideContent || isActiveElementLastFocusableElement)
|
|
148
|
+
this._handleFocusOnNextElement(ev);
|
|
148
149
|
};
|
|
149
|
-
this.
|
|
150
|
-
|
|
150
|
+
this._handleFocusOnNextElement = async (ev) => {
|
|
151
|
+
var _a;
|
|
152
|
+
ev.preventDefault();
|
|
153
|
+
const $focusableElements = utilities.UiDomUtils.getFocusableElements(document.body);
|
|
154
|
+
const indexOfDropdownToggler = $focusableElements.indexOf(this.$dropdownToggler);
|
|
155
|
+
const $nextElementToFocus = (_a = $focusableElements[indexOfDropdownToggler + 1]) !== null && _a !== void 0 ? _a : $focusableElements[0];
|
|
156
|
+
await this._hideDropdownsSequentially();
|
|
157
|
+
await this.hide();
|
|
158
|
+
this._focusOnNextElementAfterToggler($nextElementToFocus);
|
|
159
|
+
};
|
|
160
|
+
this._focusOnNextElementAfterToggler = ($elementToFocus) => {
|
|
161
|
+
var _a;
|
|
162
|
+
const isTogglerLastChildOfPreviousDropdown = ($elementToFocus === null || $elementToFocus === void 0 ? void 0 : $elementToFocus.closest(dropdown_constants.DROPDOWN_CONTENT_NAME)) === this.$dropdownContent;
|
|
163
|
+
if (isTogglerLastChildOfPreviousDropdown) {
|
|
164
|
+
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
151
165
|
return;
|
|
152
|
-
const $target = ev.target;
|
|
153
|
-
if (this.preventFocusTrap) {
|
|
154
|
-
this._handleDefaultFocusFromDropdownBackwards(ev);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
this._handleFocusFromTogglerBackwards(ev, $target);
|
|
158
|
-
this._handleFocusFromSentinelStartBackwards(ev, $target);
|
|
159
166
|
}
|
|
167
|
+
$elementToFocus === null || $elementToFocus === void 0 ? void 0 : $elementToFocus.focus();
|
|
168
|
+
};
|
|
169
|
+
this._handleBackwardFocus = async (ev) => {
|
|
170
|
+
var _a;
|
|
171
|
+
const $firstFocusableElement = this.$dropdownContent && utilities.UiDomUtils.getFocusableElement(this.$dropdownContent);
|
|
172
|
+
if (document.activeElement !== $firstFocusableElement)
|
|
173
|
+
return;
|
|
174
|
+
ev.preventDefault();
|
|
175
|
+
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
176
|
+
await this._hideDropdownsSequentially();
|
|
160
177
|
};
|
|
161
178
|
this._hoverToggle = async (ev) => {
|
|
162
179
|
if (window.innerWidth < global_constants.BREAKPOINTS.xs)
|
|
@@ -168,19 +185,12 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
168
185
|
const isHoveredWithinDropdown = this._isHoveredWithinDropdown(ev.target);
|
|
169
186
|
if (isHoveredWithinDropdown && !this.opened) {
|
|
170
187
|
await this.show();
|
|
171
|
-
|
|
188
|
+
utilities.UiDomUtils.setFocusToFirstFocusableElementInContainer(this.$dropdownContent);
|
|
172
189
|
return;
|
|
173
190
|
}
|
|
174
191
|
if (!isHoveredWithinDropdown && this.opened)
|
|
175
192
|
await this._hideDropdownsSequentially();
|
|
176
193
|
};
|
|
177
|
-
this._focusOnFirstContentElement = () => {
|
|
178
|
-
if (!this.$dropdownContent)
|
|
179
|
-
return;
|
|
180
|
-
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
181
|
-
if ($firstFocusableElement)
|
|
182
|
-
$firstFocusableElement.focus();
|
|
183
|
-
};
|
|
184
194
|
this.isOpened = () => this.opened;
|
|
185
195
|
this._positionDropdownContent = () => {
|
|
186
196
|
if (this.contentWidth === dropdown_constants.DROPDOWN_CONTENT_WIDTH.full)
|
|
@@ -206,14 +216,13 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
206
216
|
host: this,
|
|
207
217
|
target: document.body,
|
|
208
218
|
keys: ['tab'],
|
|
209
|
-
callback: this.
|
|
219
|
+
callback: this._handleForwardFocus
|
|
210
220
|
});
|
|
211
221
|
new keystrokes_controller.KeystrokesController({
|
|
212
222
|
host: this,
|
|
213
223
|
target: document.body,
|
|
214
224
|
keys: [['shift', 'tab']],
|
|
215
|
-
callback: this.
|
|
216
|
-
containerSelectors: ['h-dropdown', 'h-dropdown-content']
|
|
225
|
+
callback: this._handleBackwardFocus
|
|
217
226
|
});
|
|
218
227
|
}
|
|
219
228
|
async connectedCallback() {
|
|
@@ -289,71 +298,6 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
289
298
|
(_b = this.$dropdownContent) === null || _b === void 0 ? void 0 : _b.classList.add(global_constants.SCROLLABLE_CLASS_NAME);
|
|
290
299
|
}
|
|
291
300
|
}
|
|
292
|
-
_handleFocusFromTogglerForwards(ev, $target) {
|
|
293
|
-
var _a;
|
|
294
|
-
if (!((_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.contains($target)) || !this.opened || !this.$dropdownContent)
|
|
295
|
-
return;
|
|
296
|
-
ev.preventDefault();
|
|
297
|
-
this._getTrulyFocusableElements(this.$dropdownContent)[0].focus();
|
|
298
|
-
}
|
|
299
|
-
_handleFocusFromSentinelEndForwards(ev, $target) {
|
|
300
|
-
var _a;
|
|
301
|
-
if (!this.$dropdownContent)
|
|
302
|
-
return;
|
|
303
|
-
const $lastFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent).slice(-1)[0];
|
|
304
|
-
if (this.preventFocusTrap && document.activeElement) {
|
|
305
|
-
const $nextFocusableElement = utilities.UiDomUtils.getNextFocusableElement(document.activeElement);
|
|
306
|
-
if ($nextFocusableElement === $lastFocusableElement) {
|
|
307
|
-
this.hide();
|
|
308
|
-
utilities.UiDomUtils.getNextFocusableElement(this.$dropdownToggler || this).focus();
|
|
309
|
-
}
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
if ($target !== $lastFocusableElement)
|
|
313
|
-
return;
|
|
314
|
-
ev.preventDefault();
|
|
315
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
316
|
-
}
|
|
317
|
-
_handleDefaultFocusFromDropdownBackwards(ev) {
|
|
318
|
-
ev.preventDefault();
|
|
319
|
-
this.hide();
|
|
320
|
-
utilities.UiDomUtils.getPreviousFocusableElement(this.$dropdownToggler || this).focus();
|
|
321
|
-
}
|
|
322
|
-
_handleFocusFromTogglerBackwards(ev, $target) {
|
|
323
|
-
var _a;
|
|
324
|
-
if ($target !== this.$dropdownToggler && !((_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.contains($target)) || !this.$dropdownContent)
|
|
325
|
-
return;
|
|
326
|
-
ev.preventDefault();
|
|
327
|
-
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
328
|
-
const $lastFocusableElement = trulyFocusableElements.slice(-1)[0];
|
|
329
|
-
$lastFocusableElement.focus();
|
|
330
|
-
}
|
|
331
|
-
_handleFocusFromSentinelStartBackwards(ev, $target) {
|
|
332
|
-
var _a;
|
|
333
|
-
if (!this.$dropdownContent)
|
|
334
|
-
return;
|
|
335
|
-
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
336
|
-
if ($target !== $firstFocusableElement)
|
|
337
|
-
return;
|
|
338
|
-
ev.preventDefault();
|
|
339
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
340
|
-
}
|
|
341
|
-
_getTrulyFocusableElements($container) {
|
|
342
|
-
const focusableElements = utilities.UiDomUtils.getFocusableElements($container);
|
|
343
|
-
return focusableElements.filter(($el) => this._isElementTrulyFocusable($el));
|
|
344
|
-
}
|
|
345
|
-
_isElementTrulyFocusable($el) {
|
|
346
|
-
const style = window.getComputedStyle($el);
|
|
347
|
-
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
348
|
-
return false;
|
|
349
|
-
}
|
|
350
|
-
if ($el.nodeName === 'H-PORTAL')
|
|
351
|
-
return true;
|
|
352
|
-
const $parent = $el.parentElement;
|
|
353
|
-
if (!$parent)
|
|
354
|
-
return true;
|
|
355
|
-
return this._isElementTrulyFocusable($parent);
|
|
356
|
-
}
|
|
357
301
|
_isHoveredWithinDropdown(element) {
|
|
358
302
|
var _a;
|
|
359
303
|
if (element === this)
|
|
@@ -377,8 +321,6 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
377
321
|
return;
|
|
378
322
|
if (!this._hasScrollableClassInitially)
|
|
379
323
|
this._hasScrollableClassInitially = this.$dropdownContent.classList.contains(global_constants.SCROLLABLE_CLASS_NAME);
|
|
380
|
-
if (!this.preventFocusTrap)
|
|
381
|
-
this.$dropdownContent.setAttribute('aria-modal', 'true');
|
|
382
324
|
}
|
|
383
325
|
_getDropdownContentWidth() {
|
|
384
326
|
const isMobileResolution = document.documentElement.clientWidth < global_constants.BREAKPOINTS.xs;
|
|
@@ -447,14 +389,6 @@ tslib_es6.__decorate([
|
|
|
447
389
|
decorators_js.property({ type: String, attribute: 'mobile-position' }),
|
|
448
390
|
tslib_es6.__metadata("design:type", String)
|
|
449
391
|
], exports.HDropdown.prototype, "mobilePosition", void 0);
|
|
450
|
-
tslib_es6.__decorate([
|
|
451
|
-
decorators_js.property({ type: String, attribute: 'id', reflect: true }),
|
|
452
|
-
tslib_es6.__metadata("design:type", Object)
|
|
453
|
-
], exports.HDropdown.prototype, "id", void 0);
|
|
454
|
-
tslib_es6.__decorate([
|
|
455
|
-
decorators_js.property({ type: Boolean, attribute: 'prevent-focus-trap' }),
|
|
456
|
-
tslib_es6.__metadata("design:type", Object)
|
|
457
|
-
], exports.HDropdown.prototype, "preventFocusTrap", void 0);
|
|
458
392
|
exports.HDropdown = HDropdown_1 = tslib_es6.__decorate([
|
|
459
393
|
phoenix_custom_element.phoenixCustomElement('h-dropdown'),
|
|
460
394
|
tslib_es6.__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var lit = require('lit');
|
|
6
7
|
var decorators = require('lit/decorators');
|
|
7
8
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
9
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
@@ -22,6 +23,10 @@ exports.HDropdownContent = class HDropdownContent extends phoenix_light_lit_elem
|
|
|
22
23
|
element.setAttribute('role', 'menuitem');
|
|
23
24
|
});
|
|
24
25
|
}
|
|
26
|
+
render() {
|
|
27
|
+
super.render();
|
|
28
|
+
return lit.html ` <div role="dialog">${this.getSlot('content')}</div> `;
|
|
29
|
+
}
|
|
25
30
|
};
|
|
26
31
|
tslib_es6.__decorate([
|
|
27
32
|
decorators.property({ type: String }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
6
|
var decorators = require('lit/decorators');
|
|
7
|
-
require('@dreamcommerce/utilities');
|
|
7
|
+
var utilities = require('@dreamcommerce/utilities');
|
|
8
8
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
9
9
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
10
10
|
var btn_controller = require('../../controllers/btn_controller/btn_controller.js');
|
|
@@ -16,17 +16,6 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
this.name = '';
|
|
19
|
-
this._setupTogglerAria = () => {
|
|
20
|
-
this._$dropdown = this.closest(dropdown_constants.DROPDOWN_CONTAINER_NAME);
|
|
21
|
-
if (this._$dropdown.isOpened)
|
|
22
|
-
this._toggleElementAriaController = new toggle_element_aria_controller.ToggleElementAriaController({
|
|
23
|
-
host: this,
|
|
24
|
-
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
25
|
-
});
|
|
26
|
-
this.setAttribute('aria-haspopup', 'true');
|
|
27
|
-
if (this._$dropdown.id)
|
|
28
|
-
this.setAttribute('aria-controls', this._$dropdown.id);
|
|
29
|
-
};
|
|
30
19
|
this._dispatchToggleDropdownEventWithKeyboard = (ev) => {
|
|
31
20
|
ev.stopImmediatePropagation();
|
|
32
21
|
this._dispatchToggleDropdownEvent(ev);
|
|
@@ -40,6 +29,18 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
40
29
|
ev.preventDefault();
|
|
41
30
|
this.emitCustomEvent(dropdown_constants.DROPDOWN_EVENTS.toggle);
|
|
42
31
|
};
|
|
32
|
+
this._handleFocusToOpenedDropdown = async (ev) => {
|
|
33
|
+
if (ev.target !== this)
|
|
34
|
+
return;
|
|
35
|
+
const isOpened = this._$dropdown.isOpened();
|
|
36
|
+
if (!isOpened)
|
|
37
|
+
return;
|
|
38
|
+
const $dropdownContent = document.querySelector(`${dropdown_constants.DROPDOWN_CONTENT_NAME}[name="${this.name}"]`);
|
|
39
|
+
if (!$dropdownContent)
|
|
40
|
+
return;
|
|
41
|
+
ev.preventDefault();
|
|
42
|
+
utilities.UiDomUtils.setFocusToFirstFocusableElementInContainer($dropdownContent);
|
|
43
|
+
};
|
|
43
44
|
this.slot = this.hasAttribute('slot') ? this.slot : 'toggler';
|
|
44
45
|
this.className = `${dropdown_constants.DROPDOWN_CSS_CLASSES.toggler} ${this.className}`;
|
|
45
46
|
}
|
|
@@ -47,7 +48,13 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
47
48
|
var _a;
|
|
48
49
|
super.connectedCallback();
|
|
49
50
|
this._btnController = new btn_controller.BtnController(this, this._dispatchToggleDropdownEventWithKeyboard);
|
|
50
|
-
this.
|
|
51
|
+
this._$dropdown = this.closest(dropdown_constants.DROPDOWN_CONTAINER_NAME);
|
|
52
|
+
if (this._$dropdown.isOpened)
|
|
53
|
+
this._toggleElementAriaController = new toggle_element_aria_controller.ToggleElementAriaController({
|
|
54
|
+
host: this,
|
|
55
|
+
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
56
|
+
});
|
|
57
|
+
document.addEventListener('keydown', this._handleFocusToOpenedDropdown);
|
|
51
58
|
const hasToggleOnHover = (_a = this._$dropdown) === null || _a === void 0 ? void 0 : _a.hasAttribute(dropdown_constants.DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME);
|
|
52
59
|
if (hasToggleOnHover) {
|
|
53
60
|
this.addEventListener('click', this._dispatchToggleDropdownEventOnMobile);
|
|
@@ -55,6 +62,10 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
55
62
|
}
|
|
56
63
|
this.addEventListener('click', this._dispatchToggleDropdownEvent);
|
|
57
64
|
}
|
|
65
|
+
disconnectedCallback() {
|
|
66
|
+
super.disconnectedCallback();
|
|
67
|
+
document.removeEventListener('keydown', this._handleFocusToOpenedDropdown);
|
|
68
|
+
}
|
|
58
69
|
};
|
|
59
70
|
tslib_es6.__decorate([
|
|
60
71
|
decorators.property({ type: String, reflect: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -154,7 +154,7 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
154
154
|
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage, false);
|
|
155
155
|
document.addEventListener('keyup', this._bindKeys);
|
|
156
156
|
});
|
|
157
|
-
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.
|
|
157
|
+
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.keyup, (ev) => {
|
|
158
158
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
159
159
|
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage);
|
|
160
160
|
});
|
|
@@ -281,7 +281,7 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
281
281
|
class="${search_constants.SEARCH_CLASS_NAMES.icon} labeled-icon"
|
|
282
282
|
tabindex="0"
|
|
283
283
|
@click=${this._handleOpenSearch}
|
|
284
|
-
@
|
|
284
|
+
@keyup=${this._handleOpenSearchWithKeyboard}
|
|
285
285
|
>
|
|
286
286
|
<h-icon icon-name="icon-search" size=${icon_constants.ICONS_SIZES.l}></h-icon>
|
|
287
287
|
<div class="labeled-icon__signature">${this._translations.search}</div>
|
|
@@ -30,7 +30,7 @@ const SEARCH_CUSTOM_EVENT_NAMES = {
|
|
|
30
30
|
search: 'search',
|
|
31
31
|
updateSearchPhrase: 'updateSearchPhrase',
|
|
32
32
|
focusin: 'searchFocusIn',
|
|
33
|
-
|
|
33
|
+
keyup: 'searchKeyUp'
|
|
34
34
|
};
|
|
35
35
|
const baseSearchCssClass = 'search';
|
|
36
36
|
const SEARCH_CLASS_NAMES = {
|
package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js
CHANGED
|
@@ -57,7 +57,7 @@ exports.HSearchInput = class HSearchInput extends phoenix_light_lit_element.Phoe
|
|
|
57
57
|
if (ev.key === 'ArrowUp' || ev.key === 'ArrowDown' || ev.key === 'Escape')
|
|
58
58
|
return;
|
|
59
59
|
if (ev.key !== 'Enter') {
|
|
60
|
-
this.emitCustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.
|
|
60
|
+
this.emitCustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.keyup, {
|
|
61
61
|
detail: {
|
|
62
62
|
searchPhrase: ev.target.value
|
|
63
63
|
}
|
|
@@ -95,7 +95,7 @@ exports.HSearchInput = class HSearchInput extends phoenix_light_lit_element.Phoe
|
|
|
95
95
|
if (!ev.detail || ev.detail.moduleInstanceId !== this.moduleInstanceId)
|
|
96
96
|
return;
|
|
97
97
|
this._input.value = ev.detail.searchPhrase;
|
|
98
|
-
this.emitCustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.
|
|
98
|
+
this.emitCustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.keyup, {
|
|
99
99
|
detail: {
|
|
100
100
|
searchPhrase: ev.detail.searchPhrase
|
|
101
101
|
}
|
|
@@ -233,7 +233,9 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
233
233
|
select_utils.SelectControlUtils.appendHTMLOption($option, $list, position);
|
|
234
234
|
}
|
|
235
235
|
updateOptionAriaAttribute($option) {
|
|
236
|
-
|
|
236
|
+
!$option.selected
|
|
237
|
+
? $option.removeAttribute(this.multiple ? 'aria-checked' : 'aria-selected')
|
|
238
|
+
: $option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', 'true');
|
|
237
239
|
}
|
|
238
240
|
_removeHTMLOptions(optionsValues) {
|
|
239
241
|
this._$options = select_utils.SelectControlUtils.removeHTMLOptions(Array.from(this._$options.values()), optionsValues);
|
|
@@ -298,7 +300,6 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
298
300
|
name="${this.controlName}"
|
|
299
301
|
offset=${this.offset}
|
|
300
302
|
content-width="full"
|
|
301
|
-
prevent-focus-trap
|
|
302
303
|
>
|
|
303
304
|
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(select_constants.SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
304
305
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/cjs/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js
CHANGED
|
@@ -7,21 +7,11 @@ require('lit');
|
|
|
7
7
|
|
|
8
8
|
var _KeystrokesController_host, _KeystrokesController_target;
|
|
9
9
|
class KeystrokesController {
|
|
10
|
-
constructor({ host, keys, callback, target
|
|
10
|
+
constructor({ host, keys, callback, target }) {
|
|
11
11
|
_KeystrokesController_host.set(this, void 0);
|
|
12
12
|
_KeystrokesController_target.set(this, void 0);
|
|
13
13
|
this._buffer = [];
|
|
14
|
-
this._clearBuffer = (
|
|
15
|
-
if (!this._containerSelectors) {
|
|
16
|
-
this._buffer = [];
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const $newFocusedElement = ev.relatedTarget;
|
|
20
|
-
if ($newFocusedElement) {
|
|
21
|
-
const isNewFocusedElementAChild = !!this._containerSelectors.find((containerSelector) => !!$newFocusedElement.closest(containerSelector));
|
|
22
|
-
if (isNewFocusedElementAChild)
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
14
|
+
this._clearBuffer = () => {
|
|
25
15
|
this._buffer = [];
|
|
26
16
|
};
|
|
27
17
|
this._saveKey = (ev) => {
|
|
@@ -89,7 +79,6 @@ class KeystrokesController {
|
|
|
89
79
|
tslib_es6.__classPrivateFieldSet(this, _KeystrokesController_target, target, "f");
|
|
90
80
|
this._keys = keys;
|
|
91
81
|
this._callback = callback;
|
|
92
|
-
this._containerSelectors = containerSelectors;
|
|
93
82
|
tslib_es6.__classPrivateFieldGet(this, _KeystrokesController_host, "f").addController(this);
|
|
94
83
|
}
|
|
95
84
|
hostConnected() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -15,8 +15,6 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
15
15
|
contentWidth: TDropdownContentWidth;
|
|
16
16
|
portalTarget: string;
|
|
17
17
|
mobilePosition: TMobileElementPosition;
|
|
18
|
-
id: string;
|
|
19
|
-
preventFocusTrap: boolean;
|
|
20
18
|
$dropdownToggler: HDropdownToggler | null;
|
|
21
19
|
$dropdownContent: HDropdownContent | null;
|
|
22
20
|
$nestedDropdownContentElements?: HDropdownContent[];
|
|
@@ -42,18 +40,12 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
42
40
|
private _observeScrollToggling;
|
|
43
41
|
private _toggleScroll;
|
|
44
42
|
private _closeDropdownOnEscape;
|
|
45
|
-
private
|
|
46
|
-
private
|
|
47
|
-
private
|
|
48
|
-
private
|
|
49
|
-
private _handleDefaultFocusFromDropdownBackwards;
|
|
50
|
-
private _handleFocusFromTogglerBackwards;
|
|
51
|
-
private _handleFocusFromSentinelStartBackwards;
|
|
52
|
-
private _getTrulyFocusableElements;
|
|
53
|
-
private _isElementTrulyFocusable;
|
|
43
|
+
private _handleForwardFocus;
|
|
44
|
+
private _handleFocusOnNextElement;
|
|
45
|
+
private _focusOnNextElementAfterToggler;
|
|
46
|
+
private _handleBackwardFocus;
|
|
54
47
|
private _hoverToggle;
|
|
55
48
|
private _isHoveredWithinDropdown;
|
|
56
|
-
private _focusOnFirstContentElement;
|
|
57
49
|
private _setupInitialDropdownProperties;
|
|
58
50
|
isOpened: () => boolean;
|
|
59
51
|
private _positionDropdownContent;
|
|
@@ -6,9 +6,8 @@ import { property } from '@lit/reactive-element/decorators.js';
|
|
|
6
6
|
import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
|
|
7
7
|
import { html } from 'lit-html';
|
|
8
8
|
import { BREAKPOINTS, SCROLLABLE_CLASS_NAME } from '../../global_constants.js';
|
|
9
|
-
import { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTENT_CSS_CLASSES, DROPDOWN_EVENTS, DROPDOWN_CONTAINER_NAME,
|
|
9
|
+
import { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTENT_CSS_CLASSES, DROPDOWN_EVENTS, DROPDOWN_CONTAINER_NAME, DROPDOWN_CONTENT_NAME, DROPDOWN_CONTENT_WIDTH, DROPDOWN_TOGGLER_NAME } from './dropdown_constants.js';
|
|
10
10
|
import { RELATIVE_POSITION_CONTROLLER_EVENTS, DEFAULT_THROTTLE_WAIT_TIME } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
|
|
11
|
-
import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
|
|
12
11
|
import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
|
|
13
12
|
import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
|
|
14
13
|
import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
|
|
@@ -26,8 +25,6 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
26
25
|
this.transition = 'direction';
|
|
27
26
|
this.offset = 0;
|
|
28
27
|
this.portalTarget = DEFAULT_DROPDOWN_PORTAL_NAME;
|
|
29
|
-
this.id = v4();
|
|
30
|
-
this.preventFocusTrap = false;
|
|
31
28
|
this._backdropController = new BackdropController();
|
|
32
29
|
this._handleClickOutside = async (target) => {
|
|
33
30
|
var _a, _b;
|
|
@@ -44,7 +41,7 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
44
41
|
return;
|
|
45
42
|
}
|
|
46
43
|
await this.show();
|
|
47
|
-
|
|
44
|
+
UiDomUtils.setFocusToFirstFocusableElementInContainer(this.$dropdownContent);
|
|
48
45
|
};
|
|
49
46
|
this.show = async () => {
|
|
50
47
|
if (this.opened)
|
|
@@ -135,24 +132,44 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
135
132
|
return;
|
|
136
133
|
await this.hide();
|
|
137
134
|
};
|
|
138
|
-
this.
|
|
139
|
-
if (
|
|
135
|
+
this._handleForwardFocus = async (ev) => {
|
|
136
|
+
// if (!this.opened) this._handleFocusOnNextElement(ev);
|
|
137
|
+
if (!this.opened || ev.shiftKey)
|
|
140
138
|
return;
|
|
141
|
-
const $
|
|
142
|
-
this.
|
|
143
|
-
|
|
139
|
+
const $focusableElementsWithinDropdownContent = UiDomUtils.getFocusableElements(this.$dropdownContent).filter((element) => element.closest(DROPDOWN_CONTENT_NAME) === this.$dropdownContent);
|
|
140
|
+
const doesNotHaveFocusableElementsInsideContent = $focusableElementsWithinDropdownContent.length <= 0 && this.opened;
|
|
141
|
+
const indexOfCurrentlyFocusedElement = $focusableElementsWithinDropdownContent.indexOf(document.activeElement);
|
|
142
|
+
const isActiveElementLastFocusableElement = indexOfCurrentlyFocusedElement === $focusableElementsWithinDropdownContent.length - 1;
|
|
143
|
+
if (doesNotHaveFocusableElementsInsideContent || isActiveElementLastFocusableElement)
|
|
144
|
+
this._handleFocusOnNextElement(ev);
|
|
144
145
|
};
|
|
145
|
-
this.
|
|
146
|
-
|
|
146
|
+
this._handleFocusOnNextElement = async (ev) => {
|
|
147
|
+
var _a;
|
|
148
|
+
ev.preventDefault();
|
|
149
|
+
const $focusableElements = UiDomUtils.getFocusableElements(document.body);
|
|
150
|
+
const indexOfDropdownToggler = $focusableElements.indexOf(this.$dropdownToggler);
|
|
151
|
+
const $nextElementToFocus = (_a = $focusableElements[indexOfDropdownToggler + 1]) !== null && _a !== void 0 ? _a : $focusableElements[0];
|
|
152
|
+
await this._hideDropdownsSequentially();
|
|
153
|
+
await this.hide();
|
|
154
|
+
this._focusOnNextElementAfterToggler($nextElementToFocus);
|
|
155
|
+
};
|
|
156
|
+
this._focusOnNextElementAfterToggler = ($elementToFocus) => {
|
|
157
|
+
var _a;
|
|
158
|
+
const isTogglerLastChildOfPreviousDropdown = ($elementToFocus === null || $elementToFocus === void 0 ? void 0 : $elementToFocus.closest(DROPDOWN_CONTENT_NAME)) === this.$dropdownContent;
|
|
159
|
+
if (isTogglerLastChildOfPreviousDropdown) {
|
|
160
|
+
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
147
161
|
return;
|
|
148
|
-
const $target = ev.target;
|
|
149
|
-
if (this.preventFocusTrap) {
|
|
150
|
-
this._handleDefaultFocusFromDropdownBackwards(ev);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
this._handleFocusFromTogglerBackwards(ev, $target);
|
|
154
|
-
this._handleFocusFromSentinelStartBackwards(ev, $target);
|
|
155
162
|
}
|
|
163
|
+
$elementToFocus === null || $elementToFocus === void 0 ? void 0 : $elementToFocus.focus();
|
|
164
|
+
};
|
|
165
|
+
this._handleBackwardFocus = async (ev) => {
|
|
166
|
+
var _a;
|
|
167
|
+
const $firstFocusableElement = this.$dropdownContent && UiDomUtils.getFocusableElement(this.$dropdownContent);
|
|
168
|
+
if (document.activeElement !== $firstFocusableElement)
|
|
169
|
+
return;
|
|
170
|
+
ev.preventDefault();
|
|
171
|
+
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
172
|
+
await this._hideDropdownsSequentially();
|
|
156
173
|
};
|
|
157
174
|
this._hoverToggle = async (ev) => {
|
|
158
175
|
if (window.innerWidth < BREAKPOINTS.xs)
|
|
@@ -164,19 +181,12 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
164
181
|
const isHoveredWithinDropdown = this._isHoveredWithinDropdown(ev.target);
|
|
165
182
|
if (isHoveredWithinDropdown && !this.opened) {
|
|
166
183
|
await this.show();
|
|
167
|
-
|
|
184
|
+
UiDomUtils.setFocusToFirstFocusableElementInContainer(this.$dropdownContent);
|
|
168
185
|
return;
|
|
169
186
|
}
|
|
170
187
|
if (!isHoveredWithinDropdown && this.opened)
|
|
171
188
|
await this._hideDropdownsSequentially();
|
|
172
189
|
};
|
|
173
|
-
this._focusOnFirstContentElement = () => {
|
|
174
|
-
if (!this.$dropdownContent)
|
|
175
|
-
return;
|
|
176
|
-
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
177
|
-
if ($firstFocusableElement)
|
|
178
|
-
$firstFocusableElement.focus();
|
|
179
|
-
};
|
|
180
190
|
this.isOpened = () => this.opened;
|
|
181
191
|
this._positionDropdownContent = () => {
|
|
182
192
|
if (this.contentWidth === DROPDOWN_CONTENT_WIDTH.full)
|
|
@@ -202,14 +212,13 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
202
212
|
host: this,
|
|
203
213
|
target: document.body,
|
|
204
214
|
keys: ['tab'],
|
|
205
|
-
callback: this.
|
|
215
|
+
callback: this._handleForwardFocus
|
|
206
216
|
});
|
|
207
217
|
new KeystrokesController({
|
|
208
218
|
host: this,
|
|
209
219
|
target: document.body,
|
|
210
220
|
keys: [['shift', 'tab']],
|
|
211
|
-
callback: this.
|
|
212
|
-
containerSelectors: ['h-dropdown', 'h-dropdown-content']
|
|
221
|
+
callback: this._handleBackwardFocus
|
|
213
222
|
});
|
|
214
223
|
}
|
|
215
224
|
async connectedCallback() {
|
|
@@ -285,71 +294,6 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
285
294
|
(_b = this.$dropdownContent) === null || _b === void 0 ? void 0 : _b.classList.add(SCROLLABLE_CLASS_NAME);
|
|
286
295
|
}
|
|
287
296
|
}
|
|
288
|
-
_handleFocusFromTogglerForwards(ev, $target) {
|
|
289
|
-
var _a;
|
|
290
|
-
if (!((_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.contains($target)) || !this.opened || !this.$dropdownContent)
|
|
291
|
-
return;
|
|
292
|
-
ev.preventDefault();
|
|
293
|
-
this._getTrulyFocusableElements(this.$dropdownContent)[0].focus();
|
|
294
|
-
}
|
|
295
|
-
_handleFocusFromSentinelEndForwards(ev, $target) {
|
|
296
|
-
var _a;
|
|
297
|
-
if (!this.$dropdownContent)
|
|
298
|
-
return;
|
|
299
|
-
const $lastFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent).slice(-1)[0];
|
|
300
|
-
if (this.preventFocusTrap && document.activeElement) {
|
|
301
|
-
const $nextFocusableElement = UiDomUtils.getNextFocusableElement(document.activeElement);
|
|
302
|
-
if ($nextFocusableElement === $lastFocusableElement) {
|
|
303
|
-
this.hide();
|
|
304
|
-
UiDomUtils.getNextFocusableElement(this.$dropdownToggler || this).focus();
|
|
305
|
-
}
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
if ($target !== $lastFocusableElement)
|
|
309
|
-
return;
|
|
310
|
-
ev.preventDefault();
|
|
311
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
312
|
-
}
|
|
313
|
-
_handleDefaultFocusFromDropdownBackwards(ev) {
|
|
314
|
-
ev.preventDefault();
|
|
315
|
-
this.hide();
|
|
316
|
-
UiDomUtils.getPreviousFocusableElement(this.$dropdownToggler || this).focus();
|
|
317
|
-
}
|
|
318
|
-
_handleFocusFromTogglerBackwards(ev, $target) {
|
|
319
|
-
var _a;
|
|
320
|
-
if ($target !== this.$dropdownToggler && !((_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.contains($target)) || !this.$dropdownContent)
|
|
321
|
-
return;
|
|
322
|
-
ev.preventDefault();
|
|
323
|
-
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
324
|
-
const $lastFocusableElement = trulyFocusableElements.slice(-1)[0];
|
|
325
|
-
$lastFocusableElement.focus();
|
|
326
|
-
}
|
|
327
|
-
_handleFocusFromSentinelStartBackwards(ev, $target) {
|
|
328
|
-
var _a;
|
|
329
|
-
if (!this.$dropdownContent)
|
|
330
|
-
return;
|
|
331
|
-
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
332
|
-
if ($target !== $firstFocusableElement)
|
|
333
|
-
return;
|
|
334
|
-
ev.preventDefault();
|
|
335
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
336
|
-
}
|
|
337
|
-
_getTrulyFocusableElements($container) {
|
|
338
|
-
const focusableElements = UiDomUtils.getFocusableElements($container);
|
|
339
|
-
return focusableElements.filter(($el) => this._isElementTrulyFocusable($el));
|
|
340
|
-
}
|
|
341
|
-
_isElementTrulyFocusable($el) {
|
|
342
|
-
const style = window.getComputedStyle($el);
|
|
343
|
-
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
if ($el.nodeName === 'H-PORTAL')
|
|
347
|
-
return true;
|
|
348
|
-
const $parent = $el.parentElement;
|
|
349
|
-
if (!$parent)
|
|
350
|
-
return true;
|
|
351
|
-
return this._isElementTrulyFocusable($parent);
|
|
352
|
-
}
|
|
353
297
|
_isHoveredWithinDropdown(element) {
|
|
354
298
|
var _a;
|
|
355
299
|
if (element === this)
|
|
@@ -373,8 +317,6 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
373
317
|
return;
|
|
374
318
|
if (!this._hasScrollableClassInitially)
|
|
375
319
|
this._hasScrollableClassInitially = this.$dropdownContent.classList.contains(SCROLLABLE_CLASS_NAME);
|
|
376
|
-
if (!this.preventFocusTrap)
|
|
377
|
-
this.$dropdownContent.setAttribute('aria-modal', 'true');
|
|
378
320
|
}
|
|
379
321
|
_getDropdownContentWidth() {
|
|
380
322
|
const isMobileResolution = document.documentElement.clientWidth < BREAKPOINTS.xs;
|
|
@@ -443,14 +385,6 @@ __decorate([
|
|
|
443
385
|
property({ type: String, attribute: 'mobile-position' }),
|
|
444
386
|
__metadata("design:type", String)
|
|
445
387
|
], HDropdown.prototype, "mobilePosition", void 0);
|
|
446
|
-
__decorate([
|
|
447
|
-
property({ type: String, attribute: 'id', reflect: true }),
|
|
448
|
-
__metadata("design:type", Object)
|
|
449
|
-
], HDropdown.prototype, "id", void 0);
|
|
450
|
-
__decorate([
|
|
451
|
-
property({ type: Boolean, attribute: 'prevent-focus-trap' }),
|
|
452
|
-
__metadata("design:type", Object)
|
|
453
|
-
], HDropdown.prototype, "preventFocusTrap", void 0);
|
|
454
388
|
HDropdown = HDropdown_1 = __decorate([
|
|
455
389
|
phoenixCustomElement('h-dropdown'),
|
|
456
390
|
__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6 +1,8 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
1
2
|
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
3
|
export declare class HDropdownContent extends PhoenixLightLitElement {
|
|
3
4
|
name: string;
|
|
4
5
|
constructor();
|
|
5
6
|
connectedCallback(): void;
|
|
7
|
+
protected render(): TemplateResult;
|
|
6
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { html } from 'lit';
|
|
2
3
|
import { property } from 'lit/decorators';
|
|
3
4
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
5
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
@@ -18,6 +19,10 @@ let HDropdownContent = class HDropdownContent extends PhoenixLightLitElement {
|
|
|
18
19
|
element.setAttribute('role', 'menuitem');
|
|
19
20
|
});
|
|
20
21
|
}
|
|
22
|
+
render() {
|
|
23
|
+
super.render();
|
|
24
|
+
return html ` <div role="dialog">${this.getSlot('content')}</div> `;
|
|
25
|
+
}
|
|
21
26
|
};
|
|
22
27
|
__decorate([
|
|
23
28
|
property({ type: String }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;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,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -6,8 +6,9 @@ export declare class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
6
6
|
private _$dropdown;
|
|
7
7
|
constructor();
|
|
8
8
|
connectedCallback(): void;
|
|
9
|
-
private _setupTogglerAria;
|
|
10
9
|
private _dispatchToggleDropdownEventWithKeyboard;
|
|
11
10
|
private _dispatchToggleDropdownEventOnMobile;
|
|
12
11
|
private _dispatchToggleDropdownEvent;
|
|
12
|
+
private _handleFocusToOpenedDropdown;
|
|
13
|
+
disconnectedCallback(): void;
|
|
13
14
|
}
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { property } from 'lit/decorators';
|
|
3
|
-
import '@dreamcommerce/utilities';
|
|
3
|
+
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
4
4
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
5
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
6
6
|
import { BtnController } from '../../controllers/btn_controller/btn_controller.js';
|
|
7
7
|
import { BREAKPOINTS } from '../../global_constants.js';
|
|
8
|
-
import {
|
|
8
|
+
import { DROPDOWN_EVENTS, DROPDOWN_CONTENT_NAME, DROPDOWN_CSS_CLASSES, DROPDOWN_CONTAINER_NAME, DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME } from './dropdown_constants.js';
|
|
9
9
|
import { ToggleElementAriaController } from '../../controllers/toggle_element_aria_controller/toggle_element_aria_controller.js';
|
|
10
10
|
|
|
11
11
|
let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
14
|
this.name = '';
|
|
15
|
-
this._setupTogglerAria = () => {
|
|
16
|
-
this._$dropdown = this.closest(DROPDOWN_CONTAINER_NAME);
|
|
17
|
-
if (this._$dropdown.isOpened)
|
|
18
|
-
this._toggleElementAriaController = new ToggleElementAriaController({
|
|
19
|
-
host: this,
|
|
20
|
-
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
21
|
-
});
|
|
22
|
-
this.setAttribute('aria-haspopup', 'true');
|
|
23
|
-
if (this._$dropdown.id)
|
|
24
|
-
this.setAttribute('aria-controls', this._$dropdown.id);
|
|
25
|
-
};
|
|
26
15
|
this._dispatchToggleDropdownEventWithKeyboard = (ev) => {
|
|
27
16
|
ev.stopImmediatePropagation();
|
|
28
17
|
this._dispatchToggleDropdownEvent(ev);
|
|
@@ -36,6 +25,18 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
36
25
|
ev.preventDefault();
|
|
37
26
|
this.emitCustomEvent(DROPDOWN_EVENTS.toggle);
|
|
38
27
|
};
|
|
28
|
+
this._handleFocusToOpenedDropdown = async (ev) => {
|
|
29
|
+
if (ev.target !== this)
|
|
30
|
+
return;
|
|
31
|
+
const isOpened = this._$dropdown.isOpened();
|
|
32
|
+
if (!isOpened)
|
|
33
|
+
return;
|
|
34
|
+
const $dropdownContent = document.querySelector(`${DROPDOWN_CONTENT_NAME}[name="${this.name}"]`);
|
|
35
|
+
if (!$dropdownContent)
|
|
36
|
+
return;
|
|
37
|
+
ev.preventDefault();
|
|
38
|
+
UiDomUtils.setFocusToFirstFocusableElementInContainer($dropdownContent);
|
|
39
|
+
};
|
|
39
40
|
this.slot = this.hasAttribute('slot') ? this.slot : 'toggler';
|
|
40
41
|
this.className = `${DROPDOWN_CSS_CLASSES.toggler} ${this.className}`;
|
|
41
42
|
}
|
|
@@ -43,7 +44,13 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
43
44
|
var _a;
|
|
44
45
|
super.connectedCallback();
|
|
45
46
|
this._btnController = new BtnController(this, this._dispatchToggleDropdownEventWithKeyboard);
|
|
46
|
-
this.
|
|
47
|
+
this._$dropdown = this.closest(DROPDOWN_CONTAINER_NAME);
|
|
48
|
+
if (this._$dropdown.isOpened)
|
|
49
|
+
this._toggleElementAriaController = new ToggleElementAriaController({
|
|
50
|
+
host: this,
|
|
51
|
+
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
52
|
+
});
|
|
53
|
+
document.addEventListener('keydown', this._handleFocusToOpenedDropdown);
|
|
47
54
|
const hasToggleOnHover = (_a = this._$dropdown) === null || _a === void 0 ? void 0 : _a.hasAttribute(DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME);
|
|
48
55
|
if (hasToggleOnHover) {
|
|
49
56
|
this.addEventListener('click', this._dispatchToggleDropdownEventOnMobile);
|
|
@@ -51,6 +58,10 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
51
58
|
}
|
|
52
59
|
this.addEventListener('click', this._dispatchToggleDropdownEvent);
|
|
53
60
|
}
|
|
61
|
+
disconnectedCallback() {
|
|
62
|
+
super.disconnectedCallback();
|
|
63
|
+
document.removeEventListener('keydown', this._handleFocusToOpenedDropdown);
|
|
64
|
+
}
|
|
54
65
|
};
|
|
55
66
|
__decorate([
|
|
56
67
|
property({ type: String, reflect: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -150,7 +150,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
150
150
|
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage, false);
|
|
151
151
|
document.addEventListener('keyup', this._bindKeys);
|
|
152
152
|
});
|
|
153
|
-
this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.
|
|
153
|
+
this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.keyup, (ev) => {
|
|
154
154
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
155
155
|
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage);
|
|
156
156
|
});
|
|
@@ -277,7 +277,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
277
277
|
class="${SEARCH_CLASS_NAMES.icon} labeled-icon"
|
|
278
278
|
tabindex="0"
|
|
279
279
|
@click=${this._handleOpenSearch}
|
|
280
|
-
@
|
|
280
|
+
@keyup=${this._handleOpenSearchWithKeyboard}
|
|
281
281
|
>
|
|
282
282
|
<h-icon icon-name="icon-search" size=${ICONS_SIZES.l}></h-icon>
|
|
283
283
|
<div class="labeled-icon__signature">${this._translations.search}</div>
|
|
@@ -27,7 +27,7 @@ export declare const SEARCH_CUSTOM_EVENT_NAMES: {
|
|
|
27
27
|
readonly search: "search";
|
|
28
28
|
readonly updateSearchPhrase: "updateSearchPhrase";
|
|
29
29
|
readonly focusin: "searchFocusIn";
|
|
30
|
-
readonly
|
|
30
|
+
readonly keyup: "searchKeyUp";
|
|
31
31
|
};
|
|
32
32
|
export declare const SEARCH_CLASS_NAMES: {
|
|
33
33
|
readonly searchBar: "search__bar";
|
|
@@ -26,7 +26,7 @@ const SEARCH_CUSTOM_EVENT_NAMES = {
|
|
|
26
26
|
search: 'search',
|
|
27
27
|
updateSearchPhrase: 'updateSearchPhrase',
|
|
28
28
|
focusin: 'searchFocusIn',
|
|
29
|
-
|
|
29
|
+
keyup: 'searchKeyUp'
|
|
30
30
|
};
|
|
31
31
|
const baseSearchCssClass = 'search';
|
|
32
32
|
const SEARCH_CLASS_NAMES = {
|
package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js
CHANGED
|
@@ -53,7 +53,7 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
|
|
|
53
53
|
if (ev.key === 'ArrowUp' || ev.key === 'ArrowDown' || ev.key === 'Escape')
|
|
54
54
|
return;
|
|
55
55
|
if (ev.key !== 'Enter') {
|
|
56
|
-
this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.
|
|
56
|
+
this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.keyup, {
|
|
57
57
|
detail: {
|
|
58
58
|
searchPhrase: ev.target.value
|
|
59
59
|
}
|
|
@@ -91,7 +91,7 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
|
|
|
91
91
|
if (!ev.detail || ev.detail.moduleInstanceId !== this.moduleInstanceId)
|
|
92
92
|
return;
|
|
93
93
|
this._input.value = ev.detail.searchPhrase;
|
|
94
|
-
this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.
|
|
94
|
+
this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.keyup, {
|
|
95
95
|
detail: {
|
|
96
96
|
searchPhrase: ev.detail.searchPhrase
|
|
97
97
|
}
|
|
@@ -229,7 +229,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
229
229
|
SelectControlUtils.appendHTMLOption($option, $list, position);
|
|
230
230
|
}
|
|
231
231
|
updateOptionAriaAttribute($option) {
|
|
232
|
-
|
|
232
|
+
!$option.selected
|
|
233
|
+
? $option.removeAttribute(this.multiple ? 'aria-checked' : 'aria-selected')
|
|
234
|
+
: $option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', 'true');
|
|
233
235
|
}
|
|
234
236
|
_removeHTMLOptions(optionsValues) {
|
|
235
237
|
this._$options = SelectControlUtils.removeHTMLOptions(Array.from(this._$options.values()), optionsValues);
|
|
@@ -294,7 +296,6 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
294
296
|
name="${this.controlName}"
|
|
295
297
|
offset=${this.offset}
|
|
296
298
|
content-width="full"
|
|
297
|
-
prevent-focus-trap
|
|
298
299
|
>
|
|
299
300
|
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
300
301
|
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.d.ts
CHANGED
|
@@ -4,9 +4,8 @@ export declare class KeystrokesController implements ReactiveController {
|
|
|
4
4
|
#private;
|
|
5
5
|
private _keys;
|
|
6
6
|
private _callback;
|
|
7
|
-
private _containerSelectors?;
|
|
8
7
|
private _buffer;
|
|
9
|
-
constructor({ host, keys, callback, target
|
|
8
|
+
constructor({ host, keys, callback, target }: TKeystrokesControllerProps);
|
|
10
9
|
hostConnected(): void;
|
|
11
10
|
hostDisconnected(): void;
|
|
12
11
|
private _clearBuffer;
|
package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js
CHANGED
|
@@ -3,21 +3,11 @@ import 'lit';
|
|
|
3
3
|
|
|
4
4
|
var _KeystrokesController_host, _KeystrokesController_target;
|
|
5
5
|
class KeystrokesController {
|
|
6
|
-
constructor({ host, keys, callback, target
|
|
6
|
+
constructor({ host, keys, callback, target }) {
|
|
7
7
|
_KeystrokesController_host.set(this, void 0);
|
|
8
8
|
_KeystrokesController_target.set(this, void 0);
|
|
9
9
|
this._buffer = [];
|
|
10
|
-
this._clearBuffer = (
|
|
11
|
-
if (!this._containerSelectors) {
|
|
12
|
-
this._buffer = [];
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const $newFocusedElement = ev.relatedTarget;
|
|
16
|
-
if ($newFocusedElement) {
|
|
17
|
-
const isNewFocusedElementAChild = !!this._containerSelectors.find((containerSelector) => !!$newFocusedElement.closest(containerSelector));
|
|
18
|
-
if (isNewFocusedElementAChild)
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
10
|
+
this._clearBuffer = () => {
|
|
21
11
|
this._buffer = [];
|
|
22
12
|
};
|
|
23
13
|
this._saveKey = (ev) => {
|
|
@@ -85,7 +75,6 @@ class KeystrokesController {
|
|
|
85
75
|
__classPrivateFieldSet(this, _KeystrokesController_target, target, "f");
|
|
86
76
|
this._keys = keys;
|
|
87
77
|
this._callback = callback;
|
|
88
|
-
this._containerSelectors = containerSelectors;
|
|
89
78
|
__classPrivateFieldGet(this, _KeystrokesController_host, "f").addController(this);
|
|
90
79
|
}
|
|
91
80
|
hostConnected() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@shoper/phoenix_design_system",
|
|
3
3
|
"packageManager": "yarn@3.2.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "1.11.9-
|
|
5
|
+
"version": "1.11.9-2",
|
|
6
6
|
"description": "phoenix design system",
|
|
7
7
|
"author": "zefirek",
|
|
8
8
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@splidejs/splide": "^4.0.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@dreamcommerce/utilities": "^1.19.0
|
|
33
|
+
"@dreamcommerce/utilities": "^1.19.0",
|
|
34
34
|
"@shoper/jest_config": "^0.0.0",
|
|
35
35
|
"@shoper/tsconfig": "^0.0.0",
|
|
36
36
|
"@splidejs/splide": "4.0.7",
|