@coveo/atomic 3.62.0 → 3.64.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 +12960 -12663
- package/dist/cjs/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.cjs +1 -0
- package/dist/cjs/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.cjs +1 -1
- package/dist/cjs/components/commerce/atomic-commerce-facet/atomic-commerce-facet.cjs +1 -1
- 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/commerce/atomic-product-field-condition/atomic-product-field-condition.cjs +1 -4
- package/dist/cjs/components/commerce/atomic-product-template/atomic-product-template.cjs +15 -1
- package/dist/cjs/components/common/facets/facet-search/facet-search-aria-live.cjs +21 -8
- 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/common/query-error/icon.cjs +7 -26
- package/dist/cjs/components/common/query-error/icons.cjs +68 -0
- package/dist/cjs/components/common/template-controller/template-utils.cjs +9 -0
- package/dist/cjs/components/insight/atomic-insight-facet/atomic-insight-facet.cjs +1 -1
- package/dist/cjs/components/insight/atomic-insight-pager/atomic-insight-pager.cjs +3 -2
- package/dist/cjs/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.cjs +1 -5
- package/dist/cjs/components/insight/atomic-insight-result-template/atomic-insight-result-template.cjs +15 -1
- package/dist/cjs/components/insight/atomic-insight-smart-snippet/atomic-insight-smart-snippet.cjs +3 -3
- package/dist/cjs/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.cjs +15 -1
- package/dist/cjs/components/search/atomic-category-facet/atomic-category-facet.cjs +1 -1
- package/dist/cjs/components/search/atomic-color-facet/atomic-color-facet.cjs +1 -1
- package/dist/cjs/components/search/atomic-facet/atomic-facet.cjs +1 -1
- package/dist/cjs/components/search/atomic-field-condition/atomic-field-condition.cjs +1 -4
- package/dist/cjs/components/search/atomic-pager/atomic-pager.cjs +3 -2
- package/dist/cjs/components/search/atomic-result-children-template/atomic-result-children-template.cjs +15 -1
- package/dist/cjs/components/search/atomic-result-date/atomic-result-date.cjs +11 -16
- package/dist/cjs/components/search/atomic-result-template/atomic-result-template.cjs +15 -1
- package/dist/cjs/components/search/atomic-results-per-page/atomic-results-per-page.cjs +1 -1
- package/dist/cjs/decorators/bind-state.cjs +38 -8
- package/dist/cjs/decorators/with-tailwind-styles.cjs +2 -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/utils/init-queue.cjs +6 -4
- package/dist/cjs/utils/locale-utils.cjs +50 -0
- package/dist/cjs/utils/replace-breakpoint-utils.cjs +9 -4
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +1 -0
- package/dist/esm/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.js +1 -1
- package/dist/esm/components/commerce/atomic-commerce-facet/atomic-commerce-facet.js +1 -1
- 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/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +1 -1
- package/dist/esm/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +2 -5
- package/dist/esm/components/commerce/atomic-product-template/atomic-product-template.js +16 -2
- package/dist/esm/components/common/facets/facet-search/facet-search-aria-live.js +21 -8
- 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/common/query-error/icon.js +5 -23
- package/dist/esm/components/common/query-error/icons.js +17 -0
- package/dist/esm/components/common/template-controller/template-utils.js +7 -1
- package/dist/esm/components/insight/atomic-insight-facet/atomic-insight-facet.js +1 -1
- package/dist/esm/components/insight/atomic-insight-pager/atomic-insight-pager.js +3 -2
- package/dist/esm/components/insight/atomic-insight-result-children/atomic-insight-result-children.js +1 -1
- package/dist/esm/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.js +2 -6
- package/dist/esm/components/insight/atomic-insight-result-template/atomic-insight-result-template.js +16 -2
- package/dist/esm/components/insight/atomic-insight-smart-snippet/atomic-insight-smart-snippet.js +3 -3
- package/dist/esm/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.js +16 -2
- package/dist/esm/components/search/atomic-category-facet/atomic-category-facet.js +1 -1
- package/dist/esm/components/search/atomic-color-facet/atomic-color-facet.js +1 -1
- package/dist/esm/components/search/atomic-facet/atomic-facet.js +1 -1
- package/dist/esm/components/search/atomic-field-condition/atomic-field-condition.js +2 -5
- package/dist/esm/components/search/atomic-pager/atomic-pager.js +3 -2
- package/dist/esm/components/search/atomic-result-children-template/atomic-result-children-template.js +16 -2
- package/dist/esm/components/search/atomic-result-date/atomic-result-date.js +10 -15
- package/dist/esm/components/search/atomic-result-template/atomic-result-template.js +16 -2
- package/dist/esm/components/search/atomic-results-per-page/atomic-results-per-page.js +1 -1
- package/dist/esm/components/search/atomic-search-box/atomic-search-box.js +1 -1
- package/dist/esm/decorators/bind-state.js +38 -8
- package/dist/esm/decorators/with-tailwind-styles.js +2 -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/init-queue.js +6 -4
- package/dist/esm/utils/locale-utils.js +12 -0
- package/dist/esm/utils/replace-breakpoint-utils.js +9 -4
- 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-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/commerce/atomic-product-template/atomic-product-template.d.ts +12 -0
- package/dist/types/components/common/atomic-smart-snippet-source/atomic-smart-snippet-source.d.ts +4 -4
- package/dist/types/components/common/facets/facet-search/facet-search-aria-live.d.ts +7 -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/query-error/icon.d.ts +6 -0
- package/dist/types/components/common/query-error/icons.d.ts +5 -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/common/template-controller/template-utils.d.ts +7 -0
- 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/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.d.ts +4 -4
- package/dist/types/components/insight/atomic-insight-result-template/atomic-insight-result-template.d.ts +12 -0
- package/dist/types/components/recommendations/atomic-recs-interface/atomic-recs-interface.d.ts +4 -0
- package/dist/types/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.d.ts +12 -0
- package/dist/types/components/search/atomic-pager/atomic-pager.d.ts +1 -0
- package/dist/types/components/search/atomic-result-children-template/atomic-result-children-template.d.ts +12 -0
- package/dist/types/components/search/atomic-result-date/atomic-result-date.d.ts +3 -0
- package/dist/types/components/search/atomic-result-template/atomic-result-template.d.ts +12 -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/init-queue.d.ts +3 -2
- package/dist/types/utils/locale-utils.d.ts +7 -0
- package/docs/adr/0001-group-shared-modules-in-one-cdn-chunk.md +147 -0
- package/package.json +6 -6
|
@@ -85,7 +85,7 @@ function _ts_metadata(metadataKey, metadataValue) {
|
|
|
85
85
|
class AtomicCommerceCategoryFacet extends external_lit_namespaceObject.LitElement {
|
|
86
86
|
initialize() {
|
|
87
87
|
this.validateFacet();
|
|
88
|
-
this.facet && (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.displayName, (msg)=>{
|
|
88
|
+
this.facet && (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.displayName, (msg)=>{
|
|
89
89
|
this.facetSearchAriaMessage.message = msg;
|
|
90
90
|
}, this.bindings.i18n);
|
|
91
91
|
}
|
|
@@ -242,7 +242,7 @@ class AtomicCommerceFacet extends external_lit_namespaceObject.LitElement {
|
|
|
242
242
|
if (!this.headerFocus) this.headerFocus = new accessibility_utils_cjs_namespaceObject.FocusTargetController(this, this.bindings);
|
|
243
243
|
}
|
|
244
244
|
initAriaLive() {
|
|
245
|
-
(0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.displayName, (msg)=>{
|
|
245
|
+
(0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.displayName, (msg)=>{
|
|
246
246
|
this.ariaLiveRegion.message = msg;
|
|
247
247
|
}, this.bindings.i18n);
|
|
248
248
|
}
|
package/dist/cjs/components/commerce/atomic-commerce-interface/atomic-commerce-interface.cjs
CHANGED
|
@@ -58,6 +58,7 @@ const children_update_complete_mixin_cjs_namespaceObject = require("../../../mix
|
|
|
58
58
|
const init_queue_cjs_namespaceObject = require("../../../utils/init-queue.cjs");
|
|
59
59
|
const initialization_common_utils_cjs_namespaceObject = require("../../../utils/initialization-common-utils.cjs");
|
|
60
60
|
const local_storage_utils_cjs_namespaceObject = require("../../../utils/local-storage-utils.cjs");
|
|
61
|
+
const locale_utils_cjs_namespaceObject = require("../../../utils/locale-utils.cjs");
|
|
61
62
|
const external_analytics_config_cjs_namespaceObject = require("./analytics-config.cjs");
|
|
62
63
|
const external_store_cjs_namespaceObject = require("./store.cjs");
|
|
63
64
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -114,7 +115,7 @@ class AtomicCommerceInterface extends (0, children_update_complete_mixin_cjs_nam
|
|
|
114
115
|
}
|
|
115
116
|
updateLocale(language, country, currency) {
|
|
116
117
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.context) return;
|
|
117
|
-
language && this.interfaceController.onLanguageChange(language);
|
|
118
|
+
if (language || country && this.localizeWithCountry) this.interfaceController.onLanguageChange(this.getLocale(language || this.context.state.language, country || this.context.state.country));
|
|
118
119
|
if (this.isNewLocale(language, country, currency)) {
|
|
119
120
|
const { setContext } = (0, commerce_namespaceObject.loadContextActions)(this.engine);
|
|
120
121
|
this.engine.dispatch(setContext({
|
|
@@ -139,7 +140,11 @@ class AtomicCommerceInterface extends (0, children_update_complete_mixin_cjs_nam
|
|
|
139
140
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.language || !this.context) return;
|
|
140
141
|
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.');
|
|
141
142
|
this.context.setLanguage(this.language);
|
|
142
|
-
return this.interfaceController.onLanguageChange();
|
|
143
|
+
return this.interfaceController.onLanguageChange(this.getLocale(this.language, this.context.state.country));
|
|
144
|
+
}
|
|
145
|
+
toggleLocalizeWithCountry() {
|
|
146
|
+
if (!this.context) return;
|
|
147
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
143
148
|
}
|
|
144
149
|
updateIconAssetsPath() {
|
|
145
150
|
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
@@ -180,7 +185,10 @@ class AtomicCommerceInterface extends (0, children_update_complete_mixin_cjs_nam
|
|
|
180
185
|
}
|
|
181
186
|
initLanguage() {
|
|
182
187
|
if (!this.context || this.language) return;
|
|
183
|
-
this.interfaceController.onLanguageChange(this.context.state.language);
|
|
188
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
189
|
+
}
|
|
190
|
+
getLocale(language, country) {
|
|
191
|
+
return this.localizeWithCountry ? (0, locale_utils_cjs_namespaceObject.withCountry)(language, country) : language;
|
|
184
192
|
}
|
|
185
193
|
initRequestStatus() {
|
|
186
194
|
this.searchOrListing = 'product-listing' === this.type ? (0, commerce_namespaceObject.buildProductListing)(this.engine) : (0, commerce_namespaceObject.buildSearch)(this.engine);
|
|
@@ -244,7 +252,7 @@ class AtomicCommerceInterface extends (0, children_update_complete_mixin_cjs_nam
|
|
|
244
252
|
this.bindings.engine.logger.info(`History pushState #${newFragment}`);
|
|
245
253
|
}
|
|
246
254
|
constructor(){
|
|
247
|
-
super(), this.bindings = {}, this.unsubscribeUrlManager = ()=>{}, this.unsubscribeSummary = ()=>{}, this.initialized = false, this.interfaceController = new interface_controller_cjs_namespaceObject.InterfaceController(this, 'CoveoAtomic', commerce_namespaceObject.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)=>{
|
|
255
|
+
super(), this.bindings = {}, this.unsubscribeUrlManager = ()=>{}, this.unsubscribeSummary = ()=>{}, this.initialized = false, this.interfaceController = new interface_controller_cjs_namespaceObject.InterfaceController(this, 'CoveoAtomic', commerce_namespaceObject.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)=>{
|
|
248
256
|
this.interfaceController.onComponentInitializing(event);
|
|
249
257
|
}, this.onHashChange = ()=>{
|
|
250
258
|
this.urlManager.synchronize(this.fragment);
|
|
@@ -314,6 +322,13 @@ _ts_decorate([
|
|
|
314
322
|
}),
|
|
315
323
|
_ts_metadata("design:type", String)
|
|
316
324
|
], AtomicCommerceInterface.prototype, "language", void 0);
|
|
325
|
+
_ts_decorate([
|
|
326
|
+
(0, decorators_js_namespaceObject.property)({
|
|
327
|
+
type: Boolean,
|
|
328
|
+
attribute: 'localize-with-country',
|
|
329
|
+
reflect: true
|
|
330
|
+
})
|
|
331
|
+
], AtomicCommerceInterface.prototype, "localizeWithCountry", void 0);
|
|
317
332
|
_ts_decorate([
|
|
318
333
|
(0, decorators_js_namespaceObject.property)({
|
|
319
334
|
type: Object,
|
|
@@ -369,6 +384,12 @@ _ts_decorate([
|
|
|
369
384
|
_ts_metadata("design:paramtypes", []),
|
|
370
385
|
_ts_metadata("design:returntype", void 0)
|
|
371
386
|
], AtomicCommerceInterface.prototype, "updateLanguage", null);
|
|
387
|
+
_ts_decorate([
|
|
388
|
+
(0, watch_cjs_namespaceObject.watch)('localizeWithCountry'),
|
|
389
|
+
_ts_metadata("design:type", Function),
|
|
390
|
+
_ts_metadata("design:paramtypes", []),
|
|
391
|
+
_ts_metadata("design:returntype", void 0)
|
|
392
|
+
], AtomicCommerceInterface.prototype, "toggleLocalizeWithCountry", null);
|
|
372
393
|
_ts_decorate([
|
|
373
394
|
(0, watch_cjs_namespaceObject.watch)('iconAssetsPath'),
|
|
374
395
|
_ts_metadata("design:type", Function),
|
|
@@ -48,6 +48,7 @@ const when_js_namespaceObject = require("lit/directives/when.js");
|
|
|
48
48
|
const store_cjs_namespaceObject = require("../../common/interface/store.cjs");
|
|
49
49
|
const pager_buttons_cjs_namespaceObject = require("../../common/pager/pager-buttons.cjs");
|
|
50
50
|
const pager_navigation_cjs_namespaceObject = require("../../common/pager/pager-navigation.cjs");
|
|
51
|
+
const pager_fit_controller_cjs_namespaceObject = require("../../common/pager/pager-fit-controller.cjs");
|
|
51
52
|
const pager_utils_cjs_namespaceObject = require("../../common/pager/pager-utils.cjs");
|
|
52
53
|
const validate_props_controller_cjs_namespaceObject = require("../../common/validate-props-controller/validate-props-controller.cjs");
|
|
53
54
|
const bind_state_cjs_namespaceObject = require("../../../decorators/bind-state.cjs");
|
|
@@ -81,7 +82,7 @@ class AtomicCommercePager extends external_lit_namespaceObject.LitElement {
|
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
render() {
|
|
84
|
-
const pagesRange = (0, pager_utils_cjs_namespaceObject.getCurrentPagesRange)(this.pagerState.page, this.numberOfPages, this.pagerState.totalPages - 1);
|
|
85
|
+
const pagesRange = (0, pager_utils_cjs_namespaceObject.getCurrentPagesRange)(this.pagerState.page, this.pagerFit.getNumberOfPagesToDisplay(this.numberOfPages), this.pagerState.totalPages - 1);
|
|
85
86
|
return (0, external_lit_namespaceObject.html)`
|
|
86
87
|
${(0, when_js_namespaceObject.when)(this.pagerState.totalPages > 1 && this.isAppLoaded, ()=>(0, external_lit_namespaceObject.html)`
|
|
87
88
|
${(0, pager_navigation_cjs_namespaceObject.renderPagerNavigation)({
|
|
@@ -152,7 +153,7 @@ class AtomicCommercePager extends external_lit_namespaceObject.LitElement {
|
|
|
152
153
|
});
|
|
153
154
|
}
|
|
154
155
|
constructor(){
|
|
155
|
-
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded_cjs_default(), this.nextButtonIcon = arrow_right_rounded_cjs_default(), this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'atomic-pager');
|
|
156
|
+
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded_cjs_default(), this.nextButtonIcon = arrow_right_rounded_cjs_default(), this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'atomic-pager'), this.pagerFit = new pager_fit_controller_cjs_namespaceObject.PagerFitController(this);
|
|
156
157
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
157
158
|
numberOfPages: this.numberOfPages
|
|
158
159
|
}), AtomicCommercePager.propsSchema);
|
|
@@ -80,7 +80,7 @@ class AtomicCommerceProductsPerPage extends external_lit_namespaceObject.LitElem
|
|
|
80
80
|
render() {
|
|
81
81
|
return (0, external_lit_namespaceObject.html)`
|
|
82
82
|
${(0, when_js_namespaceObject.when)(!this.summaryState.hasError && this.summaryState.hasProducts && this.isAppLoaded, ()=>(0, external_lit_namespaceObject.html)`
|
|
83
|
-
<div class="flex items-center">
|
|
83
|
+
<div class="flex flex-wrap items-center">
|
|
84
84
|
${(0, label_cjs_namespaceObject.renderLabel)()((0, external_lit_namespaceObject.html)`${this.label}`)}
|
|
85
85
|
${(0, fieldset_group_cjs_namespaceObject.renderFieldsetGroup)({
|
|
86
86
|
props: {
|
|
@@ -52,6 +52,7 @@ const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/wi
|
|
|
52
52
|
const children_update_complete_mixin_cjs_namespaceObject = require("../../../mixins/children-update-complete-mixin.cjs");
|
|
53
53
|
const init_queue_cjs_namespaceObject = require("../../../utils/init-queue.cjs");
|
|
54
54
|
const initialization_common_utils_cjs_namespaceObject = require("../../../utils/initialization-common-utils.cjs");
|
|
55
|
+
const locale_utils_cjs_namespaceObject = require("../../../utils/locale-utils.cjs");
|
|
55
56
|
const bindings_context_cjs_namespaceObject = require("../../common/context/bindings-context.cjs");
|
|
56
57
|
const analytics_config_cjs_namespaceObject = require("../../common/interface/analytics-config.cjs");
|
|
57
58
|
const interface_controller_cjs_namespaceObject = require("../../common/interface/interface-controller.cjs");
|
|
@@ -82,7 +83,7 @@ class AtomicCommerceRecommendationInterface extends (0, children_update_complete
|
|
|
82
83
|
}
|
|
83
84
|
updateLocale(language, country, currency) {
|
|
84
85
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.context) return;
|
|
85
|
-
language && this.interfaceController.onLanguageChange(language);
|
|
86
|
+
if (language || country && this.localizeWithCountry) this.interfaceController.onLanguageChange(this.getLocale(language || this.context.state.language, country || this.context.state.country));
|
|
86
87
|
if (this.isNewLocale(language, country, currency)) {
|
|
87
88
|
const { setContext } = (0, commerce_namespaceObject.loadContextActions)(this.engine);
|
|
88
89
|
this.engine.dispatch(setContext({
|
|
@@ -105,11 +106,15 @@ class AtomicCommerceRecommendationInterface extends (0, children_update_complete
|
|
|
105
106
|
updateIconAssetsPath() {
|
|
106
107
|
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
107
108
|
}
|
|
109
|
+
toggleLocalizeWithCountry() {
|
|
110
|
+
if (!this.context) return;
|
|
111
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
112
|
+
}
|
|
108
113
|
async updateLanguage() {
|
|
109
114
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.language || !this.context) return;
|
|
110
115
|
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.');
|
|
111
116
|
this.context.setLanguage(this.language);
|
|
112
|
-
return this.interfaceController.onLanguageChange();
|
|
117
|
+
return this.interfaceController.onLanguageChange(this.getLocale(this.language, this.context.state.country));
|
|
113
118
|
}
|
|
114
119
|
disconnectedCallback() {
|
|
115
120
|
super.disconnectedCallback();
|
|
@@ -150,14 +155,17 @@ class AtomicCommerceRecommendationInterface extends (0, children_update_complete
|
|
|
150
155
|
}
|
|
151
156
|
initLanguage() {
|
|
152
157
|
if (!this.context || this.language) return;
|
|
153
|
-
this.interfaceController.onLanguageChange(this.context.state.language);
|
|
158
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
159
|
+
}
|
|
160
|
+
getLocale(language, country) {
|
|
161
|
+
return this.localizeWithCountry ? (0, locale_utils_cjs_namespaceObject.withCountry)(language, country) : language;
|
|
154
162
|
}
|
|
155
163
|
isNewLocale(language, country, currency) {
|
|
156
164
|
if (!this.context) return false;
|
|
157
165
|
return language && language !== this.context.state.language || country && country !== this.context.state.country || currency && currency !== this.context.state.currency;
|
|
158
166
|
}
|
|
159
167
|
constructor(){
|
|
160
|
-
super(), this.bindings = {}, this.interfaceController = new interface_controller_cjs_namespaceObject.InterfaceController(this, 'CoveoAtomic', commerce_namespaceObject.VERSION), this.scrollContainer = 'atomic-commerce-recommendation-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.analytics = true, this.handleInitialization = (event)=>{
|
|
168
|
+
super(), this.bindings = {}, this.interfaceController = new interface_controller_cjs_namespaceObject.InterfaceController(this, 'CoveoAtomic', commerce_namespaceObject.VERSION), this.scrollContainer = 'atomic-commerce-recommendation-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.localizeWithCountry = false, this.analytics = true, this.handleInitialization = (event)=>{
|
|
161
169
|
this.interfaceController.onComponentInitializing(event);
|
|
162
170
|
};
|
|
163
171
|
this.store = (0, external_store_cjs_namespaceObject.createCommerceRecommendationStore)();
|
|
@@ -234,6 +242,13 @@ _ts_decorate([
|
|
|
234
242
|
}),
|
|
235
243
|
_ts_metadata("design:type", String)
|
|
236
244
|
], AtomicCommerceRecommendationInterface.prototype, "language", void 0);
|
|
245
|
+
_ts_decorate([
|
|
246
|
+
(0, decorators_js_namespaceObject.property)({
|
|
247
|
+
type: Boolean,
|
|
248
|
+
attribute: 'localize-with-country',
|
|
249
|
+
reflect: true
|
|
250
|
+
})
|
|
251
|
+
], AtomicCommerceRecommendationInterface.prototype, "localizeWithCountry", void 0);
|
|
237
252
|
_ts_decorate([
|
|
238
253
|
(0, decorators_js_namespaceObject.property)({
|
|
239
254
|
type: Boolean,
|
|
@@ -254,6 +269,12 @@ _ts_decorate([
|
|
|
254
269
|
_ts_metadata("design:paramtypes", []),
|
|
255
270
|
_ts_metadata("design:returntype", void 0)
|
|
256
271
|
], AtomicCommerceRecommendationInterface.prototype, "updateIconAssetsPath", null);
|
|
272
|
+
_ts_decorate([
|
|
273
|
+
(0, watch_cjs_namespaceObject.watch)('localizeWithCountry'),
|
|
274
|
+
_ts_metadata("design:type", Function),
|
|
275
|
+
_ts_metadata("design:paramtypes", []),
|
|
276
|
+
_ts_metadata("design:returntype", void 0)
|
|
277
|
+
], AtomicCommerceRecommendationInterface.prototype, "toggleLocalizeWithCountry", null);
|
|
257
278
|
_ts_decorate([
|
|
258
279
|
(0, watch_cjs_namespaceObject.watch)('language'),
|
|
259
280
|
_ts_metadata("design:type", Function),
|
|
@@ -51,10 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
|
|
|
51
51
|
class AtomicProductFieldCondition extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(external_lit_namespaceObject.LitElement) {
|
|
52
52
|
initialize() {}
|
|
53
53
|
get conditions() {
|
|
54
|
-
return
|
|
55
|
-
...(0, template_utils_cjs_namespaceObject.makeDefinedConditions)(this.ifDefined, this.ifNotDefined, commerce_namespaceObject.ProductTemplatesHelpers),
|
|
56
|
-
...(0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, commerce_namespaceObject.ProductTemplatesHelpers)
|
|
57
|
-
];
|
|
54
|
+
return (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, commerce_namespaceObject.ProductTemplatesHelpers);
|
|
58
55
|
}
|
|
59
56
|
render() {
|
|
60
57
|
const product = this.productController.item;
|
|
@@ -51,7 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
|
|
|
51
51
|
class AtomicProductTemplate extends external_lit_namespaceObject.LitElement {
|
|
52
52
|
connectedCallback() {
|
|
53
53
|
super.connectedCallback();
|
|
54
|
-
this.productTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.
|
|
54
|
+
this.productTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, commerce_namespaceObject.ProductTemplatesHelpers);
|
|
55
55
|
}
|
|
56
56
|
async getTemplate() {
|
|
57
57
|
return this.productTemplateController.getTemplate(this.conditions);
|
|
@@ -82,6 +82,20 @@ _ts_decorate([
|
|
|
82
82
|
}),
|
|
83
83
|
_ts_metadata("design:type", Array)
|
|
84
84
|
], AtomicProductTemplate.prototype, "conditions", void 0);
|
|
85
|
+
_ts_decorate([
|
|
86
|
+
(0, decorators_js_namespaceObject.property)({
|
|
87
|
+
type: String,
|
|
88
|
+
attribute: 'if-defined'
|
|
89
|
+
}),
|
|
90
|
+
_ts_metadata("design:type", String)
|
|
91
|
+
], AtomicProductTemplate.prototype, "ifDefined", void 0);
|
|
92
|
+
_ts_decorate([
|
|
93
|
+
(0, decorators_js_namespaceObject.property)({
|
|
94
|
+
type: String,
|
|
95
|
+
attribute: 'if-not-defined'
|
|
96
|
+
}),
|
|
97
|
+
_ts_metadata("design:type", String)
|
|
98
|
+
], AtomicProductTemplate.prototype, "ifNotDefined", void 0);
|
|
85
99
|
_ts_decorate([
|
|
86
100
|
(0, props_utils_cjs_namespaceObject.mapProperty)({
|
|
87
101
|
splitValues: true,
|
|
@@ -31,15 +31,28 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
31
31
|
announceFacetSearchResultsWithAriaLive: ()=>announceFacetSearchResultsWithAriaLive
|
|
32
32
|
});
|
|
33
33
|
const external_facet_search_utils_cjs_namespaceObject = require("./facet-search-utils.cjs");
|
|
34
|
-
function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n) {
|
|
34
|
+
function announceFacetSearchResultsWithAriaLive(host, facet, label, setAriaLive, i18n) {
|
|
35
35
|
let prevState = facet.state.facetSearch;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
let unsubscribe;
|
|
37
|
+
host.addController({
|
|
38
|
+
hostConnected () {
|
|
39
|
+
if (unsubscribe) return;
|
|
40
|
+
let subscribing = true;
|
|
41
|
+
unsubscribe = facet.subscribe(()=>{
|
|
42
|
+
const nextState = facet.state.facetSearch;
|
|
43
|
+
if (!subscribing && (0, external_facet_search_utils_cjs_namespaceObject.shouldUpdateFacetSearchComponent)(nextState, prevState) && nextState.query) setAriaLive(i18n.t('facet-search-results-count', {
|
|
44
|
+
count: nextState.values.length,
|
|
45
|
+
label
|
|
46
|
+
}));
|
|
47
|
+
prevState = nextState;
|
|
48
|
+
});
|
|
49
|
+
subscribing = false;
|
|
50
|
+
},
|
|
51
|
+
hostDisconnected () {
|
|
52
|
+
if (host.isConnected) return;
|
|
53
|
+
unsubscribe?.();
|
|
54
|
+
unsubscribe = void 0;
|
|
55
|
+
}
|
|
43
56
|
});
|
|
44
57
|
}
|
|
45
58
|
exports.announceFacetSearchResultsWithAriaLive = __webpack_exports__.announceFacetSearchResultsWithAriaLive;
|
|
@@ -76,9 +76,13 @@ function i18nBackendOptions(atomicInterface) {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function loadTranslations(atomicInterface, language) {
|
|
79
|
+
async function loadTranslations(atomicInterface, language) {
|
|
80
|
+
const { languageUtils } = atomicInterface.i18n.services;
|
|
81
|
+
const languages = languageUtils.toResolveHierarchy(languageUtils.formatLanguageCode(language), false);
|
|
82
|
+
await Promise.all(languages.filter(isI18nLocaleAvailable).map((lng)=>loadTranslationBundle(atomicInterface, lng)));
|
|
83
|
+
}
|
|
84
|
+
function loadTranslationBundle(atomicInterface, lng) {
|
|
80
85
|
const { i18n } = atomicInterface;
|
|
81
|
-
const lng = language.split('-')[0];
|
|
82
86
|
return new Promise((resolve)=>{
|
|
83
87
|
new (external_i18next_http_backend_default())(i18n.services, i18nBackendOptions(atomicInterface)).read(lng, i18nTranslationNamespace, (_error, data)=>{
|
|
84
88
|
if (data) i18n.addResourceBundle(lng, i18nTranslationNamespace, data, true, false);
|
|
@@ -53,8 +53,10 @@ class InterfaceController {
|
|
|
53
53
|
this.host.updateIconAssetsPath();
|
|
54
54
|
initEngine();
|
|
55
55
|
if (this.host.registerFieldsToInclude) this.host.registerFieldsToInclude();
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
await Promise.all([
|
|
57
|
+
this.i18nPromise,
|
|
58
|
+
(0, dayjs_locales_cjs_namespaceObject.loadDayjsLocale)(this.host.language || 'en')
|
|
59
|
+
]);
|
|
58
60
|
this.initComponents();
|
|
59
61
|
}
|
|
60
62
|
onAnalyticsChange() {
|
|
@@ -67,8 +69,10 @@ class InterfaceController {
|
|
|
67
69
|
const language = newLanguage ?? this.host.language;
|
|
68
70
|
const languageWithFallback = language ?? 'en';
|
|
69
71
|
const { i18n } = this.host;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
Promise.all([
|
|
73
|
+
(0, dayjs_locales_cjs_namespaceObject.loadDayjsLocale)(languageWithFallback),
|
|
74
|
+
(0, external_i18n_cjs_namespaceObject.loadTranslations)(this.host, languageWithFallback)
|
|
75
|
+
]).then(()=>{
|
|
72
76
|
i18n.changeLanguage(language);
|
|
73
77
|
});
|
|
74
78
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
class PagerFitController {
|
|
31
|
+
hostConnected() {
|
|
32
|
+
this.resizeObserver = new ResizeObserver(()=>requestAnimationFrame(()=>this.reset()));
|
|
33
|
+
this.resizeObserver.observe(document.documentElement);
|
|
34
|
+
if (this.host.parentElement) this.resizeObserver.observe(this.host.parentElement);
|
|
35
|
+
}
|
|
36
|
+
hostDisconnected() {
|
|
37
|
+
this.resizeObserver?.disconnect();
|
|
38
|
+
}
|
|
39
|
+
hostUpdated() {
|
|
40
|
+
const root = this.host.shadowRoot;
|
|
41
|
+
const previousButton = root?.querySelector('[part="previous-button"]');
|
|
42
|
+
const nextButton = root?.querySelector('[part="next-button"]');
|
|
43
|
+
const pageButtonCount = root?.querySelectorAll('[part~="page-button"]').length ?? 0;
|
|
44
|
+
const isWrapping = !!previousButton && !!nextButton && nextButton.offsetTop > previousButton.offsetTop;
|
|
45
|
+
if (isWrapping && pageButtonCount > 1) {
|
|
46
|
+
this.maxPages = pageButtonCount - 1;
|
|
47
|
+
queueMicrotask(()=>this.host.requestUpdate());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
getNumberOfPagesToDisplay(numberOfPages) {
|
|
51
|
+
return Math.min(numberOfPages, this.maxPages);
|
|
52
|
+
}
|
|
53
|
+
reset() {
|
|
54
|
+
this.maxPages = 1 / 0;
|
|
55
|
+
this.host.requestUpdate();
|
|
56
|
+
}
|
|
57
|
+
constructor(host){
|
|
58
|
+
this.host = host;
|
|
59
|
+
this.maxPages = 1 / 0;
|
|
60
|
+
host.addController(this);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
64
|
+
PagerFitController: ()=>PagerFitController
|
|
65
|
+
});
|
|
66
|
+
exports.PagerFitController = __webpack_exports__.PagerFitController;
|
|
67
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
68
|
+
"PagerFitController"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -37,43 +37,24 @@ var __webpack_require__ = {};
|
|
|
37
37
|
var __webpack_exports__ = {};
|
|
38
38
|
__webpack_require__.r(__webpack_exports__);
|
|
39
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
loadQueryErrorIcon: ()=>loadQueryErrorIcon,
|
|
40
41
|
renderQueryErrorIcon: ()=>renderQueryErrorIcon
|
|
41
42
|
});
|
|
42
43
|
const external_lit_namespaceObject = require("lit");
|
|
43
|
-
const
|
|
44
|
-
var cannot_access_cjs_default = /*#__PURE__*/ __webpack_require__.n(cannot_access_cjs_namespaceObject);
|
|
45
|
-
const indexing_cjs_namespaceObject = require("../../../images/indexing.cjs");
|
|
46
|
-
var indexing_cjs_default = /*#__PURE__*/ __webpack_require__.n(indexing_cjs_namespaceObject);
|
|
44
|
+
const until_js_namespaceObject = require("lit/directives/until.js");
|
|
47
45
|
const no_connection_cjs_namespaceObject = require("../../../images/no-connection.cjs");
|
|
48
46
|
var no_connection_cjs_default = /*#__PURE__*/ __webpack_require__.n(no_connection_cjs_namespaceObject);
|
|
49
|
-
const search_inactive_cjs_namespaceObject = require("../../../images/search-inactive.cjs");
|
|
50
|
-
var search_inactive_cjs_default = /*#__PURE__*/ __webpack_require__.n(search_inactive_cjs_namespaceObject);
|
|
51
|
-
const something_wrong_cjs_namespaceObject = require("../../../images/something-wrong.cjs");
|
|
52
|
-
var something_wrong_cjs_default = /*#__PURE__*/ __webpack_require__.n(something_wrong_cjs_namespaceObject);
|
|
53
47
|
require("../atomic-icon/atomic-icon.cjs");
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
switch(props.errorType){
|
|
57
|
-
case 'Disconnected':
|
|
58
|
-
return no_connection_cjs_default();
|
|
59
|
-
case 'NoEndpointsException':
|
|
60
|
-
return indexing_cjs_default();
|
|
61
|
-
case 'InvalidTokenException':
|
|
62
|
-
return cannot_access_cjs_default();
|
|
63
|
-
case 'OrganizationIsPausedException':
|
|
64
|
-
return search_inactive_cjs_default();
|
|
65
|
-
default:
|
|
66
|
-
return something_wrong_cjs_default();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
return (0, external_lit_namespaceObject.html)`<atomic-icon
|
|
48
|
+
const loadQueryErrorIcon = (errorType, loadIcons = ()=>import("./icons.cjs"))=>'Disconnected' === errorType ? no_connection_cjs_default() : loadIcons().then(({ getQueryErrorIcon })=>getQueryErrorIcon(errorType)).catch(()=>'');
|
|
49
|
+
const renderQueryErrorIcon = ({ props })=>(0, external_lit_namespaceObject.html)`<atomic-icon
|
|
70
50
|
part="icon"
|
|
71
|
-
icon=${
|
|
51
|
+
icon=${(0, until_js_namespaceObject.until)(loadQueryErrorIcon(props.errorType), '')}
|
|
72
52
|
class="w-1/2 max-w-lg"
|
|
73
53
|
></atomic-icon>`;
|
|
74
|
-
|
|
54
|
+
exports.loadQueryErrorIcon = __webpack_exports__.loadQueryErrorIcon;
|
|
75
55
|
exports.renderQueryErrorIcon = __webpack_exports__.renderQueryErrorIcon;
|
|
76
56
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
57
|
+
"loadQueryErrorIcon",
|
|
77
58
|
"renderQueryErrorIcon"
|
|
78
59
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
79
60
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
getQueryErrorIcon: ()=>getQueryErrorIcon
|
|
41
|
+
});
|
|
42
|
+
const cannot_access_cjs_namespaceObject = require("../../../images/cannot-access.cjs");
|
|
43
|
+
var cannot_access_cjs_default = /*#__PURE__*/ __webpack_require__.n(cannot_access_cjs_namespaceObject);
|
|
44
|
+
const indexing_cjs_namespaceObject = require("../../../images/indexing.cjs");
|
|
45
|
+
var indexing_cjs_default = /*#__PURE__*/ __webpack_require__.n(indexing_cjs_namespaceObject);
|
|
46
|
+
const search_inactive_cjs_namespaceObject = require("../../../images/search-inactive.cjs");
|
|
47
|
+
var search_inactive_cjs_default = /*#__PURE__*/ __webpack_require__.n(search_inactive_cjs_namespaceObject);
|
|
48
|
+
const something_wrong_cjs_namespaceObject = require("../../../images/something-wrong.cjs");
|
|
49
|
+
var something_wrong_cjs_default = /*#__PURE__*/ __webpack_require__.n(something_wrong_cjs_namespaceObject);
|
|
50
|
+
function getQueryErrorIcon(errorType) {
|
|
51
|
+
switch(errorType){
|
|
52
|
+
case 'NoEndpointsException':
|
|
53
|
+
return indexing_cjs_default();
|
|
54
|
+
case 'InvalidTokenException':
|
|
55
|
+
return cannot_access_cjs_default();
|
|
56
|
+
case 'OrganizationIsPausedException':
|
|
57
|
+
return search_inactive_cjs_default();
|
|
58
|
+
default:
|
|
59
|
+
return something_wrong_cjs_default();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.getQueryErrorIcon = __webpack_exports__.getQueryErrorIcon;
|
|
63
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
64
|
+
"getQueryErrorIcon"
|
|
65
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
66
|
+
Object.defineProperty(exports, '__esModule', {
|
|
67
|
+
value: true
|
|
68
|
+
});
|
|
@@ -29,6 +29,7 @@ var __webpack_exports__ = {};
|
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
31
|
makeDefinedConditions: ()=>makeDefinedConditions,
|
|
32
|
+
makeFieldConditions: ()=>makeFieldConditions,
|
|
32
33
|
makeMatchConditions: ()=>makeMatchConditions
|
|
33
34
|
});
|
|
34
35
|
const set_cjs_namespaceObject = require("../../../utils/set.cjs");
|
|
@@ -63,10 +64,18 @@ function makeDefinedConditions(ifDefined, ifNotDefined, helpers) {
|
|
|
63
64
|
}
|
|
64
65
|
return conditions;
|
|
65
66
|
}
|
|
67
|
+
function makeFieldConditions({ ifDefined, ifNotDefined, mustMatch, mustNotMatch }, helpers) {
|
|
68
|
+
return [
|
|
69
|
+
...makeDefinedConditions(ifDefined, ifNotDefined, helpers),
|
|
70
|
+
...makeMatchConditions(mustMatch, mustNotMatch, helpers)
|
|
71
|
+
];
|
|
72
|
+
}
|
|
66
73
|
exports.makeDefinedConditions = __webpack_exports__.makeDefinedConditions;
|
|
74
|
+
exports.makeFieldConditions = __webpack_exports__.makeFieldConditions;
|
|
67
75
|
exports.makeMatchConditions = __webpack_exports__.makeMatchConditions;
|
|
68
76
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
69
77
|
"makeDefinedConditions",
|
|
78
|
+
"makeFieldConditions",
|
|
70
79
|
"makeMatchConditions"
|
|
71
80
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
72
81
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -213,7 +213,7 @@ class AtomicInsightFacet extends external_lit_namespaceObject.LitElement {
|
|
|
213
213
|
}
|
|
214
214
|
initAriaLive() {
|
|
215
215
|
this.facetSearchAriaLiveController = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'facet-search');
|
|
216
|
-
(0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.label, (msg)=>{
|
|
216
|
+
(0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.label, (msg)=>{
|
|
217
217
|
this.facetSearchAriaLiveController.message = msg;
|
|
218
218
|
}, this.bindings.i18n);
|
|
219
219
|
}
|
|
@@ -47,6 +47,7 @@ const keyed_js_namespaceObject = require("lit/directives/keyed.js");
|
|
|
47
47
|
const when_js_namespaceObject = require("lit/directives/when.js");
|
|
48
48
|
const pager_buttons_cjs_namespaceObject = require("../../common/pager/pager-buttons.cjs");
|
|
49
49
|
const pager_navigation_cjs_namespaceObject = require("../../common/pager/pager-navigation.cjs");
|
|
50
|
+
const pager_fit_controller_cjs_namespaceObject = require("../../common/pager/pager-fit-controller.cjs");
|
|
50
51
|
const pager_utils_cjs_namespaceObject = require("../../common/pager/pager-utils.cjs");
|
|
51
52
|
const validate_props_controller_cjs_namespaceObject = require("../../common/validate-props-controller/validate-props-controller.cjs");
|
|
52
53
|
const bind_state_cjs_namespaceObject = require("../../../decorators/bind-state.cjs");
|
|
@@ -80,7 +81,7 @@ class AtomicInsightPager extends external_lit_namespaceObject.LitElement {
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
render() {
|
|
83
|
-
const pagesRange = (0, pager_utils_cjs_namespaceObject.getCurrentPagesRange)(this.pagerState.currentPage - 1, this.numberOfPages, this.pagerState.maxPage);
|
|
84
|
+
const pagesRange = (0, pager_utils_cjs_namespaceObject.getCurrentPagesRange)(this.pagerState.currentPage - 1, this.pagerFit.getNumberOfPagesToDisplay(this.numberOfPages), this.pagerState.maxPage);
|
|
84
85
|
return (0, external_lit_namespaceObject.html)`${(0, when_js_namespaceObject.when)(this.pagerState.maxPage > 1, ()=>(0, external_lit_namespaceObject.html)`
|
|
85
86
|
${(0, pager_navigation_cjs_namespaceObject.renderPagerNavigation)({
|
|
86
87
|
props: {
|
|
@@ -149,7 +150,7 @@ class AtomicInsightPager extends external_lit_namespaceObject.LitElement {
|
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
152
|
constructor(){
|
|
152
|
-
super(), this.numberOfPages = 5, this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'atomic-insight-pager');
|
|
153
|
+
super(), this.numberOfPages = 5, this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'atomic-insight-pager'), this.pagerFit = new pager_fit_controller_cjs_namespaceObject.PagerFitController(this);
|
|
153
154
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
154
155
|
numberOfPages: this.numberOfPages
|
|
155
156
|
}), AtomicInsightPager.propsSchema);
|
|
@@ -51,11 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
|
|
|
51
51
|
class AtomicInsightResultChildrenTemplate extends external_lit_namespaceObject.LitElement {
|
|
52
52
|
connectedCallback() {
|
|
53
53
|
super.connectedCallback();
|
|
54
|
-
this.
|
|
55
|
-
...this.conditions,
|
|
56
|
-
...(0, template_utils_cjs_namespaceObject.makeDefinedConditions)(this.ifDefined, this.ifNotDefined, insight_namespaceObject.ResultTemplatesHelpers)
|
|
57
|
-
];
|
|
58
|
-
this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, insight_namespaceObject.ResultTemplatesHelpers);
|
|
54
|
+
this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, insight_namespaceObject.ResultTemplatesHelpers);
|
|
59
55
|
}
|
|
60
56
|
render() {
|
|
61
57
|
return external_lit_namespaceObject.nothing;
|