@shoper/phoenix_design_system 1.11.11-2 → 1.11.11-21
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/color_swatches/color_item/color_item.js +21 -29
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +0 -4
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js +121 -11
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +0 -2
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +89 -267
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +0 -5
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +9 -21
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +1 -12
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js +1 -8
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +4 -9
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +4 -9
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +4 -11
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +5 -12
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message.js +9 -47
- package/build/cjs/packages/phoenix/src/components/messages/base_message.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message_constants.js +0 -2
- package/build/cjs/packages/phoenix/src/components/messages/base_message_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +17 -17
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.d.ts +3 -6
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js +22 -30
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +1 -4
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.d.ts +11 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +124 -14
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +1 -2
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +5 -23
- package/build/esm/packages/phoenix/src/components/form/search/search.js +90 -268
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search_types.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +0 -5
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.d.ts +2 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +9 -21
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +2 -13
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js +1 -8
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +4 -9
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +4 -9
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +4 -11
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +5 -12
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/messages/base_message.d.ts +1 -3
- package/build/esm/packages/phoenix/src/components/messages/base_message.js +11 -49
- package/build/esm/packages/phoenix/src/components/messages/base_message.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.js +3 -4
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/index.js +3 -3
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import { ICONS_SIZES } from '../../../../icon/icon_constants.js';
|
|
|
7
7
|
import { Observer } from '../../../../../core/classes/observer/observer.js';
|
|
8
8
|
import { ContextConsumerController } from '../../../../../core/context/context_consumer_controller.js';
|
|
9
9
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
10
|
+
import v4 from '../../../../../../../../external/uuid/dist/esm-browser/v4.js';
|
|
10
11
|
import { when as n } from '../../../../../../../../external/lit/external/lit-html/directives/when.js';
|
|
11
12
|
import { SEARCH_CONTEXT_NAMES, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
12
13
|
import { repeat as c } from '../../../../../../../../external/lit/external/lit-html/directives/repeat.js';
|
|
@@ -15,6 +16,7 @@ let HSearchHistory = class HSearchHistory extends PhoenixLightLitElement {
|
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
17
18
|
this.buttonRef = createRef();
|
|
19
|
+
this._loadMoreButtonId = v4();
|
|
18
20
|
this.history = [];
|
|
19
21
|
this.translations = {};
|
|
20
22
|
}
|
|
@@ -41,33 +43,23 @@ let HSearchHistory = class HSearchHistory extends PhoenixLightLitElement {
|
|
|
41
43
|
return n((_a = this.history) === null || _a === void 0 ? void 0 : _a.length, () => html `<h3 class="${SEARCH_CLASS_NAMES.headline}">${this.translations.searchHistory}</h3>
|
|
42
44
|
|
|
43
45
|
<ul>
|
|
44
|
-
${c(this.history, (historyElement, index) => html `
|
|
45
|
-
|
|
46
|
-
class="
|
|
47
|
-
${SEARCH_CLASS_NAMES.item}
|
|
48
|
-
${`${this.searchId}${index}` === this.activeItemId ? SEARCH_CLASS_NAMES.itemActive : ''}
|
|
49
|
-
"
|
|
50
|
-
role="row"
|
|
46
|
+
${c(this.history, (historyElement, index) => html ` <li
|
|
47
|
+
class="${SEARCH_CLASS_NAMES.item} ${index === this.activeItemId ? SEARCH_CLASS_NAMES.itemActive : ''}"
|
|
51
48
|
>
|
|
52
49
|
<h-search-history-select
|
|
53
50
|
item-label="${historyElement.label}"
|
|
54
51
|
class="${SEARCH_CLASS_NAMES.historySelect}"
|
|
55
52
|
data-suggested-value="${historyElement.label}"
|
|
56
|
-
data-search-item-id="${
|
|
53
|
+
data-search-item-id="${index}"
|
|
57
54
|
module-instance-id="${this.moduleInstanceId}"
|
|
58
55
|
aria-label=${this.translations.historyAriaLabel ? `${this.translations.historyAriaLabel} ${historyElement.label}` : undefined}
|
|
59
|
-
role="gridcell"
|
|
60
56
|
>
|
|
61
57
|
<h-icon icon-name="icon-clock"></h-icon>
|
|
62
58
|
|
|
63
59
|
<span class="${SEARCH_CLASS_NAMES.historyItemValue}">${historyElement.label}</span>
|
|
64
60
|
</h-search-history-select>
|
|
65
61
|
|
|
66
|
-
<h-search-history-remove
|
|
67
|
-
data-search-item-id="${this.searchId}${index}-grid"
|
|
68
|
-
item-id="${historyElement.id}"
|
|
69
|
-
role="gridcell"
|
|
70
|
-
>
|
|
62
|
+
<h-search-history-remove item-id="${historyElement.id}">
|
|
71
63
|
<h-icon
|
|
72
64
|
icon-name="icon-x"
|
|
73
65
|
clickable=${true}
|
|
@@ -80,7 +72,7 @@ let HSearchHistory = class HSearchHistory extends PhoenixLightLitElement {
|
|
|
80
72
|
|
|
81
73
|
<h-search-history-load-more
|
|
82
74
|
class="${SEARCH_CLASS_NAMES.historyLoadMore}"
|
|
83
|
-
data-search-item-id="${this.
|
|
75
|
+
data-search-item-id="${this._loadMoreButtonId}"
|
|
84
76
|
${ref(this.buttonRef)}
|
|
85
77
|
>
|
|
86
78
|
${this.translations.loadMore}
|
|
@@ -92,13 +84,9 @@ __decorate([
|
|
|
92
84
|
__metadata("design:type", Array)
|
|
93
85
|
], HSearchHistory.prototype, "history", void 0);
|
|
94
86
|
__decorate([
|
|
95
|
-
property({ type:
|
|
96
|
-
__metadata("design:type",
|
|
87
|
+
property({ type: Number, attribute: 'active-item-id' }),
|
|
88
|
+
__metadata("design:type", Number)
|
|
97
89
|
], HSearchHistory.prototype, "activeItemId", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
property({ type: String, attribute: 'search-id' }),
|
|
100
|
-
__metadata("design:type", String)
|
|
101
|
-
], HSearchHistory.prototype, "searchId", void 0);
|
|
102
90
|
__decorate([
|
|
103
91
|
property({ type: Object }),
|
|
104
92
|
__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;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;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAAkE;AACjF,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;"}
|
package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js
CHANGED
|
@@ -2,21 +2,12 @@ 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 {
|
|
5
|
+
import { 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
|
-
};
|
|
20
11
|
}
|
|
21
12
|
connectedCallback() {
|
|
22
13
|
super.connectedCallback();
|
|
@@ -26,7 +17,6 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
|
|
|
26
17
|
}
|
|
27
18
|
this._setupInitialValue();
|
|
28
19
|
this._setupListeners();
|
|
29
|
-
this._setupAttributes();
|
|
30
20
|
}
|
|
31
21
|
_setupInitialValue() {
|
|
32
22
|
const searchQueryRegExp = /\/searchquery\/([^/]{1,})/;
|
|
@@ -55,8 +45,7 @@ let HSearchInput = class HSearchInput extends PhoenixLightLitElement {
|
|
|
55
45
|
this.input.addEventListener('focusin', (ev) => {
|
|
56
46
|
this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.focusin, {
|
|
57
47
|
detail: {
|
|
58
|
-
searchPhrase: ev.target.value
|
|
59
|
-
relatedTarget: ev.relatedTarget
|
|
48
|
+
searchPhrase: ev.target.value
|
|
60
49
|
}
|
|
61
50
|
});
|
|
62
51
|
});
|
|
@@ -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;"}
|
|
@@ -7,7 +7,6 @@ export declare class HSearchMessage extends PhoenixLightLitElement {
|
|
|
7
7
|
history: TSearchHistoryItem[];
|
|
8
8
|
translations: Record<string, string>;
|
|
9
9
|
moduleInstanceId: string;
|
|
10
|
-
private _searchButtonId;
|
|
11
10
|
private _createEmptyResults;
|
|
12
11
|
private _isNoResultsForSearchPhrase;
|
|
13
12
|
private _hasHistoryAndEmptyPhrase;
|
|
@@ -3,7 +3,6 @@ import { html } from 'lit';
|
|
|
3
3
|
import { property } 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';
|
|
7
6
|
import { when as n } from '../../../../../../../../external/lit/external/lit-html/directives/when.js';
|
|
8
7
|
import { SEARCH_CUSTOM_EVENT_NAMES, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
9
8
|
import isEqual_1 from '../../../../../../../../external/lodash/isEqual.js';
|
|
@@ -14,7 +13,6 @@ let HSearchMessage = class HSearchMessage extends PhoenixLightLitElement {
|
|
|
14
13
|
this.searchPhrase = '';
|
|
15
14
|
this.history = [];
|
|
16
15
|
this.translations = {};
|
|
17
|
-
this._searchButtonId = v4();
|
|
18
16
|
}
|
|
19
17
|
_createEmptyResults() {
|
|
20
18
|
return {
|
|
@@ -47,12 +45,7 @@ let HSearchMessage = class HSearchMessage extends PhoenixLightLitElement {
|
|
|
47
45
|
return html `
|
|
48
46
|
${n(this._isNoResultsForSearchPhrase(), () => html `<p class="${SEARCH_CLASS_NAMES.messageNoResults}">
|
|
49
47
|
${this.searchPhrase} -
|
|
50
|
-
<button
|
|
51
|
-
class="${SEARCH_CLASS_NAMES.messageText}"
|
|
52
|
-
@click="${this.handleGoToResults}"
|
|
53
|
-
type="button"
|
|
54
|
-
data-search-item-id="${this._searchButtonId}"
|
|
55
|
-
>
|
|
48
|
+
<button class="${SEARCH_CLASS_NAMES.messageText}" @click="${this.handleGoToResults}" type="button">
|
|
56
49
|
${this.translations.searchInStore}
|
|
57
50
|
</button>
|
|
58
51
|
</p>`, () => html `${n(this._hasHistoryAndEmptyPhrase(), () => html `<p class="${SEARCH_CLASS_NAMES.message} ${SEARCH_CLASS_NAMES.messageWithHistory}">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;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,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;"}
|
|
@@ -3,8 +3,7 @@ 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:
|
|
7
|
-
searchId: string;
|
|
6
|
+
activeItemId: number;
|
|
8
7
|
initialItemIds: Record<string, number>;
|
|
9
8
|
translations: Record<string, string>;
|
|
10
9
|
searchPhrase: string;
|
|
@@ -27,14 +27,13 @@ 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} ${
|
|
30
|
+
class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${this.initialItemIds.producers + index ===
|
|
31
31
|
this.activeItemId
|
|
32
32
|
? SEARCH_CLASS_NAMES.itemActive
|
|
33
33
|
: ''}"
|
|
34
|
-
data-search-item-id="${this.
|
|
34
|
+
data-search-item-id="${this.initialItemIds.producers + index}"
|
|
35
35
|
aria-label=${this.producerAriaLabel ? `${this.producerAriaLabel} ${producer.name}` : undefined}
|
|
36
36
|
tabindex="0"
|
|
37
|
-
role="option"
|
|
38
37
|
>
|
|
39
38
|
<a
|
|
40
39
|
href="${producer.url}"
|
|
@@ -55,13 +54,9 @@ __decorate([
|
|
|
55
54
|
__metadata("design:type", Array)
|
|
56
55
|
], HSearchProducerContent.prototype, "producers", void 0);
|
|
57
56
|
__decorate([
|
|
58
|
-
property({ type:
|
|
59
|
-
__metadata("design:type",
|
|
57
|
+
property({ type: Number, attribute: 'active-item-id' }),
|
|
58
|
+
__metadata("design:type", Number)
|
|
60
59
|
], 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);
|
|
65
60
|
__decorate([
|
|
66
61
|
property({ type: Object, reflect: true }),
|
|
67
62
|
__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,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;
|
|
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;"}
|
|
@@ -4,8 +4,7 @@ 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:
|
|
8
|
-
searchId: string;
|
|
7
|
+
activeItemId: number;
|
|
9
8
|
initialItemIds: Record<string, number>;
|
|
10
9
|
translations: Record<string, string>;
|
|
11
10
|
productAriaLabel?: string;
|
|
@@ -40,14 +40,13 @@ 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} ${
|
|
43
|
+
class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${this.initialItemIds.products + index ===
|
|
44
44
|
this.activeItemId
|
|
45
45
|
? SEARCH_CLASS_NAMES.itemActive
|
|
46
46
|
: ''}"
|
|
47
|
-
data-search-item-id="${this.
|
|
47
|
+
data-search-item-id="${this.initialItemIds.products + index}"
|
|
48
48
|
aria-label=${this.productAriaLabel ? `${this.productAriaLabel} ${product.name}` : undefined}
|
|
49
49
|
tabindex="0"
|
|
50
|
-
role="option"
|
|
51
50
|
>
|
|
52
51
|
<a
|
|
53
52
|
href="${product.url}"
|
|
@@ -96,13 +95,9 @@ __decorate([
|
|
|
96
95
|
__metadata("design:type", Object)
|
|
97
96
|
], HSearchProductContent.prototype, "settings", void 0);
|
|
98
97
|
__decorate([
|
|
99
|
-
property({ type:
|
|
100
|
-
__metadata("design:type",
|
|
98
|
+
property({ type: Number, attribute: 'active-item-id' }),
|
|
99
|
+
__metadata("design:type", Number)
|
|
101
100
|
], 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);
|
|
106
101
|
__decorate([
|
|
107
102
|
property({ type: Object, reflect: true }),
|
|
108
103
|
__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,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;
|
|
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;"}
|
|
@@ -9,8 +9,7 @@ export declare class HSearchResults extends PhoenixLightLitElement {
|
|
|
9
9
|
settings: TSearchSettings;
|
|
10
10
|
view: string;
|
|
11
11
|
locale: string;
|
|
12
|
-
activeItemId:
|
|
13
|
-
searchId: string;
|
|
12
|
+
activeItemId: number;
|
|
14
13
|
translations: Record<string, string>;
|
|
15
14
|
moduleInstanceId: string;
|
|
16
15
|
private _productPage;
|
|
@@ -66,7 +66,6 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
|
|
|
66
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
|
|
67
67
|
class="${SEARCH_CLASS_NAMES.section}"
|
|
68
68
|
active-item-id="${this.activeItemId}"
|
|
69
|
-
search-id="${this.searchId}"
|
|
70
69
|
.initialItemIds="${this._getInitialItemsIds()}"
|
|
71
70
|
.translations="${this.translations}"
|
|
72
71
|
locale="${this.locale}"
|
|
@@ -81,7 +80,6 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
|
|
|
81
80
|
.products="${this.results.products}"
|
|
82
81
|
.settings="${this.settings}"
|
|
83
82
|
active-item-id="${this.activeItemId}"
|
|
84
|
-
search-id="${this.searchId}"
|
|
85
83
|
.initialItemIds="${this._getInitialItemsIds()}"
|
|
86
84
|
.translations="${this.translations}"
|
|
87
85
|
.productAriaLabel=${this.settings.suggesterProductItemAriaLabel}
|
|
@@ -91,7 +89,7 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
|
|
|
91
89
|
class="${SEARCH_CLASS_NAMES.productButton}"
|
|
92
90
|
@click="${this.handleLoadMoreProducts}"
|
|
93
91
|
type="button"
|
|
94
|
-
data-search-item-id="${this.
|
|
92
|
+
data-search-item-id="${this._loadMoreButtonId}"
|
|
95
93
|
>
|
|
96
94
|
${this.translations.loadMore}
|
|
97
95
|
</button>`), () => html `
|
|
@@ -99,7 +97,7 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
|
|
|
99
97
|
class="${SEARCH_CLASS_NAMES.productButton}"
|
|
100
98
|
@click="${this.handleGoToProductsFor}"
|
|
101
99
|
type="button"
|
|
102
|
-
data-search-item-id="${this.
|
|
100
|
+
data-search-item-id="${this._goToProductsForButtonId}"
|
|
103
101
|
>
|
|
104
102
|
${this.translations.goToProductsFor}: <strong>${this._getSearchPhrase()}</strong>
|
|
105
103
|
</button>
|
|
@@ -110,7 +108,6 @@ let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
|
|
|
110
108
|
class="${SEARCH_CLASS_NAMES.section}"
|
|
111
109
|
.producers="${this.results.producers}"
|
|
112
110
|
active-item-id="${this.activeItemId}"
|
|
113
|
-
search-id="${this.searchId}"
|
|
114
111
|
.initialItemIds="${this._getInitialItemsIds()}"
|
|
115
112
|
.translations="${this.translations}"
|
|
116
113
|
search-phrase="${this.searchPhrase}"
|
|
@@ -141,13 +138,9 @@ __decorate([
|
|
|
141
138
|
__metadata("design:type", String)
|
|
142
139
|
], HSearchResults.prototype, "locale", void 0);
|
|
143
140
|
__decorate([
|
|
144
|
-
property({ type:
|
|
145
|
-
__metadata("design:type",
|
|
141
|
+
property({ type: Number, attribute: 'active-item-id' }),
|
|
142
|
+
__metadata("design:type", Number)
|
|
146
143
|
], 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);
|
|
151
144
|
__decorate([
|
|
152
145
|
property({ type: Object }),
|
|
153
146
|
__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,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;
|
|
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;"}
|
|
@@ -4,8 +4,7 @@ export declare class HSearchSuggestionContent extends PhoenixLightLitElement {
|
|
|
4
4
|
private _searchContextConsumer;
|
|
5
5
|
private _searchContext$;
|
|
6
6
|
private _searchContextObserver;
|
|
7
|
-
activeItemId:
|
|
8
|
-
searchId: string;
|
|
7
|
+
activeItemId: number;
|
|
9
8
|
initialItemIds: Record<string, number>;
|
|
10
9
|
translations: Record<string, string>;
|
|
11
10
|
view: string;
|
|
@@ -103,16 +103,13 @@ 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} ${
|
|
106
|
+
class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable} ${index === this.activeItemId
|
|
107
107
|
? SEARCH_CLASS_NAMES.itemActive
|
|
108
108
|
: ''}"
|
|
109
109
|
data-suggested-value="${suggestion.suggestionName}"
|
|
110
|
-
data-search-item-id="${
|
|
111
|
-
aria-label
|
|
112
|
-
`${this.suggestionAriaLabel} ${suggestion.suggestionName || suggestion.categoryName}` :
|
|
113
|
-
''}"
|
|
110
|
+
data-search-item-id="${index}"
|
|
111
|
+
aria-label=${this.suggestionAriaLabel ? `${this.suggestionAriaLabel} ${suggestion.suggestionName}` : undefined}
|
|
114
112
|
tabindex="0"
|
|
115
|
-
role="option"
|
|
116
113
|
>
|
|
117
114
|
${n(suggestion.type === SUGGESTIONS_TYPE.suggestion, () => html ` <span> ${this._getMatchedPhrase(suggestion.suggestionName)} </span>
|
|
118
115
|
<h-icon
|
|
@@ -135,13 +132,9 @@ let HSearchSuggestionContent = class HSearchSuggestionContent extends PhoenixLig
|
|
|
135
132
|
}
|
|
136
133
|
};
|
|
137
134
|
__decorate([
|
|
138
|
-
property({ type:
|
|
139
|
-
__metadata("design:type",
|
|
135
|
+
property({ type: Number, attribute: 'active-item-id' }),
|
|
136
|
+
__metadata("design:type", Number)
|
|
140
137
|
], 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);
|
|
145
138
|
__decorate([
|
|
146
139
|
property({ type: Object, reflect: true }),
|
|
147
140
|
__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;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;
|
|
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;"}
|
|
@@ -6,6 +6,7 @@ export declare class BaseMessage extends PhoenixLightLitElement implements IBase
|
|
|
6
6
|
portalTarget: string;
|
|
7
7
|
direction: TDirection;
|
|
8
8
|
offset: number;
|
|
9
|
+
tabindex: string;
|
|
9
10
|
private _positionController;
|
|
10
11
|
private _clickOutsideController;
|
|
11
12
|
private _$messageContent;
|
|
@@ -21,7 +22,4 @@ export declare class BaseMessage extends PhoenixLightLitElement implements IBase
|
|
|
21
22
|
protected _positionMessage: () => void;
|
|
22
23
|
open: () => void;
|
|
23
24
|
close: () => void;
|
|
24
|
-
private _handleFocusWithinMessage;
|
|
25
|
-
private _handleReverseTab;
|
|
26
|
-
private _isBaseMessage;
|
|
27
25
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { property } from 'lit/decorators';
|
|
3
|
-
import { DIRECTIONS
|
|
3
|
+
import { DIRECTIONS } from '@dreamcommerce/utilities';
|
|
4
4
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
|
-
import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
|
|
6
5
|
import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP, PORTAL_TARGET_ATTRIBUTE_NAME } from '../portal/portal_constants.js';
|
|
7
6
|
import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
|
|
8
7
|
import { RelativePositionController } from '../../controllers/relative_position_controller/relative_position_controller.js';
|
|
9
|
-
import { DEFAULT_MESSAGE_PORTAL_NAME, DEFAULT_MESSAGE_OFFSET, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS
|
|
8
|
+
import { DEFAULT_MESSAGE_PORTAL_NAME, DEFAULT_MESSAGE_OFFSET, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS } from './base_message_constants.js';
|
|
10
9
|
|
|
11
10
|
class BaseMessage extends PhoenixLightLitElement {
|
|
12
11
|
constructor() {
|
|
@@ -15,10 +14,12 @@ class BaseMessage extends PhoenixLightLitElement {
|
|
|
15
14
|
this.portalTarget = DEFAULT_MESSAGE_PORTAL_NAME;
|
|
16
15
|
this.direction = DIRECTIONS.topCenter;
|
|
17
16
|
this.offset = DEFAULT_MESSAGE_OFFSET;
|
|
17
|
+
this.tabindex = '0';
|
|
18
18
|
this._setupEventListeners = () => {
|
|
19
19
|
this.addEventListener('mouseenter', this.open);
|
|
20
20
|
this.addEventListener('mouseleave', this.close);
|
|
21
|
-
this.addEventListener('
|
|
21
|
+
this.addEventListener('focusin', this.open);
|
|
22
|
+
this.addEventListener('focusout', this.close);
|
|
22
23
|
};
|
|
23
24
|
this._positionMessage = () => {
|
|
24
25
|
requestAnimationFrame(() => {
|
|
@@ -54,49 +55,11 @@ class BaseMessage extends PhoenixLightLitElement {
|
|
|
54
55
|
});
|
|
55
56
|
}, this._shouldDelayClosing ? MESSAGE_CLOSE_DELAY_IN_MS : 0);
|
|
56
57
|
};
|
|
57
|
-
this._handleFocusWithinMessage = (ev) => {
|
|
58
|
-
var _a;
|
|
59
|
-
if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest(`.${this._messageComponentName}`)) !== this)
|
|
60
|
-
this.close();
|
|
61
|
-
if (!document.activeElement || ev.shiftKey)
|
|
62
|
-
return;
|
|
63
|
-
const $focusableElements = UiDomUtils.getFocusableElements(this);
|
|
64
|
-
const activeElementIndex = $focusableElements.indexOf(document.activeElement);
|
|
65
|
-
const isLastFocusableChild = activeElementIndex === $focusableElements.length - 1;
|
|
66
|
-
if (!isLastFocusableChild)
|
|
67
|
-
return;
|
|
68
|
-
this.close();
|
|
69
|
-
};
|
|
70
|
-
this._handleReverseTab = () => {
|
|
71
|
-
const $focusableElements = UiDomUtils.getFocusableElements(document.body);
|
|
72
|
-
const activeElement = document.activeElement;
|
|
73
|
-
const indexOfCurrentlyFocusedElement = $focusableElements.indexOf(activeElement);
|
|
74
|
-
const $previousElement = $focusableElements[indexOfCurrentlyFocusedElement - 1];
|
|
75
|
-
const $previousElementMessageParent = $previousElement === null || $previousElement === void 0 ? void 0 : $previousElement.closest(`h-${this._messageComponentName}`);
|
|
76
|
-
if ($previousElementMessageParent === this)
|
|
77
|
-
return;
|
|
78
|
-
if ($previousElementMessageParent)
|
|
79
|
-
$previousElementMessageParent.open();
|
|
80
|
-
if (this._isBaseMessage(activeElement))
|
|
81
|
-
activeElement.close();
|
|
82
|
-
};
|
|
83
58
|
this._clickOutsideController = new ClickOutsideController({
|
|
84
59
|
host: this,
|
|
85
60
|
container: this,
|
|
86
61
|
action: this.close
|
|
87
62
|
});
|
|
88
|
-
new KeystrokesController({
|
|
89
|
-
host: this,
|
|
90
|
-
keys: ['tab'],
|
|
91
|
-
target: this,
|
|
92
|
-
callback: this._handleFocusWithinMessage
|
|
93
|
-
});
|
|
94
|
-
new KeystrokesController({
|
|
95
|
-
host: this,
|
|
96
|
-
keys: [['shift', 'tab']],
|
|
97
|
-
target: document.body,
|
|
98
|
-
callback: this._handleReverseTab
|
|
99
|
-
});
|
|
100
63
|
}
|
|
101
64
|
connectedCallback(messageComponentName = '') {
|
|
102
65
|
super.connectedCallback();
|
|
@@ -112,7 +75,7 @@ class BaseMessage extends PhoenixLightLitElement {
|
|
|
112
75
|
elementToPosition: this._$messageContent,
|
|
113
76
|
offset: this.offset
|
|
114
77
|
});
|
|
115
|
-
this.setAttribute('tabindex',
|
|
78
|
+
this.setAttribute('tabindex', this.tabindex);
|
|
116
79
|
this._setupEventListeners();
|
|
117
80
|
}
|
|
118
81
|
static _appendMessagePortal() {
|
|
@@ -123,11 +86,6 @@ class BaseMessage extends PhoenixLightLitElement {
|
|
|
123
86
|
$portalTarget.setAttribute(PORTAL_TARGET_NAME_PROP, DEFAULT_MESSAGE_PORTAL_NAME);
|
|
124
87
|
document.body.appendChild($portalTarget);
|
|
125
88
|
}
|
|
126
|
-
_isBaseMessage($element) {
|
|
127
|
-
if (MESSAGE_ELEMENTS.includes($element.localName))
|
|
128
|
-
return true;
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
89
|
}
|
|
132
90
|
__decorate([
|
|
133
91
|
property({ type: Boolean, reflect: true }),
|
|
@@ -144,7 +102,11 @@ __decorate([
|
|
|
144
102
|
__decorate([
|
|
145
103
|
property({ type: String }),
|
|
146
104
|
__metadata("design:type", Number)
|
|
147
|
-
], BaseMessage.prototype, "offset", void 0);
|
|
105
|
+
], BaseMessage.prototype, "offset", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ type: String }),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], BaseMessage.prototype, "tabindex", void 0);
|
|
148
110
|
|
|
149
111
|
export { BaseMessage };
|
|
150
112
|
//# sourceMappingURL=base_message.js.map
|
|
@@ -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;
|
|
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;"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HINT_CONTENT_ELEMENT_NAME } from './hints/hint_constants.js';
|
|
2
|
+
import { TOOLTIP_CONTENT_ELEMENT_NAME } from './tooltips/tooltip_constants.js';
|
|
3
3
|
|
|
4
4
|
const DEFAULT_MESSAGE_PORTAL_NAME = 'message-portal';
|
|
5
5
|
const MESSAGE_CONTENT_SLOT_NAME = 'message-content';
|
|
6
6
|
const MESSAGE_REMOVED_CLASS_NAME = `removed`;
|
|
7
7
|
const DEFAULT_MESSAGE_OFFSET = 10;
|
|
8
|
-
const MESSAGE_ELEMENTS = [TOOLTIP_ELEMENT_NAME, HINT_ELEMENT_NAME];
|
|
9
8
|
const MESSAGE_CONTENT_ELEMENTS = [TOOLTIP_CONTENT_ELEMENT_NAME, HINT_CONTENT_ELEMENT_NAME];
|
|
10
9
|
const MESSAGE_SHOW_DELAY_IN_MS = 100;
|
|
11
10
|
const MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS = 500;
|
|
12
11
|
const MESSAGE_CLOSE_DELAY_IN_MS = 500;
|
|
13
12
|
|
|
14
|
-
export { DEFAULT_MESSAGE_OFFSET, DEFAULT_MESSAGE_PORTAL_NAME, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS, MESSAGE_CONTENT_SLOT_NAME,
|
|
13
|
+
export { DEFAULT_MESSAGE_OFFSET, DEFAULT_MESSAGE_PORTAL_NAME, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS, MESSAGE_CONTENT_SLOT_NAME, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS };
|
|
15
14
|
//# sourceMappingURL=base_message_constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -72,8 +72,8 @@ export { HToggleButton } from './components/groups/toggle_button_group/toggle_bu
|
|
|
72
72
|
export { CLICK_OUTSIDE_CONTROLLER_MESSAGES } from './controllers/click_outside_controller/click_outside_controller_messages.js';
|
|
73
73
|
export { HBackdrop } from './components/backdrop/backdrop.js';
|
|
74
74
|
export { COLOR_SWATCHES_CONTROL_EVENT_NAMES } from './components/form/color_swatches_control/color_swatches_control_constants.js';
|
|
75
|
-
export { HColorItem } from './components/color_swatches/color_item/color_item.js';
|
|
76
75
|
export { HColorSwatches } from './components/color_swatches/color_swatches.js';
|
|
76
|
+
export { HColorItem } from './components/color_swatches/color_item/color_item.js';
|
|
77
77
|
export { HColorSwatchesControl } from './components/form/color_swatches_control/color_swatches_control.js';
|
|
78
78
|
export { HColorSwatchesShowMore } from './components/color_swatches/show-more/show_more.js';
|
|
79
79
|
export { VisibilityController } from './controllers/visibility_controller/visibility_controller.js';
|
|
@@ -98,11 +98,11 @@ export { HSearchInput } from './components/form/search/subcomponents/input/searc
|
|
|
98
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 { HSearchClear } from './components/form/search/subcomponents/buttons/search_clear.js';
|
|
102
|
-
export { HSearchMessage } from './components/form/search/subcomponents/message/search_message.js';
|
|
103
101
|
export { HSearch } from './components/form/search/search.js';
|
|
104
102
|
export { HSearchSubmit } from './components/form/search/subcomponents/buttons/search_submit.js';
|
|
103
|
+
export { HSearchClear } from './components/form/search/subcomponents/buttons/search_clear.js';
|
|
105
104
|
export { HSearchClose } from './components/form/search/subcomponents/buttons/search_close.js';
|
|
105
|
+
export { HSearchMessage } from './components/form/search/subcomponents/message/search_message.js';
|
|
106
106
|
export { HSearchHistoryRemove } from './components/form/search/subcomponents/history/search_history_remove.js';
|
|
107
107
|
export { HSearchHistorySelect } from './components/form/search/subcomponents/history/search_history_select.js';
|
|
108
108
|
export { HSearchSuggestionContent } from './components/form/search/subcomponents/results/search_suggestion_content.js';
|