@searchcraft/javascript-sdk 0.7.0 → 0.7.2
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 +7 -1
- package/dist/cjs/{index-d4b4a45e.js → index-a81df4f0.js} +29 -113
- package/dist/{components/p-6cafd48d.js.map → cjs/index-a81df4f0.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +91 -44
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +74 -50
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-button_3.cjs.entry.js +37 -36
- package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +141 -119
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +11 -14
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +127 -92
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js +3 -7
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js +81 -75
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +29 -6
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-results-info.cjs.entry.js +9 -13
- package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-theme.cjs.entry.js +38 -0
- package/dist/cjs/searchcraft-theme.cjs.entry.js.map +1 -0
- package/dist/cjs/{store-abe47006.js → store-f6ba3dfb.js} +26 -10
- package/dist/cjs/{store-abe47006.js.map → store-f6ba3dfb.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +102 -62
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +77 -61
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +26 -30
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +6 -12
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +59 -51
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +9 -20
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +109 -87
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +10 -20
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +1 -11
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +81 -82
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +35 -17
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +17 -19
- 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 +7 -19
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +57 -65
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-theme/searchcraft-theme.js +37 -0
- package/dist/collection/components/searchcraft-theme/searchcraft-theme.js.map +1 -0
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +23 -26
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/store.js +25 -9
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/utils/facets.js +5 -3
- package/dist/collection/utils/facets.js.map +1 -1
- package/dist/components/index.js +4 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-0ef4ab33.js +66 -0
- package/dist/components/p-0ef4ab33.js.map +1 -0
- package/dist/components/p-1234974c.js +72 -0
- package/dist/components/p-1234974c.js.map +1 -0
- package/dist/components/p-4b92ae26.js +109 -0
- package/dist/components/p-4b92ae26.js.map +1 -0
- package/dist/components/{p-e1cf5f9d.js → p-506cdac1.js} +18 -14
- package/dist/components/p-506cdac1.js.map +1 -0
- package/dist/components/p-521fe971.js +60 -0
- package/dist/components/p-521fe971.js.map +1 -0
- package/dist/components/{p-6cafd48d.js → p-5365011f.js} +30 -123
- package/dist/components/p-5365011f.js.map +1 -0
- package/dist/components/p-54998882.js +285 -0
- package/dist/components/p-54998882.js.map +1 -0
- package/dist/{esm/store-712f0586.js → components/p-936e2ed4.js} +26 -10
- package/dist/components/{p-01dc5b3b.js.map → p-936e2ed4.js.map} +1 -1
- package/dist/components/p-960ddc89.js +284 -0
- package/dist/components/p-960ddc89.js.map +1 -0
- package/dist/components/p-a75ef832.js +34 -0
- package/dist/components/p-a75ef832.js.map +1 -0
- package/dist/components/p-b4a8fcbe.js +144 -0
- package/dist/components/p-b4a8fcbe.js.map +1 -0
- package/dist/components/p-ca881e5c.js +37 -0
- package/dist/components/p-ca881e5c.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +76 -52
- 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 +14 -17
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +1 -1
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-popover-button.js +3 -7
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-form.js +87 -81
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +9 -13
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-theme.d.ts +11 -0
- package/dist/components/searchcraft-theme.js +51 -0
- package/dist/components/searchcraft-theme.js.map +1 -0
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/esm/{index-56b713de.js → index-3608c57d.js} +29 -113
- package/dist/esm/index-3608c57d.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/searchcraft-base-search-result.entry.js +91 -44
- package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -1
- package/dist/esm/searchcraft-base-search-results.entry.js +74 -50
- package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
- package/dist/esm/searchcraft-button_3.entry.js +37 -36
- package/dist/esm/searchcraft-button_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-facet-list_3.entry.js +141 -119
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-filter-panel.entry.js +11 -14
- package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
- package/dist/esm/searchcraft-input-form_2.entry.js +127 -92
- package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -1
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/searchcraft-popover-button.entry.js +3 -7
- package/dist/esm/searchcraft-popover-button.entry.js.map +1 -1
- package/dist/esm/searchcraft-popover-form.entry.js +81 -75
- package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-popover-list-item.entry.js +29 -6
- package/dist/esm/searchcraft-popover-list-item.entry.js.map +1 -1
- package/dist/esm/searchcraft-results-info.entry.js +9 -13
- package/dist/esm/searchcraft-results-info.entry.js.map +1 -1
- package/dist/esm/searchcraft-theme.entry.js +34 -0
- package/dist/esm/searchcraft-theme.entry.js.map +1 -0
- package/dist/{components/p-01dc5b3b.js → esm/store-aa071d9c.js} +26 -10
- package/dist/esm/{store-712f0586.js.map → store-aa071d9c.js.map} +1 -1
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-109ab0e0.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-109ab0e0.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-7e13c128.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-7e13c128.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-01dc5b3b.js → p-936e2ed4.js} +2 -2
- package/dist/searchcraft-javascript-sdk/{p-01dc5b3b.js.map → p-936e2ed4.js.map} +1 -1
- package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-faaa4394.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-faaa4394.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 +1 -0
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +2 -1
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +1 -0
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +1 -0
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +2 -1
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +1 -0
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +7 -10
- package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +2 -1
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +2 -1
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +2 -0
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -0
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +1 -0
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +2 -1
- package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +15 -0
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
- package/dist/types/components.d.ts +53 -4
- package/dist/types/index.d.ts +2 -1
- package/dist/types/provider/store.d.ts +1 -0
- package/dist/types/types/_shared.types.d.ts +1 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/raw.d.ts +4 -0
- package/dist/types/types/searchcraft-base-search-results.types.d.ts +1 -0
- package/dist/types/types/searchcraft-filter-panel.types.d.ts +1 -0
- package/dist/types/types/searchcraft-popover-form.types.d.ts +1 -0
- package/dist/types/utils/facets.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/styles.d.ts +1 -0
- package/dist/types/utils/units.d.ts +1 -0
- package/package.json +5 -4
- package/dist/cjs/index-d4b4a45e.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -227
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -179
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -174
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -158
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +0 -266
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +0 -168
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.module.css +0 -293
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -159
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.module.css +0 -0
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.module.css +0 -322
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.css +0 -209
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.module.css +0 -0
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +0 -169
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +0 -231
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +0 -207
- package/dist/components/p-1ae87308.js +0 -43
- package/dist/components/p-1ae87308.js.map +0 -1
- package/dist/components/p-649654b5.js +0 -268
- package/dist/components/p-649654b5.js.map +0 -1
- package/dist/components/p-662cb490.js +0 -67
- package/dist/components/p-662cb490.js.map +0 -1
- package/dist/components/p-87d1611b.js +0 -97
- package/dist/components/p-87d1611b.js.map +0 -1
- package/dist/components/p-c273e43d.js +0 -40
- package/dist/components/p-c273e43d.js.map +0 -1
- package/dist/components/p-cc9f8c61.js +0 -109
- package/dist/components/p-cc9f8c61.js.map +0 -1
- package/dist/components/p-cf096782.js +0 -56
- package/dist/components/p-cf096782.js.map +0 -1
- package/dist/components/p-da5b92ef.js +0 -253
- package/dist/components/p-da5b92ef.js.map +0 -1
- package/dist/components/p-e1cf5f9d.js.map +0 -1
- package/dist/components/p-f5a06210.js +0 -34
- package/dist/components/p-f5a06210.js.map +0 -1
- package/dist/esm/index-56b713de.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-117fcdd3.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-117fcdd3.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-129e6f2c.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-129e6f2c.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-27cb401c.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-27cb401c.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-4df4a29e.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-4df4a29e.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-54248dd8.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-54248dd8.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-69430dbf.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-69430dbf.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a460755d.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a460755d.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-bc2c4259.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-bc2c4259.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-caecdcda.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-caecdcda.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-f8129731.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-f8129731.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-f839b682.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-f839b682.entry.js.map +0 -1
|
@@ -2,68 +2,69 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a81df4f0.js');
|
|
6
6
|
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
7
|
|
|
8
|
-
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}";
|
|
9
|
-
const SearchcraftButtonStyle0 = searchcraftButtonModuleCss;
|
|
10
|
-
|
|
11
8
|
const SearchcraftButton = class {
|
|
12
9
|
constructor(hostRef) {
|
|
13
10
|
index.registerInstance(this, hostRef);
|
|
14
11
|
this.buttonClick = index.createEvent(this, "buttonClick", 7);
|
|
15
|
-
/**
|
|
16
|
-
* Should the button only display an icon.
|
|
17
|
-
*/
|
|
18
|
-
this.iconOnly = false;
|
|
19
|
-
/**
|
|
20
|
-
* The position of the icon.
|
|
21
|
-
*/
|
|
22
|
-
this.iconPosition = 'left';
|
|
23
|
-
/**
|
|
24
|
-
* The label for the button.
|
|
25
|
-
*/
|
|
26
|
-
this.label = 'Search';
|
|
27
|
-
this.isRequesting = false;
|
|
28
|
-
this.handleClick = () => {
|
|
29
|
-
this.buttonClick.emit();
|
|
30
|
-
};
|
|
31
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* The icon element.
|
|
15
|
+
*/
|
|
16
|
+
iconElement;
|
|
17
|
+
/**
|
|
18
|
+
* Should the button only display an icon.
|
|
19
|
+
*/
|
|
20
|
+
iconOnly = false;
|
|
21
|
+
/**
|
|
22
|
+
* The position of the icon.
|
|
23
|
+
*/
|
|
24
|
+
iconPosition = 'left';
|
|
25
|
+
/**
|
|
26
|
+
* The label for the button.
|
|
27
|
+
*/
|
|
28
|
+
label = 'Search';
|
|
29
|
+
/**
|
|
30
|
+
* When the button is clicked.
|
|
31
|
+
*/
|
|
32
|
+
buttonClick;
|
|
33
|
+
isRequesting = false;
|
|
34
|
+
handleClick = () => {
|
|
35
|
+
this.buttonClick.emit();
|
|
36
|
+
};
|
|
32
37
|
render() {
|
|
33
|
-
return (index.h(index.Fragment, { key: '
|
|
38
|
+
return (index.h(index.Fragment, { key: 'af99927e7c05f06ec9a63123c7f740a0e96e734b' }, this.iconOnly ? (index.h("button", { class: index$1.classNames('searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (index.h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (index.h("button", { class: index$1.classNames('searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.iconElement, index.h("span", { class: index$1.classNames('buttonLabel', 'searchcraft-button-label') }, this.label)))));
|
|
34
39
|
}
|
|
35
40
|
};
|
|
36
|
-
SearchcraftButton.style = SearchcraftButtonStyle0;
|
|
37
|
-
|
|
38
|
-
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}";
|
|
39
|
-
const SearchcraftErrorMessageStyle0 = searchcraftErrorMessageModuleCss;
|
|
40
41
|
|
|
41
42
|
const SearchcraftErrorMessage = class {
|
|
42
43
|
constructor(hostRef) {
|
|
43
44
|
index.registerInstance(this, hostRef);
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* The error message.
|
|
48
|
+
*/
|
|
49
|
+
errorMessage;
|
|
45
50
|
render() {
|
|
46
|
-
return (index.h("p", { key: '
|
|
51
|
+
return (index.h("p", { key: '432bc13abc15f4d9c62ebc751e44e266b258b1f9', class: 'searchcraft-error-message' }, this.errorMessage || 'Search term is required.'));
|
|
47
52
|
}
|
|
48
53
|
};
|
|
49
|
-
SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
|
|
50
|
-
|
|
51
|
-
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}";
|
|
52
|
-
const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
|
|
53
54
|
|
|
54
55
|
const SearchcraftInputLabel = class {
|
|
55
56
|
constructor(hostRef) {
|
|
56
57
|
index.registerInstance(this, hostRef);
|
|
57
|
-
/**
|
|
58
|
-
* The classname applied to the label element.
|
|
59
|
-
*/
|
|
60
|
-
this.inputLabelClassName = '';
|
|
61
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The classname applied to the label element.
|
|
61
|
+
*/
|
|
62
|
+
inputLabelClassName = '';
|
|
63
|
+
label = '';
|
|
62
64
|
render() {
|
|
63
|
-
return (index.h("label", { key: '
|
|
65
|
+
return (index.h("label", { key: '9c71dc7429d7289ed59e7effacb91e040a9ac6a1', class: index$1.classNames('searchcraft-input-label', this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
|
|
64
66
|
}
|
|
65
67
|
};
|
|
66
|
-
SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
|
|
67
68
|
|
|
68
69
|
exports.searchcraft_button = SearchcraftButton;
|
|
69
70
|
exports.searchcraft_error_message = SearchcraftErrorMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-button.searchcraft-error-message.searchcraft-input-label.entry.cjs.js","mappings":";;;;;;;
|
|
1
|
+
{"file":"searchcraft-button.searchcraft-error-message.searchcraft-input-label.entry.cjs.js","mappings":";;;;;;;MAoBa,iBAAiB;;;;;;;;IAIpB,WAAW,CAAW;;;;IAItB,QAAQ,GAAG,KAAK,CAAC;;;;IAIjB,YAAY,GAAG,MAAM,CAAC;;;;IAItB,KAAK,GAAG,QAAQ,CAAC;;;;IAKhB,WAAW,CAAsB;IAEjC,YAAY,GAAG,KAAK,CAAC;IAEtB,WAAW,GAAG;QACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KACzB,CAAC;IAEF,MAAM;QACJ,QACEA,QAACC,cAAQ,uDACN,IAAI,CAAC,QAAQ,IACZD,oBACE,KAAK,EAAEE,kBAAU,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChBF,yCAA4B,KAE5B,IAAI,CAAC,WAAW,CACjB,CACM,KAETA,oBACE,KAAK,EAAEE,kBAAU,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EACjDF,kBAAM,KAAK,EAAEE,kBAAU,CAAC,aAAa,EAAE,0BAA0B,CAAC,IAC/D,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,EACX;KACH;;;MC/DU,uBAAuB;;;;;;;IAI1B,YAAY,CAAU;IAE9B,MAAM;QACJ,QACEF,gEAAG,KAAK,EAAC,2BAA2B,IACjC,IAAI,CAAC,YAAY,IAAI,0BAA0B,CAC9C,EACJ;KACH;;;MCXU,qBAAqB;;;;;;;IAIxB,mBAAmB,GAAI,EAAE,CAAC;IAC1B,KAAK,GAAG,EAAE,CAAC;IAEnB,MAAM;QACJ,QACEA,oEACE,KAAK,EAAEE,kBAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,mBAAmB,CAAC,EACtE,OAAO,EAAC,sBAAsB,IAE7B,IAAI,CAAC,KAAK,CACL,EACR;KACH;;;;;;;","names":["h","Fragment","classNames"],"sources":["src/components/searchcraft-button/searchcraft-button.tsx","src/components/searchcraft-error-message/searchcraft-error-message.tsx","src/components/searchcraft-input-label/searchcraft-input-label.tsx"],"sourcesContent":["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 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","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 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","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 shadow: false,\n})\nexport class SearchcraftInputLabel {\n /**\n * The classname applied to the label element.\n */\n @Prop() inputLabelClassName? = '';\n @Prop() label = '';\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}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a81df4f0.js');
|
|
6
6
|
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
-
const store = require('./store-
|
|
7
|
+
const store = require('./store-f6ba3dfb.js');
|
|
8
8
|
const units = require('./units-fe4d8083.js');
|
|
9
9
|
|
|
10
10
|
function deepMergeWithSpread(obj1, obj2) {
|
|
11
|
-
const result =
|
|
11
|
+
const result = { ...obj1 };
|
|
12
12
|
for (const key in obj2) {
|
|
13
13
|
// biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>
|
|
14
14
|
if (obj2.hasOwnProperty(key)) {
|
|
@@ -31,12 +31,11 @@ function removeSubstringMatches(arr) {
|
|
|
31
31
|
function facetToRecord(facet) {
|
|
32
32
|
const records = {};
|
|
33
33
|
const traverseAndAddToFragments = (facetChild) => {
|
|
34
|
-
var _a;
|
|
35
34
|
records[facetChild.path] = {
|
|
36
35
|
count: facetChild.count,
|
|
37
36
|
path: facetChild.path,
|
|
38
37
|
};
|
|
39
|
-
|
|
38
|
+
facetChild.children?.forEach((child) => {
|
|
40
39
|
traverseAndAddToFragments(child);
|
|
41
40
|
});
|
|
42
41
|
};
|
|
@@ -51,6 +50,9 @@ function recordToObject(record) {
|
|
|
51
50
|
};
|
|
52
51
|
Object.keys(record).forEach((key) => {
|
|
53
52
|
const fragment = record[key];
|
|
53
|
+
if (!fragment) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
54
56
|
if (fragment.path === '/') {
|
|
55
57
|
return;
|
|
56
58
|
}
|
|
@@ -133,32 +135,35 @@ function mergeFacetRoots(fieldName, currentRoot, incomingRoot) {
|
|
|
133
135
|
};
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
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}";
|
|
137
|
-
const SearchcraftFacetListStyle0 = searchcraftFacetListModuleCss;
|
|
138
|
-
|
|
139
138
|
const SearchcraftFacetList = class {
|
|
140
139
|
constructor(hostRef) {
|
|
141
140
|
index.registerInstance(this, hostRef);
|
|
142
141
|
this.facetSelectionUpdated = index.createEvent(this, "facetSelectionUpdated", 7);
|
|
143
|
-
this.selectedPaths = {};
|
|
144
|
-
this.hasNewSearchTerm = false;
|
|
145
|
-
this.searchStore = store.useSearchcraftStore.getState();
|
|
146
|
-
this.formatLabel = (facetChild) => {
|
|
147
|
-
const label = facetChild.path.replace(/^\//, '');
|
|
148
|
-
const count = facetChild.count;
|
|
149
|
-
return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
150
|
-
};
|
|
151
|
-
this.formatSubLabel = (facetChild, facetChildAncestor) => {
|
|
152
|
-
const facetChildPath = facetChild.path.substring(facetChildAncestor.path.length);
|
|
153
|
-
const label = facetChildPath.replace(/^\//, '');
|
|
154
|
-
const count = facetChild.count;
|
|
155
|
-
return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
156
|
-
};
|
|
157
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The name of the field where facets are applied.
|
|
145
|
+
*/
|
|
146
|
+
fieldName = '';
|
|
147
|
+
/**
|
|
148
|
+
* When the facets are updated.
|
|
149
|
+
*/
|
|
150
|
+
facetSelectionUpdated;
|
|
151
|
+
baseFacetRoot;
|
|
152
|
+
facetRoot;
|
|
153
|
+
selectedPaths = {};
|
|
154
|
+
lastTimeTaken;
|
|
155
|
+
hasNewSearchTerm = false;
|
|
156
|
+
lastQuery;
|
|
157
|
+
lastSearchMode;
|
|
158
|
+
lastSortType;
|
|
159
|
+
unsubscribe;
|
|
160
|
+
searchStore = store.useSearchcraftStore.getState();
|
|
158
161
|
handleStateUpdate(state) {
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
+
const facetPrime = state.searchResults?.data.facets;
|
|
163
|
+
const timeTaken = state.searchResults?.data.time_taken;
|
|
164
|
+
if (!this.fieldName) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
162
167
|
/** Things to do when the state's search term has changed, but before the response received */
|
|
163
168
|
if (state.query !== this.lastQuery ||
|
|
164
169
|
state.searchMode !== this.lastSearchMode ||
|
|
@@ -176,7 +181,7 @@ const SearchcraftFacetList = class {
|
|
|
176
181
|
this.facetRoot = incomingFacetRoot;
|
|
177
182
|
this.hasNewSearchTerm = false;
|
|
178
183
|
}
|
|
179
|
-
else if (this.baseFacetRoot) {
|
|
184
|
+
else if (this.baseFacetRoot && incomingFacetRoot) {
|
|
180
185
|
/** Data is from an existing search term, merge the facets together */
|
|
181
186
|
this.facetRoot = mergeFacetRoots(this.fieldName, this.baseFacetRoot, incomingFacetRoot);
|
|
182
187
|
}
|
|
@@ -193,8 +198,7 @@ const SearchcraftFacetList = class {
|
|
|
193
198
|
});
|
|
194
199
|
}
|
|
195
200
|
disconnectedCallback() {
|
|
196
|
-
|
|
197
|
-
(_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
201
|
+
this.unsubscribe?.();
|
|
198
202
|
}
|
|
199
203
|
handleCheckboxChange(path) {
|
|
200
204
|
const isCheckboxChecked = !this.selectedPaths[path];
|
|
@@ -203,7 +207,10 @@ const SearchcraftFacetList = class {
|
|
|
203
207
|
* Checkbox Checked: Add to the selectedPaths record
|
|
204
208
|
* Uses spread operator here so UI updates.
|
|
205
209
|
*/
|
|
206
|
-
this.selectedPaths =
|
|
210
|
+
this.selectedPaths = {
|
|
211
|
+
...this.selectedPaths,
|
|
212
|
+
[path]: true,
|
|
213
|
+
};
|
|
207
214
|
}
|
|
208
215
|
else {
|
|
209
216
|
/**
|
|
@@ -220,90 +227,101 @@ const SearchcraftFacetList = class {
|
|
|
220
227
|
*/
|
|
221
228
|
const paths = Object.keys(this.selectedPaths).filter((path) => this.selectedPaths[path]);
|
|
222
229
|
const pathsWithParentPathsRemoved = removeSubstringMatches(paths);
|
|
223
|
-
this.facetSelectionUpdated
|
|
230
|
+
this.facetSelectionUpdated?.emit({ paths: pathsWithParentPathsRemoved });
|
|
224
231
|
}
|
|
232
|
+
formatLabel = (facetChild) => {
|
|
233
|
+
const label = facetChild.path.replace(/^\//, '');
|
|
234
|
+
const count = facetChild.count;
|
|
235
|
+
return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
236
|
+
};
|
|
237
|
+
formatSubLabel = (facetChild, facetChildAncestor) => {
|
|
238
|
+
const facetChildPath = facetChild.path.substring(facetChildAncestor.path.length);
|
|
239
|
+
const label = facetChildPath.replace(/^\//, '');
|
|
240
|
+
const count = facetChild.count;
|
|
241
|
+
return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
242
|
+
};
|
|
225
243
|
render() {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
244
|
+
if (!this.fieldName) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const firstFacet = this.facetRoot?.[this.fieldName];
|
|
248
|
+
return (index.h("div", { class: index$1.classNames('filtersListContainer', 'searchcraft-filters-list-container') }, !firstFacet && (index.h("p", { class: 'searchcraft-facet-message' }, "Enter a search to view facets.")), firstFacet?.map((facetChild) => {
|
|
249
|
+
const isChildSelected = facetChild.children
|
|
250
|
+
? facetChild.children?.some((child) => this.selectedPaths[child.path])
|
|
251
|
+
: false;
|
|
252
|
+
return (index.h("div", { key: facetChild.path, class: index$1.classNames('searchcraft-filters-list-item') }, index.h("label", { class: index$1.classNames('filterCheckboxLabel', 'searchcraft-filters-list-checkbox-label') }, index.h("input", { checked: this.selectedPaths[facetChild.path], onChange: (_event) => this.handleCheckboxChange(facetChild.path), type: 'checkbox' }), isChildSelected ? (index.h("div", { class: index$1.classNames('dashContainer', 'searchcraft-filter-list-dash-container') }, index.h("searchcraft-dash-icon", null))) : (index.h("div", { class: index$1.classNames('checkContainer', 'searchcraft-filter-list-check-container') }, index.h("searchcraft-check-icon", null))), this.formatLabel(facetChild)), facetChild.children && facetChild.children.length > 0 && (index.h(index.Fragment, null, facetChild.children.map((grandchild) => (index.h("label", { key: grandchild.path, class: index$1.classNames('childFilterCheckboxLabel', 'searchcraft-child-filter-checkbox-label'), style: {
|
|
253
|
+
display: this.selectedPaths[facetChild.path]
|
|
254
|
+
? 'flex'
|
|
255
|
+
: 'none',
|
|
256
|
+
} }, index.h("input", { checked: this.selectedPaths[grandchild.path], onChange: (_event) => {
|
|
257
|
+
this.handleCheckboxChange(grandchild.path);
|
|
258
|
+
}, type: 'checkbox' }), index.h("div", { class: index$1.classNames('checkContainer', 'searchcraft-filter-list-check-container') }, index.h("searchcraft-check-icon", null)), this.formatSubLabel(grandchild, facetChild))))))));
|
|
259
|
+
})));
|
|
242
260
|
}
|
|
243
261
|
};
|
|
244
|
-
SearchcraftFacetList.style = SearchcraftFacetListStyle0;
|
|
245
|
-
|
|
246
|
-
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}";
|
|
247
|
-
const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
|
|
248
262
|
|
|
249
263
|
const SearchcraftSlider = class {
|
|
250
264
|
constructor(hostRef) {
|
|
251
265
|
index.registerInstance(this, hostRef);
|
|
252
266
|
this.rangeChanged = index.createEvent(this, "rangeChanged", 7);
|
|
253
|
-
/**
|
|
254
|
-
* The maximum value allowed.
|
|
255
|
-
*/
|
|
256
|
-
this.max = 100;
|
|
257
|
-
/**
|
|
258
|
-
* The minimum value allowed.
|
|
259
|
-
*/
|
|
260
|
-
this.min = 0;
|
|
261
|
-
/**
|
|
262
|
-
* The granularity that the value must adhere to.
|
|
263
|
-
*/
|
|
264
|
-
this.granularity = units.getMillis('month');
|
|
265
|
-
/** The type of data allowed. */
|
|
266
|
-
this.dataType = 'number';
|
|
267
|
-
this.endValue = this.max;
|
|
268
|
-
this.startValue = this.min;
|
|
269
|
-
this.lastFocusedHandle = 'max';
|
|
270
|
-
this.emitUpdate = async () => {
|
|
271
|
-
this.rangeChanged.emit({
|
|
272
|
-
startValue: this.startValue,
|
|
273
|
-
endValue: this.endValue,
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
|
-
this.handleStartValueChange = (event) => {
|
|
277
|
-
const inputElement = event.target;
|
|
278
|
-
const value = Number.parseInt(inputElement.value, 10);
|
|
279
|
-
this.lastFocusedHandle = 'min';
|
|
280
|
-
if (value <= this.endValue) {
|
|
281
|
-
this.startValue = value;
|
|
282
|
-
this.emitUpdate();
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
this.startValue = this.endValue;
|
|
286
|
-
inputElement.value = `${this.endValue}`;
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
this.handleEndValueChange = (event) => {
|
|
290
|
-
const inputElement = event.target;
|
|
291
|
-
const value = Number.parseInt(inputElement.value, 10);
|
|
292
|
-
this.lastFocusedHandle = 'max';
|
|
293
|
-
if (value >= this.startValue) {
|
|
294
|
-
this.endValue = value;
|
|
295
|
-
this.emitUpdate();
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
this.endValue = this.startValue;
|
|
299
|
-
inputElement.value = `${this.startValue}`;
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* The maximum value allowed.
|
|
270
|
+
*/
|
|
271
|
+
max = 100;
|
|
272
|
+
/**
|
|
273
|
+
* The minimum value allowed.
|
|
274
|
+
*/
|
|
275
|
+
min = 0;
|
|
276
|
+
/**
|
|
277
|
+
* The granularity that the value must adhere to.
|
|
278
|
+
*/
|
|
279
|
+
granularity = units.getMillis('month');
|
|
280
|
+
/** The type of data allowed. */
|
|
281
|
+
dataType = 'number';
|
|
282
|
+
endValue = this.max;
|
|
283
|
+
startValue = this.min;
|
|
284
|
+
lastFocusedHandle = 'max';
|
|
285
|
+
/**
|
|
286
|
+
* When the range has changed.
|
|
287
|
+
* */
|
|
288
|
+
rangeChanged;
|
|
303
289
|
componentDidLoad() {
|
|
304
290
|
this.startValue = this.min;
|
|
305
291
|
this.endValue = this.max;
|
|
306
292
|
}
|
|
293
|
+
emitUpdate = async () => {
|
|
294
|
+
this.rangeChanged?.emit({
|
|
295
|
+
startValue: this.startValue,
|
|
296
|
+
endValue: this.endValue,
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
handleStartValueChange = (event) => {
|
|
300
|
+
const inputElement = event.target;
|
|
301
|
+
const value = Number.parseInt(inputElement.value, 10);
|
|
302
|
+
this.lastFocusedHandle = 'min';
|
|
303
|
+
if (value <= this.endValue) {
|
|
304
|
+
this.startValue = value;
|
|
305
|
+
this.emitUpdate();
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
this.startValue = this.endValue;
|
|
309
|
+
inputElement.value = `${this.endValue}`;
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
handleEndValueChange = (event) => {
|
|
313
|
+
const inputElement = event.target;
|
|
314
|
+
const value = Number.parseInt(inputElement.value, 10);
|
|
315
|
+
this.lastFocusedHandle = 'max';
|
|
316
|
+
if (value >= this.startValue) {
|
|
317
|
+
this.endValue = value;
|
|
318
|
+
this.emitUpdate();
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
this.endValue = this.startValue;
|
|
322
|
+
inputElement.value = `${this.startValue}`;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
307
325
|
render() {
|
|
308
326
|
const rangeMin = this.min;
|
|
309
327
|
const rangeMax = this.max;
|
|
@@ -315,31 +333,37 @@ const SearchcraftSlider = class {
|
|
|
315
333
|
const endLabel = this.dataType === 'number'
|
|
316
334
|
? this.endValue
|
|
317
335
|
: new Date(this.endValue).getFullYear();
|
|
318
|
-
return (index.h("div", { key: '
|
|
336
|
+
return (index.h("div", { key: 'bf815949fc9e24e7f3ff9e1870affe676592fc68', class: 'searchcraft-slider-container' }, index.h("div", { key: 'd0913ee4e35f551782ec5649b9782c535e81ff74', class: 'searchcraft-slider-range-container' }, index.h("div", { key: '5397b3ef9a79c589080560e886ef709b77279748', class: 'searchcraft-slider-active-range', style: {
|
|
319
337
|
left: `${startPercent}%`,
|
|
320
338
|
width: `${endPercent - startPercent}%`,
|
|
321
|
-
} }), index.h("input", { key: '
|
|
339
|
+
} }), index.h("input", { key: '714896ec90ea07a1be7b73e7168c6fab9d2c095b', class: index$1.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 }), index.h("input", { key: '646042689f17b594dac00ba04c80d5d3a32a3cd0', class: index$1.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 })), index.h("div", { key: 'a6bc39619d6bcbb3ccf09e923436122db4559289', class: 'searchcraft-slider-label-container' }, index.h("span", { key: 'd15f19f86abeacb5c100403e9e4be20f28f604c0', class: 'searchcraft-slider-label' }, startLabel), index.h("span", { key: '6c0394917a4f54edae8a347cc8b225a64d044ea6', class: 'searchcraft-slider-label' }, endLabel))));
|
|
322
340
|
}
|
|
323
341
|
};
|
|
324
|
-
SearchcraftSlider.style = SearchcraftSliderStyle0;
|
|
325
|
-
|
|
326
|
-
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)}";
|
|
327
|
-
const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
|
|
328
342
|
|
|
329
343
|
const SearchcraftToggleButton = class {
|
|
330
344
|
constructor(hostRef) {
|
|
331
345
|
index.registerInstance(this, hostRef);
|
|
332
346
|
this.toggleUpdated = index.createEvent(this, "toggleUpdated", 7);
|
|
333
|
-
/**
|
|
334
|
-
* The label.
|
|
335
|
-
*/
|
|
336
|
-
this.label = 'Toggle';
|
|
337
|
-
this.isActive = false;
|
|
338
|
-
this.handleToggle = async () => {
|
|
339
|
-
this.isActive = !this.isActive;
|
|
340
|
-
this.toggleUpdated.emit(this.isActive);
|
|
341
|
-
};
|
|
342
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* The label.
|
|
350
|
+
*/
|
|
351
|
+
label = 'Toggle';
|
|
352
|
+
/**
|
|
353
|
+
* The secondary label displayed below the main label.
|
|
354
|
+
*/
|
|
355
|
+
subLabel;
|
|
356
|
+
/**
|
|
357
|
+
* When the toggle element is changed.
|
|
358
|
+
*/
|
|
359
|
+
toggleUpdated;
|
|
360
|
+
isActive = false;
|
|
361
|
+
unsubscribe;
|
|
362
|
+
lastQuery;
|
|
363
|
+
handleToggle = async () => {
|
|
364
|
+
this.isActive = !this.isActive;
|
|
365
|
+
this.toggleUpdated?.emit(this.isActive);
|
|
366
|
+
};
|
|
343
367
|
connectedCallback() {
|
|
344
368
|
/** When the query changes, sets toggle button state back to inactive. */
|
|
345
369
|
this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
|
|
@@ -350,18 +374,16 @@ const SearchcraftToggleButton = class {
|
|
|
350
374
|
});
|
|
351
375
|
}
|
|
352
376
|
disconnectedCallback() {
|
|
353
|
-
|
|
354
|
-
(_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
377
|
+
this.unsubscribe?.();
|
|
355
378
|
}
|
|
356
379
|
render() {
|
|
357
|
-
return (index.h("div", { key: '
|
|
380
|
+
return (index.h("div", { key: '8967ffc9328e0e6822f558d04ab31bc7b7f5c871', class: 'searchcraft-toggle-button-container' }, index.h("div", { key: 'd46d8ad6aff1bb012bea8e4b10cec03a12da8d64' }, index.h("p", { key: 'f9fd16a0da58bd66697d13df34a93cd70a6148c6', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (index.h("p", { key: 'ba7a0c309ca4cc0faa891ad9e270ac16f1d1d4cc', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), index.h("button", { key: '3b406713d41f055bbaf32d231188faba0dfa48fb', class: index$1.classNames('searchcraft-toggle-button-background', {
|
|
358
381
|
active: this.isActive,
|
|
359
|
-
}), onClick: this.handleToggle, type: 'button' }, index.h("div", { key: '
|
|
382
|
+
}), onClick: this.handleToggle, type: 'button' }, index.h("div", { key: '7dab3166e027e4efad18a3db9b541c1a4ba7da5f', class: index$1.classNames('searchcraft-toggle-button-handle', {
|
|
360
383
|
active: this.isActive,
|
|
361
384
|
}) }))));
|
|
362
385
|
}
|
|
363
386
|
};
|
|
364
|
-
SearchcraftToggleButton.style = SearchcraftToggleButtonStyle0;
|
|
365
387
|
|
|
366
388
|
exports.searchcraft_facet_list = SearchcraftFacetList;
|
|
367
389
|
exports.searchcraft_slider = SearchcraftSlider;
|