@shoper/phoenix_design_system 1.15.3-3 → 1.15.3-31

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.
Files changed (51) hide show
  1. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js +9 -2
  2. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
  3. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js +6 -1
  4. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
  5. package/build/cjs/packages/phoenix/src/components/form/search/search.js +1 -12
  6. package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
  7. package/build/cjs/packages/phoenix/src/components/form/select/components/search/select_search.js +30 -0
  8. package/build/cjs/packages/phoenix/src/components/form/select/components/search/select_search.js.map +1 -1
  9. package/build/cjs/packages/phoenix/src/components/form/select/components/select_options.js +1 -2
  10. package/build/cjs/packages/phoenix/src/components/form/select/components/select_options.js.map +1 -1
  11. package/build/cjs/packages/phoenix/src/components/form/select/select.js +26 -8
  12. package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
  13. package/build/cjs/packages/phoenix/src/components/modal/modal.js +8 -12
  14. package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
  15. package/build/cjs/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js +62 -15
  16. package/build/cjs/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
  17. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +1 -0
  18. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +9 -2
  19. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
  20. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.d.ts +1 -0
  21. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +6 -1
  22. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
  23. package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +0 -1
  24. package/build/esm/packages/phoenix/src/components/form/search/search.js +1 -12
  25. package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
  26. package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.d.ts +4 -0
  27. package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.js +30 -0
  28. package/build/esm/packages/phoenix/src/components/form/select/components/search/select_search.js.map +1 -1
  29. package/build/esm/packages/phoenix/src/components/form/select/components/select_options.js +1 -2
  30. package/build/esm/packages/phoenix/src/components/form/select/components/select_options.js.map +1 -1
  31. package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +4 -2
  32. package/build/esm/packages/phoenix/src/components/form/select/select.js +26 -8
  33. package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
  34. package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +0 -1
  35. package/build/esm/packages/phoenix/src/components/modal/modal.js +9 -13
  36. package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
  37. package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_controller_types.d.ts +6 -2
  38. package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_controller_types.js +1 -0
  39. package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_controller_types.js.map +1 -1
  40. package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.d.ts +7 -3
  41. package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js +62 -15
  42. package/build/esm/packages/phoenix/src/controllers/list_box_controller/list_box_keyboard_controller.js.map +1 -1
  43. package/package.json +1 -1
  44. package/build/cjs/packages/phoenix/src/controllers/inert_controller/inert_controller.js +0 -35
  45. package/build/cjs/packages/phoenix/src/controllers/inert_controller/inert_controller.js.map +0 -1
  46. package/build/esm/packages/phoenix/src/controllers/inert_controller/inert_controller.d.ts +0 -9
  47. package/build/esm/packages/phoenix/src/controllers/inert_controller/inert_controller.js +0 -31
  48. package/build/esm/packages/phoenix/src/controllers/inert_controller/inert_controller.js.map +0 -1
  49. package/build/esm/packages/phoenix/src/controllers/inert_controller/inert_controller_types.d.ts +0 -9
  50. package/build/esm/packages/phoenix/src/controllers/inert_controller/inert_controller_types.js +0 -3
  51. package/build/esm/packages/phoenix/src/controllers/inert_controller/inert_controller_types.js.map +0 -1
@@ -12,6 +12,7 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
12
12
  constructor() {
13
13
  super();
14
14
  this.name = '';
15
+ this.ariaHasPopup = 'menu';
15
16
  this._setupTogglerAria = () => {
16
17
  this._$dropdown = this.closest(DROPDOWN_CONTAINER_NAME);
17
18
  if (this._$dropdown.isOpened)
@@ -19,7 +20,7 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
19
20
  host: this,
20
21
  initialAriaExpandedValue: this._$dropdown.isOpened()
21
22
  });
22
- this.setAttribute('aria-haspopup', 'true');
23
+ this.setAttribute('aria-haspopup', this.ariaHasPopup);
23
24
  if (this._$dropdown.id)
24
25
  this.setAttribute('aria-controls', this._$dropdown.id);
25
26
  };
@@ -56,6 +57,10 @@ __decorate([
56
57
  property({ type: String, reflect: true }),
57
58
  __metadata("design:type", Object)
58
59
  ], 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);
59
64
  HDropdownToggler = __decorate([
60
65
  phoenixCustomElement('h-dropdown-toggler'),
61
66
  __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;AACA;AACA;AACA;AACA;AACA;"}
@@ -29,7 +29,6 @@ export declare class HSearch extends PhoenixLightLitElement {
29
29
  private _activeItemId;
30
30
  private _translations;
31
31
  private _containerRole;
32
- private _inertController;
33
32
  connectedCallback(): Promise<void>;
34
33
  disconnectedCallback(): void;
35
34
  private _setupContext;
@@ -12,7 +12,6 @@ import { createRef, ref } from 'lit-html/directives/ref.js';
12
12
  import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
13
13
  import { BREAKPOINTS } from '../../../global_constants.js';
14
14
  import v4 from '../../../../../../external/uuid/dist/esm-browser/v4.js';
15
- import { InertController } from '../../../controllers/inert_controller/inert_controller.js';
16
15
  import { when as n } from '../../../../../../external/lit/external/lit-html/directives/when.js';
17
16
  import { DEFAULT_VIEW, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES, SEARCH_CONFIGURATION, SEARCH_CONTEXT_NAMES, SEARCH_CUSTOM_EVENT_NAMES } from './search_constants.js';
18
17
 
@@ -37,7 +36,6 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
37
36
  this._activeItemId = `${this._id}-1`;
38
37
  this._translations = {};
39
38
  this._containerRole = 'grid';
40
- this._inertController = null;
41
39
  this._bindKeys = (ev) => {
42
40
  switch (ev.key) {
43
41
  case 'ArrowDown':
@@ -230,10 +228,8 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
230
228
  }
231
229
  };
232
230
  this._removeSearchKeyboardNavigation = () => {
233
- var _a;
234
231
  document.removeEventListener('keydown', this._bindKeys);
235
232
  document.removeEventListener('keyup', this._handleSearchTabNavigation);
236
- (_a = this._inertController) === null || _a === void 0 ? void 0 : _a.show();
237
233
  };
238
234
  this._handleFocusOnInputWithCaretEnd = () => {
239
235
  const isFocusedOnSearchInput = document.activeElement === this._inputField;
@@ -279,12 +275,6 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
279
275
  }
280
276
  async connectedCallback() {
281
277
  super.connectedCallback();
282
- this._inertController = new InertController({
283
- host: this,
284
- hideConditionHandler: (child) => {
285
- return child !== this && !child.closest('h-search');
286
- }
287
- });
288
278
  this._setupContext();
289
279
  try {
290
280
  this._searchContextConsumer = new ContextConsumerController(this);
@@ -354,7 +344,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
354
344
  }
355
345
  _setupListeners() {
356
346
  this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.focusin, (ev) => {
357
- var _a, _b, _c, _d;
347
+ var _a, _b, _c;
358
348
  const $target = (_a = ev.detail) === null || _a === void 0 ? void 0 : _a.relatedTarget;
359
349
  if ($target === null || $target === void 0 ? void 0 : $target.closest(`[id="${this._searchContentContainerId}"]`))
360
350
  return;
@@ -365,7 +355,6 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
365
355
  document.addEventListener('keydown', this._bindKeys);
366
356
  document.addEventListener('keyup', this._handleSearchTabNavigation);
367
357
  document.addEventListener('keydown', this._preventScrollingOnSearchContentBrowsing);
368
- (_d = this._inertController) === null || _d === void 0 ? void 0 : _d.hide();
369
358
  });
370
359
  this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.keyup, (ev) => {
371
360
  const shouldShowMessage = ev.detail.searchPhrase !== '';
@@ -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,eAAe,wDAA4D;AAC3E;AACA,0BAA0B,qEAA6E;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,eAAe,wDAA4D;AAC3E,0BAA0B,qEAA6E;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -2,7 +2,11 @@ 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;
5
6
  connectedCallback(): void;
7
+ private _handleSearchKeydown;
8
+ private _handleDispatchEventOnOptionsList;
9
+ private _handleFocusOptionOnArrowNavigation;
6
10
  private _handleInputChange;
7
11
  protected render(): TemplateResult;
8
12
  }
@@ -1,6 +1,7 @@
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';
4
5
  import { PhoenixLightLitElement } from '../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
5
6
  import { phoenixCustomElement } from '../../../../../core/decorators/phoenix_custom_element.js';
6
7
  import { SELECT_SEARCH_EVENT_NAMES, SELECT_RELATED_COMPONENTS_NAMES } from '../select_components_constatns.js';
@@ -11,6 +12,32 @@ let HSelectSearch = class HSelectSearch extends PhoenixLightLitElement {
11
12
  constructor() {
12
13
  super(...arguments);
13
14
  this.value = '';
15
+ this._$selectOptions = null;
16
+ this._handleSearchKeydown = (ev) => {
17
+ if (ev.key !== 'ArrowDown' && ev.key !== 'ArrowUp')
18
+ return;
19
+ this._handleFocusOptionOnArrowNavigation();
20
+ this._handleDispatchEventOnOptionsList(ev);
21
+ };
22
+ this._handleDispatchEventOnOptionsList = (ev) => {
23
+ var _a;
24
+ const arrowNavigationEvent = new KeyboardEvent('keydown', {
25
+ key: ev.key
26
+ });
27
+ (_a = this._$selectOptions) === null || _a === void 0 ? void 0 : _a.dispatchEvent(arrowNavigationEvent);
28
+ };
29
+ this._handleFocusOptionOnArrowNavigation = () => {
30
+ const $options = this._$selectOptions ? [...this._$selectOptions.querySelectorAll('h-option')] : [];
31
+ const $availableOptions = $options.filter(($option) => {
32
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
33
+ });
34
+ const $firstOption = $availableOptions.find(($option) => {
35
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.getAttribute('hidden');
36
+ });
37
+ const $selectedOption = $availableOptions.find(($option) => $option.getAttribute('aria-selected'));
38
+ const $optionToFocus = $selectedOption || $firstOption;
39
+ $optionToFocus === null || $optionToFocus === void 0 ? void 0 : $optionToFocus.focus();
40
+ };
14
41
  this._handleInputChange = debounce_1(({ target }) => {
15
42
  this.value = target.value;
16
43
  this.emitCustomEvent(SELECT_SEARCH_EVENT_NAMES.search, {
@@ -21,6 +48,9 @@ let HSelectSearch = class HSelectSearch extends PhoenixLightLitElement {
21
48
  connectedCallback() {
22
49
  super.connectedCallback();
23
50
  this.classList.add(SELECT_SEARCH_CSS_CLASSES.selectSearch);
51
+ // to musisz zrobić inaczej, bo jest kilka selectów na stronie
52
+ this._$selectOptions = document.querySelector('h-options');
53
+ this.addEventListener('keydown', this._handleSearchKeydown);
24
54
  }
25
55
  render() {
26
56
  return html `
@@ -1 +1 @@
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
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;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;AACA;AACA;AACA;AACA;AACA;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 { UiDomUtils } from '@dreamcommerce/utilities';
2
+ import '@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,7 +22,6 @@ let HOptions = class HOptions extends PhoenixLightLitElement {
22
22
  });
23
23
  };
24
24
  this.setAttribute('role', 'listbox');
25
- UiDomUtils.makeNavigable(this);
26
25
  this.addEventListener(SELECT_OPTION_EVENT_NAMES.clicked, this._dispatchClickedEvent);
27
26
  this.addEventListener(SELECT_OPTION_EVENT_NAMES.updated, this._dispatchUpdatedEvent);
28
27
  }
@@ -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;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;"}
@@ -1,5 +1,7 @@
1
1
  import { PropertyValues, TemplateResult } from 'lit';
2
2
  import { HOption } from "./components/option/select_option";
3
+ import { HSelectSearch } from "./components/search/select_search";
4
+ import { ListBoxKeyboardController } from "../../../controllers/list_box_controller/list_box_keyboard_controller";
3
5
  import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
4
6
  import { SelectOption } from "./model/select_option";
5
7
  import type { TSelectType } from "./select_types";
@@ -29,12 +31,12 @@ export declare class HSelect extends PhoenixLightLitElement {
29
31
  private _selectController;
30
32
  private _$options;
31
33
  private _$dropdown;
32
- private _$search;
34
+ $search: import("lit-html/directives/ref.js").Ref<HSelectSearch>;
33
35
  private _$optionsList;
34
36
  private _$dropdownContent;
35
37
  private _$dropdownToggler;
36
38
  private _selectContext;
37
- private _listBoxController;
39
+ listBoxController: ListBoxKeyboardController;
38
40
  private _optionsObserver;
39
41
  private $placeholder;
40
42
  constructor();
@@ -40,7 +40,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
40
40
  this._searchValue = '';
41
41
  this._$options = new Map();
42
42
  this._$dropdown = createRef();
43
- this._$search = createRef();
43
+ this.$search = createRef();
44
44
  this._$optionsList = createRef();
45
45
  this._$dropdownContent = createRef();
46
46
  this._$dropdownToggler = createRef();
@@ -116,10 +116,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
116
116
  });
117
117
  };
118
118
  this._handleDropdownHidden = () => {
119
- var _a;
119
+ var _a, _b;
120
120
  this._searchValue = '';
121
121
  this.opened = false;
122
122
  (_a = this._$dropdownToggler.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', '');
123
+ (_b = this._$dropdownToggler.value) === null || _b === void 0 ? void 0 : _b.focus();
123
124
  };
124
125
  this._manageSelectFocusAria = (ev) => {
125
126
  var _a;
@@ -179,6 +180,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
179
180
  return Array.from(this._$options.values());
180
181
  }
181
182
  updated(changedProperties) {
183
+ var _a;
182
184
  super.updated(changedProperties);
183
185
  if (changedProperties.has('opened')) {
184
186
  if (this.opened) {
@@ -192,16 +194,27 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
192
194
  if (changedProperties.has('optionsList')) {
193
195
  this._updateOptions();
194
196
  }
195
- if (this._$optionsList.value && !this._listBoxController)
196
- this._listBoxController = new ListBoxKeyboardController({
197
+ if (this._$optionsList.value) {
198
+ (_a = this.listBoxController) === null || _a === void 0 ? void 0 : _a.hostDisconnected();
199
+ this.listBoxController = new ListBoxKeyboardController({
197
200
  host: this,
198
201
  $list: this._$optionsList.value
199
202
  });
203
+ }
204
+ if (this.listBoxController) {
205
+ this.listBoxController.calculateSelectedOptionIndex();
206
+ }
200
207
  }
201
208
  _focusElementAfterSelectOpened() {
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();
209
+ var _a;
210
+ const $searchInput = (_a = this.$search.value) === null || _a === void 0 ? void 0 : _a.querySelector('[role="search"]');
211
+ const $options = this._$optionsList.value ? [...this._$optionsList.value.querySelectorAll('h-option')] : [];
212
+ const $firstOption = $options.find(($option) => {
213
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.getAttribute('hidden');
214
+ });
215
+ const $selectedOption = this.selectedOptions[0];
216
+ const $optionToFocus = $selectedOption || $firstOption;
217
+ $searchInput ? $searchInput.focus() : $optionToFocus === null || $optionToFocus === void 0 ? void 0 : $optionToFocus.focus();
205
218
  }
206
219
  connectedCallback() {
207
220
  super.connectedCallback();
@@ -243,6 +256,10 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
243
256
  SelectControlUtils.appendHTMLOption($option, $list, position);
244
257
  }
245
258
  updateOptionAriaAttribute($option) {
259
+ if (!this.multiple) {
260
+ const $options = this._$optionsList.value ? [...this._$optionsList.value.querySelectorAll('h-option')] : [];
261
+ $options.forEach(($option) => ($option.removeAttribute('aria-selected')));
262
+ }
246
263
  $option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', String($option.selected));
247
264
  }
248
265
  _removeHTMLOptions(optionsValues) {
@@ -309,6 +326,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
309
326
  offset=${this.offset}
310
327
  content-width="full"
311
328
  prevent-focus-trap
329
+ no-autofocus
312
330
  >
313
331
  <h-dropdown-toggler
314
332
  ${ref(this._$dropdownToggler)}
@@ -336,7 +354,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
336
354
  ${isSearchEnabled
337
355
  ? html ` <h-select-search
338
356
  class=${SELECT_CSS_CLASSES.selectSearch}
339
- ${ref(this._$search)}
357
+ ${ref(this.$search)}
340
358
  .value=${this._searchValue}
341
359
  @search=${this._handleSearch}
342
360
  ></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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -16,7 +16,6 @@ export declare class HModal extends PhoenixLightLitElement {
16
16
  private _propsChangeStrategies;
17
17
  private static openModals;
18
18
  private _backdropController;
19
- private _inertController;
20
19
  private static _appendModalsPortal;
21
20
  static isSomeModalOpen(): boolean;
22
21
  constructor();
@@ -6,12 +6,11 @@ import { property, state } from '@lit/reactive-element/decorators.js';
6
6
  import '@lit/reactive-element';
7
7
  import { html } from 'lit-html';
8
8
  import { createRef, ref } from 'lit-html/directives/ref.js';
9
- import { PORTAL_TARGET_NAME_PROP, PORTAL_TARGET_COMPONENT_NAME } from '../portal/portal_constants.js';
9
+ import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
10
10
  import { BACKDROP_EVENTS } from '../backdrop/backdrop_constants.js';
11
11
  import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
12
12
  import { MODAL_OPENED_PROP, FOCUSABLE_ELEMENTS_WITHIN_MODAL, MODALS_PORTAL_NAME, MODAL_EVENTS } from './modal_constants.js';
13
13
  import { HModalClose } from './modal_close.js';
14
- import { InertController } from '../../controllers/inert_controller/inert_controller.js';
15
14
 
16
15
  var HModal_1;
17
16
  let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
@@ -50,7 +49,6 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
50
49
  }
51
50
  };
52
51
  this._backdropController = new BackdropController();
53
- this._inertController = null;
54
52
  this._keepFocusWithinModal = (ev) => {
55
53
  var _a;
56
54
  const isTabPressed = ev.code === 'Tab';
@@ -113,12 +111,16 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
113
111
  });
114
112
  };
115
113
  this._addInertToBodyChildrenElements = () => {
116
- var _a;
117
- (_a = this._inertController) === null || _a === void 0 ? void 0 : _a.hide();
114
+ [...document.body.children].forEach((child) => {
115
+ if (child.tagName !== PORTAL_TARGET_COMPONENT_NAME.toUpperCase()) {
116
+ child.setAttribute('inert', '');
117
+ }
118
+ });
118
119
  };
119
120
  this._removeInertFromBodyChildrenElements = () => {
120
- var _a;
121
- (_a = this._inertController) === null || _a === void 0 ? void 0 : _a.show();
121
+ [...document.body.children].forEach((child) => {
122
+ child.removeAttribute('inert');
123
+ });
122
124
  };
123
125
  this.hidden = true;
124
126
  this._focusableElements = [...this.querySelectorAll(FOCUSABLE_ELEMENTS_WITHIN_MODAL)];
@@ -137,12 +139,6 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
137
139
  connectedCallback() {
138
140
  super.connectedCallback();
139
141
  HModal_1._appendModalsPortal();
140
- this._inertController = new InertController({
141
- host: this,
142
- hideConditionHandler: (child) => {
143
- return child.tagName !== PORTAL_TARGET_COMPONENT_NAME.toUpperCase();
144
- }
145
- });
146
142
  document.addEventListener('keyup', this._keepFocusWithinModal);
147
143
  document.addEventListener(MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
148
144
  }
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,10 +1,14 @@
1
1
  import { Any } from 'ts-toolbelt';
2
- import { ReactiveControllerHost } from 'lit';
2
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
3
3
  import { LIST_BOX_KEYBOARD_NAVIGATION_DIRECTIONS } from "./list_box_controller_constants";
4
+ import { HSelect } from "../../components/form/select/select";
4
5
  export declare type TListBoxKeyboardNavigationDirection = Any.Keys<typeof LIST_BOX_KEYBOARD_NAVIGATION_DIRECTIONS>;
5
6
  export declare type TListBoxKeyboardControllerConstructorOptions = {
6
- host: ReactiveControllerHost & HTMLElement;
7
+ host: ReactiveControllerHost & HSelect;
7
8
  $list: HTMLElement;
8
9
  listItemSelector?: string;
9
10
  orientation?: TListBoxKeyboardNavigationDirection;
10
11
  };
12
+ export interface IListboxController extends ReactiveController {
13
+ calculateSelectedOptionIndex(): void;
14
+ }
@@ -1,4 +1,5 @@
1
1
  import 'ts-toolbelt';
2
2
  import 'lit';
3
3
  import '@phoenixRoot/controllers/list_box_controller/list_box_controller_constants';
4
+ import '@phoenixRoot/components/form/select/select';
4
5
  //# sourceMappingURL=list_box_controller_types.js.map
@@ -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,OAAuC,KAAK,CAAC;AAC7C,OAAwD,4EAA4E,CAAC"}
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,OAA2D,KAAK,CAAC;AACjE,OAAwD,4EAA4E,CAAC;AACrI,OAAwB,4CAA4C,CAAC"}
@@ -1,10 +1,14 @@
1
- import { ReactiveController } from 'lit';
2
- import { TListBoxKeyboardControllerConstructorOptions } from "./list_box_controller_types";
3
- export declare class ListBoxKeyboardController implements ReactiveController {
1
+ import { IListboxController, TListBoxKeyboardControllerConstructorOptions } from "./list_box_controller_types";
2
+ export declare class ListBoxKeyboardController implements IListboxController {
4
3
  #private;
5
4
  constructor({ host, $list, listItemSelector, orientation }: TListBoxKeyboardControllerConstructorOptions);
6
5
  hostConnected(): void;
6
+ private _handleKeyboardNavigation;
7
7
  private _handleArrowNavigation;
8
+ private _findCurrentIndex;
9
+ private _handleWriteableCharacter;
10
+ calculateSelectedOptionIndex: () => void;
8
11
  private _getPrevOptionIndex;
9
12
  private _getNextOptionIndex;
13
+ hostDisconnected(): void;
10
14
  }
@@ -1,7 +1,6 @@
1
1
  import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import 'lit';
3
3
  import { UiDomUtils } from '@dreamcommerce/utilities';
4
- import { KeystrokesController } from '../keystrokes_controller/keystrokes_controller.js';
5
4
  import { LIST_BOX_KEYBOARD_NAVIGATION_DIRECTIONS } from './list_box_controller_constants.js';
6
5
 
7
6
  var _ListBoxKeyboardController_host, _ListBoxKeyboardController__$list, _ListBoxKeyboardController_currentOptionIndex, _ListBoxKeyboardController__$options, _ListBoxKeyboardController_listItemSelector, _ListBoxKeyboardController_keys;
@@ -13,25 +12,54 @@ class ListBoxKeyboardController {
13
12
  _ListBoxKeyboardController__$options.set(this, void 0);
14
13
  _ListBoxKeyboardController_listItemSelector.set(this, void 0);
15
14
  _ListBoxKeyboardController_keys.set(this, void 0);
15
+ this._handleKeyboardNavigation = (ev) => {
16
+ if (__classPrivateFieldGet(this, _ListBoxKeyboardController_keys, "f").find((key) => key === ev.key)) {
17
+ this._handleArrowNavigation(ev);
18
+ return;
19
+ }
20
+ this._handleWriteableCharacter(ev);
21
+ };
16
22
  this._handleArrowNavigation = (event) => {
17
23
  event.preventDefault();
18
24
  const { key } = event;
19
- const prevOptionIndex = __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
25
+ const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
26
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
27
+ });
28
+ const prevOptionIndex = this._findCurrentIndex();
20
29
  let newOptionIndex = key === 'ArrowDown' || key === 'ArrowRight' ? this._getNextOptionIndex() : this._getPrevOptionIndex();
21
30
  if (newOptionIndex === undefined) {
22
- const selectedOptionIndex = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").findIndex(($option) => $option.selected);
23
- newOptionIndex = selectedOptionIndex !== -1 ? selectedOptionIndex : 0;
31
+ newOptionIndex = this._findCurrentIndex();
24
32
  }
25
33
  if (newOptionIndex === __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f"))
26
34
  return;
27
35
  if (prevOptionIndex !== undefined) {
28
36
  const $prevOption = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f")[prevOptionIndex];
29
- UiDomUtils.makeUnnavigable($prevOption);
37
+ $prevOption && UiDomUtils.makeUnnavigable($prevOption);
30
38
  }
31
39
  __classPrivateFieldSet(this, _ListBoxKeyboardController_currentOptionIndex, newOptionIndex, "f");
32
- const $focusedOption = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f")[newOptionIndex];
33
- UiDomUtils.makeNavigable($focusedOption);
34
- $focusedOption.focus();
40
+ const $focusedOption = $availableOptions[newOptionIndex];
41
+ if ($focusedOption) {
42
+ UiDomUtils.makeNavigable($focusedOption);
43
+ $focusedOption.focus();
44
+ }
45
+ };
46
+ this._findCurrentIndex = () => {
47
+ const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
48
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
49
+ });
50
+ const selectedOptionIndex = $availableOptions.findIndex(($option) => $option.selected);
51
+ return selectedOptionIndex !== -1 ? selectedOptionIndex : 0;
52
+ };
53
+ this._handleWriteableCharacter = (ev) => {
54
+ var _a;
55
+ const $searchInput = (_a = __classPrivateFieldGet(this, _ListBoxKeyboardController_host, "f").$search.value) === null || _a === void 0 ? void 0 : _a.querySelector('[role="search"]');
56
+ if (!$searchInput)
57
+ return;
58
+ $searchInput === null || $searchInput === void 0 ? void 0 : $searchInput.focus();
59
+ };
60
+ this.calculateSelectedOptionIndex = () => {
61
+ const selectedOptionIndex = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").findIndex(($option) => $option.selected);
62
+ __classPrivateFieldSet(this, _ListBoxKeyboardController_currentOptionIndex, selectedOptionIndex !== -1 ? selectedOptionIndex : 0, "f");
35
63
  };
36
64
  __classPrivateFieldSet(this, _ListBoxKeyboardController_host, host, "f");
37
65
  __classPrivateFieldSet(this, _ListBoxKeyboardController__$list, $list, "f");
@@ -41,12 +69,7 @@ class ListBoxKeyboardController {
41
69
  __classPrivateFieldGet(this, _ListBoxKeyboardController_host, "f").addController(this);
42
70
  }
43
71
  hostConnected() {
44
- new KeystrokesController({
45
- host: __classPrivateFieldGet(this, _ListBoxKeyboardController_host, "f"),
46
- keys: __classPrivateFieldGet(this, _ListBoxKeyboardController_keys, "f"),
47
- callback: this._handleArrowNavigation,
48
- target: __classPrivateFieldGet(this, _ListBoxKeyboardController__$list, "f")
49
- });
72
+ __classPrivateFieldGet(this, _ListBoxKeyboardController__$list, "f").addEventListener('keydown', this._handleKeyboardNavigation);
50
73
  UiDomUtils.makeNavigable(__classPrivateFieldGet(this, _ListBoxKeyboardController__$list, "f"));
51
74
  __classPrivateFieldGet(this, _ListBoxKeyboardController__$list, "f").addEventListener('focusin', (event) => {
52
75
  if (event.target !== __classPrivateFieldGet(this, _ListBoxKeyboardController__$list, "f"))
@@ -64,15 +87,39 @@ class ListBoxKeyboardController {
64
87
  return undefined;
65
88
  if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") <= 0)
66
89
  return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
90
+ if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") <= 0)
91
+ return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
92
+ const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
93
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
94
+ });
95
+ if (!!$availableOptions[__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1])
96
+ return __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;
67
101
  return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") - 1;
68
102
  }
69
103
  _getNextOptionIndex() {
70
104
  if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") === undefined)
71
105
  return undefined;
72
- if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") >= __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").length - 1)
106
+ const $availableOptions = __classPrivateFieldGet(this, _ListBoxKeyboardController__$options, "f").filter(($option) => {
107
+ return !$option.getAttribute('inactive') && !$option.getAttribute('disabled') && !$option.hidden;
108
+ });
109
+ if (__classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") === $availableOptions.length - 1)
73
110
  return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f");
111
+ if (__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
+ }
74
118
  return __classPrivateFieldGet(this, _ListBoxKeyboardController_currentOptionIndex, "f") + 1;
75
119
  }
120
+ hostDisconnected() {
121
+ __classPrivateFieldGet(this, _ListBoxKeyboardController__$list, "f").removeEventListener('keydown', this._handleKeyboardNavigation);
122
+ }
76
123
  }
77
124
  _ListBoxKeyboardController_host = new WeakMap(), _ListBoxKeyboardController__$list = new WeakMap(), _ListBoxKeyboardController_currentOptionIndex = new WeakMap(), _ListBoxKeyboardController__$options = new WeakMap(), _ListBoxKeyboardController_listItemSelector = new WeakMap(), _ListBoxKeyboardController_keys = new WeakMap();
78
125
 
@@ -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;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.15.3-3",
5
+ "version": "1.15.3-31",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",