@shoper/phoenix_design_system 1.15.3-27 → 1.15.3-28
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/list_box_controller/list_box_keyboard_controller.js +10 -6
- package/build/cjs/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.d.ts +1 -0
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js +10 -6
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,9 +21,7 @@ class ListBoxKeyboardController {
|
|
|
21
21
|
this._handleArrowNavigation(ev);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
this._handleWriteableCharacter(ev);
|
|
26
|
-
}
|
|
24
|
+
this._handleWriteableCharacter(ev);
|
|
27
25
|
};
|
|
28
26
|
this._handleArrowNavigation = (event) => {
|
|
29
27
|
event.preventDefault();
|
|
@@ -31,11 +29,10 @@ class ListBoxKeyboardController {
|
|
|
31
29
|
const $availableOptions = tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
|
|
32
30
|
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
33
31
|
});
|
|
34
|
-
const prevOptionIndex =
|
|
32
|
+
const prevOptionIndex = this._findCurrentIndex();
|
|
35
33
|
let newOptionIndex = key === 'ArrowDown' || key === 'ArrowRight' ? this._getNextOptionIndex() : this._getPrevOptionIndex();
|
|
36
34
|
if (newOptionIndex === undefined) {
|
|
37
|
-
|
|
38
|
-
newOptionIndex = selectedOptionIndex !== -1 ? selectedOptionIndex : 0;
|
|
35
|
+
newOptionIndex = this._findCurrentIndex();
|
|
39
36
|
}
|
|
40
37
|
if (newOptionIndex === tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f"))
|
|
41
38
|
return;
|
|
@@ -50,6 +47,13 @@ class ListBoxKeyboardController {
|
|
|
50
47
|
$focusedOption.focus();
|
|
51
48
|
}
|
|
52
49
|
};
|
|
50
|
+
this._findCurrentIndex = () => {
|
|
51
|
+
const $availableOptions = tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
|
|
52
|
+
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
53
|
+
});
|
|
54
|
+
const selectedOptionIndex = $availableOptions.findIndex(($option) => $option.selected);
|
|
55
|
+
return selectedOptionIndex !== -1 ? selectedOptionIndex : 0;
|
|
56
|
+
};
|
|
53
57
|
this._handleWriteableCharacter = (ev) => {
|
|
54
58
|
var _a;
|
|
55
59
|
const $searchInput = (_a = tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_host, "f").$search.value) === null || _a === void 0 ? void 0 : _a.querySelector('[role="search"]');
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -5,6 +5,7 @@ export declare class ListBoxKeyboardController implements IListboxController {
|
|
|
5
5
|
hostConnected(): void;
|
|
6
6
|
private _handleKeyboardNavigation;
|
|
7
7
|
private _handleArrowNavigation;
|
|
8
|
+
private _findCurrentIndex;
|
|
8
9
|
private _handleWriteableCharacter;
|
|
9
10
|
calculateSelectedOptionIndex: () => void;
|
|
10
11
|
private _getPrevOptionIndex;
|
|
@@ -17,9 +17,7 @@ class ListBoxKeyboardController {
|
|
|
17
17
|
this._handleArrowNavigation(ev);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
this._handleWriteableCharacter(ev);
|
|
22
|
-
}
|
|
20
|
+
this._handleWriteableCharacter(ev);
|
|
23
21
|
};
|
|
24
22
|
this._handleArrowNavigation = (event) => {
|
|
25
23
|
event.preventDefault();
|
|
@@ -27,11 +25,10 @@ class ListBoxKeyboardController {
|
|
|
27
25
|
const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
|
|
28
26
|
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
29
27
|
});
|
|
30
|
-
const prevOptionIndex =
|
|
28
|
+
const prevOptionIndex = this._findCurrentIndex();
|
|
31
29
|
let newOptionIndex = key === 'ArrowDown' || key === 'ArrowRight' ? this._getNextOptionIndex() : this._getPrevOptionIndex();
|
|
32
30
|
if (newOptionIndex === undefined) {
|
|
33
|
-
|
|
34
|
-
newOptionIndex = selectedOptionIndex !== -1 ? selectedOptionIndex : 0;
|
|
31
|
+
newOptionIndex = this._findCurrentIndex();
|
|
35
32
|
}
|
|
36
33
|
if (newOptionIndex === __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f"))
|
|
37
34
|
return;
|
|
@@ -46,6 +43,13 @@ class ListBoxKeyboardController {
|
|
|
46
43
|
$focusedOption.focus();
|
|
47
44
|
}
|
|
48
45
|
};
|
|
46
|
+
this._findCurrentIndex = () => {
|
|
47
|
+
const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
|
|
48
|
+
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
49
|
+
});
|
|
50
|
+
const selectedOptionIndex = $availableOptions.findIndex(($option) => $option.selected);
|
|
51
|
+
return selectedOptionIndex !== -1 ? selectedOptionIndex : 0;
|
|
52
|
+
};
|
|
49
53
|
this._handleWriteableCharacter = (ev) => {
|
|
50
54
|
var _a;
|
|
51
55
|
const $searchInput = (_a = __classPrivateFieldGet(this, _ListBoxKeyboardController_host, "f").$search.value) === null || _a === void 0 ? void 0 : _a.querySelector('[role="search"]');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|