@searchcraft/javascript-sdk 0.5.3 → 0.7.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/README.md +53 -55
- package/dist/cjs/{index-b76bece0.js → index-d4b4a45e.js} +234 -130
- package/dist/cjs/index-d4b4a45e.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 +15 -19
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +31 -17
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-button_3.cjs.entry.js +72 -0
- package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +163 -35
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +11 -10
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +238 -0
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +3 -3
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +1 -1
- 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 +206 -5
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +26 -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-abe47006.js +1479 -0
- package/dist/cjs/store-abe47006.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 +3 -2
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +65 -32
- 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 +86 -19
- 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 +32 -11
- 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 +13 -5
- 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 +27 -14
- 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 +19 -7
- 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 +106 -61
- 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 +19 -7
- 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 +299 -9
- 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 +143 -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 +50 -9
- 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 +38 -15
- 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 +18 -10
- 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 +7 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-01dc5b3b.js +1475 -0
- package/dist/components/p-01dc5b3b.js.map +1 -0
- package/dist/components/p-1ae87308.js +43 -0
- package/dist/components/p-1ae87308.js.map +1 -0
- package/dist/components/p-649654b5.js +268 -0
- package/dist/components/p-649654b5.js.map +1 -0
- package/dist/components/p-662cb490.js +67 -0
- package/dist/components/p-662cb490.js.map +1 -0
- package/dist/components/{p-e4846fa2.js → p-6cafd48d.js} +189 -112
- package/dist/components/p-6cafd48d.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-87d1611b.js +97 -0
- package/dist/components/p-87d1611b.js.map +1 -0
- package/dist/components/p-c273e43d.js +40 -0
- package/dist/components/p-c273e43d.js.map +1 -0
- package/dist/components/p-cc9f8c61.js +109 -0
- package/dist/components/p-cc9f8c61.js.map +1 -0
- package/dist/components/p-cf096782.js +56 -0
- package/dist/components/p-cf096782.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-da5b92ef.js +253 -0
- package/dist/components/p-da5b92ef.js.map +1 -0
- package/dist/components/p-e1cf5f9d.js +54 -0
- package/dist/components/p-e1cf5f9d.js.map +1 -0
- package/dist/components/p-f5a06210.js +34 -0
- package/dist/components/p-f5a06210.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +25 -11
- 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 +13 -12
- 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 +255 -8
- 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 +4 -4
- 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-56b713de.js} +234 -131
- package/dist/esm/index-56b713de.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 +15 -19
- package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -1
- package/dist/esm/searchcraft-base-search-results.entry.js +23 -9
- package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
- package/dist/esm/searchcraft-button_3.entry.js +66 -0
- package/dist/esm/searchcraft-button_3.entry.js.map +1 -0
- package/dist/esm/searchcraft-facet-list_3.entry.js +161 -33
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-filter-panel.entry.js +10 -9
- package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
- package/dist/esm/searchcraft-input-form_2.entry.js +233 -0
- package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -0
- package/dist/esm/searchcraft-javascript-sdk.js +4 -4
- package/dist/esm/searchcraft-javascript-sdk.js.map +1 -1
- 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 +206 -5
- package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-popover-list-item.entry.js +22 -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-712f0586.js +1475 -0
- package/dist/esm/store-712f0586.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-01dc5b3b.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-01dc5b3b.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-117fcdd3.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-117fcdd3.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-129e6f2c.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-129e6f2c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-27cb401c.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-27cb401c.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-4df4a29e.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-4df4a29e.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-54248dd8.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-54248dd8.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-69430dbf.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-69430dbf.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-a460755d.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-a460755d.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-bc2c4259.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-bc2c4259.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-caecdcda.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-caecdcda.entry.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-f8129731.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-f8129731.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-f839b682.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-f839b682.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 +8 -4
- 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 +0 -956
- 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 +0 -952
- 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 +0 -101
- package/dist/components/p-cbdcf6df.js.map +0 -1
- package/dist/components/p-e4846fa2.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 +0 -952
- 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-32068485.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-32068485.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-d7d0b88c.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-d7d0b88c.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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, F as Fragment } from './p-6cafd48d.js';
|
|
2
|
+
import { u as useSearchcraftStore } from './p-01dc5b3b.js';
|
|
3
|
+
|
|
4
|
+
const searchcraftBaseSearchResultModuleCss = ":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-result-container{all:unset;align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media (min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:var(--sc-image-border-radius);width:100%}@media (min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{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);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-base-search-result-subtitle{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-disabled)}.searchcraft-base-search-result-body-content{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-secondary)}.searchcraft-base-search-result-footer-content{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-disabled)}";
|
|
5
|
+
const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
|
|
6
|
+
|
|
7
|
+
const SearchcraftBaseSearchResult = /*@__PURE__*/ proxyCustomElement(class SearchcraftBaseSearchResult extends H {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
/**
|
|
12
|
+
* Where to open the link for the button rendered when containerHref is not present.
|
|
13
|
+
*/
|
|
14
|
+
this.buttonTarget = '_blank';
|
|
15
|
+
/**
|
|
16
|
+
* Where to open the link for the containing element.
|
|
17
|
+
*/
|
|
18
|
+
this.containerTarget = '_blank';
|
|
19
|
+
/**
|
|
20
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
21
|
+
*/
|
|
22
|
+
this.documentPosition = 0;
|
|
23
|
+
this.searchcraftStore = useSearchcraftStore.getState();
|
|
24
|
+
this.recordMeasureEvent = () => {
|
|
25
|
+
var _a, _b, _c;
|
|
26
|
+
const searchcraft = this.searchcraftStore.getSearchcraftInstance();
|
|
27
|
+
if (searchcraft) {
|
|
28
|
+
const document_position = this.documentPosition;
|
|
29
|
+
const search_term = this.searchcraftStore.query;
|
|
30
|
+
const number_of_documents = ((_c = (_b = (_a = this.searchcraftStore.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
|
|
31
|
+
searchcraft.sendMeasureEvent('document_clicked', {
|
|
32
|
+
document_position,
|
|
33
|
+
number_of_documents,
|
|
34
|
+
search_term,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.parseStyles = () => {
|
|
39
|
+
if (this.customStyles) {
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(this.customStyles);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error parsing custom styles:', error);
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const styles = this.parseStyles();
|
|
53
|
+
const imageContainer = this.imageSrc && (h("img", { alt: this.imageAlt, class: 'searchcraft-search-result-image', src: this.imageSrc, style: styles.image || {} }));
|
|
54
|
+
const contentContainer = (h(Fragment, null, this.imageSrc && this.imagePlacement === 'left' && imageContainer, h("div", { class: 'searchcraft-base-search-result-content-container' }, this.titleContent && (h("h2", { class: 'searchcraft-base-search-result-title', style: styles.title || {} }, this.titleContent)), this.subtitleContent && (h("h3", { class: 'searchcraft-base-search-result-subtitle', style: styles.subtitle || {} }, this.subtitleContent)), this.bodyContent && (h("p", { class: 'searchcraft-base-search-result-body-content', style: styles.primaryContent || {} }, this.bodyContent)), this.footerContent && (h("p", { class: 'searchcraft-base-search-result-footer-content', style: styles.secondaryContent || {} }, this.footerContent)), this.buttonHref && !this.containerHref && this.buttonLabel && (h("a", { class: 'searchcraft-search-result-button', href: this.buttonHref, style: styles.button || {}, target: this.buttonTarget, rel: this.buttonRel }, this.buttonLabel))), this.imageSrc && this.imagePlacement === 'right' && imageContainer));
|
|
55
|
+
/** Render as an anchor tag if the containerHref prop is present. */
|
|
56
|
+
if (this.containerHref) {
|
|
57
|
+
return (h("a", { class: 'searchcraft-search-result-container', onClick: this.recordMeasureEvent, href: this.containerHref, rel: this.containerRel, style: styles.container || {}, tabindex: '0', target: this.containerTarget }, contentContainer));
|
|
58
|
+
}
|
|
59
|
+
/** Render as a div if no href prop. */
|
|
60
|
+
return (h("div", { class: 'searchcraft-search-result-container', style: styles.container || {} }, contentContainer));
|
|
61
|
+
}
|
|
62
|
+
static get style() { return SearchcraftBaseSearchResultStyle0; }
|
|
63
|
+
}, [0, "searchcraft-base-search-result", {
|
|
64
|
+
"titleContent": [1, "title-content"],
|
|
65
|
+
"subtitleContent": [1, "subtitle-content"],
|
|
66
|
+
"bodyContent": [1, "body-content"],
|
|
67
|
+
"footerContent": [1, "footer-content"],
|
|
68
|
+
"buttonLabel": [1, "button-label"],
|
|
69
|
+
"buttonHref": [1, "button-href"],
|
|
70
|
+
"buttonTarget": [1, "button-target"],
|
|
71
|
+
"buttonRel": [1, "button-rel"],
|
|
72
|
+
"containerHref": [1, "container-href"],
|
|
73
|
+
"containerTarget": [1, "container-target"],
|
|
74
|
+
"containerRel": [1, "container-rel"],
|
|
75
|
+
"imageSrc": [1, "image-src"],
|
|
76
|
+
"imageAlt": [1, "image-alt"],
|
|
77
|
+
"imagePlacement": [1, "image-placement"],
|
|
78
|
+
"customStyles": [1, "custom-styles"],
|
|
79
|
+
"documentPosition": [2, "document-position"]
|
|
80
|
+
}]);
|
|
81
|
+
function defineCustomElement() {
|
|
82
|
+
if (typeof customElements === "undefined") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const components = ["searchcraft-base-search-result"];
|
|
86
|
+
components.forEach(tagName => { switch (tagName) {
|
|
87
|
+
case "searchcraft-base-search-result":
|
|
88
|
+
if (!customElements.get(tagName)) {
|
|
89
|
+
customElements.define(tagName, SearchcraftBaseSearchResult);
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
} });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { SearchcraftBaseSearchResult as S, defineCustomElement as d };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=p-87d1611b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-87d1611b.js","mappings":"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","names":[],"sources":["src/components/searchcraft-base-search-result/searchcraft-base-search-result.module.scss?tag=searchcraft-base-search-result","src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"sourcesContent":["\n.searchcraft-search-result-container {\n all: unset;\n align-items: flex-start;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 8px;\n color: inherit;\n\n background-color: var(--sc-surface-neutral-primary);\n\n @media (min-width: $breakpoint-md) {\n flex-direction: row;\n }\n}\n\na.searchcraft-search-result-container {\n cursor: pointer;\n transition: background-color 100ms;\n}\n\n.searchcraft-base-search-result-content-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.searchcraft-search-result-image {\n border-radius: var(--sc-image-border-radius);\n width: 100%;\n\n @media (min-width: $breakpoint-md) {\n width: 200px;\n }\n}\n\n.searchcraft-base-search-result-title {\n @include body-bold();\n margin: 0;\n color: var(--sc-content-neutral-primary);\n}\n\n.searchcraft-base-search-result-subtitle {\n @include body-small();\n margin: 0;\n color: var(--sc-content-disabled);\n}\n\n.searchcraft-base-search-result-body-content {\n @include body();\n margin: 0;\n color: var(--sc-content-neutral-secondary);\n}\n\n.searchcraft-base-search-result-footer-content {\n @include body();\n margin: 0;\n color: var(--sc-content-disabled);\n}\n","import { useSearchcraftStore } from '@provider/store';\nimport { Component, Fragment, h, Prop } from '@stencil/core';\n\n/**\n * This web component is designed to display detailed information for a single search result.\n * Once a query is submitted, the component formats and presents the result.\n * It is consumed within the `searchcraft-base-search-results` component.\n */\n@Component({\n tag: 'searchcraft-base-search-result',\n styleUrl: 'searchcraft-base-search-result.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResult {\n /**\n * The title content.\n */\n @Prop() titleContent: string | undefined;\n /**\n * The subtitle content.\n */\n @Prop() subtitleContent: string | undefined;\n /**\n * The body content.\n */\n @Prop() bodyContent: string | undefined;\n /**\n * The footer content.\n */\n @Prop() footerContent: string | undefined;\n /**\n * The label for the button rendered when containerHref is not present.\n */\n @Prop() buttonLabel: string | undefined;\n /**\n * The link for the button rendered when containerHref is not present.\n */\n @Prop() buttonHref: string | undefined;\n /**\n * Where to open the link for the button rendered when containerHref is not present.\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.\n */\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * The link for the containing element.\n */\n @Prop() containerHref: string | undefined;\n /**\n * Where to open the link for the containing element.\n */\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the containing element.\n */\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * The image source.\n */\n @Prop() imageSrc: string | undefined;\n /**\n * The image alternative text.\n */\n @Prop() imageAlt: string | undefined;\n /**\n * The placement of the image.\n */\n @Prop() imagePlacement: 'left' | 'right';\n /**\n * A custom styles object.\n */\n @Prop() customStyles: string | undefined;\n /**\n * The position in the document. Used with the \"document_clicked\" measure event.\n */\n @Prop() documentPosition = 0;\n\n private searchcraftStore = useSearchcraftStore.getState();\n\n private recordMeasureEvent = () => {\n const searchcraft = this.searchcraftStore.getSearchcraftInstance();\n\n if (searchcraft) {\n const document_position = this.documentPosition;\n const search_term = this.searchcraftStore.query;\n const number_of_documents =\n this.searchcraftStore.searchResults?.data?.hits?.length || 0;\n\n searchcraft.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n }\n };\n\n private parseStyles = (): Record<string, { [key: string]: string }> => {\n if (this.customStyles) {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n return {};\n };\n\n render() {\n const styles = this.parseStyles();\n const imageContainer = this.imageSrc && (\n <img\n alt={this.imageAlt}\n class='searchcraft-search-result-image'\n src={this.imageSrc}\n style={styles.image || {}}\n />\n );\n\n const contentContainer = (\n <Fragment>\n {this.imageSrc && this.imagePlacement === 'left' && imageContainer}\n <div class='searchcraft-base-search-result-content-container'>\n {this.titleContent && (\n <h2\n class='searchcraft-base-search-result-title'\n style={styles.title || {}}\n >\n {this.titleContent}\n </h2>\n )}\n {this.subtitleContent && (\n <h3\n class='searchcraft-base-search-result-subtitle'\n style={styles.subtitle || {}}\n >\n {this.subtitleContent}\n </h3>\n )}\n {this.bodyContent && (\n <p\n class='searchcraft-base-search-result-body-content'\n style={styles.primaryContent || {}}\n >\n {this.bodyContent}\n </p>\n )}\n\n {this.footerContent && (\n <p\n class='searchcraft-base-search-result-footer-content'\n style={styles.secondaryContent || {}}\n >\n {this.footerContent}\n </p>\n )}\n {this.buttonHref && !this.containerHref && this.buttonLabel && (\n <a\n class='searchcraft-search-result-button'\n href={this.buttonHref}\n style={styles.button || {}}\n target={this.buttonTarget}\n rel={this.buttonRel}\n >\n {this.buttonLabel}\n </a>\n )}\n </div>\n {this.imageSrc && this.imagePlacement === 'right' && imageContainer}\n </Fragment>\n );\n\n /** Render as an anchor tag if the containerHref prop is present. */\n if (this.containerHref) {\n return (\n <a\n class='searchcraft-search-result-container'\n onClick={this.recordMeasureEvent}\n href={this.containerHref}\n rel={this.containerRel}\n style={styles.container || {}}\n tabindex='0'\n target={this.containerTarget}\n >\n {contentContainer}\n </a>\n );\n }\n\n /** Render as a div if no href prop. */\n return (\n <div\n class='searchcraft-search-result-container'\n style={styles.container || {}}\n >\n {contentContainer}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-6cafd48d.js';
|
|
2
|
+
import { c as classNames } from './p-5cdc6210.js';
|
|
3
|
+
|
|
4
|
+
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}";
|
|
5
|
+
const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
|
|
6
|
+
|
|
7
|
+
const SearchcraftInputLabel = /*@__PURE__*/ proxyCustomElement(class SearchcraftInputLabel extends H {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
/**
|
|
12
|
+
* The classname applied to the label element.
|
|
13
|
+
*/
|
|
14
|
+
this.inputLabelClassName = '';
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return (h("label", { key: '4f913c1d9027ff781725a01e71e241cb5767eadb', class: classNames('searchcraft-input-label', this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
|
|
18
|
+
}
|
|
19
|
+
static get style() { return SearchcraftInputLabelStyle0; }
|
|
20
|
+
}, [0, "searchcraft-input-label", {
|
|
21
|
+
"inputLabelClassName": [1, "input-label-class-name"],
|
|
22
|
+
"label": [1]
|
|
23
|
+
}]);
|
|
24
|
+
function defineCustomElement() {
|
|
25
|
+
if (typeof customElements === "undefined") {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const components = ["searchcraft-input-label"];
|
|
29
|
+
components.forEach(tagName => { switch (tagName) {
|
|
30
|
+
case "searchcraft-input-label":
|
|
31
|
+
if (!customElements.get(tagName)) {
|
|
32
|
+
customElements.define(tagName, SearchcraftInputLabel);
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
} });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { SearchcraftInputLabel as S, defineCustomElement as d };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=p-c273e43d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-c273e43d.js","mappings":";;;AAAA,MAAM,8BAA8B,GAAG,0nHAA0nH,CAAC;AAClqH,oCAAe,8BAA8B;;MCgBhC,qBAAqB;IALlC;;;;;;QASU,wBAAmB,GAAI,EAAE,CAAC;KAanC;IAVC,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-input-label/searchcraft-input-label.module.scss?tag=searchcraft-input-label","src/components/searchcraft-input-label/searchcraft-input-label.tsx"],"sourcesContent":[".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}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-6cafd48d.js';
|
|
2
|
+
import { a as getMillis } from './p-755f491b.js';
|
|
3
|
+
import { c as classNames } from './p-5cdc6210.js';
|
|
4
|
+
|
|
5
|
+
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}";
|
|
6
|
+
const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
|
|
7
|
+
|
|
8
|
+
const SearchcraftSlider = /*@__PURE__*/ proxyCustomElement(class SearchcraftSlider extends H {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.rangeChanged = createEvent(this, "rangeChanged", 7);
|
|
13
|
+
/**
|
|
14
|
+
* The maximum value allowed.
|
|
15
|
+
*/
|
|
16
|
+
this.max = 100;
|
|
17
|
+
/**
|
|
18
|
+
* The minimum value allowed.
|
|
19
|
+
*/
|
|
20
|
+
this.min = 0;
|
|
21
|
+
/**
|
|
22
|
+
* The granularity that the value must adhere to.
|
|
23
|
+
*/
|
|
24
|
+
this.granularity = getMillis('month');
|
|
25
|
+
/** The type of data allowed. */
|
|
26
|
+
this.dataType = 'number';
|
|
27
|
+
this.endValue = this.max;
|
|
28
|
+
this.startValue = this.min;
|
|
29
|
+
this.lastFocusedHandle = 'max';
|
|
30
|
+
this.emitUpdate = async () => {
|
|
31
|
+
this.rangeChanged.emit({
|
|
32
|
+
startValue: this.startValue,
|
|
33
|
+
endValue: this.endValue,
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
this.handleStartValueChange = (event) => {
|
|
37
|
+
const inputElement = event.target;
|
|
38
|
+
const value = Number.parseInt(inputElement.value, 10);
|
|
39
|
+
this.lastFocusedHandle = 'min';
|
|
40
|
+
if (value <= this.endValue) {
|
|
41
|
+
this.startValue = value;
|
|
42
|
+
this.emitUpdate();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.startValue = this.endValue;
|
|
46
|
+
inputElement.value = `${this.endValue}`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
this.handleEndValueChange = (event) => {
|
|
50
|
+
const inputElement = event.target;
|
|
51
|
+
const value = Number.parseInt(inputElement.value, 10);
|
|
52
|
+
this.lastFocusedHandle = 'max';
|
|
53
|
+
if (value >= this.startValue) {
|
|
54
|
+
this.endValue = value;
|
|
55
|
+
this.emitUpdate();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this.endValue = this.startValue;
|
|
59
|
+
inputElement.value = `${this.startValue}`;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
componentDidLoad() {
|
|
64
|
+
this.startValue = this.min;
|
|
65
|
+
this.endValue = this.max;
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const rangeMin = this.min;
|
|
69
|
+
const rangeMax = this.max;
|
|
70
|
+
const startPercent = ((this.startValue - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
71
|
+
const endPercent = ((this.endValue - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
72
|
+
const startLabel = this.dataType === 'number'
|
|
73
|
+
? this.startValue
|
|
74
|
+
: new Date(this.startValue).getFullYear();
|
|
75
|
+
const endLabel = this.dataType === 'number'
|
|
76
|
+
? this.endValue
|
|
77
|
+
: new Date(this.endValue).getFullYear();
|
|
78
|
+
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: {
|
|
79
|
+
left: `${startPercent}%`,
|
|
80
|
+
width: `${endPercent - startPercent}%`,
|
|
81
|
+
} }), 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))));
|
|
82
|
+
}
|
|
83
|
+
static get style() { return SearchcraftSliderStyle0; }
|
|
84
|
+
}, [0, "searchcraft-slider", {
|
|
85
|
+
"max": [2],
|
|
86
|
+
"min": [2],
|
|
87
|
+
"granularity": [2],
|
|
88
|
+
"dataType": [1, "data-type"],
|
|
89
|
+
"endValue": [32],
|
|
90
|
+
"startValue": [32],
|
|
91
|
+
"lastFocusedHandle": [32]
|
|
92
|
+
}]);
|
|
93
|
+
function defineCustomElement() {
|
|
94
|
+
if (typeof customElements === "undefined") {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const components = ["searchcraft-slider"];
|
|
98
|
+
components.forEach(tagName => { switch (tagName) {
|
|
99
|
+
case "searchcraft-slider":
|
|
100
|
+
if (!customElements.get(tagName)) {
|
|
101
|
+
customElements.define(tagName, SearchcraftSlider);
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
} });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { SearchcraftSlider as S, defineCustomElement as d };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=p-cc9f8c61.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-cc9f8c61.js","mappings":"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","names":[],"sources":["src/components/searchcraft-slider/searchcraft-slider.module.scss?tag=searchcraft-slider","src/components/searchcraft-slider/searchcraft-slider.tsx"],"sourcesContent":[".searchcraft-slider-container {\n align-items: center;\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 100%;\n}\n\n.searchcraft-slider-range-container {\n align-items: center;\n background-color: var(--sc-surface-disabled);\n border-radius: 999px;\n display: flex;\n position: relative;\n height: 4px;\n width: 100%;\n\n &::-webkit-slider-runnable-track {\n pointer-events: none;\n }\n\n .searchcraft-slider-active-range {\n background-color: var(--sc-surface-brand-primary);\n border-radius: 2px;\n height: 4px;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 0;\n\n &::-webkit-slider-runnable-track {\n pointer-events: none;\n }\n\n &::-moz-range-track {\n pointer-events: none;\n }\n }\n\n .searchcraft-slider-input {\n appearance: none;\n background: transparent;\n border-radius: 2px;\n height: 4px;\n margin: 0;\n outline: none;\n pointer-events: none;\n position: absolute;\n width: 100%;\n -webkit-appearance: none;\n\n &::-webkit-slider-thumb {\n background-color: var(--sc-surface-neutral-light);\n border-radius: 50%;\n border: 2px solid var(--sc-border-neutral);\n cursor: pointer;\n height: 20px;\n pointer-events: all;\n width: 20px;\n -webkit-appearance: none;\n }\n\n &::-moz-range-thumb {\n background-color: var(--sc-surface-neutral-light);\n border-radius: 50%;\n border: 2px solid var(--sc-border-neutral);\n cursor: pointer;\n height: 20px;\n pointer-events: all;\n width: 20px;\n }\n }\n}\n\n.searchcraft-slider-label-container {\n color: var(--sc-content-primary);\n display: flex;\n font-family: 'Source Sans Pro', sans-serif;\n font-size: 15px;\n font-weight: 600;\n justify-content: space-between;\n margin-top: 10px;\n width: 100%;\n}\n\n.searchcraft-slider-label {\n min-width: 30px;\n text-align: center;\n}","import {\n Component,\n Event,\n type EventEmitter,\n h,\n State,\n Prop,\n} from '@stencil/core';\nimport { getMillis } from '@utils';\nimport classNames from 'classnames';\n\n/**\n * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.\n * The component renders a slider interface, which can be used to visually choose a value between two boundaries.\n * It is consumed by the `searchcraft-filter-panel` component.\n */\n@Component({\n tag: 'searchcraft-slider',\n styleUrl: 'searchcraft-slider.module.scss',\n shadow: false,\n})\nexport class SearchcraftSlider {\n /**\n * The maximum value allowed.\n */\n @Prop() max = 100;\n /**\n * The minimum value allowed.\n */\n @Prop() min = 0;\n /**\n * The granularity that the value must adhere to.\n */\n @Prop() granularity: number = getMillis('month');\n /** The type of data allowed. */\n @Prop() dataType: 'number' | 'date' = 'number';\n\n @State() endValue = this.max;\n @State() startValue = this.min;\n @State() lastFocusedHandle: 'min' | 'max' = 'max';\n\n /**\n * When the range has changed.\n * */\n @Event() rangeChanged: EventEmitter<{ startValue: number; endValue: number }>;\n\n componentDidLoad() {\n this.startValue = this.min;\n this.endValue = this.max;\n }\n\n private emitUpdate = async () => {\n this.rangeChanged.emit({\n startValue: this.startValue,\n endValue: this.endValue,\n });\n };\n\n private handleStartValueChange = (event: InputEvent) => {\n const inputElement = event.target as HTMLInputElement;\n const value = Number.parseInt(inputElement.value, 10);\n this.lastFocusedHandle = 'min';\n if (value <= this.endValue) {\n this.startValue = value;\n this.emitUpdate();\n } else {\n this.startValue = this.endValue;\n inputElement.value = `${this.endValue}`;\n }\n };\n\n private handleEndValueChange = (event: InputEvent) => {\n const inputElement = event.target as HTMLInputElement;\n const value = Number.parseInt(inputElement.value, 10);\n this.lastFocusedHandle = 'max';\n if (value >= this.startValue) {\n this.endValue = value;\n this.emitUpdate();\n } else {\n this.endValue = this.startValue;\n inputElement.value = `${this.startValue}`;\n }\n };\n\n render() {\n const rangeMin = this.min;\n const rangeMax = this.max;\n const startPercent =\n ((this.startValue - rangeMin) / (rangeMax - rangeMin)) * 100;\n const endPercent =\n ((this.endValue - rangeMin) / (rangeMax - rangeMin)) * 100;\n\n const startLabel =\n this.dataType === 'number'\n ? this.startValue\n : new Date(this.startValue).getFullYear();\n\n const endLabel =\n this.dataType === 'number'\n ? this.endValue\n : new Date(this.endValue).getFullYear();\n\n return (\n <div class='searchcraft-slider-container'>\n <div class='searchcraft-slider-range-container'>\n <div\n class='searchcraft-slider-active-range'\n style={{\n left: `${startPercent}%`,\n width: `${endPercent - startPercent}%`,\n }}\n />\n <input\n class={classNames(\n 'searchcraft-slider-input',\n 'searchcraft-slider-input-min-handle',\n )}\n max={this.max}\n min={this.min}\n onInput={this.handleStartValueChange.bind(this)}\n step={this.granularity}\n style={{ zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }}\n type='range'\n value={this.startValue}\n />\n <input\n class={classNames(\n 'searchcraft-slider-input',\n 'searchcraft-slider-input-max-handle',\n )}\n max={this.max}\n min={this.min}\n onInput={this.handleEndValueChange.bind(this)}\n step={this.granularity}\n style={{ zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }}\n type='range'\n value={this.endValue}\n />\n </div>\n <div class='searchcraft-slider-label-container'>\n <span class='searchcraft-slider-label'>{startLabel}</span>\n <span class='searchcraft-slider-label'>{endLabel}</span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment } from './p-6cafd48d.js';
|
|
2
|
+
import { c as classNames } from './p-5cdc6210.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 = /*@__PURE__*/ proxyCustomElement(class SearchcraftButton extends H {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.buttonClick = createEvent(this, "buttonClick", 7);
|
|
12
|
+
/**
|
|
13
|
+
* Should the button only display an icon.
|
|
14
|
+
*/
|
|
15
|
+
this.iconOnly = false;
|
|
16
|
+
/**
|
|
17
|
+
* The position of the icon.
|
|
18
|
+
*/
|
|
19
|
+
this.iconPosition = 'left';
|
|
20
|
+
/**
|
|
21
|
+
* The label for the button.
|
|
22
|
+
*/
|
|
23
|
+
this.label = 'Search';
|
|
24
|
+
this.isRequesting = false;
|
|
25
|
+
this.handleClick = () => {
|
|
26
|
+
this.buttonClick.emit();
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
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)))));
|
|
31
|
+
}
|
|
32
|
+
static get style() { return SearchcraftButtonStyle0; }
|
|
33
|
+
}, [0, "searchcraft-button", {
|
|
34
|
+
"iconElement": [16],
|
|
35
|
+
"iconOnly": [4, "icon-only"],
|
|
36
|
+
"iconPosition": [1, "icon-position"],
|
|
37
|
+
"label": [1],
|
|
38
|
+
"isRequesting": [32]
|
|
39
|
+
}]);
|
|
40
|
+
function defineCustomElement() {
|
|
41
|
+
if (typeof customElements === "undefined") {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const components = ["searchcraft-button"];
|
|
45
|
+
components.forEach(tagName => { switch (tagName) {
|
|
46
|
+
case "searchcraft-button":
|
|
47
|
+
if (!customElements.get(tagName)) {
|
|
48
|
+
customElements.define(tagName, SearchcraftButton);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
} });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { SearchcraftButton as S, defineCustomElement as d };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=p-cf096782.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-cf096782.js","mappings":";;;AAAA,MAAM,0BAA0B,GAAG,46HAA46H,CAAC;AACh9H,gCAAe,0BAA0B;;MCoB5B,iBAAiB;IAL9B;;;;;;;QAaU,aAAQ,GAAG,KAAK,CAAC;;;;QAIjB,iBAAY,GAAG,MAAM,CAAC;;;;QAItB,UAAK,GAAG,QAAQ,CAAC;QAOhB,iBAAY,GAAG,KAAK,CAAC;QAEtB,gBAAW,GAAG;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB,CAAC;KAgCH;IA9BC,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;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-button/searchcraft-button.module.scss?tag=searchcraft-button","src/components/searchcraft-button/searchcraft-button.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"],"version":3}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function parseCustomStyles(styles) {
|
|
2
|
+
if (typeof styles === 'string') {
|
|
3
|
+
try {
|
|
4
|
+
return JSON.parse(styles);
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
console.error('Invalid customStyles format:', styles);
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return styles || {};
|
|
12
|
+
}
|
|
13
|
+
function serializeStyles(styles) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.stringify(styles);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
console.error('Error serializing styles:', error);
|
|
19
|
+
return '{}';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { parseCustomStyles as p, serializeStyles as s };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=p-d9551738.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-d9551738.js","mappings":"SAAgB,iBAAiB,CAC/B,MAAuC;IAEvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;YACtD,OAAO,EAAE,CAAC;SACX;KACF;IACD,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC;SAEe,eAAe,CAC7B,MAA8C;IAE9C,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KAC/B;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;KACb;AACH;;;;","names":[],"sources":["src/utils/styles.ts"],"sourcesContent":["export function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n\nexport function serializeStyles(\n styles: Record<string, Record<string, string>>,\n): string {\n try {\n return JSON.stringify(styles);\n } catch (error) {\n console.error('Error serializing styles:', error);\n return '{}';\n }\n}\n"],"version":3}
|