@searchcraft/javascript-sdk 0.7.0 → 0.7.1
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 +27 -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-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/p-d95bc2a0.js +284 -0
- package/dist/components/p-d95bc2a0.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-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-8b0a60b3.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-8b0a60b3.entry.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 +5 -0
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
- package/dist/types/components.d.ts +17 -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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftInputFormModuleCss","SearchcraftInputFormStyle0","SearchcraftInput","constructor","hostRef","this","autoSearch","buttonPlacement","customStyles","placeholderValue","searchTerm","inputValue","error","isSearchcraftInitialized","searchStore","useSearchcraftStore","getState","handleOnInput","event","input","target","value","trim","inputCleared","emit","setQuery","setSearchResults","performSearch","async","query","querySubmit","search","handleClearInput","handleFormSubmit","preventDefault","init","config","searchcraft","SearchcraftCore","sdkName","packageJson","name","sdkVersion","version","initialize","inputInit","componentDidLoad","onConfigChange","render","validatedCustomStyles","parseCustomStyles","isShowingClearButton","length","inputGridClassNames","classNames","shouldHaveVerticalGap","inputLabel","inputGridStyles","gap","h","key","class","onSubmit","style","onButtonClick","label","buttonLabel","errorMessage","autoComplete","onFocus","inputFocus","onBlur","inputBlur","onInput","placeholder","type","viewBox","fill","xmlns","id","d","stroke","onClick","searchcraftPopoverListViewModuleCss","SearchcraftPopoverListViewStyle0","SearchcraftPopoverListView","renderDocument","document","index","titleContent","getDocumentValueFromSearchResultMapping","popoverResultMappings","title","subtitleContent","subtitle","href","imageSource","imageAlt","document_id","_a","documents","map"],"sources":["src/components/searchcraft-input-form/searchcraft-input-form.module.scss?tag=searchcraft-input-form","src/components/searchcraft-input-form/searchcraft-input-form.tsx","src/components/searchcraft-popover-list-view/searchcraft-popover-list-view.module.scss?tag=searchcraft-popover-list-view","src/components/searchcraft-popover-list-view/searchcraft-popover-list-view.tsx"],"sourcesContent":[".searchcraft-input-grid {\n display: grid;\n gap: 4px 8px;\n}\n\n.searchcraft-input-grid-buttonLeft {\n grid-template-rows: repeat(3, auto);\n grid-template-columns: auto 1fr;\n\n & .searchcraft-input-button-wrapper {\n grid-column: 1 / span 1;\n grid-row: 2 / span 1;\n }\n\n & .searchcraft-input-label-wrapper {\n grid-column: 2 / span 1;\n grid-row: 1 / span 1;\n }\n\n & .searchcraft-input-error-wrapper {\n grid-column: 2 / span 1;\n grid-row: 3 / span 1;\n }\n\n & .searchcraft-input-wrapper {\n grid-column: 2 / span 1;\n grid-row: 2 / span 1;\n }\n}\n\n.searchcraft-input-grid-buttonRight {\n grid-template-rows: repeat(3, auto);\n grid-template-columns: 1fr auto;\n\n & .searchcraft-input-button-wrapper {\n grid-column: 2 / span 1;\n grid-row: 2 / span 1;\n }\n\n & .searchcraft-input-label-wrapper {\n grid-column: 1 / span 1;\n grid-row: 1 / span 1;\n }\n\n & .searchcraft-input-error-wrapper {\n grid-column: 1 / span 1;\n grid-row: 3 / span 1;\n }\n\n & .searchcraft-input-wrapper {\n grid-column: 1 / span 1;\n grid-row: 2 / span 1;\n }\n}\n\n.searchcraft-input-grid-buttonNone {\n grid-template-rows: repeat(3, auto);\n grid-template-columns: auto;\n\n & .searchcraft-input-button-wrapper {\n display: none;\n }\n\n & .searchcraft-input-label-wrapper {\n grid-column: 1 / span 1;\n grid-row: 1 / span 1;\n }\n\n & .searchcraft-input-error-wrapper {\n grid-column: 1 / span 1;\n grid-row: 3 / span 1;\n }\n\n & .searchcraft-input-wrapper {\n grid-column: 1 / span 1;\n grid-row: 2 / span 1;\n }\n}\n\n.searchcraft-input-wrapper {\n position: relative;\n display: flex;\n}\n\n.searchcraft-input {\n @include body();\n background-color: var(--sc-surface-neutral-secondary);\n border-radius: var(--sc-input-border-radius);\n border: none;\n color: var(--sc-content-neutral-primary);\n outline: none;\n padding-left: var(--sc-input-padding-left);\n padding-right: var(--sc-input-padding-right);\n padding-top: 12px;\n padding-bottom: 12px;\n flex: 1;\n\n &::placeholder {\n color: var(--sc-content-disabled);\n }\n\n &:focus {\n outline: var(--sc-border-brand) solid 2px;\n }\n\n &:focus::placeholder {\n opacity: 0;\n }\n}\n\n.searchcraft-input.error {\n color: var(--sc-content-danger);\n outline: var(--sc-border-danger) solid 2px;\n\n &:focus {\n outline: var(--sc-border-danger) solid 2px;\n }\n}\n\n.searchcraft-input-search-icon-wrapper {\n align-items: center;\n justify-content: center;\n display: flex;\n position: absolute;\n pointer-events: none;\n bottom: 0;\n left: 0;\n top: 0;\n width: var(--sc-input-padding-left);\n}\n\n.searchcraft-input-search-icon {\n pointer-events: none;\n width: var(--sc-input-search-icon-size);\n height: var(--sc-input-search-icon-size);\n}\n\n.searchcraft-input-clear-button {\n all: unset;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n position: absolute;\n border: none;\n outline: none;\n bottom: 0;\n right: 0;\n top: 0;\n width: var(--sc-input-padding-right);\n}\n\n.searchcraft-input-clear-icon {\n width: var(--sc-input-clear-icon-size);\n height: var(--sc-input-clear-icon-size);\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Event,\n type EventEmitter,\n Watch,\n} from '@stencil/core';\n\nimport { type SearchcraftConfig, SearchcraftCore } from '@searchcraft/core';\nimport packageJson from '../../../package.json';\n\nimport { parseCustomStyles } from '@utils';\nimport { useSearchcraftStore } from '@provider/store';\nimport classNames from 'classnames';\n\nexport interface ScInputCustomEvent<T> extends CustomEvent<T> {\n detail: T;\n target: HTMLSearchcraftInputFormElement;\n}\n\n/**\n * This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.\n * It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-input-form placeholder-value=\"Search here\" />\n * ```\n *\n * ```js\n * // index.js\n * const searchInputForm = document.querySelector('searchcraft-input-form');\n *\n * seardchInputForm.config = {\n * index: [],\n * readKey: '',\n * endpointUrl: '',\n * };\n *\n * searchForm.addEventListener('querySubmit', (event) => {\n * console.log('Query submitted', event.detail);\n * });\n * ```\n */\n@Component({\n tag: 'searchcraft-input-form',\n styleUrl: 'searchcraft-input-form.module.scss',\n shadow: false,\n})\nexport class SearchcraftInput {\n /**\n * The Searchcraft config object.\n */\n @Prop() config: SearchcraftConfig | undefined;\n /**\n * Whether or not to automatically submit the search term when the input changes.\n */\n @Prop() autoSearch = true;\n /**\n * Where to place the search button.\n */\n @Prop() buttonPlacement: 'left' | 'right' | 'none' = 'none';\n /**\n * The label for the submit button.\n */\n @Prop() buttonLabel: string | undefined;\n /**\n * The label rendered above the input.\n */\n @Prop() inputLabel: string | undefined;\n /**\n * A custom styles object to be applied to the input element.\n */\n @Prop() customStyles: string | Record<string, string> = {};\n /**\n * The input element's placeholder value.\n */\n @Prop() placeholderValue = 'Enter Search';\n /**\n * The starting value of the input element.\n */\n @Prop() searchTerm = '';\n /**\n * When the input is cleared.\n */\n @Event() inputCleared: EventEmitter<void>;\n /**\n * When no results are returned.\n */\n @Event() noResultsReceived: EventEmitter<void>;\n /**\n * When the input becomes focused.\n */\n @Event() inputFocus: EventEmitter<void>;\n /**\n * When the input becomes unfocused.\n */\n @Event() inputBlur: EventEmitter<void>;\n /**\n * Event emitted when input initializes.\n */\n @Event() inputInit: EventEmitter<void>;\n /**\n * Event emitted when a query has been submitted.\n */\n @Event() querySubmit: EventEmitter<string>;\n\n @State() inputValue = this.searchTerm;\n @State() error = false;\n @State() isSearchcraftInitialized = false;\n\n private searchStore = useSearchcraftStore.getState();\n\n init() {\n if (this.config && !this.isSearchcraftInitialized) {\n const searchcraft = new SearchcraftCore(this.config, {\n sdkName: packageJson.name,\n sdkVersion: packageJson.version,\n });\n this.searchStore.initialize(searchcraft, true);\n this.isSearchcraftInitialized = true;\n this.inputInit.emit();\n }\n }\n\n componentDidLoad() {\n this.init();\n }\n\n @Watch('config')\n onConfigChange() {\n this.init();\n }\n\n handleOnInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.inputValue = input.value;\n\n if (input.value.trim() === '') {\n this.inputCleared.emit();\n this.searchTerm = '';\n this.searchStore.setQuery('');\n this.searchStore.setSearchResults(null);\n return;\n }\n\n if (!this.autoSearch) {\n return;\n }\n\n this.performSearch(input.value);\n };\n\n private performSearch = async (value: string) => {\n if (value === useSearchcraftStore.getState().query) {\n return;\n }\n\n this.searchTerm = value.trim();\n this.error = false;\n this.searchStore.setQuery(this.searchTerm);\n this.querySubmit.emit(this.searchTerm);\n\n try {\n await this.searchStore.search();\n } catch (error) {\n this.error = true;\n this.inputCleared.emit();\n }\n };\n\n handleClearInput = () => {\n this.inputValue = '';\n this.searchTerm = '';\n this.searchStore.setQuery('');\n this.searchStore.setSearchResults(null);\n this.error = false;\n\n if (this.inputCleared) {\n this.inputCleared.emit();\n }\n };\n\n handleFormSubmit = async (event: Event) => {\n event.preventDefault();\n await this.performSearch(this.searchTerm);\n };\n\n render() {\n const validatedCustomStyles = parseCustomStyles(this.customStyles);\n\n const isShowingClearButton = this.inputValue.length > 0;\n\n const inputGridClassNames = classNames('searchcraft-input-grid', {\n 'searchcraft-input-grid-buttonLeft': this.buttonPlacement === 'left',\n 'searchcraft-input-grid-buttonRight': this.buttonPlacement === 'right',\n 'searchcraft-input-grid-buttonNone': this.buttonPlacement === 'none',\n });\n\n const shouldHaveVerticalGap = this.inputLabel || this.error;\n const inputGridStyles = {\n gap: shouldHaveVerticalGap ? '4px 8px' : '0px 8px',\n };\n\n return (\n <form class='searchcraft-input-form' onSubmit={this.handleFormSubmit}>\n <div class={inputGridClassNames} style={inputGridStyles}>\n <div class='searchcraft-input-button-wrapper'>\n <searchcraft-button\n onButtonClick={this.handleFormSubmit}\n label={this.buttonLabel}\n />\n </div>\n {this.inputLabel && (\n <div class='searchcraft-input-label-wrapper'>\n <searchcraft-input-label label={this.inputLabel} />\n </div>\n )}\n {this.error && (\n <div class='searchcraft-input-error-wrapper'>\n <searchcraft-error-message errorMessage='Something went wrong.' />\n </div>\n )}\n <div class='searchcraft-input-wrapper'>\n <input\n autoComplete='off'\n class='searchcraft-input'\n onFocus={() => this.inputFocus.emit()}\n onBlur={() => this.inputBlur.emit()}\n onInput={(event) => {\n this.handleOnInput(event);\n }}\n placeholder={this.placeholderValue}\n style={validatedCustomStyles}\n type='text'\n value={this.inputValue}\n />\n <div class='searchcraft-input-search-icon-wrapper'>\n <svg\n class='searchcraft-input-search-icon'\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>\n Searchcraft Search Icon Light\n </title>\n <path\n d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z'\n stroke='#404040'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n </div>\n {isShowingClearButton && (\n <button\n type='button'\n class='searchcraft-input-clear-button'\n onClick={this.handleClearInput}\n >\n <svg\n class='searchcraft-input-clear-icon'\n viewBox='0 0 22 22'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>\n Searchcraft Clear Input Icon Light\n </title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='black'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n </button>\n )}\n </div>\n </div>\n </form>\n );\n }\n}\n",null,"import { Component, h, Prop } from '@stencil/core';\n\nimport { getDocumentValueFromSearchResultMapping } from '@utils';\nimport type { PopoverResultMappings } from 'types';\n\n/**\n * This web component is designed to display a list of results within a popover interface.\n * It is consumed within the `searchcraft-popover-form` component.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-popover-list-view />\n * ```\n */\n@Component({\n tag: 'searchcraft-popover-list-view',\n styleUrl: 'searchcraft-popover-list-view.module.scss',\n shadow: false,\n})\nexport class SearchcraftPopoverListView {\n /**\n * The mappings that define how the data in the documents are mapped to the\n * list-view-item elements.\n */\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /**\n * The documents to render in the list view.\n */\n @Prop() documents: Record<string, unknown>[] | undefined;\n\n renderDocument(document: Record<string, unknown>, index: number) {\n /**\n * Index field values -> Result container props mappings.\n */\n const titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings.title,\n );\n const subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings.subtitle,\n );\n const href = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings.href,\n );\n const imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings.imageSource,\n );\n const imageAlt = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings.imageAlt,\n );\n\n return (\n <searchcraft-popover-list-item\n key={`${document.document_id}-${index}`}\n title-content={titleContent}\n subtitle-content={subtitleContent}\n image-src={imageSource}\n image-alt={imageAlt}\n href={href}\n document-position={index}\n />\n );\n }\n\n render() {\n return (\n <div class='searchcraft-popover-list-view'>\n {this.documents?.map((document, index) =>\n this.renderDocument(document, index),\n )}\n </div>\n );\n }\n}\n"],"mappings":"wyDAAA,MAAMA,EAAgC,m4MACtC,MAAAC,EAAeD,E,MCmDFE,EAAgB,MAL7B,WAAAC,CAAAC,G,oQAaUC,KAAAC,WAAa,KAIbD,KAAAE,gBAA6C,OAY7CF,KAAAG,aAAgD,GAIhDH,KAAAI,iBAAmB,eAInBJ,KAAAK,WAAa,GA0BZL,KAAAM,WAAaN,KAAKK,WAClBL,KAAAO,MAAQ,MACRP,KAAAQ,yBAA2B,MAE5BR,KAAAS,YAAcC,EAAoBC,WAuB1CX,KAAAY,cAAiBC,IACf,MAAMC,EAAQD,EAAME,OACpBf,KAAKM,WAAaQ,EAAME,MAExB,GAAIF,EAAME,MAAMC,SAAW,GAAI,CAC7BjB,KAAKkB,aAAaC,OAClBnB,KAAKK,WAAa,GAClBL,KAAKS,YAAYW,SAAS,IAC1BpB,KAAKS,YAAYY,iBAAiB,MAClC,M,CAGF,IAAKrB,KAAKC,WAAY,CACpB,M,CAGFD,KAAKsB,cAAcR,EAAME,MAAM,EAGzBhB,KAAAsB,cAAgBC,MAAOP,IAC7B,GAAIA,IAAUN,EAAoBC,WAAWa,MAAO,CAClD,M,CAGFxB,KAAKK,WAAaW,EAAMC,OACxBjB,KAAKO,MAAQ,MACbP,KAAKS,YAAYW,SAASpB,KAAKK,YAC/BL,KAAKyB,YAAYN,KAAKnB,KAAKK,YAE3B,UACQL,KAAKS,YAAYiB,Q,CACvB,MAAOnB,GACPP,KAAKO,MAAQ,KACbP,KAAKkB,aAAaC,M,GAItBnB,KA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,EAAkBH,EACtBH,EACAlF,KAAKsF,sBAAsBG,UAE7B,MAAMC,EAAOL,EACXH,EACAlF,KAAKsF,sBAAsBI,MAE7B,MAAMC,EAAcN,EAClBH,EACAlF,KAAKsF,sBAAsBK,aAE7B,MAAMC,EAAWP,EACfH,EACAlF,KAAKsF,sBAAsBM,UAG7B,OACEtC,EAAA,iCACEC,IAAK,GAAG2B,EAASW,eAAeV,IAAO,gBACxBC,EAAY,mBACTI,EAAe,YACtBG,EAAW,YACXC,EACXF,KAAMA,EAAI,oBACSP,G,CAKzB,MAAAxC,G,MACE,OACEW,EAAA,OAAAC,IAAA,2CAAKC,MAAM,kCACRsC,EAAA9F,KAAK+F,aAAS,MAAAD,SAAA,SAAAA,EAAEE,KAAI,CAACd,EAAUC,IAC9BnF,KAAKiF,eAAeC,EAAUC,K","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s}from"./p-129e6f2c.js";const c=":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-popover-list-item{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{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:inherit}.searchcraft-popover-list-item-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:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}";const a=c;const r=class{constructor(s){e(this,s)}componentDidLoad(){}connectedCallback(){}disconnectedCallback(){}handleButtonClick(){}render(){return s("a",{key:"b7a590e92994869477825dd17545e8d4e05d1d07",class:"searchcraft-popover-list-item",href:this.href},this.imageSrc&&s("div",{key:"129525e50ec17dce052f503af318b56e06c900ef",class:"searchcraft-popover-list-item-image-wrapper"},s("img",{key:"4ba701f35cbf7e167e7edd63ba19e3576e620c26",alt:this.imageAlt,src:this.imageSrc,class:"searchcraft-popover-list-item-image"})),s("div",{key:"6a6ab09451f5d9d4e554dc1f1fcd57ec13adf2f2",class:"searchcraft-popover-list-item-info-wrapper"},s("p",{key:"476fdefff6cb35167fb00f24cdf03b9f8d826ba5",class:"searchcraft-popover-list-item-title"},this.titleContent),s("p",{key:"b43fd584bfcc8efc7d50d7220b649fafc8bba244",class:"searchcraft-popover-list-item-subtitle"},this.subtitleContent)))}};r.style=a;export{r as searchcraft_popover_list_item};
|
|
2
|
-
//# sourceMappingURL=p-54248dd8.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftPopoverListItemModuleCss","SearchcraftPopoverListItemStyle0","SearchcraftPopoverListItem","componentDidLoad","connectedCallback","disconnectedCallback","handleButtonClick","render","h","key","class","href","this","imageSrc","alt","imageAlt","src","titleContent","subtitleContent"],"sources":["src/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.scss?tag=searchcraft-popover-list-item","src/components/searchcraft-popover-list-item/searchcraft-popover-list-item.tsx"],"sourcesContent":[".searchcraft-popover-list-item {\n all: unset;\n display: flex;\n flex-direction: row;\n cursor: pointer;\n gap: 8px;\n padding-right: var(--sc-popover-list-item-padding-horizontal);\n padding-left: var(--sc-popover-list-item-padding-horizontal);\n padding-top: var(--sc-popover-list-item-padding-vertical);\n padding-bottom: var(--sc-popover-list-item-padding-vertical);\n\n &:focus {\n background-color: var(--sc-surface-neutral-secondary-active);\n color: var(--sc-content-neutral-secondary);\n }\n\n &:hover {\n background-color: var(--sc-surface-neutral-secondary-hover);\n color: var(--sc-content-neutral-secondary);\n }\n}\n\n.searchcraft-popover-list-item-title {\n @include body();\n margin: 0;\n color: inherit;\n}\n\n.searchcraft-popover-list-item-subtitle {\n @include body-small();\n margin: 0;\n color: inherit;\n}\n\n.searchcraft-popover-list-item-image-wrapper {\n width: var(--sc-popover-list-item-image-size);\n height: var(--sc-popover-list-item-image-size);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.searchcraft-popover-list-item-image {\n max-width: var(--sc-popover-list-item-image-size);\n max-height: var(--sc-popover-list-item-image-size);\n}\n\n.searchcraft-popover-list-item-info-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n justify-content: center;\n}","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * A single list item rendered in a searchcraft-popover-list-view.\n */\n@Component({\n tag: 'searchcraft-popover-list-item',\n styleUrl: 'searchcraft-popover-list-item.module.scss',\n shadow: false,\n})\nexport class SearchcraftPopoverListItem {\n /** The result title */\n @Prop() titleContent: string | undefined;\n /** The result subtitle */\n @Prop() subtitleContent: string | undefined;\n /** The source of the image. If not included, no item will be rendered. */\n @Prop() imageSrc: string | undefined;\n /** The image alt tag. */\n @Prop() imageAlt: string | undefined;\n /** The link href */\n @Prop() href: string | undefined;\n /** The document position relative to the search results (For Measure) */\n @Prop() documentPosition: number;\n\n componentDidLoad() {}\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n handleButtonClick() {}\n\n render() {\n return (\n <a class='searchcraft-popover-list-item' href={this.href}>\n {this.imageSrc && (\n <div class='searchcraft-popover-list-item-image-wrapper'>\n <img\n alt={this.imageAlt}\n src={this.imageSrc}\n class='searchcraft-popover-list-item-image'\n />\n </div>\n )}\n <div class='searchcraft-popover-list-item-info-wrapper'>\n <p class='searchcraft-popover-list-item-title'>{this.titleContent}</p>\n <p class='searchcraft-popover-list-item-subtitle'>\n {this.subtitleContent}\n </p>\n </div>\n </a>\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAsC,i2JAC5C,MAAAC,EAAeD,E,MCSFE,EAA0B,M,yBAcrC,gBAAAC,GAAgB,CAEhB,iBAAAC,GAAiB,CAEjB,oBAAAC,GAAoB,CAEpB,iBAAAC,GAAiB,CAEjB,MAAAC,GACE,OACEC,EAAA,KAAAC,IAAA,2CAAGC,MAAM,gCAAgCC,KAAMC,KAAKD,MACjDC,KAAKC,UACJL,EAAA,OAAAC,IAAA,2CAAKC,MAAM,+CACTF,EAAA,OAAAC,IAAA,2CACEK,IAAKF,KAAKG,SACVC,IAAKJ,KAAKC,SACVH,MAAM,yCAIZF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,8CACTF,EAAA,KAAAC,IAAA,2CAAGC,MAAM,uCAAuCE,KAAKK,cACrDT,EAAA,KAAAC,IAAA,2CAAGC,MAAM,0CACNE,KAAKM,kB","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as s,c as e,h as t}from"./p-129e6f2c.js";import{u as c}from"./p-01dc5b3b.js";import{g as r}from"./p-755f491b.js";import{s as i}from"./p-d9551738.js";const a=":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-ad-section{align-items:center;background-color:#F1F1F1;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;min-height:176px;text-align:center}.searchcraft-ad-section p{margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}";const n=a;const o=class{constructor(t){s(this,t);this.noResults=e(this,"noResults",7);this.adInterval=4;this.placeAdAtEnd=false;this.placeAdAtStart=true;this.resultImagePlacement="right";this.buttonTarget="_blank";this.containerTarget="_blank";this.hasSearched=false;this.query="";this.searchResults=null}componentDidLoad(){this.unsubscribe=c.subscribe((s=>{if(s.query.length>0){this.hasSearched=true}else{this.hasSearched=false}this.searchResults=Object.assign({},s.searchResults);this.query=s.query}));const{searchResults:s,query:e}=c.getState();this.searchResults=s;this.query=e}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}renderDocument(s,e){const c=r(s,this.searchResultMappings.title);const a=r(s,this.searchResultMappings.subtitle);const n=r(s,this.searchResultMappings.body);const o=r(s,this.searchResultMappings.containerHref);const d=r(s,this.searchResultMappings.buttonHref);const h=r(s,this.searchResultMappings.imageSource);const l=r(s,this.searchResultMappings.footer);const u=typeof this.customStylesForResults==="string"?this.customStylesForResults:i(this.customStylesForResults);return t("searchcraft-base-search-result",{key:`${s.document_id}-${e}`,"custom-styles":u,"image-placement":this.resultImagePlacement,"container-rel":this.containerRel,"container-target":this.containerTarget,"button-label":this.buttonLabel||"View more","button-rel":this.buttonRel,"button-target":this.buttonTarget,"document-position":e,"title-content":c,"subtitle-content":a,"body-content":n,"footer-content":l,"container-href":o,"button-href":d,"image-src":h})}render(){var s,e,c,r,i,a,n,o,d,h;if(this.query.trim()===""){return t("div",{class:"searchcraft-search-results-empty-state-container"},t("slot",{name:"empty-search"}))}if(!((s=this.searchResults)===null||s===void 0?void 0:s.data)){return}const l=(r=(c=(e=this.searchResults)===null||e===void 0?void 0:e.data)===null||c===void 0?void 0:c.hits)===null||r===void 0?void 0:r.map(((s,e)=>{const{doc:t}=s;return t}));const u=[];if(this.placeAdAtStart){u.push(t("div",{key:"ad-section-start",class:"searchcraft-ad-section"},t("p",null,"Ad Section")))}if(this.adInterval>0){l.forEach(((s,e)=>{u.push(this.renderDocument(s,e));if((e+1)%this.adInterval===0){u.push(t("div",{key:`ad-section-${e+1}`,class:"searchcraft-ad-section "},t("p",null,"Ad Section")))}}))}else{const s=l.map(((s,e)=>this.renderDocument(s,e)));u.push(...s)}if(this.placeAdAtEnd){u.push(t("div",{key:"ad-section-end",class:"searchcraft-ad-section"},t("p",null,"Ad Section")))}if(this.query.length>0&&((n=(a=(i=this.searchResults)===null||i===void 0?void 0:i.data)===null||a===void 0?void 0:a.hits)===null||n===void 0?void 0:n.length)===0){this.noResults.emit()}return t("div",{class:"searchcraft-search-results-container"},u,this.query.length>0&&((h=(d=(o=this.searchResults)===null||o===void 0?void 0:o.data)===null||d===void 0?void 0:d.hits)===null||h===void 0?void 0:h.length)===0&&t("div",{class:"searchcraft-search-results-error-message-container"},t("searchcraft-error-message",{"error-message":`No search results found for "${this.query}" query`})))}};o.style=n;export{o as searchcraft_base_search_results};
|
|
2
|
-
//# sourceMappingURL=p-69430dbf.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftBaseSearchResultsModuleCss","SearchcraftBaseSearchResultsStyle0","SearchcraftBaseSearchResults","constructor","hostRef","this","adInterval","placeAdAtEnd","placeAdAtStart","resultImagePlacement","buttonTarget","containerTarget","hasSearched","query","searchResults","componentDidLoad","unsubscribe","useSearchcraftStore","subscribe","state","length","Object","assign","getState","disconnectedCallback","renderDocument","document","index","titleContent","getDocumentValueFromSearchResultMapping","searchResultMappings","title","subtitleContent","subtitle","bodyContent","body","containerHref","buttonHref","imageSource","footerContent","footer","serializedStyles","customStylesForResults","serializeStyles","h","key","document_id","containerRel","buttonLabel","buttonRel","render","trim","class","name","_a","data","documents","_d","_c","_b","hits","map","_index","doc","result","finalComponents","push","forEach","documentElements","_g","_f","_e","noResults","emit","_k","_j","_h"],"sources":["src/components/searchcraft-base-search-results/searchcraft-base-search-results.module.scss?tag=searchcraft-base-search-results","src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"sourcesContent":[".searchcraft-search-results-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 16px;\n}\n\n.searchcraft-ad-section {\n align-items: center;\n background-color: #F1F1F1;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n font-size: 16px;\n justify-content: center;\n min-height: 176px;\n text-align: center;\n\n p {\n margin: 0;\n color: var(--sc-content-disabled);\n }\n}\n\n.searchcraft-search-results-empty-state-container {\n text-align: center;\n}\n\n.searchcraft-search-results-error-message-container {\n text-align: center;\n}\n","import {\n Component,\n h,\n Event,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\n\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport {\n getDocumentValueFromSearchResultMapping,\n serializeStyles,\n} from '@utils';\nimport type { SearchResultMappings } from 'types';\n\n/**\n * This web component is responsible for displaying the results of a search query.\n * Once a query is submitted, the component formats and presents an ordered list of the results.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-base-search-results\n * ad-interval=\"4\"\n * place-ad-at-start=\"false\"\n * result-image-placement=\"right\"\n * />\n * ```\n *\n * ```js\n * // index.js\n * const baseSearchResults = document.querySelector('searchcraft-base-search-results');\n *\n * baseSearchResults.searchResultMappings = containerHref: {\n * fieldNames: [\n * {\n * fieldName: 'canonical_link',\n * dataType: 'text',\n * },\n * ],\n * };\n *\n * baseSearchResults.addEventListener('noResults', () => {\n * console.log('No search results found');\n * });\n * ```\n */\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResults {\n /**\n * How often ads are injected.\n */\n @Prop() adInterval = 4;\n /**\n * A custom styles object.\n */\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>>\n | undefined;\n /**\n * Formats the content rendered for each result.\n */\n @Prop() searchResultMappings: SearchResultMappings | undefined;\n /**\n * Should an ad be placed at the end of the results.\n */\n @Prop() placeAdAtEnd = false;\n /**\n * Should an ad be placed at the start of the results.\n */\n @Prop() placeAdAtStart = true;\n /**\n * The placement of the image for each result.\n */\n @Prop() resultImagePlacement: 'left' | 'right' = 'right';\n /**\n * The label for the button rendered when containerHref is not present for each result.\n */\n @Prop() buttonLabel: string | undefined;\n /**\n * Where to open the link for the button rendered when containerHref is not present for each result.\n */\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the button rendered when containerHref is not present for each result.\n */\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * Where to open the link for the containing element for each result.\n */\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the containing element for each result.\n */\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n\n /**\n * When no results are returned.\n */\n @Event() noResults: EventEmitter<void>;\n\n @State() hasSearched = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n renderDocument(document: Record<string, unknown>, index: number) {\n /**\n * Index field values -> Result container props mappings.\n */\n const titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.title,\n );\n const subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.subtitle,\n );\n const bodyContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.body,\n );\n const containerHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.containerHref,\n );\n const buttonHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.buttonHref,\n );\n const imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.imageSource,\n );\n const footerContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.footer,\n );\n\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n return (\n <searchcraft-base-search-result\n key={`${document.document_id}-${index}`}\n custom-styles={serializedStyles}\n image-placement={this.resultImagePlacement}\n container-rel={this.containerRel}\n container-target={this.containerTarget}\n button-label={this.buttonLabel || 'View more'}\n button-rel={this.buttonRel}\n button-target={this.buttonTarget}\n document-position={index}\n title-content={titleContent}\n subtitle-content={subtitleContent}\n body-content={bodyContent}\n footer-content={footerContent}\n container-href={containerHref}\n button-href={buttonHref}\n image-src={imageSource}\n />\n );\n }\n\n render() {\n if (this.query.trim() === '') {\n return (\n <div class='searchcraft-search-results-empty-state-container'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n return;\n }\n\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n documents.forEach((document, index) => {\n finalComponents.push(this.renderDocument(document, index));\n\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div\n key={`ad-section-${index + 1}`}\n class='searchcraft-ad-section '\n >\n <p>Ad Section</p>\n </div>,\n );\n }\n });\n } else {\n const documentElements = documents.map((document, index) =>\n this.renderDocument(document, index),\n );\n finalComponents.push(...documentElements);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.query.length > 0 && this.searchResults?.data?.hits?.length === 0) {\n this.noResults.emit();\n }\n\n return (\n <div class='searchcraft-search-results-container'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='searchcraft-search-results-error-message-container'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n"],"mappings":"8JAAA,MAAMA,EAAwC,4zHAC9C,MAAAC,EAAeD,E,MCuDFE,EAA4B,MALzC,WAAAC,CAAAC,G,+CASUC,KAAAC,WAAa,EAebD,KAAAE,aAAe,MAIfF,KAAAG,eAAiB,KAIjBH,KAAAI,qBAAyC,QAQzCJ,KAAAK,aAAwD,SAQxDL,KAAAM,gBAA2D,SAW1DN,KAAAO,YAAc,MACdP,KAAAQ,MAAQ,GACRR,KAAAS,cAA4C,I,CAIrD,gBAAAC,GACEV,KAAKW,YAAcC,EAAoBC,WAAWC,IAChD,GAAIA,EAAMN,MAAMO,OAAS,EAAG,CAC1Bf,KAAKO,YAAc,I,KACd,CACLP,KAAKO,YAAc,K,CAErBP,KAAKS,cAAaO,OAAAC,OAAA,GAAQH,EAAML,eAChCT,KAAKQ,MAAQM,EAAMN,KAAK,IAG1B,MAAMC,cAAEA,EAAaD,MAAEA,GAAUI,EAAoBM,WACrDlB,KAAKS,cAAgBA,EACrBT,KAAKQ,MAAQA,C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import{r as s,h as e}from"./p-129e6f2c.js";import{u as c}from"./p-01dc5b3b.js";import{f as r}from"./p-755f491b.js";const a=":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-results-info-container{border-bottom:1px solid var(--sc-surface-disabled);display:flex;justify-content:flex-start}.searchcraft-results-info-content{color:var(--sc-content-primary);font-family:var(--sc-font-family);font-size:18px;font-weight:600;line-height:20px;margin:0px 0 8px}@media (max-width: 768px){.searchcraft-results-info-content{margin:0;margin-bottom:8px}}";const i=a;const n=class{constructor(e){s(this,e);this.isRequesting=false;this.resultsCount=0;this.responseTime="";this.query=""}connectedCallback(){this.unsubscribe=c.subscribe((s=>{var e,c,r,a;this.isRequesting=s.isRequesting;this.resultsCount=((c=(e=s.searchResults)===null||e===void 0?void 0:e.data)===null||c===void 0?void 0:c.count)||0;this.responseTime=((((a=(r=s.searchResults)===null||r===void 0?void 0:r.data)===null||a===void 0?void 0:a.time_taken)||0)*1e3).toFixed(2);this.query=s.query||""}))}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){if(!this.query||this.resultsCount===0){return null}const s=r(this.resultsCount);return e("div",{class:"searchcraft-results-info-container"},e("p",{class:"searchcraft-results-info-content"},s," results found in ",this.responseTime,"ms"))}};n.style=i;export{n as searchcraft_results_info};
|
|
2
|
-
//# sourceMappingURL=p-a460755d.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftResultsInfoModuleCss","SearchcraftResultsInfoStyle0","SearchcraftResultsInfo","constructor","hostRef","this","isRequesting","resultsCount","responseTime","query","connectedCallback","unsubscribe","useSearchcraftStore","subscribe","state","_b","_a","searchResults","data","count","_d","_c","time_taken","toFixed","disconnectedCallback","render","formattedResults","formatNumberWithCommas","h","class"],"sources":["src/components/searchcraft-results-info/searchcraft-results-info.module.scss?tag=searchcraft-results-info","src/components/searchcraft-results-info/searchcraft-results-info.tsx"],"sourcesContent":[".searchcraft-results-info-container {\n border-bottom: 1px solid var(--sc-surface-disabled);\n display: flex;\n justify-content: flex-start;\n}\n\n.searchcraft-results-info-content {\n color: var(--sc-content-primary);\n font-family: var(--sc-font-family);\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n margin: 0px 0 8px;\n\n @media (max-width: $breakpoint-md) {\n margin: 0;\n margin-bottom: 8px;\n }\n}","import { Component, h, State } from '@stencil/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport { formatNumberWithCommas } from '@utils';\n\n/**\n * This web component is designed to display the number of results returned from a search query.\n * It provides users with real-time feedback on the scale of the results, such as the total number of items found.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-results-info />\n * ```\n */\n@Component({\n tag: 'searchcraft-results-info',\n styleUrl: 'searchcraft-results-info.module.scss',\n shadow: false,\n})\nexport class SearchcraftResultsInfo {\n @State() isRequesting = false;\n @State() resultsCount = 0;\n @State() responseTime = '';\n @State() query = '';\n\n unsubscribe: () => void;\n\n connectedCallback() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n this.resultsCount = state.searchResults?.data?.count || 0;\n this.responseTime = (\n (state.searchResults?.data?.time_taken || 0) * 1000\n ).toFixed(2);\n this.query = state.query || '';\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n const formattedResults = formatNumberWithCommas(this.resultsCount);\n return (\n <div class='searchcraft-results-info-container'>\n <p class='searchcraft-results-info-content'>\n {formattedResults} results found in {this.responseTime}ms\n </p>\n </div>\n );\n }\n}\n"],"mappings":"mHAAA,MAAMA,EAAkC,8rHACxC,MAAAC,EAAeD,E,MCoBFE,EAAsB,MALnC,WAAAC,CAAAC,G,UAMWC,KAAAC,aAAe,MACfD,KAAAE,aAAe,EACfF,KAAAG,aAAe,GACfH,KAAAI,MAAQ,E,CAIjB,iBAAAC,GACEL,KAAKM,YAAcC,EAAoBC,WAAWC,I,YAChDT,KAAKC,aAAeQ,EAAMR,aAC1BD,KAAKE,eAAeQ,GAAAC,EAAAF,EAAMG,iBAAa,MAAAD,SAAA,SAAAA,EAAEE,QAAI,MAAAH,SAAA,SAAAA,EAAEI,QAAS,EACxDd,KAAKG,iBACFY,GAAAC,EAAAP,EAAMG,iBAAa,MAAAI,SAAA,SAAAA,EAAEH,QAAI,MAAAE,SAAA,SAAAA,EAAEE,aAAc,GAAK,KAC/CC,QAAQ,GACVlB,KAAKI,MAAQK,EAAML,OAAS,EAAE,G,CAIlC,oBAAAe,GACE,GAAInB,KAAKM,YAAa,CACpBN,KAAKM,a,EAIT,MAAAc,GACE,IAAKpB,KAAKI,OAASJ,KAAKE,eAAiB,EAAG,CAC1C,OAAO,I,CAET,MAAMmB,EAAmBC,EAAuBtB,KAAKE,cACrD,OACEqB,EAAA,OAAKC,MAAM,sCACTD,EAAA,KAAGC,MAAM,oCACNH,EAAgB,qBAAoBrB,KAAKG,aAAY,M","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r,h as e,g as o}from"./p-129e6f2c.js";import{c as s}from"./p-5cdc6210.js";import{u as a}from"./p-01dc5b3b.js";const c=":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-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{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);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px;border-radius:calc(var(--sc-popover-form-border-radius) * 0.8)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media (min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:transparent}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius) * 0.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0, 0, 0, 0.5);display:none}@media (min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media (min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media (min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media (min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius) * 0.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}";const t=c;const i=class{constructor(e){r(this,e);this.type="inline";this.hotkey="k";this.hotkeyModifier="meta";this.isPopoverVisibleInState=false;this.isFocused=false;this.breakpointSm=576;this.breakpointMd=768;this.breakpointLg=992;this.handleDocumentClick=r=>{if(!this.hostElement.contains(r.target)){this.isFocused=false}};this.handleDocumentKeyDown=r=>{if(r.key===this.hotkey){this.handleHotkeyPressed(r)}if(!this.hostElement.contains(document.activeElement)){return}switch(r.key){case"ArrowDown":case"ArrowUp":r.preventDefault();this.focusOnNextListItem(r.key);break;case"Escape":a.getState().setPopoverVisibility(false);break;default:return}};this.handleInputInit=()=>{const r=this.hostElement.querySelector(".searchcraft-input");r===null||r===void 0?void 0:r.focus()}}componentDidLoad(){const r=getComputedStyle(document.documentElement);this.breakpointSm=Number.parseFloat(r.getPropertyValue("--sc-breakpoint-sm").trim());this.breakpointMd=Number.parseFloat(r.getPropertyValue("--sc-breakpoint-md").trim());this.breakpointLg=Number.parseFloat(r.getPropertyValue("--sc-breakpoint-lg").trim());this.isPopoverVisibleInState=a.getState().isPopoverVisible;document.addEventListener("click",this.handleDocumentClick);document.addEventListener("keydown",this.handleDocumentKeyDown);this.unsubscribe=a.subscribe((r=>{if(this.isPopoverVisibleInState!==r.isPopoverVisible){this.handlePopoverVisibilityChange(r.isPopoverVisible)}this.searchResults=Object.assign({},r.searchResults);this.searchTerm=r.query}))}disconnectedCallback(){var r;(r=this.unsubscribe)===null||r===void 0?void 0:r.call(this);document.removeEventListener("click",this.handleDocumentClick);document.removeEventListener("keydown",this.handleDocumentKeyDown)}handlePopoverVisibilityChange(r){this.isPopoverVisibleInState=r;document.body.style.overflow=r?"hidden":"auto"}handleInputFocus(){this.isFocused=true;if(this.type==="inline"&&window.visualViewport.width<this.breakpointSm){a.getState().setPopoverVisibility(true);if(!this.modalElement){this.modalElement=document.createElement("searchcraft-popover-form");this.modalElement.config=this.config;this.modalElement.popoverResultMappings=this.popoverResultMappings;this.modalElement.setAttribute("type","fullscreen");document.body.appendChild(this.modalElement)}}}handleModalBackdropClick(r){a.getState().setPopoverVisibility(false)}handleHotkeyPressed(r){if(r.ctrlKey&&this.hotkeyModifier==="ctrl"||r.altKey&&this.hotkeyModifier==="alt"||r.metaKey&&this.hotkeyModifier==="meta"){r.preventDefault();if(this.type==="inline"&&!this.isPopoverVisibleInState){const r=this.hostElement.querySelector(".searchcraft-input");r===null||r===void 0?void 0:r.focus()}else{a.getState().setPopoverVisibility(!this.isPopoverVisibleInState)}}}handleCancelButtonClick(){a.getState().setPopoverVisibility(false)}focusOnNextListItem(r){var e,o;const s=Array.from(document.querySelectorAll("a.searchcraft-popover-list-item")).filter((r=>!r.hasAttribute("disabled")&&r.offsetParent!==null));const a=s.indexOf(document.activeElement);if(r==="ArrowDown"){(e=s[(a+1)%s.length])===null||e===void 0?void 0:e.focus()}else if(r==="ArrowUp"){if(a>=1){(o=s[a-1])===null||o===void 0?void 0:o.focus()}else{const r=document.querySelector(".searchcraft-input");if(r){r.focus();requestAnimationFrame((()=>{r.selectionEnd=r.value.length;r.selectionStart=r.value.length}))}}}}get hasResultsToShow(){var r,e,o,s,a;return((e=(r=this.searchTerm)===null||r===void 0?void 0:r.trim())===null||e===void 0?void 0:e.length)>0&&((a=(s=(o=this.searchResults)===null||o===void 0?void 0:o.data)===null||s===void 0?void 0:s.hits)===null||a===void 0?void 0:a.length)>0}renderInlinePopover(r){const o=this.hasResultsToShow&&this.isFocused;const a=s("searchcraft-popover-form searchcraft-popover-form-inline",{"searchcraft-popover-form-active":o});return e("div",{class:a},e("searchcraft-input-form",{config:this.config,onInputFocus:this.handleInputFocus.bind(this)}),o&&e("div",{class:"searchcraft-popover-inline-wrapper-outer"},e("div",{class:"searchcraft-popover-inline-wrapper-inner"},e("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,documents:r}))))}renderModalPopover(r){if(this.isPopoverVisibleInState){const o=s("searchcraft-popover-form",{"searchcraft-popover-form-active":this.hasResultsToShow});return e("div",{class:"searchcraft-popover-form-modal"},e("div",{class:"searchcraft-popover-form-modal-backdrop",onClick:this.handleModalBackdropClick}),e("div",{class:"searchcraft-popover-form-modal-inner"},e("div",{class:o},e("div",{class:"searchcraft-popover-form-input-wrapper"},e("searchcraft-input-form",{config:this.config,onInputFocus:this.handleInputFocus.bind(this),onInputInit:this.handleInputInit.bind(this)}),e("button",{type:"button",class:"searchcraft-popover-form-cancel-button",onClick:this.handleCancelButtonClick.bind(this)},"Cancel")),this.hasResultsToShow&&e("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,documents:r}))))}}renderFullscreenPopover(r){if(this.isPopoverVisibleInState){return e("div",{class:"searchcraft-popover-form-fullscreen"},e("div",{class:"searchcraft-popover-form"},e("div",{class:"searchcraft-popover-form-input-wrapper"},e("searchcraft-input-form",{config:this.config,onInputFocus:this.handleInputFocus.bind(this),onInputInit:this.handleInputInit.bind(this)}),e("button",{type:"button",class:"searchcraft-popover-form-cancel-button",onClick:this.handleCancelButtonClick.bind(this)},"Cancel")),this.hasResultsToShow&&e("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,documents:r})))}}render(){var r,e,o;const s=(o=(e=(r=this.searchResults)===null||r===void 0?void 0:r.data)===null||e===void 0?void 0:e.hits)===null||o===void 0?void 0:o.map(((r,e)=>{const{doc:o}=r;return o}));switch(this.type){case"inline":return this.renderInlinePopover(s);case"modal":return this.renderModalPopover(s);case"fullscreen":return this.renderFullscreenPopover(s)}}get hostElement(){return o(this)}};i.style=t;export{i as searchcraft_popover_form};
|
|
2
|
-
//# sourceMappingURL=p-bc2c4259.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftPopoverFormModuleCss","SearchcraftPopoverFormStyle0","SearchcraftPopoverForm","constructor","hostRef","this","type","hotkey","hotkeyModifier","isPopoverVisibleInState","isFocused","breakpointSm","breakpointMd","breakpointLg","handleDocumentClick","event","hostElement","contains","target","handleDocumentKeyDown","key","handleHotkeyPressed","document","activeElement","preventDefault","focusOnNextListItem","useSearchcraftStore","getState","setPopoverVisibility","handleInputInit","input","querySelector","focus","componentDidLoad","computedStyle","getComputedStyle","documentElement","Number","parseFloat","getPropertyValue","trim","isPopoverVisible","addEventListener","unsubscribe","subscribe","state","handlePopoverVisibilityChange","searchResults","Object","assign","searchTerm","query","disconnectedCallback","_a","call","removeEventListener","isVisible","body","style","overflow","handleInputFocus","window","visualViewport","width","modalElement","createElement","config","popoverResultMappings","setAttribute","appendChild","handleModalBackdropClick","_event","ctrlKey","altKey","metaKey","hostElementInput","handleCancelButtonClick","direction","listItems","Array","from","querySelectorAll","filter","el","hasAttribute","offsetParent","currentIndex","indexOf","length","_b","requestAnimationFrame","selectionEnd","value","selectionStart","hasResultsToShow","_e","_d","_c","data","hits","renderInlinePopover","documents","isListViewVisible","popoverFormClassNames","classNames","h","class","onInputFocus","bind","renderModalPopover","onClick","onInputInit","renderFullscreenPopover","render","map","_index","doc","result"],"sources":["src/components/searchcraft-popover-form/searchcraft-popover-form.module.scss?tag=searchcraft-popover-form","src/components/searchcraft-popover-form/searchcraft-popover-form.tsx"],"sourcesContent":["/**\n * Styles applied to all popover form variants.\n */\n.searchcraft-popover-form {\n display: flex;\n flex-direction: column;\n flex: 1;\n\n & .searchcraft-popover-form-input-wrapper {\n padding: 12px;\n background-color: var(--sc-surface-neutral-secondary);\n display: flex;\n flex-direction: row;\n gap: 4px;\n }\n\n & .searchcraft-popover-form-input-wrapper > searchcraft-input-form {\n flex: 1;\n }\n\n & .searchcraft-popover-form-cancel-button {\n @include body();\n border: 0;\n outline: 0;\n padding: 0;\n flex-shrink: 0;\n background: none;\n cursor: pointer;\n padding-left: 12px;\n padding-right: 12px;\n border-radius: calc(var(--sc-popover-form-border-radius) * 0.8);\n\n &:hover {\n background-color: var(--sc-surface-brand-secondary-hover);\n }\n\n &:focus {\n background-color: var(--sc-surface-brand-secondary-active);\n }\n }\n}\n\n/**\n * Styles applied to `inline` popover forms.\n */\n.searchcraft-popover-form-inline {\n & .searchcraft-input {\n border-top-left-radius: var(--sc-popover-form-border-radius);\n border-top-right-radius: var(--sc-popover-form-border-radius);\n border-bottom-left-radius: var(--sc-popover-form-border-radius);\n border-bottom-right-radius: var(--sc-popover-form-border-radius);\n border: none;\n outline: none;\n }\n\n &.searchcraft-popover-form-active .searchcraft-input {\n border-top-left-radius: var(--sc-popover-form-border-radius);\n border-top-right-radius: var(--sc-popover-form-border-radius);\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n & .searchcraft-popover-inline-wrapper-outer {\n position: relative;\n }\n\n & .searchcraft-popover-inline-wrapper-inner {\n position: absolute;\n height: var(--sc-popover-list-view-height);\n z-index: 1000;\n width: 100%;\n }\n\n & .searchcraft-popover-list-view {\n display: flex;\n flex-direction: column;\n overflow: auto;\n background-color: var(--sc-surface-neutral-secondary);\n border-bottom-left-radius: var(--sc-popover-form-border-radius);\n border-bottom-right-radius: var(--sc-popover-form-border-radius);\n max-height: var(--sc-popover-list-view-height)\n }\n}\n\n/**\n * Styles applied to `modal` popover forms.\n */\n.searchcraft-popover-form-modal {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 0;\n background-color: var(--sc-surface-neutral-secondary);\n\n @media (min-width: $breakpoint-sm) {\n padding: 16px;\n background-color: transparent;\n }\n\n & .searchcraft-input {\n border-radius: calc(var(--sc-popover-form-border-radius) * 0.8);\n outline-width: 1px;\n outline-color: var(--sc-border-neutral);\n }\n\n & .searchcraft-popover-form-modal-backdrop {\n position: absolute;\n inset: 0;\n background-color: rgba(0,0,0, 0.5);\n display: none;\n\n @media (min-width: $breakpoint-sm) {\n display: block;\n }\n }\n\n & .searchcraft-popover-form-modal-inner {\n position: absolute;\n inset: 0;\n z-index: 1002;\n margin-top: 0px;\n display: flex;\n border-radius: var(--sc-popover-form-border-radius);\n overflow: hidden;\n\n @media (min-width: $breakpoint-sm) {\n inset: auto;\n position: relative;\n width: 100%;\n margin-top: 100px;\n max-width: var(--sc-popover-modal-max-width);\n }\n }\n\n & .searchcraft-popover-list-view {\n display: flex;\n flex-direction: column;\n overflow: auto;\n background-color: var(--sc-surface-neutral-secondary);\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n\n @media (min-width: $breakpoint-sm) {\n max-height: var(--sc-popover-list-view-height)\n }\n }\n\n & searchcraft-popover-list-view {\n overflow: scroll;\n\n @media (min-width: $breakpoint-sm) {\n overflow: auto;\n }\n }\n}\n\n/**\n * Styles applied to `fullscreen` popover forms.\n */\n.searchcraft-popover-form-fullscreen {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background-color: var(--sc-surface-neutral-secondary);\n\n & .searchcraft-popover-form {\n position: absolute;\n inset: 0;\n }\n\n & .searchcraft-input {\n border-radius: calc(var(--sc-popover-form-border-radius) * 0.8);\n outline-width: 1px;\n outline-color: var(--sc-border-neutral);\n }\n\n & searchcraft-popover-list-view {\n overflow: scroll;\n }\n}\n","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport classNames from 'classnames';\nimport type { SearchcraftConfig, SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\nimport type { PopoverResultMappings } from 'types';\n\n/**\n * This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-popover-form type=\"fullscreen\" />\n * ```\n *\n * ```js\n * // index.js\n * const popoverForm = document.querySelector('searchcraft-popover-form');\n *\n * popoverForm.config = {\n * index: [index_name_from_vektron],\n * readKey: 'read_key_from_vektron',\n * endpointUrl: 'enpoint_url_from_vektron',\n * };\n *\n * popoverForm.popoverResultMappings = {\n * containerHref: {\n * fieldNames: [\n * {\n * fieldName: 'canonical_link',\n * dataType: 'text',\n * },\n * ],\n * };\n * ```\n */\n@Component({\n tag: 'searchcraft-popover-form',\n styleUrl: 'searchcraft-popover-form.module.scss',\n shadow: false,\n})\nexport class SearchcraftPopoverForm {\n /**\n * The Searchcraft config object.\n */\n @Prop() config: SearchcraftConfig | undefined;\n /**\n * The type of popover form to render.\n *\n * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.\n * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.\n * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.\n */\n @Prop() type: 'inline' | 'fullscreen' | 'modal' = 'inline';\n /**\n * Formats the content rendered for each result.\n */\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /**\n * The hotkey that activates the popover.\n */\n @Prop() hotkey = 'k';\n /**\n * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.\n */\n @Prop() hotkeyModifier: 'ctrl' | 'meta' | 'alt' | 'option' = 'meta';\n\n @State() isPopoverVisibleInState = false;\n @State() unsubscribe: (() => void) | undefined;\n @State() searchResults: SearchcraftResponse | undefined;\n @State() searchTerm: string | undefined;\n @State() isFocused = false;\n @State() breakpointSm = 576;\n @State() breakpointMd = 768;\n @State() breakpointLg = 992;\n\n @State() modalElement;\n\n @Element() hostElement!: HTMLElement;\n\n componentDidLoad() {\n // Loads the breakpoint values into state\n const computedStyle = getComputedStyle(document.documentElement);\n this.breakpointSm = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-sm').trim(),\n );\n this.breakpointMd = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-md').trim(),\n );\n this.breakpointLg = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-lg').trim(),\n );\n // Set popover visiblity in state\n this.isPopoverVisibleInState =\n useSearchcraftStore.getState().isPopoverVisible;\n\n // Add event listeners\n document.addEventListener('click', this.handleDocumentClick);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n\n // Subscribe to state events\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (this.isPopoverVisibleInState !== state.isPopoverVisible) {\n this.handlePopoverVisibilityChange(state.isPopoverVisible);\n }\n\n this.searchResults = { ...state.searchResults };\n this.searchTerm = state.query;\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n document.removeEventListener('click', this.handleDocumentClick);\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n handleDocumentClick = (event: MouseEvent) => {\n if (!this.hostElement.contains(event.target as Node)) {\n this.isFocused = false;\n }\n };\n\n /**\n * Handles when popover visibility is changed in state\n */\n handlePopoverVisibilityChange(isVisible: boolean) {\n this.isPopoverVisibleInState = isVisible;\n document.body.style.overflow = isVisible ? 'hidden' : 'auto';\n }\n\n /**\n * Actions to perform when various keys are pressed within the popover form.\n */\n handleDocumentKeyDown = (event: KeyboardEvent) => {\n // Document-scoped actions\n if (event.key === this.hotkey) {\n this.handleHotkeyPressed(event);\n }\n\n // Document-scoped -> Popover-scoped keyboard event boundary\n if (!this.hostElement.contains(document.activeElement)) {\n return;\n }\n\n // Popover-scoped actions\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n this.focusOnNextListItem(event.key);\n break;\n case 'Escape':\n useSearchcraftStore.getState().setPopoverVisibility(false);\n break;\n default:\n return;\n }\n };\n\n handleInputInit = () => {\n const input = this.hostElement.querySelector('.searchcraft-input') as\n | HTMLInputElement\n | undefined;\n input?.focus();\n };\n\n /**\n * When popover is `inline` and the viewport is at the smallest breakpoint,\n * focusing on the input will open a modal version of the popover form.\n */\n handleInputFocus() {\n this.isFocused = true;\n\n if (\n this.type === 'inline' &&\n window.visualViewport.width < this.breakpointSm\n ) {\n useSearchcraftStore.getState().setPopoverVisibility(true);\n\n // Appends a popover form of type=`modal` to the body\n if (!this.modalElement) {\n this.modalElement = document.createElement('searchcraft-popover-form');\n this.modalElement.config = this.config;\n this.modalElement.popoverResultMappings = this.popoverResultMappings;\n this.modalElement.setAttribute('type', 'fullscreen');\n document.body.appendChild(this.modalElement);\n }\n }\n }\n\n handleModalBackdropClick(_event: MouseEvent) {\n useSearchcraftStore.getState().setPopoverVisibility(false);\n }\n\n /**\n * When a hotkey is pressed, tests if the modifiers also match.\n * If modifiers match, toggles visibility of the popover modal.\n */\n handleHotkeyPressed(event: KeyboardEvent) {\n if (\n (event.ctrlKey && this.hotkeyModifier === 'ctrl') ||\n (event.altKey && this.hotkeyModifier === 'alt') ||\n (event.metaKey && this.hotkeyModifier === 'meta')\n ) {\n event.preventDefault();\n if (this.type === 'inline' && !this.isPopoverVisibleInState) {\n const hostElementInput = this.hostElement.querySelector(\n '.searchcraft-input',\n ) as HTMLInputElement | undefined;\n hostElementInput?.focus();\n } else {\n useSearchcraftStore\n .getState()\n .setPopoverVisibility(!this.isPopoverVisibleInState);\n }\n }\n }\n\n handleCancelButtonClick() {\n useSearchcraftStore.getState().setPopoverVisibility(false);\n }\n\n /**\n * Moves focus to the next/previous list item in the list view. If you are at the top\n * of the list view, it moves focus back to the input.\n *\n * @param direction\n */\n focusOnNextListItem(direction: 'ArrowDown' | 'ArrowUp') {\n const listItems = Array.from(\n document.querySelectorAll<HTMLAnchorElement>(\n 'a.searchcraft-popover-list-item',\n ),\n ).filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null);\n\n const currentIndex = listItems.indexOf(\n document.activeElement as HTMLAnchorElement,\n );\n\n if (direction === 'ArrowDown') {\n listItems[(currentIndex + 1) % listItems.length]?.focus();\n } else if (direction === 'ArrowUp') {\n if (currentIndex >= 1) {\n listItems[currentIndex - 1]?.focus();\n } else {\n const input = document.querySelector('.searchcraft-input') as\n | HTMLInputElement\n | undefined;\n\n if (input) {\n input.focus();\n requestAnimationFrame(() => {\n input.selectionEnd = input.value.length;\n input.selectionStart = input.value.length;\n });\n }\n }\n }\n }\n\n get hasResultsToShow() {\n return (\n this.searchTerm?.trim()?.length > 0 &&\n this.searchResults?.data?.hits?.length > 0\n );\n }\n\n renderInlinePopover(documents: Record<string, unknown>[]) {\n const isListViewVisible = this.hasResultsToShow && this.isFocused;\n\n const popoverFormClassNames = classNames(\n 'searchcraft-popover-form searchcraft-popover-form-inline',\n {\n 'searchcraft-popover-form-active': isListViewVisible,\n },\n );\n\n return (\n <div class={popoverFormClassNames}>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n />\n {isListViewVisible && (\n <div class='searchcraft-popover-inline-wrapper-outer'>\n <div class='searchcraft-popover-inline-wrapper-inner'>\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n </div>\n </div>\n )}\n </div>\n );\n }\n\n renderModalPopover(documents: Record<string, unknown>[]) {\n if (this.isPopoverVisibleInState) {\n const popoverFormClassNames = classNames('searchcraft-popover-form', {\n 'searchcraft-popover-form-active': this.hasResultsToShow,\n });\n\n return (\n <div class='searchcraft-popover-form-modal'>\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}\n <div\n class='searchcraft-popover-form-modal-backdrop'\n onClick={this.handleModalBackdropClick}\n />\n <div class='searchcraft-popover-form-modal-inner'>\n <div class={popoverFormClassNames}>\n <div class='searchcraft-popover-form-input-wrapper'>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n onInputInit={this.handleInputInit.bind(this)}\n />\n <button\n type='button'\n class='searchcraft-popover-form-cancel-button'\n onClick={this.handleCancelButtonClick.bind(this)}\n >\n Cancel\n </button>\n </div>\n {this.hasResultsToShow && (\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n )}\n </div>\n </div>\n </div>\n );\n }\n }\n\n renderFullscreenPopover(documents: Record<string, unknown>[]) {\n if (this.isPopoverVisibleInState) {\n return (\n <div class='searchcraft-popover-form-fullscreen'>\n <div class='searchcraft-popover-form'>\n <div class='searchcraft-popover-form-input-wrapper'>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n onInputInit={this.handleInputInit.bind(this)}\n />\n <button\n type='button'\n class='searchcraft-popover-form-cancel-button'\n onClick={this.handleCancelButtonClick.bind(this)}\n >\n Cancel\n </button>\n </div>\n {this.hasResultsToShow && (\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n )}\n </div>\n </div>\n );\n }\n }\n\n render() {\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n switch (this.type) {\n case 'inline':\n return this.renderInlinePopover(documents);\n case 'modal':\n return this.renderModalPopover(documents);\n case 'fullscreen':\n return this.renderFullscreenPopover(documents);\n }\n }\n}\n"],"mappings":"qHAAA,MAAMA,EAAkC,gjPACxC,MAAAC,EAAeD,E,MCyCFE,EAAsB,MALnC,WAAAC,CAAAC,G,UAiBUC,KAAAC,KAA0C,SAQ1CD,KAAAE,OAAS,IAITF,KAAAG,eAAqD,OAEpDH,KAAAI,wBAA0B,MAI1BJ,KAAAK,UAAY,MACZL,KAAAM,aAAe,IACfN,KAAAO,aAAe,IACfP,KAAAQ,aAAe,IA2CxBR,KAAAS,oBAAuBC,IACrB,IAAKV,KAAKW,YAAYC,SAASF,EAAMG,QAAiB,CACpDb,KAAKK,UAAY,K,GAerBL,KAAAc,sBAAyBJ,IAEvB,GAAIA,EAAMK,MAAQf,KAAKE,OAAQ,CAC7BF,KAAKgB,oBAAoBN,E,CAI3B,IAAKV,KAAKW,YAAYC,SAASK,SAASC,eAAgB,CACtD,M,CAIF,OAAQR,EAAMK,KACZ,IAAK,YACL,IAAK,UACHL,EAAMS,iBACNnB,KAAKoB,oBAAoBV,EAAMK,KAC/B,MACF,IAAK,SACHM,EAAoBC,WAAWC,qBAAqB,OACpD,MACF,QACE,O,EAINvB,KAAAwB,gBAAkB,KAChB,MAAMC,EAAQzB,KAAKW,YAAYe,cAAc,sBAG7CD,IAAK,MAALA,SAAK,SAALA,EAAOE,OAAO,C,CApFhB,gBAAAC,GAEE,MAAMC,EAAgBC,iBAAiBb,SAASc,iBAChD/B,KAAKM,aAAe0B,OAAOC,WACzBJ,EAAcK,iBAAiB,sBAAsBC,QAEvDnC,KAAKO,aAAeyB,OAAOC,WACzBJ,EAAcK,iBAAiB,sBAAsBC,QAEvDnC,KAAKQ,aAAewB,OAAOC,WACzBJ,EAAcK,iBAAiB,sBAAsBC,QAGvDnC,KAAKI,wBACHiB,EAAoBC,WAAWc,iBAGjCnB,SAASoB,iBAAiB,QAAS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,iBAAa,MAAAM,SAAA,SAAAA,EAAE6C,QAAI,MAAAT,SAAA,SAAAA,EAAEU,QAAI,MAAAF,SAAA,SAAAA,EAAEiB,KAAI,CAAChB,EAAMiB,KACzC,MAAQC,IAAKC,GAAWnB,EACxB,OAAOmB,CAAM,IAGjB,OAAQhH,KAAKC,MACX,IAAK,SACH,OAAOD,KAAK+F,oBAAoBC,GAClC,IAAK,QACH,OAAOhG,KAAKwG,mBAAmBR,GACjC,IAAK,aACH,OAAOhG,KAAK2G,wBAAwBX,G","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as s,c as e,h as c,F as r}from"./p-129e6f2c.js";import{c as a}from"./p-5cdc6210.js";const n=":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}";const i=n;const t=class{constructor(c){s(this,c);this.buttonClick=e(this,"buttonClick",7);this.iconOnly=false;this.iconPosition="left";this.label="Search";this.isRequesting=false;this.handleClick=()=>{this.buttonClick.emit()}}render(){return c(r,{key:"52b95f09f5da9f281b250285623e150c5d952dce"},this.iconOnly?c("button",{class:a("searchcraft-button"),onClick:this.handleClick,type:"submit"},this.isRequesting?c("searchcraft-spinner-dark",null):this.iconElement):c("button",{class:a("searchcraft-button"),onClick:this.handleClick,type:"submit"},this.iconPosition==="left"&&this.iconElement,c("span",{class:a("buttonLabel","searchcraft-button-label")},this.label)))}};t.style=i;const o=":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}";const d=o;const p=class{constructor(e){s(this,e)}render(){return c("p",{key:"5bdc428adf6f239d66a9b0f946ee6e582de41e86",class:"searchcraft-error-message"},this.errorMessage||"Search term is required.")}};p.style=d;const h=":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}";const l=h;const u=class{constructor(e){s(this,e);this.inputLabelClassName=""}render(){return c("label",{key:"4f913c1d9027ff781725a01e71e241cb5767eadb",class:a("searchcraft-input-label",this.inputLabelClassName),htmlFor:"searchcraft-input-id"},this.label)}};u.style=l;export{t as searchcraft_button,p as searchcraft_error_message,u as searchcraft_input_label};
|
|
2
|
-
//# sourceMappingURL=p-caecdcda.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftButtonModuleCss","SearchcraftButtonStyle0","SearchcraftButton","constructor","hostRef","this","iconOnly","iconPosition","label","isRequesting","handleClick","buttonClick","emit","render","h","Fragment","key","class","classNames","onClick","type","iconElement","searchcraftErrorMessageModuleCss","SearchcraftErrorMessageStyle0","SearchcraftErrorMessage","errorMessage","searchcraftInputLabelModuleCss","SearchcraftInputLabelStyle0","SearchcraftInputLabel","inputLabelClassName","htmlFor"],"sources":["src/components/searchcraft-button/searchcraft-button.module.scss?tag=searchcraft-button","src/components/searchcraft-button/searchcraft-button.tsx","src/components/searchcraft-error-message/searchcraft-error-message.module.scss?tag=searchcraft-error-message","src/components/searchcraft-error-message/searchcraft-error-message.tsx","src/components/searchcraft-input-label/searchcraft-input-label.module.scss?tag=searchcraft-input-label","src/components/searchcraft-input-label/searchcraft-input-label.tsx"],"sourcesContent":[".searchcraft-button {\n @include body-bold;\n\n border-radius: 8px;\n display: flex;\n padding: 12px 20px;\n position: relative;\n\n background-color: var(--sc-surface-brand-primary);\n border: 1px solid var(--sc-border-primary);\n color: var(--sc-content-brand-on-primary);\n\n &:hover {\n cursor: pointer;\n background-color: var(--sc-surface-brand-primary-hover);\n }\n\n &:focus {\n outline: 2px solid var(--sc-surface-brand-primary);\n }\n}\n\n.buttonLabel {\n position: relative;\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component represents a button to be consumed within the `search-input-form` component.\n * It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.\n * It is consumed within the `searchcraft-input-form` component.\n */\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: false,\n})\nexport class SearchcraftButton {\n /**\n * The icon element.\n */\n @Prop() iconElement?: Element;\n /**\n * Should the button only display an icon.\n */\n @Prop() iconOnly = false;\n /**\n * The position of the icon.\n */\n @Prop() iconPosition = 'left';\n /**\n * The label for the button.\n */\n @Prop() label = 'Search';\n\n /**\n * When the button is clicked.\n */\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n\n private handleClick = () => {\n this.buttonClick.emit();\n };\n\n render() {\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames('searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.isRequesting ? (\n <searchcraft-spinner-dark />\n ) : (\n this.iconElement\n )}\n </button>\n ) : (\n <button\n class={classNames('searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.iconElement}\n <span class={classNames('buttonLabel', 'searchcraft-button-label')}>\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n",".searchcraft-error-message {\n @include body-small();\n color: var(--sc-content-danger);\n margin: 0;\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n/**\n * This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-error-message error-message=\"No search results found for query\" />\n * ```\n */\n@Component({\n tag: 'searchcraft-error-message',\n styleUrl: 'searchcraft-error-message.module.scss',\n shadow: false,\n})\nexport class SearchcraftErrorMessage {\n /**\n * The error message.\n */\n @Prop() errorMessage?: string;\n\n render() {\n return (\n <p class='searchcraft-error-message'>\n {this.errorMessage || 'Search term is required.'}\n </p>\n );\n }\n}\n",".searchcraft-input-label {\n @include body-small-bold();\n color: var(--sc-content-neutral-primary);\n margin-top: 4px;\n margin-bottom: 4px;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component serves as the input label for the searchcraft-input-form component.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-input-label label=\"Search\" />\n * ```\n */\n@Component({\n tag: 'searchcraft-input-label',\n styleUrl: 'searchcraft-input-label.module.scss',\n shadow: false,\n})\nexport class SearchcraftInputLabel {\n /**\n * The classname applied to the label element.\n */\n @Prop() inputLabelClassName? = '';\n @Prop() label: string;\n\n render() {\n return (\n <label\n class={classNames('searchcraft-input-label', this.inputLabelClassName)}\n htmlFor='searchcraft-input-id'\n >\n {this.label}\n </label>\n );\n }\n}\n"],"mappings":"6FAAA,MAAMA,EAA6B,66HACnC,MAAAC,EAAeD,E,MCoBFE,EAAiB,MAL9B,WAAAC,CAAAC,G,mDAaUC,KAAAC,SAAW,MAIXD,KAAAE,aAAe,OAIfF,KAAAG,MAAQ,SAOPH,KAAAI,aAAe,MAEhBJ,KAAAK,YAAc,KACpBL,KAAKM,YAAYC,MAAM,C,CAGzB,MAAAC,GACE,OACEC,EAACC,EAAQ,CAAAC,IAAA,4CACNX,KAAKC,SACJQ,EAAA,UACEG,MAAOC,EAAW,sBAClBC,QAASd,KAAKK,YACdU,KAAK,UAEJf,KAAKI,aACJK,EAAA,iCAEAT,KAAgB,aAIpBS,EAAA,UACEG,MAAOC,EAAW,sBAClBC,QAASd,KAAKK,YACdU,KAAK,UAEJf,KAAKE,eAAiB,QAAUF,KAAKgB,YACtCP,EAAA,QAAMG,MAAOC,EAAW,cAAe,6BACpCb,KAAKG,Q,aCzEpB,MAAMc,EAAmC,6kHACzC,MAAAC,EAAeD,E,MCeFE,EAAuB,M,yBAMlC,MAAAX,GACE,OACEC,EAAA,KAAAE,IAAA,2CAAGC,MAAM,6BACNZ,KAAKoB,cAAgB,2B,aCzB9B,MAAMC,EAAiC,2nHACvC,MAAAC,EAAeD,E,MCgBFE,EAAqB,MALlC,WAAAzB,CAAAC,G,UASUC,KAAAwB,oBAAuB,E,CAG/B,MAAAhB,GACE,OACEC,EAAA,SAAAE,IAAA,2CACEC,MAAOC,EAAW,0BAA2Bb,KAAKwB,qBAClDC,QAAQ,wBAEPzB,KAAKG,M","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s}from"./p-129e6f2c.js";import{u as a}from"./p-01dc5b3b.js";import{a as c}from"./p-755f491b.js";const t=":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-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-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)}";const r=t;const n=class{constructor(s){e(this,s);this.items=[];this.searchStore=a.getState()}componentDidLoad(){this.unsubscribe=a.subscribe((e=>{this.lastQuery=e.query||""}))}disconnectedCallback(){var e;(e=this.unsubscribe)===null||e===void 0?void 0:e.call(this)}handleDateRangeChanged(e,s,a){const c=new Date(s);const t=new Date(a);this.searchStore.addRangeValueForIndexField({fieldName:e,value:`${e}:[${c.toISOString()} TO ${t.toISOString()}]`});this.searchStore.search()}handleNumericRangeChanged(e,s,a){this.searchStore.addRangeValueForIndexField({fieldName:e,value:`${e}:[${s} TO ${a}]`});this.searchStore.search()}handleFacetSelectionUpdated(e,s){if(s.length>0){this.searchStore.addFacetPathsForIndexField({fieldName:e,value:`${e}: IN [${s.join(" ")}]`})}else{this.searchStore.removeFacetPathsForIndexField(e)}this.searchStore.search()}handleExactMatchToggleUpdated(e){this.searchStore.setSearchMode(e?"exact":"fuzzy");this.searchStore.search()}handleMostRecentToggleUpdated(e){this.searchStore.setSortType(e?"desc":"asc");this.searchStore.search()}render(){return s("div",{key:"43bb83b1616c00f46727c7baff2cbc013f88e111",class:"searchcraft-filter-panel"},this.items.map((e=>{switch(e.type){case"dateRange":{const a=e;const t=new Date(a.options.minDate).getTime();const r=new Date(a.options.maxDate).getTime();const n=c(a.options.granularity);return s("div",{class:"searchcraft-filter-panel-section"},s("p",{class:"searchcraft-filter-panel-label"},e.label),s("searchcraft-slider",{min:t,max:r,granularity:n,dataType:"date",onRangeChanged:e=>{this.handleDateRangeChanged(a.fieldName,e.detail.startValue,e.detail.endValue)}}))}case"numericRange":{const a=e;return s("div",{class:"searchcraft-filter-panel-section"},s("p",{class:"searchcraft-filter-panel-label"},e.label),s("searchcraft-slider",{min:a.options.min,max:a.options.max,granularity:a.options.granularity,onRangeChanged:e=>{this.handleNumericRangeChanged(a.fieldName,e.detail.startValue,e.detail.endValue)}}))}case"facets":{const a=e;return s("div",{class:"searchcraft-filter-panel-section"},s("p",{class:"searchcraft-filter-panel-label"},e.label),s("searchcraft-facet-list",{fieldName:a.fieldName,onFacetSelectionUpdated:e=>{this.handleFacetSelectionUpdated(a.fieldName,e.detail.paths)}}))}case"exactMatchToggle":{const a=e;return s("searchcraft-toggle-button",{label:a.label,subLabel:a.options.subLabel,onToggleUpdated:e=>{this.handleExactMatchToggleUpdated(e.detail)}})}case"mostRecentToggle":{const a=e;return s("searchcraft-toggle-button",{label:a.label,subLabel:a.options.subLabel,onToggleUpdated:e=>{this.handleMostRecentToggleUpdated(e.detail)}})}}})))}};n.style=r;export{n as searchcraft_filter_panel};
|
|
2
|
-
//# sourceMappingURL=p-f8129731.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftFilterPanelModuleCss","SearchcraftFilterPanelStyle0","SearchcraftFilterPanel","constructor","hostRef","this","items","searchStore","useSearchcraftStore","getState","componentDidLoad","unsubscribe","subscribe","state","lastQuery","query","disconnectedCallback","_a","call","handleDateRangeChanged","fieldName","min","max","start","Date","end","addRangeValueForIndexField","value","toISOString","search","handleNumericRangeChanged","handleFacetSelectionUpdated","paths","length","addFacetPathsForIndexField","join","removeFacetPathsForIndexField","handleExactMatchToggleUpdated","isActive","setSearchMode","handleMostRecentToggleUpdated","setSortType","render","h","key","class","map","filterItem","type","item","options","minDate","getTime","maxDate","granularityValue","getMillis","granularity","label","dataType","onRangeChanged","event","detail","startValue","endValue","onFacetSelectionUpdated","subLabel","onToggleUpdated"],"sources":["src/components/searchcraft-filter-panel/searchcraft-filter-panel.module.scss?tag=searchcraft-filter-panel","src/components/searchcraft-filter-panel/searchcraft-filter-panel.tsx"],"sourcesContent":[".searchcraft-filter-panel {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.searchcraft-filter-panel-section {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.searchcraft-filter-panel-label {\n @include body-small-bold();\n}\n","import { Component, h, Prop, State } from '@stencil/core';\nimport type {\n FilterItem,\n DateRangeFilterItem,\n NumericFilterItem,\n ExactMatchToggleFilterItem,\n FacetsFilterItem,\n} from '../../types/searchcraft-filter-panel.types';\nimport { useSearchcraftStore } from '@provider/store';\nimport { getMillis } from '@utils';\n\n/**\n * This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-filter-panel />\n * ```\n */\n@Component({\n tag: 'searchcraft-filter-panel',\n styleUrl: 'searchcraft-filter-panel.module.scss',\n shadow: false,\n})\nexport class SearchcraftFilterPanel {\n /**\n * The items to filter.\n */\n @Prop() items: FilterItem[] = [];\n\n @State() unsubscribe: (() => void) | undefined;\n @State() lastQuery: string | undefined;\n\n private searchStore = useSearchcraftStore.getState();\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (this.lastQuery !== state.query) {\n // A place to put actions to do when the query changes\n }\n this.lastQuery = state.query || '';\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n }\n\n handleDateRangeChanged(fieldName: string, min: number, max: number) {\n const start = new Date(min);\n const end = new Date(max);\n this.searchStore.addRangeValueForIndexField({\n fieldName,\n value: `${fieldName}:[${start.toISOString()} TO ${end.toISOString()}]`,\n });\n\n this.searchStore.search();\n }\n\n handleNumericRangeChanged(fieldName: string, min: number, max: number) {\n this.searchStore.addRangeValueForIndexField({\n fieldName,\n value: `${fieldName}:[${min} TO ${max}]`,\n });\n this.searchStore.search();\n }\n\n handleFacetSelectionUpdated(fieldName: string, paths: string[]) {\n if (paths.length > 0) {\n this.searchStore.addFacetPathsForIndexField({\n fieldName,\n value: `${fieldName}: IN [${paths.join(' ')}]`,\n });\n } else {\n this.searchStore.removeFacetPathsForIndexField(fieldName);\n }\n this.searchStore.search();\n }\n\n handleExactMatchToggleUpdated(isActive: boolean) {\n this.searchStore.setSearchMode(isActive ? 'exact' : 'fuzzy');\n this.searchStore.search();\n }\n\n handleMostRecentToggleUpdated(isActive: boolean) {\n this.searchStore.setSortType(isActive ? 'desc' : 'asc');\n this.searchStore.search();\n }\n\n /**\n * Iterate through `items` and render them based on `type`\n */\n render() {\n return (\n <div class='searchcraft-filter-panel'>\n {this.items.map((filterItem) => {\n switch (filterItem.type) {\n case 'dateRange': {\n const item = filterItem as DateRangeFilterItem;\n const min = new Date(item.options.minDate).getTime();\n const max = new Date(item.options.maxDate).getTime();\n const granularityValue = getMillis(item.options.granularity);\n // return date range slider\n return (\n <div class='searchcraft-filter-panel-section'>\n <p class='searchcraft-filter-panel-label'>\n {filterItem.label}\n </p>\n <searchcraft-slider\n min={min}\n max={max}\n granularity={granularityValue}\n dataType='date'\n onRangeChanged={(event) => {\n this.handleDateRangeChanged(\n item.fieldName,\n event.detail.startValue,\n event.detail.endValue,\n );\n }}\n />\n </div>\n );\n }\n case 'numericRange': {\n const item = filterItem as NumericFilterItem;\n // return date range slider\n return (\n <div class='searchcraft-filter-panel-section'>\n <p class='searchcraft-filter-panel-label'>\n {filterItem.label}\n </p>\n <searchcraft-slider\n min={item.options.min}\n max={item.options.max}\n granularity={item.options.granularity}\n onRangeChanged={(event) => {\n this.handleNumericRangeChanged(\n item.fieldName,\n event.detail.startValue,\n event.detail.endValue,\n );\n }}\n />\n </div>\n );\n }\n case 'facets': {\n const item = filterItem as FacetsFilterItem;\n // return \"filters-list\"\n return (\n <div class='searchcraft-filter-panel-section'>\n <p class='searchcraft-filter-panel-label'>\n {filterItem.label}\n </p>\n <searchcraft-facet-list\n fieldName={item.fieldName}\n onFacetSelectionUpdated={(event) => {\n this.handleFacetSelectionUpdated(\n item.fieldName,\n event.detail.paths,\n );\n }}\n />\n </div>\n );\n }\n case 'exactMatchToggle': {\n const item = filterItem as ExactMatchToggleFilterItem;\n return (\n <searchcraft-toggle-button\n label={item.label}\n subLabel={item.options.subLabel}\n onToggleUpdated={(event) => {\n this.handleExactMatchToggleUpdated(event.detail);\n }}\n />\n );\n }\n case 'mostRecentToggle': {\n const item = filterItem as ExactMatchToggleFilterItem;\n return (\n <searchcraft-toggle-button\n label={item.label}\n subLabel={item.options.subLabel}\n onToggleUpdated={(event) => {\n this.handleMostRecentToggleUpdated(event.detail);\n }}\n />\n );\n }\n }\n })}\n </div>\n );\n }\n}\n"],"mappings":"mHAAA,MAAMA,EAAkC,4sHACxC,MAAAC,EAAeD,E,MCwBFE,EAAsB,MALnC,WAAAC,CAAAC,G,UASUC,KAAAC,MAAsB,GAKtBD,KAAAE,YAAcC,EAAoBC,U,CAE1C,gBAAAC,GACEL,KAAKM,YAAcH,EAAoBI,WAAWC,IAIhDR,KAAKS,UAAYD,EAAME,OAAS,EAAE,G,CAItC,oBAAAC,G,OACEC,EAAAZ,KAAKM,eAAW,MAAAM,SAAA,SAAAA,EAAAC,KAAAb,K,CAGlB,sBAAAc,CAAuBC,EAAmBC,EAAaC,GACrD,MAAMC,EAAQ,IAAIC,KAAKH,GACvB,MAAMI,EAAM,IAAID,KAAKF,GACrBjB,KAAKE,YAAYmB,2BAA2B,CAC1CN,YACAO,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A,OAAKE,MAAM,oCACTF,EAAA,KAAGE,MAAM,kCACNE,EAAWU,OAEdd,EAAA,sBACEtB,IAAK4B,EAAKC,QAAQ7B,IAClBC,IAAK2B,EAAKC,QAAQ5B,IAClBkC,YAAaP,EAAKC,QAAQM,YAC1BG,eAAiBC,IACfvD,KAAKyB,0BACHmB,EAAK7B,UACLwC,EAAMC,OAAOC,WACbF,EAAMC,OAAOE,SACd,I,CAMX,IAAK,SAAU,CACb,MAAMd,EAAOF,EAEb,OACEJ,EAAA,OAAKE,MAAM,oCACTF,EAAA,KAAGE,MAAM,kCACNE,EAAWU,OAEdd,EAAA,0BACEvB,UAAW6B,EAAK7B,UAChB4C,wBAA0BJ,IACxBvD,KAAK0B,4BACHkB,EAAK7B,UACLwC,EAAMC,OAAO7B,MACd,I,CAMX,IAAK,mBAAoB,CACvB,MAAMiB,EAAOF,EACb,OACEJ,EAAA,6BACEc,MAAOR,EAAKQ,MACZQ,SAAUhB,EAAKC,QAAQe,SACvBC,gBAAkBN,IAChBvD,KAAKgC,8BAA8BuB,EAAMC,OAAO,G,CAKxD,IAAK,mBAAoB,CACvB,MAAMZ,EAAOF,EACb,OACEJ,EAAA,6BACEc,MAAOR,EAAKQ,MACZQ,SAAUhB,EAAKC,QAAQe,SACvBC,gBAAkBN,IAChBvD,KAAKmC,8BAA8BoB,EAAMC,OAAO,G","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as c,h as t}from"./p-129e6f2c.js";import{u as e}from"./p-01dc5b3b.js";const o="";const r=o;const s=class{constructor(t){c(this,t)}handleOnClick(){e.getState().setPopoverVisibility(true)}render(){return t("button",{key:"7885ca44b5ce619d572194d60c3b7e9d9f6666be",type:"button",onClick:this.handleOnClick.bind(this)},t("slot",{key:"0a8dc506eadbc725e3ed4c7c6987e02dfcecc229"}))}};s.style=r;export{s as searchcraft_popover_button};
|
|
2
|
-
//# sourceMappingURL=p-f839b682.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["searchcraftPopoverButtonModuleCss","SearchcraftPopoverButtonStyle0","SearchcraftPopoverButton","handleOnClick","useSearchcraftStore","getState","setPopoverVisibility","render","h","key","type","onClick","this","bind"],"sources":["src/components/searchcraft-popover-button/searchcraft-popover-button.module.scss?tag=searchcraft-popover-button","src/components/searchcraft-popover-button/searchcraft-popover-button.tsx"],"sourcesContent":[null,"import { useSearchcraftStore } from '@provider/store';\nimport { Component, h } from '@stencil/core';\n\n/**\n * Renders a button which, when clicked, turns on popover visibility.\n */\n@Component({\n tag: 'searchcraft-popover-button',\n styleUrl: 'searchcraft-popover-button.module.scss',\n shadow: false,\n})\nexport class SearchcraftPopoverButton {\n handleOnClick() {\n useSearchcraftStore.getState().setPopoverVisibility(true);\n }\n\n render() {\n return (\n <button type='button' onClick={this.handleOnClick.bind(this)}>\n <slot />\n </button>\n );\n }\n}\n"],"mappings":"+EAAA,MAAMA,EAAoC,GAC1C,MAAAC,EAAeD,E,MCUFE,EAAwB,M,yBACnC,aAAAC,GACEC,EAAoBC,WAAWC,qBAAqB,K,CAGtD,MAAAC,GACE,OACEC,EAAA,UAAAC,IAAA,2CAAQC,KAAK,SAASC,QAASC,KAAKT,cAAcU,KAAKD,OACrDJ,EAAA,QAAAC,IAAA,6C","ignoreList":[]}
|