@shoper/phoenix_design_system 1.18.23-1 → 1.18.23-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 +14 -77
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +27 -0
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +37 -18
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +13 -59
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js +1 -3
- package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/sheet/sheet.js +9 -55
- package/build/cjs/packages/phoenix/src/components/sheet/sheet.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/sheet/sheet_constants.js +1 -3
- package/build/cjs/packages/phoenix/src/components/sheet/sheet_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js +200 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +1 -6
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +14 -77
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/form/search/search.js +27 -0
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/form/select/select.js +37 -18
- package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +1 -5
- package/build/esm/packages/phoenix/src/components/modal/modal.js +15 -61
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.js +2 -3
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/sheet/sheet.d.ts +1 -5
- package/build/esm/packages/phoenix/src/components/sheet/sheet.js +11 -57
- package/build/esm/packages/phoenix/src/components/sheet/sheet.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/sheet/sheet_constants.js +2 -3
- package/build/esm/packages/phoenix/src/components/sheet/sheet_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.d.ts +24 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js +196 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.d.ts +14 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.js +2 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
-
var utilities = require('@dreamcommerce/utilities');
|
|
7
6
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
7
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
9
8
|
var decorators_js = require('@lit/reactive-element/decorators.js');
|
|
@@ -13,6 +12,7 @@ var ref_js = require('lit-html/directives/ref.js');
|
|
|
13
12
|
var portal_constants = require('../portal/portal_constants.js');
|
|
14
13
|
var backdrop_constants = require('../backdrop/backdrop_constants.js');
|
|
15
14
|
var backdrop_controller = require('../backdrop/controller/backdrop_controller.js');
|
|
15
|
+
var focus_trap_controller = require('../../controllers/focus_trap_controller/focus_trap_controller.js');
|
|
16
16
|
var sheet_constants = require('./sheet_constants.js');
|
|
17
17
|
var sheet_close = require('./sheet_close.js');
|
|
18
18
|
|
|
@@ -24,9 +24,6 @@ exports.HSheet = HSheet_1 = class HSheet extends phoenix_light_lit_element.Phoen
|
|
|
24
24
|
this.class = '';
|
|
25
25
|
this.transition = 'scale';
|
|
26
26
|
this.sheetLabel = '';
|
|
27
|
-
this._firstFocusableElement = undefined;
|
|
28
|
-
this._focusableElements = null;
|
|
29
|
-
this._lastFocusableElement = undefined;
|
|
30
27
|
this._focusedToggler = null;
|
|
31
28
|
this._contentRef = ref_js.createRef();
|
|
32
29
|
this._focusSentinelStart = ref_js.createRef();
|
|
@@ -34,42 +31,25 @@ exports.HSheet = HSheet_1 = class HSheet extends phoenix_light_lit_element.Phoen
|
|
|
34
31
|
this._propsChangeStrategies = {
|
|
35
32
|
[sheet_constants.SHEET_OPENED_PROP]: {
|
|
36
33
|
true: () => {
|
|
37
|
-
const scrollY = window.scrollY;
|
|
38
34
|
HSheet_1.openSheets = [...HSheet_1.openSheets, this];
|
|
39
35
|
document.addEventListener('keydown', this._bindCloseOnEsc);
|
|
40
36
|
document.addEventListener(backdrop_constants.BACKDROP_EVENTS.clicked, this.close);
|
|
41
37
|
this._dispatchSheetOpenedEvent();
|
|
42
|
-
|
|
43
|
-
var _a;
|
|
44
|
-
(_a = this._firstFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
45
|
-
window.scrollTo(0, scrollY);
|
|
46
|
-
}, 0);
|
|
38
|
+
this._focusTrapController.activate();
|
|
47
39
|
},
|
|
48
40
|
false: () => {
|
|
49
41
|
HSheet_1.openSheets = HSheet_1.openSheets.filter((sheet) => sheet !== this);
|
|
50
42
|
document.removeEventListener('keydown', this._bindCloseOnEsc);
|
|
51
43
|
document.removeEventListener(backdrop_constants.BACKDROP_EVENTS.clicked, this.close);
|
|
44
|
+
this._focusTrapController.deactivate();
|
|
52
45
|
}
|
|
53
46
|
}
|
|
54
47
|
};
|
|
55
48
|
this._backdropController = new backdrop_controller.BackdropController();
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (ev.shiftKey) {
|
|
61
|
-
if (document.activeElement === this._firstFocusableElement) {
|
|
62
|
-
const focusableElements = utilities.UiDomUtils.getFocusableElements(this._contentRef.value);
|
|
63
|
-
(_a = focusableElements[focusableElements.length - 1]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
64
|
-
ev.preventDefault();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else if (document.activeElement === this._lastFocusableElement) {
|
|
68
|
-
utilities.UiDomUtils.setFocusToFirstFocusableElementInContainer(this._contentRef.value);
|
|
69
|
-
ev.preventDefault();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
49
|
+
this._focusTrapController = new focus_trap_controller.FocusTrapController({
|
|
50
|
+
host: this,
|
|
51
|
+
getContainer: () => this._contentRef.value
|
|
52
|
+
});
|
|
73
53
|
this._handleCloseFromCloseComponent = async (ev) => {
|
|
74
54
|
var _a;
|
|
75
55
|
ev.stopPropagation();
|
|
@@ -130,7 +110,6 @@ exports.HSheet = HSheet_1 = class HSheet extends phoenix_light_lit_element.Phoen
|
|
|
130
110
|
});
|
|
131
111
|
};
|
|
132
112
|
this.hidden = true;
|
|
133
|
-
this._focusableElements = [...this.querySelectorAll(sheet_constants.FOCUSABLE_ELEMENTS_WITHIN_SHEET)];
|
|
134
113
|
}
|
|
135
114
|
static _appendSheetPortal() {
|
|
136
115
|
const $modalsPortalTarget = document.querySelector(`h-portal-target[name="${sheet_constants.SHEETS_PORTAL_NAME}"]`);
|
|
@@ -146,7 +125,6 @@ exports.HSheet = HSheet_1 = class HSheet extends phoenix_light_lit_element.Phoen
|
|
|
146
125
|
connectedCallback() {
|
|
147
126
|
super.connectedCallback();
|
|
148
127
|
HSheet_1._appendSheetPortal();
|
|
149
|
-
document.addEventListener('keyup', this._keepFocusWithinSheet);
|
|
150
128
|
document.addEventListener(sheet_constants.SHEET_EVENTS.close, this._handleCloseFromCloseComponent);
|
|
151
129
|
}
|
|
152
130
|
disconnectedCallback() {
|
|
@@ -155,28 +133,16 @@ exports.HSheet = HSheet_1 = class HSheet extends phoenix_light_lit_element.Phoen
|
|
|
155
133
|
this.close();
|
|
156
134
|
document.removeEventListener(sheet_constants.SHEET_EVENTS.close, this._handleCloseFromCloseComponent);
|
|
157
135
|
document.removeEventListener('keydown', this._bindCloseOnEsc);
|
|
158
|
-
document.removeEventListener('keyup', this._keepFocusWithinSheet);
|
|
159
136
|
}
|
|
160
137
|
firstUpdated(props) {
|
|
161
138
|
super.firstUpdated(props);
|
|
162
|
-
this.
|
|
163
|
-
this._lastFocusableElement = this._focusSentinelEnd.value;
|
|
139
|
+
this._focusTrapController.setSentinels(this._focusSentinelStart.value, this._focusSentinelEnd.value);
|
|
164
140
|
}
|
|
165
141
|
updated(changedProps) {
|
|
166
142
|
if (changedProps.has(sheet_constants.SHEET_OPENED_PROP)) {
|
|
167
143
|
this._propsChangeStrategies[sheet_constants.SHEET_OPENED_PROP][String(this[sheet_constants.SHEET_OPENED_PROP])]();
|
|
168
144
|
}
|
|
169
145
|
}
|
|
170
|
-
_setFocusToFirstFocusableElementInSheetOrCloseBtn() {
|
|
171
|
-
requestAnimationFrame(() => {
|
|
172
|
-
if (this._contentRef.value) {
|
|
173
|
-
const focusableElements = utilities.UiDomUtils.getFocusableElements(this._contentRef.value);
|
|
174
|
-
if (focusableElements.length > 0) {
|
|
175
|
-
focusableElements.length > 1 ? focusableElements[1].focus() : focusableElements[0].focus();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
146
|
async open() {
|
|
181
147
|
this._focusedToggler = document.activeElement;
|
|
182
148
|
return new Promise((resolve) => {
|
|
@@ -192,7 +158,7 @@ exports.HSheet = HSheet_1 = class HSheet extends phoenix_light_lit_element.Phoen
|
|
|
192
158
|
setTimeout(() => {
|
|
193
159
|
var _a;
|
|
194
160
|
(_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`sheet_show-${this.transition}-start`, `sheet_show-${this.transition}-end`);
|
|
195
|
-
this.
|
|
161
|
+
this._focusTrapController.focusFirst();
|
|
196
162
|
resolve();
|
|
197
163
|
}, transitionDuration);
|
|
198
164
|
});
|
|
@@ -245,18 +211,6 @@ tslib_es6.__decorate([
|
|
|
245
211
|
decorators_js.property({ type: String, attribute: 'sheet-label' }),
|
|
246
212
|
tslib_es6.__metadata("design:type", Object)
|
|
247
213
|
], exports.HSheet.prototype, "sheetLabel", void 0);
|
|
248
|
-
tslib_es6.__decorate([
|
|
249
|
-
decorators_js.state(),
|
|
250
|
-
tslib_es6.__metadata("design:type", Object)
|
|
251
|
-
], exports.HSheet.prototype, "_firstFocusableElement", void 0);
|
|
252
|
-
tslib_es6.__decorate([
|
|
253
|
-
decorators_js.state(),
|
|
254
|
-
tslib_es6.__metadata("design:type", Object)
|
|
255
|
-
], exports.HSheet.prototype, "_focusableElements", void 0);
|
|
256
|
-
tslib_es6.__decorate([
|
|
257
|
-
decorators_js.state(),
|
|
258
|
-
tslib_es6.__metadata("design:type", Object)
|
|
259
|
-
], exports.HSheet.prototype, "_lastFocusableElement", void 0);
|
|
260
214
|
exports.HSheet = HSheet_1 = tslib_es6.__decorate([
|
|
261
215
|
phoenix_custom_element.phoenixCustomElement('h-sheet'),
|
|
262
216
|
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -9,10 +9,8 @@ const SHEET_EVENTS = {
|
|
|
9
9
|
opened: 'opened',
|
|
10
10
|
closed: 'closed'
|
|
11
11
|
};
|
|
12
|
-
const SHEET_OPENED_PROP = 'opened';
|
|
13
|
-
const FOCUSABLE_ELEMENTS_WITHIN_SHEET = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
12
|
+
const SHEET_OPENED_PROP = 'opened';
|
|
14
13
|
|
|
15
|
-
exports.FOCUSABLE_ELEMENTS_WITHIN_SHEET = FOCUSABLE_ELEMENTS_WITHIN_SHEET;
|
|
16
14
|
exports.SHEETS_PORTAL_NAME = SHEETS_PORTAL_NAME;
|
|
17
15
|
exports.SHEET_EVENTS = SHEET_EVENTS;
|
|
18
16
|
exports.SHEET_OPENED_PROP = SHEET_OPENED_PROP;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
require('lit');
|
|
7
|
+
var utilities = require('@dreamcommerce/utilities');
|
|
8
|
+
|
|
9
|
+
var _FocusTrapController_getContainer, _FocusTrapController_getToggler, _FocusTrapController_cyclicKeydown, _FocusTrapController_active, _FocusTrapController_sentinelStart, _FocusTrapController_sentinelEnd;
|
|
10
|
+
class FocusTrapController {
|
|
11
|
+
constructor({ host, getContainer, noAutofocus = false, getToggler, cyclicKeydown = false }) {
|
|
12
|
+
_FocusTrapController_getContainer.set(this, void 0);
|
|
13
|
+
_FocusTrapController_getToggler.set(this, void 0);
|
|
14
|
+
_FocusTrapController_cyclicKeydown.set(this, void 0);
|
|
15
|
+
_FocusTrapController_active.set(this, false);
|
|
16
|
+
_FocusTrapController_sentinelStart.set(this, void 0);
|
|
17
|
+
_FocusTrapController_sentinelEnd.set(this, void 0);
|
|
18
|
+
// ─── Sentinel mode ───────────────────────────────────────────────────────
|
|
19
|
+
this._handleSentinelModeKeyUp = (ev) => {
|
|
20
|
+
var _a;
|
|
21
|
+
if (!tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_active, "f") || ev.code !== 'Tab')
|
|
22
|
+
return;
|
|
23
|
+
const container = tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getContainer, "f").call(this);
|
|
24
|
+
if (!container)
|
|
25
|
+
return;
|
|
26
|
+
if (ev.shiftKey) {
|
|
27
|
+
if (document.activeElement === tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_sentinelStart, "f")) {
|
|
28
|
+
const focusableElements = this._getFocusableElements(container);
|
|
29
|
+
(_a = focusableElements[focusableElements.length - 1]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
30
|
+
ev.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (document.activeElement === tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_sentinelEnd, "f")) {
|
|
34
|
+
utilities.UiDomUtils.setFocusToFirstFocusableElementInContainer(container);
|
|
35
|
+
ev.preventDefault();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
// ─── Cyclic keydown mode ─────────────────────────────────────────────────
|
|
39
|
+
//
|
|
40
|
+
// No sentinel elements. Tab past the last focusable element wraps to the
|
|
41
|
+
// first; Shift+Tab past the first wraps to the last. Uses keydown +
|
|
42
|
+
// preventDefault so the browser never moves focus outside the container.
|
|
43
|
+
this._handleCyclicKeyDown = (ev) => {
|
|
44
|
+
if (!tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_active, "f") || ev.code !== 'Tab')
|
|
45
|
+
return;
|
|
46
|
+
const container = tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getContainer, "f").call(this);
|
|
47
|
+
if (!container)
|
|
48
|
+
return;
|
|
49
|
+
const focusableElements = this._getFocusableElements(container);
|
|
50
|
+
if (focusableElements.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
const $target = ev.target;
|
|
53
|
+
if (ev.shiftKey) {
|
|
54
|
+
if ($target === focusableElements[0]) {
|
|
55
|
+
ev.preventDefault();
|
|
56
|
+
focusableElements[focusableElements.length - 1].focus();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if ($target === focusableElements[focusableElements.length - 1]) {
|
|
61
|
+
ev.preventDefault();
|
|
62
|
+
focusableElements[0].focus();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
// ─── Toggler mode ────────────────────────────────────────────────────────
|
|
67
|
+
//
|
|
68
|
+
// Cycle: toggler → content[0] → … → content[last] → toggler (and reverse).
|
|
69
|
+
// Uses keydown + preventDefault so the browser never moves focus on its own.
|
|
70
|
+
this._handleTogglerModeKeyDown = (ev) => {
|
|
71
|
+
var _a;
|
|
72
|
+
if (!tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_active, "f") || ev.code !== 'Tab')
|
|
73
|
+
return;
|
|
74
|
+
const container = tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getContainer, "f").call(this);
|
|
75
|
+
const toggler = (_a = tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getToggler, "f")) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
76
|
+
if (!container || !toggler)
|
|
77
|
+
return;
|
|
78
|
+
const $target = ev.target;
|
|
79
|
+
const focusableElements = this._getFocusableElements(container);
|
|
80
|
+
if (ev.shiftKey) {
|
|
81
|
+
// Shift+Tab on toggler → last content element
|
|
82
|
+
if (toggler.contains($target)) {
|
|
83
|
+
const last = focusableElements[focusableElements.length - 1];
|
|
84
|
+
if (!last)
|
|
85
|
+
return;
|
|
86
|
+
ev.preventDefault();
|
|
87
|
+
last.focus();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Shift+Tab on first content element → toggler
|
|
91
|
+
if ($target === focusableElements[0]) {
|
|
92
|
+
ev.preventDefault();
|
|
93
|
+
toggler.focus();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Tab on toggler → first content element
|
|
98
|
+
if (toggler.contains($target)) {
|
|
99
|
+
const first = focusableElements[0];
|
|
100
|
+
if (!first)
|
|
101
|
+
return;
|
|
102
|
+
ev.preventDefault();
|
|
103
|
+
first.focus();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// Tab on last content element → toggler
|
|
107
|
+
if ($target === focusableElements[focusableElements.length - 1]) {
|
|
108
|
+
ev.preventDefault();
|
|
109
|
+
toggler.focus();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_getContainer, getContainer, "f");
|
|
114
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_getToggler, getToggler, "f");
|
|
115
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_cyclicKeydown, cyclicKeydown, "f");
|
|
116
|
+
this.noAutofocus = noAutofocus;
|
|
117
|
+
host.addController(this);
|
|
118
|
+
}
|
|
119
|
+
hostConnected() {
|
|
120
|
+
if (tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_cyclicKeydown, "f")) {
|
|
121
|
+
document.addEventListener('keydown', this._handleCyclicKeyDown);
|
|
122
|
+
}
|
|
123
|
+
else if (tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getToggler, "f")) {
|
|
124
|
+
document.addEventListener('keydown', this._handleTogglerModeKeyDown);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
document.addEventListener('keyup', this._handleSentinelModeKeyUp);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
hostDisconnected() {
|
|
131
|
+
if (tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_cyclicKeydown, "f")) {
|
|
132
|
+
document.removeEventListener('keydown', this._handleCyclicKeyDown);
|
|
133
|
+
}
|
|
134
|
+
else if (tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getToggler, "f")) {
|
|
135
|
+
document.removeEventListener('keydown', this._handleTogglerModeKeyDown);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
document.removeEventListener('keyup', this._handleSentinelModeKeyUp);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** Sentinel mode only: call once in firstUpdated with the two bookend elements. */
|
|
142
|
+
setSentinels(start, end) {
|
|
143
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_sentinelStart, start, "f");
|
|
144
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_sentinelEnd, end, "f");
|
|
145
|
+
}
|
|
146
|
+
activate() {
|
|
147
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_active, true, "f");
|
|
148
|
+
// Sentinel mode: move focus to sentinelStart to prime the trap.
|
|
149
|
+
if (!tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getToggler, "f") && !this.noAutofocus) {
|
|
150
|
+
const scrollY = window.scrollY;
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
var _a;
|
|
153
|
+
(_a = tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_sentinelStart, "f")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
154
|
+
window.scrollTo(0, scrollY);
|
|
155
|
+
}, 0);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
deactivate() {
|
|
159
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_active, false, "f");
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Sentinel mode: move focus to the first real interactive element after the
|
|
163
|
+
* open transition completes (skips sentinelStart at index 0).
|
|
164
|
+
*/
|
|
165
|
+
focusFirst() {
|
|
166
|
+
if (this.noAutofocus)
|
|
167
|
+
return;
|
|
168
|
+
requestAnimationFrame(() => {
|
|
169
|
+
const container = tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_getContainer, "f").call(this);
|
|
170
|
+
if (!container)
|
|
171
|
+
return;
|
|
172
|
+
const focusableElements = this._getFocusableElements(container);
|
|
173
|
+
if (focusableElements.length > 0) {
|
|
174
|
+
focusableElements.length > 1 ? focusableElements[1].focus() : focusableElements[0].focus();
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
_getFocusableElements(container) {
|
|
179
|
+
return utilities.UiDomUtils.getFocusableElements(container).filter(($el) => this._isElementTrulyFocusable($el));
|
|
180
|
+
}
|
|
181
|
+
getFocusableElements(container) {
|
|
182
|
+
return this._getFocusableElements(container);
|
|
183
|
+
}
|
|
184
|
+
_isElementTrulyFocusable($el) {
|
|
185
|
+
const style = window.getComputedStyle($el);
|
|
186
|
+
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if ($el.nodeName === 'H-PORTAL')
|
|
190
|
+
return true;
|
|
191
|
+
const $parent = $el.parentElement;
|
|
192
|
+
if (!$parent)
|
|
193
|
+
return true;
|
|
194
|
+
return this._isElementTrulyFocusable($parent);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
_FocusTrapController_getContainer = new WeakMap(), _FocusTrapController_getToggler = new WeakMap(), _FocusTrapController_cyclicKeydown = new WeakMap(), _FocusTrapController_active = new WeakMap(), _FocusTrapController_sentinelStart = new WeakMap(), _FocusTrapController_sentinelEnd = new WeakMap();
|
|
198
|
+
|
|
199
|
+
exports.FocusTrapController = FocusTrapController;
|
|
200
|
+
//# sourceMappingURL=focus_trap_controller.js.map
|
|
@@ -0,0 +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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -26,6 +26,7 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
26
26
|
private _dropdownContentChildrenHeight;
|
|
27
27
|
private _hasScrollableClassInitially;
|
|
28
28
|
private _backdropController;
|
|
29
|
+
private _focusTrapController;
|
|
29
30
|
constructor();
|
|
30
31
|
connectedCallback(): Promise<void>;
|
|
31
32
|
private static _appendDropdownPortal;
|
|
@@ -45,14 +46,8 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
45
46
|
private _closeDropdownOnEscape;
|
|
46
47
|
private _keepFocusWithinDropdownForwards;
|
|
47
48
|
private _handleFocusOnNextElementAfterDropdown;
|
|
48
|
-
private _handleFocusFromTogglerForwards;
|
|
49
|
-
private _handleFocusFromSentinelEndForwards;
|
|
50
49
|
private _keepFocusWithinDropdownBackwards;
|
|
51
50
|
private _handleDefaultFocusFromDropdownBackwards;
|
|
52
|
-
private _handleFocusFromTogglerBackwards;
|
|
53
|
-
private _handleFocusFromSentinelStartBackwards;
|
|
54
|
-
private _getTrulyFocusableElements;
|
|
55
|
-
private _isElementTrulyFocusable;
|
|
56
51
|
private _hoverToggle;
|
|
57
52
|
private _isHoveredWithinDropdown;
|
|
58
53
|
private _focusOnFirstContentElement;
|
|
@@ -12,6 +12,7 @@ import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
|
|
|
12
12
|
import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
|
|
13
13
|
import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
|
|
14
14
|
import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
|
|
15
|
+
import { FocusTrapController } from '../../controllers/focus_trap_controller/focus_trap_controller.js';
|
|
15
16
|
import throttle_1 from '../../../../../external/lodash/throttle.js';
|
|
16
17
|
import { RelativePositionController } from '../../controllers/relative_position_controller/relative_position_controller.js';
|
|
17
18
|
|
|
@@ -30,6 +31,11 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
30
31
|
this.preventFocusTrap = false;
|
|
31
32
|
this.noAutoFocus = false;
|
|
32
33
|
this._backdropController = new BackdropController();
|
|
34
|
+
this._focusTrapController = new FocusTrapController({
|
|
35
|
+
host: this,
|
|
36
|
+
getContainer: () => { var _a; return (_a = this.$dropdownContent) !== null && _a !== void 0 ? _a : undefined; },
|
|
37
|
+
getToggler: () => this.$dropdownToggler
|
|
38
|
+
});
|
|
33
39
|
this._handleClickOutside = async (target) => {
|
|
34
40
|
var _a, _b;
|
|
35
41
|
if (!this.opened)
|
|
@@ -67,6 +73,8 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
67
73
|
this._dispatchShowDropdownEvent();
|
|
68
74
|
(_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.remove(`${DROPDOWN_CONTENT_CSS_CLASSES.show}-${this.transition}-start`, `${DROPDOWN_CONTENT_CSS_CLASSES.show}-${this.transition}-end`);
|
|
69
75
|
this._toggleScroll();
|
|
76
|
+
if (!this.preventFocusTrap)
|
|
77
|
+
this._focusTrapController.activate();
|
|
70
78
|
resolve();
|
|
71
79
|
}, transitionDuration);
|
|
72
80
|
});
|
|
@@ -107,6 +115,7 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
107
115
|
var _a;
|
|
108
116
|
(_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.remove(`${DROPDOWN_CONTENT_CSS_CLASSES.hide}-${this.transition}-start`, `${DROPDOWN_CONTENT_CSS_CLASSES.hide}-${this.transition}-end`);
|
|
109
117
|
this.opened = false;
|
|
118
|
+
this._focusTrapController.deactivate();
|
|
110
119
|
this._dispatchHideDropdownEvent();
|
|
111
120
|
resolve();
|
|
112
121
|
}, transitionDuration);
|
|
@@ -138,31 +147,16 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
138
147
|
await this.hide();
|
|
139
148
|
};
|
|
140
149
|
this._keepFocusWithinDropdownForwards = (ev) => {
|
|
141
|
-
|
|
142
|
-
if (ev.shiftKey === true || !this.$dropdownContent || !this.opened)
|
|
150
|
+
if (ev.shiftKey || !this.$dropdownContent || !this.opened || !this.preventFocusTrap)
|
|
143
151
|
return;
|
|
144
|
-
|
|
145
|
-
if (((_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.contains($target)) && this.preventFocusTrap) {
|
|
152
|
+
if (this.$dropdownContent.contains(ev.target)) {
|
|
146
153
|
this._handleFocusOnNextElementAfterDropdown(ev);
|
|
147
|
-
return;
|
|
148
154
|
}
|
|
149
|
-
if ((_b = this.$dropdownToggler) === null || _b === void 0 ? void 0 : _b.contains($target)) {
|
|
150
|
-
this._handleFocusFromTogglerForwards(ev);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
this._handleFocusFromSentinelEndForwards(ev, $target);
|
|
154
155
|
};
|
|
155
156
|
this._keepFocusWithinDropdownBackwards = (ev) => {
|
|
156
|
-
if (!this.opened || !this.$dropdownContent)
|
|
157
|
+
if (!this.opened || !this.$dropdownContent || !this.preventFocusTrap)
|
|
157
158
|
return;
|
|
158
|
-
|
|
159
|
-
if (this.preventFocusTrap) {
|
|
160
|
-
this._handleDefaultFocusFromDropdownBackwards(ev);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
this._handleFocusFromTogglerBackwards(ev, $target);
|
|
164
|
-
this._handleFocusFromSentinelStartBackwards(ev, $target);
|
|
165
|
-
}
|
|
159
|
+
this._handleDefaultFocusFromDropdownBackwards(ev);
|
|
166
160
|
};
|
|
167
161
|
this._hoverToggle = async (ev) => {
|
|
168
162
|
if (window.innerWidth < BREAKPOINTS.xs)
|
|
@@ -184,7 +178,7 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
184
178
|
this._focusOnFirstContentElement = () => {
|
|
185
179
|
if (!this.$dropdownContent)
|
|
186
180
|
return;
|
|
187
|
-
const $firstFocusableElement = this.
|
|
181
|
+
const $firstFocusableElement = this._focusTrapController.getFocusableElements(this.$dropdownContent)[0];
|
|
188
182
|
if ($firstFocusableElement)
|
|
189
183
|
$firstFocusableElement.focus();
|
|
190
184
|
};
|
|
@@ -302,68 +296,11 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
302
296
|
UiDomUtils.getNextFocusableElement(this.$dropdownToggler || this).focus();
|
|
303
297
|
return;
|
|
304
298
|
}
|
|
305
|
-
_handleFocusFromTogglerForwards(ev) {
|
|
306
|
-
if (!this.$dropdownContent)
|
|
307
|
-
return;
|
|
308
|
-
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
309
|
-
if (trulyFocusableElements.length === 0)
|
|
310
|
-
return;
|
|
311
|
-
ev.preventDefault();
|
|
312
|
-
trulyFocusableElements[0].focus();
|
|
313
|
-
}
|
|
314
|
-
_handleFocusFromSentinelEndForwards(ev, $target) {
|
|
315
|
-
var _a;
|
|
316
|
-
if (!this.$dropdownContent)
|
|
317
|
-
return;
|
|
318
|
-
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
319
|
-
const $lastFocusableElement = trulyFocusableElements.slice(-1)[0];
|
|
320
|
-
if ($target !== $lastFocusableElement)
|
|
321
|
-
return;
|
|
322
|
-
ev.preventDefault();
|
|
323
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
324
|
-
}
|
|
325
299
|
_handleDefaultFocusFromDropdownBackwards(ev) {
|
|
326
300
|
ev.preventDefault();
|
|
327
301
|
this.hide();
|
|
328
302
|
UiDomUtils.getPreviousFocusableElement(this.$dropdownToggler || this).focus();
|
|
329
303
|
}
|
|
330
|
-
_handleFocusFromTogglerBackwards(ev, $target) {
|
|
331
|
-
var _a;
|
|
332
|
-
if ($target !== this.$dropdownToggler && !((_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.contains($target)) || !this.$dropdownContent)
|
|
333
|
-
return;
|
|
334
|
-
ev.preventDefault();
|
|
335
|
-
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
336
|
-
if (trulyFocusableElements.length === 0)
|
|
337
|
-
return;
|
|
338
|
-
const $lastFocusableElement = trulyFocusableElements.slice(-1)[0];
|
|
339
|
-
$lastFocusableElement.focus();
|
|
340
|
-
}
|
|
341
|
-
_handleFocusFromSentinelStartBackwards(ev, $target) {
|
|
342
|
-
var _a;
|
|
343
|
-
if (!this.$dropdownContent)
|
|
344
|
-
return;
|
|
345
|
-
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
346
|
-
if ($target !== $firstFocusableElement)
|
|
347
|
-
return;
|
|
348
|
-
ev.preventDefault();
|
|
349
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
350
|
-
}
|
|
351
|
-
_getTrulyFocusableElements($container) {
|
|
352
|
-
const focusableElements = UiDomUtils.getFocusableElements($container);
|
|
353
|
-
return focusableElements.filter(($el) => this._isElementTrulyFocusable($el));
|
|
354
|
-
}
|
|
355
|
-
_isElementTrulyFocusable($el) {
|
|
356
|
-
const style = window.getComputedStyle($el);
|
|
357
|
-
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
358
|
-
return false;
|
|
359
|
-
}
|
|
360
|
-
if ($el.nodeName === 'H-PORTAL')
|
|
361
|
-
return true;
|
|
362
|
-
const $parent = $el.parentElement;
|
|
363
|
-
if (!$parent)
|
|
364
|
-
return true;
|
|
365
|
-
return this._isElementTrulyFocusable($parent);
|
|
366
|
-
}
|
|
367
304
|
_isHoveredWithinDropdown(element) {
|
|
368
305
|
var _a;
|
|
369
306
|
if (element === this)
|
|
@@ -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,eAAe,qDAAyD;AACxE;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;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,eAAe,qDAAyD;AACxE;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -19,7 +19,9 @@ export declare class HSearch extends PhoenixLightLitElement {
|
|
|
19
19
|
private _togglerElement;
|
|
20
20
|
private _id;
|
|
21
21
|
private _openSearchButtonAriaLabelId;
|
|
22
|
+
private _searchIconId;
|
|
22
23
|
private _searchContentContainerId;
|
|
24
|
+
private _mobileFocusTrapController;
|
|
23
25
|
private _searchResultsRef;
|
|
24
26
|
private _searchHistoryRef;
|
|
25
27
|
private _searchMessageRef;
|
|
@@ -81,6 +83,8 @@ export declare class HSearch extends PhoenixLightLitElement {
|
|
|
81
83
|
private _isSuggesterLayerVisible;
|
|
82
84
|
private _preventSubmitOnSearchClear;
|
|
83
85
|
private _resetSearchOnFocusOutside;
|
|
86
|
+
private _activateMobileDialog;
|
|
87
|
+
private _deactivateMobileDialog;
|
|
84
88
|
private _setupAriaAttributes;
|
|
85
89
|
private _handleOpenSearch;
|
|
86
90
|
private _handleOpenSearchWithKeyboard;
|