@shoper/phoenix_design_system 1.6.6 → 1.6.7-1
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/components/modal/modal.js +20 -17
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
- 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/components/modal/modal.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.js +20 -17
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +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/esm/packages/phoenix/src/components/search/search.d.ts +0 -15
- package/build/esm/packages/phoenix/src/components/search/search.js +0 -94
- package/build/esm/packages/phoenix/src/components/search/search.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/search/search_history.d.ts +0 -5
- package/build/esm/packages/phoenix/src/components/search/search_history.js +0 -23
- package/build/esm/packages/phoenix/src/components/search/search_history.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/search/search_input.d.ts +0 -7
- package/build/esm/packages/phoenix/src/components/search/search_input.js +0 -39
- package/build/esm/packages/phoenix/src/components/search/search_input.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/search/search_results.d.ts +0 -5
- package/build/esm/packages/phoenix/src/components/search/search_results.js +0 -24
- package/build/esm/packages/phoenix/src/components/search/search_results.js.map +0 -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
|
@@ -4,6 +4,7 @@ export declare const SEARCH_COMPONENT_NAMES: {
|
|
|
4
4
|
readonly searchInput: "h-search-input";
|
|
5
5
|
readonly clearButton: "h-search-clear";
|
|
6
6
|
readonly submitButton: "h-search-submit";
|
|
7
|
+
readonly closeButton: "h-search-close";
|
|
7
8
|
readonly searchResults: "h-search-results";
|
|
8
9
|
readonly searchHistory: "h-search-history";
|
|
9
10
|
readonly searchMessage: "h-search-message";
|
|
@@ -19,8 +20,10 @@ export declare const SEARCH_CUSTOM_EVENT_NAMES: {
|
|
|
19
20
|
readonly searchPhraseSubmitted: "search.searchPhraseSubmitted";
|
|
20
21
|
readonly removeHistoryItem: "search.removeHistoryItem";
|
|
21
22
|
readonly loadMoreHistoryItems: "search.loadMoreHistoryItems";
|
|
23
|
+
readonly loadMoreProducts: "search.loadMoreProducts";
|
|
22
24
|
readonly clear: "search.clearSearchPhrase";
|
|
23
25
|
readonly submit: "search.submitSearchPhrase";
|
|
26
|
+
readonly close: "search.close";
|
|
24
27
|
readonly focusinInput: "search.input.focusin";
|
|
25
28
|
readonly keyupInput: "search.input.keyup";
|
|
26
29
|
readonly searchInput: "search.input.search";
|
|
@@ -29,15 +32,34 @@ export declare const SEARCH_NATIVE_EVENT_NAMES: {
|
|
|
29
32
|
readonly click: "click";
|
|
30
33
|
};
|
|
31
34
|
export declare const SEARCH_CLASS_NAMES: {
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
35
|
+
readonly searchBar: "search__bar";
|
|
36
|
+
readonly container: "search__container";
|
|
37
|
+
readonly icon: "search__icon";
|
|
38
|
+
readonly outline: "search_outline";
|
|
39
|
+
readonly mobileOpened: "search_mobile-opened";
|
|
40
|
+
readonly headline: "search__headline";
|
|
41
|
+
readonly section: "search__section";
|
|
42
|
+
readonly item: "search__item";
|
|
43
|
+
readonly itemHoverable: "search__item_hoverable";
|
|
44
|
+
readonly link: "search__link";
|
|
45
|
+
readonly linkWithImage: "search__link_with-image";
|
|
46
|
+
readonly categoryTitle: "search__category-title";
|
|
47
|
+
readonly productIconFilled: "search__product-icon-filled";
|
|
48
|
+
readonly productIconEmpty: "search__product-icon-empty";
|
|
49
|
+
readonly productButton: "search__product-button";
|
|
50
|
+
readonly productText: "search__product-text";
|
|
51
|
+
readonly productPriceInfo: "search__product-price-info";
|
|
52
|
+
readonly productPriceBasic: "search__product-price_basic";
|
|
53
|
+
readonly productPricePromotion: "search__product-price_promotion";
|
|
54
|
+
readonly starScore: "star-score";
|
|
55
|
+
readonly historyItemValue: "search__history-item-value";
|
|
56
|
+
readonly historyRemoveIcon: "search__history-remove-icon";
|
|
57
|
+
readonly historyLoadMore: "search__history-load-more";
|
|
58
|
+
readonly historySelect: "search__history-select";
|
|
59
|
+
readonly message: "search__message";
|
|
60
|
+
readonly messageWithHistory: "search__message_with-history";
|
|
61
|
+
readonly messageNoResults: "search__message_no-results";
|
|
62
|
+
readonly messageText: "search__message-text";
|
|
41
63
|
};
|
|
42
64
|
export declare const SEARCH_CONTEXT_NAMES: {
|
|
43
65
|
readonly historyContext: "historyContext";
|
|
@@ -52,5 +74,6 @@ export declare const SEARCH_SLOT_NAMES: {
|
|
|
52
74
|
};
|
|
53
75
|
export declare const SEARCH_CONFIGURATION: {
|
|
54
76
|
readonly historyContentLimit: 3;
|
|
77
|
+
readonly maxCharactersInProductName: 28;
|
|
55
78
|
};
|
|
56
79
|
export declare const EMPTY_SEARCH_RESULTS: TSearchResults;
|
|
@@ -3,6 +3,7 @@ const SEARCH_COMPONENT_NAMES = {
|
|
|
3
3
|
searchInput: 'h-search-input',
|
|
4
4
|
clearButton: 'h-search-clear',
|
|
5
5
|
submitButton: 'h-search-submit',
|
|
6
|
+
closeButton: 'h-search-close',
|
|
6
7
|
searchResults: 'h-search-results',
|
|
7
8
|
searchHistory: 'h-search-history',
|
|
8
9
|
searchMessage: 'h-search-message',
|
|
@@ -18,8 +19,10 @@ const SEARCH_CUSTOM_EVENT_NAMES = {
|
|
|
18
19
|
searchPhraseSubmitted: 'search.searchPhraseSubmitted',
|
|
19
20
|
removeHistoryItem: 'search.removeHistoryItem',
|
|
20
21
|
loadMoreHistoryItems: 'search.loadMoreHistoryItems',
|
|
22
|
+
loadMoreProducts: 'search.loadMoreProducts',
|
|
21
23
|
clear: 'search.clearSearchPhrase',
|
|
22
24
|
submit: 'search.submitSearchPhrase',
|
|
25
|
+
close: 'search.close',
|
|
23
26
|
focusinInput: 'search.input.focusin',
|
|
24
27
|
keyupInput: 'search.input.keyup',
|
|
25
28
|
searchInput: 'search.input.search'
|
|
@@ -27,16 +30,36 @@ const SEARCH_CUSTOM_EVENT_NAMES = {
|
|
|
27
30
|
const SEARCH_NATIVE_EVENT_NAMES = {
|
|
28
31
|
click: 'click'
|
|
29
32
|
};
|
|
33
|
+
const baseSearchCssClass = 'search';
|
|
30
34
|
const SEARCH_CLASS_NAMES = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
searchBar: `${baseSearchCssClass}__bar`,
|
|
36
|
+
container: `${baseSearchCssClass}__container`,
|
|
37
|
+
icon: `${baseSearchCssClass}__icon`,
|
|
38
|
+
outline: `${baseSearchCssClass}_outline`,
|
|
39
|
+
mobileOpened: `${baseSearchCssClass}_mobile-opened`,
|
|
40
|
+
headline: `${baseSearchCssClass}__headline`,
|
|
41
|
+
section: `${baseSearchCssClass}__section`,
|
|
42
|
+
item: `${baseSearchCssClass}__item`,
|
|
43
|
+
itemHoverable: `${baseSearchCssClass}__item_hoverable`,
|
|
44
|
+
link: `${baseSearchCssClass}__link`,
|
|
45
|
+
linkWithImage: `${baseSearchCssClass}__link_with-image`,
|
|
46
|
+
categoryTitle: `${baseSearchCssClass}__category-title`,
|
|
47
|
+
productIconFilled: `${baseSearchCssClass}__product-icon-filled`,
|
|
48
|
+
productIconEmpty: `${baseSearchCssClass}__product-icon-empty`,
|
|
49
|
+
productButton: `${baseSearchCssClass}__product-button`,
|
|
50
|
+
productText: `${baseSearchCssClass}__product-text`,
|
|
51
|
+
productPriceInfo: `${baseSearchCssClass}__product-price-info`,
|
|
52
|
+
productPriceBasic: `${baseSearchCssClass}__product-price_basic`,
|
|
53
|
+
productPricePromotion: `${baseSearchCssClass}__product-price_promotion`,
|
|
54
|
+
starScore: 'star-score',
|
|
55
|
+
historyItemValue: `${baseSearchCssClass}__history-item-value`,
|
|
56
|
+
historyRemoveIcon: `${baseSearchCssClass}__history-remove-icon`,
|
|
57
|
+
historyLoadMore: `${baseSearchCssClass}__history-load-more`,
|
|
58
|
+
historySelect: `${baseSearchCssClass}__history-select`,
|
|
59
|
+
message: `${baseSearchCssClass}__message`,
|
|
60
|
+
messageWithHistory: `${baseSearchCssClass}__message_with-history`,
|
|
61
|
+
messageNoResults: `${baseSearchCssClass}__message_no-results`,
|
|
62
|
+
messageText: `${baseSearchCssClass}__message-text`
|
|
40
63
|
};
|
|
41
64
|
const SEARCH_CONTEXT_NAMES = {
|
|
42
65
|
historyContext: 'historyContext',
|
|
@@ -50,13 +73,15 @@ const SEARCH_SLOT_NAMES = {
|
|
|
50
73
|
clearButton: 'search.clear.button'
|
|
51
74
|
};
|
|
52
75
|
const SEARCH_CONFIGURATION = {
|
|
53
|
-
historyContentLimit: 3
|
|
76
|
+
historyContentLimit: 3,
|
|
77
|
+
maxCharactersInProductName: 28
|
|
54
78
|
};
|
|
55
79
|
const EMPTY_SEARCH_RESULTS = {
|
|
56
80
|
suggestions: [],
|
|
57
81
|
products: [],
|
|
58
82
|
producers: [],
|
|
59
|
-
categories: []
|
|
83
|
+
categories: [],
|
|
84
|
+
productsPagesCount: 0
|
|
60
85
|
};
|
|
61
86
|
|
|
62
87
|
export { EMPTY_SEARCH_RESULTS, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES, SEARCH_CONFIGURATION, SEARCH_CONTEXT_NAMES, SEARCH_CUSTOM_EVENT_NAMES, SEARCH_NATIVE_EVENT_NAMES, SEARCH_PORTAL_DESTINATIONS, SEARCH_SLOT_NAMES };
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -3,16 +3,31 @@ export declare type TSearchResults = {
|
|
|
3
3
|
products: TProduct[];
|
|
4
4
|
producers: TProducer[];
|
|
5
5
|
categories: TCategory[];
|
|
6
|
+
productsPagesCount: number;
|
|
6
7
|
};
|
|
7
8
|
export declare type TCategory = {
|
|
8
9
|
url: string;
|
|
9
10
|
name: string;
|
|
10
11
|
};
|
|
11
12
|
export declare type TProducer = TCategory & {
|
|
12
|
-
|
|
13
|
+
image?: {
|
|
14
|
+
imagePath: string;
|
|
15
|
+
};
|
|
13
16
|
};
|
|
14
17
|
export declare type TProduct = TProducer & {
|
|
15
|
-
|
|
18
|
+
category: TCategory;
|
|
19
|
+
availabilityLabel: string;
|
|
20
|
+
isStock: boolean;
|
|
21
|
+
prices: {
|
|
22
|
+
basic: {
|
|
23
|
+
text: string;
|
|
24
|
+
};
|
|
25
|
+
promotion: {
|
|
26
|
+
text: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
rate: number;
|
|
30
|
+
url: string;
|
|
16
31
|
};
|
|
17
32
|
export declare type TSearchHistoryItem = {
|
|
18
33
|
id: string;
|
|
@@ -34,3 +49,12 @@ export declare type RemoveHistoryItemEvent = CustomEventInit<{
|
|
|
34
49
|
export declare type TSearchHistoryContext = {
|
|
35
50
|
showLoadMore: boolean;
|
|
36
51
|
};
|
|
52
|
+
export declare type TSearchSettings = {
|
|
53
|
+
isSearchSuggestLayerEnabled: boolean;
|
|
54
|
+
isNamesShorteningEnabled: boolean;
|
|
55
|
+
isSearchButtonPinnedOnMobile: boolean;
|
|
56
|
+
isLoadingMoreSearchResultsEnabled: boolean;
|
|
57
|
+
showProductRate: boolean;
|
|
58
|
+
showProductAvailability: boolean;
|
|
59
|
+
showProductPrice: boolean;
|
|
60
|
+
};
|
|
@@ -15,7 +15,8 @@ let HStorefrontSearchMock = class HStorefrontSearchMock extends PhoenixLightLitE
|
|
|
15
15
|
suggestions: [],
|
|
16
16
|
products: [],
|
|
17
17
|
producers: [],
|
|
18
|
-
categories: []
|
|
18
|
+
categories: [],
|
|
19
|
+
productsPagesCount: 0
|
|
19
20
|
},
|
|
20
21
|
history: [],
|
|
21
22
|
searchPhrase: '',
|
|
@@ -43,9 +44,13 @@ let HStorefrontSearchMock = class HStorefrontSearchMock extends PhoenixLightLitE
|
|
|
43
44
|
products: 'Products',
|
|
44
45
|
producers: 'Producers',
|
|
45
46
|
loadMore: 'Load more',
|
|
46
|
-
goToProductsFor: 'Go to products for
|
|
47
|
+
goToProductsFor: 'Go to products for',
|
|
47
48
|
category: 'category',
|
|
48
|
-
searchInStore: 'search in store'
|
|
49
|
+
searchInStore: 'search in store',
|
|
50
|
+
inTheCategory: 'in the category',
|
|
51
|
+
availability: 'Availability',
|
|
52
|
+
priceForTheBaseModel: 'Price for the base model. Variants may have a different price.',
|
|
53
|
+
search: 'Search'
|
|
49
54
|
}
|
|
50
55
|
});
|
|
51
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefront_search_mock.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/search/storefront_search_mock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAuE,kDAAkD,CAAC;AAC1H,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACvH,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAGpC,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,sBAAsB;
|
|
1
|
+
{"version":3,"file":"storefront_search_mock.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/search/storefront_search_mock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6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BAAJ,IAAI,CAAE,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,WAAC,OAAA,IAAI,CAAC,KAAK,MAAK,MAAA,EAAE,CAAC,MAAM,0CAAE,YAAY,CAAA,CAAA,EAAA,CAAC,CAAC;YACvF,oCAAoC;YACpC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;gBAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;oBACd,EAAE,EAAE,MAAM,EAAE;oBACZ,KAAK,EAAE,MAAA,EAAE,CAAC,MAAM,0CAAE,YAAY;iBACjC,CAAC,CAAC;aACN;YAED,WAAW;QACf,CAAC,CAAC,CAAC;QAEH,mHAAmH;QACnH,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,iBAAiB,EAAE,CAAC,EAA0B,EAAE,EAAE;YAC9F,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,WAAC,OAAA,IAAI,CAAC,EAAE,MAAK,MAAA,EAAE,CAAC,MAAM,0CAAE,EAAE,CAAA,CAAA,EAAA,CAAC,CAAC;YAE1E,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;gBACrB,GAAG,IAAI;gBACP,OAAO;aACK,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA3NG;IADC,KAAK,EAAE;8BACc,eAAe;2DAWlC;AAfM,qBAAqB;IADjC,oBAAoB,CAAC,qBAAqB,CAAC;;GAC/B,qBAAqB,CA+NjC;SA/NY,qBAAqB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HSearchClose extends PhoenixLightLitElement {
|
|
3
|
+
private _btnController;
|
|
4
|
+
constructor();
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
private _dispatchCloseEvent;
|
|
7
|
+
}
|
package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_close.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { PhoenixLightLitElement } from '../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
3
|
+
import { phoenixCustomElement } from '../../../../../core/decorators/phoenix_custom_element.js';
|
|
4
|
+
import { BtnController } from '../../../../../controllers/btn_controller/btn_controller.js';
|
|
5
|
+
import { SEARCH_NATIVE_EVENT_NAMES, SEARCH_CUSTOM_EVENT_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
6
|
+
|
|
7
|
+
let HSearchClose = class HSearchClose extends PhoenixLightLitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this._btnController = new BtnController(this, this._dispatchCloseEvent);
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
super.connectedCallback();
|
|
14
|
+
this.addEventListener(SEARCH_NATIVE_EVENT_NAMES.click, this._dispatchCloseEvent);
|
|
15
|
+
}
|
|
16
|
+
_dispatchCloseEvent() {
|
|
17
|
+
this.dispatchEvent(new CustomEvent(SEARCH_CUSTOM_EVENT_NAMES.close, {
|
|
18
|
+
bubbles: true
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
HSearchClose = __decorate([
|
|
23
|
+
phoenixCustomElement(SEARCH_COMPONENT_NAMES.closeButton),
|
|
24
|
+
__metadata("design:paramtypes", [])
|
|
25
|
+
], HSearchClose);
|
|
26
|
+
|
|
27
|
+
export { HSearchClose };
|
|
28
|
+
//# sourceMappingURL=search_close.js.map
|
|
@@ -0,0 +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;"}
|
|
@@ -6,7 +6,7 @@ import { phoenixCustomElement } from '../../../../../core/decorators/phoenix_cus
|
|
|
6
6
|
import { Observer } from '../../../../../core/classes/observer/observer.js';
|
|
7
7
|
import { ContextConsumerController } from '../../../../../core/context/context_consumer_controller.js';
|
|
8
8
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
9
|
-
import { SEARCH_CONTEXT_NAMES, SEARCH_CLASS_NAMES,
|
|
9
|
+
import { SEARCH_CONTEXT_NAMES, SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
10
10
|
import { when } from 'lit/directives/when';
|
|
11
11
|
import { repeat as c } from '../../../../../../../../external/lit/external/lit-html/directives/repeat.js';
|
|
12
12
|
|
|
@@ -25,6 +25,8 @@ let HSearchHistory = class HSearchHistory extends PhoenixLightLitElement {
|
|
|
25
25
|
this._historyContextObserver = new Observer((searchHistory) => {
|
|
26
26
|
this.requestUpdate();
|
|
27
27
|
const button = this.buttonRef.value;
|
|
28
|
+
if (!button)
|
|
29
|
+
return;
|
|
28
30
|
searchHistory.showLoadMore ? button.show() : button.hide();
|
|
29
31
|
});
|
|
30
32
|
this._historyContext$.subscribe(this._historyContextObserver);
|
|
@@ -35,29 +37,30 @@ let HSearchHistory = class HSearchHistory extends PhoenixLightLitElement {
|
|
|
35
37
|
}
|
|
36
38
|
render() {
|
|
37
39
|
var _a;
|
|
38
|
-
return when((_a = this.history) === null || _a === void 0 ? void 0 : _a.length, () => html `<
|
|
39
|
-
<h-portal to="${SEARCH_PORTAL_DESTINATIONS.historyContent}" hidden>
|
|
40
|
-
<h3 class="${SEARCH_CLASS_NAMES.historyContainerHeadline}">${this.translations.searchHistory}</h3>
|
|
41
|
-
<ul class="${SEARCH_CLASS_NAMES.historyContainerList}">
|
|
42
|
-
${c(this.history, (historyElement) => html `<li class="${SEARCH_CLASS_NAMES.historyContainerItem}">
|
|
43
|
-
<h-search-history-select item-label="${historyElement.label}">
|
|
44
|
-
<span class="search__icon_main-color search__list-icon icon icon-reload"></span>
|
|
45
|
-
<span class="search__history-item-value">${historyElement.label}</span>
|
|
46
|
-
</h-search-history-select>
|
|
47
|
-
<h-search-history-remove item-id="${historyElement.id}">X</h-search-history-remove>
|
|
48
|
-
</li>`)}
|
|
49
|
-
</ul>
|
|
50
|
-
<h-search-history-load-more class="${SEARCH_CLASS_NAMES.historyContainerLoadMore}" ${ref(this.buttonRef)}
|
|
51
|
-
>${this.translations.loadMore}</h-search-history-load-more
|
|
52
|
-
>
|
|
53
|
-
</h-portal>
|
|
40
|
+
return when((_a = this.history) === null || _a === void 0 ? void 0 : _a.length, () => html `<h3 class="${SEARCH_CLASS_NAMES.headline}">${this.translations.searchHistory}</h3>
|
|
54
41
|
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
<ul>
|
|
43
|
+
${c(this.history, (historyElement) => html ` <li class="${SEARCH_CLASS_NAMES.item}">
|
|
44
|
+
<h-search-history-select item-label="${historyElement.label}" class="${SEARCH_CLASS_NAMES.historySelect}">
|
|
45
|
+
<h-icon icon-name="icon-clock"></h-icon>
|
|
46
|
+
|
|
47
|
+
<span class="${SEARCH_CLASS_NAMES.historyItemValue}">${historyElement.label}</span>
|
|
48
|
+
</h-search-history-select>
|
|
49
|
+
|
|
50
|
+
<h-search-history-remove item-id="${historyElement.id}">
|
|
51
|
+
<h-icon
|
|
52
|
+
icon-name="icon-x"
|
|
53
|
+
clickable=${true}
|
|
54
|
+
size="l"
|
|
55
|
+
css-classes="${SEARCH_CLASS_NAMES.historyRemoveIcon}"
|
|
56
|
+
></h-icon>
|
|
57
|
+
</h-search-history-remove>
|
|
58
|
+
</li>`)}
|
|
59
|
+
</ul>
|
|
60
|
+
|
|
61
|
+
<h-search-history-load-more class="${SEARCH_CLASS_NAMES.historyLoadMore}" ${ref(this.buttonRef)}>
|
|
62
|
+
${this.translations.loadMore}
|
|
63
|
+
</h-search-history-load-more>`);
|
|
61
64
|
}
|
|
62
65
|
};
|
|
63
66
|
__decorate([
|
|
@@ -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,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;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;"}
|
|
@@ -3,7 +3,7 @@ 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 { SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
6
|
+
import { SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
7
7
|
import { when } from 'lit/directives/when';
|
|
8
8
|
import isEqual_1 from '../../../../../../../../external/lodash/isEqual.js';
|
|
9
9
|
|
|
@@ -19,7 +19,8 @@ let HSearchMessage = class HSearchMessage extends PhoenixLightLitElement {
|
|
|
19
19
|
suggestions: [],
|
|
20
20
|
products: [],
|
|
21
21
|
producers: [],
|
|
22
|
-
categories: []
|
|
22
|
+
categories: [],
|
|
23
|
+
productsPagesCount: 0
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
_isNoResultsForSearchPhrase() {
|
|
@@ -32,8 +33,14 @@ let HSearchMessage = class HSearchMessage extends PhoenixLightLitElement {
|
|
|
32
33
|
return this.searchPhrase === '' && this.history.length === 0;
|
|
33
34
|
}
|
|
34
35
|
render() {
|
|
35
|
-
return html `
|
|
36
|
-
|
|
36
|
+
return html `
|
|
37
|
+
${when(this._isNoResultsForSearchPhrase(), () => html `<p class="${SEARCH_CLASS_NAMES.messageNoResults}">
|
|
38
|
+
${this.searchPhrase} - <a class="${SEARCH_CLASS_NAMES.messageText}">${this.translations.searchInStore}</a>
|
|
39
|
+
</p>`, () => html `${when(this._hasHistoryAndEmptyPhrase(), () => html `<p class="${SEARCH_CLASS_NAMES.message} ${SEARCH_CLASS_NAMES.messageWithHistory}">
|
|
40
|
+
${this.translations.enterSearchPraseOrChooseFromHistory}
|
|
41
|
+
</p>`)}
|
|
42
|
+
${when(this._hasNoHistoryAndEmptyPhrase(), () => html `<p class="${SEARCH_CLASS_NAMES.message}">${this.translations.enterSearchPrase}</p>`)} `)}
|
|
43
|
+
`;
|
|
37
44
|
}
|
|
38
45
|
};
|
|
39
46
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;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;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;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;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ 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
6
|
import { when as n } from '../../../../../../../../external/lit/external/lit-html/directives/when.js';
|
|
7
|
-
import { SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
7
|
+
import { SEARCH_CLASS_NAMES, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
8
8
|
import { repeat as c } from '../../../../../../../../external/lit/external/lit-html/directives/repeat.js';
|
|
9
9
|
|
|
10
10
|
let HSearchProducerContent = class HSearchProducerContent extends PhoenixLightLitElement {
|
|
@@ -13,25 +13,25 @@ let HSearchProducerContent = class HSearchProducerContent extends PhoenixLightLi
|
|
|
13
13
|
this.translations = {};
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
return html `
|
|
17
|
+
<h3 class="${SEARCH_CLASS_NAMES.headline}">${this.translations.producers}</h3>
|
|
18
|
+
|
|
19
|
+
<ul>
|
|
20
|
+
${c(this.producers, (producer) => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
return html `<li class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable}">
|
|
23
|
+
<a
|
|
24
|
+
href="${producer.url}"
|
|
25
|
+
class="${((_a = producer.image) === null || _a === void 0 ? void 0 : _a.imagePath) ? SEARCH_CLASS_NAMES.linkWithImage : SEARCH_CLASS_NAMES.link}"
|
|
26
|
+
>
|
|
27
|
+
${n((_b = producer.image) === null || _b === void 0 ? void 0 : _b.imagePath, () => { var _a; return html `<img src="${(_a = producer.image) === null || _a === void 0 ? void 0 : _a.imagePath}" alt="${producer.name}" />`; })}
|
|
28
|
+
|
|
29
|
+
<span>${producer.name}</span>
|
|
30
|
+
</a>
|
|
31
|
+
</li>`;
|
|
32
|
+
})}
|
|
33
|
+
</ul>
|
|
34
|
+
`;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
__decorate([
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
|
-
import { TProduct } from "../../search_types";
|
|
3
|
+
import type { TProduct, TSearchSettings } from "../../search_types";
|
|
4
4
|
export declare class HSearchProductContent extends PhoenixLightLitElement {
|
|
5
5
|
products: TProduct[];
|
|
6
|
+
settings: TSearchSettings;
|
|
6
7
|
translations: Record<string, string>;
|
|
7
|
-
|
|
8
|
+
getProductRateHtml: (productRate: number) => TemplateResult;
|
|
9
|
+
private _getShortenProductName;
|
|
8
10
|
protected render(): TemplateResult;
|
|
9
11
|
}
|
|
@@ -4,57 +4,73 @@ 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
6
|
import { when as n } from '../../../../../../../../external/lit/external/lit-html/directives/when.js';
|
|
7
|
-
import {
|
|
7
|
+
import { SEARCH_CLASS_NAMES, SEARCH_CONFIGURATION, SEARCH_COMPONENT_NAMES } from '../../search_constants.js';
|
|
8
8
|
import { repeat as c } from '../../../../../../../../external/lit/external/lit-html/directives/repeat.js';
|
|
9
9
|
|
|
10
10
|
let HSearchProductContent = class HSearchProductContent extends PhoenixLightLitElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.translations = {};
|
|
14
|
+
this.getProductRateHtml = (productRate) => {
|
|
15
|
+
return html `
|
|
16
|
+
<div class="${SEARCH_CLASS_NAMES.starScore}">
|
|
17
|
+
${[1, 2, 3, 4, 5].map((score) => html ` <h-icon
|
|
18
|
+
icon-name="icon-star"
|
|
19
|
+
css-classes=${productRate >= score ? SEARCH_CLASS_NAMES.productIconFilled : SEARCH_CLASS_NAMES.productIconEmpty}
|
|
20
|
+
noStroke=${true}
|
|
21
|
+
></h-icon>`)}
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
14
25
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
bubbles: true,
|
|
18
|
-
detail: {
|
|
19
|
-
searchPhrase: ev.target.textContent
|
|
20
|
-
}
|
|
21
|
-
}));
|
|
26
|
+
_getShortenProductName(productName) {
|
|
27
|
+
return productName.substring(0, SEARCH_CONFIGURATION.maxCharactersInProductName) + '...';
|
|
22
28
|
}
|
|
23
29
|
render() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<h3 class="search__section-head search__section-head_sticky search__section-head_line">${this.translations.products}</h3>
|
|
30
|
+
return html `
|
|
31
|
+
<h3 class="${SEARCH_CLASS_NAMES.headline}">${this.translations.products}</h3>
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</div>
|
|
38
|
-
<div class="search__result-note">
|
|
39
|
-
<span class="search__result-note-item search__result-item_active">${product.price}</span>
|
|
40
|
-
</div>
|
|
41
|
-
</div></a
|
|
42
|
-
>
|
|
43
|
-
</li>`)}
|
|
44
|
-
</ul>
|
|
33
|
+
<ul>
|
|
34
|
+
${c(this.products, (product) => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
return html ` <li class="${SEARCH_CLASS_NAMES.item} ${SEARCH_CLASS_NAMES.itemHoverable}">
|
|
37
|
+
<a
|
|
38
|
+
href="${product.url}"
|
|
39
|
+
class="${((_a = product.image) === null || _a === void 0 ? void 0 : _a.imagePath) ? SEARCH_CLASS_NAMES.linkWithImage : SEARCH_CLASS_NAMES.link}"
|
|
40
|
+
>
|
|
41
|
+
${n((_b = product.image) === null || _b === void 0 ? void 0 : _b.imagePath, () => { var _a; return html `<img src="${(_a = product.image) === null || _a === void 0 ? void 0 : _a.imagePath}" alt="${product.name}" />`; })}
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
<div>
|
|
44
|
+
${n(this.settings.showProductRate, () => this.getProductRateHtml(product.rate))}
|
|
45
|
+
|
|
46
|
+
<div>${this.settings.isNamesShorteningEnabled ? this._getShortenProductName(product.name) : product.name}</div>
|
|
47
|
+
|
|
48
|
+
${n(this.settings.showProductPrice, () => html ` ${n(product.prices.promotion.text.length, () => html `<div>
|
|
49
|
+
<span class="${SEARCH_CLASS_NAMES.productPricePromotion}">${product.prices.promotion.text}</span>
|
|
50
|
+
<span class="${SEARCH_CLASS_NAMES.productPriceBasic}">${product.prices.basic.text}</span>
|
|
51
|
+
</div>`, () => html `<div class="${SEARCH_CLASS_NAMES.productText}">${product.prices.basic.text}</div>`)}
|
|
52
|
+
${n(product.isStock, () => html `<div class="${SEARCH_CLASS_NAMES.productPriceInfo}">
|
|
53
|
+
${this.translations.priceForTheBaseModel}
|
|
54
|
+
</div>`)}`)}
|
|
55
|
+
${n(this.settings.showProductAvailability, () => html `<div>
|
|
56
|
+
${this.translations.availability}: <span class="${SEARCH_CLASS_NAMES.productText}">${product.availabilityLabel}<span>
|
|
57
|
+
</div>`)}
|
|
58
|
+
</div>
|
|
59
|
+
</a>
|
|
60
|
+
</li>`;
|
|
61
|
+
})}
|
|
62
|
+
</ul>
|
|
63
|
+
`;
|
|
52
64
|
}
|
|
53
65
|
};
|
|
54
66
|
__decorate([
|
|
55
67
|
property({ type: Object, reflect: true }),
|
|
56
68
|
__metadata("design:type", Array)
|
|
57
69
|
], HSearchProductContent.prototype, "products", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
property({ type: Object }),
|
|
72
|
+
__metadata("design:type", Object)
|
|
73
|
+
], HSearchProductContent.prototype, "settings", void 0);
|
|
58
74
|
__decorate([
|
|
59
75
|
property({ type: Object }),
|
|
60
76
|
__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;"}
|
|
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;"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
|
-
import type { TSearchResults } from "../../search_types";
|
|
3
|
+
import type { TSearchResults, TSearchSettings } from "../../search_types";
|
|
4
4
|
export declare class HSearchResults extends PhoenixLightLitElement {
|
|
5
5
|
results: TSearchResults;
|
|
6
|
+
searchPhrase: string;
|
|
7
|
+
settings: TSearchSettings;
|
|
6
8
|
translations: Record<string, string>;
|
|
7
|
-
private
|
|
9
|
+
private _productPage;
|
|
10
|
+
private _areSearchResultsNotEmpty;
|
|
11
|
+
private _areMoreProductsAvailable;
|
|
12
|
+
private _getSearchPhrase;
|
|
13
|
+
handleGoToProductsFor(): void;
|
|
14
|
+
handleLoadMoreProducts(ev: Event): void;
|
|
8
15
|
protected render(): TemplateResult;
|
|
9
16
|
}
|