@coveo/atomic 3.34.0-pre.d34e47bc86 → 3.34.0-pre.d6630bb1de
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/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/atomic.esm.js.map +1 -1
- package/dist/atomic/components/_index.d.ts +0 -2
- package/dist/atomic/components/_index.js +0 -1
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-category-facet.js +1 -1
- package/dist/atomic/components/atomic-facet.js +1 -1
- package/dist/atomic/components/atomic-format-currency.js +1 -1
- package/dist/atomic/components/atomic-format-number.js +1 -1
- package/dist/atomic/components/atomic-format-unit.js +1 -1
- package/dist/atomic/components/atomic-insight-pager.js +38 -2
- package/dist/atomic/components/atomic-insight-pager.js.map +1 -1
- package/dist/atomic/components/atomic-numeric-facet.js +1 -1
- package/dist/atomic/components/atomic-query-error.js +1 -1
- package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
- package/dist/atomic/components/atomic-quickview.js +1 -1
- package/dist/atomic/components/atomic-refine-modal2.js +1 -1
- package/dist/atomic/components/atomic-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-relevance-inspector.js +2 -2
- package/dist/atomic/components/atomic-result-children.js +1 -1
- package/dist/atomic/components/atomic-result-fields-list.js +1 -1
- package/dist/atomic/components/atomic-result-link.js +1 -1
- package/dist/atomic/components/atomic-result-list.js +1 -1
- package/dist/atomic/components/atomic-result-table-placeholder2.js +1 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +1 -1
- package/dist/atomic/components/atomic-search-box-recent-queries2.js +1 -1
- package/dist/atomic/components/atomic-search-box.js +3 -3
- package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
- package/dist/atomic/components/atomic-sort-dropdown.js +2 -2
- package/dist/atomic/components/atomic-sort-expression.js +1 -1
- package/dist/atomic/components/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js +25 -11
- package/dist/atomic/components/components/search/atomic-pager/atomic-pager.js +188 -0
- package/dist/atomic/components/components/search/index.js +1 -0
- package/dist/atomic/components/components/search/lazy-index.js +1 -0
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/{p-4ca51934.entry.js → p-0110f06c.entry.js} +2 -2
- package/dist/atomic/{p-503ecb6d.js → p-04a5acdf.js} +2 -2
- package/dist/atomic/{p-4ae14373.entry.js → p-0bdd730f.entry.js} +2 -2
- package/dist/atomic/{p-74822069.entry.js → p-13391e75.entry.js} +2 -2
- package/dist/atomic/{p-8103bad3.entry.js → p-16f6c1f3.entry.js} +2 -2
- package/dist/atomic/{p-e3edbf14.entry.js → p-20764605.entry.js} +2 -2
- package/dist/atomic/{p-20019654.entry.js → p-3a7a1a00.entry.js} +2 -2
- package/dist/atomic/{p-f073a78d.entry.js → p-3cbab25b.entry.js} +2 -2
- package/dist/atomic/{p-6abd5b2b.entry.js → p-3e9db2b5.entry.js} +2 -2
- package/dist/atomic/{p-dfc385b7.entry.js → p-4601eb93.entry.js} +2 -2
- package/dist/atomic/{p-44ef70b6.entry.js → p-475124d2.entry.js} +2 -2
- package/dist/atomic/{p-0402ee69.entry.js → p-59f043a0.entry.js} +2 -2
- package/dist/atomic/{p-8acb1466.entry.js → p-60800b2f.entry.js} +2 -2
- package/dist/atomic/{p-3e38aea6.entry.js → p-7c3c5f07.entry.js} +2 -2
- package/dist/atomic/{p-aa616502.entry.js → p-7ec6dd3e.entry.js} +2 -2
- package/dist/atomic/{p-b7cd0342.entry.js → p-86bde026.entry.js} +2 -2
- package/dist/atomic/{p-4b9a166f.entry.js → p-88af4470.entry.js} +2 -2
- package/dist/atomic/{p-62afcf79.entry.js → p-8fdef8a3.entry.js} +2 -2
- package/dist/atomic/{p-30411cd4.entry.js → p-97ce3384.entry.js} +2 -2
- package/dist/atomic/{p-b4ad3036.entry.js → p-a5714bc4.entry.js} +2 -2
- package/dist/atomic/{p-45c76d98.entry.js → p-bd3542d2.entry.js} +2 -2
- package/dist/atomic/{p-df1d50c8.entry.js → p-dbcef3a9.entry.js} +2 -2
- package/dist/atomic/{p-c724e6d8.entry.js → p-dd532d1b.entry.js} +2 -2
- package/dist/atomic/{p-d8028950.entry.js → p-de687bed.entry.js} +2 -2
- package/dist/atomic/{p-516b8165.entry.js → p-df4397ab.entry.js} +2 -2
- package/dist/atomic/{p-d2d22ab2.entry.js → p-e398835b.entry.js} +2 -2
- package/dist/atomic/p-fdcd187d.entry.js +2 -0
- package/dist/atomic/p-fdcd187d.entry.js.map +1 -0
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-c90ee350.js → analytics-config-115e4f90.js} +2 -2
- package/dist/cjs/{analytics-config-c90ee350.js.map → analytics-config-115e4f90.js.map} +1 -1
- package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-format-currency.cjs.entry.js +1 -1
- package/dist/cjs/atomic-format-number.cjs.entry.js +1 -1
- package/dist/cjs/atomic-format-unit.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-pager.cjs.entry.js +41 -7
- package/dist/cjs/atomic-insight-pager.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-query-error.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-quickview.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-refine-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-relevance-inspector.cjs.entry.js +2 -2
- package/dist/cjs/atomic-result-children.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-fields-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-link.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-result-placeholder_8.cjs.entry.js +1 -1
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-search-box.cjs.entry.js +3 -3
- package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-sort-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/atomic-sort-expression.cjs.entry.js +1 -1
- package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/index-757bc886.js +0 -4
- package/dist/cjs/version.cjs.js +2 -2
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-77dd2f9a.js → analytics-config-007c200a.js} +2 -2
- package/dist/esm/{analytics-config-77dd2f9a.js.map → analytics-config-007c200a.js.map} +1 -1
- package/dist/esm/atomic-category-facet.entry.js +1 -1
- package/dist/esm/atomic-facet.entry.js +1 -1
- package/dist/esm/atomic-format-currency.entry.js +1 -1
- package/dist/esm/atomic-format-number.entry.js +1 -1
- package/dist/esm/atomic-format-unit.entry.js +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-insight-pager.entry.js +38 -4
- package/dist/esm/atomic-insight-pager.entry.js.map +1 -1
- package/dist/esm/atomic-numeric-facet.entry.js +1 -1
- package/dist/esm/atomic-query-error.entry.js +1 -1
- package/dist/esm/atomic-quickview-modal.entry.js +1 -1
- package/dist/esm/atomic-quickview.entry.js +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-refine-modal.entry.js +1 -1
- package/dist/esm/atomic-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-relevance-inspector.entry.js +2 -2
- package/dist/esm/atomic-result-children.entry.js +1 -1
- package/dist/esm/atomic-result-fields-list.entry.js +1 -1
- package/dist/esm/atomic-result-link.entry.js +1 -1
- package/dist/esm/atomic-result-list.entry.js +1 -1
- package/dist/esm/atomic-result-placeholder_8.entry.js +1 -1
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +2 -2
- package/dist/esm/atomic-search-box.entry.js +3 -3
- package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-sort-dropdown.entry.js +2 -2
- package/dist/esm/atomic-sort-expression.entry.js +1 -1
- package/dist/esm/atomic-tab-manager.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/index-3f35faca.js +0 -4
- package/dist/esm/version.js +2 -2
- package/dist/types/components/commerce/atomic-commerce-pager/atomic-commerce-pager.d.ts +5 -3
- package/dist/types/components/search/atomic-pager/atomic-pager.d.ts +28 -16
- package/dist/types/components/search/index.d.ts +1 -0
- package/dist/types/components.d.ts +0 -65
- package/docs/atomic-docs.json +1 -167
- package/package.json +4 -4
- package/dist/atomic/components/atomic-pager.d.ts +0 -11
- package/dist/atomic/components/atomic-pager.js +0 -134
- package/dist/atomic/components/atomic-pager.js.map +0 -1
- package/dist/atomic/components/stencil-pager-navigation.js +0 -42
- package/dist/atomic/components/stencil-pager-navigation.js.map +0 -1
- package/dist/atomic/p-1201bf3d.entry.js +0 -2
- package/dist/atomic/p-1201bf3d.entry.js.map +0 -1
- package/dist/atomic/p-145e3a1c.entry.js +0 -2
- package/dist/atomic/p-145e3a1c.entry.js.map +0 -1
- package/dist/atomic/p-211d7d6a.js +0 -2
- package/dist/atomic/p-211d7d6a.js.map +0 -1
- package/dist/cjs/atomic-pager.cjs.entry.js +0 -121
- package/dist/cjs/atomic-pager.cjs.entry.js.map +0 -1
- package/dist/cjs/stencil-pager-navigation-c20b8a95.js +0 -48
- package/dist/cjs/stencil-pager-navigation-c20b8a95.js.map +0 -1
- package/dist/esm/atomic-pager.entry.js +0 -117
- package/dist/esm/atomic-pager.entry.js.map +0 -1
- package/dist/esm/stencil-pager-navigation-7261a834.js +0 -42
- package/dist/esm/stencil-pager-navigation-7261a834.js.map +0 -1
- /package/dist/atomic/{p-4ca51934.entry.js.map → p-0110f06c.entry.js.map} +0 -0
- /package/dist/atomic/{p-503ecb6d.js.map → p-04a5acdf.js.map} +0 -0
- /package/dist/atomic/{p-4ae14373.entry.js.map → p-0bdd730f.entry.js.map} +0 -0
- /package/dist/atomic/{p-74822069.entry.js.map → p-13391e75.entry.js.map} +0 -0
- /package/dist/atomic/{p-8103bad3.entry.js.map → p-16f6c1f3.entry.js.map} +0 -0
- /package/dist/atomic/{p-e3edbf14.entry.js.map → p-20764605.entry.js.map} +0 -0
- /package/dist/atomic/{p-20019654.entry.js.map → p-3a7a1a00.entry.js.map} +0 -0
- /package/dist/atomic/{p-f073a78d.entry.js.map → p-3cbab25b.entry.js.map} +0 -0
- /package/dist/atomic/{p-6abd5b2b.entry.js.map → p-3e9db2b5.entry.js.map} +0 -0
- /package/dist/atomic/{p-dfc385b7.entry.js.map → p-4601eb93.entry.js.map} +0 -0
- /package/dist/atomic/{p-44ef70b6.entry.js.map → p-475124d2.entry.js.map} +0 -0
- /package/dist/atomic/{p-0402ee69.entry.js.map → p-59f043a0.entry.js.map} +0 -0
- /package/dist/atomic/{p-8acb1466.entry.js.map → p-60800b2f.entry.js.map} +0 -0
- /package/dist/atomic/{p-3e38aea6.entry.js.map → p-7c3c5f07.entry.js.map} +0 -0
- /package/dist/atomic/{p-aa616502.entry.js.map → p-7ec6dd3e.entry.js.map} +0 -0
- /package/dist/atomic/{p-b7cd0342.entry.js.map → p-86bde026.entry.js.map} +0 -0
- /package/dist/atomic/{p-4b9a166f.entry.js.map → p-88af4470.entry.js.map} +0 -0
- /package/dist/atomic/{p-62afcf79.entry.js.map → p-8fdef8a3.entry.js.map} +0 -0
- /package/dist/atomic/{p-30411cd4.entry.js.map → p-97ce3384.entry.js.map} +0 -0
- /package/dist/atomic/{p-b4ad3036.entry.js.map → p-a5714bc4.entry.js.map} +0 -0
- /package/dist/atomic/{p-45c76d98.entry.js.map → p-bd3542d2.entry.js.map} +0 -0
- /package/dist/atomic/{p-df1d50c8.entry.js.map → p-dbcef3a9.entry.js.map} +0 -0
- /package/dist/atomic/{p-c724e6d8.entry.js.map → p-dd532d1b.entry.js.map} +0 -0
- /package/dist/atomic/{p-d8028950.entry.js.map → p-de687bed.entry.js.map} +0 -0
- /package/dist/atomic/{p-516b8165.entry.js.map → p-df4397ab.entry.js.map} +0 -0
- /package/dist/atomic/{p-d2d22ab2.entry.js.map → p-e398835b.entry.js.map} +0 -0
@@ -37,7 +37,7 @@ const AtomicQueryError$1 = /*@__PURE__*/ proxyCustomElement(class AtomicQueryErr
|
|
37
37
|
if (hasError) {
|
38
38
|
this.ariaMessage = getAriaMessageFromErrorType(i18n, organizationId, url, error?.type);
|
39
39
|
}
|
40
|
-
return (h(QueryErrorGuard, { key: '
|
40
|
+
return (h(QueryErrorGuard, { key: '7ef7df7b13ffb36716015ddcd559a725772905a0', hasError: hasError }, h(QueryErrorContainer, { key: 'de8c0f4c161db29b3b8f410863ea44c7ae16a5b8' }, h(QueryErrorIcon, { key: '1c5270d79647902695223f305f2774580cc6c7b9', errorType: error?.type }), h(QueryErrorTitle, { key: '71cf91d37e4eb1a27ad511f9bd9d6a42058af304', errorType: error?.type, i18n: i18n, organizationId: organizationId }), h(QueryErrorDescription, { key: 'd1dc91dcddcb595f530aad1a2bd802cd062deb1c', i18n: i18n, organizationId: organizationId, url: url, errorType: error?.type }), h(QueryErrorShowMore, { key: 'aaf95d510291dd3043da8f4f9a9b22f2bff5fcf8', link: h(QueryErrorLink, { i18n: i18n, errorType: error?.type }), onShowMore: () => (this.showMoreInfo = !this.showMoreInfo), i18n: i18n }), h(QueryErrorDetails, { key: 'ccb1b03edbe743197d239ac365ae0423f103adb0', error: error, show: this.showMoreInfo }))));
|
41
41
|
}
|
42
42
|
static get style() { return AtomicQueryErrorStyle0; }
|
43
43
|
}, [1, "atomic-query-error", {
|
@@ -582,7 +582,7 @@ const AtomicQuickviewModal = /*@__PURE__*/ proxyCustomElement(class AtomicQuickv
|
|
582
582
|
});
|
583
583
|
}
|
584
584
|
render() {
|
585
|
-
return (h("atomic-modal", { key: '
|
585
|
+
return (h("atomic-modal", { key: '84b950ecdc79dd6a1b53d3af44c62219740bc572', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
|
586
586
|
}
|
587
587
|
static get watchers() { return {
|
588
588
|
"highlightKeywords": ["watchHighlightKeywords"]
|
@@ -106,7 +106,7 @@ const AtomicQuickview$1 = /*@__PURE__*/ proxyCustomElement(class AtomicQuickview
|
|
106
106
|
}
|
107
107
|
render() {
|
108
108
|
if (this.quickviewState.resultHasPreview) {
|
109
|
-
return (h(Button, { key: '
|
109
|
+
return (h(Button, { key: '4e34bfe78864244b13813fb9113b90d2a7658506', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, h("atomic-icon", { key: '2d96d58b8e4b63f21bf8f40c2a5383d7711fa59f', part: "icon", class: "flex w-5 justify-center", icon: QuickviewIcon })));
|
110
110
|
}
|
111
111
|
}
|
112
112
|
static get style() { return AtomicQuickviewStyle0; }
|
@@ -204,7 +204,7 @@ const AtomicRefineModal = /*@__PURE__*/ proxyCustomElement(class AtomicRefineMod
|
|
204
204
|
return (h(RefineModalFiltersSection, { i18n: i18n, withFacets: hasFacetElements, withAutomaticFacets: hasAutomaticFacets }, this.breadcrumbManagerState.hasBreadcrumbs && (h(RefineModalFiltersClearButton, { i18n: i18n, onClick: () => this.breadcrumbManager.deselectAll() }))));
|
205
205
|
}
|
206
206
|
render() {
|
207
|
-
return (h(RefineModal, { key: '
|
207
|
+
return (h(RefineModal, { key: 'c1903b44e0c9deffc57515099a0993203c92c9b7', i18n: this.bindings.i18n, host: this.host, isOpen: this.isOpen, onClose: () => (this.isOpen = false), title: this.bindings.i18n.t('sort-and-filter'), numberOfItems: this.querySummaryState.total, openButton: this.openButton }, h(RefineModalBody, { key: '7a48ac497f20763f538e115965d34e1f6eb776b7' }, this.renderSort(), this.renderFilters())));
|
208
208
|
}
|
209
209
|
componentDidLoad() {
|
210
210
|
this.host.style.display = '';
|
@@ -68,7 +68,7 @@ const AtomicRefineToggle$1 = /*@__PURE__*/ proxyCustomElement(class AtomicRefine
|
|
68
68
|
this.modalRef && (this.modalRef.isOpen = true);
|
69
69
|
}
|
70
70
|
render() {
|
71
|
-
return (h(RefineToggleGuard, { key: '
|
71
|
+
return (h(RefineToggleGuard, { key: '83730811042478dfaec5eab5fadc9ec63b613721', firstRequestExecuted: this.searchStatusState.firstSearchExecuted, hasError: this.searchStatusState.hasError, hasItems: this.searchStatusState.hasResults }, h(RefineToggleButton, { key: '8e9781b72935261a0ab7fc3009bb479ad1f65936', i18n: this.bindings.i18n, onClick: () => this.enableModal(), setRef: (button) => {
|
72
72
|
if (!button) {
|
73
73
|
return;
|
74
74
|
}
|
@@ -16,9 +16,9 @@ const AtomicRelevanceInspector$1 = /*@__PURE__*/ proxyCustomElement(class Atomic
|
|
16
16
|
this.open = false;
|
17
17
|
}
|
18
18
|
render() {
|
19
|
-
return (h("atomic-modal", { key: '
|
19
|
+
return (h("atomic-modal", { key: 'e809eacbd92d6aa2217113cc333e350d8a2d4d85', exportparts: "footer", isOpen: this.open, close: () => {
|
20
20
|
this.closeRelevanceInspector?.emit();
|
21
|
-
} }, h("p", { key: '
|
21
|
+
} }, h("p", { key: '263264d8fa09af2b69600ecaf18d61a126966d34', slot: "header" }, "Open the relevance inspector"), h("p", { key: 'cd9e787accfb369d1b7999e24947db72909eb037', slot: "body" }, "The Relevance Inspector will open in the Coveo Administration Console."), h("div", { key: '1bcea9f1ad1a48607c841c1279bf6c0cf12352d7', slot: "footer", class: "flex w-full items-center justify-end" }, h(Button, { key: '3fc7c82a1f993104ca889a93ceadbef6a244f524', style: "outline-primary", class: "mr-2 p-2", onClick: () => this.closeRelevanceInspector?.emit() }, "Ignore"), h("a", { key: '5ca578e81b6e3215165f512bb60440f0680cb73d', class: "btn-primary p-2", target: "_blank", href: this.adminHref, onClick: () => this.closeRelevanceInspector?.emit() }, "Open"))));
|
22
22
|
}
|
23
23
|
get adminHref() {
|
24
24
|
const { organizationId, environment } = this.bindings.engine.state.configuration;
|
@@ -138,7 +138,7 @@ const AtomicResultChildren$1 = /*@__PURE__*/ proxyCustomElement(class AtomicResu
|
|
138
138
|
return (h(ChildrenWrapper, { hasChildren: children.length > 0 }, children.map((child, i) => this.renderChild(child, i === children.length - 1))));
|
139
139
|
}
|
140
140
|
render() {
|
141
|
-
return (h(ResultChildrenGuard, { key: '
|
141
|
+
return (h(ResultChildrenGuard, { key: '78cc57aacc5e31fe241f290e38a2fe363ca22852', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
|
142
142
|
}
|
143
143
|
get host() { return this; }
|
144
144
|
static get style() { return AtomicResultChildrenStyle0; }
|
@@ -98,7 +98,7 @@ const AtomicResultFieldsList$1 = /*@__PURE__*/ proxyCustomElement(class AtomicRe
|
|
98
98
|
}
|
99
99
|
}
|
100
100
|
render() {
|
101
|
-
return h(Host, { key: '
|
101
|
+
return h(Host, { key: '8a554da4b25cd72108826703cfc60e26c74a7562' });
|
102
102
|
}
|
103
103
|
get host() { return this; }
|
104
104
|
static get style() { return AtomicResultFieldsListStyle0; }
|
@@ -43,7 +43,7 @@ const AtomicResultLink$1 = /*@__PURE__*/ proxyCustomElement(class AtomicResultLi
|
|
43
43
|
const href = isUndefined(this.hrefTemplate)
|
44
44
|
? this.result.clickUri
|
45
45
|
: buildStringTemplateFromResult(this.hrefTemplate, this.result, this.bindings);
|
46
|
-
return (h(LinkWithItemAnalytics, { key: '
|
46
|
+
return (h(LinkWithItemAnalytics, { key: '66f88ff6735899ea2aded08b2da9871cc98963c6', href: href, onSelect: () => this.interactiveResult.select(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (h("slot", null)) : (h("atomic-result-text", { field: "title", default: "no-title" }))));
|
47
47
|
}
|
48
48
|
get host() { return this; }
|
49
49
|
static get style() { return AtomicResultLinkStyle0; }
|
@@ -194,7 +194,7 @@ const AtomicResultList$1 = /*@__PURE__*/ proxyCustomElement(class AtomicResultLi
|
|
194
194
|
render() {
|
195
195
|
this.resultListCommon.updateBreakpoints();
|
196
196
|
const listClasses = this.computeListDisplayClasses();
|
197
|
-
return (h(TabGuard, { key: '
|
197
|
+
return (h(TabGuard, { key: 'b0ff0e3012ca64073a2ff66eeb16bc98e664dc50', tabsIncluded: this.tabsIncluded, tabsExcluded: this.tabsExcluded, activeTab: this.tabManagerState.activeTab }, h(ItemListGuard, { key: '2edd5822368238752cfd611eed25022abb81fbd8', hasError: this.resultListState.hasError, hasTemplate: this.resultTemplateRegistered, templateHasError: this.itemTemplateProvider.hasError, firstRequestExecuted: this.resultListState.firstSearchExecuted, hasItems: this.resultListState.hasResults }, h(DisplayWrapper, { key: 'c29a9d2af689775616355a42d5fe7f43bcf51ea8', display: this.display, listClasses: listClasses }, h(ResultsPlaceholdersGuard, { key: 'e62e986ea55a9349467b8d32c937281fc3434f44', density: this.density, display: this.display, imageSize: this.imageSize, displayPlaceholders: !this.isAppLoaded, numberOfPlaceholders: this.resultsPerPageState.numberOfResults }), h(ItemDisplayGuard, { key: 'f12f2f7b1d0a2e6ee7c8a59ff2a6ba8f31b8bb5a', firstRequestExecuted: this.resultListState.firstSearchExecuted, hasItems: this.resultListState.hasResults }, this.display === 'table'
|
198
198
|
? this.renderAsTable()
|
199
199
|
: this.display === 'grid'
|
200
200
|
? this.renderAsGrid()
|
@@ -18,7 +18,7 @@ const AtomicResultTablePlaceholder = /*@__PURE__*/ proxyCustomElement(class Atom
|
|
18
18
|
return getItemDisplayClasses('table', this.density, this.imageSize);
|
19
19
|
}
|
20
20
|
render() {
|
21
|
-
return (h("table", { key: '
|
21
|
+
return (h("table", { key: 'aaef2b349a7fd003ac467e35bd8f252a9ebf948d', class: `list-root animate-pulse ${this.getClasses().join(' ')}` }, h("thead", { key: '52059a56d86650fb006ef5bb5d58e22da90ec522' }, h("tr", { key: '95c0b6ea3fffbe42413c8acbe20db317162576b9' }, h("th", { key: '96c14b820260010d8de3b05898c00ff6d15cc0ef' }, h("div", { key: '0055b9fea2ffce1a7546c5bb6216bc3bb5a317db', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '14.5rem' } })), h("th", { key: '2c617a8d714305de201fbfdfac6dd52f8cb69148' }, h("div", { key: '068b1cc654f27b33cdc502d416daf1c081d4cf19', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '9.75rem' } })), h("th", { key: '55a625ccff48da33184579efda097724d200f7ac' }, h("div", { key: '0a843d33317e3d86b9229cc9a73e1a0b2087e34e', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '6.5rem' } })))), h("tbody", { key: '62ca6c923527954dc76cd5c398fe7ab04772f8a7' }, Array.from({ length: this.rows }, () => (h("tr", null, h("td", null, h("div", { class: `mb-6 h-8 ${placeholderClasses}`, style: { width: '22.875rem' } }), h("div", { class: `mb-2 h-5 ${placeholderClasses}`, style: { width: '23.75rem' } }), h("div", { class: `h-5 ${placeholderClasses}`, style: { width: '11.5rem' } })), h("td", null, h("div", { class: `mt-1.5 h-5 ${placeholderClasses}`, style: { width: '11rem' } })), h("td", null, h("div", { class: `mt-1.5 h-5 ${placeholderClasses}`, style: { width: '4.875rem' } }))))))));
|
22
22
|
}
|
23
23
|
static get style() { return AtomicResultTablePlaceholderStyle0; }
|
24
24
|
}, [1, "atomic-result-table-placeholder", {
|
@@ -60,7 +60,7 @@ const AtomicSearchBoxQuerySuggestions = /*@__PURE__*/ proxyCustomElement(class A
|
|
60
60
|
}
|
61
61
|
render() {
|
62
62
|
if (this.error) {
|
63
|
-
return (h("atomic-component-error", { key: '
|
63
|
+
return (h("atomic-component-error", { key: 'd8ace632cbbd5924ed771125cea0b395b021fe3e', element: this.host, error: this.error }));
|
64
64
|
}
|
65
65
|
}
|
66
66
|
get host() { return this; }
|
@@ -154,7 +154,7 @@ const AtomicSearchBoxRecentQueries = /*@__PURE__*/ proxyCustomElement(class Atom
|
|
154
154
|
}
|
155
155
|
render() {
|
156
156
|
if (this.error) {
|
157
|
-
return (h("atomic-component-error", { key: '
|
157
|
+
return (h("atomic-component-error", { key: '8b84892b677e093e1d3a077ba76851ccbbc6c0b1', element: this.host, error: this.error }));
|
158
158
|
}
|
159
159
|
}
|
160
160
|
get host() { return this; }
|
@@ -436,14 +436,14 @@ const AtomicSearchBox$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBox
|
|
436
436
|
if (!this.suggestionManager.suggestions.length) {
|
437
437
|
this.registerSearchboxSuggestionEvents();
|
438
438
|
}
|
439
|
-
return (h(Host, { key: '
|
440
|
-
h(SearchBoxWrapper, { key: '
|
439
|
+
return (h(Host, { key: '60105569e410916a4118616a1272ecf11aa9776b' }, this.renderAbsolutePositionSpacer(), [
|
440
|
+
h(SearchBoxWrapper, { key: 'b86013c465025b0f72853c748bdcbbc459e5442a', disabled: isDisabled, onFocusout: (event) => {
|
441
441
|
if (!isFocusingOut(event)) {
|
442
442
|
return;
|
443
443
|
}
|
444
444
|
this.suggestionManager.clearSuggestions();
|
445
445
|
this.isExpanded = false;
|
446
|
-
} }, this.renderTextBox(searchLabel), h(SubmitButton, { key: '
|
446
|
+
} }, this.renderTextBox(searchLabel), h(SubmitButton, { key: '4a39072b8cbd568e56ed78fa6d271f2ea46cf163', bindings: this.bindings, disabled: isDisabled, onClick: () => {
|
447
447
|
this.searchBox.submit();
|
448
448
|
this.suggestionManager.clearSuggestions();
|
449
449
|
} }), this.renderSuggestions()),
|
@@ -43,9 +43,9 @@ const AtomicSmartSnippetFeedbackModal = /*@__PURE__*/ proxyCustomElement(class A
|
|
43
43
|
}
|
44
44
|
render() {
|
45
45
|
updateBreakpoints(this.host);
|
46
|
-
return (h("atomic-modal", { key: '
|
46
|
+
return (h("atomic-modal", { key: '15de572eae017a51a3661f0d3b5c18b339825991', fullscreen: false, source: this.source, container: this.host, isOpen: this.isOpen, close: () => this.close(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, h(SmartSnippetFeedbackModalHeader, { key: '84c56aa5e8392b0f5e568a1383e823d1689c7ad3', i18n: this.bindings.i18n }), h(SmartSnippetFeedbackModalBody, { key: '5e8f67f08ca1c5995ef88d0df8712ef844982a4c', formId: this.formId, onSubmit: (e) => this.sendFeedback(e) }, h(SmartSnippetFeebackModalOptions, { key: '6a2bf746e7c87a9cfaf9a99352682ca74e44b3a3', i18n: this.bindings.i18n }, smartSnippetFeedbackOptions.map(({ id, localeKey, correspondingAnswer }) => (h(SmartSnippetFeedbackModalOption, { correspondingAnswer: correspondingAnswer, currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, id: id, localeKey: localeKey, onChange: () => {
|
47
47
|
this.currentAnswer = correspondingAnswer;
|
48
|
-
} })))), h(SmartSnippetFeedbackModalDetails, { key: '
|
48
|
+
} })))), h(SmartSnippetFeedbackModalDetails, { key: '6861f14c5de978693d3a181c10aeda23925fd483', currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, setDetailsInputRef: (ref) => (this.detailsInputRef = ref) })), h(SmartSnippetFeedbackModalFooter, { key: 'c3176c34b25b1fbccaabff2db741052f93a0f648', formId: this.formId, i18n: this.bindings.i18n, onClick: () => this.close() })));
|
49
49
|
}
|
50
50
|
close() {
|
51
51
|
this.isOpen = false;
|
@@ -117,8 +117,8 @@ const AtomicSortDropdown$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSortDr
|
|
117
117
|
const { hasError, hasResults, firstSearchExecuted } = this.searchStatusState;
|
118
118
|
const { bindings: { i18n }, id, } = this;
|
119
119
|
return [
|
120
|
-
h(SortGuard, { key: '
|
121
|
-
h("slot", { key: '
|
120
|
+
h(SortGuard, { key: 'a4cecb87aacaf7058d5e6160a0cd7c22adb02247', firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: hasResults }, h(SortContainer, { key: '6aac17b39117336e846024e21fa5a268db1a31f6' }, h(SortLabel, { key: 'f57ce4c3c215744c8ec69730e9d413fbe1b8af90', i18n: i18n, id: id }), h(SortSelect, { key: '87a7a8291e300e1732e72d4fc09d2871f2beac60', i18n: i18n, id: id, onSelect: (evt) => this.select(evt) }, this.options.map(({ label, criteria, expression }) => (h(SortOption, { i18n: i18n, label: label, selected: this.sort.isSortedBy(criteria), value: expression })))))),
|
121
|
+
h("slot", { key: '4527e008ad3be24bf18714d4af1f18f24148a43c' }),
|
122
122
|
];
|
123
123
|
}
|
124
124
|
get host() { return this; }
|
@@ -47,7 +47,7 @@ const AtomicSortExpression$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSort
|
|
47
47
|
const dropdownComponent = 'atomic-sort-dropdown';
|
48
48
|
if (!this.host.closest(dropdownComponent)) {
|
49
49
|
const error = new Error(`The "${this.host.nodeName.toLowerCase()}" component has to be used inside an ${dropdownComponent} element.`);
|
50
|
-
return (h("atomic-component-error", { key: '
|
50
|
+
return (h("atomic-component-error", { key: 'e6f4618bff3c867c11f3abc7d0d8916bed9d9490', element: this.host, error: error }));
|
51
51
|
}
|
52
52
|
}
|
53
53
|
get host() { return this; }
|
@@ -59,7 +59,7 @@ const AtomicTabManager$1 = /*@__PURE__*/ proxyCustomElement(class AtomicTabManag
|
|
59
59
|
});
|
60
60
|
}
|
61
61
|
render() {
|
62
|
-
return (h(Host, { key: '
|
62
|
+
return (h(Host, { key: 'ae4d45e9174c3cc0b4fe07435cbd062ec2d06a7a' }, h("atomic-tab-bar", { key: '3fd543b6b72ad9a51c11b527f3b8b0eaceaef7cf' }, h("div", { key: '5e1b5be5dc3ca9974633dea1da3619281122f8f6', role: "list", "aria-label": "tab-area", part: "tab-area", class: "border-neutral mb-2 flex w-full flex-row border-b" }, this.tabs.map((tab) => (h("atomic-tab-button", { active: this.tabManagerState.activeTab === tab.name, label: this.bindings.i18n.t(tab.label, {
|
63
63
|
defaultValue: tab.label,
|
64
64
|
}), select: () => {
|
65
65
|
if (!tab.tabController.state.isActive) {
|
package/dist/atomic/components/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js
CHANGED
@@ -4,10 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
+
var AtomicCommercePager_1;
|
7
8
|
import { NumberValue, Schema } from '@coveo/bueno';
|
8
9
|
import { buildProductListing, buildSearch, } from '@coveo/headless/commerce';
|
9
10
|
import { html, LitElement } from 'lit';
|
10
11
|
import { customElement, property, state } from 'lit/decorators.js';
|
12
|
+
import { keyed } from 'lit/directives/keyed.js';
|
11
13
|
import { when } from 'lit/directives/when.js';
|
12
14
|
import { bindStateToController } from "../../../decorators/bind-state";
|
13
15
|
import { bindingGuard } from "../../../decorators/binding-guard";
|
@@ -35,9 +37,10 @@ import { getCurrentPagesRange } from './commerce-pager-utils';
|
|
35
37
|
*
|
36
38
|
* @event atomic/scrollToTop - Emitted when the user clicks the next or previous button, or a page button.
|
37
39
|
*/
|
38
|
-
let AtomicCommercePager = class AtomicCommercePager extends LitElement {
|
40
|
+
let AtomicCommercePager = AtomicCommercePager_1 = class AtomicCommercePager extends LitElement {
|
39
41
|
constructor() {
|
40
42
|
super(...arguments);
|
43
|
+
this.radioGroupName = randomID('atomic-commerce-pager-');
|
41
44
|
this.isAppLoaded = false;
|
42
45
|
/**
|
43
46
|
* The maximum number of page buttons to display.
|
@@ -59,7 +62,6 @@ let AtomicCommercePager = class AtomicCommercePager extends LitElement {
|
|
59
62
|
* - Use a stringified SVG to display it directly.
|
60
63
|
*/
|
61
64
|
this.nextButtonIcon = ArrowRightIcon;
|
62
|
-
this.radioGroupName = randomID('atomic-commerce-pager-');
|
63
65
|
}
|
64
66
|
initialize() {
|
65
67
|
this.validateProps();
|
@@ -74,12 +76,10 @@ let AtomicCommercePager = class AtomicCommercePager extends LitElement {
|
|
74
76
|
this.isAppLoaded = isAppLoaded;
|
75
77
|
});
|
76
78
|
}
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
numberOfPages: this.numberOfPages,
|
82
|
-
});
|
79
|
+
willUpdate(changedProperties) {
|
80
|
+
if (changedProperties.has('numberOfPages')) {
|
81
|
+
this.validateProps();
|
82
|
+
}
|
83
83
|
}
|
84
84
|
render() {
|
85
85
|
const pagesRange = getCurrentPagesRange(this.pagerState.page, this.numberOfPages, this.pagerState.totalPages - 1);
|
@@ -103,7 +103,7 @@ let AtomicCommercePager = class AtomicCommercePager extends LitElement {
|
|
103
103
|
props: {
|
104
104
|
i18n: this.bindings.i18n,
|
105
105
|
},
|
106
|
-
})(html `${pagesRange.map((pageNumber) => renderPagerPageButton({
|
106
|
+
})(html `${pagesRange.map((pageNumber, index) => keyed(`page-${pageNumber}-${index}`, renderPagerPageButton({
|
107
107
|
props: {
|
108
108
|
isSelected: pageNumber === this.pagerState.page,
|
109
109
|
ariaLabel: this.bindings.i18n.t('page-number', {
|
@@ -117,7 +117,7 @@ let AtomicCommercePager = class AtomicCommercePager extends LitElement {
|
|
117
117
|
groupName: this.radioGroupName,
|
118
118
|
text: (pageNumber + 1).toLocaleString(this.bindings.i18n.language),
|
119
119
|
},
|
120
|
-
}))}`)}
|
120
|
+
})))}`)}
|
121
121
|
${renderPagerNextButton({
|
122
122
|
props: {
|
123
123
|
icon: this.nextButtonIcon,
|
@@ -131,11 +131,25 @@ let AtomicCommercePager = class AtomicCommercePager extends LitElement {
|
|
131
131
|
})}
|
132
132
|
`)}`)}`;
|
133
133
|
}
|
134
|
+
validateProps() {
|
135
|
+
try {
|
136
|
+
AtomicCommercePager_1.propsSchema.validate({
|
137
|
+
numberOfPages: this.numberOfPages,
|
138
|
+
});
|
139
|
+
}
|
140
|
+
catch (error) {
|
141
|
+
this.error = error;
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
}
|
134
145
|
async focusOnFirstResultAndScrollToTop() {
|
135
146
|
await this.bindings.store.state.resultList?.focusOnFirstResultAfterNextSearch();
|
136
147
|
this.dispatchEvent(new CustomEvent('atomic/scrollToTop'));
|
137
148
|
}
|
138
149
|
};
|
150
|
+
AtomicCommercePager.propsSchema = new Schema({
|
151
|
+
numberOfPages: new NumberValue({ min: 0 }),
|
152
|
+
});
|
139
153
|
__decorate([
|
140
154
|
state()
|
141
155
|
], AtomicCommercePager.prototype, "bindings", void 0);
|
@@ -162,7 +176,7 @@ __decorate([
|
|
162
176
|
bindingGuard(),
|
163
177
|
errorGuard()
|
164
178
|
], AtomicCommercePager.prototype, "render", null);
|
165
|
-
AtomicCommercePager = __decorate([
|
179
|
+
AtomicCommercePager = AtomicCommercePager_1 = __decorate([
|
166
180
|
customElement('atomic-commerce-pager'),
|
167
181
|
bindings(),
|
168
182
|
withTailwindStyles
|
@@ -0,0 +1,188 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var AtomicPager_1;
|
8
|
+
import { NumberValue, Schema } from '@coveo/bueno';
|
9
|
+
import { buildPager, buildSearchStatus, } from '@coveo/headless';
|
10
|
+
import { html, LitElement } from 'lit';
|
11
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
12
|
+
import { keyed } from 'lit/directives/keyed.js';
|
13
|
+
import { when } from 'lit/directives/when.js';
|
14
|
+
import { createAppLoadedListener } from "../../common/interface/store";
|
15
|
+
import { renderPagerNavigation } from "../../common/pager/pager-navigation";
|
16
|
+
import { bindStateToController } from "../../../decorators/bind-state";
|
17
|
+
import { bindingGuard } from "../../../decorators/binding-guard";
|
18
|
+
import { bindings } from "../../../decorators/bindings";
|
19
|
+
import { errorGuard } from "../../../decorators/error-guard";
|
20
|
+
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles";
|
21
|
+
import { InitializeBindingsMixin } from "../../../mixins/bindings-mixin";
|
22
|
+
import { randomID } from "../../../utils/utils";
|
23
|
+
const ArrowLeftIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.5 4.8-4.3 4.5c-.3.4-.3.9 0 1.3l4.3 4.6c.3.4.9.4 1.2 0s.3-.9 0-1.3l-3.7-4 3.7-3.9c.3-.4.3-.9 0-1.3-.3-.3-.9-.3-1.2.1z\"/></svg>";
|
24
|
+
const ArrowRightIcon = "<svg viewBox=\"0 0 20 20\"><path d=\"m8.5 15.2 4.3-4.6c.3-.4.3-.9 0-1.3l-4.4-4.5c-.3-.4-.9-.4-1.2 0s-.3.9 0 1.3l3.7 4-3.7 3.9c-.3.4-.3.9 0 1.3.4.3 1 .3 1.3-.1z\"/></svg>";
|
25
|
+
import { renderPageButtons, renderPagerNextButton, renderPagerPageButton, renderPagerPreviousButton, } from '../../common/pager/pager-buttons';
|
26
|
+
/**
|
27
|
+
* The `atomic-pager` provides buttons that allow the end user to navigate through the different result pages.
|
28
|
+
*
|
29
|
+
* @part buttons - The list of the next/previous buttons and page-buttons.
|
30
|
+
* @part page-buttons - The list of page buttons.
|
31
|
+
* @part page-button - The individual page buttons.
|
32
|
+
* @part active-page-button - The active page button.
|
33
|
+
* @part previous-button - The previous page button.
|
34
|
+
* @part next-button - The next page button.
|
35
|
+
* @part previous-button-icon - The icon displayed on the "previous page" button.
|
36
|
+
* @part next-button-icon - The icon displayed on the "next page" button.
|
37
|
+
*
|
38
|
+
* @event atomic/scrollToTop - Emitted when the user clicks any of the buttons rendered by the component.
|
39
|
+
*/
|
40
|
+
let AtomicPager = AtomicPager_1 = class AtomicPager extends InitializeBindingsMixin(LitElement) {
|
41
|
+
constructor() {
|
42
|
+
super(...arguments);
|
43
|
+
this.isAppLoaded = false;
|
44
|
+
/**
|
45
|
+
* The maximum number of page buttons to display in the pager.
|
46
|
+
*/
|
47
|
+
this.numberOfPages = 5;
|
48
|
+
/**
|
49
|
+
* The SVG icon to render on the "previous page" button.
|
50
|
+
*
|
51
|
+
* - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.
|
52
|
+
* - Use a value that starts with `assets://`, to display an icon from the Atomic package.
|
53
|
+
* - Use a stringified SVG to display it directly.
|
54
|
+
*/
|
55
|
+
this.previousButtonIcon = ArrowLeftIcon;
|
56
|
+
/**
|
57
|
+
* The SVG icon to render on the "next page" button.
|
58
|
+
*
|
59
|
+
* - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.
|
60
|
+
* - Use a value that starts with `assets://`, to display an icon from the Atomic package.
|
61
|
+
* - Use a stringified SVG to display it directly.
|
62
|
+
*/
|
63
|
+
this.nextButtonIcon = ArrowRightIcon;
|
64
|
+
this.radioGroupName = randomID('atomic-pager-');
|
65
|
+
}
|
66
|
+
initialize() {
|
67
|
+
this.validateProps();
|
68
|
+
this.searchStatus = buildSearchStatus(this.bindings.engine);
|
69
|
+
this.pager = buildPager(this.bindings.engine, {
|
70
|
+
options: { numberOfPages: this.numberOfPages },
|
71
|
+
});
|
72
|
+
createAppLoadedListener(this.bindings.store, (isAppLoaded) => {
|
73
|
+
this.isAppLoaded = isAppLoaded;
|
74
|
+
});
|
75
|
+
}
|
76
|
+
willUpdate(changedProperties) {
|
77
|
+
if (changedProperties.has('numberOfPages')) {
|
78
|
+
this.validateProps();
|
79
|
+
}
|
80
|
+
}
|
81
|
+
render() {
|
82
|
+
const currentGroupName = `${this.radioGroupName}-${this.pagerState.currentPages.join('-')}`;
|
83
|
+
return html `${when(!this.searchStatusState.hasError &&
|
84
|
+
this.searchStatusState.hasResults &&
|
85
|
+
this.isAppLoaded, () => html `
|
86
|
+
${renderPagerNavigation({
|
87
|
+
props: {
|
88
|
+
i18n: this.bindings.i18n,
|
89
|
+
},
|
90
|
+
})(html `
|
91
|
+
${renderPagerPreviousButton({
|
92
|
+
props: {
|
93
|
+
icon: this.previousButtonIcon,
|
94
|
+
disabled: !this.pagerState.hasPreviousPage,
|
95
|
+
i18n: this.bindings.i18n,
|
96
|
+
onClick: () => {
|
97
|
+
this.pager.previousPage();
|
98
|
+
this.focusOnFirstResultAndScrollToTop();
|
99
|
+
},
|
100
|
+
},
|
101
|
+
})}
|
102
|
+
${renderPageButtons({
|
103
|
+
props: {
|
104
|
+
i18n: this.bindings.i18n,
|
105
|
+
},
|
106
|
+
})(html `${this.pagerState.currentPages.map((pageNumber, index) => keyed(`page-${pageNumber}-${index}`, renderPagerPageButton({
|
107
|
+
props: {
|
108
|
+
isSelected: this.pager.isCurrentPage(pageNumber),
|
109
|
+
ariaLabel: this.bindings.i18n.t('page-number', {
|
110
|
+
pageNumber,
|
111
|
+
}),
|
112
|
+
onChecked: () => {
|
113
|
+
this.pager.selectPage(pageNumber);
|
114
|
+
this.focusOnFirstResultAndScrollToTop();
|
115
|
+
},
|
116
|
+
page: pageNumber,
|
117
|
+
groupName: currentGroupName,
|
118
|
+
text: pageNumber.toLocaleString(this.bindings.i18n.language),
|
119
|
+
},
|
120
|
+
})))}`)}
|
121
|
+
${renderPagerNextButton({
|
122
|
+
props: {
|
123
|
+
icon: this.nextButtonIcon,
|
124
|
+
disabled: !this.pagerState.hasNextPage,
|
125
|
+
i18n: this.bindings.i18n,
|
126
|
+
onClick: () => {
|
127
|
+
this.pager.nextPage();
|
128
|
+
this.focusOnFirstResultAndScrollToTop();
|
129
|
+
},
|
130
|
+
},
|
131
|
+
})}
|
132
|
+
`)}`)}`;
|
133
|
+
}
|
134
|
+
validateProps() {
|
135
|
+
try {
|
136
|
+
AtomicPager_1.propsSchema.validate({
|
137
|
+
numberOfPages: this.numberOfPages,
|
138
|
+
});
|
139
|
+
}
|
140
|
+
catch (error) {
|
141
|
+
this.error = error;
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
async focusOnFirstResultAndScrollToTop() {
|
146
|
+
await this.bindings.store.state.resultList?.focusOnFirstResultAfterNextSearch();
|
147
|
+
this.dispatchEvent(new CustomEvent('atomic/scrollToTop'));
|
148
|
+
}
|
149
|
+
};
|
150
|
+
AtomicPager.propsSchema = new Schema({
|
151
|
+
numberOfPages: new NumberValue({ min: 0 }),
|
152
|
+
});
|
153
|
+
__decorate([
|
154
|
+
state()
|
155
|
+
], AtomicPager.prototype, "bindings", void 0);
|
156
|
+
__decorate([
|
157
|
+
state()
|
158
|
+
], AtomicPager.prototype, "error", void 0);
|
159
|
+
__decorate([
|
160
|
+
state()
|
161
|
+
], AtomicPager.prototype, "isAppLoaded", void 0);
|
162
|
+
__decorate([
|
163
|
+
bindStateToController('pager'),
|
164
|
+
state()
|
165
|
+
], AtomicPager.prototype, "pagerState", void 0);
|
166
|
+
__decorate([
|
167
|
+
bindStateToController('searchStatus'),
|
168
|
+
state()
|
169
|
+
], AtomicPager.prototype, "searchStatusState", void 0);
|
170
|
+
__decorate([
|
171
|
+
property({ reflect: true, attribute: 'number-of-pages', type: Number })
|
172
|
+
], AtomicPager.prototype, "numberOfPages", void 0);
|
173
|
+
__decorate([
|
174
|
+
property({ reflect: true, attribute: 'previous-button-icon', type: String })
|
175
|
+
], AtomicPager.prototype, "previousButtonIcon", void 0);
|
176
|
+
__decorate([
|
177
|
+
property({ reflect: true, attribute: 'next-button-icon', type: String })
|
178
|
+
], AtomicPager.prototype, "nextButtonIcon", void 0);
|
179
|
+
__decorate([
|
180
|
+
bindingGuard(),
|
181
|
+
errorGuard()
|
182
|
+
], AtomicPager.prototype, "render", null);
|
183
|
+
AtomicPager = AtomicPager_1 = __decorate([
|
184
|
+
customElement('atomic-pager'),
|
185
|
+
bindings(),
|
186
|
+
withTailwindStyles
|
187
|
+
], AtomicPager);
|
188
|
+
export { AtomicPager };
|
@@ -1,4 +1,5 @@
|
|
1
1
|
// Auto-generated file
|
2
|
+
export { AtomicPager } from './atomic-pager/atomic-pager.js';
|
2
3
|
export { AtomicQuerySummary } from './atomic-query-summary/atomic-query-summary.js';
|
3
4
|
export { AtomicResultsPerPage } from './atomic-results-per-page/atomic-results-per-page.js';
|
4
5
|
export { AtomicSearchInterface } from './atomic-search-interface/atomic-search-interface.js';
|
@@ -1,5 +1,6 @@
|
|
1
1
|
// Auto-generated file
|
2
2
|
export default {
|
3
|
+
'atomic-pager': async () => await import('./atomic-pager/atomic-pager.js'),
|
3
4
|
'atomic-query-summary': async () => await import('./atomic-query-summary/atomic-query-summary.js'),
|
4
5
|
'atomic-results-per-page': async () => await import('./atomic-results-per-page/atomic-results-per-page.js'),
|
5
6
|
'atomic-search-interface': async () => await import('./atomic-search-interface/atomic-search-interface.js'),
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"index.js","mappings":"
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCHa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
|