@shoper/phoenix_design_system 1.15.11-7 → 1.15.11-9
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 +1 -6
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/search/select_search.js +0 -31
- 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 +15 -67
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/scroll_to/scroll_to.js +7 -6
- package/build/cjs/packages/phoenix/src/components/scroll_to/scroll_to.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js +30 -76
- 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 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +1 -6
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.js +0 -31
- 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 +4 -12
- package/build/esm/packages/phoenix/src/components/form/select/select.js +15 -67
- package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/scroll_to/scroll_to.js +7 -6
- package/build/esm/packages/phoenix/src/components/scroll_to/scroll_to.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 +30 -76
- package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
- package/package.json +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js +0 -98
- 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 -15
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js +0 -94
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qDAAyD;AACxE;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;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qDAAyD;AACxE;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;AACA;AACA;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
2
|
export declare class HDropdownToggler extends PhoenixLightLitElement {
|
|
3
3
|
name: string;
|
|
4
|
-
ariaHasPopup: string;
|
|
5
4
|
private _btnController;
|
|
6
5
|
private _toggleElementAriaController;
|
|
7
6
|
private _$dropdown;
|
|
@@ -12,7 +12,6 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
14
|
this.name = '';
|
|
15
|
-
this.ariaHasPopup = 'menu';
|
|
16
15
|
this._setupTogglerAria = () => {
|
|
17
16
|
this._$dropdown = this.closest(DROPDOWN_CONTAINER_NAME);
|
|
18
17
|
if (this._$dropdown.isOpened)
|
|
@@ -20,7 +19,7 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
20
19
|
host: this,
|
|
21
20
|
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
22
21
|
});
|
|
23
|
-
this.setAttribute('aria-haspopup',
|
|
22
|
+
this.setAttribute('aria-haspopup', 'true');
|
|
24
23
|
if (this._$dropdown.id)
|
|
25
24
|
this.setAttribute('aria-controls', this._$dropdown.id);
|
|
26
25
|
};
|
|
@@ -57,10 +56,6 @@ __decorate([
|
|
|
57
56
|
property({ type: String, reflect: true }),
|
|
58
57
|
__metadata("design:type", Object)
|
|
59
58
|
], HDropdownToggler.prototype, "name", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
property({ type: String, attribute: 'aria-haspopup' }),
|
|
62
|
-
__metadata("design:type", Object)
|
|
63
|
-
], HDropdownToggler.prototype, "ariaHasPopup", void 0);
|
|
64
59
|
HDropdownToggler = __decorate([
|
|
65
60
|
phoenixCustomElement('h-dropdown-toggler'),
|
|
66
61
|
__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/esm/packages/phoenix/src/components/form/select/components/search/select_search.d.ts
CHANGED
|
@@ -2,11 +2,7 @@ import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_el
|
|
|
2
2
|
import { TemplateResult } from 'lit';
|
|
3
3
|
export declare class HSelectSearch extends PhoenixLightLitElement {
|
|
4
4
|
value: string;
|
|
5
|
-
private _$selectOptions;
|
|
6
5
|
connectedCallback(): void;
|
|
7
|
-
private _handleSearchKeydown;
|
|
8
|
-
private _handleDispatchEventOnOptionsList;
|
|
9
|
-
private _handleFocusOptionOnArrowNavigation;
|
|
10
6
|
private _handleInputChange;
|
|
11
7
|
protected render(): TemplateResult;
|
|
12
8
|
}
|
package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators';
|
|
4
|
-
import '@dreamcommerce/utilities';
|
|
5
4
|
import { PhoenixLightLitElement } from '../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
6
5
|
import { phoenixCustomElement } from '../../../../../core/decorators/phoenix_custom_element.js';
|
|
7
6
|
import { SELECT_SEARCH_EVENT_NAMES, SELECT_RELATED_COMPONENTS_NAMES } from '../select_components_constatns.js';
|
|
8
|
-
import { DROPDOWN_CONTENT_NAME } from '../../../../dropdown/dropdown_constants.js';
|
|
9
7
|
import debounce_1 from '../../../../../../../../external/lodash/debounce.js';
|
|
10
8
|
import { SELECT_SEARCH_CSS_CLASSES } from './select_search_constants.js';
|
|
11
9
|
|
|
@@ -13,32 +11,6 @@ let HSelectSearch = class HSelectSearch extends PhoenixLightLitElement {
|
|
|
13
11
|
constructor() {
|
|
14
12
|
super(...arguments);
|
|
15
13
|
this.value = '';
|
|
16
|
-
this._$selectOptions = null;
|
|
17
|
-
this._handleSearchKeydown = (ev) => {
|
|
18
|
-
if (ev.key !== 'ArrowDown' && ev.key !== 'ArrowUp')
|
|
19
|
-
return;
|
|
20
|
-
this._handleFocusOptionOnArrowNavigation();
|
|
21
|
-
this._handleDispatchEventOnOptionsList(ev);
|
|
22
|
-
};
|
|
23
|
-
this._handleDispatchEventOnOptionsList = (ev) => {
|
|
24
|
-
var _a;
|
|
25
|
-
const arrowNavigationEvent = new KeyboardEvent('keydown', {
|
|
26
|
-
key: ev.key
|
|
27
|
-
});
|
|
28
|
-
(_a = this._$selectOptions) === null || _a === void 0 ? void 0 : _a.dispatchEvent(arrowNavigationEvent);
|
|
29
|
-
};
|
|
30
|
-
this._handleFocusOptionOnArrowNavigation = () => {
|
|
31
|
-
const $options = this._$selectOptions ? [...this._$selectOptions.querySelectorAll('h-option')] : [];
|
|
32
|
-
const $availableOptions = $options.filter(($option) => {
|
|
33
|
-
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
|
|
34
|
-
});
|
|
35
|
-
const $firstOption = $availableOptions.find(($option) => {
|
|
36
|
-
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.getAttribute('hidden');
|
|
37
|
-
});
|
|
38
|
-
const $selectedOption = $availableOptions.find(($option) => $option.getAttribute('aria-selected'));
|
|
39
|
-
const $optionToFocus = $selectedOption || $firstOption;
|
|
40
|
-
$optionToFocus === null || $optionToFocus === void 0 ? void 0 : $optionToFocus.focus();
|
|
41
|
-
};
|
|
42
14
|
this._handleInputChange = debounce_1(({ target }) => {
|
|
43
15
|
this.value = target.value;
|
|
44
16
|
this.emitCustomEvent(SELECT_SEARCH_EVENT_NAMES.search, {
|
|
@@ -49,9 +21,6 @@ let HSelectSearch = class HSelectSearch extends PhoenixLightLitElement {
|
|
|
49
21
|
connectedCallback() {
|
|
50
22
|
super.connectedCallback();
|
|
51
23
|
this.classList.add(SELECT_SEARCH_CSS_CLASSES.selectSearch);
|
|
52
|
-
const $selectOptionsContainer = this.closest(DROPDOWN_CONTENT_NAME);
|
|
53
|
-
this._$selectOptions = $selectOptionsContainer === null || $selectOptionsContainer === void 0 ? void 0 : $selectOptionsContainer.querySelector('h-options');
|
|
54
|
-
this.addEventListener('keydown', this._handleSearchKeydown);
|
|
55
24
|
}
|
|
56
25
|
render() {
|
|
57
26
|
return html `
|
package/build/esm/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,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;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;AACA;AACA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import '@dreamcommerce/utilities';
|
|
2
|
+
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
3
3
|
import { PhoenixLightLitElement } from '../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
4
|
import { phoenixCustomElement } from '../../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { SELECT_OPTIONS_EVENT_NAMES, SELECT_OPTION_EVENT_NAMES, SELECT_RELATED_COMPONENTS_NAMES } from './select_components_constatns.js';
|
|
@@ -22,6 +22,7 @@ let HOptions = class HOptions extends PhoenixLightLitElement {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
this.setAttribute('role', 'listbox');
|
|
25
|
+
UiDomUtils.makeNavigable(this);
|
|
25
26
|
this.addEventListener(SELECT_OPTION_EVENT_NAMES.clicked, this._dispatchClickedEvent);
|
|
26
27
|
this.addEventListener(SELECT_OPTION_EVENT_NAMES.updated, this._dispatchUpdatedEvent);
|
|
27
28
|
}
|
package/build/esm/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,uCAAuC,kDAAsD;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,uCAAuC,kDAAsD;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,9 +1,5 @@
|
|
|
1
1
|
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
|
-
import { HDropdown } from "../../dropdown/dropdown";
|
|
3
|
-
import { HDropdownToggler } from "../../dropdown/dropdown_toggler";
|
|
4
2
|
import { HOption } from "./components/option/select_option";
|
|
5
|
-
import { HSelectSearch } from "./components/search/select_search";
|
|
6
|
-
import { ListBoxKeyboardController } from "../../../controllers/list_box_controller/list_box_keyboard_controller";
|
|
7
3
|
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
8
4
|
import { SelectOption } from "./model/select_option";
|
|
9
5
|
import type { TSelectType } from "./select_types";
|
|
@@ -32,18 +28,15 @@ export declare class HSelect extends PhoenixLightLitElement {
|
|
|
32
28
|
private _searchValue;
|
|
33
29
|
private _selectController;
|
|
34
30
|
private _$options;
|
|
35
|
-
$dropdown
|
|
36
|
-
$search
|
|
31
|
+
private _$dropdown;
|
|
32
|
+
private _$search;
|
|
37
33
|
private _$optionsList;
|
|
38
34
|
private _$dropdownContent;
|
|
39
|
-
$dropdownToggler
|
|
35
|
+
private _$dropdownToggler;
|
|
40
36
|
private _selectContext;
|
|
41
|
-
|
|
42
|
-
private _selectTogglerKeyboardController;
|
|
37
|
+
private _listBoxController;
|
|
43
38
|
private _optionsObserver;
|
|
44
|
-
private _selectedOptionsAriaObserver;
|
|
45
39
|
private $placeholder;
|
|
46
|
-
private $searchLabel;
|
|
47
40
|
constructor();
|
|
48
41
|
updated(changedProperties: PropertyValues): void;
|
|
49
42
|
private _focusElementAfterSelectOpened;
|
|
@@ -54,7 +47,6 @@ export declare class HSelect extends PhoenixLightLitElement {
|
|
|
54
47
|
private _setupEvents;
|
|
55
48
|
private _handleOptionDeselect;
|
|
56
49
|
private _updateOptionsView;
|
|
57
|
-
private _updateLabelAria;
|
|
58
50
|
private _appendNewHTMLOption;
|
|
59
51
|
updateOptionAriaAttribute($option: HOption): void;
|
|
60
52
|
private _removeHTMLOptions;
|
|
@@ -25,7 +25,6 @@ import { SelectControlUtils } from './select_utils.js';
|
|
|
25
25
|
import { SelectController } from './controllers/select_controller.js';
|
|
26
26
|
import { SelectOptionMapper } from './model/select_option_mapper.js';
|
|
27
27
|
import { repeat } from 'lit/directives/repeat';
|
|
28
|
-
import { SelectTogglerKeyboardController } from './controllers/select_toggler_keyboard_controller/select_toggler_keyboard_controller.js';
|
|
29
28
|
|
|
30
29
|
let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
31
30
|
constructor() {
|
|
@@ -40,11 +39,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
40
39
|
this.ariaLabelledby = '';
|
|
41
40
|
this._searchValue = '';
|
|
42
41
|
this._$options = new Map();
|
|
43
|
-
this
|
|
44
|
-
this
|
|
42
|
+
this._$dropdown = createRef();
|
|
43
|
+
this._$search = createRef();
|
|
45
44
|
this._$optionsList = createRef();
|
|
46
45
|
this._$dropdownContent = createRef();
|
|
47
|
-
this
|
|
46
|
+
this._$dropdownToggler = createRef();
|
|
48
47
|
this._selectContext = new ContextProviderController(this);
|
|
49
48
|
this._updateOptions = () => {
|
|
50
49
|
const $options = this._getOptions();
|
|
@@ -102,18 +101,6 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
102
101
|
this.updateOptionAriaAttribute($option);
|
|
103
102
|
});
|
|
104
103
|
};
|
|
105
|
-
this._updateLabelAria = (options) => {
|
|
106
|
-
var _a, _b;
|
|
107
|
-
if (!this.$searchLabel)
|
|
108
|
-
return;
|
|
109
|
-
(_a = this.$searchLabel.querySelector(`[id="value-label"]`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
110
|
-
this.$searchLabel.innerHTML = `
|
|
111
|
-
${(_b = this.$searchLabel) === null || _b === void 0 ? void 0 : _b.innerHTML}
|
|
112
|
-
<span id="value-label" class="sr-only">
|
|
113
|
-
${options.reduce((totalSelectedContent, currentOption) => (totalSelectedContent += currentOption.content), '')}
|
|
114
|
-
</span>
|
|
115
|
-
`;
|
|
116
|
-
};
|
|
117
104
|
this._handleOptionClicked = ({ detail }) => {
|
|
118
105
|
if (!(detail === null || detail === void 0 ? void 0 : detail.$option))
|
|
119
106
|
return;
|
|
@@ -129,13 +116,10 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
129
116
|
});
|
|
130
117
|
};
|
|
131
118
|
this._handleDropdownHidden = () => {
|
|
132
|
-
var _a
|
|
119
|
+
var _a;
|
|
133
120
|
this._searchValue = '';
|
|
134
121
|
this.opened = false;
|
|
135
|
-
(_a = this
|
|
136
|
-
if (this.contains(document.activeElement) || document.activeElement === document.body) {
|
|
137
|
-
(_b = this.$dropdownToggler.value) === null || _b === void 0 ? void 0 : _b.focus();
|
|
138
|
-
}
|
|
122
|
+
(_a = this._$dropdownToggler.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', '');
|
|
139
123
|
};
|
|
140
124
|
this._manageSelectFocusAria = (ev) => {
|
|
141
125
|
var _a;
|
|
@@ -144,14 +128,14 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
144
128
|
return;
|
|
145
129
|
const optionId = $target.id;
|
|
146
130
|
if (optionId) {
|
|
147
|
-
(_a = this
|
|
131
|
+
(_a = this._$dropdownToggler.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', optionId);
|
|
148
132
|
}
|
|
149
133
|
};
|
|
150
134
|
this._closeSelect = () => {
|
|
151
135
|
var _a;
|
|
152
136
|
if (!this.opened)
|
|
153
137
|
return;
|
|
154
|
-
(_a = this
|
|
138
|
+
(_a = this._$dropdown.value) === null || _a === void 0 ? void 0 : _a.hide();
|
|
155
139
|
};
|
|
156
140
|
this._clearOptions = () => {
|
|
157
141
|
this._selectController.deselectAll();
|
|
@@ -195,7 +179,6 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
195
179
|
return Array.from(this._$options.values());
|
|
196
180
|
}
|
|
197
181
|
updated(changedProperties) {
|
|
198
|
-
var _a, _b;
|
|
199
182
|
super.updated(changedProperties);
|
|
200
183
|
if (changedProperties.has('opened')) {
|
|
201
184
|
if (this.opened) {
|
|
@@ -209,52 +192,28 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
209
192
|
if (changedProperties.has('optionsList')) {
|
|
210
193
|
this._updateOptions();
|
|
211
194
|
}
|
|
212
|
-
if (this._$optionsList.value)
|
|
213
|
-
|
|
214
|
-
this.listBoxController = new ListBoxKeyboardController({
|
|
215
|
-
host: this,
|
|
216
|
-
$list: this._$optionsList.value
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
if (this.listBoxController) {
|
|
220
|
-
this.listBoxController.calculateSelectedOptionIndex();
|
|
221
|
-
}
|
|
222
|
-
if (this._$optionsList.value && this.$dropdownToggler.value) {
|
|
223
|
-
(_b = this._selectTogglerKeyboardController) === null || _b === void 0 ? void 0 : _b.hostDisconnected();
|
|
224
|
-
this._selectTogglerKeyboardController = new SelectTogglerKeyboardController({
|
|
195
|
+
if (this._$optionsList.value && !this._listBoxController)
|
|
196
|
+
this._listBoxController = new ListBoxKeyboardController({
|
|
225
197
|
host: this,
|
|
226
|
-
$toggler: this.$dropdownToggler.value,
|
|
227
198
|
$list: this._$optionsList.value
|
|
228
199
|
});
|
|
229
|
-
}
|
|
230
200
|
}
|
|
231
201
|
_focusElementAfterSelectOpened() {
|
|
232
|
-
var _a;
|
|
233
|
-
const $searchInput = (_a = this
|
|
234
|
-
|
|
235
|
-
const $firstOption = $options.find(($option) => {
|
|
236
|
-
return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.getAttribute('hidden');
|
|
237
|
-
});
|
|
238
|
-
const $selectedOption = this.selectedOptions[0];
|
|
239
|
-
const $optionToFocus = $selectedOption || $firstOption;
|
|
240
|
-
$searchInput ? $searchInput.focus() : $optionToFocus === null || $optionToFocus === void 0 ? void 0 : $optionToFocus.focus();
|
|
202
|
+
var _a, _b;
|
|
203
|
+
const $searchInput = (_a = this._$search.value) === null || _a === void 0 ? void 0 : _a.querySelector('[role="search"]');
|
|
204
|
+
$searchInput ? $searchInput.focus() : (_b = this._$optionsList.value) === null || _b === void 0 ? void 0 : _b.focus();
|
|
241
205
|
}
|
|
242
206
|
connectedCallback() {
|
|
243
|
-
var _a;
|
|
244
207
|
super.connectedCallback();
|
|
245
208
|
this.classList.add(SELECT_CSS_CLASSES.select);
|
|
246
209
|
if (!this.searchDisabled) {
|
|
247
210
|
this.classList.add(SELECT_CSS_CLASSES.selectWithSearch);
|
|
248
211
|
}
|
|
249
|
-
this.$searchLabel = document.querySelector(`[id="${this.ariaLabelledby}"]`);
|
|
250
|
-
(_a = this.$searchLabel) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-hidden', 'true');
|
|
251
212
|
this._selectController = this.multiple ? new MultiSelectController({ host: this }) : new SelectController({ host: this });
|
|
252
213
|
this._selectContext.provide(SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
253
214
|
this._selectContext.provide(SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
254
215
|
this._optionsObserver = new Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
255
216
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
256
|
-
this._selectedOptionsAriaObserver = new Observer((selectedOptions) => this._updateLabelAria(selectedOptions));
|
|
257
|
-
this._selectController.selectedOptions$.subscribe(this._selectedOptionsAriaObserver);
|
|
258
217
|
this._updateOptions();
|
|
259
218
|
this._setupEvents();
|
|
260
219
|
}
|
|
@@ -284,10 +243,6 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
284
243
|
SelectControlUtils.appendHTMLOption($option, $list, position);
|
|
285
244
|
}
|
|
286
245
|
updateOptionAriaAttribute($option) {
|
|
287
|
-
if (!this.multiple) {
|
|
288
|
-
const $options = this._$optionsList.value ? [...this._$optionsList.value.querySelectorAll('h-option')] : [];
|
|
289
|
-
$options.forEach(($option) => ($option.removeAttribute('aria-selected')));
|
|
290
|
-
}
|
|
291
246
|
$option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', String($option.selected));
|
|
292
247
|
}
|
|
293
248
|
_removeHTMLOptions(optionsValues) {
|
|
@@ -297,12 +252,6 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
297
252
|
const option = this._selectController.getOption(value);
|
|
298
253
|
if (!option)
|
|
299
254
|
return;
|
|
300
|
-
const $selectedOption = this._$options.get(option.value);
|
|
301
|
-
const $selectedOptionLink = $selectedOption === null || $selectedOption === void 0 ? void 0 : $selectedOption.querySelector('a');
|
|
302
|
-
if ($selectedOptionLink) {
|
|
303
|
-
$selectedOptionLink.click();
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
255
|
this.noDeselect ? this._selectController.select(option) : this._selectController.toggle(option);
|
|
307
256
|
if (!this.multiple)
|
|
308
257
|
this._closeSelect();
|
|
@@ -353,17 +302,16 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
353
302
|
const isSearchEnabled = !this.searchDisabled && options.length > MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH;
|
|
354
303
|
return html `
|
|
355
304
|
<h-dropdown
|
|
356
|
-
${ref(this
|
|
305
|
+
${ref(this._$dropdown)}
|
|
357
306
|
@showed=${() => (this.opened = true)}
|
|
358
307
|
@hidden=${this._handleDropdownHidden}
|
|
359
308
|
name="${this.controlName}"
|
|
360
309
|
offset=${this.offset}
|
|
361
310
|
content-width="full"
|
|
362
311
|
prevent-focus-trap
|
|
363
|
-
no-autofocus
|
|
364
312
|
>
|
|
365
313
|
<h-dropdown-toggler
|
|
366
|
-
${ref(this
|
|
314
|
+
${ref(this._$dropdownToggler)}
|
|
367
315
|
name="${this.controlName}"
|
|
368
316
|
validation-container
|
|
369
317
|
aria-haspopup="listbox"
|
|
@@ -388,7 +336,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
388
336
|
${isSearchEnabled
|
|
389
337
|
? html ` <h-select-search
|
|
390
338
|
class=${SELECT_CSS_CLASSES.selectSearch}
|
|
391
|
-
${ref(this
|
|
339
|
+
${ref(this._$search)}
|
|
392
340
|
.value=${this._searchValue}
|
|
393
341
|
@search=${this._handleSearch}
|
|
394
342
|
></h-select-search>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -11,12 +11,13 @@ let HScrollTo = class HScrollTo extends PhoenixLightLitElement {
|
|
|
11
11
|
this.behavior = 'smooth';
|
|
12
12
|
this.scrollToElement = () => {
|
|
13
13
|
const $scrollTo = document.querySelector(`[data-scroll="${this.to}"]`);
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
}
|
|
14
|
+
if (!$scrollTo)
|
|
15
|
+
return;
|
|
16
|
+
const elTopPosition = $scrollTo.getBoundingClientRect().top;
|
|
17
|
+
requestAnimationFrame(() => {
|
|
18
|
+
window.scrollTo({ top: elTopPosition + window.scrollY, behavior: this.behavior });
|
|
19
|
+
});
|
|
20
|
+
$scrollTo.focus();
|
|
20
21
|
};
|
|
21
22
|
this._btnController = new BtnController(this, this.scrollToElement);
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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 +1,10 @@
|
|
|
1
1
|
import { Any } from 'ts-toolbelt';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactiveControllerHost } from 'lit';
|
|
3
3
|
import { LIST_BOX_KEYBOARD_NAVIGATION_DIRECTIONS } from "./list_box_controller_constants";
|
|
4
|
-
import { HSelect } from "../../components/form/select/select";
|
|
5
4
|
export declare type TListBoxKeyboardNavigationDirection = Any.Keys<typeof LIST_BOX_KEYBOARD_NAVIGATION_DIRECTIONS>;
|
|
6
5
|
export declare type TListBoxKeyboardControllerConstructorOptions = {
|
|
7
|
-
host: ReactiveControllerHost &
|
|
6
|
+
host: ReactiveControllerHost & HTMLElement;
|
|
8
7
|
$list: HTMLElement;
|
|
9
8
|
listItemSelector?: string;
|
|
10
9
|
orientation?: TListBoxKeyboardNavigationDirection;
|
|
11
10
|
};
|
|
12
|
-
export interface IListboxController extends ReactiveController {
|
|
13
|
-
calculateSelectedOptionIndex(): void;
|
|
14
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_box_controller_types.js","sourceRoot":"","sources":["../../../../../../../src/controllers/list_box_controller/list_box_controller_types.ts"],"names":[],"mappings":"AAAA,OAAoB,aAAa,CAAC;AAClC,
|
|
1
|
+
{"version":3,"file":"list_box_controller_types.js","sourceRoot":"","sources":["../../../../../../../src/controllers/list_box_controller/list_box_controller_types.ts"],"names":[],"mappings":"AAAA,OAAoB,aAAa,CAAC;AAClC,OAAuC,KAAK,CAAC;AAC7C,OAAwD,4EAA4E,CAAC"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactiveController } from 'lit';
|
|
2
|
+
import { TListBoxKeyboardControllerConstructorOptions } from "./list_box_controller_types";
|
|
3
|
+
export declare class ListBoxKeyboardController implements ReactiveController {
|
|
3
4
|
#private;
|
|
4
|
-
currentOptionIndex: number | undefined;
|
|
5
5
|
constructor({ host, $list, listItemSelector, orientation }: TListBoxKeyboardControllerConstructorOptions);
|
|
6
6
|
hostConnected(): void;
|
|
7
|
-
private _handleKeyboardNavigation;
|
|
8
7
|
private _handleArrowNavigation;
|
|
9
|
-
private _findCurrentIndex;
|
|
10
|
-
private _handleWriteableCharacter;
|
|
11
|
-
calculateSelectedOptionIndex: () => void;
|
|
12
8
|
private _getPrevOptionIndex;
|
|
13
9
|
private _getNextOptionIndex;
|
|
14
|
-
hostDisconnected(): void;
|
|
15
10
|
}
|