@shoper/phoenix_design_system 1.11.10-0 → 1.11.10-10

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 (53) hide show
  1. package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker.js +0 -1
  2. package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker.js.map +1 -1
  3. package/build/cjs/packages/phoenix/src/components/form/search/search.js +247 -66
  4. package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
  5. package/build/cjs/packages/phoenix/src/components/form/search/search_constants.js +1 -1
  6. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +5 -0
  7. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
  8. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +26 -7
  9. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
  10. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +20 -10
  11. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
  12. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +15 -4
  13. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
  14. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +15 -4
  15. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
  16. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +22 -3
  17. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
  18. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +17 -4
  19. package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
  20. package/build/cjs/packages/phoenix/src/components/form/select/select.js +1 -1
  21. package/build/cjs/packages/phoenix/src/index.js +6 -6
  22. package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.js +0 -1
  23. package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.js.map +1 -1
  24. package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +22 -2
  25. package/build/esm/packages/phoenix/src/components/form/search/search.js +248 -67
  26. package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
  27. package/build/esm/packages/phoenix/src/components/form/search/search_constants.d.ts +1 -1
  28. package/build/esm/packages/phoenix/src/components/form/search/search_constants.js +1 -1
  29. package/build/esm/packages/phoenix/src/components/form/search/search_types.d.ts +10 -0
  30. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.d.ts +2 -1
  31. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +5 -0
  32. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
  33. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.d.ts +2 -1
  34. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +26 -7
  35. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
  36. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.d.ts +2 -1
  37. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +21 -11
  38. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
  39. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.d.ts +3 -1
  40. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +15 -4
  41. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
  42. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.d.ts +3 -1
  43. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +15 -4
  44. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
  45. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.d.ts +4 -1
  46. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +22 -3
  47. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
  48. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.d.ts +3 -1
  49. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +17 -4
  50. package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
  51. package/build/esm/packages/phoenix/src/components/form/select/select.js +1 -1
  52. package/build/esm/packages/phoenix/src/index.js +2 -2
  53. package/package.json +1 -1
@@ -2,21 +2,31 @@ import { __decorate, __metadata } from '../../../../../../../../external/tslib/t
2
2
  import { property, state } from 'lit/decorators';
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
- import { SEARCH_CUSTOM_EVENT_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
5
+ import { SEARCH_CLASS_NAMES, SEARCH_CUSTOM_EVENT_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
6
6
 
7
7
  let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
8
8
  constructor() {
9
9
  super(...arguments);
10
10
  this._isSearchPhraseCleared = false;
11
+ this._setupAttributes = () => {
12
+ var _a, _b, _c, _d, _e, _f;
13
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'combobox');
14
+ (_b = this.input) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-autocomplete', 'none');
15
+ (_c = this.input) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-haspopup', 'grid');
16
+ const $searchContentContainer = (_d = this.closest('h-search')) === null || _d === void 0 ? void 0 : _d.querySelector(`.${SEARCH_CLASS_NAMES.container}`);
17
+ (_e = this.input) === null || _e === void 0 ? void 0 : _e.setAttribute('aria-controls', ($searchContentContainer === null || $searchContentContainer === void 0 ? void 0 : $searchContentContainer.id) || '');
18
+ (_f = this.input) === null || _f === void 0 ? void 0 : _f.setAttribute('aria-activedescendant', '');
19
+ };
11
20
  }
12
21
  connectedCallback() {
13
22
  super.connectedCallback();
14
- this._input = this.querySelector('input[type="search"]');
15
- if (!this._input) {
23
+ this.input = this.querySelector('input[type="search"]');
24
+ if (!this.input) {
16
25
  throw new Error('Search input not found');
17
26
  }
18
27
  this._setupInitialValue();
19
28
  this._setupListeners();
29
+ this._setupAttributes();
20
30
  }
21
31
  _setupInitialValue() {
22
32
  const searchQueryRegExp = /\/searchquery\/([^/]{1,})/;
@@ -24,7 +34,7 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
24
34
  if (!searchPhraseRegArray)
25
35
  return;
26
36
  const searchQuery = searchPhraseRegArray[1].replace(/\+/g, ' ');
27
- this._input.value = decodeURIComponent(this._deserializeInputPhrase(searchQuery));
37
+ this.input.value = decodeURIComponent(this._deserializeInputPhrase(searchQuery));
28
38
  }
29
39
  _deserializeInputPhrase(value) {
30
40
  if (value.indexOf('%2f') !== -1) {
@@ -42,14 +52,14 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
42
52
  return value;
43
53
  }
44
54
  _setupListeners() {
45
- this._input.addEventListener('focusin', (ev) => {
55
+ this.input.addEventListener('focusin', (ev) => {
46
56
  this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.focusin, {
47
57
  detail: {
48
58
  searchPhrase: ev.target.value
49
59
  }
50
60
  });
51
61
  });
52
- this._input.addEventListener('keyup', (ev) => {
62
+ this.input.addEventListener('keyup', (ev) => {
53
63
  if (ev.key === 'ArrowUp' || ev.key === 'ArrowDown' || ev.key === 'Escape')
54
64
  return;
55
65
  if (ev.key !== 'Enter') {
@@ -70,8 +80,8 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
70
80
  }
71
81
  });
72
82
  });
73
- this._input.addEventListener('search', (ev) => {
74
- if (this._input.value !== '') {
83
+ this.input.addEventListener('search', (ev) => {
84
+ if (this.input.value !== '') {
75
85
  return;
76
86
  }
77
87
  this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.search, {
@@ -84,13 +94,13 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
84
94
  if (!ev.detail || ev.detail.moduleInstanceId !== this.moduleInstanceId)
85
95
  return;
86
96
  this._isSearchPhraseCleared = true;
87
- this._input.value = '';
88
- this._input.focus();
97
+ this.input.value = '';
98
+ this.input.focus();
89
99
  });
90
100
  document.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.updateSearchPhrase, (ev) => {
91
101
  if (!ev.detail || ev.detail.moduleInstanceId !== this.moduleInstanceId)
92
102
  return;
93
- this._input.value = ev.detail.searchPhrase;
103
+ this.input.value = ev.detail.searchPhrase;
94
104
  this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.keyup, {
95
105
  detail: {
96
106
  searchPhrase: ev.detail.searchPhrase
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,10 +3,12 @@ import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_el
3
3
  import { TProducer } from "../../search_types";
4
4
  export declare class HSearchProducerContent extends PhoenixLightLitElement {
5
5
  producers: TProducer[];
6
- activeItemId: number;
6
+ activeItemId: string;
7
+ searchId: string;
7
8
  initialItemIds: Record<string, number>;
8
9
  translations: Record<string, string>;
9
10
  searchPhrase: string;
11
+ producerAriaLabel?: string;
10
12
  private _getMatchedPhrase;
11
13
  protected render(): TemplateResult;
12
14
  }
@@ -27,11 +27,14 @@ let HSearchProducerContent = class HSearchProducerContent extends PhoenixLightLi
27
27
  ${c(this.producers, (producer, index) => {
28
28
  var _a, _b;
29
29
  return html `<li
30
- class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${this.initialItemIds.producers + index ===
30
+ class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${String(this.initialItemIds.producers + index) ===
31
31
  this.activeItemId
32
32
  ? SEARCH_CLASS_NAMES.itemActive
33
33
  : ''}"
34
- data-search-item-id="${this.initialItemIds.producers + index}"
34
+ data-search-item-id="${this.searchId}${this.initialItemIds.producers + index}"
35
+ aria-label=${this.producerAriaLabel ? `${this.producerAriaLabel} ${producer.name}` : undefined}
36
+ tabindex="0"
37
+ role="option"
35
38
  >
36
39
  <a
37
40
  href="${producer.url}"
@@ -52,9 +55,13 @@ __decorate([
52
55
  __metadata("design:type", Array)
53
56
  ], HSearchProducerContent.prototype, "producers", void 0);
54
57
  __decorate([
55
- property({ type: Number, attribute: 'active-item-id' }),
56
- __metadata("design:type", Number)
58
+ property({ type: String, attribute: 'active-item-id' }),
59
+ __metadata("design:type", String)
57
60
  ], HSearchProducerContent.prototype, "activeItemId", void 0);
61
+ __decorate([
62
+ property({ type: String, attribute: 'search-id' }),
63
+ __metadata("design:type", String)
64
+ ], HSearchProducerContent.prototype, "searchId", void 0);
58
65
  __decorate([
59
66
  property({ type: Object, reflect: true }),
60
67
  __metadata("design:type", Object)
@@ -67,6 +74,10 @@ __decorate([
67
74
  property({ type: String, attribute: 'search-phrase' }),
68
75
  __metadata("design:type", String)
69
76
  ], HSearchProducerContent.prototype, "searchPhrase", void 0);
77
+ __decorate([
78
+ property({ type: String }),
79
+ __metadata("design:type", String)
80
+ ], HSearchProducerContent.prototype, "producerAriaLabel", void 0);
70
81
  HSearchProducerContent = __decorate([
71
82
  phoenixCustomElement(SEARCH_COMPONENT_NAMES.searchProducerContent)
72
83
  ], HSearchProducerContent);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,9 +4,11 @@ import type { TProduct, TSearchSettings } from "../../search_types";
4
4
  export declare class HSearchProductContent extends PhoenixLightLitElement {
5
5
  products: TProduct[];
6
6
  settings: TSearchSettings;
7
- activeItemId: number;
7
+ activeItemId: string;
8
+ searchId: string;
8
9
  initialItemIds: Record<string, number>;
9
10
  translations: Record<string, string>;
11
+ productAriaLabel?: string;
10
12
  getProductRateHtml: (productRate: number) => TemplateResult;
11
13
  private _getShortenProductName;
12
14
  private _getPercentPromotion;
@@ -40,11 +40,14 @@ let HSearchProductContent = class HSearchProductContent extends PhoenixLightLitE
40
40
  ${c(this.products, (product, index) => {
41
41
  var _a, _b;
42
42
  return html ` <li
43
- class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${this.initialItemIds.products + index ===
43
+ class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${String(this.initialItemIds.products + index) ===
44
44
  this.activeItemId
45
45
  ? SEARCH_CLASS_NAMES.itemActive
46
46
  : ''}"
47
- data-search-item-id="${this.initialItemIds.products + index}"
47
+ data-search-item-id="${this.searchId}${this.initialItemIds.products + index}"
48
+ aria-label=${this.productAriaLabel ? `${this.productAriaLabel} ${product.name}` : undefined}
49
+ tabindex="0"
50
+ role="option"
48
51
  >
49
52
  <a
50
53
  href="${product.url}"
@@ -93,9 +96,13 @@ __decorate([
93
96
  __metadata("design:type", Object)
94
97
  ], HSearchProductContent.prototype, "settings", void 0);
95
98
  __decorate([
96
- property({ type: Number, attribute: 'active-item-id' }),
97
- __metadata("design:type", Number)
99
+ property({ type: String, attribute: 'active-item-id' }),
100
+ __metadata("design:type", String)
98
101
  ], HSearchProductContent.prototype, "activeItemId", void 0);
102
+ __decorate([
103
+ property({ type: String, attribute: 'search-id' }),
104
+ __metadata("design:type", String)
105
+ ], HSearchProductContent.prototype, "searchId", void 0);
99
106
  __decorate([
100
107
  property({ type: Object, reflect: true }),
101
108
  __metadata("design:type", Object)
@@ -104,6 +111,10 @@ __decorate([
104
111
  property({ type: Object }),
105
112
  __metadata("design:type", Object)
106
113
  ], HSearchProductContent.prototype, "translations", void 0);
114
+ __decorate([
115
+ property({ type: String }),
116
+ __metadata("design:type", String)
117
+ ], HSearchProductContent.prototype, "productAriaLabel", void 0);
107
118
  HSearchProductContent = __decorate([
108
119
  phoenixCustomElement(SEARCH_COMPONENT_NAMES.searchProductContent)
109
120
  ], HSearchProductContent);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,12 +2,15 @@ import { TemplateResult } from 'lit';
2
2
  import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
3
3
  import type { TSearchResults, TSearchSettings } from "../../search_types";
4
4
  export declare class HSearchResults extends PhoenixLightLitElement {
5
+ private _loadMoreButtonId;
6
+ private _goToProductsForButtonId;
5
7
  results: TSearchResults;
6
8
  searchPhrase: string;
7
9
  settings: TSearchSettings;
8
10
  view: string;
9
11
  locale: string;
10
- activeItemId: number;
12
+ activeItemId: string;
13
+ searchId: string;
11
14
  translations: Record<string, string>;
12
15
  moduleInstanceId: string;
13
16
  private _productPage;
@@ -3,6 +3,7 @@ import { html } from 'lit';
3
3
  import { property, state } from 'lit/decorators';
4
4
  import { PhoenixLightLitElement } from '../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
5
5
  import { phoenixCustomElement } from '../../../../../core/decorators/phoenix_custom_element.js';
6
+ import v4 from '../../../../../../../../external/uuid/dist/esm-browser/v4.js';
6
7
  import { when as n } from '../../../../../../../../external/lit/external/lit-html/directives/when.js';
7
8
  import { SEARCH_CUSTOM_EVENT_NAMES, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES, EMPTY_SEARCH_RESULTS } from '../../search_constants.js';
8
9
  import isEqual_1 from '../../../../../../../../external/lodash/isEqual.js';
@@ -10,6 +11,8 @@ import isEqual_1 from '../../../../../../../../external/lodash/isEqual.js';
10
11
  let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
11
12
  constructor() {
12
13
  super(...arguments);
14
+ this._loadMoreButtonId = v4();
15
+ this._goToProductsForButtonId = v4();
13
16
  this.searchPhrase = '';
14
17
  this.translations = {};
15
18
  this._productPage = 1;
@@ -63,11 +66,13 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
63
66
  ${n(((_a = this.results.suggestions) === null || _a === void 0 ? void 0 : _a.length) || ((_b = this.results.categories) === null || _b === void 0 ? void 0 : _b.length), () => html ` <h-search-suggestion-content
64
67
  class="${SEARCH_CLASS_NAMES.section}"
65
68
  active-item-id="${this.activeItemId}"
69
+ search-id="${this.searchId}"
66
70
  .initialItemIds="${this._getInitialItemsIds()}"
67
71
  .translations="${this.translations}"
68
72
  locale="${this.locale}"
69
73
  view="${this.view}"
70
74
  module-instance-id="${this.moduleInstanceId}"
75
+ .suggestionAriaLabel=${this.settings.suggesterItemAriaLabel}
71
76
  >
72
77
  </h-search-suggestion-content>`)}
73
78
  ${n((_c = this.results.products) === null || _c === void 0 ? void 0 : _c.length, () => html `
@@ -76,18 +81,26 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
76
81
  .products="${this.results.products}"
77
82
  .settings="${this.settings}"
78
83
  active-item-id="${this.activeItemId}"
84
+ search-id="${this.searchId}"
79
85
  .initialItemIds="${this._getInitialItemsIds()}"
80
86
  .translations="${this.translations}"
87
+ .productAriaLabel=${this.settings.suggesterProductItemAriaLabel}
81
88
  ></h-search-product-content>
82
89
 
83
90
  ${n(this.settings.isLoadingMoreSearchResultsEnabled, () => n(this._areMoreProductsAvailable(), () => html `<button
84
91
  class="${SEARCH_CLASS_NAMES.productButton}"
85
92
  @click="${this.handleLoadMoreProducts}"
86
93
  type="button"
94
+ data-search-item-id="${this.searchId}${this._loadMoreButtonId}"
87
95
  >
88
96
  ${this.translations.loadMore}
89
97
  </button>`), () => html `
90
- <button class="${SEARCH_CLASS_NAMES.productButton}" @click="${this.handleGoToProductsFor}" type="button">
98
+ <button
99
+ class="${SEARCH_CLASS_NAMES.productButton}"
100
+ @click="${this.handleGoToProductsFor}"
101
+ type="button"
102
+ data-search-item-id="${this.searchId}${this._goToProductsForButtonId}"
103
+ >
91
104
  ${this.translations.goToProductsFor}: <strong>${this._getSearchPhrase()}</strong>
92
105
  </button>
93
106
  `)}
@@ -97,9 +110,11 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
97
110
  class="${SEARCH_CLASS_NAMES.section}"
98
111
  .producers="${this.results.producers}"
99
112
  active-item-id="${this.activeItemId}"
113
+ search-id="${this.searchId}"
100
114
  .initialItemIds="${this._getInitialItemsIds()}"
101
115
  .translations="${this.translations}"
102
116
  search-phrase="${this.searchPhrase}"
117
+ .producerAriaLabel=${this.settings.suggesterProducerItemAriaLabel}
103
118
  ></h-search-producer-content>`)}
104
119
  `;
105
120
  });
@@ -126,9 +141,13 @@ __decorate([
126
141
  __metadata("design:type", String)
127
142
  ], HSearchResults.prototype, "locale", void 0);
128
143
  __decorate([
129
- property({ type: Number, attribute: 'active-item-id' }),
130
- __metadata("design:type", Number)
144
+ property({ type: String, attribute: 'active-item-id' }),
145
+ __metadata("design:type", String)
131
146
  ], HSearchResults.prototype, "activeItemId", void 0);
147
+ __decorate([
148
+ property({ type: String, attribute: 'search-id' }),
149
+ __metadata("design:type", String)
150
+ ], HSearchResults.prototype, "searchId", void 0);
132
151
  __decorate([
133
152
  property({ type: Object }),
134
153
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA,sBAAsB,oDAAwD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,eAAe,8DAAkE;AACjF,0BAA0B,2EAAmF;AAC7G;AACA,sBAAsB,oDAAwD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,12 +4,14 @@ export declare class HSearchSuggestionContent extends PhoenixLightLitElement {
4
4
  private _searchContextConsumer;
5
5
  private _searchContext$;
6
6
  private _searchContextObserver;
7
- activeItemId: number;
7
+ activeItemId: string;
8
+ searchId: string;
8
9
  initialItemIds: Record<string, number>;
9
10
  translations: Record<string, string>;
10
11
  view: string;
11
12
  locale: string;
12
13
  moduleInstanceId: string;
14
+ suggestionAriaLabel?: string;
13
15
  private _searchPhrase;
14
16
  private _suggestionsData;
15
17
  connectedCallback(): Promise<void>;
@@ -103,11 +103,16 @@ let HSearchSuggestionContent = class HSearchSuggestionContent extends PhoenixLig
103
103
  <ul>
104
104
  ${c(this._suggestionsData, (suggestion, index) => html `<li
105
105
  @click=${() => this._handleSuggestion(suggestion.suggestionName, suggestion.type)}
106
- class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${index === this.activeItemId
106
+ class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${String(index) === this.activeItemId
107
107
  ? SEARCH_CLASS_NAMES.itemActive
108
108
  : ''}"
109
109
  data-suggested-value="${suggestion.suggestionName}"
110
- data-search-item-id="${index}"
110
+ data-search-item-id="${this.searchId}${index}"
111
+ aria-label="${this.suggestionAriaLabel ?
112
+ `${this.suggestionAriaLabel} ${suggestion.suggestionName || suggestion.categoryName}` :
113
+ ''}"
114
+ tabindex="0"
115
+ role="option"
111
116
  >
112
117
  ${n(suggestion.type === SUGGESTIONS_TYPE.suggestion, () => html ` <span> ${this._getMatchedPhrase(suggestion.suggestionName)} </span>
113
118
  <h-icon
@@ -130,9 +135,13 @@ let HSearchSuggestionContent = class HSearchSuggestionContent extends PhoenixLig
130
135
  }
131
136
  };
132
137
  __decorate([
133
- property({ type: Number, attribute: 'active-item-id' }),
134
- __metadata("design:type", Number)
138
+ property({ type: String, attribute: 'active-item-id' }),
139
+ __metadata("design:type", String)
135
140
  ], HSearchSuggestionContent.prototype, "activeItemId", void 0);
141
+ __decorate([
142
+ property({ type: String, attribute: 'search-id' }),
143
+ __metadata("design:type", String)
144
+ ], HSearchSuggestionContent.prototype, "searchId", void 0);
136
145
  __decorate([
137
146
  property({ type: Object, reflect: true }),
138
147
  __metadata("design:type", Object)
@@ -153,6 +162,10 @@ __decorate([
153
162
  property({ type: String, attribute: 'module-instance-id' }),
154
163
  __metadata("design:type", String)
155
164
  ], HSearchSuggestionContent.prototype, "moduleInstanceId", void 0);
165
+ __decorate([
166
+ property({ type: String }),
167
+ __metadata("design:type", String)
168
+ ], HSearchSuggestionContent.prototype, "suggestionAriaLabel", void 0);
156
169
  __decorate([
157
170
  state(),
158
171
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -297,7 +297,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
297
297
  offset=${this.offset}
298
298
  content-width="full"
299
299
  >
300
- <h-dropdown-toggler name=${this.controlName} focus-priority> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
300
+ <h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
301
301
 
302
302
  <h-dropdown-content
303
303
  class="${SELECT_CSS_CLASSES.selectContent} ${this.error ? SELECT_CSS_CLASSES.selectContentError : ''}"
@@ -95,10 +95,10 @@ export { HDisplayStepper } from './components/form/input_stepper/display_stepper
95
95
  export { HButtonStepper } from './components/form/input_stepper/button_stepper.js';
96
96
  export { DEFAULT_VIEW, EMPTY_SEARCH_RESULTS, SCROLL_DIRECTIONS, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES, SEARCH_CONFIGURATION, SEARCH_CONTEXT_NAMES, SEARCH_CUSTOM_EVENT_NAMES, SEARCH_PORTAL_DESTINATIONS, SEARCH_SLOT_NAMES, SUGGESTIONS_TYPE } from './components/form/search/search_constants.js';
97
97
  export { HSearchInput } from './components/form/search/subcomponents/input/search_input.js';
98
- export { HSearch } from './components/form/search/search.js';
98
+ export { HSearchResults } from './components/form/search/subcomponents/results/search_results.js';
99
99
  export { HSearchHistoryLoadMore } from './components/form/search/subcomponents/history/search_history_load_more.js';
100
100
  export { HSearchHistory } from './components/form/search/subcomponents/history/search_history.js';
101
- export { HSearchResults } from './components/form/search/subcomponents/results/search_results.js';
101
+ export { HSearch } from './components/form/search/search.js';
102
102
  export { HSearchSubmit } from './components/form/search/subcomponents/buttons/search_submit.js';
103
103
  export { HSearchClear } from './components/form/search/subcomponents/buttons/search_clear.js';
104
104
  export { HSearchClose } from './components/form/search/subcomponents/buttons/search_close.js';
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.11.10-0",
5
+ "version": "1.11.10-10",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",