@coveo/atomic 3.27.4 → 3.27.5-pre.1ef71f18a4
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/atomic-aria-live2.js +1 -1
- package/dist/atomic/components/atomic-category-facet.js +1 -1
- package/dist/atomic/components/atomic-citation.js +1 -1
- package/dist/atomic/components/atomic-commerce-category-facet2.js +1 -1
- package/dist/atomic/components/atomic-commerce-numeric-facet2.js +2 -2
- package/dist/atomic/components/atomic-commerce-query-error.js +1 -1
- package/dist/atomic/components/atomic-commerce-query-error.js.map +1 -1
- package/dist/atomic/components/atomic-commerce-recommendation-interface.js +1 -1
- package/dist/atomic/components/atomic-commerce-refine-modal2.js +1 -1
- package/dist/atomic/components/atomic-commerce-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-commerce-timeframe-facet2.js +1 -1
- package/dist/atomic/components/atomic-facet-manager.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-generated-answer-feedback-modal.js +1 -1
- package/dist/atomic/components/atomic-html2.js +1 -1
- package/dist/atomic/components/atomic-insight-edit-toggle.js +1 -1
- package/dist/atomic/components/atomic-insight-facet.js +1 -1
- package/dist/atomic/components/atomic-insight-folded-result-list.js +1 -1
- package/dist/atomic/components/atomic-insight-full-search-button.js +1 -1
- package/dist/atomic/components/atomic-insight-history-toggle.js +1 -1
- package/dist/atomic/components/atomic-insight-no-results.js +1 -1
- package/dist/atomic/components/atomic-insight-numeric-facet.js +1 -1
- package/dist/atomic/components/atomic-insight-pager.js +3 -3
- package/dist/atomic/components/atomic-insight-query-error.js +1 -1
- package/dist/atomic/components/atomic-insight-query-error.js.map +1 -1
- package/dist/atomic/components/atomic-insight-refine-modal2.js +2 -2
- package/dist/atomic/components/atomic-insight-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +1 -1
- package/dist/atomic/components/atomic-insight-result-children.js +1 -1
- package/dist/atomic/components/atomic-insight-result-list.js +1 -1
- package/dist/atomic/components/atomic-insight-result-quickview-action.js +1 -1
- package/dist/atomic/components/atomic-insight-result2.js +1 -1
- package/dist/atomic/components/atomic-insight-search-box.js +2 -2
- package/dist/atomic/components/atomic-insight-smart-snippet-feedback-modal2.js +2 -2
- package/dist/atomic/components/atomic-insight-tabs.js +1 -1
- package/dist/atomic/components/atomic-insight-user-actions-session2.js +1 -1
- package/dist/atomic/components/atomic-insight-user-actions-toggle.js +1 -1
- package/dist/atomic/components/atomic-ipx-body2.js +2 -2
- package/dist/atomic/components/atomic-ipx-button.js +2 -2
- package/dist/atomic/components/atomic-ipx-embedded.js +1 -1
- package/dist/atomic/components/atomic-ipx-modal.js +2 -2
- package/dist/atomic/components/atomic-ipx-recs-list.js +1 -1
- package/dist/atomic/components/atomic-ipx-refine-modal2.js +1 -1
- package/dist/atomic/components/atomic-ipx-refine-toggle.js +1 -1
- package/dist/atomic/components/atomic-ipx-result-link.js +1 -1
- package/dist/atomic/components/atomic-ipx-tabs.js +1 -1
- package/dist/atomic/components/atomic-load-more-results.js +1 -1
- package/dist/atomic/components/atomic-modal2.js +2 -2
- package/dist/atomic/components/atomic-no-results.js +1 -1
- package/dist/atomic/components/atomic-numeric-facet.js +1 -1
- package/dist/atomic/components/atomic-pager.js +3 -3
- package/dist/atomic/components/atomic-product-price.js +1 -1
- package/dist/atomic/components/atomic-query-error.js +1 -1
- package/dist/atomic/components/atomic-query-error.js.map +1 -1
- package/dist/atomic/components/atomic-query-summary.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-recs-error.js +1 -1
- package/dist/atomic/components/atomic-recs-error.js.map +1 -1
- package/dist/atomic/components/atomic-recs-list.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-inspector2.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-placeholder2.js +2 -2
- package/dist/atomic/components/atomic-result-table-placeholder2.js +1 -1
- package/dist/atomic/components/atomic-results-per-page.js +68 -3
- package/dist/atomic/components/atomic-results-per-page.js.map +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 +4 -4
- package/dist/atomic/components/atomic-smart-snippet-answer2.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-collapse-wrapper2.js +2 -2
- package/dist/atomic/components/atomic-smart-snippet-expandable-answer2.js +1 -1
- package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
- package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
- 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-suggestion-renderer2.js +1 -1
- package/dist/atomic/components/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-did-you-mean/atomic-commerce-did-you-mean.js +1 -2
- package/dist/atomic/components/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.js +126 -0
- package/dist/atomic/components/components/commerce/index.js +1 -0
- package/dist/atomic/components/components/commerce/lazy-index.js +1 -0
- package/dist/atomic/components/components/common/breadbox/breadcrumb-content.js +4 -1
- package/dist/atomic/components/components/common/fieldset-group.js +5 -0
- package/dist/atomic/components/components/common/items-per-page/choices.js +47 -0
- package/dist/atomic/components/components/common/items-per-page/error.js +18 -0
- package/dist/atomic/components/components/common/items-per-page/label.js +10 -0
- package/dist/atomic/components/components/common/items-per-page/validate.js +19 -0
- package/dist/atomic/components/facet-date-input.js +3 -3
- package/dist/atomic/components/facet-number-input.js +2 -2
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/interface-common-stencil.js +1 -1
- package/dist/atomic/components/interface-common-stencil.js.map +1 -1
- package/dist/atomic/components/stencil-link.js.map +1 -1
- package/dist/atomic/components/tab-button.js +1 -1
- package/dist/atomic/components/tab-popover.js +1 -1
- package/dist/atomic/{p-a535a268.entry.js → p-0267a585.entry.js} +2 -2
- package/dist/atomic/{p-9a161d8f.entry.js → p-0a7b0daa.entry.js} +2 -2
- package/dist/atomic/{p-f7eab69a.entry.js → p-0b0ea7d3.entry.js} +2 -2
- package/dist/atomic/{p-07cd7e4a.entry.js → p-135be5aa.entry.js} +2 -2
- package/dist/atomic/{p-5789732b.entry.js → p-17fd5a28.entry.js} +2 -2
- package/dist/atomic/p-17fd5a28.entry.js.map +1 -0
- package/dist/atomic/{p-e739825f.entry.js → p-1cc97adc.entry.js} +2 -2
- package/dist/atomic/{p-005d34a4.entry.js → p-29d27418.entry.js} +2 -2
- package/dist/atomic/{p-4dbb3798.entry.js → p-2f0cb73c.entry.js} +2 -2
- package/dist/atomic/{p-bad08ec3.entry.js → p-2ff906b9.entry.js} +2 -2
- package/dist/atomic/{p-908fa9c8.entry.js → p-306c83ea.entry.js} +2 -2
- package/dist/atomic/{p-1243448d.entry.js → p-3195fa42.entry.js} +2 -2
- package/dist/atomic/{p-f5ea03f0.entry.js → p-32b26cd0.entry.js} +2 -2
- package/dist/atomic/{p-dc463f0b.entry.js → p-32c90fe9.entry.js} +2 -2
- package/dist/atomic/{p-84b36ec2.entry.js → p-3ec18de9.entry.js} +2 -2
- package/dist/atomic/{p-8a337769.entry.js → p-3f42a2db.entry.js} +2 -2
- package/dist/atomic/{p-cdb4f283.entry.js → p-4025f4c7.entry.js} +2 -2
- package/dist/atomic/{p-c74c1b41.entry.js → p-45b26cc7.entry.js} +2 -2
- package/dist/atomic/{p-1c06ca0c.entry.js → p-46522ee4.entry.js} +2 -2
- package/dist/atomic/{p-cfec0988.entry.js → p-47ee9d37.entry.js} +2 -2
- package/dist/atomic/{p-4af746a9.entry.js → p-50b9a5d2.entry.js} +2 -2
- package/dist/atomic/{p-756462de.entry.js → p-51c5acfc.entry.js} +2 -2
- package/dist/atomic/{p-1202d6cc.entry.js → p-543e811e.entry.js} +2 -2
- package/dist/atomic/{p-029d5ce0.entry.js → p-5e56ead4.entry.js} +2 -2
- package/dist/atomic/{p-5aa16a91.entry.js → p-5f45ec5d.entry.js} +2 -2
- package/dist/atomic/p-5f45ec5d.entry.js.map +1 -0
- package/dist/atomic/{p-99a27b04.entry.js → p-5fd1cc6d.entry.js} +2 -2
- package/dist/atomic/{p-4d0fc010.js → p-6083c281.js} +1 -1
- package/dist/atomic/p-6083c281.js.map +1 -0
- package/dist/atomic/{p-d4ab4985.entry.js → p-60a9e718.entry.js} +2 -2
- package/dist/atomic/{p-1c5502a8.entry.js → p-66683abd.entry.js} +2 -2
- package/dist/atomic/{p-3024c394.entry.js → p-67315415.entry.js} +2 -2
- package/dist/atomic/{p-baa3b8ee.entry.js → p-689e063d.entry.js} +2 -2
- package/dist/atomic/p-690b5853.entry.js +2 -0
- package/dist/atomic/{p-5576074c.entry.js → p-6e41443c.entry.js} +2 -2
- package/dist/atomic/p-6e41443c.entry.js.map +1 -0
- package/dist/atomic/{p-447f0772.entry.js → p-70ab347b.entry.js} +2 -2
- package/dist/atomic/{p-dc051fee.entry.js → p-76122df5.entry.js} +2 -2
- package/dist/atomic/{p-4d8ec431.entry.js → p-7d1f8d9c.entry.js} +2 -2
- package/dist/atomic/{p-d7c44977.entry.js → p-80dc3bab.entry.js} +2 -2
- package/dist/atomic/{p-c265c67d.entry.js → p-8392e900.entry.js} +2 -2
- package/dist/atomic/{p-c3a2be63.js → p-8abd6400.js} +2 -2
- package/dist/atomic/{p-58c8065c.entry.js → p-8d7f57d9.entry.js} +2 -2
- package/dist/atomic/{p-bb5c19a7.entry.js → p-8e09f796.entry.js} +2 -2
- package/dist/atomic/{p-79e1bcc1.entry.js → p-95942ba2.entry.js} +2 -2
- package/dist/atomic/{p-a896c7b8.entry.js → p-9a08dad7.entry.js} +2 -2
- package/dist/atomic/{p-d5c709cd.entry.js → p-9ae88402.entry.js} +2 -2
- package/dist/atomic/{p-52abba32.entry.js → p-9eb108c9.entry.js} +2 -2
- package/dist/atomic/{p-558f3bd6.entry.js → p-a046cf06.entry.js} +2 -2
- package/dist/atomic/{p-9fb18d3e.entry.js → p-a3169f59.entry.js} +2 -2
- package/dist/atomic/{p-891f0c50.entry.js → p-a772b365.entry.js} +2 -2
- package/dist/atomic/{p-ccff6c87.entry.js → p-a8281e9b.entry.js} +2 -2
- package/dist/atomic/{p-c4dd47ca.entry.js → p-ab5eec3d.entry.js} +2 -2
- package/dist/atomic/{p-2b11517f.entry.js → p-b19a8cbb.entry.js} +2 -2
- package/dist/atomic/{p-4b20cdb3.entry.js → p-b4d47ca9.entry.js} +2 -2
- package/dist/atomic/{p-0ea5cbb8.entry.js → p-b4dfe5b2.entry.js} +2 -2
- package/dist/atomic/p-b747e4a9.entry.js +2 -0
- package/dist/atomic/{p-af8999b1.entry.js → p-b7824e0e.entry.js} +2 -2
- package/dist/atomic/{p-2b1cf37a.entry.js → p-bc5682c6.entry.js} +2 -2
- package/dist/atomic/{p-e7b8ee60.entry.js → p-be13ed5c.entry.js} +2 -2
- package/dist/atomic/p-befca41f.entry.js +2 -0
- package/dist/atomic/{p-6d264c97.entry.js → p-bfeefcaa.entry.js} +2 -2
- package/dist/atomic/{p-34cff6c8.entry.js → p-c0d7b26d.entry.js} +2 -2
- package/dist/atomic/{p-7d1ca26f.entry.js → p-c13d4039.entry.js} +2 -2
- package/dist/atomic/{p-6d083c4e.entry.js → p-c4f042ae.entry.js} +2 -2
- package/dist/atomic/{p-f96655f4.entry.js → p-c83f9cff.entry.js} +2 -2
- package/dist/atomic/{p-dc7b528c.js → p-caff73b0.js} +2 -2
- package/dist/atomic/{p-dc7b528c.js.map → p-caff73b0.js.map} +1 -1
- package/dist/atomic/{p-4e3518c2.entry.js → p-cd87574b.entry.js} +2 -2
- package/dist/atomic/{p-963a3e18.entry.js → p-d30057a0.entry.js} +2 -2
- package/dist/atomic/{p-d5c308fc.entry.js → p-d4aba9f9.entry.js} +2 -2
- package/dist/atomic/{p-dd6e18bb.entry.js → p-d69756ae.entry.js} +2 -2
- package/dist/atomic/{p-68bf4184.entry.js → p-d827c148.entry.js} +2 -2
- package/dist/atomic/{p-e47dd218.entry.js → p-da46d5cd.entry.js} +2 -2
- package/dist/atomic/p-da46d5cd.entry.js.map +1 -0
- package/dist/atomic/{p-cbe083d3.entry.js → p-dd8c6bdd.entry.js} +2 -2
- package/dist/atomic/{p-26ec2d6d.entry.js → p-ddd52850.entry.js} +2 -2
- package/dist/atomic/{p-c751940f.entry.js → p-e44155cc.entry.js} +2 -2
- package/dist/atomic/{p-5e7f50a5.entry.js → p-e4754fd0.entry.js} +2 -2
- package/dist/atomic/{p-bd109981.entry.js → p-e604fd29.entry.js} +2 -2
- package/dist/atomic/{p-75d11764.entry.js → p-eab28672.entry.js} +2 -2
- package/dist/atomic/p-ec0161b7.entry.js +2 -0
- package/dist/atomic/p-ec0161b7.entry.js.map +1 -0
- package/dist/atomic/{p-6c5524dc.entry.js → p-ec6bc15b.entry.js} +2 -2
- package/dist/atomic/p-eebb168b.entry.js +2 -0
- package/dist/atomic/{p-1de6a3e2.entry.js → p-f4a1bfe3.entry.js} +2 -2
- package/dist/atomic/{p-d1434df4.entry.js → p-f4b98113.entry.js} +2 -2
- package/dist/atomic/{p-a15f6b8c.entry.js → p-f6283657.entry.js} +2 -2
- package/dist/atomic/{p-e961a0cc.entry.js → p-f7f8096a.entry.js} +2 -2
- package/dist/atomic/{p-f8fb398c.entry.js → p-fb0bdcdb.entry.js} +2 -2
- package/dist/atomic/p-fbbbc454.entry.js +2 -0
- package/dist/atomic/{p-dea13af7.entry.js → p-fd9d1c3f.entry.js} +2 -2
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-02c61b8d.js → analytics-config-34571b0d.js} +2 -2
- package/dist/cjs/{analytics-config-02c61b8d.js.map → analytics-config-34571b0d.js.map} +1 -1
- package/dist/cjs/atomic-aria-live.cjs.entry.js +1 -1
- package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-citation.cjs.entry.js +1 -1
- package/dist/cjs/atomic-commerce-category-facet_5.cjs.entry.js +4 -4
- package/dist/cjs/atomic-commerce-facet-number-input_2.cjs.entry.js +3 -3
- package/dist/cjs/atomic-commerce-query-error.cjs.entry.js +2 -2
- package/dist/cjs/atomic-commerce-query-error.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-commerce-recommendation-interface.cjs.entry.js +2 -2
- package/dist/cjs/atomic-commerce-refine-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-commerce-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-facet-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic-facet-number-input.cjs.entry.js +2 -2
- package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-focus-trap_2.cjs.entry.js +2 -2
- 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-generated-answer-feedback-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-html.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-edit-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-full-search-button.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-no-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-numeric-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-pager.cjs.entry.js +3 -3
- package/dist/cjs/atomic-insight-query-error.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-query-error.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-refine-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-children.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-result.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-search-box.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-insight-tabs.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-user-actions-session_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-body.cjs.entry.js +2 -2
- package/dist/cjs/atomic-ipx-button.cjs.entry.js +2 -2
- package/dist/cjs/atomic-ipx-embedded.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-refine-modal.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-refine-toggle.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +1 -1
- package/dist/cjs/atomic-ipx-tabs.cjs.entry.js +1 -1
- package/dist/cjs/atomic-load-more-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-no-results.cjs.entry.js +1 -1
- package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
- package/dist/cjs/atomic-pager.cjs.entry.js +3 -3
- package/dist/cjs/atomic-product-price.cjs.entry.js +1 -1
- package/dist/cjs/atomic-query-error.cjs.entry.js +2 -2
- package/dist/cjs/atomic-query-error.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-query-summary.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-error.cjs.entry.js +2 -2
- package/dist/cjs/atomic-recs-error.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +2 -2
- package/dist/cjs/atomic-recs-list.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 +3 -3
- package/dist/cjs/atomic-results-per-page.cjs.entry.js +71 -7
- package/dist/cjs/atomic-results-per-page.cjs.entry.js.map +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 +4 -4
- package/dist/cjs/atomic-search-interface.cjs.entry.js +2 -2
- package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +2 -2
- package/dist/cjs/atomic-smart-snippet-collapse-wrapper_2.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-suggestion-renderer.cjs.entry.js +1 -1
- package/dist/cjs/atomic-tab-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/atomic-tab-button.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/{interface-common-stencil-86cc0d53.js → interface-common-stencil-8fdf6a85.js} +2 -2
- package/dist/cjs/interface-common-stencil-8fdf6a85.js.map +1 -0
- package/dist/cjs/{stencil-link-9ee2c42d.js → stencil-link-c6b12034.js} +1 -1
- package/dist/cjs/stencil-link-c6b12034.js.map +1 -0
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-f0d21567.js → analytics-config-ff27106b.js} +2 -2
- package/dist/esm/{analytics-config-f0d21567.js.map → analytics-config-ff27106b.js.map} +1 -1
- package/dist/esm/atomic-aria-live.entry.js +1 -1
- package/dist/esm/atomic-category-facet.entry.js +1 -1
- package/dist/esm/atomic-citation.entry.js +1 -1
- package/dist/esm/atomic-commerce-category-facet_5.entry.js +4 -4
- package/dist/esm/atomic-commerce-facet-number-input_2.entry.js +3 -3
- package/dist/esm/atomic-commerce-query-error.entry.js +2 -2
- package/dist/esm/atomic-commerce-query-error.entry.js.map +1 -1
- package/dist/esm/atomic-commerce-recommendation-interface.entry.js +2 -2
- package/dist/esm/atomic-commerce-refine-modal.entry.js +1 -1
- package/dist/esm/atomic-commerce-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-facet-manager.entry.js +1 -1
- package/dist/esm/atomic-facet-number-input.entry.js +2 -2
- package/dist/esm/atomic-facet.entry.js +1 -1
- package/dist/esm/atomic-focus-trap_2.entry.js +2 -2
- 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-generated-answer-feedback-modal.entry.js +1 -1
- package/dist/esm/atomic-html.entry.js +1 -1
- package/dist/esm/atomic-insight-edit-toggle.entry.js +1 -1
- package/dist/esm/atomic-insight-facet.entry.js +1 -1
- package/dist/esm/atomic-insight-folded-result-list.entry.js +1 -1
- package/dist/esm/atomic-insight-full-search-button.entry.js +1 -1
- package/dist/esm/atomic-insight-history-toggle.entry.js +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +2 -2
- package/dist/esm/atomic-insight-no-results.entry.js +1 -1
- package/dist/esm/atomic-insight-numeric-facet.entry.js +1 -1
- package/dist/esm/atomic-insight-pager.entry.js +3 -3
- package/dist/esm/atomic-insight-query-error.entry.js +2 -2
- package/dist/esm/atomic-insight-query-error.entry.js.map +1 -1
- package/dist/esm/atomic-insight-refine-modal.entry.js +2 -2
- package/dist/esm/atomic-insight-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +1 -1
- package/dist/esm/atomic-insight-result-children.entry.js +1 -1
- package/dist/esm/atomic-insight-result-list.entry.js +1 -1
- package/dist/esm/atomic-insight-result-quickview-action.entry.js +1 -1
- package/dist/esm/atomic-insight-result.entry.js +1 -1
- package/dist/esm/atomic-insight-search-box.entry.js +2 -2
- package/dist/esm/atomic-insight-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-insight-tabs.entry.js +1 -1
- package/dist/esm/atomic-insight-user-actions-session_2.entry.js +1 -1
- package/dist/esm/atomic-insight-user-actions-toggle.entry.js +1 -1
- package/dist/esm/atomic-ipx-body.entry.js +2 -2
- package/dist/esm/atomic-ipx-button.entry.js +2 -2
- package/dist/esm/atomic-ipx-embedded.entry.js +1 -1
- package/dist/esm/atomic-ipx-modal.entry.js +2 -2
- package/dist/esm/atomic-ipx-recs-list.entry.js +1 -1
- package/dist/esm/atomic-ipx-refine-modal.entry.js +1 -1
- package/dist/esm/atomic-ipx-refine-toggle.entry.js +1 -1
- package/dist/esm/atomic-ipx-result-link.entry.js +1 -1
- package/dist/esm/atomic-ipx-tabs.entry.js +1 -1
- package/dist/esm/atomic-load-more-results.entry.js +1 -1
- package/dist/esm/atomic-no-results.entry.js +1 -1
- package/dist/esm/atomic-numeric-facet.entry.js +1 -1
- package/dist/esm/atomic-pager.entry.js +3 -3
- package/dist/esm/atomic-product-price.entry.js +1 -1
- package/dist/esm/atomic-query-error.entry.js +2 -2
- package/dist/esm/atomic-query-error.entry.js.map +1 -1
- package/dist/esm/atomic-query-summary.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-error.entry.js +2 -2
- package/dist/esm/atomic-recs-error.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +2 -2
- package/dist/esm/atomic-recs-list.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 +3 -3
- package/dist/esm/atomic-results-per-page.entry.js +68 -4
- package/dist/esm/atomic-results-per-page.entry.js.map +1 -1
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +2 -2
- package/dist/esm/atomic-search-box.entry.js +4 -4
- package/dist/esm/atomic-search-interface.entry.js +2 -2
- package/dist/esm/atomic-smart-snippet-answer_2.entry.js +2 -2
- package/dist/esm/atomic-smart-snippet-collapse-wrapper_2.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-suggestion-renderer.entry.js +1 -1
- package/dist/esm/atomic-tab-bar_2.entry.js +1 -1
- package/dist/esm/atomic-tab-button.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/{interface-common-stencil-5ac4bb62.js → interface-common-stencil-7008c6f4.js} +2 -2
- package/dist/esm/interface-common-stencil-7008c6f4.js.map +1 -0
- package/dist/esm/{stencil-link-ea50cb61.js → stencil-link-637c1ac5.js} +1 -1
- package/dist/esm/stencil-link-637c1ac5.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.d.ts +13 -7
- package/dist/types/components/commerce/index.d.ts +1 -0
- package/dist/types/components/common/items-per-page/choices.d.ts +1 -1
- package/dist/types/components/common/items-per-page/error.d.ts +3 -0
- package/dist/types/components/common/query-error/stencil-title.d.ts +9 -0
- package/dist/types/components/common/query-error/title.d.ts +3 -2
- package/dist/types/components.d.ts +0 -63
- package/docs/atomic-docs.json +1 -123
- package/package.json +1 -1
- package/dist/atomic/components/atomic-commerce-products-per-page.d.ts +0 -11
- package/dist/atomic/components/atomic-commerce-products-per-page.js +0 -107
- package/dist/atomic/components/atomic-commerce-products-per-page.js.map +0 -1
- package/dist/atomic/components/validate.js +0 -62
- package/dist/atomic/components/validate.js.map +0 -1
- package/dist/atomic/p-03109525.entry.js +0 -2
- package/dist/atomic/p-03109525.entry.js.map +0 -1
- package/dist/atomic/p-162da819.entry.js +0 -2
- package/dist/atomic/p-4d0fc010.js.map +0 -1
- package/dist/atomic/p-5576074c.entry.js.map +0 -1
- package/dist/atomic/p-5789732b.entry.js.map +0 -1
- package/dist/atomic/p-5aa16a91.entry.js.map +0 -1
- package/dist/atomic/p-81874146.entry.js +0 -2
- package/dist/atomic/p-98c16767.entry.js +0 -2
- package/dist/atomic/p-b0be7782.entry.js +0 -2
- package/dist/atomic/p-b90ea7e9.entry.js +0 -2
- package/dist/atomic/p-ba5a125f.entry.js +0 -2
- package/dist/atomic/p-ba5a125f.entry.js.map +0 -1
- package/dist/atomic/p-c408a774.js +0 -2
- package/dist/atomic/p-c408a774.js.map +0 -1
- package/dist/atomic/p-e47dd218.entry.js.map +0 -1
- package/dist/cjs/atomic-commerce-products-per-page.cjs.entry.js +0 -95
- package/dist/cjs/atomic-commerce-products-per-page.cjs.entry.js.map +0 -1
- package/dist/cjs/interface-common-stencil-86cc0d53.js.map +0 -1
- package/dist/cjs/stencil-link-9ee2c42d.js.map +0 -1
- package/dist/cjs/validate-232b3138.js +0 -69
- package/dist/cjs/validate-232b3138.js.map +0 -1
- package/dist/esm/atomic-commerce-products-per-page.entry.js +0 -91
- package/dist/esm/atomic-commerce-products-per-page.entry.js.map +0 -1
- package/dist/esm/interface-common-stencil-5ac4bb62.js.map +0 -1
- package/dist/esm/stencil-link-ea50cb61.js.map +0 -1
- package/dist/esm/validate-8b800378.js +0 -62
- package/dist/esm/validate-8b800378.js.map +0 -1
- /package/dist/atomic/{p-a535a268.entry.js.map → p-0267a585.entry.js.map} +0 -0
- /package/dist/atomic/{p-9a161d8f.entry.js.map → p-0a7b0daa.entry.js.map} +0 -0
- /package/dist/atomic/{p-f7eab69a.entry.js.map → p-0b0ea7d3.entry.js.map} +0 -0
- /package/dist/atomic/{p-07cd7e4a.entry.js.map → p-135be5aa.entry.js.map} +0 -0
- /package/dist/atomic/{p-e739825f.entry.js.map → p-1cc97adc.entry.js.map} +0 -0
- /package/dist/atomic/{p-005d34a4.entry.js.map → p-29d27418.entry.js.map} +0 -0
- /package/dist/atomic/{p-4dbb3798.entry.js.map → p-2f0cb73c.entry.js.map} +0 -0
- /package/dist/atomic/{p-bad08ec3.entry.js.map → p-2ff906b9.entry.js.map} +0 -0
- /package/dist/atomic/{p-908fa9c8.entry.js.map → p-306c83ea.entry.js.map} +0 -0
- /package/dist/atomic/{p-1243448d.entry.js.map → p-3195fa42.entry.js.map} +0 -0
- /package/dist/atomic/{p-f5ea03f0.entry.js.map → p-32b26cd0.entry.js.map} +0 -0
- /package/dist/atomic/{p-dc463f0b.entry.js.map → p-32c90fe9.entry.js.map} +0 -0
- /package/dist/atomic/{p-84b36ec2.entry.js.map → p-3ec18de9.entry.js.map} +0 -0
- /package/dist/atomic/{p-8a337769.entry.js.map → p-3f42a2db.entry.js.map} +0 -0
- /package/dist/atomic/{p-cdb4f283.entry.js.map → p-4025f4c7.entry.js.map} +0 -0
- /package/dist/atomic/{p-c74c1b41.entry.js.map → p-45b26cc7.entry.js.map} +0 -0
- /package/dist/atomic/{p-1c06ca0c.entry.js.map → p-46522ee4.entry.js.map} +0 -0
- /package/dist/atomic/{p-cfec0988.entry.js.map → p-47ee9d37.entry.js.map} +0 -0
- /package/dist/atomic/{p-4af746a9.entry.js.map → p-50b9a5d2.entry.js.map} +0 -0
- /package/dist/atomic/{p-756462de.entry.js.map → p-51c5acfc.entry.js.map} +0 -0
- /package/dist/atomic/{p-1202d6cc.entry.js.map → p-543e811e.entry.js.map} +0 -0
- /package/dist/atomic/{p-029d5ce0.entry.js.map → p-5e56ead4.entry.js.map} +0 -0
- /package/dist/atomic/{p-99a27b04.entry.js.map → p-5fd1cc6d.entry.js.map} +0 -0
- /package/dist/atomic/{p-d4ab4985.entry.js.map → p-60a9e718.entry.js.map} +0 -0
- /package/dist/atomic/{p-1c5502a8.entry.js.map → p-66683abd.entry.js.map} +0 -0
- /package/dist/atomic/{p-3024c394.entry.js.map → p-67315415.entry.js.map} +0 -0
- /package/dist/atomic/{p-baa3b8ee.entry.js.map → p-689e063d.entry.js.map} +0 -0
- /package/dist/atomic/{p-b0be7782.entry.js.map → p-690b5853.entry.js.map} +0 -0
- /package/dist/atomic/{p-447f0772.entry.js.map → p-70ab347b.entry.js.map} +0 -0
- /package/dist/atomic/{p-dc051fee.entry.js.map → p-76122df5.entry.js.map} +0 -0
- /package/dist/atomic/{p-4d8ec431.entry.js.map → p-7d1f8d9c.entry.js.map} +0 -0
- /package/dist/atomic/{p-d7c44977.entry.js.map → p-80dc3bab.entry.js.map} +0 -0
- /package/dist/atomic/{p-c265c67d.entry.js.map → p-8392e900.entry.js.map} +0 -0
- /package/dist/atomic/{p-c3a2be63.js.map → p-8abd6400.js.map} +0 -0
- /package/dist/atomic/{p-58c8065c.entry.js.map → p-8d7f57d9.entry.js.map} +0 -0
- /package/dist/atomic/{p-bb5c19a7.entry.js.map → p-8e09f796.entry.js.map} +0 -0
- /package/dist/atomic/{p-79e1bcc1.entry.js.map → p-95942ba2.entry.js.map} +0 -0
- /package/dist/atomic/{p-a896c7b8.entry.js.map → p-9a08dad7.entry.js.map} +0 -0
- /package/dist/atomic/{p-d5c709cd.entry.js.map → p-9ae88402.entry.js.map} +0 -0
- /package/dist/atomic/{p-52abba32.entry.js.map → p-9eb108c9.entry.js.map} +0 -0
- /package/dist/atomic/{p-558f3bd6.entry.js.map → p-a046cf06.entry.js.map} +0 -0
- /package/dist/atomic/{p-9fb18d3e.entry.js.map → p-a3169f59.entry.js.map} +0 -0
- /package/dist/atomic/{p-891f0c50.entry.js.map → p-a772b365.entry.js.map} +0 -0
- /package/dist/atomic/{p-ccff6c87.entry.js.map → p-a8281e9b.entry.js.map} +0 -0
- /package/dist/atomic/{p-c4dd47ca.entry.js.map → p-ab5eec3d.entry.js.map} +0 -0
- /package/dist/atomic/{p-2b11517f.entry.js.map → p-b19a8cbb.entry.js.map} +0 -0
- /package/dist/atomic/{p-4b20cdb3.entry.js.map → p-b4d47ca9.entry.js.map} +0 -0
- /package/dist/atomic/{p-0ea5cbb8.entry.js.map → p-b4dfe5b2.entry.js.map} +0 -0
- /package/dist/atomic/{p-81874146.entry.js.map → p-b747e4a9.entry.js.map} +0 -0
- /package/dist/atomic/{p-af8999b1.entry.js.map → p-b7824e0e.entry.js.map} +0 -0
- /package/dist/atomic/{p-2b1cf37a.entry.js.map → p-bc5682c6.entry.js.map} +0 -0
- /package/dist/atomic/{p-e7b8ee60.entry.js.map → p-be13ed5c.entry.js.map} +0 -0
- /package/dist/atomic/{p-b90ea7e9.entry.js.map → p-befca41f.entry.js.map} +0 -0
- /package/dist/atomic/{p-6d264c97.entry.js.map → p-bfeefcaa.entry.js.map} +0 -0
- /package/dist/atomic/{p-34cff6c8.entry.js.map → p-c0d7b26d.entry.js.map} +0 -0
- /package/dist/atomic/{p-7d1ca26f.entry.js.map → p-c13d4039.entry.js.map} +0 -0
- /package/dist/atomic/{p-6d083c4e.entry.js.map → p-c4f042ae.entry.js.map} +0 -0
- /package/dist/atomic/{p-f96655f4.entry.js.map → p-c83f9cff.entry.js.map} +0 -0
- /package/dist/atomic/{p-4e3518c2.entry.js.map → p-cd87574b.entry.js.map} +0 -0
- /package/dist/atomic/{p-963a3e18.entry.js.map → p-d30057a0.entry.js.map} +0 -0
- /package/dist/atomic/{p-d5c308fc.entry.js.map → p-d4aba9f9.entry.js.map} +0 -0
- /package/dist/atomic/{p-dd6e18bb.entry.js.map → p-d69756ae.entry.js.map} +0 -0
- /package/dist/atomic/{p-68bf4184.entry.js.map → p-d827c148.entry.js.map} +0 -0
- /package/dist/atomic/{p-cbe083d3.entry.js.map → p-dd8c6bdd.entry.js.map} +0 -0
- /package/dist/atomic/{p-26ec2d6d.entry.js.map → p-ddd52850.entry.js.map} +0 -0
- /package/dist/atomic/{p-c751940f.entry.js.map → p-e44155cc.entry.js.map} +0 -0
- /package/dist/atomic/{p-5e7f50a5.entry.js.map → p-e4754fd0.entry.js.map} +0 -0
- /package/dist/atomic/{p-bd109981.entry.js.map → p-e604fd29.entry.js.map} +0 -0
- /package/dist/atomic/{p-75d11764.entry.js.map → p-eab28672.entry.js.map} +0 -0
- /package/dist/atomic/{p-6c5524dc.entry.js.map → p-ec6bc15b.entry.js.map} +0 -0
- /package/dist/atomic/{p-98c16767.entry.js.map → p-eebb168b.entry.js.map} +0 -0
- /package/dist/atomic/{p-1de6a3e2.entry.js.map → p-f4a1bfe3.entry.js.map} +0 -0
- /package/dist/atomic/{p-d1434df4.entry.js.map → p-f4b98113.entry.js.map} +0 -0
- /package/dist/atomic/{p-a15f6b8c.entry.js.map → p-f6283657.entry.js.map} +0 -0
- /package/dist/atomic/{p-e961a0cc.entry.js.map → p-f7f8096a.entry.js.map} +0 -0
- /package/dist/atomic/{p-f8fb398c.entry.js.map → p-fb0bdcdb.entry.js.map} +0 -0
- /package/dist/atomic/{p-162da819.entry.js.map → p-fbbbc454.entry.js.map} +0 -0
- /package/dist/atomic/{p-dea13af7.entry.js.map → p-fd9d1c3f.entry.js.map} +0 -0
|
@@ -73,7 +73,7 @@ const AtomicSuggestionRenderer = /*@__PURE__*/ proxyCustomElement(class AtomicSu
|
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
75
|
const isButton = !!(this.suggestion.onSelect || this.suggestion.query);
|
|
76
|
-
return (h(Host, { key: '
|
|
76
|
+
return (h(Host, { key: '65b5d84340d508712073522ae4ff19d4274fafeb', class: "contents" }, isButton ? (h("button", { id: this.id, key: this.suggestion.key, part: this.parts, class: this.classes, onMouseDown: (e) => e.preventDefault(), onClick: (e) => this.onClick?.(e), onMouseOver: (e) => this.onMouseOver?.(e), "data-query": this.suggestion.query, "aria-label": this.ariaLabel(isButton), ref: (el) => {
|
|
77
77
|
if (!el) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -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: '99cf133406539520a02364ea9a04ec5df9c35332' }, h("atomic-tab-bar", { key: '7f63a5f0a65e8f30bfdbb9cf19943de4e6ccb0d5' }, h("div", { key: 'a1a69340dc6111bb64d18d0b2de01f9c4ef042f1', 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) {
|
|
@@ -55,8 +55,7 @@ let AtomicCommerceDidYouMean = class AtomicCommerceDidYouMean extends LitElement
|
|
|
55
55
|
props: {
|
|
56
56
|
correctedQuery: this.didYouMeanState.queryCorrection.correctedQuery,
|
|
57
57
|
i18n: this.bindings.i18n,
|
|
58
|
-
|
|
59
|
-
onClick: () => { },
|
|
58
|
+
onClick: () => this.didYouMean.applyCorrection(),
|
|
60
59
|
},
|
|
61
60
|
});
|
|
62
61
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
import { renderFieldsetGroup } from "../../common/fieldset-group.js";
|
|
8
|
+
import { createAppLoadedListener } from "../../common/interface/store.js";
|
|
9
|
+
import { renderChoices } from "../../common/items-per-page/choices.js";
|
|
10
|
+
import { renderLabel } from "../../common/items-per-page/label.js";
|
|
11
|
+
import { convertChoicesToNumbers, validateInitialChoice, } from "../../common/items-per-page/validate.js";
|
|
12
|
+
import { renderPagerGuard } from "../../common/pager/pager-guard.js";
|
|
13
|
+
import { bindStateToController } from "../../../decorators/bind-state.js";
|
|
14
|
+
import { bindingGuard } from "../../../decorators/binding-guard";
|
|
15
|
+
import { bindings } from "../../../decorators/bindings.js";
|
|
16
|
+
import { errorGuard } from "../../../decorators/error-guard";
|
|
17
|
+
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
|
|
18
|
+
import { randomID } from "../../../utils/utils.js";
|
|
19
|
+
import { buildSearch, buildProductListing, } from '@coveo/headless/commerce';
|
|
20
|
+
import { html, LitElement } from 'lit';
|
|
21
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
22
|
+
/**
|
|
23
|
+
* The `atomic-commerce-products-per-page` component lets the end user select how many products to display per page.
|
|
24
|
+
*
|
|
25
|
+
* @part label - The "Products per page" label.
|
|
26
|
+
* @part buttons - The list of buttons.
|
|
27
|
+
* @part button - The individual products per page buttons.
|
|
28
|
+
* @part active-button - The active products per page button.
|
|
29
|
+
*
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
let AtomicCommerceProductsPerPage = class AtomicCommerceProductsPerPage extends LitElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.isAppLoaded = false;
|
|
36
|
+
this.radioGroupName = randomID('atomic-commerce-products-per-page-');
|
|
37
|
+
/**
|
|
38
|
+
* A list of choices for the number of products to display per page, separated by commas.
|
|
39
|
+
*/
|
|
40
|
+
this.choicesDisplayed = '10,25,50,100';
|
|
41
|
+
}
|
|
42
|
+
initialize() {
|
|
43
|
+
this.choices = convertChoicesToNumbers(this.choicesDisplayed);
|
|
44
|
+
this.initialChoice = this.initialChoice ?? this.choices[0];
|
|
45
|
+
validateInitialChoice(this.initialChoice, this.choices);
|
|
46
|
+
const controller = this.bindings.interfaceElement.type === 'search'
|
|
47
|
+
? buildSearch(this.bindings.engine)
|
|
48
|
+
: buildProductListing(this.bindings.engine);
|
|
49
|
+
this.summary = controller.summary();
|
|
50
|
+
this.pagination = controller.pagination(this.initialChoice ? { options: { pageSize: this.initialChoice } } : {});
|
|
51
|
+
createAppLoadedListener(this.bindings.store, (isAppLoaded) => {
|
|
52
|
+
this.isAppLoaded = isAppLoaded;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
scrollToTopEvent() {
|
|
56
|
+
this.dispatchEvent(new CustomEvent('atomic/scrollToTop', {
|
|
57
|
+
bubbles: true,
|
|
58
|
+
composed: true,
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
get label() {
|
|
62
|
+
return this.bindings.i18n.t('products-per-page');
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
return html `
|
|
66
|
+
${renderPagerGuard({
|
|
67
|
+
props: {
|
|
68
|
+
hasError: this.summaryState.hasError,
|
|
69
|
+
hasItems: this.summaryState.hasProducts,
|
|
70
|
+
isAppLoaded: this.isAppLoaded,
|
|
71
|
+
},
|
|
72
|
+
})(html `
|
|
73
|
+
<div class="flex items-center">
|
|
74
|
+
${renderLabel({ props: {} })(html `${this.label}`)}
|
|
75
|
+
${renderFieldsetGroup({
|
|
76
|
+
props: {
|
|
77
|
+
label: this.label,
|
|
78
|
+
},
|
|
79
|
+
})(renderChoices({
|
|
80
|
+
props: {
|
|
81
|
+
label: this.label,
|
|
82
|
+
groupName: this.radioGroupName,
|
|
83
|
+
pageSize: this.paginationState.pageSize,
|
|
84
|
+
choices: this.choices,
|
|
85
|
+
lang: this.bindings.i18n.language,
|
|
86
|
+
scrollToTopEvent: () => this.scrollToTopEvent(),
|
|
87
|
+
setItemSize: (size) => this.pagination.setPageSize(size),
|
|
88
|
+
focusOnFirstResultAfterNextSearch: () => this.bindings.store.state.resultList?.focusOnFirstResultAfterNextSearch(),
|
|
89
|
+
focusOnNextNewResult: () => this.bindings.store.state.resultList?.focusOnNextNewResult(),
|
|
90
|
+
},
|
|
91
|
+
}))}
|
|
92
|
+
</div>
|
|
93
|
+
`)}
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
__decorate([
|
|
98
|
+
bindStateToController('pagination'),
|
|
99
|
+
state()
|
|
100
|
+
], AtomicCommerceProductsPerPage.prototype, "paginationState", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
bindStateToController('summary'),
|
|
103
|
+
state()
|
|
104
|
+
], AtomicCommerceProductsPerPage.prototype, "summaryState", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
state()
|
|
107
|
+
], AtomicCommerceProductsPerPage.prototype, "error", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
state()
|
|
110
|
+
], AtomicCommerceProductsPerPage.prototype, "isAppLoaded", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
property({ reflect: true, attribute: 'choices-displayed' })
|
|
113
|
+
], AtomicCommerceProductsPerPage.prototype, "choicesDisplayed", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
property({ type: Number, reflect: true, attribute: 'initial-choice' })
|
|
116
|
+
], AtomicCommerceProductsPerPage.prototype, "initialChoice", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
bindingGuard(),
|
|
119
|
+
errorGuard()
|
|
120
|
+
], AtomicCommerceProductsPerPage.prototype, "render", null);
|
|
121
|
+
AtomicCommerceProductsPerPage = __decorate([
|
|
122
|
+
customElement('atomic-commerce-products-per-page'),
|
|
123
|
+
bindings(),
|
|
124
|
+
withTailwindStyles
|
|
125
|
+
], AtomicCommerceProductsPerPage);
|
|
126
|
+
export { AtomicCommerceProductsPerPage };
|
|
@@ -5,6 +5,7 @@ export { AtomicCommerceInterface } from './atomic-commerce-interface/atomic-comm
|
|
|
5
5
|
export { AtomicCommerceLayout } from './atomic-commerce-layout/atomic-commerce-layout.js';
|
|
6
6
|
export { AtomicCommercePager } from './atomic-commerce-pager/atomic-commerce-pager.js';
|
|
7
7
|
export { AtomicCommerceProductList } from './atomic-commerce-product-list/atomic-commerce-product-list.js';
|
|
8
|
+
export { AtomicCommerceProductsPerPage } from './atomic-commerce-products-per-page/atomic-commerce-products-per-page.js';
|
|
8
9
|
export { AtomicCommerceQuerySummary } from './atomic-commerce-query-summary/atomic-commerce-query-summary.js';
|
|
9
10
|
export { AtomicCommerceRecommendationList } from './atomic-commerce-recommendation-list/atomic-commerce-recommendation-list.js';
|
|
10
11
|
export { AtomicCommerceSearchBox } from './atomic-commerce-search-box/atomic-commerce-search-box.js';
|
|
@@ -6,6 +6,7 @@ export default {
|
|
|
6
6
|
'atomic-commerce-layout': async () => await import('./atomic-commerce-layout/atomic-commerce-layout.js'),
|
|
7
7
|
'atomic-commerce-pager': async () => await import('./atomic-commerce-pager/atomic-commerce-pager.js'),
|
|
8
8
|
'atomic-commerce-product-list': async () => await import('./atomic-commerce-product-list/atomic-commerce-product-list.js'),
|
|
9
|
+
'atomic-commerce-products-per-page': async () => await import('./atomic-commerce-products-per-page/atomic-commerce-products-per-page.js'),
|
|
9
10
|
'atomic-commerce-query-summary': async () => await import('./atomic-commerce-query-summary/atomic-commerce-query-summary.js'),
|
|
10
11
|
'atomic-commerce-recommendation-list': async () => await import('./atomic-commerce-recommendation-list/atomic-commerce-recommendation-list.js'),
|
|
11
12
|
'atomic-commerce-search-box': async () => await import('./atomic-commerce-search-box/atomic-commerce-search-box.js'),
|
|
@@ -28,7 +28,10 @@ export const renderBreadcrumbContent = ({ props }) => {
|
|
|
28
28
|
excluded: isExclusion && !props.breadcrumb.content,
|
|
29
29
|
});
|
|
30
30
|
return html `<span part="breadcrumb-label" class=${multiClassMap(labelClass)}>
|
|
31
|
-
${props.i18n.t('with-colon', {
|
|
31
|
+
${props.i18n.t('with-colon', {
|
|
32
|
+
text: props.breadcrumb.label,
|
|
33
|
+
interpolation: { escapeValue: false },
|
|
34
|
+
})}
|
|
32
35
|
</span>
|
|
33
36
|
<span part="breadcrumb-value" class=${multiClassMap(valueClass)}>
|
|
34
37
|
${props.breadcrumb.content ?? value}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { renderRadioButton } from '../radio-button';
|
|
3
|
+
export const renderChoices = ({ props }) => {
|
|
4
|
+
const { label, groupName, pageSize, choices, lang, scrollToTopEvent, setItemSize, focusOnFirstResultAfterNextSearch, focusOnNextNewResult, } = props;
|
|
5
|
+
const focusOnProperResultDependingOnChoice = (choice) => {
|
|
6
|
+
if (choice < pageSize) {
|
|
7
|
+
focusOnFirstResultAfterNextSearch()?.then(() => scrollToTopEvent());
|
|
8
|
+
}
|
|
9
|
+
else if (choice > pageSize) {
|
|
10
|
+
focusOnNextNewResult();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return html `
|
|
14
|
+
<div
|
|
15
|
+
part="buttons"
|
|
16
|
+
role="radiogroup"
|
|
17
|
+
aria-label=${label}
|
|
18
|
+
class="flex flex-wrap gap-2"
|
|
19
|
+
>
|
|
20
|
+
${choices.map((choice) => {
|
|
21
|
+
const isSelected = pageSize === choice;
|
|
22
|
+
const parts = ['button'];
|
|
23
|
+
if (isSelected) {
|
|
24
|
+
parts.push('active-button');
|
|
25
|
+
}
|
|
26
|
+
const text = choice.toLocaleString(lang);
|
|
27
|
+
return renderRadioButton({
|
|
28
|
+
props: {
|
|
29
|
+
key: 'choice',
|
|
30
|
+
groupName,
|
|
31
|
+
style: 'outline-neutral',
|
|
32
|
+
checked: isSelected,
|
|
33
|
+
ariaLabel: text,
|
|
34
|
+
onChecked: () => {
|
|
35
|
+
focusOnProperResultDependingOnChoice(choice);
|
|
36
|
+
setItemSize(choice);
|
|
37
|
+
},
|
|
38
|
+
class: 'btn-page focus-visible:bg-neutral-light',
|
|
39
|
+
part: parts.join(' '),
|
|
40
|
+
text,
|
|
41
|
+
selectWhenFocused: false,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
})}
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class ChoiceIsNaNError extends Error {
|
|
2
|
+
constructor(choice) {
|
|
3
|
+
super(`The choice value "${choice}" from the "choicesDisplayed" option is not a number.`);
|
|
4
|
+
this.name = 'ChoiceIsNaNError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class InitialChoiceNotInChoicesError extends Error {
|
|
8
|
+
constructor(initialChoice, choices) {
|
|
9
|
+
super(`The initial choice value "${initialChoice}" is not included in the choices ${choices}.`);
|
|
10
|
+
this.name = 'InitialChoiceNotInChoicesError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class ChoiceIsNonPositiveError extends Error {
|
|
14
|
+
constructor(choice) {
|
|
15
|
+
super(`The choice value "${choice}" from the "choicesDisplayed" option is not positive (<= 0).`);
|
|
16
|
+
this.name = 'ChoiceIsNonPositiveError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChoiceIsNaNError, ChoiceIsNonPositiveError, InitialChoiceNotInChoicesError, } from './error';
|
|
2
|
+
export function convertChoicesToNumbers(choices) {
|
|
3
|
+
return choices.split(',').map((choice) => {
|
|
4
|
+
const parsedChoice = parseInt(choice);
|
|
5
|
+
if (isNaN(parsedChoice)) {
|
|
6
|
+
throw new ChoiceIsNaNError(choice);
|
|
7
|
+
}
|
|
8
|
+
if (parsedChoice <= 0) {
|
|
9
|
+
throw new ChoiceIsNonPositiveError(parsedChoice);
|
|
10
|
+
}
|
|
11
|
+
return parsedChoice;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function validateInitialChoice(initialChoice, choices) {
|
|
15
|
+
if (!choices.includes(initialChoice)) {
|
|
16
|
+
throw new InitialChoiceNotInChoicesError(initialChoice, choices);
|
|
17
|
+
}
|
|
18
|
+
return initialChoice;
|
|
19
|
+
}
|
|
@@ -65,13 +65,13 @@ const FacetDateInput = /*@__PURE__*/ proxyCustomElement(class FacetDateInput ext
|
|
|
65
65
|
// Fallback for Safari < 14.1, date with format yyyy-mm-dd over 1400 (API limit)
|
|
66
66
|
const pattern = '^(1[4-9]\\d{2}|2\\d{3})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$';
|
|
67
67
|
const range = this.rangeGetter();
|
|
68
|
-
return (h("form", { key: '
|
|
68
|
+
return (h("form", { key: '5b9dcc787bc6df5e367c5f42399870887c47d1ac', class: "mt-4 grid grid-cols-[min-content_1fr] gap-2 px-2", onSubmit: (e) => {
|
|
69
69
|
e.preventDefault();
|
|
70
70
|
this.apply();
|
|
71
71
|
return false;
|
|
72
|
-
} }, h("label", { key: '
|
|
72
|
+
} }, h("label", { key: '402453cff10dc0145067c4915c37f4664062b483', part: "input-label", class: labelClasses, htmlFor: `${this.facetId}_start` }, startLabel, ":"), h("input", { key: '9b29df3dc13bfa9f8a75c7bc4528ed81c75b26a4', id: `${this.facetId}_start`, part: "input-start", type: "date", ref: (ref) => (this.startRef = ref), class: inputClasses, "aria-label": startAria, placeholder: placeholder, pattern: pattern, required: true,
|
|
73
73
|
// API/Index minimum supported date
|
|
74
|
-
min: this.min || this.formattedDateValue('1401-01-01'), max: this.end ? this.formattedDateValue(this.end) : this.max, value: this.formattedDateValue(range?.start), onInput: (e) => (this.start = parseDate(e.target.value).toDate()) }), h("label", { key: '
|
|
74
|
+
min: this.min || this.formattedDateValue('1401-01-01'), max: this.end ? this.formattedDateValue(this.end) : this.max, value: this.formattedDateValue(range?.start), onInput: (e) => (this.start = parseDate(e.target.value).toDate()) }), h("label", { key: 'be0174d19a814f5119ef504f56a60f1d00e690ed', part: "input-label", class: labelClasses, htmlFor: `${this.facetId}_end` }, endLabel, ":"), h("input", { key: '1786cc6d87fe13282dc0c7a4e56c5a979ad10d39', id: `${this.facetId}_end`, part: "input-end", type: "date", ref: (ref) => (this.endRef = ref), class: inputClasses, "aria-label": endAria, placeholder: placeholder, pattern: pattern, required: true, min: this.formattedDateValue(this.start) || this.min, max: this.max, value: this.formattedDateValue(range?.end), onInput: (e) => (this.end = parseDate(e.target.value).toDate()) }), h(Button, { key: '4d15da7ba14e0349e0caa0b576c392ad331c29f9', style: "outline-primary", type: "submit", part: "input-apply-button", class: "col-span-2 truncate p-2.5", ariaLabel: applyAria, text: apply })));
|
|
75
75
|
}
|
|
76
76
|
}, [0, "atomic-facet-date-input", {
|
|
77
77
|
"bindings": [16],
|
|
@@ -42,11 +42,11 @@ const FacetNumberInput = /*@__PURE__*/ proxyCustomElement(class FacetNumberInput
|
|
|
42
42
|
const inputClasses = 'p-2.5 input-primary placeholder-neutral-dark min-w-0 mr-1';
|
|
43
43
|
const labelClasses = 'text-neutral-dark text-sm';
|
|
44
44
|
const step = this.type === 'integer' ? '1' : 'any';
|
|
45
|
-
return (h("form", { key: '
|
|
45
|
+
return (h("form", { key: 'aeec1e4f98899d1653df921fc0a9c53ca3fcbf3b', class: "mt-4 gap-y-0.5 px-2", part: "input-form", onSubmit: (e) => {
|
|
46
46
|
e.preventDefault();
|
|
47
47
|
this.apply();
|
|
48
48
|
return false;
|
|
49
|
-
} }, h("label", { key: '
|
|
49
|
+
} }, h("label", { key: 'edfa0efd988534f6c8228215489220f79504e166', part: "label-start", class: labelClasses, htmlFor: `${this.filterState.facetId}_start` }, minText), h("input", { key: 'c032ead904ce549843de5ca3f124d8502a3e4d14', part: "input-start", id: `${this.filterState.facetId}_start`, type: "number", step: step, ref: (ref) => (this.startRef = ref), class: inputClasses, "aria-label": minAria, required: true, min: Number.MIN_SAFE_INTEGER, max: this.end, value: this.filterState.range?.start, onInput: (e) => (this.start = e.target.valueAsNumber) }), h("label", { key: '5e6950b85237aaf46b09d00487f882044402eec1', part: "label-end", class: labelClasses, htmlFor: `${this.filterState.facetId}_end` }, maxText), h("input", { key: 'c07d8787a0bcdc8f267f3d753752feb14c1e14f2', part: "input-end", id: `${this.filterState.facetId}_end`, type: "number", step: step, ref: (ref) => (this.endRef = ref), class: inputClasses, "aria-label": maxAria, required: true, min: this.start, max: Number.MAX_SAFE_INTEGER, value: this.filterState.range?.end, onInput: (e) => (this.end = e.target.valueAsNumber) }), h(Button, { key: '97b81fcf3f99a3a250b1f4e538dd720893be20fe', style: "outline-primary", type: "submit", part: "input-apply-button", class: "flex-none truncate p-2.5", ariaLabel: applyAria, text: apply })));
|
|
50
50
|
}
|
|
51
51
|
static get style() { return AtomicFacetNumberInputStyle0; }
|
|
52
52
|
}, [0, "atomic-facet-number-input", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":"
|
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAca,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;;ACkDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["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 {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\nimport {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\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 {InteractiveItemContextController} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {InteractiveItemContextEvent} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\nimport {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport {LitElement} from 'lit';\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}
|