@shoper/phoenix_design_system 1.18.34-1 → 1.18.34-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/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js +9 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js +2 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.d.ts +3 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js +9 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/base_focus_trap_strategy.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.d.ts +1 -1
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy.js +2 -2
- package/build/esm/packages/phoenix/src/controllers/focus_trap_controller/strategies/cyclic_focus_trap_strategy/cyclic_focus_trap_strategy_types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var utilities = require('@dreamcommerce/utilities');
|
|
6
6
|
|
|
7
7
|
class BaseFocusTrapStrategy {
|
|
8
|
-
constructor(getContainer) {
|
|
8
|
+
constructor(getContainer, getOpener) {
|
|
9
9
|
this.getContainer = getContainer;
|
|
10
|
+
this.getOpener = getOpener;
|
|
10
11
|
this.active = false;
|
|
11
12
|
this.noAutofocus = false;
|
|
12
13
|
this._handleKeyDown = (ev) => {
|
|
@@ -34,16 +35,23 @@ class BaseFocusTrapStrategy {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
attach() {
|
|
38
|
+
var _a, _b;
|
|
37
39
|
document.addEventListener('keydown', this._handleKeyDown);
|
|
40
|
+
(_b = (_a = this.getOpener) === null || _a === void 0 ? void 0 : _a.call(this)) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-haspopup', 'dialog');
|
|
38
41
|
}
|
|
39
42
|
detach() {
|
|
40
43
|
document.removeEventListener('keydown', this._handleKeyDown);
|
|
41
44
|
}
|
|
42
45
|
activate() {
|
|
46
|
+
var _a, _b, _c;
|
|
43
47
|
this.active = true;
|
|
48
|
+
(_b = (_a = this.getOpener) === null || _a === void 0 ? void 0 : _a.call(this)) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-haspopup', 'dialog');
|
|
49
|
+
(_c = this.getContainer()) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-modal', 'true');
|
|
44
50
|
}
|
|
45
51
|
deactivate() {
|
|
52
|
+
var _a;
|
|
46
53
|
this.active = false;
|
|
54
|
+
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeAttribute('aria-modal');
|
|
47
55
|
}
|
|
48
56
|
getFocusableElements(container) {
|
|
49
57
|
return utilities.UiDomUtils.getFocusableElements(container).filter(($el) => this._isElementTrulyFocusable($el));
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var base_focus_trap_strategy = require('../base_focus_trap_strategy.js');
|
|
6
6
|
|
|
7
7
|
class CyclicFocusTrapStrategy extends base_focus_trap_strategy.BaseFocusTrapStrategy {
|
|
8
|
-
constructor({ getContainer }) {
|
|
9
|
-
super(getContainer);
|
|
8
|
+
constructor({ getContainer, getOpener }) {
|
|
9
|
+
super(getContainer, getOpener);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IBaseFocusTrapStrategy } from './base_focus_trap_strategy_types';
|
|
2
2
|
export declare abstract class BaseFocusTrapStrategy implements IBaseFocusTrapStrategy {
|
|
3
|
-
protected readonly getContainer: () => HTMLElement | undefined;
|
|
3
|
+
protected readonly getContainer: () => HTMLElement | null | undefined;
|
|
4
|
+
protected readonly getOpener?: (() => HTMLElement | null | undefined) | undefined;
|
|
4
5
|
protected active: boolean;
|
|
5
6
|
noAutofocus: boolean;
|
|
6
|
-
constructor(getContainer: () => HTMLElement | undefined);
|
|
7
|
+
constructor(getContainer: () => HTMLElement | null | undefined, getOpener?: (() => HTMLElement | null | undefined) | undefined);
|
|
7
8
|
attach(): void;
|
|
8
9
|
detach(): void;
|
|
9
10
|
activate(): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
2
2
|
|
|
3
3
|
class BaseFocusTrapStrategy {
|
|
4
|
-
constructor(getContainer) {
|
|
4
|
+
constructor(getContainer, getOpener) {
|
|
5
5
|
this.getContainer = getContainer;
|
|
6
|
+
this.getOpener = getOpener;
|
|
6
7
|
this.active = false;
|
|
7
8
|
this.noAutofocus = false;
|
|
8
9
|
this._handleKeyDown = (ev) => {
|
|
@@ -30,16 +31,23 @@ class BaseFocusTrapStrategy {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
attach() {
|
|
34
|
+
var _a, _b;
|
|
33
35
|
document.addEventListener('keydown', this._handleKeyDown);
|
|
36
|
+
(_b = (_a = this.getOpener) === null || _a === void 0 ? void 0 : _a.call(this)) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-haspopup', 'dialog');
|
|
34
37
|
}
|
|
35
38
|
detach() {
|
|
36
39
|
document.removeEventListener('keydown', this._handleKeyDown);
|
|
37
40
|
}
|
|
38
41
|
activate() {
|
|
42
|
+
var _a, _b, _c;
|
|
39
43
|
this.active = true;
|
|
44
|
+
(_b = (_a = this.getOpener) === null || _a === void 0 ? void 0 : _a.call(this)) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-haspopup', 'dialog');
|
|
45
|
+
(_c = this.getContainer()) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-modal', 'true');
|
|
40
46
|
}
|
|
41
47
|
deactivate() {
|
|
48
|
+
var _a;
|
|
42
49
|
this.active = false;
|
|
50
|
+
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeAttribute('aria-modal');
|
|
43
51
|
}
|
|
44
52
|
getFocusableElements(container) {
|
|
45
53
|
return UiDomUtils.getFocusableElements(container).filter(($el) => this._isElementTrulyFocusable($el));
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -2,5 +2,5 @@ import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy';
|
|
|
2
2
|
import { IBaseFocusTrapStrategy } from '../base_focus_trap_strategy_types';
|
|
3
3
|
import { TCyclicFocusTrapStrategyProps } from './cyclic_focus_trap_strategy_types';
|
|
4
4
|
export declare class CyclicFocusTrapStrategy extends BaseFocusTrapStrategy implements IBaseFocusTrapStrategy {
|
|
5
|
-
constructor({ getContainer }: TCyclicFocusTrapStrategyProps);
|
|
5
|
+
constructor({ getContainer, getOpener }: TCyclicFocusTrapStrategyProps);
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseFocusTrapStrategy } from '../base_focus_trap_strategy.js';
|
|
2
2
|
|
|
3
3
|
class CyclicFocusTrapStrategy extends BaseFocusTrapStrategy {
|
|
4
|
-
constructor({ getContainer }) {
|
|
5
|
-
super(getContainer);
|
|
4
|
+
constructor({ getContainer, getOpener }) {
|
|
5
|
+
super(getContainer, getOpener);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|