@coveo/atomic 3.61.5 → 3.63.0
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/custom-elements.json +189 -20
- package/dist/cjs/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.cjs +19 -7
- package/dist/cjs/components/commerce/atomic-commerce-interface/atomic-commerce-interface.cjs +25 -4
- package/dist/cjs/components/commerce/atomic-commerce-pager/atomic-commerce-pager.cjs +3 -2
- package/dist/cjs/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.cjs +1 -1
- package/dist/cjs/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.cjs +25 -4
- package/dist/cjs/components/common/facets/category-facet/active-value.cjs +69 -0
- package/dist/cjs/components/common/facets/category-facet/selected-value.cjs +78 -0
- package/dist/cjs/components/common/facets/category-facet/value-link.cjs +5 -6
- package/dist/cjs/components/common/interface/i18n.cjs +6 -2
- package/dist/cjs/components/common/interface/interface-controller.cjs +8 -4
- package/dist/cjs/components/common/pager/pager-fit-controller.cjs +72 -0
- package/dist/cjs/components/insight/atomic-insight-pager/atomic-insight-pager.cjs +3 -2
- package/dist/cjs/components/search/atomic-category-facet/atomic-category-facet.cjs +19 -8
- package/dist/cjs/components/search/atomic-pager/atomic-pager.cjs +3 -2
- package/dist/cjs/components/search/atomic-result-date/atomic-result-date.cjs +11 -16
- package/dist/cjs/components/search/atomic-results-per-page/atomic-results-per-page.cjs +1 -1
- package/dist/cjs/generated/dayjs-locales-data.cjs +43 -43
- package/dist/cjs/global/environment.cjs +1 -1
- package/dist/cjs/utils/dayjs-locales.cjs +23 -9
- package/dist/cjs/utils/field-utils.cjs +5 -1
- package/dist/cjs/{components/common/facets/category-facet/parent-value-link.cjs → utils/locale-utils.cjs} +14 -11
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.js +19 -7
- package/dist/esm/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +25 -4
- package/dist/esm/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js +3 -2
- package/dist/esm/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.js +1 -1
- package/dist/esm/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.js +25 -4
- package/dist/esm/components/common/facets/category-facet/active-value.js +31 -0
- package/dist/esm/components/common/facets/category-facet/selected-value.js +30 -0
- package/dist/esm/components/common/facets/category-facet/value-link.js +5 -6
- package/dist/esm/components/common/interface/i18n.js +6 -2
- package/dist/esm/components/common/interface/interface-controller.js +8 -4
- package/dist/esm/components/common/pager/pager-fit-controller.js +34 -0
- package/dist/esm/components/insight/atomic-insight-pager/atomic-insight-pager.js +3 -2
- package/dist/esm/components/search/atomic-category-facet/atomic-category-facet.js +19 -8
- package/dist/esm/components/search/atomic-pager/atomic-pager.js +3 -2
- package/dist/esm/components/search/atomic-result-date/atomic-result-date.js +10 -15
- package/dist/esm/components/search/atomic-results-per-page/atomic-results-per-page.js +1 -1
- package/dist/esm/generated/dayjs-locales-data.js +43 -43
- package/dist/esm/global/environment.js +1 -1
- package/dist/esm/utils/dayjs-locales.js +23 -9
- package/dist/esm/utils/field-utils.js +5 -1
- package/dist/esm/utils/locale-utils.js +12 -0
- package/dist/esm/versions.js +1 -1
- package/dist/lang/cs.json +1 -1
- package/dist/lang/da.json +1 -1
- package/dist/lang/de.json +1 -1
- package/dist/lang/el.json +1 -1
- package/dist/lang/es.json +1 -1
- package/dist/lang/fi.json +1 -1
- package/dist/lang/hu.json +1 -1
- package/dist/lang/id.json +1 -1
- package/dist/lang/it.json +1 -1
- package/dist/lang/ja.json +1 -1
- package/dist/lang/ko.json +1 -1
- package/dist/lang/nl.json +1 -1
- package/dist/lang/no.json +1 -1
- package/dist/lang/pl.json +1 -1
- package/dist/lang/pt-BR.json +1 -1
- package/dist/lang/pt.json +1 -1
- package/dist/lang/ru.json +1 -1
- package/dist/lang/sv.json +1 -1
- package/dist/lang/th.json +1 -1
- package/dist/lang/tr.json +1 -1
- package/dist/lang/zh-CN.json +1 -1
- package/dist/lang/zh-TW.json +1 -1
- package/dist/lang/zh.json +1 -1
- package/dist/types/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.d.ts +7 -1
- package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +17 -0
- package/dist/types/components/commerce/atomic-commerce-pager/atomic-commerce-pager.d.ts +1 -0
- package/dist/types/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.d.ts +13 -0
- package/dist/types/components/common/facets/category-facet/active-value.d.ts +19 -0
- package/dist/types/components/common/facets/category-facet/selected-value.d.ts +22 -0
- package/dist/types/components/common/facets/category-facet/value-link.d.ts +0 -1
- package/dist/types/components/common/interface/i18n.d.ts +9 -5
- package/dist/types/components/common/pager/pager-fit-controller.d.ts +21 -0
- package/dist/types/components/common/suggestions/suggestion-manager.d.ts +1 -1
- package/dist/types/components/common/suggestions/suggestions-types.d.ts +1 -1
- package/dist/types/components/insight/atomic-insight-interface/atomic-insight-interface.d.ts +4 -0
- package/dist/types/components/insight/atomic-insight-pager/atomic-insight-pager.d.ts +1 -0
- package/dist/types/components/recommendations/atomic-recs-interface/atomic-recs-interface.d.ts +4 -0
- package/dist/types/components/search/atomic-category-facet/atomic-category-facet.d.ts +8 -2
- package/dist/types/components/search/atomic-pager/atomic-pager.d.ts +1 -0
- package/dist/types/components/search/atomic-result-date/atomic-result-date.d.ts +3 -0
- package/dist/types/components/search/atomic-search-interface/atomic-search-interface.d.ts +4 -0
- package/dist/types/utils/dayjs-locales.d.ts +1 -1
- package/dist/types/utils/field-utils.d.ts +1 -1
- package/dist/types/utils/locale-utils.d.ts +7 -0
- package/package.json +4 -4
- package/dist/esm/components/common/facets/category-facet/parent-value-link.js +0 -9
- package/dist/types/components/common/facets/category-facet/parent-value-link.d.ts +0 -6
|
@@ -30,20 +30,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30
30
|
const locales = {
|
|
31
31
|
af: ()=>import("dayjs/locale/af"),
|
|
32
32
|
am: ()=>import("dayjs/locale/am"),
|
|
33
|
-
'ar-
|
|
34
|
-
'ar-
|
|
35
|
-
'ar-
|
|
36
|
-
'ar-
|
|
37
|
-
'ar-
|
|
38
|
-
'ar-
|
|
39
|
-
'ar-
|
|
33
|
+
'ar-iq': ()=>import("dayjs/locale/ar-iq"),
|
|
34
|
+
'ar-dz': ()=>import("dayjs/locale/ar-dz"),
|
|
35
|
+
'ar-kw': ()=>import("dayjs/locale/ar-kw"),
|
|
36
|
+
'ar-ly': ()=>import("dayjs/locale/ar-ly"),
|
|
37
|
+
'ar-ma': ()=>import("dayjs/locale/ar-ma"),
|
|
38
|
+
'ar-sa': ()=>import("dayjs/locale/ar-sa"),
|
|
39
|
+
'ar-tn': ()=>import("dayjs/locale/ar-tn"),
|
|
40
40
|
ar: ()=>import("dayjs/locale/ar"),
|
|
41
41
|
az: ()=>import("dayjs/locale/az"),
|
|
42
42
|
be: ()=>import("dayjs/locale/be"),
|
|
43
43
|
bg: ()=>import("dayjs/locale/bg"),
|
|
44
44
|
bi: ()=>import("dayjs/locale/bi"),
|
|
45
45
|
bm: ()=>import("dayjs/locale/bm"),
|
|
46
|
-
'bn-
|
|
46
|
+
'bn-bd': ()=>import("dayjs/locale/bn-bd"),
|
|
47
47
|
bn: ()=>import("dayjs/locale/bn"),
|
|
48
48
|
bo: ()=>import("dayjs/locale/bo"),
|
|
49
49
|
br: ()=>import("dayjs/locale/br"),
|
|
@@ -53,49 +53,49 @@ const locales = {
|
|
|
53
53
|
cv: ()=>import("dayjs/locale/cv"),
|
|
54
54
|
cy: ()=>import("dayjs/locale/cy"),
|
|
55
55
|
da: ()=>import("dayjs/locale/da"),
|
|
56
|
-
'de-
|
|
57
|
-
'de-
|
|
56
|
+
'de-at': ()=>import("dayjs/locale/de-at"),
|
|
57
|
+
'de-ch': ()=>import("dayjs/locale/de-ch"),
|
|
58
58
|
de: ()=>import("dayjs/locale/de"),
|
|
59
59
|
dv: ()=>import("dayjs/locale/dv"),
|
|
60
|
-
'en-
|
|
60
|
+
'en-au': ()=>import("dayjs/locale/en-au"),
|
|
61
61
|
el: ()=>import("dayjs/locale/el"),
|
|
62
|
-
'en-
|
|
63
|
-
'en-
|
|
64
|
-
'en-
|
|
65
|
-
'en-
|
|
66
|
-
'en-
|
|
67
|
-
'en-
|
|
68
|
-
'en-
|
|
69
|
-
'en-
|
|
62
|
+
'en-gb': ()=>import("dayjs/locale/en-gb"),
|
|
63
|
+
'en-ie': ()=>import("dayjs/locale/en-ie"),
|
|
64
|
+
'en-il': ()=>import("dayjs/locale/en-il"),
|
|
65
|
+
'en-in': ()=>import("dayjs/locale/en-in"),
|
|
66
|
+
'en-nz': ()=>import("dayjs/locale/en-nz"),
|
|
67
|
+
'en-sg': ()=>import("dayjs/locale/en-sg"),
|
|
68
|
+
'en-tt': ()=>import("dayjs/locale/en-tt"),
|
|
69
|
+
'en-ca': ()=>import("dayjs/locale/en-ca"),
|
|
70
70
|
en: ()=>import("dayjs/locale/en"),
|
|
71
71
|
eo: ()=>import("dayjs/locale/eo"),
|
|
72
|
-
'es-
|
|
73
|
-
'es-
|
|
74
|
-
'es-
|
|
75
|
-
'es-
|
|
72
|
+
'es-mx': ()=>import("dayjs/locale/es-mx"),
|
|
73
|
+
'es-pr': ()=>import("dayjs/locale/es-pr"),
|
|
74
|
+
'es-us': ()=>import("dayjs/locale/es-us"),
|
|
75
|
+
'es-do': ()=>import("dayjs/locale/es-do"),
|
|
76
76
|
et: ()=>import("dayjs/locale/et"),
|
|
77
77
|
eu: ()=>import("dayjs/locale/eu"),
|
|
78
78
|
fa: ()=>import("dayjs/locale/fa"),
|
|
79
79
|
fi: ()=>import("dayjs/locale/fi"),
|
|
80
|
-
'fr-
|
|
81
|
-
'fr-
|
|
80
|
+
'fr-ca': ()=>import("dayjs/locale/fr-ca"),
|
|
81
|
+
'fr-ch': ()=>import("dayjs/locale/fr-ch"),
|
|
82
82
|
fr: ()=>import("dayjs/locale/fr"),
|
|
83
83
|
fo: ()=>import("dayjs/locale/fo"),
|
|
84
84
|
fy: ()=>import("dayjs/locale/fy"),
|
|
85
85
|
ga: ()=>import("dayjs/locale/ga"),
|
|
86
86
|
gd: ()=>import("dayjs/locale/gd"),
|
|
87
87
|
gl: ()=>import("dayjs/locale/gl"),
|
|
88
|
-
'gom-
|
|
88
|
+
'gom-latn': ()=>import("dayjs/locale/gom-latn"),
|
|
89
89
|
gu: ()=>import("dayjs/locale/gu"),
|
|
90
90
|
he: ()=>import("dayjs/locale/he"),
|
|
91
91
|
hi: ()=>import("dayjs/locale/hi"),
|
|
92
92
|
hr: ()=>import("dayjs/locale/hr"),
|
|
93
93
|
ht: ()=>import("dayjs/locale/ht"),
|
|
94
94
|
hu: ()=>import("dayjs/locale/hu"),
|
|
95
|
-
'hy-
|
|
95
|
+
'hy-am': ()=>import("dayjs/locale/hy-am"),
|
|
96
96
|
id: ()=>import("dayjs/locale/id"),
|
|
97
97
|
is: ()=>import("dayjs/locale/is"),
|
|
98
|
-
'it-
|
|
98
|
+
'it-ch': ()=>import("dayjs/locale/it-ch"),
|
|
99
99
|
it: ()=>import("dayjs/locale/it"),
|
|
100
100
|
jv: ()=>import("dayjs/locale/jv"),
|
|
101
101
|
ka: ()=>import("dayjs/locale/ka"),
|
|
@@ -115,7 +115,7 @@ const locales = {
|
|
|
115
115
|
ml: ()=>import("dayjs/locale/ml"),
|
|
116
116
|
mn: ()=>import("dayjs/locale/mn"),
|
|
117
117
|
mr: ()=>import("dayjs/locale/mr"),
|
|
118
|
-
'ms-
|
|
118
|
+
'ms-my': ()=>import("dayjs/locale/ms-my"),
|
|
119
119
|
ms: ()=>import("dayjs/locale/ms"),
|
|
120
120
|
mt: ()=>import("dayjs/locale/mt"),
|
|
121
121
|
lo: ()=>import("dayjs/locale/lo"),
|
|
@@ -123,11 +123,11 @@ const locales = {
|
|
|
123
123
|
nb: ()=>import("dayjs/locale/nb"),
|
|
124
124
|
ne: ()=>import("dayjs/locale/ne"),
|
|
125
125
|
nl: ()=>import("dayjs/locale/nl"),
|
|
126
|
-
'nl-
|
|
126
|
+
'nl-be': ()=>import("dayjs/locale/nl-be"),
|
|
127
127
|
nn: ()=>import("dayjs/locale/nn"),
|
|
128
|
-
'pa-
|
|
128
|
+
'pa-in': ()=>import("dayjs/locale/pa-in"),
|
|
129
129
|
pl: ()=>import("dayjs/locale/pl"),
|
|
130
|
-
'pt-
|
|
130
|
+
'pt-br': ()=>import("dayjs/locale/pt-br"),
|
|
131
131
|
pt: ()=>import("dayjs/locale/pt"),
|
|
132
132
|
rn: ()=>import("dayjs/locale/rn"),
|
|
133
133
|
ro: ()=>import("dayjs/locale/ro"),
|
|
@@ -139,12 +139,12 @@ const locales = {
|
|
|
139
139
|
si: ()=>import("dayjs/locale/si"),
|
|
140
140
|
sk: ()=>import("dayjs/locale/sk"),
|
|
141
141
|
sl: ()=>import("dayjs/locale/sl"),
|
|
142
|
-
'oc-
|
|
142
|
+
'oc-lnc': ()=>import("dayjs/locale/oc-lnc"),
|
|
143
143
|
sq: ()=>import("dayjs/locale/sq"),
|
|
144
|
-
'sr-
|
|
144
|
+
'sr-cyrl': ()=>import("dayjs/locale/sr-cyrl"),
|
|
145
145
|
sr: ()=>import("dayjs/locale/sr"),
|
|
146
146
|
ss: ()=>import("dayjs/locale/ss"),
|
|
147
|
-
'sv-
|
|
147
|
+
'sv-fi': ()=>import("dayjs/locale/sv-fi"),
|
|
148
148
|
sv: ()=>import("dayjs/locale/sv"),
|
|
149
149
|
sw: ()=>import("dayjs/locale/sw"),
|
|
150
150
|
ta: ()=>import("dayjs/locale/ta"),
|
|
@@ -152,24 +152,24 @@ const locales = {
|
|
|
152
152
|
tet: ()=>import("dayjs/locale/tet"),
|
|
153
153
|
tg: ()=>import("dayjs/locale/tg"),
|
|
154
154
|
th: ()=>import("dayjs/locale/th"),
|
|
155
|
-
'tl-
|
|
155
|
+
'tl-ph': ()=>import("dayjs/locale/tl-ph"),
|
|
156
156
|
tlh: ()=>import("dayjs/locale/tlh"),
|
|
157
157
|
tr: ()=>import("dayjs/locale/tr"),
|
|
158
158
|
tzl: ()=>import("dayjs/locale/tzl"),
|
|
159
159
|
tzm: ()=>import("dayjs/locale/tzm"),
|
|
160
|
-
'ug-
|
|
160
|
+
'ug-cn': ()=>import("dayjs/locale/ug-cn"),
|
|
161
161
|
uk: ()=>import("dayjs/locale/uk"),
|
|
162
162
|
tk: ()=>import("dayjs/locale/tk"),
|
|
163
163
|
ur: ()=>import("dayjs/locale/ur"),
|
|
164
|
-
'uz-
|
|
164
|
+
'uz-latn': ()=>import("dayjs/locale/uz-latn"),
|
|
165
165
|
uz: ()=>import("dayjs/locale/uz"),
|
|
166
166
|
vi: ()=>import("dayjs/locale/vi"),
|
|
167
|
-
'x-
|
|
168
|
-
'tzm-
|
|
167
|
+
'x-pseudo': ()=>import("dayjs/locale/x-pseudo"),
|
|
168
|
+
'tzm-latn': ()=>import("dayjs/locale/tzm-latn"),
|
|
169
169
|
yo: ()=>import("dayjs/locale/yo"),
|
|
170
|
-
'zh-
|
|
171
|
-
'zh-
|
|
172
|
-
'zh-
|
|
170
|
+
'zh-cn': ()=>import("dayjs/locale/zh-cn"),
|
|
171
|
+
'zh-hk': ()=>import("dayjs/locale/zh-hk"),
|
|
172
|
+
'zh-tw': ()=>import("dayjs/locale/zh-tw"),
|
|
173
173
|
zh: ()=>import("dayjs/locale/zh")
|
|
174
174
|
};
|
|
175
175
|
__webpack_require__.d(__webpack_exports__, {}, {
|
|
@@ -43,20 +43,34 @@ const external_dayjs_namespaceObject = require("dayjs");
|
|
|
43
43
|
var external_dayjs_default = /*#__PURE__*/ __webpack_require__.n(external_dayjs_namespaceObject);
|
|
44
44
|
const dayjs_locales_data_cjs_namespaceObject = require("../generated/dayjs-locales-data.cjs");
|
|
45
45
|
const warn = (language)=>console.warn(`Cannot load dayjs locale file for "${language}"`);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const getCandidateLocales = (languageInput)=>{
|
|
47
|
+
try {
|
|
48
|
+
const { language, script, region } = new Intl.Locale(languageInput);
|
|
49
|
+
return [
|
|
50
|
+
languageInput,
|
|
51
|
+
...region ? [
|
|
52
|
+
`${language}-${region}`
|
|
53
|
+
] : [],
|
|
54
|
+
...script ? [
|
|
55
|
+
`${language}-${script}`
|
|
56
|
+
] : [],
|
|
57
|
+
language
|
|
58
|
+
];
|
|
59
|
+
} catch {
|
|
60
|
+
return [
|
|
61
|
+
languageInput,
|
|
62
|
+
languageInput.split('-')[0]
|
|
63
|
+
];
|
|
51
64
|
}
|
|
52
|
-
return languageInput;
|
|
53
65
|
};
|
|
54
|
-
|
|
66
|
+
const resolveLanguage = (languageInput)=>getCandidateLocales(languageInput).map((locale)=>locale.toLowerCase()).find((locale)=>Object.hasOwn(dayjs_locales_data_cjs_namespaceObject.locales, locale)) ?? languageInput;
|
|
67
|
+
async function loadDayjsLocale(languageInput) {
|
|
55
68
|
const language = resolveLanguage(languageInput);
|
|
56
69
|
if (!dayjs_locales_data_cjs_namespaceObject.locales[language]) return void warn(language);
|
|
57
70
|
try {
|
|
58
|
-
dayjs_locales_data_cjs_namespaceObject.locales[language]()
|
|
59
|
-
|
|
71
|
+
await dayjs_locales_data_cjs_namespaceObject.locales[language]();
|
|
72
|
+
external_dayjs_default().locale(language);
|
|
73
|
+
} catch {
|
|
60
74
|
warn(language);
|
|
61
75
|
}
|
|
62
76
|
}
|
|
@@ -31,7 +31,11 @@ function getFieldCaptionNamespace(field) {
|
|
|
31
31
|
return `caption-${field}`;
|
|
32
32
|
}
|
|
33
33
|
function getFieldCaptions(field, i18n) {
|
|
34
|
-
|
|
34
|
+
const namespace = getFieldCaptionNamespace(field);
|
|
35
|
+
return (i18n.languages ?? []).reduceRight((captions, language)=>({
|
|
36
|
+
...captions,
|
|
37
|
+
...i18n.getResourceBundle(language, namespace)
|
|
38
|
+
}), {});
|
|
35
39
|
}
|
|
36
40
|
function getFieldValueCaption(field, facetValue, i18n) {
|
|
37
41
|
return i18n.t(facetValue, {
|
|
@@ -27,20 +27,23 @@ var __webpack_require__ = {};
|
|
|
27
27
|
})();
|
|
28
28
|
var __webpack_exports__ = {};
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
function withCountry(language, country) {
|
|
31
|
+
if (!country) return language;
|
|
32
|
+
try {
|
|
33
|
+
if (new Intl.Locale(language).region) return language;
|
|
34
|
+
return new Intl.Locale(language, {
|
|
35
|
+
region: country
|
|
36
|
+
}).toString();
|
|
37
|
+
} catch {
|
|
38
|
+
return language;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
30
41
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
|
|
42
|
+
withCountry: ()=>withCountry
|
|
32
43
|
});
|
|
33
|
-
|
|
34
|
-
const renderCategoryFacetParentValueLink = ({ props })=>(0, external_value_link_cjs_namespaceObject.renderCategoryFacetValueLink)({
|
|
35
|
-
props: {
|
|
36
|
-
...props,
|
|
37
|
-
isParent: true,
|
|
38
|
-
isSelected: true
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
exports.renderCategoryFacetParentValueLink = __webpack_exports__.renderCategoryFacetParentValueLink;
|
|
44
|
+
exports.withCountry = __webpack_exports__.withCountry;
|
|
42
45
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
43
|
-
"
|
|
46
|
+
"withCountry"
|
|
44
47
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
45
48
|
Object.defineProperty(exports, '__esModule', {
|
|
46
49
|
value: true
|
package/dist/cjs/versions.cjs
CHANGED
|
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32
32
|
headlessVersion: ()=>package_json_namespaceObject.version
|
|
33
33
|
});
|
|
34
34
|
const package_json_namespaceObject = require("@coveo/headless/package.json");
|
|
35
|
-
const atomicVersion = "3.
|
|
35
|
+
const atomicVersion = "3.63.0";
|
|
36
36
|
exports.atomicVersion = __webpack_exports__.atomicVersion;
|
|
37
37
|
exports.headlessVersion = __webpack_exports__.headlessVersion;
|
|
38
38
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -18,13 +18,14 @@ import { errorGuard } from "../../../decorators/error-guard.js";
|
|
|
18
18
|
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
|
|
19
19
|
import { AriaLiveRegionController, FocusTargetController } from "../../../utils/accessibility-utils.js";
|
|
20
20
|
import { getFieldValueCaption } from "../../../utils/field-utils.js";
|
|
21
|
+
import { renderCategoryFacetActiveValue } from "../../common/facets/category-facet/active-value.js";
|
|
21
22
|
import { renderCategoryFacetAllCategoryButton } from "../../common/facets/category-facet/all-categories-button.js";
|
|
22
23
|
import { renderCategoryFacetChildrenAsTreeContainer } from "../../common/facets/category-facet/children-as-tree-container.js";
|
|
23
24
|
import { renderCategoryFacetParentAsTreeContainer } from "../../common/facets/category-facet/parent-as-tree-container.js";
|
|
24
25
|
import { renderCategoryFacetParentButton } from "../../common/facets/category-facet/parent-button.js";
|
|
25
|
-
import { renderCategoryFacetParentValueLink } from "../../common/facets/category-facet/parent-value-link.js";
|
|
26
26
|
import { renderCategoryFacetSearchResultsContainer } from "../../common/facets/category-facet/search-results-container.js";
|
|
27
27
|
import { renderCategoryFacetSearchValue } from "../../common/facets/category-facet/search-value.js";
|
|
28
|
+
import { renderCategoryFacetSelectedValue } from "../../common/facets/category-facet/selected-value.js";
|
|
28
29
|
import { renderCategoryFacetTreeValueContainer } from "../../common/facets/category-facet/value-as-tree-container.js";
|
|
29
30
|
import { renderCategoryFacetValueLink } from "../../common/facets/category-facet/value-link.js";
|
|
30
31
|
import facet_common_tw_css from "../../common/facets/facet-common.tw.css.js";
|
|
@@ -93,6 +94,21 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
96
|
}
|
|
97
|
+
renderSelectedValue() {
|
|
98
|
+
const activeValue = this.facetState.selectedValueAncestry?.at(-1);
|
|
99
|
+
if (!activeValue) return nothing;
|
|
100
|
+
return renderCategoryFacetSelectedValue({
|
|
101
|
+
props: {
|
|
102
|
+
displayValue: getFieldValueCaption(this.facetState.field, activeValue.value, this.bindings.i18n),
|
|
103
|
+
label: this.displayName,
|
|
104
|
+
i18n: this.bindings.i18n,
|
|
105
|
+
onClearFilters: ()=>{
|
|
106
|
+
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
107
|
+
this.facet.deselectAll();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
96
112
|
renderValuesTree(parents, isRoot) {
|
|
97
113
|
if (!this.hasParents) return this.renderChildren();
|
|
98
114
|
if (isRoot) return renderCategoryFacetTreeValueContainer()(html`
|
|
@@ -137,16 +153,12 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
137
153
|
const activeParent = parents[0];
|
|
138
154
|
const activeParentDisplayValue = getFieldValueCaption(this.facetState?.field, activeParent.value, this.bindings.i18n);
|
|
139
155
|
return html`
|
|
140
|
-
${
|
|
156
|
+
${renderCategoryFacetActiveValue({
|
|
141
157
|
props: {
|
|
142
158
|
displayValue: activeParentDisplayValue,
|
|
143
159
|
numberOfResults: activeParent.numberOfResults,
|
|
144
160
|
i18n: this.bindings.i18n,
|
|
145
161
|
isLeafValue: activeParent.isLeafValue,
|
|
146
|
-
onClick: ()=>{
|
|
147
|
-
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
148
|
-
this.facet.deselectAll();
|
|
149
|
-
},
|
|
150
162
|
searchQuery: this.facetState.facetSearch.query,
|
|
151
163
|
setRef: (el)=>{
|
|
152
164
|
this.focusTargets.activeValueFocus.setTarget(el);
|
|
@@ -171,7 +183,6 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
171
183
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
172
184
|
this.facet.toggleSelect(facetValue);
|
|
173
185
|
},
|
|
174
|
-
isParent: false,
|
|
175
186
|
isSelected,
|
|
176
187
|
searchQuery: this.facetState.facetSearch.query,
|
|
177
188
|
isLeafValue: facetValue.isLeafValue,
|
|
@@ -246,6 +257,7 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
246
257
|
onClear: ()=>this.facet.facetSearch.clear()
|
|
247
258
|
}
|
|
248
259
|
})}
|
|
260
|
+
${this.renderSelectedValue()}
|
|
249
261
|
${when(shouldDisplaySearchResults(facetSearch), ()=>html`
|
|
250
262
|
${when(facetSearch.values.length > 0, ()=>renderFacetValuesGroup({
|
|
251
263
|
props: {
|
|
@@ -16,6 +16,7 @@ import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-com
|
|
|
16
16
|
import { markParentAsReady } from "../../../utils/init-queue.js";
|
|
17
17
|
import { waitForAtomicChildrenToBeDefined } from "../../../utils/initialization-common-utils.js";
|
|
18
18
|
import { SafeStorage, StorageItems } from "../../../utils/local-storage-utils.js";
|
|
19
|
+
import { withCountry } from "../../../utils/locale-utils.js";
|
|
19
20
|
import { getAnalyticsConfig } from "./analytics-config.js";
|
|
20
21
|
import { createCommerceStore } from "./store.js";
|
|
21
22
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -72,7 +73,7 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
72
73
|
}
|
|
73
74
|
updateLocale(language, country, currency) {
|
|
74
75
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.context) return;
|
|
75
|
-
language && this.interfaceController.onLanguageChange(language);
|
|
76
|
+
if (language || country && this.localizeWithCountry) this.interfaceController.onLanguageChange(this.getLocale(language || this.context.state.language, country || this.context.state.country));
|
|
76
77
|
if (this.isNewLocale(language, country, currency)) {
|
|
77
78
|
const { setContext } = loadContextActions(this.engine);
|
|
78
79
|
this.engine.dispatch(setContext({
|
|
@@ -97,7 +98,11 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
97
98
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.language || !this.context) return;
|
|
98
99
|
this.engine.logger.warn('The `language` property will be removed in the next major version of Atomic (v4). Rather than using this property, set the initial language through the engine configuration when calling `initialize` or `initializeWithEngine`, and update the language as needed using the `updateLocale` method.');
|
|
99
100
|
this.context.setLanguage(this.language);
|
|
100
|
-
return this.interfaceController.onLanguageChange();
|
|
101
|
+
return this.interfaceController.onLanguageChange(this.getLocale(this.language, this.context.state.country));
|
|
102
|
+
}
|
|
103
|
+
toggleLocalizeWithCountry() {
|
|
104
|
+
if (!this.context) return;
|
|
105
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
101
106
|
}
|
|
102
107
|
updateIconAssetsPath() {
|
|
103
108
|
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
@@ -138,7 +143,10 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
138
143
|
}
|
|
139
144
|
initLanguage() {
|
|
140
145
|
if (!this.context || this.language) return;
|
|
141
|
-
this.interfaceController.onLanguageChange(this.context.state.language);
|
|
146
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
147
|
+
}
|
|
148
|
+
getLocale(language, country) {
|
|
149
|
+
return this.localizeWithCountry ? withCountry(language, country) : language;
|
|
142
150
|
}
|
|
143
151
|
initRequestStatus() {
|
|
144
152
|
this.searchOrListing = 'product-listing' === this.type ? buildProductListing(this.engine) : buildSearch(this.engine);
|
|
@@ -202,7 +210,7 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
202
210
|
this.bindings.engine.logger.info(`History pushState #${newFragment}`);
|
|
203
211
|
}
|
|
204
212
|
constructor(){
|
|
205
|
-
super(), this.bindings = {}, this.unsubscribeUrlManager = ()=>{}, this.unsubscribeSummary = ()=>{}, this.initialized = false, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.type = 'search', this.analytics = true, this.reflectStateInUrl = true, this.disableStateReflectionInUrl = false, this.scrollContainer = 'atomic-commerce-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.handleInitialization = (event)=>{
|
|
213
|
+
super(), this.bindings = {}, this.unsubscribeUrlManager = ()=>{}, this.unsubscribeSummary = ()=>{}, this.initialized = false, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.type = 'search', this.analytics = true, this.localizeWithCountry = false, this.reflectStateInUrl = true, this.disableStateReflectionInUrl = false, this.scrollContainer = 'atomic-commerce-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.handleInitialization = (event)=>{
|
|
206
214
|
this.interfaceController.onComponentInitializing(event);
|
|
207
215
|
}, this.onHashChange = ()=>{
|
|
208
216
|
this.urlManager.synchronize(this.fragment);
|
|
@@ -264,6 +272,13 @@ _ts_decorate([
|
|
|
264
272
|
}),
|
|
265
273
|
_ts_metadata("design:type", String)
|
|
266
274
|
], AtomicCommerceInterface.prototype, "language", void 0);
|
|
275
|
+
_ts_decorate([
|
|
276
|
+
property({
|
|
277
|
+
type: Boolean,
|
|
278
|
+
attribute: 'localize-with-country',
|
|
279
|
+
reflect: true
|
|
280
|
+
})
|
|
281
|
+
], AtomicCommerceInterface.prototype, "localizeWithCountry", void 0);
|
|
267
282
|
_ts_decorate([
|
|
268
283
|
property({
|
|
269
284
|
type: Object,
|
|
@@ -319,6 +334,12 @@ _ts_decorate([
|
|
|
319
334
|
_ts_metadata("design:paramtypes", []),
|
|
320
335
|
_ts_metadata("design:returntype", void 0)
|
|
321
336
|
], AtomicCommerceInterface.prototype, "updateLanguage", null);
|
|
337
|
+
_ts_decorate([
|
|
338
|
+
watch('localizeWithCountry'),
|
|
339
|
+
_ts_metadata("design:type", Function),
|
|
340
|
+
_ts_metadata("design:paramtypes", []),
|
|
341
|
+
_ts_metadata("design:returntype", void 0)
|
|
342
|
+
], AtomicCommerceInterface.prototype, "toggleLocalizeWithCountry", null);
|
|
322
343
|
_ts_decorate([
|
|
323
344
|
watch('iconAssetsPath'),
|
|
324
345
|
_ts_metadata("design:type", Function),
|
|
@@ -7,6 +7,7 @@ import { when } from "lit/directives/when.js";
|
|
|
7
7
|
import { createAppLoadedListener } from "../../common/interface/store.js";
|
|
8
8
|
import { renderPageButtons, renderPagerNextButton, renderPagerPageButton, renderPagerPreviousButton } from "../../common/pager/pager-buttons.js";
|
|
9
9
|
import { renderPagerNavigation } from "../../common/pager/pager-navigation.js";
|
|
10
|
+
import { PagerFitController } from "../../common/pager/pager-fit-controller.js";
|
|
10
11
|
import { getCurrentPagesRange } from "../../common/pager/pager-utils.js";
|
|
11
12
|
import { ValidatePropsController } from "../../common/validate-props-controller/validate-props-controller.js";
|
|
12
13
|
import { bindStateToController } from "../../../decorators/bind-state.js";
|
|
@@ -38,7 +39,7 @@ class AtomicCommercePager extends LitElement {
|
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
render() {
|
|
41
|
-
const pagesRange = getCurrentPagesRange(this.pagerState.page, this.numberOfPages, this.pagerState.totalPages - 1);
|
|
42
|
+
const pagesRange = getCurrentPagesRange(this.pagerState.page, this.pagerFit.getNumberOfPagesToDisplay(this.numberOfPages), this.pagerState.totalPages - 1);
|
|
42
43
|
return html`
|
|
43
44
|
${when(this.pagerState.totalPages > 1 && this.isAppLoaded, ()=>html`
|
|
44
45
|
${renderPagerNavigation({
|
|
@@ -109,7 +110,7 @@ class AtomicCommercePager extends LitElement {
|
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
112
|
constructor(){
|
|
112
|
-
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded, this.nextButtonIcon = arrow_right_rounded, this.ariaMessage = new AriaLiveRegionController(this, 'atomic-pager');
|
|
113
|
+
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded, this.nextButtonIcon = arrow_right_rounded, this.ariaMessage = new AriaLiveRegionController(this, 'atomic-pager'), this.pagerFit = new PagerFitController(this);
|
|
113
114
|
new ValidatePropsController(this, ()=>({
|
|
114
115
|
numberOfPages: this.numberOfPages
|
|
115
116
|
}), AtomicCommercePager.propsSchema);
|
|
@@ -48,7 +48,7 @@ class AtomicCommerceProductsPerPage extends LitElement {
|
|
|
48
48
|
render() {
|
|
49
49
|
return html`
|
|
50
50
|
${when(!this.summaryState.hasError && this.summaryState.hasProducts && this.isAppLoaded, ()=>html`
|
|
51
|
-
<div class="flex items-center">
|
|
51
|
+
<div class="flex flex-wrap items-center">
|
|
52
52
|
${renderLabel()(html`${this.label}`)}
|
|
53
53
|
${renderFieldsetGroup({
|
|
54
54
|
props: {
|
|
@@ -10,6 +10,7 @@ import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js"
|
|
|
10
10
|
import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-complete-mixin.js";
|
|
11
11
|
import { markParentAsReady } from "../../../utils/init-queue.js";
|
|
12
12
|
import { waitForAtomicChildrenToBeDefined } from "../../../utils/initialization-common-utils.js";
|
|
13
|
+
import { withCountry } from "../../../utils/locale-utils.js";
|
|
13
14
|
import { bindingsContext } from "../../common/context/bindings-context.js";
|
|
14
15
|
import { augmentAnalyticsConfigWithAtomicVersion } from "../../common/interface/analytics-config.js";
|
|
15
16
|
import { InterfaceController } from "../../common/interface/interface-controller.js";
|
|
@@ -40,7 +41,7 @@ class AtomicCommerceRecommendationInterface extends ChildrenUpdateCompleteMixin(
|
|
|
40
41
|
}
|
|
41
42
|
updateLocale(language, country, currency) {
|
|
42
43
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.context) return;
|
|
43
|
-
language && this.interfaceController.onLanguageChange(language);
|
|
44
|
+
if (language || country && this.localizeWithCountry) this.interfaceController.onLanguageChange(this.getLocale(language || this.context.state.language, country || this.context.state.country));
|
|
44
45
|
if (this.isNewLocale(language, country, currency)) {
|
|
45
46
|
const { setContext } = loadContextActions(this.engine);
|
|
46
47
|
this.engine.dispatch(setContext({
|
|
@@ -63,11 +64,15 @@ class AtomicCommerceRecommendationInterface extends ChildrenUpdateCompleteMixin(
|
|
|
63
64
|
updateIconAssetsPath() {
|
|
64
65
|
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
65
66
|
}
|
|
67
|
+
toggleLocalizeWithCountry() {
|
|
68
|
+
if (!this.context) return;
|
|
69
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
70
|
+
}
|
|
66
71
|
async updateLanguage() {
|
|
67
72
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.language || !this.context) return;
|
|
68
73
|
this.engine.logger.warn('The `language` property will be removed in the next major version of Atomic (v4). Rather than using this property, set the initial language through the engine configuration when calling `initializeWithEngine`, and update the language as needed using the `updateLocale` method.');
|
|
69
74
|
this.context.setLanguage(this.language);
|
|
70
|
-
return this.interfaceController.onLanguageChange();
|
|
75
|
+
return this.interfaceController.onLanguageChange(this.getLocale(this.language, this.context.state.country));
|
|
71
76
|
}
|
|
72
77
|
disconnectedCallback() {
|
|
73
78
|
super.disconnectedCallback();
|
|
@@ -108,14 +113,17 @@ class AtomicCommerceRecommendationInterface extends ChildrenUpdateCompleteMixin(
|
|
|
108
113
|
}
|
|
109
114
|
initLanguage() {
|
|
110
115
|
if (!this.context || this.language) return;
|
|
111
|
-
this.interfaceController.onLanguageChange(this.context.state.language);
|
|
116
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
117
|
+
}
|
|
118
|
+
getLocale(language, country) {
|
|
119
|
+
return this.localizeWithCountry ? withCountry(language, country) : language;
|
|
112
120
|
}
|
|
113
121
|
isNewLocale(language, country, currency) {
|
|
114
122
|
if (!this.context) return false;
|
|
115
123
|
return language && language !== this.context.state.language || country && country !== this.context.state.country || currency && currency !== this.context.state.currency;
|
|
116
124
|
}
|
|
117
125
|
constructor(){
|
|
118
|
-
super(), this.bindings = {}, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.scrollContainer = 'atomic-commerce-recommendation-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.analytics = true, this.handleInitialization = (event)=>{
|
|
126
|
+
super(), this.bindings = {}, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.scrollContainer = 'atomic-commerce-recommendation-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.localizeWithCountry = false, this.analytics = true, this.handleInitialization = (event)=>{
|
|
119
127
|
this.interfaceController.onComponentInitializing(event);
|
|
120
128
|
};
|
|
121
129
|
this.store = createCommerceRecommendationStore();
|
|
@@ -183,6 +191,13 @@ _ts_decorate([
|
|
|
183
191
|
}),
|
|
184
192
|
_ts_metadata("design:type", String)
|
|
185
193
|
], AtomicCommerceRecommendationInterface.prototype, "language", void 0);
|
|
194
|
+
_ts_decorate([
|
|
195
|
+
property({
|
|
196
|
+
type: Boolean,
|
|
197
|
+
attribute: 'localize-with-country',
|
|
198
|
+
reflect: true
|
|
199
|
+
})
|
|
200
|
+
], AtomicCommerceRecommendationInterface.prototype, "localizeWithCountry", void 0);
|
|
186
201
|
_ts_decorate([
|
|
187
202
|
property({
|
|
188
203
|
type: Boolean,
|
|
@@ -203,6 +218,12 @@ _ts_decorate([
|
|
|
203
218
|
_ts_metadata("design:paramtypes", []),
|
|
204
219
|
_ts_metadata("design:returntype", void 0)
|
|
205
220
|
], AtomicCommerceRecommendationInterface.prototype, "updateIconAssetsPath", null);
|
|
221
|
+
_ts_decorate([
|
|
222
|
+
watch('localizeWithCountry'),
|
|
223
|
+
_ts_metadata("design:type", Function),
|
|
224
|
+
_ts_metadata("design:paramtypes", []),
|
|
225
|
+
_ts_metadata("design:returntype", void 0)
|
|
226
|
+
], AtomicCommerceRecommendationInterface.prototype, "toggleLocalizeWithCountry", null);
|
|
206
227
|
_ts_decorate([
|
|
207
228
|
watch('language'),
|
|
208
229
|
_ts_metadata("design:type", Function),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { keyed } from "lit/directives/keyed.js";
|
|
3
|
+
import { ref } from "lit/directives/ref.js";
|
|
4
|
+
import { renderFacetValueLabelHighlight } from "../facet-value-label-highlight/facet-value-label-highlight.js";
|
|
5
|
+
const renderCategoryFacetActiveValue = ({ props: { displayValue, numberOfResults, i18n, searchQuery, isLeafValue, setRef } })=>(children)=>{
|
|
6
|
+
const count = numberOfResults.toLocaleString(i18n.language);
|
|
7
|
+
return html`${keyed(displayValue, html`<li class="contents">
|
|
8
|
+
<span
|
|
9
|
+
part="active-parent ${isLeafValue ? 'leaf-value' : 'node-value'}"
|
|
10
|
+
class="text-primary flex w-full items-center truncate px-2 py-2.5 text-left"
|
|
11
|
+
aria-current="true"
|
|
12
|
+
tabindex="-1"
|
|
13
|
+
${ref(setRef)}
|
|
14
|
+
>
|
|
15
|
+
${renderFacetValueLabelHighlight({
|
|
16
|
+
props: {
|
|
17
|
+
displayValue,
|
|
18
|
+
searchQuery,
|
|
19
|
+
isSelected: true
|
|
20
|
+
}
|
|
21
|
+
})}
|
|
22
|
+
<span part="value-count" class="value-count">
|
|
23
|
+
${i18n.t('between-parentheses', {
|
|
24
|
+
text: count
|
|
25
|
+
})}
|
|
26
|
+
</span>
|
|
27
|
+
</span>
|
|
28
|
+
${children}
|
|
29
|
+
</li>`)}`;
|
|
30
|
+
};
|
|
31
|
+
export { renderCategoryFacetActiveValue };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import images_close from "../../../../images/close.js";
|
|
3
|
+
import "../../atomic-icon/atomic-icon.js";
|
|
4
|
+
import { renderButton } from "../../button.js";
|
|
5
|
+
const renderCategoryFacetSelectedValue = ({ props: { displayValue, label, i18n, onClearFilters } })=>html`<div part="selected-value" class="mt-3 flex items-center justify-between gap-2">
|
|
6
|
+
<span
|
|
7
|
+
part="selected-value-pill"
|
|
8
|
+
title=${displayValue}
|
|
9
|
+
class="bg-neutral-light truncate rounded-md px-2 py-1 text-sm"
|
|
10
|
+
>${displayValue}</span
|
|
11
|
+
>
|
|
12
|
+
${renderButton({
|
|
13
|
+
props: {
|
|
14
|
+
part: 'selected-value-clear-button',
|
|
15
|
+
style: 'text-primary',
|
|
16
|
+
class: 'flex shrink-0 items-center p-1 text-sm',
|
|
17
|
+
ariaLabel: i18n.t('clear-filters-for-facet', {
|
|
18
|
+
count: 1,
|
|
19
|
+
label: i18n.t(label)
|
|
20
|
+
}),
|
|
21
|
+
onClick: onClearFilters
|
|
22
|
+
}
|
|
23
|
+
})(html`<atomic-icon
|
|
24
|
+
part="selected-value-clear-button-icon"
|
|
25
|
+
class="mr-1 h-2 w-2"
|
|
26
|
+
.icon=${images_close}
|
|
27
|
+
></atomic-icon>
|
|
28
|
+
<span>${i18n.t('clear')}</span>`)}
|
|
29
|
+
</div>`;
|
|
30
|
+
export { renderCategoryFacetSelectedValue };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { renderFacetValueLabelHighlight } from "../facet-value-label-highlight/facet-value-label-highlight.js";
|
|
3
3
|
import { renderFacetValueLink } from "../facet-value-link/facet-value-link.js";
|
|
4
|
-
const renderCategoryFacetValueLink = ({ props: { displayValue, numberOfResults, i18n, onClick,
|
|
5
|
-
const partNames = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
else partNames.push('node-value');
|
|
4
|
+
const renderCategoryFacetValueLink = ({ props: { displayValue, numberOfResults, i18n, onClick, isSelected, searchQuery, isLeafValue, setRef } })=>(children)=>{
|
|
5
|
+
const partNames = [
|
|
6
|
+
`value-link${isSelected ? ' value-link-selected' : ''}`,
|
|
7
|
+
isLeafValue ? 'leaf-value' : 'node-value'
|
|
8
|
+
];
|
|
10
9
|
return html`${renderFacetValueLink({
|
|
11
10
|
props: {
|
|
12
11
|
displayValue,
|