@shoper/phoenix_design_system 1.18.23-13 → 1.18.23-15
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 +3 -51
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +8 -55
- 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 +22 -51
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +5 -10
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +11 -39
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/sheet/sheet.js +10 -33
- package/build/cjs/packages/phoenix/src/components/sheet/sheet.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +0 -6
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +3 -51
- 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 +0 -6
- package/build/esm/packages/phoenix/src/components/form/search/search.js +8 -55
- 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.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +22 -51
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.js +5 -10
- 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 +0 -2
- package/build/esm/packages/phoenix/src/components/modal/modal.js +11 -39
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/sheet/sheet.d.ts +0 -2
- package/build/esm/packages/phoenix/src/components/sheet/sheet.js +10 -33
- package/build/esm/packages/phoenix/src/components/sheet/sheet.js.map +1 -1
- package/package.json +1 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js +0 -47
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js.map +0 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js +0 -66
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js.map +0 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js +0 -14
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js.map +0 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js +0 -12
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js.map +0 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js +0 -29
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js.map +0 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js +0 -60
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.d.ts +0 -13
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js +0 -43
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.d.ts +0 -14
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.js +0 -5
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.d.ts +0 -14
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js +0 -62
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.d.ts +0 -8
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.js +0 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.d.ts +0 -6
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js +0 -10
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.d.ts +0 -3
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.js +0 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.d.ts +0 -5
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js +0 -8
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/focus_trap_strategy_constants.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.d.ts +0 -7
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js +0 -25
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.d.ts +0 -4
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.js +0 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.d.ts +0 -11
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js +0 -56
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js.map +0 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.d.ts +0 -4
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.js +0 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.js.map +0 -1
package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/focus_trap_controller.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import 'lit';
|
|
3
|
-
import { SentinelFocusTrapStrategy } from './strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy.js';
|
|
4
|
-
import { CyclicFocusTrapStrategy } from './strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js';
|
|
5
|
-
import { TogglerFocusTrapStrategy } from './strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy.js';
|
|
6
|
-
import { FOCUS_TRAP_STRATEGY_TYPES } from './strategies/focus_trap_strategy_constants.js';
|
|
7
|
-
|
|
8
|
-
var _a, _FocusTrapController_strategy, _FocusTrapController_createStrategy;
|
|
9
|
-
class FocusTrapController {
|
|
10
|
-
constructor(host, props) {
|
|
11
|
-
_FocusTrapController_strategy.set(this, void 0);
|
|
12
|
-
__classPrivateFieldSet(this, _FocusTrapController_strategy, __classPrivateFieldGet(FocusTrapController, _a, "m", _FocusTrapController_createStrategy).call(FocusTrapController, props), "f");
|
|
13
|
-
host.addController(this);
|
|
14
|
-
}
|
|
15
|
-
get strategy() {
|
|
16
|
-
return __classPrivateFieldGet(this, _FocusTrapController_strategy, "f");
|
|
17
|
-
}
|
|
18
|
-
hostConnected() {
|
|
19
|
-
__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").attach();
|
|
20
|
-
}
|
|
21
|
-
hostDisconnected() {
|
|
22
|
-
__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").detach();
|
|
23
|
-
}
|
|
24
|
-
activate() {
|
|
25
|
-
__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").activate();
|
|
26
|
-
}
|
|
27
|
-
deactivate() {
|
|
28
|
-
__classPrivateFieldGet(this, _FocusTrapController_strategy, "f").deactivate();
|
|
29
|
-
}
|
|
30
|
-
getFocusableElements(container) {
|
|
31
|
-
return __classPrivateFieldGet(this, _FocusTrapController_strategy, "f").getFocusableElements(container);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
_a = FocusTrapController, _FocusTrapController_strategy = new WeakMap(), _FocusTrapController_createStrategy = function _FocusTrapController_createStrategy(props) {
|
|
35
|
-
switch (props.mode) {
|
|
36
|
-
case FOCUS_TRAP_STRATEGY_TYPES.sentinel: return new SentinelFocusTrapStrategy(props);
|
|
37
|
-
case FOCUS_TRAP_STRATEGY_TYPES.cyclic: return new CyclicFocusTrapStrategy(props);
|
|
38
|
-
case FOCUS_TRAP_STRATEGY_TYPES.toggler: return new TogglerFocusTrapStrategy(props);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { FocusTrapController };
|
|
43
|
-
//# sourceMappingURL=focus_trap_controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TCyclicFocusTrapStrategyProps } from "./strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types";
|
|
2
|
-
import { FOCUS_TRAP_STRATEGY_TYPES } from "./strategies/focus_trap_strategy_constants";
|
|
3
|
-
import { TSentinelFocusTrapStrategyProps } from "./strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types";
|
|
4
|
-
import { TTogglerFocusTrapStrategyProps } from "./strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types";
|
|
5
|
-
export declare type TSentinelFocusTrapProps = TSentinelFocusTrapStrategyProps & {
|
|
6
|
-
mode: typeof FOCUS_TRAP_STRATEGY_TYPES.sentinel;
|
|
7
|
-
};
|
|
8
|
-
export declare type TCyclicFocusTrapProps = TCyclicFocusTrapStrategyProps & {
|
|
9
|
-
mode: typeof FOCUS_TRAP_STRATEGY_TYPES.cyclic;
|
|
10
|
-
};
|
|
11
|
-
export declare type TTogglerFocusTrapProps = TTogglerFocusTrapStrategyProps & {
|
|
12
|
-
mode: typeof FOCUS_TRAP_STRATEGY_TYPES.toggler;
|
|
13
|
-
};
|
|
14
|
-
export declare type TFocusTrapProps = TSentinelFocusTrapProps | TCyclicFocusTrapProps | TTogglerFocusTrapProps;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import "./strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types";
|
|
2
|
-
import "./strategies/focus_trap_strategy_constants";
|
|
3
|
-
import "./strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types";
|
|
4
|
-
import "./strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types";
|
|
5
|
-
//# sourceMappingURL=focus_trap_controller_types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focus_trap_controller_types.js","sourceRoot":"","sources":["../../../../../../../src/controllers/focus_trap_controller/focus_trap_controller_types.ts"],"names":[],"mappings":"AAAA,OAA8C,0EAA0E,CAAC;AACzH,OAA0C,4CAA4C,CAAC;AACvF,OAAgD,8EAA8E,CAAC;AAC/H,OAA+C,4EAA4E,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IBaseFocusTrapStrategy } from './base_focus_trap_strategy_types';
|
|
2
|
-
export declare abstract class BaseFocusTrapStrategy implements IBaseFocusTrapStrategy {
|
|
3
|
-
protected readonly getContainer: () => HTMLElement | undefined;
|
|
4
|
-
protected active: boolean;
|
|
5
|
-
noAutofocus: boolean;
|
|
6
|
-
constructor(getContainer: () => HTMLElement | undefined);
|
|
7
|
-
attach(): void;
|
|
8
|
-
detach(): void;
|
|
9
|
-
activate(): void;
|
|
10
|
-
deactivate(): void;
|
|
11
|
-
getFocusableElements(container: HTMLElement): HTMLElement[];
|
|
12
|
-
protected _handleKeyDown: (ev: KeyboardEvent) => void;
|
|
13
|
-
private _isElementTrulyFocusable;
|
|
14
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
2
|
-
|
|
3
|
-
class BaseFocusTrapStrategy {
|
|
4
|
-
constructor(getContainer) {
|
|
5
|
-
this.getContainer = getContainer;
|
|
6
|
-
this.active = false;
|
|
7
|
-
this.noAutofocus = false;
|
|
8
|
-
this._handleKeyDown = (ev) => {
|
|
9
|
-
if (!this.active || ev.code !== 'Tab')
|
|
10
|
-
return;
|
|
11
|
-
const container = this.getContainer();
|
|
12
|
-
if (!container)
|
|
13
|
-
return;
|
|
14
|
-
const focusableElements = this.getFocusableElements(container);
|
|
15
|
-
if (focusableElements.length === 0)
|
|
16
|
-
return;
|
|
17
|
-
const $target = ev.target;
|
|
18
|
-
if (ev.shiftKey) {
|
|
19
|
-
if ($target === focusableElements[0]) {
|
|
20
|
-
ev.preventDefault();
|
|
21
|
-
focusableElements[focusableElements.length - 1].focus();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
if ($target === focusableElements[focusableElements.length - 1]) {
|
|
26
|
-
ev.preventDefault();
|
|
27
|
-
focusableElements[0].focus();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
attach() {
|
|
33
|
-
document.addEventListener('keydown', this._handleKeyDown);
|
|
34
|
-
}
|
|
35
|
-
detach() {
|
|
36
|
-
document.removeEventListener('keydown', this._handleKeyDown);
|
|
37
|
-
}
|
|
38
|
-
activate() {
|
|
39
|
-
this.active = true;
|
|
40
|
-
}
|
|
41
|
-
deactivate() {
|
|
42
|
-
this.active = false;
|
|
43
|
-
}
|
|
44
|
-
getFocusableElements(container) {
|
|
45
|
-
return UiDomUtils.getFocusableElements(container).filter(($el) => this._isElementTrulyFocusable($el));
|
|
46
|
-
}
|
|
47
|
-
_isElementTrulyFocusable($el) {
|
|
48
|
-
const style = window.getComputedStyle($el);
|
|
49
|
-
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
if ($el.nodeName === 'H-PORTAL')
|
|
53
|
-
return true;
|
|
54
|
-
const $parent = $el.parentElement;
|
|
55
|
-
if (!$parent)
|
|
56
|
-
return true;
|
|
57
|
-
return this._isElementTrulyFocusable($parent);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { BaseFocusTrapStrategy };
|
|
62
|
-
//# sourceMappingURL=base_focus_trap_strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base_focus_trap_strategy_types.js","sourceRoot":"","sources":["../../../../../../../../src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy_types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy';
|
|
2
|
-
import { IBaseFocusTrapStrategy } from '../base_focus_trap_strategy_types';
|
|
3
|
-
import { TCyclicFocusTrapStrategyProps } from './cyclic_focus_trap_strategy_types';
|
|
4
|
-
export declare class CyclicFocusTrapStrategy extends BaseFocusTrapStrategy implements IBaseFocusTrapStrategy {
|
|
5
|
-
constructor({ getContainer }: TCyclicFocusTrapStrategyProps);
|
|
6
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy.js';
|
|
2
|
-
|
|
3
|
-
class CyclicFocusTrapStrategy extends BaseFocusTrapStrategy {
|
|
4
|
-
constructor({ getContainer }) {
|
|
5
|
-
super(getContainer);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { CyclicFocusTrapStrategy };
|
|
10
|
-
//# sourceMappingURL=cyclic_focus_trap_strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cyclic_focus_trap_strategy_types.js","sourceRoot":"","sources":["../../../../../../../../../src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy';
|
|
2
|
-
import { IBaseFocusTrapStrategy } from '../base_focus_trap_strategy_types';
|
|
3
|
-
import { TSentinelFocusTrapStrategyProps } from './sentinel_focus_trap_strategy_types';
|
|
4
|
-
export declare class SentinelFocusTrapStrategy extends BaseFocusTrapStrategy implements IBaseFocusTrapStrategy {
|
|
5
|
-
constructor({ getContainer, noAutofocus }: TSentinelFocusTrapStrategyProps);
|
|
6
|
-
activate(): void;
|
|
7
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy.js';
|
|
2
|
-
|
|
3
|
-
class SentinelFocusTrapStrategy extends BaseFocusTrapStrategy {
|
|
4
|
-
constructor({ getContainer, noAutofocus = false }) {
|
|
5
|
-
super(getContainer);
|
|
6
|
-
this.noAutofocus = noAutofocus;
|
|
7
|
-
}
|
|
8
|
-
activate() {
|
|
9
|
-
this.active = true;
|
|
10
|
-
if (!this.noAutofocus) {
|
|
11
|
-
requestAnimationFrame(() => {
|
|
12
|
-
const container = this.getContainer();
|
|
13
|
-
if (!container)
|
|
14
|
-
return;
|
|
15
|
-
const focusableElements = this.getFocusableElements(container);
|
|
16
|
-
const shouldSkipStartSentinel = focusableElements.length > 1;
|
|
17
|
-
const $firstFocusableContentElement = shouldSkipStartSentinel ? focusableElements[1] : focusableElements[0];
|
|
18
|
-
$firstFocusableContentElement === null || $firstFocusableContentElement === void 0 ? void 0 : $firstFocusableContentElement.focus();
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { SentinelFocusTrapStrategy };
|
|
25
|
-
//# sourceMappingURL=sentinel_focus_trap_strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sentinel_focus_trap_strategy_types.js","sourceRoot":"","sources":["../../../../../../../../../src/controllers/focus_trap_controller/strategies/sentinel_focus_trap_strategy/sentinel_focus_trap_strategy_types.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy';
|
|
2
|
-
import { IBaseFocusTrapStrategy } from '../base_focus_trap_strategy_types';
|
|
3
|
-
import { TTogglerFocusTrapStrategyProps } from './toggler_focus_trap_strategy_types';
|
|
4
|
-
export declare class TogglerFocusTrapStrategy extends BaseFocusTrapStrategy implements IBaseFocusTrapStrategy {
|
|
5
|
-
#private;
|
|
6
|
-
constructor({ getContainer, getToggler }: TTogglerFocusTrapStrategyProps);
|
|
7
|
-
protected _handleKeyDown: (ev: KeyboardEvent) => void;
|
|
8
|
-
private _focusLastContentElement;
|
|
9
|
-
private _focusFirstContentElement;
|
|
10
|
-
private _returnToToggler;
|
|
11
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy.js';
|
|
3
|
-
|
|
4
|
-
var _TogglerFocusTrapStrategy_getToggler;
|
|
5
|
-
class TogglerFocusTrapStrategy extends BaseFocusTrapStrategy {
|
|
6
|
-
constructor({ getContainer, getToggler }) {
|
|
7
|
-
super(getContainer);
|
|
8
|
-
_TogglerFocusTrapStrategy_getToggler.set(this, void 0);
|
|
9
|
-
this._handleKeyDown = (ev) => {
|
|
10
|
-
var _a;
|
|
11
|
-
if (!this.active || ev.code !== 'Tab')
|
|
12
|
-
return;
|
|
13
|
-
const container = this.getContainer();
|
|
14
|
-
const toggler = (_a = __classPrivateFieldGet(this, _TogglerFocusTrapStrategy_getToggler, "f")) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
15
|
-
if (!container || !toggler)
|
|
16
|
-
return;
|
|
17
|
-
const $target = ev.target;
|
|
18
|
-
const focusableElements = this.getFocusableElements(container);
|
|
19
|
-
if (ev.shiftKey) {
|
|
20
|
-
if (toggler.contains($target))
|
|
21
|
-
return this._focusLastContentElement(ev, focusableElements);
|
|
22
|
-
if ($target === focusableElements[0])
|
|
23
|
-
return this._returnToToggler(ev, toggler);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
if (toggler.contains($target))
|
|
27
|
-
return this._focusFirstContentElement(ev, focusableElements);
|
|
28
|
-
if ($target === focusableElements[focusableElements.length - 1])
|
|
29
|
-
return this._returnToToggler(ev, toggler);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
__classPrivateFieldSet(this, _TogglerFocusTrapStrategy_getToggler, getToggler, "f");
|
|
33
|
-
}
|
|
34
|
-
_focusLastContentElement(ev, focusableElements) {
|
|
35
|
-
const last = focusableElements[focusableElements.length - 1];
|
|
36
|
-
if (!last)
|
|
37
|
-
return;
|
|
38
|
-
ev.preventDefault();
|
|
39
|
-
last.focus();
|
|
40
|
-
}
|
|
41
|
-
_focusFirstContentElement(ev, focusableElements) {
|
|
42
|
-
const first = focusableElements[0];
|
|
43
|
-
if (!first)
|
|
44
|
-
return;
|
|
45
|
-
ev.preventDefault();
|
|
46
|
-
first.focus();
|
|
47
|
-
}
|
|
48
|
-
_returnToToggler(ev, toggler) {
|
|
49
|
-
ev.preventDefault();
|
|
50
|
-
toggler.focus();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
_TogglerFocusTrapStrategy_getToggler = new WeakMap();
|
|
54
|
-
|
|
55
|
-
export { TogglerFocusTrapStrategy };
|
|
56
|
-
//# sourceMappingURL=toggler_focus_trap_strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,kDAAsD;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggler_focus_trap_strategy_types.js","sourceRoot":"","sources":["../../../../../../../../../src/controllers/focus_trap_controller/strategies/toggler_focus_trap_strategy/toggler_focus_trap_strategy_types.ts"],"names":[],"mappings":""}
|