@shoper/phoenix_design_system 1.18.23-0 → 1.18.23-10
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 +24 -93
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +55 -8
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +3 -13
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +39 -11
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/sheet/sheet.js +33 -10
- package/build/cjs/packages/phoenix/src/components/sheet/sheet.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js +47 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js.map +1 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js +66 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js.map +1 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js +14 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js.map +1 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js +12 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js +29 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js.map +1 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js +60 -0
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +3 -10
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +24 -93
- 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 +6 -0
- package/build/esm/packages/phoenix/src/components/form/search/search.js +55 -8
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +3 -13
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +2 -0
- package/build/esm/packages/phoenix/src/components/modal/modal.js +39 -11
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/sheet/sheet.d.ts +2 -0
- package/build/esm/packages/phoenix/src/components/sheet/sheet.js +33 -10
- package/build/esm/packages/phoenix/src/components/sheet/sheet.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.d.ts +13 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js +43 -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 +5 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.d.ts +14 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js +62 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.d.ts +8 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.js +2 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.d.ts +6 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js +10 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.js +2 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.d.ts +5 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js +8 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.d.ts +7 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js +25 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.d.ts +4 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.js +2 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.d.ts +11 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js +56 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.d.ts +4 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.js +2 -0
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.js.map +1 -0
- package/package.json +1 -1
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/focus_trap_controller/focus_trap_controller.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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 sentinel_focus_trap_strategy = require('./strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js');
|
|
8
|
+
var cyclic_focus_trap_strategy = require('./strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js');
|
|
9
|
+
var toggler_focus_trap_strategy = require('./strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js');
|
|
10
|
+
var focus_trap_strategy_constants = require('./strategies/focus_trap_strategy_constants.js');
|
|
11
|
+
|
|
12
|
+
var _a, _FocusTrapController_strategy, _FocusTrapController_createStrategy;
|
|
13
|
+
class FocusTrapController {
|
|
14
|
+
constructor(host, props) {
|
|
15
|
+
_FocusTrapController_strategy.set(this, void 0);
|
|
16
|
+
tslib_es6.__classPrivateFieldSet(this, _FocusTrapController_strategy, tslib_es6.__classPrivateFieldGet(FocusTrapController, _a, "m", _FocusTrapController_createStrategy).call(FocusTrapController, props), "f");
|
|
17
|
+
host.addController(this);
|
|
18
|
+
}
|
|
19
|
+
get strategy() {
|
|
20
|
+
return tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_strategy, "f");
|
|
21
|
+
}
|
|
22
|
+
hostConnected() {
|
|
23
|
+
tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").attach();
|
|
24
|
+
}
|
|
25
|
+
hostDisconnected() {
|
|
26
|
+
tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").detach();
|
|
27
|
+
}
|
|
28
|
+
activate() {
|
|
29
|
+
tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").activate();
|
|
30
|
+
}
|
|
31
|
+
deactivate() {
|
|
32
|
+
tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").deactivate();
|
|
33
|
+
}
|
|
34
|
+
getFocusableElements(container) {
|
|
35
|
+
return tslib_es6.__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").getFocusableElements(container);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
_a = FocusTrapController, _FocusTrapController_strategy = new WeakMap(), _FocusTrapController_createStrategy = function _FocusTrapController_createStrategy(props) {
|
|
39
|
+
switch (props.mode) {
|
|
40
|
+
case focus_trap_strategy_constants.FOCUS_TRAP_STRATEGY_TYPES.sentinel: return new sentinel_focus_trap_strategy.SentinelFocusTrapStrategy(props);
|
|
41
|
+
case focus_trap_strategy_constants.FOCUS_TRAP_STRATEGY_TYPES.cyclic: return new cyclic_focus_trap_strategy.CyclicFocusTrapStrategy(props);
|
|
42
|
+
case focus_trap_strategy_constants.FOCUS_TRAP_STRATEGY_TYPES.toggler: return new toggler_focus_trap_strategy.TogglerFocusTrapStrategy(props);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.FocusTrapController = FocusTrapController;
|
|
47
|
+
//# 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;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utilities = require('@dreamcommerce/utilities');
|
|
6
|
+
|
|
7
|
+
class BaseFocusTrapStrategy {
|
|
8
|
+
constructor(getContainer) {
|
|
9
|
+
this.getContainer = getContainer;
|
|
10
|
+
this.active = false;
|
|
11
|
+
this.noAutofocus = false;
|
|
12
|
+
this._handleKeyDown = (ev) => {
|
|
13
|
+
if (!this.active || ev.code !== 'Tab')
|
|
14
|
+
return;
|
|
15
|
+
const container = this.getContainer();
|
|
16
|
+
if (!container)
|
|
17
|
+
return;
|
|
18
|
+
const focusableElements = this.getFocusableElements(container);
|
|
19
|
+
if (focusableElements.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
const $target = ev.target;
|
|
22
|
+
if (ev.shiftKey) {
|
|
23
|
+
if ($target === focusableElements[0]) {
|
|
24
|
+
ev.preventDefault();
|
|
25
|
+
focusableElements[focusableElements.length - 1].focus();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if ($target === focusableElements[focusableElements.length - 1]) {
|
|
30
|
+
ev.preventDefault();
|
|
31
|
+
focusableElements[0].focus();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
attach() {
|
|
37
|
+
document.addEventListener('keydown', this._handleKeyDown);
|
|
38
|
+
}
|
|
39
|
+
detach() {
|
|
40
|
+
document.removeEventListener('keydown', this._handleKeyDown);
|
|
41
|
+
}
|
|
42
|
+
activate() {
|
|
43
|
+
this.active = true;
|
|
44
|
+
}
|
|
45
|
+
deactivate() {
|
|
46
|
+
this.active = false;
|
|
47
|
+
}
|
|
48
|
+
getFocusableElements(container) {
|
|
49
|
+
return utilities.UiDomUtils.getFocusableElements(container).filter(($el) => this._isElementTrulyFocusable($el));
|
|
50
|
+
}
|
|
51
|
+
_isElementTrulyFocusable($el) {
|
|
52
|
+
const style = window.getComputedStyle($el);
|
|
53
|
+
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if ($el.nodeName === 'H-PORTAL')
|
|
57
|
+
return true;
|
|
58
|
+
const $parent = $el.parentElement;
|
|
59
|
+
if (!$parent)
|
|
60
|
+
return true;
|
|
61
|
+
return this._isElementTrulyFocusable($parent);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
exports.BaseFocusTrapStrategy = BaseFocusTrapStrategy;
|
|
66
|
+
//# sourceMappingURL=base_focus_trap_strategy.js.map
|
|
@@ -0,0 +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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var base_focus_trap_strategy = require('../base_focus_trap_strategy.js');
|
|
6
|
+
|
|
7
|
+
class CyclicFocusTrapStrategy extends base_focus_trap_strategy.BaseFocusTrapStrategy {
|
|
8
|
+
constructor({ getContainer }) {
|
|
9
|
+
super(getContainer);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.CyclicFocusTrapStrategy = CyclicFocusTrapStrategy;
|
|
14
|
+
//# sourceMappingURL=cyclic_focus_trap_strategy.js.map
|
|
@@ -0,0 +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;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const FOCUS_TRAP_STRATEGY_TYPES = {
|
|
6
|
+
cyclic: 'cyclic',
|
|
7
|
+
toggler: 'toggler',
|
|
8
|
+
sentinel: 'sentinel',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.FOCUS_TRAP_STRATEGY_TYPES = FOCUS_TRAP_STRATEGY_TYPES;
|
|
12
|
+
//# sourceMappingURL=focus_trap_strategy_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var base_focus_trap_strategy = require('../base_focus_trap_strategy.js');
|
|
6
|
+
|
|
7
|
+
class SentinelFocusTrapStrategy extends base_focus_trap_strategy.BaseFocusTrapStrategy {
|
|
8
|
+
constructor({ getContainer, noAutofocus = false }) {
|
|
9
|
+
super(getContainer);
|
|
10
|
+
this.noAutofocus = noAutofocus;
|
|
11
|
+
}
|
|
12
|
+
activate() {
|
|
13
|
+
this.active = true;
|
|
14
|
+
if (!this.noAutofocus) {
|
|
15
|
+
requestAnimationFrame(() => {
|
|
16
|
+
const container = this.getContainer();
|
|
17
|
+
if (!container)
|
|
18
|
+
return;
|
|
19
|
+
const focusableElements = this.getFocusableElements(container);
|
|
20
|
+
const shouldSkipStartSentinel = focusableElements.length > 1;
|
|
21
|
+
const $firstFocusableContentElement = shouldSkipStartSentinel ? focusableElements[1] : focusableElements[0];
|
|
22
|
+
$firstFocusableContentElement === null || $firstFocusableContentElement === void 0 ? void 0 : $firstFocusableContentElement.focus();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.SentinelFocusTrapStrategy = SentinelFocusTrapStrategy;
|
|
29
|
+
//# sourceMappingURL=sentinel_focus_trap_strategy.js.map
|
|
@@ -0,0 +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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var base_focus_trap_strategy = require('../base_focus_trap_strategy.js');
|
|
7
|
+
|
|
8
|
+
var _TogglerFocusTrapStrategy_getToggler;
|
|
9
|
+
class TogglerFocusTrapStrategy extends base_focus_trap_strategy.BaseFocusTrapStrategy {
|
|
10
|
+
constructor({ getContainer, getToggler }) {
|
|
11
|
+
super(getContainer);
|
|
12
|
+
_TogglerFocusTrapStrategy_getToggler.set(this, void 0);
|
|
13
|
+
this._handleKeyDown = (ev) => {
|
|
14
|
+
var _a;
|
|
15
|
+
if (!this.active || ev.code !== 'Tab')
|
|
16
|
+
return;
|
|
17
|
+
const container = this.getContainer();
|
|
18
|
+
const toggler = (_a = tslib_es6.__classPrivateFieldGet(this, _TogglerFocusTrapStrategy_getToggler, "f")) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
19
|
+
if (!container || !toggler)
|
|
20
|
+
return;
|
|
21
|
+
const $target = ev.target;
|
|
22
|
+
const focusableElements = this.getFocusableElements(container);
|
|
23
|
+
if (ev.shiftKey) {
|
|
24
|
+
if (toggler.contains($target))
|
|
25
|
+
return this._focusLastContentElement(ev, focusableElements);
|
|
26
|
+
if ($target === focusableElements[0])
|
|
27
|
+
return this._returnToToggler(ev, toggler);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (toggler.contains($target))
|
|
31
|
+
return this._focusFirstContentElement(ev, focusableElements);
|
|
32
|
+
if ($target === focusableElements[focusableElements.length - 1])
|
|
33
|
+
return this._returnToToggler(ev, toggler);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
tslib_es6.__classPrivateFieldSet(this, _TogglerFocusTrapStrategy_getToggler, getToggler, "f");
|
|
37
|
+
}
|
|
38
|
+
_focusLastContentElement(ev, focusableElements) {
|
|
39
|
+
const last = focusableElements[focusableElements.length - 1];
|
|
40
|
+
if (!last)
|
|
41
|
+
return;
|
|
42
|
+
ev.preventDefault();
|
|
43
|
+
last.focus();
|
|
44
|
+
}
|
|
45
|
+
_focusFirstContentElement(ev, focusableElements) {
|
|
46
|
+
const first = focusableElements[0];
|
|
47
|
+
if (!first)
|
|
48
|
+
return;
|
|
49
|
+
ev.preventDefault();
|
|
50
|
+
first.focus();
|
|
51
|
+
}
|
|
52
|
+
_returnToToggler(ev, toggler) {
|
|
53
|
+
ev.preventDefault();
|
|
54
|
+
toggler.focus();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
_TogglerFocusTrapStrategy_getToggler = new WeakMap();
|
|
58
|
+
|
|
59
|
+
exports.TogglerFocusTrapStrategy = TogglerFocusTrapStrategy;
|
|
60
|
+
//# sourceMappingURL=toggler_focus_trap_strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,kDAAsD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;
|
|
@@ -43,16 +44,8 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
43
44
|
private _observeScrollToggling;
|
|
44
45
|
private _toggleScroll;
|
|
45
46
|
private _closeDropdownOnEscape;
|
|
46
|
-
private
|
|
47
|
-
private
|
|
48
|
-
private _handleFocusFromTogglerForwards;
|
|
49
|
-
private _handleFocusFromSentinelEndForwards;
|
|
50
|
-
private _keepFocusWithinDropdownBackwards;
|
|
51
|
-
private _handleDefaultFocusFromDropdownBackwards;
|
|
52
|
-
private _handleFocusFromTogglerBackwards;
|
|
53
|
-
private _handleFocusFromSentinelStartBackwards;
|
|
54
|
-
private _getTrulyFocusableElements;
|
|
55
|
-
private _isElementTrulyFocusable;
|
|
47
|
+
private _handleTabExitForward;
|
|
48
|
+
private _handleTabExitBackward;
|
|
56
49
|
private _hoverToggle;
|
|
57
50
|
private _isHoveredWithinDropdown;
|
|
58
51
|
private _focusOnFirstContentElement;
|
|
@@ -12,6 +12,8 @@ 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 { FOCUS_TRAP_STRATEGY_TYPES } from '../../controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js';
|
|
16
|
+
import { FocusTrapController } from '../../controllers/focus_trap_controller/focus_trap_controller.js';
|
|
15
17
|
import throttle_1 from '../../../../../external/lodash/throttle.js';
|
|
16
18
|
import { RelativePositionController } from '../../controllers/relative_position_controller/relative_position_controller.js';
|
|
17
19
|
|
|
@@ -30,6 +32,11 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
30
32
|
this.preventFocusTrap = false;
|
|
31
33
|
this.noAutoFocus = false;
|
|
32
34
|
this._backdropController = new BackdropController();
|
|
35
|
+
this._focusTrapController = new FocusTrapController(this, {
|
|
36
|
+
mode: FOCUS_TRAP_STRATEGY_TYPES.toggler,
|
|
37
|
+
getContainer: () => { var _a; return (_a = this.$dropdownContent) !== null && _a !== void 0 ? _a : undefined; },
|
|
38
|
+
getToggler: () => { var _a; return (_a = this.$dropdownToggler) !== null && _a !== void 0 ? _a : undefined; }
|
|
39
|
+
});
|
|
33
40
|
this._handleClickOutside = async (target) => {
|
|
34
41
|
var _a, _b;
|
|
35
42
|
if (!this.opened)
|
|
@@ -67,6 +74,8 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
67
74
|
this._dispatchShowDropdownEvent();
|
|
68
75
|
(_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
76
|
this._toggleScroll();
|
|
77
|
+
if (!this.preventFocusTrap)
|
|
78
|
+
this._focusTrapController.activate();
|
|
70
79
|
resolve();
|
|
71
80
|
}, transitionDuration);
|
|
72
81
|
});
|
|
@@ -107,6 +116,7 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
107
116
|
var _a;
|
|
108
117
|
(_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
118
|
this.opened = false;
|
|
119
|
+
this._focusTrapController.deactivate();
|
|
110
120
|
this._dispatchHideDropdownEvent();
|
|
111
121
|
resolve();
|
|
112
122
|
}, transitionDuration);
|
|
@@ -137,32 +147,21 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
137
147
|
return;
|
|
138
148
|
await this.hide();
|
|
139
149
|
};
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
if (ev.shiftKey === true || !this.$dropdownContent || !this.opened)
|
|
143
|
-
return;
|
|
144
|
-
const $target = ev.target;
|
|
145
|
-
if (((_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.contains($target)) && this.preventFocusTrap) {
|
|
146
|
-
this._handleFocusOnNextElementAfterDropdown(ev);
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if ((_b = this.$dropdownToggler) === null || _b === void 0 ? void 0 : _b.contains($target)) {
|
|
150
|
-
this._handleFocusFromTogglerForwards(ev);
|
|
150
|
+
this._handleTabExitForward = (ev) => {
|
|
151
|
+
if (ev.shiftKey || !this.$dropdownContent || !this.opened || !this.preventFocusTrap)
|
|
151
152
|
return;
|
|
153
|
+
if (this.$dropdownContent.contains(ev.target)) {
|
|
154
|
+
ev.preventDefault();
|
|
155
|
+
this.hide();
|
|
156
|
+
UiDomUtils.getNextFocusableElement(this.$dropdownToggler || this).focus();
|
|
152
157
|
}
|
|
153
|
-
this._handleFocusFromSentinelEndForwards(ev, $target);
|
|
154
158
|
};
|
|
155
|
-
this.
|
|
156
|
-
if (!this.opened || !this.$dropdownContent)
|
|
159
|
+
this._handleTabExitBackward = (ev) => {
|
|
160
|
+
if (!this.opened || !this.$dropdownContent || !this.preventFocusTrap)
|
|
157
161
|
return;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
this._handleFocusFromTogglerBackwards(ev, $target);
|
|
164
|
-
this._handleFocusFromSentinelStartBackwards(ev, $target);
|
|
165
|
-
}
|
|
162
|
+
ev.preventDefault();
|
|
163
|
+
this.hide();
|
|
164
|
+
UiDomUtils.getPreviousFocusableElement(this.$dropdownToggler || this).focus();
|
|
166
165
|
};
|
|
167
166
|
this._hoverToggle = async (ev) => {
|
|
168
167
|
if (window.innerWidth < BREAKPOINTS.xs)
|
|
@@ -184,7 +183,7 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
184
183
|
this._focusOnFirstContentElement = () => {
|
|
185
184
|
if (!this.$dropdownContent)
|
|
186
185
|
return;
|
|
187
|
-
const $firstFocusableElement = this.
|
|
186
|
+
const $firstFocusableElement = this._focusTrapController.getFocusableElements(this.$dropdownContent)[0];
|
|
188
187
|
if ($firstFocusableElement)
|
|
189
188
|
$firstFocusableElement.focus();
|
|
190
189
|
};
|
|
@@ -213,13 +212,13 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
213
212
|
host: this,
|
|
214
213
|
target: document.body,
|
|
215
214
|
keys: ['tab'],
|
|
216
|
-
callback: this.
|
|
215
|
+
callback: this._handleTabExitForward
|
|
217
216
|
});
|
|
218
217
|
new KeystrokesController({
|
|
219
218
|
host: this,
|
|
220
219
|
target: document.body,
|
|
221
220
|
keys: [['shift', 'tab']],
|
|
222
|
-
callback: this.
|
|
221
|
+
callback: this._handleTabExitBackward,
|
|
223
222
|
containerSelectors: ['h-dropdown', 'h-dropdown-content']
|
|
224
223
|
});
|
|
225
224
|
}
|
|
@@ -296,74 +295,6 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
296
295
|
(_b = this.$dropdownContent) === null || _b === void 0 ? void 0 : _b.classList.add(SCROLLABLE_CLASS_NAME);
|
|
297
296
|
}
|
|
298
297
|
}
|
|
299
|
-
_handleFocusOnNextElementAfterDropdown(ev) {
|
|
300
|
-
ev.preventDefault();
|
|
301
|
-
this.hide();
|
|
302
|
-
UiDomUtils.getNextFocusableElement(this.$dropdownToggler || this).focus();
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
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
|
-
_handleDefaultFocusFromDropdownBackwards(ev) {
|
|
326
|
-
ev.preventDefault();
|
|
327
|
-
this.hide();
|
|
328
|
-
UiDomUtils.getPreviousFocusableElement(this.$dropdownToggler || this).focus();
|
|
329
|
-
}
|
|
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
298
|
_isHoveredWithinDropdown(element) {
|
|
368
299
|
var _a;
|
|
369
300
|
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;
|
|
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;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;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
3
|
import type { TSearchDisplayMode, TSearchSettings } from "./search_types";
|
|
4
|
+
import { FocusTrapController } from "../../../controllers/focus_trap_controller/focus_trap_controller";
|
|
4
5
|
export declare class HSearch extends PhoenixLightLitElement {
|
|
5
6
|
settings: TSearchSettings;
|
|
6
7
|
view: string;
|
|
7
8
|
locale: string;
|
|
8
9
|
isSearchIconFixEnabled: boolean;
|
|
9
10
|
isSearchUxFixesFlagEnabled: boolean;
|
|
11
|
+
isSearchFocusTrapFixEnabled: boolean;
|
|
10
12
|
displayMode: TSearchDisplayMode;
|
|
11
13
|
moduleInstanceId: string;
|
|
12
14
|
private _historyContextProvider;
|
|
@@ -17,9 +19,11 @@ export declare class HSearch extends PhoenixLightLitElement {
|
|
|
17
19
|
private _inputField;
|
|
18
20
|
private _searchForm;
|
|
19
21
|
private _togglerElement;
|
|
22
|
+
private _mobileDialogOpener;
|
|
20
23
|
private _id;
|
|
21
24
|
private _openSearchButtonAriaLabelId;
|
|
22
25
|
private _searchContentContainerId;
|
|
26
|
+
mobileFocusTrapController: FocusTrapController;
|
|
23
27
|
private _searchResultsRef;
|
|
24
28
|
private _searchHistoryRef;
|
|
25
29
|
private _searchMessageRef;
|
|
@@ -81,6 +85,8 @@ export declare class HSearch extends PhoenixLightLitElement {
|
|
|
81
85
|
private _isSuggesterLayerVisible;
|
|
82
86
|
private _preventSubmitOnSearchClear;
|
|
83
87
|
private _resetSearchOnFocusOutside;
|
|
88
|
+
private _activateMobileDialog;
|
|
89
|
+
private _deactivateMobileDialog;
|
|
84
90
|
private _setupAriaAttributes;
|
|
85
91
|
private _handleOpenSearch;
|
|
86
92
|
private _handleOpenSearchWithKeyboard;
|