@searchcraft/javascript-sdk 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-b76bece0.js → index-b3b77ea2.js} +2 -1
- package/dist/cjs/index-b3b77ea2.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +3 -3
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +13 -12
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-button_3.cjs.entry.js +63 -0
- package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +140 -14
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +7 -7
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +227 -0
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js +26 -0
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js +197 -3
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +32 -0
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-results-info.cjs.entry.js +5 -5
- package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -1
- package/dist/cjs/{store-943576b0.js → store-d7ebcf7a.js} +280 -267
- package/dist/cjs/store-d7ebcf7a.js.map +1 -0
- package/dist/cjs/styles-7b2d06f2.js +28 -0
- package/dist/cjs/styles-7b2d06f2.js.map +1 -0
- package/dist/cjs/units-fe4d8083.js +88 -0
- package/dist/cjs/units-fe4d8083.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +21 -16
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +54 -4
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +45 -13
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +52 -2
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +11 -6
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +52 -2
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +11 -2
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +52 -2
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +23 -4
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +52 -2
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +13 -4
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +52 -2
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +66 -49
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +1 -1
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.module.css +56 -6
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +12 -6
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +52 -2
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +25 -0
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js.map +1 -0
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +278 -5
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.module.css +322 -0
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +139 -0
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +1 -0
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.css +209 -0
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +47 -6
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +11 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +53 -3
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +13 -8
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +52 -2
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +9 -5
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +52 -2
- package/dist/collection/index.js +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/store.js +14 -15
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/types/_shared.types.js +2 -0
- package/dist/collection/types/_shared.types.js.map +1 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/collection/types/searchcraft-base-search-results.types.js.map +1 -1
- package/dist/collection/types/searchcraft-popover-form.types.js.map +1 -1
- package/dist/collection/utils/{utils.js → facets.js} +7 -105
- package/dist/collection/utils/facets.js.map +1 -0
- package/dist/collection/utils/index.js +4 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/collection/utils/styles.js +22 -0
- package/dist/collection/utils/styles.js.map +1 -0
- package/dist/collection/utils/units.js +83 -0
- package/dist/collection/utils/units.js.map +1 -0
- package/dist/components/index.js +6 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-02a16e53.js +240 -0
- package/dist/components/p-02a16e53.js.map +1 -0
- package/dist/components/{p-cbdcf6df.js → p-04c46179.js} +3 -3
- package/dist/components/p-04c46179.js.map +1 -0
- package/dist/components/p-0e38a723.js +99 -0
- package/dist/components/p-0e38a723.js.map +1 -0
- package/dist/components/p-4c45ef80.js +67 -0
- package/dist/components/p-4c45ef80.js.map +1 -0
- package/dist/components/p-755f491b.js +84 -0
- package/dist/components/p-755f491b.js.map +1 -0
- package/dist/components/p-85765b81.js +56 -0
- package/dist/components/p-85765b81.js.map +1 -0
- package/dist/components/p-953f4238.js +35 -0
- package/dist/components/p-953f4238.js.map +1 -0
- package/dist/components/p-a248ad69.js +276 -0
- package/dist/components/p-a248ad69.js.map +1 -0
- package/dist/components/p-a9bd1872.js +38 -0
- package/dist/components/p-a9bd1872.js.map +1 -0
- package/dist/components/p-cf4ced92.js +49 -0
- package/dist/components/p-cf4ced92.js.map +1 -0
- package/dist/components/{p-ad4ebde0.js → p-d6a88eed.js} +280 -267
- package/dist/components/p-d6a88eed.js.map +1 -0
- package/dist/components/p-d9551738.js +25 -0
- package/dist/components/p-d9551738.js.map +1 -0
- package/dist/components/p-f9d778b3.js +48 -0
- package/dist/components/p-f9d778b3.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +6 -5
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +8 -8
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +1 -241
- package/dist/components/searchcraft-input-form.js.map +1 -1
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-popover-button.d.ts +11 -0
- package/dist/components/searchcraft-popover-button.js +39 -0
- package/dist/components/searchcraft-popover-button.js.map +1 -0
- package/dist/components/searchcraft-popover-form.js +245 -5
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.d.ts +11 -0
- package/dist/components/searchcraft-popover-list-item.js +8 -0
- package/dist/components/searchcraft-popover-list-item.js.map +1 -0
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +3 -3
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/esm/{index-be042742.js → index-11551663.js} +2 -2
- package/dist/esm/index-11551663.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/searchcraft-base-search-result.entry.js +3 -3
- package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -1
- package/dist/esm/searchcraft-base-search-results.entry.js +5 -4
- package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
- package/dist/esm/searchcraft-button_3.entry.js +57 -0
- package/dist/esm/searchcraft-button_3.entry.js.map +1 -0
- package/dist/esm/searchcraft-facet-list_3.entry.js +137 -11
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-filter-panel.entry.js +6 -6
- package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
- package/dist/esm/searchcraft-input-form_2.entry.js +222 -0
- package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -0
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/searchcraft-popover-button.entry.js +22 -0
- package/dist/esm/searchcraft-popover-button.entry.js.map +1 -0
- package/dist/esm/searchcraft-popover-form.entry.js +197 -3
- package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-popover-list-item.entry.js +28 -0
- package/dist/esm/searchcraft-popover-list-item.entry.js.map +1 -0
- package/dist/esm/searchcraft-results-info.entry.js +4 -4
- package/dist/esm/searchcraft-results-info.entry.js.map +1 -1
- package/dist/esm/{store-eb4269d6.js → store-1058f7b0.js} +280 -267
- package/dist/esm/store-1058f7b0.js.map +1 -0
- package/dist/esm/styles-961644ef.js +25 -0
- package/dist/esm/styles-961644ef.js.map +1 -0
- package/dist/esm/units-b6eba560.js +84 -0
- package/dist/esm/units-b6eba560.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-4580e8a4.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-4580e8a4.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-7049b93d.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-7049b93d.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-755f491b.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-755f491b.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-8e539d62.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-8e539d62.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-98640a6a.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-98640a6a.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-9d0f5c89.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-9d0f5c89.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-b8bd53ce.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-b8bd53ce.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-c27a3673.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-c27a3673.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-cd852b84.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-cd852b84.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-d6a88eed.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-d6a88eed.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-d9551738.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-d9551738.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-e042deb9.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-e042deb9.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-d7d0b88c.js → p-e0be53df.js} +2 -2
- package/dist/searchcraft-javascript-sdk/{p-d7d0b88c.js.map → p-e0be53df.js.map} +1 -1
- package/dist/searchcraft-javascript-sdk/p-efab9f3c.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-efab9f3c.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +53 -0
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +68 -0
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +20 -0
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +12 -0
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +25 -0
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +12 -0
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +37 -13
- package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +13 -1
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +7 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +97 -1
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +22 -0
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +19 -3
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +10 -0
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +18 -0
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +11 -3
- package/dist/types/components.d.ts +1023 -30
- package/dist/types/index.d.ts +1 -1
- package/dist/types/provider/store.d.ts +4 -2
- package/dist/types/types/_shared.types.d.ts +45 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/searchcraft-base-search-results.types.d.ts +1 -8
- package/dist/types/types/searchcraft-popover-form.types.d.ts +2 -1
- package/dist/types/utils/facets.d.ts +6 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/styles.d.ts +2 -0
- package/dist/types/utils/{utils.d.ts → units.d.ts} +12 -19
- package/package.json +11 -8
- package/dist/cjs/index-b76bece0.js.map +0 -1
- package/dist/cjs/searchcraft-button_2.cjs.entry.js +0 -51
- package/dist/cjs/searchcraft-button_2.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-error-message.cjs.entry.js +0 -23
- package/dist/cjs/searchcraft-error-message.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-input-form.cjs.entry.js +0 -202
- package/dist/cjs/searchcraft-input-form.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-list-view.cjs.entry.js +0 -26
- package/dist/cjs/searchcraft-popover-list-view.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-result.cjs.entry.js +0 -25
- package/dist/cjs/searchcraft-popover-result.cjs.entry.js.map +0 -1
- package/dist/cjs/store-943576b0.js.map +0 -1
- package/dist/cjs/utils-a17279a2.js +0 -226
- package/dist/cjs/utils-a17279a2.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-result/searchcraft-popover-result.js +0 -21
- package/dist/collection/components/searchcraft-popover-result/searchcraft-popover-result.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/p-16983367.js +0 -35
- package/dist/components/p-16983367.js.map +0 -1
- package/dist/components/p-42bfef5f.js +0 -151
- package/dist/components/p-42bfef5f.js.map +0 -1
- package/dist/components/p-5380505b.js +0 -99
- package/dist/components/p-5380505b.js.map +0 -1
- package/dist/components/p-672354c0.js +0 -38
- package/dist/components/p-672354c0.js.map +0 -1
- package/dist/components/p-9cb3d38b.js +0 -48
- package/dist/components/p-9cb3d38b.js.map +0 -1
- package/dist/components/p-a23d2994.js +0 -67
- package/dist/components/p-a23d2994.js.map +0 -1
- package/dist/components/p-ad4ebde0.js.map +0 -1
- package/dist/components/p-bd5fede3.js +0 -41
- package/dist/components/p-bd5fede3.js.map +0 -1
- package/dist/components/p-cbdcf6df.js.map +0 -1
- package/dist/components/p-f308d05d.js +0 -218
- package/dist/components/p-f308d05d.js.map +0 -1
- package/dist/components/searchcraft-popover-result.d.ts +0 -11
- package/dist/components/searchcraft-popover-result.js +0 -38
- package/dist/components/searchcraft-popover-result.js.map +0 -1
- package/dist/esm/index-be042742.js.map +0 -1
- package/dist/esm/searchcraft-button_2.entry.js +0 -46
- package/dist/esm/searchcraft-button_2.entry.js.map +0 -1
- package/dist/esm/searchcraft-error-message.entry.js +0 -19
- package/dist/esm/searchcraft-error-message.entry.js.map +0 -1
- package/dist/esm/searchcraft-input-form.entry.js +0 -198
- package/dist/esm/searchcraft-input-form.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-list-view.entry.js +0 -22
- package/dist/esm/searchcraft-popover-list-view.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-result.entry.js +0 -21
- package/dist/esm/searchcraft-popover-result.entry.js.map +0 -1
- package/dist/esm/store-eb4269d6.js.map +0 -1
- package/dist/esm/utils-c2ce411f.js +0 -218
- package/dist/esm/utils-c2ce411f.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-04300412.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-04300412.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-09c7fbef.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-09c7fbef.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-3e4a28e7.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-3e4a28e7.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-4d3682a8.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-4d3682a8.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-61cf9d6c.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-61cf9d6c.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-93b92b65.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-93b92b65.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a7a7b4e0.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a7a7b4e0.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a810aeae.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a810aeae.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-aa155194.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-aa155194.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-ad4ebde0.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-ad4ebde0.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-adadf38a.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-adadf38a.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-d57eba31.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-d57eba31.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-f308d05d.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-f308d05d.js.map +0 -1
- package/dist/types/components/searchcraft-popover-result/searchcraft-popover-result.d.ts +0 -6
- /package/dist/collection/components/{searchcraft-popover-result/searchcraft-popover-result.module.css → searchcraft-popover-button/searchcraft-popover-button.module.css} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
2
|
-
import { u as useSearchcraftStore } from './store-
|
|
3
|
-
import { g as getDocumentValueFromSearchResultMapping
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-11551663.js';
|
|
2
|
+
import { u as useSearchcraftStore } from './store-1058f7b0.js';
|
|
3
|
+
import { g as getDocumentValueFromSearchResultMapping } from './units-b6eba560.js';
|
|
4
|
+
import { s as serializeStyles } from './styles-961644ef.js';
|
|
4
5
|
|
|
5
|
-
const searchcraftBaseSearchResultsModuleCss = ":root{--sc-
|
|
6
|
+
const searchcraftBaseSearchResultsModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-ad-section{align-items:center;background-color:#F1F1F1;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;min-height:176px;text-align:center}.searchcraft-ad-section p{margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}";
|
|
6
7
|
const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss;
|
|
7
8
|
|
|
8
9
|
const SearchcraftBaseSearchResults = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-base-search-results.entry.js","mappings":"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","names":[],"sources":["src/components/searchcraft-base-search-results/searchcraft-base-search-results.module.scss?tag=searchcraft-base-search-results","src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"sourcesContent":[".searchcraft-search-results-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 16px;\n}\n\n.searchcraft-ad-section {\n align-items: center;\n background-color: #F1F1F1;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n font-size: 16px;\n justify-content: center;\n min-height: 176px;\n text-align: center;\n\n p {\n margin: 0;\n color: var(--sc-content-disabled);\n }\n}\n\n.searchcraft-search-results-empty-state-container {\n text-align: center;\n}\n\n.searchcraft-search-results-error-message-container {\n text-align: center;\n}\n","import {\n Component,\n h,\n Event,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\n\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport {\n getDocumentValueFromSearchResultMapping,\n serializeStyles,\n} from '@utils/utils';\nimport type { SearchResultMappings } from 'types';\n\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResults {\n @Prop() adInterval = 4;\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>>\n | undefined;\n @Prop() searchResultMappings: SearchResultMappings | undefined;\n @Prop() placeAdAtEnd = false;\n @Prop() placeAdAtStart = true;\n @Prop() resultImagePlacement: 'left' | 'right' = 'right';\n @Prop() buttonLabel: string | undefined;\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n\n @Event() noResults: EventEmitter<void>;\n\n @State() hasSearched = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n renderDocument(document: Record<string, unknown>, index: number) {\n /**\n * Index field values -> Result container props mappings.\n */\n const titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.title,\n );\n const subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.subtitle,\n );\n const bodyContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.body,\n );\n const containerHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.containerHref,\n );\n const buttonHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.buttonHref,\n );\n const imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.imageSource,\n );\n const footerContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.footer,\n );\n\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n return (\n <searchcraft-base-search-result\n key={`${document.document_id}-${index}`}\n custom-styles={serializedStyles}\n image-placement={this.resultImagePlacement}\n container-rel={this.containerRel}\n container-target={this.containerTarget}\n button-label={this.buttonLabel || 'View more'}\n button-rel={this.buttonRel}\n button-target={this.buttonTarget}\n document-position={index}\n title-content={titleContent}\n subtitle-content={subtitleContent}\n body-content={bodyContent}\n footer-content={footerContent}\n container-href={containerHref}\n button-href={buttonHref}\n image-src={imageSource}\n />\n );\n }\n\n render() {\n if (this.query.trim() === '') {\n return (\n <div class='searchcraft-search-results-empty-state-container'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n return;\n }\n\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n documents.forEach((document, index) => {\n finalComponents.push(this.renderDocument(document, index));\n\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div\n key={`ad-section-${index + 1}`}\n class='searchcraft-ad-section '\n >\n <p>Ad Section</p>\n </div>,\n );\n }\n });\n } else {\n const documentElements = documents.map((document, index) =>\n this.renderDocument(document, index),\n );\n finalComponents.push(...documentElements);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.query.length > 0 && this.searchResults?.data?.hits?.length === 0) {\n this.noResults.emit();\n }\n\n return (\n <div class='searchcraft-search-results-container'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='searchcraft-search-results-error-message-container'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"searchcraft-base-search-results.entry.js","mappings":"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","names":[],"sources":["src/components/searchcraft-base-search-results/searchcraft-base-search-results.module.scss?tag=searchcraft-base-search-results","src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"sourcesContent":[".searchcraft-search-results-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 16px;\n}\n\n.searchcraft-ad-section {\n align-items: center;\n background-color: #F1F1F1;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n font-size: 16px;\n justify-content: center;\n min-height: 176px;\n text-align: center;\n\n p {\n margin: 0;\n color: var(--sc-content-disabled);\n }\n}\n\n.searchcraft-search-results-empty-state-container {\n text-align: center;\n}\n\n.searchcraft-search-results-error-message-container {\n text-align: center;\n}\n","import {\n Component,\n h,\n Event,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\n\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport {\n getDocumentValueFromSearchResultMapping,\n serializeStyles,\n} from '@utils';\nimport type { SearchResultMappings } from 'types';\n\n/**\n * This web component is responsible for displaying the results of a search query.\n * Once a query is submitted, the component formats and presents an ordered list of the results.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-base-search-results\n * ad-interval=\"4\"\n * place-ad-at-start=\"false\"\n * result-image-placement=\"right\"\n * />\n * ```\n *\n * ```js\n * // index.js\n * const baseSearchResults = document.querySelector('searchcraft-base-search-results');\n *\n * baseSearchResults.searchResultMappings = containerHref: {\n * fieldNames: [\n * {\n * fieldName: 'canonical_link',\n * dataType: 'text',\n * },\n * ],\n * };\n *\n * baseSearchResults.addEventListener('noResults', () => {\n * console.log('No search results found');\n * });\n * ```\n */\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResults {\n /**\n * How often ads are injected.\n */\n @Prop() adInterval = 4;\n /**\n * A custom styles object.\n */\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>>\n | undefined;\n /**\n * Formats the content rendered for each result.\n */\n @Prop() searchResultMappings: SearchResultMappings | undefined;\n /**\n * Should an ad be placed at the end of the results.\n */\n @Prop() placeAdAtEnd = false;\n /**\n * Should an ad be placed at the start of the results.\n */\n @Prop() placeAdAtStart = true;\n /**\n * The placement of the image for each result.\n */\n @Prop() resultImagePlacement: 'left' | 'right' = 'right';\n /**\n * The label for the button rendered when containerHref is not present for each result.\n */\n @Prop() buttonLabel: string | undefined;\n /**\n * Where to open the link for the button rendered when containerHref is not present for each result.\n */\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the button rendered when containerHref is not present for each result.\n */\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * Where to open the link for the containing element for each result.\n */\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the containing element for each result.\n */\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n\n /**\n * When no results are returned.\n */\n @Event() noResults: EventEmitter<void>;\n\n @State() hasSearched = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n renderDocument(document: Record<string, unknown>, index: number) {\n /**\n * Index field values -> Result container props mappings.\n */\n const titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.title,\n );\n const subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.subtitle,\n );\n const bodyContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.body,\n );\n const containerHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.containerHref,\n );\n const buttonHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.buttonHref,\n );\n const imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.imageSource,\n );\n const footerContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.footer,\n );\n\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n return (\n <searchcraft-base-search-result\n key={`${document.document_id}-${index}`}\n custom-styles={serializedStyles}\n image-placement={this.resultImagePlacement}\n container-rel={this.containerRel}\n container-target={this.containerTarget}\n button-label={this.buttonLabel || 'View more'}\n button-rel={this.buttonRel}\n button-target={this.buttonTarget}\n document-position={index}\n title-content={titleContent}\n subtitle-content={subtitleContent}\n body-content={bodyContent}\n footer-content={footerContent}\n container-href={containerHref}\n button-href={buttonHref}\n image-src={imageSource}\n />\n );\n }\n\n render() {\n if (this.query.trim() === '') {\n return (\n <div class='searchcraft-search-results-empty-state-container'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n return;\n }\n\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n documents.forEach((document, index) => {\n finalComponents.push(this.renderDocument(document, index));\n\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div\n key={`ad-section-${index + 1}`}\n class='searchcraft-ad-section '\n >\n <p>Ad Section</p>\n </div>,\n );\n }\n });\n } else {\n const documentElements = documents.map((document, index) =>\n this.renderDocument(document, index),\n );\n finalComponents.push(...documentElements);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.query.length > 0 && this.searchResults?.data?.hits?.length === 0) {\n this.noResults.emit();\n }\n\n return (\n <div class='searchcraft-search-results-container'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='searchcraft-search-results-error-message-container'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-11551663.js';
|
|
2
|
+
import { c as classNames } from './index-72ac5051.js';
|
|
3
|
+
|
|
4
|
+
const searchcraftButtonModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);border-radius:8px;display:flex;padding:12px 20px;position:relative;background-color:var(--sc-surface-brand-primary);border:1px solid var(--sc-border-primary);color:var(--sc-content-brand-on-primary)}.searchcraft-button:hover{cursor:pointer;background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button:focus{outline:2px solid var(--sc-surface-brand-primary)}.buttonLabel{position:relative}";
|
|
5
|
+
const SearchcraftButtonStyle0 = searchcraftButtonModuleCss;
|
|
6
|
+
|
|
7
|
+
const SearchcraftButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.buttonClick = createEvent(this, "buttonClick", 7);
|
|
11
|
+
this.handleClick = () => {
|
|
12
|
+
this.buttonClick.emit();
|
|
13
|
+
};
|
|
14
|
+
this.iconElement = undefined;
|
|
15
|
+
this.iconOnly = false;
|
|
16
|
+
this.iconPosition = 'left';
|
|
17
|
+
this.label = 'Search';
|
|
18
|
+
this.isRequesting = false;
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (h(Fragment, { key: '52b95f09f5da9f281b250285623e150c5d952dce' }, this.iconOnly ? (h("button", { class: classNames('searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (h("button", { class: classNames('searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.iconElement, h("span", { class: classNames('buttonLabel', 'searchcraft-button-label') }, this.label)))));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
SearchcraftButton.style = SearchcraftButtonStyle0;
|
|
25
|
+
|
|
26
|
+
const searchcraftErrorMessageModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-error-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-danger);margin:0}";
|
|
27
|
+
const SearchcraftErrorMessageStyle0 = searchcraftErrorMessageModuleCss;
|
|
28
|
+
|
|
29
|
+
const SearchcraftErrorMessage = class {
|
|
30
|
+
constructor(hostRef) {
|
|
31
|
+
registerInstance(this, hostRef);
|
|
32
|
+
this.errorMessage = undefined;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h("p", { key: '5bdc428adf6f239d66a9b0f946ee6e582de41e86', class: 'searchcraft-error-message' }, this.errorMessage || 'Search term is required.'));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
|
|
39
|
+
|
|
40
|
+
const searchcraftInputLabelModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-input-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height);color:var(--sc-content-neutral-primary);margin-top:4px;margin-bottom:4px}";
|
|
41
|
+
const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
|
|
42
|
+
|
|
43
|
+
const SearchcraftInputLabel = class {
|
|
44
|
+
constructor(hostRef) {
|
|
45
|
+
registerInstance(this, hostRef);
|
|
46
|
+
this.inputLabelClassName = '';
|
|
47
|
+
this.label = undefined;
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return (h("label", { key: '4f913c1d9027ff781725a01e71e241cb5767eadb', class: classNames('searchcraft-input-label', this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
|
|
54
|
+
|
|
55
|
+
export { SearchcraftButton as searchcraft_button, SearchcraftErrorMessage as searchcraft_error_message, SearchcraftInputLabel as searchcraft_input_label };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=searchcraft-button_3.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-button.searchcraft-error-message.searchcraft-input-label.entry.js","mappings":";;;AAAA,MAAM,0BAA0B,GAAG,46HAA46H,CAAC;AACh9H,gCAAe,0BAA0B;;MCoB5B,iBAAiB;;;;QAyBpB,gBAAW,GAAG;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB,CAAC;;wBAnBiB,KAAK;4BAID,MAAM;qBAIb,QAAQ;4BAOA,KAAK;;IAM7B,MAAM;QACJ,QACE,EAAC,QAAQ,uDACN,IAAI,CAAC,QAAQ,IACZ,cACE,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChB,mCAA4B,KAE5B,IAAI,CAAC,WAAW,CACjB,CACM,KAET,cACE,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EACjD,YAAM,KAAK,EAAE,UAAU,CAAC,aAAa,EAAE,0BAA0B,CAAC,IAC/D,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,EACX;KACH;;;;AC/EH,MAAM,gCAAgC,GAAG,4kHAA4kH,CAAC;AACtnH,sCAAe,gCAAgC;;MCelC,uBAAuB;;;;;IAMlC,MAAM;QACJ,QACE,0DAAG,KAAK,EAAC,2BAA2B,IACjC,IAAI,CAAC,YAAY,IAAI,0BAA0B,CAC9C,EACJ;KACH;;;;AC5BH,MAAM,8BAA8B,GAAG,0nHAA0nH,CAAC;AAClqH,oCAAe,8BAA8B;;MCgBhC,qBAAqB;;;mCAID,EAAE;;;IAGjC,MAAM;QACJ,QACE,8DACE,KAAK,EAAE,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,mBAAmB,CAAC,EACtE,OAAO,EAAC,sBAAsB,IAE7B,IAAI,CAAC,KAAK,CACL,EACR;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-button/searchcraft-button.module.scss?tag=searchcraft-button","src/components/searchcraft-button/searchcraft-button.tsx","src/components/searchcraft-error-message/searchcraft-error-message.module.scss?tag=searchcraft-error-message","src/components/searchcraft-error-message/searchcraft-error-message.tsx","src/components/searchcraft-input-label/searchcraft-input-label.module.scss?tag=searchcraft-input-label","src/components/searchcraft-input-label/searchcraft-input-label.tsx"],"sourcesContent":[".searchcraft-button {\n @include body-bold;\n\n border-radius: 8px;\n display: flex;\n padding: 12px 20px;\n position: relative;\n\n background-color: var(--sc-surface-brand-primary);\n border: 1px solid var(--sc-border-primary);\n color: var(--sc-content-brand-on-primary);\n\n &:hover {\n cursor: pointer;\n background-color: var(--sc-surface-brand-primary-hover);\n }\n\n &:focus {\n outline: 2px solid var(--sc-surface-brand-primary);\n }\n}\n\n.buttonLabel {\n position: relative;\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component represents a button to be consumed within the `search-input-form` component.\n * It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.\n * It is consumed within the `searchcraft-input-form` component.\n */\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: false,\n})\nexport class SearchcraftButton {\n /**\n * The icon element.\n */\n @Prop() iconElement?: Element;\n /**\n * Should the button only display an icon.\n */\n @Prop() iconOnly = false;\n /**\n * The position of the icon.\n */\n @Prop() iconPosition = 'left';\n /**\n * The label for the button.\n */\n @Prop() label = 'Search';\n\n /**\n * When the button is clicked.\n */\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n\n private handleClick = () => {\n this.buttonClick.emit();\n };\n\n render() {\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames('searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.isRequesting ? (\n <searchcraft-spinner-dark />\n ) : (\n this.iconElement\n )}\n </button>\n ) : (\n <button\n class={classNames('searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.iconElement}\n <span class={classNames('buttonLabel', 'searchcraft-button-label')}>\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n",".searchcraft-error-message {\n @include body-small();\n color: var(--sc-content-danger);\n margin: 0;\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n/**\n * This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-error-message error-message=\"No search results found for query\" />\n * ```\n */\n@Component({\n tag: 'searchcraft-error-message',\n styleUrl: 'searchcraft-error-message.module.scss',\n shadow: false,\n})\nexport class SearchcraftErrorMessage {\n /**\n * The error message.\n */\n @Prop() errorMessage?: string;\n\n render() {\n return (\n <p class='searchcraft-error-message'>\n {this.errorMessage || 'Search term is required.'}\n </p>\n );\n }\n}\n",".searchcraft-input-label {\n @include body-small-bold();\n color: var(--sc-content-neutral-primary);\n margin-top: 4px;\n margin-bottom: 4px;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component serves as the input label for the searchcraft-input-form component.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-input-label label=\"Search\" />\n * ```\n */\n@Component({\n tag: 'searchcraft-input-label',\n styleUrl: 'searchcraft-input-label.module.scss',\n shadow: false,\n})\nexport class SearchcraftInputLabel {\n /**\n * The classname applied to the label element.\n */\n @Prop() inputLabelClassName? = '';\n @Prop() label: string;\n\n render() {\n return (\n <label\n class={classNames('searchcraft-input-label', this.inputLabelClassName)}\n htmlFor='searchcraft-input-id'\n >\n {this.label}\n </label>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,9 +1,135 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-11551663.js';
|
|
2
2
|
import { c as classNames } from './index-72ac5051.js';
|
|
3
|
-
import { u as useSearchcraftStore } from './store-
|
|
4
|
-
import {
|
|
3
|
+
import { u as useSearchcraftStore } from './store-1058f7b0.js';
|
|
4
|
+
import { a as getMillis } from './units-b6eba560.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function deepMergeWithSpread(obj1, obj2) {
|
|
7
|
+
const result = Object.assign({}, obj1);
|
|
8
|
+
for (const key in obj2) {
|
|
9
|
+
// biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>
|
|
10
|
+
if (obj2.hasOwnProperty(key)) {
|
|
11
|
+
if (obj2[key] instanceof Object && obj1[key] instanceof Object) {
|
|
12
|
+
result[key] = deepMergeWithSpread(obj1[key], obj2[key]);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
result[key] = obj2[key];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Given an array of facet paths, removes parent facet paths.
|
|
23
|
+
*/
|
|
24
|
+
function removeSubstringMatches(arr) {
|
|
25
|
+
return arr.filter((entry, index, array) => !array.some((otherEntry, otherIndex) => otherIndex !== index && otherEntry.includes(entry)));
|
|
26
|
+
}
|
|
27
|
+
function facetToRecord(facet) {
|
|
28
|
+
const records = {};
|
|
29
|
+
const traverseAndAddToFragments = (facetChild) => {
|
|
30
|
+
var _a;
|
|
31
|
+
records[facetChild.path] = {
|
|
32
|
+
count: facetChild.count,
|
|
33
|
+
path: facetChild.path,
|
|
34
|
+
};
|
|
35
|
+
(_a = facetChild.children) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
36
|
+
traverseAndAddToFragments(child);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
traverseAndAddToFragments(facet);
|
|
40
|
+
return records;
|
|
41
|
+
}
|
|
42
|
+
function recordToObject(record) {
|
|
43
|
+
const root = {
|
|
44
|
+
count: 0,
|
|
45
|
+
path: '/',
|
|
46
|
+
children: {},
|
|
47
|
+
};
|
|
48
|
+
Object.keys(record).forEach((key) => {
|
|
49
|
+
const fragment = record[key];
|
|
50
|
+
if (fragment.path === '/') {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const pathParts = fragment.path.substring(1).split('/');
|
|
54
|
+
let currentRoot = root;
|
|
55
|
+
let currentPath = '';
|
|
56
|
+
pathParts.forEach((part, index) => {
|
|
57
|
+
const nextPath = `${currentPath}/${part}`;
|
|
58
|
+
if (!currentRoot.children[nextPath]) {
|
|
59
|
+
currentRoot.children[nextPath] = {
|
|
60
|
+
count: 0,
|
|
61
|
+
path: nextPath,
|
|
62
|
+
children: {},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (index === pathParts.length - 1) {
|
|
66
|
+
currentRoot.children[nextPath].count = fragment.count;
|
|
67
|
+
}
|
|
68
|
+
currentPath = nextPath;
|
|
69
|
+
currentRoot = currentRoot.children[nextPath];
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
return root;
|
|
73
|
+
}
|
|
74
|
+
function objectToFacet(childObject) {
|
|
75
|
+
const transformed = {
|
|
76
|
+
count: childObject.count,
|
|
77
|
+
path: childObject.path,
|
|
78
|
+
children: [],
|
|
79
|
+
};
|
|
80
|
+
if (Object.keys(childObject.children).length > 0) {
|
|
81
|
+
transformed.children = Object.values(childObject.children).map((subChildObject) => objectToFacet(subChildObject));
|
|
82
|
+
}
|
|
83
|
+
return transformed;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Filters records with the parent paths from record2 OUT of record1
|
|
87
|
+
*/
|
|
88
|
+
function filterRecordByParentPaths(record1, record2) {
|
|
89
|
+
// Extract all paths (keys) both records
|
|
90
|
+
const paths1 = Object.keys(record1);
|
|
91
|
+
const paths2 = Object.keys(record2);
|
|
92
|
+
// Find all parent paths in record2
|
|
93
|
+
const parentPaths = new Set(paths2
|
|
94
|
+
.filter((path) => path.split('/').length > 2) // Only consider paths with more than one level
|
|
95
|
+
.map((path) => path.substring(0, path.lastIndexOf('/'))));
|
|
96
|
+
// Filter out keys in record1 that share a parent path with any of the identified parent paths
|
|
97
|
+
const filteredRecord = Object.fromEntries(paths1
|
|
98
|
+
.filter((path) => !parentPaths.has(path.substring(0, path.lastIndexOf('/'))))
|
|
99
|
+
.map((path) => [path, record1[path]]));
|
|
100
|
+
return filteredRecord;
|
|
101
|
+
}
|
|
102
|
+
function mergeFacetRoots(fieldName, currentRoot, incomingRoot) {
|
|
103
|
+
const currentArray = currentRoot[fieldName];
|
|
104
|
+
const incomingArray = incomingRoot[fieldName];
|
|
105
|
+
const currentRootFacetChild = {
|
|
106
|
+
count: 0,
|
|
107
|
+
path: '/',
|
|
108
|
+
children: currentArray,
|
|
109
|
+
};
|
|
110
|
+
const incomingRootFacetChild = {
|
|
111
|
+
count: 0,
|
|
112
|
+
path: '/',
|
|
113
|
+
children: incomingArray,
|
|
114
|
+
};
|
|
115
|
+
// Flatten them into records
|
|
116
|
+
const currentRecord = facetToRecord(currentRootFacetChild);
|
|
117
|
+
const incomingRecord = facetToRecord(incomingRootFacetChild);
|
|
118
|
+
// Filter out the records from record1 (the current set of records)
|
|
119
|
+
// that share a parent path with record2 (the incoming records)
|
|
120
|
+
const filteredCurrentRecord = filterRecordByParentPaths(currentRecord, incomingRecord);
|
|
121
|
+
// Deep merge the records together
|
|
122
|
+
const mergedRecord = deepMergeWithSpread(filteredCurrentRecord, incomingRecord);
|
|
123
|
+
// Convert into a heirarchical object
|
|
124
|
+
const mergedObject = recordToObject(mergedRecord);
|
|
125
|
+
// Convert the heirarchical object back to the Facet child structure
|
|
126
|
+
const mergedFacetChild = objectToFacet(mergedObject);
|
|
127
|
+
return {
|
|
128
|
+
[fieldName]: mergedFacetChild.children,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const searchcraftFacetListModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-disabled);text-align:center}";
|
|
7
133
|
const SearchcraftFacetListStyle0 = searchcraftFacetListModuleCss;
|
|
8
134
|
|
|
9
135
|
const SearchcraftFacetList = class {
|
|
@@ -103,7 +229,7 @@ const SearchcraftFacetList = class {
|
|
|
103
229
|
render() {
|
|
104
230
|
var _a;
|
|
105
231
|
const firstFacet = (_a = this.facetRoot) === null || _a === void 0 ? void 0 : _a[this.fieldName];
|
|
106
|
-
return (h("div", { key: '
|
|
232
|
+
return (h("div", { key: '709834d9f86b75257ae0c67e9340c0fea4131035', class: classNames('filtersListContainer', 'searchcraft-filters-list-container') }, !firstFacet && (h("p", { key: 'a6e2ced40fcc0762ae8ea835c9d6c573aceeb1f1', class: 'searchcraft-facet-message' }, "Enter a search to view facets.")), firstFacet === null || firstFacet === void 0 ? void 0 :
|
|
107
233
|
firstFacet.map((facetChild) => {
|
|
108
234
|
var _a;
|
|
109
235
|
const isChildSelected = facetChild.children
|
|
@@ -121,7 +247,7 @@ const SearchcraftFacetList = class {
|
|
|
121
247
|
};
|
|
122
248
|
SearchcraftFacetList.style = SearchcraftFacetListStyle0;
|
|
123
249
|
|
|
124
|
-
const searchcraftSliderModuleCss = ":root{--sc-
|
|
250
|
+
const searchcraftSliderModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-input{appearance:none;background:transparent;border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:\"Source Sans Pro\", sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}";
|
|
125
251
|
const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
|
|
126
252
|
|
|
127
253
|
const SearchcraftSlider = class {
|
|
@@ -183,15 +309,15 @@ const SearchcraftSlider = class {
|
|
|
183
309
|
const endLabel = this.dataType === 'number'
|
|
184
310
|
? this.endValue
|
|
185
311
|
: new Date(this.endValue).getFullYear();
|
|
186
|
-
return (h("div", { key: '
|
|
312
|
+
return (h("div", { key: 'd03f03307d560048eff499afabb4171421c9b5cd', class: 'searchcraft-slider-container' }, h("div", { key: '986b2fb47def38024b256cb093546ee7db9ccf5c', class: 'searchcraft-slider-range-container' }, h("div", { key: '4c4f71c218f65acbfa25ec220cdeb581ef0e6c0d', class: 'searchcraft-slider-active-range', style: {
|
|
187
313
|
left: `${startPercent}%`,
|
|
188
314
|
width: `${endPercent - startPercent}%`,
|
|
189
|
-
} }), h("input", { key: '
|
|
315
|
+
} }), h("input", { key: '8968b1925f83480561a460b5f7da64499ec220c0', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.max, min: this.min, onInput: this.handleStartValueChange.bind(this), step: this.granularity, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), h("input", { key: '1ec4b397eb5ca6834719b0c09811d2b11e70c6d0', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.max, min: this.min, onInput: this.handleEndValueChange.bind(this), step: this.granularity, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), h("div", { key: 'abc788f7398c68aefcd12468280ef07fcf2ae673', class: 'searchcraft-slider-label-container' }, h("span", { key: 'f09f772f95c21fc4dfcd58d6eed7ff6901d329b8', class: 'searchcraft-slider-label' }, startLabel), h("span", { key: '251cecce58bb785d9478e80edfe429a1e18ef274', class: 'searchcraft-slider-label' }, endLabel))));
|
|
190
316
|
}
|
|
191
317
|
};
|
|
192
318
|
SearchcraftSlider.style = SearchcraftSliderStyle0;
|
|
193
319
|
|
|
194
|
-
const searchcraftToggleButtonModuleCss = ":root{--sc-
|
|
320
|
+
const searchcraftToggleButtonModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color 0.2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.searchcraft-toggle-button-handle.active{transform:translateX(16px)}";
|
|
195
321
|
const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
|
|
196
322
|
|
|
197
323
|
const SearchcraftToggleButton = class {
|
|
@@ -222,9 +348,9 @@ const SearchcraftToggleButton = class {
|
|
|
222
348
|
(_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
223
349
|
}
|
|
224
350
|
render() {
|
|
225
|
-
return (h("div", { key: '
|
|
351
|
+
return (h("div", { key: '607bbc1adc109ec918effb25c6b91052227a2f7b', class: 'searchcraft-toggle-button-container' }, h("div", { key: 'b452e1690c617020866f6bf3e591f62cc3fce111' }, h("p", { key: '1bd8fa345516e412ea57bdbeac37dc8e26f2feaa', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (h("p", { key: 'fce324a14721bab5f6173838f677ecb290200c8f', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), h("button", { key: '7b293a3ef64da88f463e5e6e303dabcbc63589bd', class: classNames('searchcraft-toggle-button-background', {
|
|
226
352
|
active: this.isActive,
|
|
227
|
-
}), onClick: this.handleToggle, type: 'button' }, h("div", { key: '
|
|
353
|
+
}), onClick: this.handleToggle, type: 'button' }, h("div", { key: '6afd68afeea5bb15ce1bde486ac59f7a958f6752', class: classNames('searchcraft-toggle-button-handle', {
|
|
228
354
|
active: this.isActive,
|
|
229
355
|
}) }))));
|
|
230
356
|
}
|