@shoper/phoenix_design_system 1.15.3-25 → 1.15.3-27
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 +18 -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.js +18 -6
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
- package/package.json +1 -1
|
@@ -56,10 +56,6 @@ class ListBoxKeyboardController {
|
|
|
56
56
|
if (!$searchInput)
|
|
57
57
|
return;
|
|
58
58
|
$searchInput === null || $searchInput === void 0 ? void 0 : $searchInput.focus();
|
|
59
|
-
const isAPrintableCharacter = ev.key.match(/\P{C}/u);
|
|
60
|
-
if (ev.key.length !== 1 || !isAPrintableCharacter) {
|
|
61
|
-
ev.preventDefault();
|
|
62
|
-
}
|
|
63
59
|
};
|
|
64
60
|
this.calculateSelectedOptionIndex = () => {
|
|
65
61
|
const selectedOptionIndex = tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").findIndex(($option) => $option.selected);
|
|
@@ -91,6 +87,17 @@ class ListBoxKeyboardController {
|
|
|
91
87
|
return undefined;
|
|
92
88
|
if (tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") <= 0)
|
|
93
89
|
return tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
|
|
90
|
+
if (tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") <= 0)
|
|
91
|
+
return tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
|
|
92
|
+
const $availableOptions = tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
|
|
93
|
+
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
94
|
+
});
|
|
95
|
+
if (!!$availableOptions[tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1])
|
|
96
|
+
return tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1;
|
|
97
|
+
// bo ktoś wpisał coś w searcha i index obecnie wybranej opcji jest inny
|
|
98
|
+
const newIndexOfCurrentlySelectedOption = $availableOptions.findIndex(($option) => $option.selected);
|
|
99
|
+
if (newIndexOfCurrentlySelectedOption)
|
|
100
|
+
return newIndexOfCurrentlySelectedOption - 1;
|
|
94
101
|
return tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1;
|
|
95
102
|
}
|
|
96
103
|
_getNextOptionIndex() {
|
|
@@ -101,8 +108,13 @@ class ListBoxKeyboardController {
|
|
|
101
108
|
});
|
|
102
109
|
if (tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") === $availableOptions.length - 1)
|
|
103
110
|
return tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
|
|
104
|
-
if (tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") > $availableOptions.length - 1)
|
|
105
|
-
|
|
111
|
+
if (tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") > $availableOptions.length - 1) {
|
|
112
|
+
// bo ktoś wpisał coś w searcha i index obecnie wybranej opcji jest inny
|
|
113
|
+
const newIndexOfCurrentlySelectedOption = $availableOptions.findIndex(($option) => $option.selected);
|
|
114
|
+
if (newIndexOfCurrentlySelectedOption)
|
|
115
|
+
return newIndexOfCurrentlySelectedOption + 1;
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
106
118
|
return tslib_es6.__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") + 1;
|
|
107
119
|
}
|
|
108
120
|
hostDisconnected() {
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -52,10 +52,6 @@ class ListBoxKeyboardController {
|
|
|
52
52
|
if (!$searchInput)
|
|
53
53
|
return;
|
|
54
54
|
$searchInput === null || $searchInput === void 0 ? void 0 : $searchInput.focus();
|
|
55
|
-
const isAPrintableCharacter = ev.key.match(/\P{C}/u);
|
|
56
|
-
if (ev.key.length !== 1 || !isAPrintableCharacter) {
|
|
57
|
-
ev.preventDefault();
|
|
58
|
-
}
|
|
59
55
|
};
|
|
60
56
|
this.calculateSelectedOptionIndex = () => {
|
|
61
57
|
const selectedOptionIndex = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").findIndex(($option) => $option.selected);
|
|
@@ -87,6 +83,17 @@ class ListBoxKeyboardController {
|
|
|
87
83
|
return undefined;
|
|
88
84
|
if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") <= 0)
|
|
89
85
|
return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
|
|
86
|
+
if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") <= 0)
|
|
87
|
+
return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
|
|
88
|
+
const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
|
|
89
|
+
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
90
|
+
});
|
|
91
|
+
if (!!$availableOptions[__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1])
|
|
92
|
+
return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1;
|
|
93
|
+
// bo ktoś wpisał coś w searcha i index obecnie wybranej opcji jest inny
|
|
94
|
+
const newIndexOfCurrentlySelectedOption = $availableOptions.findIndex(($option) => $option.selected);
|
|
95
|
+
if (newIndexOfCurrentlySelectedOption)
|
|
96
|
+
return newIndexOfCurrentlySelectedOption - 1;
|
|
90
97
|
return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1;
|
|
91
98
|
}
|
|
92
99
|
_getNextOptionIndex() {
|
|
@@ -97,8 +104,13 @@ class ListBoxKeyboardController {
|
|
|
97
104
|
});
|
|
98
105
|
if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") === $availableOptions.length - 1)
|
|
99
106
|
return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
|
|
100
|
-
if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") > $availableOptions.length - 1)
|
|
101
|
-
|
|
107
|
+
if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") > $availableOptions.length - 1) {
|
|
108
|
+
// bo ktoś wpisał coś w searcha i index obecnie wybranej opcji jest inny
|
|
109
|
+
const newIndexOfCurrentlySelectedOption = $availableOptions.findIndex(($option) => $option.selected);
|
|
110
|
+
if (newIndexOfCurrentlySelectedOption)
|
|
111
|
+
return newIndexOfCurrentlySelectedOption + 1;
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
102
114
|
return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") + 1;
|
|
103
115
|
}
|
|
104
116
|
hostDisconnected() {
|
|
@@ -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;"}
|
|
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;"}
|