@shoper/phoenix_design_system 1.15.11-39 → 1.15.11-40
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 +2 -9
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js +5 -23
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio_control.js +5 -0
- package/build/cjs/packages/phoenix/src/components/form/radio/radio_control.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/search/select_search.js +1 -48
- package/build/cjs/packages/phoenix/src/components/form/select/components/search/select_search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/select_options.js +2 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/select_options.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +29 -97
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +3 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js +38 -83
- package/build/cjs/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +2 -9
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.d.ts +0 -3
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +5 -23
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio_control.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/form/radio/radio_control.js +5 -0
- package/build/esm/packages/phoenix/src/components/form/radio/radio_control.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.d.ts +0 -7
- package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.js +1 -48
- package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/select_options.js +2 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/select_options.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +6 -16
- package/build/esm/packages/phoenix/src/components/form/select/select.js +29 -97
- package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.js +3 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_controller_types.d.ts +2 -6
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_controller_types.js +0 -1
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_controller_types.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.d.ts +3 -8
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js +38 -83
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
- package/package.json +2 -2
- package/build/cjs/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js +0 -88
- package/build/cjs/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.d.ts +0 -14
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js +0 -84
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller_types.d.ts +0 -8
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller_types.js +0 -3
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller_types.js.map +0 -1
|
@@ -32,7 +32,6 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
32
32
|
this.portalTarget = dropdown_constants.DEFAULT_DROPDOWN_PORTAL_NAME;
|
|
33
33
|
this.id = v4['default']();
|
|
34
34
|
this.preventFocusTrap = false;
|
|
35
|
-
this.noAutoFocus = false;
|
|
36
35
|
this._backdropController = new backdrop_controller.BackdropController();
|
|
37
36
|
this._handleClickOutside = async (target) => {
|
|
38
37
|
var _a, _b;
|
|
@@ -49,8 +48,7 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
50
|
await this.show();
|
|
52
|
-
|
|
53
|
-
this._focusOnFirstContentElement();
|
|
51
|
+
this._focusOnFirstContentElement();
|
|
54
52
|
};
|
|
55
53
|
this.show = async () => {
|
|
56
54
|
if (this.opened)
|
|
@@ -178,8 +176,7 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
|
|
|
178
176
|
const isHoveredWithinDropdown = this._isHoveredWithinDropdown(ev.target);
|
|
179
177
|
if (isHoveredWithinDropdown && !this.opened) {
|
|
180
178
|
await this.show();
|
|
181
|
-
|
|
182
|
-
this._focusOnFirstContentElement();
|
|
179
|
+
this._focusOnFirstContentElement();
|
|
183
180
|
return;
|
|
184
181
|
}
|
|
185
182
|
if (!isHoveredWithinDropdown && this.opened)
|
|
@@ -469,10 +466,6 @@ tslib_es6.__decorate([
|
|
|
469
466
|
decorators_js.property({ type: Boolean, attribute: 'prevent-focus-trap' }),
|
|
470
467
|
tslib_es6.__metadata("design:type", Object)
|
|
471
468
|
], exports.HDropdown.prototype, "preventFocusTrap", void 0);
|
|
472
|
-
tslib_es6.__decorate([
|
|
473
|
-
decorators_js.property({ type: Boolean, attribute: 'no-autofocus' }),
|
|
474
|
-
tslib_es6.__metadata("design:type", Object)
|
|
475
|
-
], exports.HDropdown.prototype, "noAutoFocus", void 0);
|
|
476
469
|
exports.HDropdown = HDropdown_1 = tslib_es6.__decorate([
|
|
477
470
|
phoenix_custom_element.phoenixCustomElement('h-dropdown'),
|
|
478
471
|
tslib_es6.__metadata("design:paramtypes", [])
|
|
@@ -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,iBAAiB,qDAAyD;AAC1E;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,iBAAiB,qDAAyD;AAC1E;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -7,6 +7,7 @@ var decorators = require('lit/decorators');
|
|
|
7
7
|
require('@dreamcommerce/utilities');
|
|
8
8
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
9
9
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
10
|
+
var btn_controller = require('../../controllers/btn_controller/btn_controller.js');
|
|
10
11
|
var global_constants = require('../../global_constants.js');
|
|
11
12
|
var dropdown_constants = require('./dropdown_constants.js');
|
|
12
13
|
var toggle_element_aria_controller = require('../../controllers/toggle_element_aria_controller/toggle_element_aria_controller.js');
|
|
@@ -15,9 +16,6 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
15
16
|
constructor() {
|
|
16
17
|
super();
|
|
17
18
|
this.name = '';
|
|
18
|
-
this.ariaHasPopup = 'menu';
|
|
19
|
-
this.ariaControls = '';
|
|
20
|
-
this.role = 'button';
|
|
21
19
|
this._setupTogglerAria = () => {
|
|
22
20
|
this._$dropdown = this.closest(dropdown_constants.DROPDOWN_CONTAINER_NAME);
|
|
23
21
|
if (this._$dropdown.isOpened)
|
|
@@ -25,14 +23,11 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
25
23
|
host: this,
|
|
26
24
|
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
27
25
|
});
|
|
28
|
-
this.setAttribute('
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.setAttribute('aria-controls', this.ariaControls || this._$dropdown.id);
|
|
26
|
+
this.setAttribute('aria-haspopup', 'true');
|
|
27
|
+
if (this._$dropdown.id)
|
|
28
|
+
this.setAttribute('aria-controls', this._$dropdown.id);
|
|
32
29
|
};
|
|
33
30
|
this._dispatchToggleDropdownEventWithKeyboard = (ev) => {
|
|
34
|
-
if (ev.key !== 'Enter' && ev.key !== ' ')
|
|
35
|
-
return;
|
|
36
31
|
ev.stopImmediatePropagation();
|
|
37
32
|
this._dispatchToggleDropdownEvent(ev);
|
|
38
33
|
};
|
|
@@ -51,8 +46,7 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
|
|
|
51
46
|
connectedCallback() {
|
|
52
47
|
var _a;
|
|
53
48
|
super.connectedCallback();
|
|
54
|
-
this.
|
|
55
|
-
this.addEventListener('keydown', this._dispatchToggleDropdownEventWithKeyboard);
|
|
49
|
+
this._btnController = new btn_controller.BtnController(this, this._dispatchToggleDropdownEventWithKeyboard);
|
|
56
50
|
this._setupTogglerAria();
|
|
57
51
|
const hasToggleOnHover = (_a = this._$dropdown) === null || _a === void 0 ? void 0 : _a.hasAttribute(dropdown_constants.DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME);
|
|
58
52
|
if (hasToggleOnHover) {
|
|
@@ -66,18 +60,6 @@ tslib_es6.__decorate([
|
|
|
66
60
|
decorators.property({ type: String, reflect: true }),
|
|
67
61
|
tslib_es6.__metadata("design:type", Object)
|
|
68
62
|
], exports.HDropdownToggler.prototype, "name", void 0);
|
|
69
|
-
tslib_es6.__decorate([
|
|
70
|
-
decorators.property({ type: String, attribute: 'aria-haspopup' }),
|
|
71
|
-
tslib_es6.__metadata("design:type", Object)
|
|
72
|
-
], exports.HDropdownToggler.prototype, "ariaHasPopup", void 0);
|
|
73
|
-
tslib_es6.__decorate([
|
|
74
|
-
decorators.property({ type: String, attribute: 'aria-controls' }),
|
|
75
|
-
tslib_es6.__metadata("design:type", Object)
|
|
76
|
-
], exports.HDropdownToggler.prototype, "ariaControls", void 0);
|
|
77
|
-
tslib_es6.__decorate([
|
|
78
|
-
decorators.property({ type: String }),
|
|
79
|
-
tslib_es6.__metadata("design:type", Object)
|
|
80
|
-
], exports.HDropdownToggler.prototype, "role", void 0);
|
|
81
63
|
exports.HDropdownToggler = tslib_es6.__decorate([
|
|
82
64
|
phoenix_custom_element.phoenixCustomElement('h-dropdown-toggler'),
|
|
83
65
|
tslib_es6.__metadata("design:paramtypes", [])
|
|
@@ -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;
|
|
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;"}
|
|
@@ -41,6 +41,7 @@ exports.HRadioControl = class HRadioControl extends phoenix_light_lit_element.Ph
|
|
|
41
41
|
?readonly="${this.readonly}"
|
|
42
42
|
?hidden="${this.hidden}"
|
|
43
43
|
.checked="${this.checked}"
|
|
44
|
+
aria-describedby="${ifDefined_js.ifDefined(this.ariaDescribedby)}"
|
|
44
45
|
@change="${this._handleChangeEvent}"
|
|
45
46
|
/>
|
|
46
47
|
|
|
@@ -80,6 +81,10 @@ tslib_es6.__decorate([
|
|
|
80
81
|
decorators.property({ type: String }),
|
|
81
82
|
tslib_es6.__metadata("design:type", String)
|
|
82
83
|
], exports.HRadioControl.prototype, "value", void 0);
|
|
84
|
+
tslib_es6.__decorate([
|
|
85
|
+
decorators.property({ type: String, attribute: 'aria-describedby' }),
|
|
86
|
+
tslib_es6.__metadata("design:type", String)
|
|
87
|
+
], exports.HRadioControl.prototype, "ariaDescribedby", void 0);
|
|
83
88
|
exports.HRadioControl = tslib_es6.__decorate([
|
|
84
89
|
phoenix_custom_element.phoenixCustomElement('h-radio-control'),
|
|
85
90
|
tslib_es6.__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/components/form/select/components/search/select_search.js
CHANGED
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib_es6 = require('../../../../../../../../external/tslib/tslib.es6.js');
|
|
6
6
|
var lit = require('lit');
|
|
7
7
|
var decorators = require('lit/decorators');
|
|
8
|
-
require('@dreamcommerce/utilities');
|
|
9
8
|
var phoenix_light_lit_element = require('../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
10
9
|
var phoenix_custom_element = require('../../../../../core/decorators/phoenix_custom_element.js');
|
|
11
10
|
var select_components_constatns = require('../select_components_constatns.js');
|
|
12
|
-
var dropdown_constants = require('../../../../dropdown/dropdown_constants.js');
|
|
13
11
|
var debounce = require('../../../../../../../../external/lodash/debounce.js');
|
|
14
12
|
var select_search_constants = require('./select_search_constants.js');
|
|
15
13
|
|
|
@@ -17,37 +15,6 @@ exports.HSelectSearch = class HSelectSearch extends phoenix_light_lit_element.Ph
|
|
|
17
15
|
constructor() {
|
|
18
16
|
super(...arguments);
|
|
19
17
|
this.value = '';
|
|
20
|
-
this.selectControlId = '';
|
|
21
|
-
this.selectOptionsId = '';
|
|
22
|
-
this._$selectOptions = null;
|
|
23
|
-
this._$select = null;
|
|
24
|
-
this._handleSearchKeydown = (ev) => {
|
|
25
|
-
if (ev.key !== 'ArrowDown' && ev.key !== 'ArrowUp')
|
|
26
|
-
return;
|
|
27
|
-
this._handleFocusOptionOnArrowNavigation();
|
|
28
|
-
this._handleDispatchEventOnOptionsList(ev);
|
|
29
|
-
};
|
|
30
|
-
this._handleDispatchEventOnOptionsList = (ev) => {
|
|
31
|
-
var _a;
|
|
32
|
-
const arrowNavigationEvent = new KeyboardEvent('keydown', {
|
|
33
|
-
key: ev.key
|
|
34
|
-
});
|
|
35
|
-
(_a = this._$selectOptions) === null || _a === void 0 ? void 0 : _a.dispatchEvent(arrowNavigationEvent);
|
|
36
|
-
};
|
|
37
|
-
this._handleFocusOptionOnArrowNavigation = () => {
|
|
38
|
-
var _a;
|
|
39
|
-
const $options = this._$selectOptions ? [...this._$selectOptions.querySelectorAll('h-option')] : [];
|
|
40
|
-
const $availableOptions = $options.filter(($option) => {
|
|
41
|
-
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
42
|
-
});
|
|
43
|
-
const $firstOption = $availableOptions.find(($option) => {
|
|
44
|
-
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.getAttribute('hidden');
|
|
45
|
-
});
|
|
46
|
-
const $selectedOption = $availableOptions.find(($option) => $option.getAttribute('aria-selected'));
|
|
47
|
-
const $optionToFocus = $selectedOption || $firstOption;
|
|
48
|
-
if ($optionToFocus)
|
|
49
|
-
(_a = this._$select) === null || _a === void 0 ? void 0 : _a.manageSelectVirtualFocus($optionToFocus);
|
|
50
|
-
};
|
|
51
18
|
this._handleInputChange = debounce['default'](({ target }) => {
|
|
52
19
|
this.value = target.value;
|
|
53
20
|
this.emitCustomEvent(select_components_constatns.SELECT_SEARCH_EVENT_NAMES.search, {
|
|
@@ -58,22 +25,16 @@ exports.HSelectSearch = class HSelectSearch extends phoenix_light_lit_element.Ph
|
|
|
58
25
|
connectedCallback() {
|
|
59
26
|
super.connectedCallback();
|
|
60
27
|
this.classList.add(select_search_constants.SELECT_SEARCH_CSS_CLASSES.selectSearch);
|
|
61
|
-
const $selectOptionsContainer = this.closest(dropdown_constants.DROPDOWN_CONTENT_NAME);
|
|
62
|
-
this._$selectOptions = $selectOptionsContainer === null || $selectOptionsContainer === void 0 ? void 0 : $selectOptionsContainer.querySelector('h-options');
|
|
63
|
-
this._$select = document.querySelector(`[control-id="${this.selectControlId}"]`);
|
|
64
|
-
this.addEventListener('keydown', this._handleSearchKeydown);
|
|
65
28
|
}
|
|
66
29
|
render() {
|
|
67
30
|
return lit.html `
|
|
68
31
|
<h-icon icon-name="icon-search" class=${select_search_constants.SELECT_SEARCH_CSS_CLASSES.selectSearchIcon}></h-icon>
|
|
69
32
|
<input
|
|
70
|
-
|
|
71
|
-
class="${select_search_constants.SELECT_SEARCH_CSS_CLASSES.selectSearchInput}"
|
|
33
|
+
class=${select_search_constants.SELECT_SEARCH_CSS_CLASSES.selectSearchInput}
|
|
72
34
|
type="text"
|
|
73
35
|
role="search"
|
|
74
36
|
.value=${this.value}
|
|
75
37
|
aria-autocomplete="list"
|
|
76
|
-
aria-controls="${this.selectOptionsId}"
|
|
77
38
|
autocomplete="false"
|
|
78
39
|
placeholder="Szukaj"
|
|
79
40
|
@input=${this._handleInputChange}
|
|
@@ -85,14 +46,6 @@ tslib_es6.__decorate([
|
|
|
85
46
|
decorators.property({ type: String, reflect: true }),
|
|
86
47
|
tslib_es6.__metadata("design:type", String)
|
|
87
48
|
], exports.HSelectSearch.prototype, "value", void 0);
|
|
88
|
-
tslib_es6.__decorate([
|
|
89
|
-
decorators.property({ type: String }),
|
|
90
|
-
tslib_es6.__metadata("design:type", String)
|
|
91
|
-
], exports.HSelectSearch.prototype, "selectControlId", void 0);
|
|
92
|
-
tslib_es6.__decorate([
|
|
93
|
-
decorators.property({ type: String }),
|
|
94
|
-
tslib_es6.__metadata("design:type", String)
|
|
95
|
-
], exports.HSelectSearch.prototype, "selectOptionsId", void 0);
|
|
96
49
|
exports.HSelectSearch = tslib_es6.__decorate([
|
|
97
50
|
phoenix_custom_element.phoenixCustomElement(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.search)
|
|
98
51
|
], exports.HSelectSearch);
|
package/build/cjs/packages/phoenix/src/components/form/select/components/search/select_search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA,uBAAuB,qDAAyD;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
-
require('@dreamcommerce/utilities');
|
|
6
|
+
var utilities = require('@dreamcommerce/utilities');
|
|
7
7
|
var phoenix_light_lit_element = require('../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
8
|
var phoenix_custom_element = require('../../../../core/decorators/phoenix_custom_element.js');
|
|
9
9
|
var select_components_constatns = require('./select_components_constatns.js');
|
|
@@ -26,6 +26,7 @@ exports.HOptions = class HOptions extends phoenix_light_lit_element.PhoenixLight
|
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
this.setAttribute('role', 'listbox');
|
|
29
|
+
utilities.UiDomUtils.makeNavigable(this);
|
|
29
30
|
this.addEventListener(select_components_constatns.SELECT_OPTION_EVENT_NAMES.clicked, this._dispatchClickedEvent);
|
|
30
31
|
this.addEventListener(select_components_constatns.SELECT_OPTION_EVENT_NAMES.updated, this._dispatchUpdatedEvent);
|
|
31
32
|
}
|
package/build/cjs/packages/phoenix/src/components/form/select/components/select_options.js.map
CHANGED
|
@@ -1 +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;"}
|
|
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;"}
|
|
@@ -18,7 +18,6 @@ var observable_directive = require('../../../directives/observable_directive.js'
|
|
|
18
18
|
var select_toggler = require('./components/toggler/select_toggler.js');
|
|
19
19
|
var ref_js = require('lit-html/directives/ref.js');
|
|
20
20
|
var context_provider_controller = require('../../../core/context/context_provider_controller.js');
|
|
21
|
-
var v4 = require('../../../../../../external/uuid/dist/esm-browser/v4.js');
|
|
22
21
|
var dropdown_content = require('../../dropdown/dropdown_content.js');
|
|
23
22
|
var dropdown_toggler = require('../../dropdown/dropdown_toggler.js');
|
|
24
23
|
var dropdown = require('../../dropdown/dropdown.js');
|
|
@@ -30,7 +29,6 @@ var select_utils = require('./select_utils.js');
|
|
|
30
29
|
var select_controller = require('./controllers/select_controller.js');
|
|
31
30
|
var select_option_mapper = require('./model/select_option_mapper.js');
|
|
32
31
|
var repeat = require('lit/directives/repeat');
|
|
33
|
-
var select_toggler_keyboard_controller = require('./controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js');
|
|
34
32
|
|
|
35
33
|
exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
36
34
|
constructor() {
|
|
@@ -42,15 +40,14 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
42
40
|
this.searchDisabled = false;
|
|
43
41
|
this.type = select_constants.SELECT_TYPES.select;
|
|
44
42
|
this.noDeselect = false;
|
|
45
|
-
this.
|
|
46
|
-
this._selectOptionsId = v4['default']();
|
|
43
|
+
this.ariaLabelledby = '';
|
|
47
44
|
this._searchValue = '';
|
|
48
45
|
this._$options = new Map();
|
|
49
|
-
this
|
|
50
|
-
this
|
|
46
|
+
this._$dropdown = ref_js.createRef();
|
|
47
|
+
this._$search = ref_js.createRef();
|
|
51
48
|
this._$optionsList = ref_js.createRef();
|
|
52
49
|
this._$dropdownContent = ref_js.createRef();
|
|
53
|
-
this
|
|
50
|
+
this._$dropdownToggler = ref_js.createRef();
|
|
54
51
|
this._selectContext = new context_provider_controller.ContextProviderController(this);
|
|
55
52
|
this._updateOptions = () => {
|
|
56
53
|
const $options = this._getOptions();
|
|
@@ -108,18 +105,6 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
108
105
|
this.updateOptionAriaAttribute($option);
|
|
109
106
|
});
|
|
110
107
|
};
|
|
111
|
-
this._updateLabelAria = (options) => {
|
|
112
|
-
var _a, _b;
|
|
113
|
-
if (!this.$searchLabel)
|
|
114
|
-
return;
|
|
115
|
-
(_a = this.$searchLabel.querySelector(`[id="value-label"]`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
116
|
-
this.$searchLabel.innerHTML = `
|
|
117
|
-
${(_b = this.$searchLabel) === null || _b === void 0 ? void 0 : _b.innerHTML}
|
|
118
|
-
<span id="value-label" class="sr-only">
|
|
119
|
-
${options.reduce((totalSelectedContent, currentOption) => (totalSelectedContent += currentOption.content), '')}
|
|
120
|
-
</span>
|
|
121
|
-
`;
|
|
122
|
-
};
|
|
123
108
|
this._handleOptionClicked = ({ detail }) => {
|
|
124
109
|
if (!(detail === null || detail === void 0 ? void 0 : detail.$option))
|
|
125
110
|
return;
|
|
@@ -135,37 +120,26 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
135
120
|
});
|
|
136
121
|
};
|
|
137
122
|
this._handleDropdownHidden = () => {
|
|
138
|
-
var _a
|
|
123
|
+
var _a;
|
|
139
124
|
this._searchValue = '';
|
|
140
125
|
this.opened = false;
|
|
141
|
-
(_a = this
|
|
142
|
-
const isBodyActive = document.activeElement === document.body;
|
|
143
|
-
const isInnerElementActive = (_b = this._$dropdownContent.value) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
|
|
144
|
-
if (isInnerElementActive || isBodyActive) {
|
|
145
|
-
(_c = this.$dropdownToggler.value) === null || _c === void 0 ? void 0 : _c.focus();
|
|
146
|
-
}
|
|
126
|
+
(_a = this._$dropdownToggler.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', '');
|
|
147
127
|
};
|
|
148
|
-
this.
|
|
149
|
-
|
|
150
|
-
const $
|
|
151
|
-
if (
|
|
152
|
-
|
|
128
|
+
this._manageSelectFocusAria = (ev) => {
|
|
129
|
+
var _a;
|
|
130
|
+
const $target = ev.target;
|
|
131
|
+
if (!$target)
|
|
132
|
+
return;
|
|
133
|
+
const optionId = $target.id;
|
|
134
|
+
if (optionId) {
|
|
135
|
+
(_a = this._$dropdownToggler.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', optionId);
|
|
153
136
|
}
|
|
154
137
|
};
|
|
155
|
-
this.manageSelectVirtualFocus = ($newOption) => {
|
|
156
|
-
var _a, _b, _c;
|
|
157
|
-
(_a = this.$dropdownToggler.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', $newOption.id);
|
|
158
|
-
(_c = (_b = this.$search.value) === null || _b === void 0 ? void 0 : _b.querySelector('input')) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-activedescendant', $newOption.id);
|
|
159
|
-
this.options.forEach((option) => {
|
|
160
|
-
option.classList.remove('select-option_virtually-focused');
|
|
161
|
-
});
|
|
162
|
-
$newOption.classList.add('select-option_virtually-focused');
|
|
163
|
-
};
|
|
164
138
|
this._closeSelect = () => {
|
|
165
139
|
var _a;
|
|
166
140
|
if (!this.opened)
|
|
167
141
|
return;
|
|
168
|
-
(_a = this
|
|
142
|
+
(_a = this._$dropdown.value) === null || _a === void 0 ? void 0 : _a.hide();
|
|
169
143
|
};
|
|
170
144
|
this._clearOptions = () => {
|
|
171
145
|
this._selectController.deselectAll();
|
|
@@ -209,7 +183,6 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
209
183
|
return Array.from(this._$options.values());
|
|
210
184
|
}
|
|
211
185
|
updated(changedProperties) {
|
|
212
|
-
var _a, _b;
|
|
213
186
|
super.updated(changedProperties);
|
|
214
187
|
if (changedProperties.has('opened')) {
|
|
215
188
|
if (this.opened) {
|
|
@@ -223,55 +196,28 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
223
196
|
if (changedProperties.has('optionsList')) {
|
|
224
197
|
this._updateOptions();
|
|
225
198
|
}
|
|
226
|
-
if (this._$optionsList.value)
|
|
227
|
-
|
|
228
|
-
this.listBoxController = new list_box_keyboard_controller.ListBoxKeyboardController({
|
|
199
|
+
if (this._$optionsList.value && !this._listBoxController)
|
|
200
|
+
this._listBoxController = new list_box_keyboard_controller.ListBoxKeyboardController({
|
|
229
201
|
host: this,
|
|
230
202
|
$list: this._$optionsList.value
|
|
231
203
|
});
|
|
232
|
-
}
|
|
233
|
-
if (this.listBoxController) {
|
|
234
|
-
this.listBoxController.calculateSelectedOptionIndex();
|
|
235
|
-
}
|
|
236
|
-
if (this._$optionsList.value && this.$dropdownToggler.value) {
|
|
237
|
-
(_b = this._selectTogglerKeyboardController) === null || _b === void 0 ? void 0 : _b.hostDisconnected();
|
|
238
|
-
this._selectTogglerKeyboardController = new select_toggler_keyboard_controller.SelectTogglerKeyboardController({
|
|
239
|
-
host: this,
|
|
240
|
-
$toggler: this.$dropdownToggler.value,
|
|
241
|
-
$list: this._$optionsList.value
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
204
|
}
|
|
245
205
|
_focusElementAfterSelectOpened() {
|
|
246
|
-
var _a;
|
|
247
|
-
const $searchInput = (_a = this
|
|
248
|
-
|
|
249
|
-
$searchInput.focus();
|
|
250
|
-
const $options = this._$optionsList.value ? [...this._$optionsList.value.querySelectorAll('h-option')] : [];
|
|
251
|
-
const $firstOption = $options.find(($option) => {
|
|
252
|
-
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.getAttribute('hidden');
|
|
253
|
-
});
|
|
254
|
-
const $selectedOption = this.selectedOptions[0];
|
|
255
|
-
const $optionToFocus = $selectedOption || $firstOption;
|
|
256
|
-
if ($optionToFocus)
|
|
257
|
-
this.manageSelectVirtualFocus($optionToFocus);
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const $searchInput = (_a = this._$search.value) === null || _a === void 0 ? void 0 : _a.querySelector('[role="search"]');
|
|
208
|
+
$searchInput ? $searchInput.focus() : (_b = this._$optionsList.value) === null || _b === void 0 ? void 0 : _b.focus();
|
|
258
209
|
}
|
|
259
210
|
connectedCallback() {
|
|
260
|
-
var _a;
|
|
261
211
|
super.connectedCallback();
|
|
262
212
|
this.classList.add(select_constants.SELECT_CSS_CLASSES.select);
|
|
263
213
|
if (!this.searchDisabled) {
|
|
264
214
|
this.classList.add(select_constants.SELECT_CSS_CLASSES.selectWithSearch);
|
|
265
215
|
}
|
|
266
|
-
this.$searchLabel = document.querySelector(`[id="${this.assistiveTitleId}"]`);
|
|
267
|
-
(_a = this.$searchLabel) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-hidden', 'true');
|
|
268
216
|
this._selectController = this.multiple ? new multi_select_controller.MultiSelectController({ host: this }) : new select_controller.SelectController({ host: this });
|
|
269
217
|
this._selectContext.provide(select_constants.SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
270
218
|
this._selectContext.provide(select_constants.SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
271
219
|
this._optionsObserver = new observer.Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
272
220
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
273
|
-
this._selectedOptionsAriaObserver = new observer.Observer((selectedOptions) => this._updateLabelAria(selectedOptions));
|
|
274
|
-
this._selectController.selectedOptions$.subscribe(this._selectedOptionsAriaObserver);
|
|
275
221
|
this._updateOptions();
|
|
276
222
|
this._setupEvents();
|
|
277
223
|
}
|
|
@@ -301,10 +247,6 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
301
247
|
select_utils.SelectControlUtils.appendHTMLOption($option, $list, position);
|
|
302
248
|
}
|
|
303
249
|
updateOptionAriaAttribute($option) {
|
|
304
|
-
if (!this.multiple) {
|
|
305
|
-
const $options = this._$optionsList.value ? [...this._$optionsList.value.querySelectorAll('h-option')] : [];
|
|
306
|
-
$options.forEach(($option) => ($option.removeAttribute('aria-selected')));
|
|
307
|
-
}
|
|
308
250
|
$option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', String($option.selected));
|
|
309
251
|
}
|
|
310
252
|
_removeHTMLOptions(optionsValues) {
|
|
@@ -314,12 +256,6 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
314
256
|
const option = this._selectController.getOption(value);
|
|
315
257
|
if (!option)
|
|
316
258
|
return;
|
|
317
|
-
const $selectedOption = this._$options.get(option.value);
|
|
318
|
-
const $selectedOptionLink = $selectedOption === null || $selectedOption === void 0 ? void 0 : $selectedOption.querySelector('a');
|
|
319
|
-
if ($selectedOptionLink) {
|
|
320
|
-
$selectedOptionLink.click();
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
259
|
this.noDeselect ? this._selectController.select(option) : this._selectController.toggle(option);
|
|
324
260
|
if (!this.multiple)
|
|
325
261
|
this._closeSelect();
|
|
@@ -370,24 +306,23 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
370
306
|
const isSearchEnabled = !this.searchDisabled && options.length > select_constants.MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH;
|
|
371
307
|
return lit.html `
|
|
372
308
|
<h-dropdown
|
|
373
|
-
${ref_js.ref(this
|
|
374
|
-
@showed=${this.
|
|
309
|
+
${ref_js.ref(this._$dropdown)}
|
|
310
|
+
@showed=${() => (this.opened = true)}
|
|
375
311
|
@hidden=${this._handleDropdownHidden}
|
|
376
312
|
name="${this.controlName}"
|
|
377
313
|
offset=${this.offset}
|
|
378
314
|
content-width="full"
|
|
379
315
|
prevent-focus-trap
|
|
380
|
-
no-autofocus
|
|
381
316
|
>
|
|
382
317
|
<h-dropdown-toggler
|
|
383
|
-
${ref_js.ref(this
|
|
318
|
+
${ref_js.ref(this._$dropdownToggler)}
|
|
384
319
|
name="${this.controlName}"
|
|
385
320
|
validation-container
|
|
386
321
|
aria-haspopup="listbox"
|
|
387
322
|
role="combobox"
|
|
388
323
|
aria-required="${this.required ? 'true' : 'false'}"
|
|
389
|
-
|
|
390
|
-
aria-
|
|
324
|
+
aria-activedescendant
|
|
325
|
+
aria-labelledby="${this.ariaLabelledby}"
|
|
391
326
|
>
|
|
392
327
|
${this.getSlot(select_constants.SELECT_SLOT_NAMES.toggler)}
|
|
393
328
|
</h-dropdown-toggler>
|
|
@@ -396,6 +331,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
396
331
|
class="${select_constants.SELECT_CSS_CLASSES.selectContent} ${this.error ? select_constants.SELECT_CSS_CLASSES.selectContentError : ''}"
|
|
397
332
|
${ref_js.ref(this._$dropdownContent)}
|
|
398
333
|
name="${this.controlName}"
|
|
334
|
+
@focusin="${this._manageSelectFocusAria}"
|
|
399
335
|
>
|
|
400
336
|
<h-select-close-btn class="${select_constants.SELECT_CSS_CLASSES.selectCloseMobileButton}" @close=${this._closeSelect}></h-select-close-btn>
|
|
401
337
|
|
|
@@ -404,18 +340,14 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
404
340
|
${isSearchEnabled
|
|
405
341
|
? lit.html ` <h-select-search
|
|
406
342
|
class=${select_constants.SELECT_CSS_CLASSES.selectSearch}
|
|
407
|
-
${ref_js.ref(this
|
|
343
|
+
${ref_js.ref(this._$search)}
|
|
408
344
|
.value=${this._searchValue}
|
|
409
345
|
@search=${this._handleSearch}
|
|
410
|
-
.selectControlId="${this.controlId}"
|
|
411
|
-
.selectOptionsId="${this._selectOptionsId}"
|
|
412
346
|
></h-select-search>`
|
|
413
347
|
: lit.nothing}
|
|
414
348
|
|
|
415
349
|
<h-options
|
|
416
350
|
class="${select_constants.SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult() ? select_constants.SELECT_CSS_CLASSES.selectOptionsEmpty : ''}"
|
|
417
|
-
aria-labelledby="${this.assistiveTitleId}"
|
|
418
|
-
id="${this._selectOptionsId}"
|
|
419
351
|
${ref_js.ref(this._$optionsList)}
|
|
420
352
|
@optionClicked=${this._handleOptionClicked}
|
|
421
353
|
@optionUpdated=${this._handleOptionUpdated}
|
|
@@ -507,9 +439,9 @@ tslib_es6.__decorate([
|
|
|
507
439
|
tslib_es6.__metadata("design:type", Boolean)
|
|
508
440
|
], exports.HSelect.prototype, "noDeselect", void 0);
|
|
509
441
|
tslib_es6.__decorate([
|
|
510
|
-
decorators_js.property({ type: String, attribute: '
|
|
442
|
+
decorators_js.property({ type: String, attribute: 'aria-labelledby' }),
|
|
511
443
|
tslib_es6.__metadata("design:type", String)
|
|
512
|
-
], exports.HSelect.prototype, "
|
|
444
|
+
], exports.HSelect.prototype, "ariaLabelledby", void 0);
|
|
513
445
|
tslib_es6.__decorate([
|
|
514
446
|
decorators.state(),
|
|
515
447
|
tslib_es6.__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;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,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -116,7 +116,9 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
|
|
|
116
116
|
};
|
|
117
117
|
this._addInertToBodyChildrenElements = () => {
|
|
118
118
|
[...document.body.children].forEach((child) => {
|
|
119
|
-
|
|
119
|
+
const isPortalTarget = child.tagName === portal_constants.PORTAL_TARGET_COMPONENT_NAME.toUpperCase();
|
|
120
|
+
const isAriaLiveContainer = child.hasAttribute('aria-live');
|
|
121
|
+
if (!isPortalTarget && !isAriaLiveContainer) {
|
|
120
122
|
child.setAttribute('inert', '');
|
|
121
123
|
}
|
|
122
124
|
});
|
|
@@ -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;"}
|
|
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;"}
|