@shoper/phoenix_design_system 1.6.7 → 1.6.8
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/form/search/search.js +85 -37
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search_constants.js +36 -11
- package/build/cjs/packages/phoenix/src/components/form/search/search_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.js +30 -0
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +25 -22
- 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/message/search_message.js +10 -3
- 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 +19 -19
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +49 -33
- 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 +74 -27
- 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 +34 -13
- 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/icon/icon.js +2 -2
- package/build/cjs/packages/phoenix/src/directives/{namespaced_attribure_directive.js → namespaced_attribute_directive.js} +1 -1
- package/build/cjs/packages/phoenix/src/index.js +7 -0
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +11 -6
- package/build/esm/packages/phoenix/src/components/form/search/search.js +87 -39
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search_constants.d.ts +32 -9
- package/build/esm/packages/phoenix/src/components/form/search/search_constants.js +36 -11
- package/build/esm/packages/phoenix/src/components/form/search/search_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search_types.d.ts +26 -2
- package/build/esm/packages/phoenix/src/components/form/search/storefront_search_mock.js +8 -3
- package/build/esm/packages/phoenix/src/components/form/search/storefront_search_mock.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.js +28 -0
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +26 -23
- 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/message/search_message.js +11 -4
- 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.js +20 -20
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.d.ts +4 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +50 -34
- 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 +9 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +76 -29
- 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 +3 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +35 -14
- 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/icon/icon.js +1 -1
- package/build/esm/packages/phoenix/src/directives/{namespaced_attribure_directive.js → namespaced_attribute_directive.js} +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +1 -0
- package/build/esm/packages/phoenix/src/index.js +1 -0
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
- /package/build/cjs/packages/phoenix/src/directives/{namespaced_attribure_directive.js.map → namespaced_attribute_directive.js.map} +0 -0
- /package/build/esm/packages/phoenix/src/directives/{namespaced_attribure_directive.d.ts → namespaced_attribute_directive.d.ts} +0 -0
- /package/build/esm/packages/phoenix/src/directives/{namespaced_attribure_directive.js.map → namespaced_attribute_directive.js.map} +0 -0
|
@@ -7,10 +7,12 @@ var lit = require('lit');
|
|
|
7
7
|
var decorators = require('lit/decorators');
|
|
8
8
|
var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
9
9
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
10
|
+
var icon_constants = require('../../icon/icon_constants.js');
|
|
10
11
|
var observer = require('../../../core/classes/observer/observer.js');
|
|
11
12
|
var context_consumer_controller = require('../../../core/context/context_consumer_controller.js');
|
|
12
13
|
var behavior_subject = require('../../../core/classes/behavior_subject/behavior_subject.js');
|
|
13
14
|
var context_provider_controller = require('../../../core/context/context_provider_controller.js');
|
|
15
|
+
var global_constants = require('../../../global_constants.js');
|
|
14
16
|
var when = require('../../../../../../external/lit/external/lit-html/directives/when.js');
|
|
15
17
|
var search_constants = require('./search_constants.js');
|
|
16
18
|
|
|
@@ -29,10 +31,16 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
29
31
|
this._translations = {};
|
|
30
32
|
this._hideSuggesterOnClickOutside = (ev) => {
|
|
31
33
|
const outsideClick = typeof ev.composedPath === 'function' && !ev.composedPath().includes(this);
|
|
32
|
-
if (outsideClick)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (!outsideClick)
|
|
35
|
+
return;
|
|
36
|
+
this._resetSearchView();
|
|
37
|
+
};
|
|
38
|
+
this._switchTypeOfSearchView = () => {
|
|
39
|
+
if (!this._isSuggesterLayerVisible())
|
|
40
|
+
return;
|
|
41
|
+
window.innerWidth > global_constants.BREAKPOINTS.sm
|
|
42
|
+
? this.classList.remove(search_constants.SEARCH_CLASS_NAMES.mobileOpened)
|
|
43
|
+
: this.classList.add(search_constants.SEARCH_CLASS_NAMES.mobileOpened);
|
|
36
44
|
};
|
|
37
45
|
}
|
|
38
46
|
async connectedCallback() {
|
|
@@ -59,6 +67,7 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
59
67
|
disconnectedCallback() {
|
|
60
68
|
super.disconnectedCallback();
|
|
61
69
|
document.removeEventListener('click', this._hideSuggesterOnClickOutside);
|
|
70
|
+
window.removeEventListener('resize', this._switchTypeOfSearchView);
|
|
62
71
|
}
|
|
63
72
|
_setupContext() {
|
|
64
73
|
this._historyContextProvider = new context_provider_controller.ContextProviderController(this);
|
|
@@ -66,7 +75,10 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
66
75
|
}
|
|
67
76
|
_setupListeners() {
|
|
68
77
|
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.focusinInput, (ev) => {
|
|
69
|
-
this.
|
|
78
|
+
const searchBar = this.querySelector(`.${search_constants.SEARCH_CLASS_NAMES.searchBar}`);
|
|
79
|
+
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.add(search_constants.SEARCH_CLASS_NAMES.outline);
|
|
80
|
+
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
81
|
+
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage, false);
|
|
70
82
|
});
|
|
71
83
|
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.keyupInput, (ev) => {
|
|
72
84
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
@@ -83,8 +95,13 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
83
95
|
this._updateSearchView(updatedInput.value, true);
|
|
84
96
|
}
|
|
85
97
|
else {
|
|
86
|
-
this.
|
|
98
|
+
this._resetSearchView();
|
|
87
99
|
}
|
|
100
|
+
this._submitSearchPhrase(updatedInput.value);
|
|
101
|
+
});
|
|
102
|
+
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.close, () => {
|
|
103
|
+
this.classList.remove(search_constants.SEARCH_CLASS_NAMES.mobileOpened);
|
|
104
|
+
this._resetSearchView();
|
|
88
105
|
});
|
|
89
106
|
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.loadMoreHistoryItems, () => {
|
|
90
107
|
const contentLength = this._searchHistory.length;
|
|
@@ -95,31 +112,15 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
95
112
|
this._historyContext.notify({ showLoadMore: this._historyLimitedContent.length < contentLength });
|
|
96
113
|
});
|
|
97
114
|
document.addEventListener('click', this._hideSuggesterOnClickOutside);
|
|
115
|
+
window.addEventListener('resize', this._switchTypeOfSearchView);
|
|
98
116
|
}
|
|
99
|
-
_updateSearchView(searchPhrase, shouldShowMessage) {
|
|
117
|
+
_updateSearchView(searchPhrase, shouldShowMessage, shouldUpdateSearchPhrase = true) {
|
|
100
118
|
this._shouldShowMessage = shouldShowMessage;
|
|
101
119
|
this._displaySuggester(searchPhrase);
|
|
120
|
+
if (!shouldUpdateSearchPhrase)
|
|
121
|
+
return;
|
|
102
122
|
this._updateSearchPhrase(searchPhrase);
|
|
103
123
|
}
|
|
104
|
-
_resetSearchViewAndSubmitSearchPhrase(searchPhrase) {
|
|
105
|
-
this._shouldShowMessage = false;
|
|
106
|
-
this._hideHistorySuggestionsAndResults();
|
|
107
|
-
this._submitSearchPhrase(searchPhrase);
|
|
108
|
-
}
|
|
109
|
-
_updateSearchPhrase(searchPhrase) {
|
|
110
|
-
this._dispatchEventWithSearchPhrase(search_constants.SEARCH_CUSTOM_EVENT_NAMES.searchPhraseUpdated, searchPhrase);
|
|
111
|
-
}
|
|
112
|
-
_submitSearchPhrase(searchPhrase) {
|
|
113
|
-
this._dispatchEventWithSearchPhrase(search_constants.SEARCH_CUSTOM_EVENT_NAMES.searchPhraseSubmitted, searchPhrase);
|
|
114
|
-
}
|
|
115
|
-
_dispatchEventWithSearchPhrase(eventName, searchPhrase) {
|
|
116
|
-
this.dispatchEvent(new CustomEvent(eventName, {
|
|
117
|
-
detail: {
|
|
118
|
-
searchPhrase
|
|
119
|
-
},
|
|
120
|
-
bubbles: true
|
|
121
|
-
}));
|
|
122
|
-
}
|
|
123
124
|
_displaySuggester(searchPhrase) {
|
|
124
125
|
if (searchPhrase === '' && this._searchHistory.length !== 0) {
|
|
125
126
|
this._displayHistorySuggestions();
|
|
@@ -135,24 +136,67 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
135
136
|
this._shouldShowHistory = true;
|
|
136
137
|
this._shouldShowResults = false;
|
|
137
138
|
}
|
|
139
|
+
_hideHistorySuggestionsAndResults() {
|
|
140
|
+
this._shouldShowHistory = false;
|
|
141
|
+
this._shouldShowResults = false;
|
|
142
|
+
}
|
|
138
143
|
_displayResults() {
|
|
139
144
|
this._shouldShowHistory = false;
|
|
140
145
|
this._shouldShowResults = true;
|
|
141
146
|
}
|
|
142
|
-
|
|
143
|
-
this.
|
|
144
|
-
|
|
147
|
+
_updateSearchPhrase(searchPhrase) {
|
|
148
|
+
this._dispatchEventWithSearchPhrase(search_constants.SEARCH_CUSTOM_EVENT_NAMES.searchPhraseUpdated, searchPhrase);
|
|
149
|
+
}
|
|
150
|
+
_dispatchEventWithSearchPhrase(eventName, searchPhrase) {
|
|
151
|
+
this.dispatchEvent(new CustomEvent(eventName, {
|
|
152
|
+
detail: {
|
|
153
|
+
searchPhrase
|
|
154
|
+
},
|
|
155
|
+
bubbles: true
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
_resetSearchView() {
|
|
159
|
+
this._shouldShowMessage = false;
|
|
160
|
+
const searchBar = this.querySelector(`.${search_constants.SEARCH_CLASS_NAMES.searchBar}`);
|
|
161
|
+
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(search_constants.SEARCH_CLASS_NAMES.outline);
|
|
162
|
+
this._hideHistorySuggestionsAndResults();
|
|
163
|
+
}
|
|
164
|
+
_submitSearchPhrase(searchPhrase) {
|
|
165
|
+
this._dispatchEventWithSearchPhrase(search_constants.SEARCH_CUSTOM_EVENT_NAMES.searchPhraseSubmitted, searchPhrase);
|
|
166
|
+
}
|
|
167
|
+
_isSuggesterLayerVisible() {
|
|
168
|
+
return this.settings.isSearchSuggestLayerEnabled && (this._shouldShowHistory || this._shouldShowResults || this._shouldShowMessage);
|
|
169
|
+
}
|
|
170
|
+
_handleOpenSearch() {
|
|
171
|
+
this.classList.add(search_constants.SEARCH_CLASS_NAMES.mobileOpened);
|
|
172
|
+
const shouldShowMessage = this._searchPhrase !== '';
|
|
173
|
+
this._updateSearchView(this._searchPhrase, shouldShowMessage, false);
|
|
145
174
|
}
|
|
146
175
|
render() {
|
|
147
176
|
return lit.html `
|
|
148
|
-
${
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
177
|
+
<div class="${search_constants.SEARCH_CLASS_NAMES.icon} labeled-icon" @click=${this._handleOpenSearch}>
|
|
178
|
+
<h-icon icon-name="icon-search" size=${icon_constants.ICONS_SIZES.l}></h-icon>
|
|
179
|
+
<div class="labeled-icon__signature">${this._translations.search}</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
${when.when(this._isSuggesterLayerVisible(), () => lit.html `<div class="${search_constants.SEARCH_CLASS_NAMES.container}">
|
|
183
|
+
${when.when(this._shouldShowMessage, () => lit.html `<h-search-message
|
|
184
|
+
.history="${this._historyLimitedContent}"
|
|
185
|
+
.results="${this._searchResults}"
|
|
186
|
+
.translations="${this._translations}"
|
|
187
|
+
search-phrase="${this._searchPhrase}"
|
|
188
|
+
></h-search-message>`)}
|
|
189
|
+
${when.when(this._shouldShowHistory, () => lit.html `<h-search-history
|
|
190
|
+
.history="${this._historyLimitedContent}"
|
|
191
|
+
.translations="${this._translations}"
|
|
192
|
+
></h-search-history>`)}
|
|
193
|
+
${when.when(this._shouldShowResults, () => lit.html `<h-search-results
|
|
194
|
+
.results="${this._searchResults}"
|
|
195
|
+
search-phrase="${this._searchPhrase}"
|
|
196
|
+
.settings="${this.settings}"
|
|
197
|
+
.translations="${this._translations}"
|
|
198
|
+
></h-search-results>`)}
|
|
199
|
+
</div>`)}
|
|
156
200
|
`;
|
|
157
201
|
}
|
|
158
202
|
};
|
|
@@ -188,6 +232,10 @@ tslib_es6.__decorate([
|
|
|
188
232
|
decorators.state(),
|
|
189
233
|
tslib_es6.__metadata("design:type", behavior_subject.BehaviorSubject)
|
|
190
234
|
], exports.HSearch.prototype, "_historyContext", void 0);
|
|
235
|
+
tslib_es6.__decorate([
|
|
236
|
+
decorators.property({ type: Object }),
|
|
237
|
+
tslib_es6.__metadata("design:type", Object)
|
|
238
|
+
], exports.HSearch.prototype, "settings", void 0);
|
|
191
239
|
exports.HSearch = tslib_es6.__decorate([
|
|
192
240
|
phoenix_custom_element.phoenixCustomElement(search_constants.SEARCH_COMPONENT_NAMES.search)
|
|
193
241
|
], exports.HSearch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qEAA6E;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qEAA6E;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -7,6 +7,7 @@ const SEARCH_COMPONENT_NAMES = {
|
|
|
7
7
|
searchInput: 'h-search-input',
|
|
8
8
|
clearButton: 'h-search-clear',
|
|
9
9
|
submitButton: 'h-search-submit',
|
|
10
|
+
closeButton: 'h-search-close',
|
|
10
11
|
searchResults: 'h-search-results',
|
|
11
12
|
searchHistory: 'h-search-history',
|
|
12
13
|
searchMessage: 'h-search-message',
|
|
@@ -22,8 +23,10 @@ const SEARCH_CUSTOM_EVENT_NAMES = {
|
|
|
22
23
|
searchPhraseSubmitted: 'search.searchPhraseSubmitted',
|
|
23
24
|
removeHistoryItem: 'search.removeHistoryItem',
|
|
24
25
|
loadMoreHistoryItems: 'search.loadMoreHistoryItems',
|
|
26
|
+
loadMoreProducts: 'search.loadMoreProducts',
|
|
25
27
|
clear: 'search.clearSearchPhrase',
|
|
26
28
|
submit: 'search.submitSearchPhrase',
|
|
29
|
+
close: 'search.close',
|
|
27
30
|
focusinInput: 'search.input.focusin',
|
|
28
31
|
keyupInput: 'search.input.keyup',
|
|
29
32
|
searchInput: 'search.input.search'
|
|
@@ -31,16 +34,36 @@ const SEARCH_CUSTOM_EVENT_NAMES = {
|
|
|
31
34
|
const SEARCH_NATIVE_EVENT_NAMES = {
|
|
32
35
|
click: 'click'
|
|
33
36
|
};
|
|
37
|
+
const baseSearchCssClass = 'search';
|
|
34
38
|
const SEARCH_CLASS_NAMES = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
searchBar: `${baseSearchCssClass}__bar`,
|
|
40
|
+
container: `${baseSearchCssClass}__container`,
|
|
41
|
+
icon: `${baseSearchCssClass}__icon`,
|
|
42
|
+
outline: `${baseSearchCssClass}_outline`,
|
|
43
|
+
mobileOpened: `${baseSearchCssClass}_mobile-opened`,
|
|
44
|
+
headline: `${baseSearchCssClass}__headline`,
|
|
45
|
+
section: `${baseSearchCssClass}__section`,
|
|
46
|
+
item: `${baseSearchCssClass}__item`,
|
|
47
|
+
itemHoverable: `${baseSearchCssClass}__item_hoverable`,
|
|
48
|
+
link: `${baseSearchCssClass}__link`,
|
|
49
|
+
linkWithImage: `${baseSearchCssClass}__link_with-image`,
|
|
50
|
+
categoryTitle: `${baseSearchCssClass}__category-title`,
|
|
51
|
+
productIconFilled: `${baseSearchCssClass}__product-icon-filled`,
|
|
52
|
+
productIconEmpty: `${baseSearchCssClass}__product-icon-empty`,
|
|
53
|
+
productButton: `${baseSearchCssClass}__product-button`,
|
|
54
|
+
productText: `${baseSearchCssClass}__product-text`,
|
|
55
|
+
productPriceInfo: `${baseSearchCssClass}__product-price-info`,
|
|
56
|
+
productPriceBasic: `${baseSearchCssClass}__product-price_basic`,
|
|
57
|
+
productPricePromotion: `${baseSearchCssClass}__product-price_promotion`,
|
|
58
|
+
starScore: 'star-score',
|
|
59
|
+
historyItemValue: `${baseSearchCssClass}__history-item-value`,
|
|
60
|
+
historyRemoveIcon: `${baseSearchCssClass}__history-remove-icon`,
|
|
61
|
+
historyLoadMore: `${baseSearchCssClass}__history-load-more`,
|
|
62
|
+
historySelect: `${baseSearchCssClass}__history-select`,
|
|
63
|
+
message: `${baseSearchCssClass}__message`,
|
|
64
|
+
messageWithHistory: `${baseSearchCssClass}__message_with-history`,
|
|
65
|
+
messageNoResults: `${baseSearchCssClass}__message_no-results`,
|
|
66
|
+
messageText: `${baseSearchCssClass}__message-text`
|
|
44
67
|
};
|
|
45
68
|
const SEARCH_CONTEXT_NAMES = {
|
|
46
69
|
historyContext: 'historyContext',
|
|
@@ -54,13 +77,15 @@ const SEARCH_SLOT_NAMES = {
|
|
|
54
77
|
clearButton: 'search.clear.button'
|
|
55
78
|
};
|
|
56
79
|
const SEARCH_CONFIGURATION = {
|
|
57
|
-
historyContentLimit: 3
|
|
80
|
+
historyContentLimit: 3,
|
|
81
|
+
maxCharactersInProductName: 28
|
|
58
82
|
};
|
|
59
83
|
const EMPTY_SEARCH_RESULTS = {
|
|
60
84
|
suggestions: [],
|
|
61
85
|
products: [],
|
|
62
86
|
producers: [],
|
|
63
|
-
categories: []
|
|
87
|
+
categories: [],
|
|
88
|
+
productsPagesCount: 0
|
|
64
89
|
};
|
|
65
90
|
|
|
66
91
|
exports.EMPTY_SEARCH_RESULTS = EMPTY_SEARCH_RESULTS;
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var phoenix_light_lit_element = require('../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
7
|
+
var phoenix_custom_element = require('../../../../../core/decorators/phoenix_custom_element.js');
|
|
8
|
+
var btn_controller = require('../../../../../controllers/btn_controller/btn_controller.js');
|
|
9
|
+
var search_constants = require('../../search_constants.js');
|
|
10
|
+
|
|
11
|
+
exports.HSearchClose = class HSearchClose extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this._btnController = new btn_controller.BtnController(this, this._dispatchCloseEvent);
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback();
|
|
18
|
+
this.addEventListener(search_constants.SEARCH_NATIVE_EVENT_NAMES.click, this._dispatchCloseEvent);
|
|
19
|
+
}
|
|
20
|
+
_dispatchCloseEvent() {
|
|
21
|
+
this.dispatchEvent(new CustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.close, {
|
|
22
|
+
bubbles: true
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.HSearchClose = tslib_es6.__decorate([
|
|
27
|
+
phoenix_custom_element.phoenixCustomElement(search_constants.SEARCH_COMPONENT_NAMES.closeButton),
|
|
28
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
29
|
+
], exports.HSearchClose);
|
|
30
|
+
//# sourceMappingURL=search_close.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -29,6 +29,8 @@ exports.HSearchHistory = class HSearchHistory extends phoenix_light_lit_element.
|
|
|
29
29
|
this._historyContextObserver = new observer.Observer((searchHistory) => {
|
|
30
30
|
this.requestUpdate();
|
|
31
31
|
const button = this.buttonRef.value;
|
|
32
|
+
if (!button)
|
|
33
|
+
return;
|
|
32
34
|
searchHistory.showLoadMore ? button.show() : button.hide();
|
|
33
35
|
});
|
|
34
36
|
this._historyContext$.subscribe(this._historyContextObserver);
|
|
@@ -39,29 +41,30 @@ exports.HSearchHistory = class HSearchHistory extends phoenix_light_lit_element.
|
|
|
39
41
|
}
|
|
40
42
|
render() {
|
|
41
43
|
var _a;
|
|
42
|
-
return when.when((_a = this.history) === null || _a === void 0 ? void 0 : _a.length, () => lit.html `<
|
|
43
|
-
<h-portal to="${search_constants.SEARCH_PORTAL_DESTINATIONS.historyContent}" hidden>
|
|
44
|
-
<h3 class="${search_constants.SEARCH_CLASS_NAMES.historyContainerHeadline}">${this.translations.searchHistory}</h3>
|
|
45
|
-
<ul class="${search_constants.SEARCH_CLASS_NAMES.historyContainerList}">
|
|
46
|
-
${repeat.repeat(this.history, (historyElement) => lit.html `<li class="${search_constants.SEARCH_CLASS_NAMES.historyContainerItem}">
|
|
47
|
-
<h-search-history-select item-label="${historyElement.label}">
|
|
48
|
-
<span class="search__icon_main-color search__list-icon icon icon-reload"></span>
|
|
49
|
-
<span class="search__history-item-value">${historyElement.label}</span>
|
|
50
|
-
</h-search-history-select>
|
|
51
|
-
<h-search-history-remove item-id="${historyElement.id}">X</h-search-history-remove>
|
|
52
|
-
</li>`)}
|
|
53
|
-
</ul>
|
|
54
|
-
<h-search-history-load-more class="${search_constants.SEARCH_CLASS_NAMES.historyContainerLoadMore}" ${ref_js.ref(this.buttonRef)}
|
|
55
|
-
>${this.translations.loadMore}</h-search-history-load-more
|
|
56
|
-
>
|
|
57
|
-
</h-portal>
|
|
44
|
+
return when.when((_a = this.history) === null || _a === void 0 ? void 0 : _a.length, () => lit.html `<h3 class="${search_constants.SEARCH_CLASS_NAMES.headline}">${this.translations.searchHistory}</h3>
|
|
58
45
|
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
<ul>
|
|
47
|
+
${repeat.repeat(this.history, (historyElement) => lit.html ` <li class="${search_constants.SEARCH_CLASS_NAMES.item}">
|
|
48
|
+
<h-search-history-select item-label="${historyElement.label}" class="${search_constants.SEARCH_CLASS_NAMES.historySelect}">
|
|
49
|
+
<h-icon icon-name="icon-clock"></h-icon>
|
|
50
|
+
|
|
51
|
+
<span class="${search_constants.SEARCH_CLASS_NAMES.historyItemValue}">${historyElement.label}</span>
|
|
52
|
+
</h-search-history-select>
|
|
53
|
+
|
|
54
|
+
<h-search-history-remove item-id="${historyElement.id}">
|
|
55
|
+
<h-icon
|
|
56
|
+
icon-name="icon-x"
|
|
57
|
+
clickable=${true}
|
|
58
|
+
size="l"
|
|
59
|
+
css-classes="${search_constants.SEARCH_CLASS_NAMES.historyRemoveIcon}"
|
|
60
|
+
></h-icon>
|
|
61
|
+
</h-search-history-remove>
|
|
62
|
+
</li>`)}
|
|
63
|
+
</ul>
|
|
64
|
+
|
|
65
|
+
<h-search-history-load-more class="${search_constants.SEARCH_CLASS_NAMES.historyLoadMore}" ${ref_js.ref(this.buttonRef)}>
|
|
66
|
+
${this.translations.loadMore}
|
|
67
|
+
</h-search-history-load-more>`);
|
|
65
68
|
}
|
|
66
69
|
};
|
|
67
70
|
tslib_es6.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -23,7 +23,8 @@ exports.HSearchMessage = class HSearchMessage extends phoenix_light_lit_element.
|
|
|
23
23
|
suggestions: [],
|
|
24
24
|
products: [],
|
|
25
25
|
producers: [],
|
|
26
|
-
categories: []
|
|
26
|
+
categories: [],
|
|
27
|
+
productsPagesCount: 0
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
_isNoResultsForSearchPhrase() {
|
|
@@ -36,8 +37,14 @@ exports.HSearchMessage = class HSearchMessage extends phoenix_light_lit_element.
|
|
|
36
37
|
return this.searchPhrase === '' && this.history.length === 0;
|
|
37
38
|
}
|
|
38
39
|
render() {
|
|
39
|
-
return lit.html `
|
|
40
|
-
|
|
40
|
+
return lit.html `
|
|
41
|
+
${when.when(this._isNoResultsForSearchPhrase(), () => lit.html `<p class="${search_constants.SEARCH_CLASS_NAMES.messageNoResults}">
|
|
42
|
+
${this.searchPhrase} - <a class="${search_constants.SEARCH_CLASS_NAMES.messageText}">${this.translations.searchInStore}</a>
|
|
43
|
+
</p>`, () => lit.html `${when.when(this._hasHistoryAndEmptyPhrase(), () => lit.html `<p class="${search_constants.SEARCH_CLASS_NAMES.message} ${search_constants.SEARCH_CLASS_NAMES.messageWithHistory}">
|
|
44
|
+
${this.translations.enterSearchPraseOrChooseFromHistory}
|
|
45
|
+
</p>`)}
|
|
46
|
+
${when.when(this._hasNoHistoryAndEmptyPhrase(), () => lit.html `<p class="${search_constants.SEARCH_CLASS_NAMES.message}">${this.translations.enterSearchPrase}</p>`)} `)}
|
|
47
|
+
`;
|
|
41
48
|
}
|
|
42
49
|
};
|
|
43
50
|
tslib_es6.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;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;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;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;"}
|
|
@@ -17,25 +17,25 @@ exports.HSearchProducerContent = class HSearchProducerContent extends phoenix_li
|
|
|
17
17
|
this.translations = {};
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
return lit.html `
|
|
21
|
+
<h3 class="${search_constants.SEARCH_CLASS_NAMES.headline}">${this.translations.producers}</h3>
|
|
22
|
+
|
|
23
|
+
<ul>
|
|
24
|
+
${repeat.repeat(this.producers, (producer) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return lit.html `<li class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable}">
|
|
27
|
+
<a
|
|
28
|
+
href="${producer.url}"
|
|
29
|
+
class="${((_a = producer.image) === null || _a === void 0 ? void 0 : _a.imagePath) ? search_constants.SEARCH_CLASS_NAMES.linkWithImage : search_constants.SEARCH_CLASS_NAMES.link}"
|
|
30
|
+
>
|
|
31
|
+
${when.when((_b = producer.image) === null || _b === void 0 ? void 0 : _b.imagePath, () => { var _a; return lit.html `<img src="${(_a = producer.image) === null || _a === void 0 ? void 0 : _a.imagePath}" alt="${producer.name}" />`; })}
|
|
32
|
+
|
|
33
|
+
<span>${producer.name}</span>
|
|
34
|
+
</a>
|
|
35
|
+
</li>`;
|
|
36
|
+
})}
|
|
37
|
+
</ul>
|
|
38
|
+
`;
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
tslib_es6.__decorate([
|
|
@@ -15,50 +15,66 @@ exports.HSearchProductContent = class HSearchProductContent extends phoenix_ligh
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.translations = {};
|
|
18
|
+
this.getProductRateHtml = (productRate) => {
|
|
19
|
+
return lit.html `
|
|
20
|
+
<div class="${search_constants.SEARCH_CLASS_NAMES.starScore}">
|
|
21
|
+
${[1, 2, 3, 4, 5].map((score) => lit.html ` <h-icon
|
|
22
|
+
icon-name="icon-star"
|
|
23
|
+
css-classes=${productRate >= score ? search_constants.SEARCH_CLASS_NAMES.productIconFilled : search_constants.SEARCH_CLASS_NAMES.productIconEmpty}
|
|
24
|
+
noStroke=${true}
|
|
25
|
+
></h-icon>`)}
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
};
|
|
18
29
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
bubbles: true,
|
|
22
|
-
detail: {
|
|
23
|
-
searchPhrase: ev.target.textContent
|
|
24
|
-
}
|
|
25
|
-
}));
|
|
30
|
+
_getShortenProductName(productName) {
|
|
31
|
+
return productName.substring(0, search_constants.SEARCH_CONFIGURATION.maxCharactersInProductName) + '...';
|
|
26
32
|
}
|
|
27
33
|
render() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<h3 class="search__section-head search__section-head_sticky search__section-head_line">${this.translations.products}</h3>
|
|
34
|
+
return lit.html `
|
|
35
|
+
<h3 class="${search_constants.SEARCH_CLASS_NAMES.headline}">${this.translations.products}</h3>
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</div>
|
|
42
|
-
<div class="search__result-note">
|
|
43
|
-
<span class="search__result-note-item search__result-item_active">${product.price}</span>
|
|
44
|
-
</div>
|
|
45
|
-
</div></a
|
|
46
|
-
>
|
|
47
|
-
</li>`)}
|
|
48
|
-
</ul>
|
|
37
|
+
<ul>
|
|
38
|
+
${repeat.repeat(this.products, (product) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
return lit.html ` <li class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable}">
|
|
41
|
+
<a
|
|
42
|
+
href="${product.url}"
|
|
43
|
+
class="${((_a = product.image) === null || _a === void 0 ? void 0 : _a.imagePath) ? search_constants.SEARCH_CLASS_NAMES.linkWithImage : search_constants.SEARCH_CLASS_NAMES.link}"
|
|
44
|
+
>
|
|
45
|
+
${when.when((_b = product.image) === null || _b === void 0 ? void 0 : _b.imagePath, () => { var _a; return lit.html `<img src="${(_a = product.image) === null || _a === void 0 ? void 0 : _a.imagePath}" alt="${product.name}" />`; })}
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
<div>
|
|
48
|
+
${when.when(this.settings.showProductRate, () => this.getProductRateHtml(product.rate))}
|
|
49
|
+
|
|
50
|
+
<div>${this.settings.isNamesShorteningEnabled ? this._getShortenProductName(product.name) : product.name}</div>
|
|
51
|
+
|
|
52
|
+
${when.when(this.settings.showProductPrice, () => lit.html ` ${when.when(product.prices.promotion.text.length, () => lit.html `<div>
|
|
53
|
+
<span class="${search_constants.SEARCH_CLASS_NAMES.productPricePromotion}">${product.prices.promotion.text}</span>
|
|
54
|
+
<span class="${search_constants.SEARCH_CLASS_NAMES.productPriceBasic}">${product.prices.basic.text}</span>
|
|
55
|
+
</div>`, () => lit.html `<div class="${search_constants.SEARCH_CLASS_NAMES.productText}">${product.prices.basic.text}</div>`)}
|
|
56
|
+
${when.when(product.isStock, () => lit.html `<div class="${search_constants.SEARCH_CLASS_NAMES.productPriceInfo}">
|
|
57
|
+
${this.translations.priceForTheBaseModel}
|
|
58
|
+
</div>`)}`)}
|
|
59
|
+
${when.when(this.settings.showProductAvailability, () => lit.html `<div>
|
|
60
|
+
${this.translations.availability}: <span class="${search_constants.SEARCH_CLASS_NAMES.productText}">${product.availabilityLabel}<span>
|
|
61
|
+
</div>`)}
|
|
62
|
+
</div>
|
|
63
|
+
</a>
|
|
64
|
+
</li>`;
|
|
65
|
+
})}
|
|
66
|
+
</ul>
|
|
67
|
+
`;
|
|
56
68
|
}
|
|
57
69
|
};
|
|
58
70
|
tslib_es6.__decorate([
|
|
59
71
|
decorators.property({ type: Object, reflect: true }),
|
|
60
72
|
tslib_es6.__metadata("design:type", Array)
|
|
61
73
|
], exports.HSearchProductContent.prototype, "products", void 0);
|
|
74
|
+
tslib_es6.__decorate([
|
|
75
|
+
decorators.property({ type: Object }),
|
|
76
|
+
tslib_es6.__metadata("design:type", Object)
|
|
77
|
+
], exports.HSearchProductContent.prototype, "settings", void 0);
|
|
62
78
|
tslib_es6.__decorate([
|
|
63
79
|
decorators.property({ type: Object }),
|
|
64
80
|
tslib_es6.__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|