@searchcraft/javascript-sdk 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-b76bece0.js → index-b3b77ea2.js} +2 -1
- package/dist/cjs/index-b3b77ea2.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +3 -3
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +13 -12
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-button_3.cjs.entry.js +63 -0
- package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +140 -14
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +7 -7
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +227 -0
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js +26 -0
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js +197 -3
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +32 -0
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-results-info.cjs.entry.js +5 -5
- package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -1
- package/dist/cjs/{store-943576b0.js → store-d7ebcf7a.js} +280 -267
- package/dist/cjs/store-d7ebcf7a.js.map +1 -0
- package/dist/cjs/styles-7b2d06f2.js +28 -0
- package/dist/cjs/styles-7b2d06f2.js.map +1 -0
- package/dist/cjs/units-fe4d8083.js +88 -0
- package/dist/cjs/units-fe4d8083.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +21 -16
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +54 -4
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +45 -13
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +52 -2
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +11 -6
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +52 -2
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +11 -2
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +52 -2
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +23 -4
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +52 -2
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +13 -4
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +52 -2
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +66 -49
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +1 -1
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.module.css +56 -6
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +12 -6
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +52 -2
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +25 -0
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js.map +1 -0
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +278 -5
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.module.css +322 -0
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +139 -0
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +1 -0
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.css +209 -0
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +47 -6
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +11 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +53 -3
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +13 -8
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +52 -2
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +9 -5
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +52 -2
- package/dist/collection/index.js +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/store.js +14 -15
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/types/_shared.types.js +2 -0
- package/dist/collection/types/_shared.types.js.map +1 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/collection/types/searchcraft-base-search-results.types.js.map +1 -1
- package/dist/collection/types/searchcraft-popover-form.types.js.map +1 -1
- package/dist/collection/utils/{utils.js → facets.js} +7 -105
- package/dist/collection/utils/facets.js.map +1 -0
- package/dist/collection/utils/index.js +4 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/collection/utils/styles.js +22 -0
- package/dist/collection/utils/styles.js.map +1 -0
- package/dist/collection/utils/units.js +83 -0
- package/dist/collection/utils/units.js.map +1 -0
- package/dist/components/index.js +6 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-02a16e53.js +240 -0
- package/dist/components/p-02a16e53.js.map +1 -0
- package/dist/components/{p-cbdcf6df.js → p-04c46179.js} +3 -3
- package/dist/components/p-04c46179.js.map +1 -0
- package/dist/components/p-0e38a723.js +99 -0
- package/dist/components/p-0e38a723.js.map +1 -0
- package/dist/components/p-4c45ef80.js +67 -0
- package/dist/components/p-4c45ef80.js.map +1 -0
- package/dist/components/p-755f491b.js +84 -0
- package/dist/components/p-755f491b.js.map +1 -0
- package/dist/components/p-85765b81.js +56 -0
- package/dist/components/p-85765b81.js.map +1 -0
- package/dist/components/p-953f4238.js +35 -0
- package/dist/components/p-953f4238.js.map +1 -0
- package/dist/components/p-a248ad69.js +276 -0
- package/dist/components/p-a248ad69.js.map +1 -0
- package/dist/components/p-a9bd1872.js +38 -0
- package/dist/components/p-a9bd1872.js.map +1 -0
- package/dist/components/p-cf4ced92.js +49 -0
- package/dist/components/p-cf4ced92.js.map +1 -0
- package/dist/components/{p-ad4ebde0.js → p-d6a88eed.js} +280 -267
- package/dist/components/p-d6a88eed.js.map +1 -0
- package/dist/components/p-d9551738.js +25 -0
- package/dist/components/p-d9551738.js.map +1 -0
- package/dist/components/p-f9d778b3.js +48 -0
- package/dist/components/p-f9d778b3.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +6 -5
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +8 -8
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +1 -241
- package/dist/components/searchcraft-input-form.js.map +1 -1
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-popover-button.d.ts +11 -0
- package/dist/components/searchcraft-popover-button.js +39 -0
- package/dist/components/searchcraft-popover-button.js.map +1 -0
- package/dist/components/searchcraft-popover-form.js +245 -5
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.d.ts +11 -0
- package/dist/components/searchcraft-popover-list-item.js +8 -0
- package/dist/components/searchcraft-popover-list-item.js.map +1 -0
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +3 -3
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/esm/{index-be042742.js → index-11551663.js} +2 -2
- package/dist/esm/index-11551663.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/searchcraft-base-search-result.entry.js +3 -3
- package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -1
- package/dist/esm/searchcraft-base-search-results.entry.js +5 -4
- package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
- package/dist/esm/searchcraft-button_3.entry.js +57 -0
- package/dist/esm/searchcraft-button_3.entry.js.map +1 -0
- package/dist/esm/searchcraft-facet-list_3.entry.js +137 -11
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-filter-panel.entry.js +6 -6
- package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
- package/dist/esm/searchcraft-input-form_2.entry.js +222 -0
- package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -0
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/searchcraft-popover-button.entry.js +22 -0
- package/dist/esm/searchcraft-popover-button.entry.js.map +1 -0
- package/dist/esm/searchcraft-popover-form.entry.js +197 -3
- package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-popover-list-item.entry.js +28 -0
- package/dist/esm/searchcraft-popover-list-item.entry.js.map +1 -0
- package/dist/esm/searchcraft-results-info.entry.js +4 -4
- package/dist/esm/searchcraft-results-info.entry.js.map +1 -1
- package/dist/esm/{store-eb4269d6.js → store-1058f7b0.js} +280 -267
- package/dist/esm/store-1058f7b0.js.map +1 -0
- package/dist/esm/styles-961644ef.js +25 -0
- package/dist/esm/styles-961644ef.js.map +1 -0
- package/dist/esm/units-b6eba560.js +84 -0
- package/dist/esm/units-b6eba560.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-4580e8a4.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-4580e8a4.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-7049b93d.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-7049b93d.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-755f491b.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-755f491b.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-8e539d62.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-8e539d62.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-98640a6a.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-98640a6a.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-9d0f5c89.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-9d0f5c89.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-b8bd53ce.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-b8bd53ce.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-c27a3673.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-c27a3673.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-cd852b84.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-cd852b84.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-d6a88eed.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-d6a88eed.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-d9551738.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-d9551738.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-e042deb9.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-e042deb9.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-d7d0b88c.js → p-e0be53df.js} +2 -2
- package/dist/searchcraft-javascript-sdk/{p-d7d0b88c.js.map → p-e0be53df.js.map} +1 -1
- package/dist/searchcraft-javascript-sdk/p-efab9f3c.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-efab9f3c.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +53 -0
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +68 -0
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +20 -0
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +12 -0
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +25 -0
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +12 -0
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +37 -13
- package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +13 -1
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +7 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +97 -1
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +22 -0
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +19 -3
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +10 -0
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +18 -0
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +11 -3
- package/dist/types/components.d.ts +1023 -30
- package/dist/types/index.d.ts +1 -1
- package/dist/types/provider/store.d.ts +4 -2
- package/dist/types/types/_shared.types.d.ts +45 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/searchcraft-base-search-results.types.d.ts +1 -8
- package/dist/types/types/searchcraft-popover-form.types.d.ts +2 -1
- package/dist/types/utils/facets.d.ts +6 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/styles.d.ts +2 -0
- package/dist/types/utils/{utils.d.ts → units.d.ts} +12 -19
- package/package.json +7 -4
- package/dist/cjs/index-b76bece0.js.map +0 -1
- package/dist/cjs/searchcraft-button_2.cjs.entry.js +0 -51
- package/dist/cjs/searchcraft-button_2.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-error-message.cjs.entry.js +0 -23
- package/dist/cjs/searchcraft-error-message.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-input-form.cjs.entry.js +0 -202
- package/dist/cjs/searchcraft-input-form.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-list-view.cjs.entry.js +0 -26
- package/dist/cjs/searchcraft-popover-list-view.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-result.cjs.entry.js +0 -25
- package/dist/cjs/searchcraft-popover-result.cjs.entry.js.map +0 -1
- package/dist/cjs/store-943576b0.js.map +0 -1
- package/dist/cjs/utils-a17279a2.js +0 -226
- package/dist/cjs/utils-a17279a2.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-result/searchcraft-popover-result.js +0 -21
- package/dist/collection/components/searchcraft-popover-result/searchcraft-popover-result.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/p-16983367.js +0 -35
- package/dist/components/p-16983367.js.map +0 -1
- package/dist/components/p-42bfef5f.js +0 -151
- package/dist/components/p-42bfef5f.js.map +0 -1
- package/dist/components/p-5380505b.js +0 -99
- package/dist/components/p-5380505b.js.map +0 -1
- package/dist/components/p-672354c0.js +0 -38
- package/dist/components/p-672354c0.js.map +0 -1
- package/dist/components/p-9cb3d38b.js +0 -48
- package/dist/components/p-9cb3d38b.js.map +0 -1
- package/dist/components/p-a23d2994.js +0 -67
- package/dist/components/p-a23d2994.js.map +0 -1
- package/dist/components/p-ad4ebde0.js.map +0 -1
- package/dist/components/p-bd5fede3.js +0 -41
- package/dist/components/p-bd5fede3.js.map +0 -1
- package/dist/components/p-cbdcf6df.js.map +0 -1
- package/dist/components/p-f308d05d.js +0 -218
- package/dist/components/p-f308d05d.js.map +0 -1
- package/dist/components/searchcraft-popover-result.d.ts +0 -11
- package/dist/components/searchcraft-popover-result.js +0 -38
- package/dist/components/searchcraft-popover-result.js.map +0 -1
- package/dist/esm/index-be042742.js.map +0 -1
- package/dist/esm/searchcraft-button_2.entry.js +0 -46
- package/dist/esm/searchcraft-button_2.entry.js.map +0 -1
- package/dist/esm/searchcraft-error-message.entry.js +0 -19
- package/dist/esm/searchcraft-error-message.entry.js.map +0 -1
- package/dist/esm/searchcraft-input-form.entry.js +0 -198
- package/dist/esm/searchcraft-input-form.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-list-view.entry.js +0 -22
- package/dist/esm/searchcraft-popover-list-view.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-result.entry.js +0 -21
- package/dist/esm/searchcraft-popover-result.entry.js.map +0 -1
- package/dist/esm/store-eb4269d6.js.map +0 -1
- package/dist/esm/utils-c2ce411f.js +0 -218
- package/dist/esm/utils-c2ce411f.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-04300412.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-04300412.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-09c7fbef.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-09c7fbef.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-32068485.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-32068485.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-4d3682a8.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-4d3682a8.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-61cf9d6c.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-61cf9d6c.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-93b92b65.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-93b92b65.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a7a7b4e0.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a7a7b4e0.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a810aeae.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a810aeae.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-aa155194.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-aa155194.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-ad4ebde0.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-ad4ebde0.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-adadf38a.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-adadf38a.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-d57eba31.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-d57eba31.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-f308d05d.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-f308d05d.js.map +0 -1
- package/dist/types/components/searchcraft-popover-result/searchcraft-popover-result.d.ts +0 -6
- /package/dist/collection/components/{searchcraft-popover-result/searchcraft-popover-result.module.css → searchcraft-popover-button/searchcraft-popover-button.module.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-base-search-result.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"searchcraft-base-search-result.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;GAIG;AAMH,MAAM,OAAO,2BAA2B;;QAkE9B,qBAAgB,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QAElD,uBAAkB,GAAG,GAAG,EAAE;;YAChC,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,EAAE,CAAC;YAEnE,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC;gBAChD,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;gBAChD,MAAM,mBAAmB,GACvB,CAAA,MAAA,MAAA,MAAA,IAAI,CAAC,gBAAgB,CAAC,aAAa,0CAAE,IAAI,0CAAE,IAAI,0CAAE,MAAM,KAAI,CAAC,CAAC;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IAE5B,gBAAgB,CACb,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { useSearchcraftStore } from '@provider/store';\nimport { Component, Fragment, h, Prop } from '@stencil/core';\n\n/**\n * This web component is designed to display detailed information for a single search result.\n * Once a query is submitted, the component formats and presents the result.\n * It is consumed within the `searchcraft-base-search-results` component.\n */\n@Component({\n tag: 'searchcraft-base-search-result',\n styleUrl: 'searchcraft-base-search-result.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResult {\n /**\n * The title content.\n */\n @Prop() titleContent: string | undefined;\n /**\n * The subtitle content.\n */\n @Prop() subtitleContent: string | undefined;\n /**\n * The body content.\n */\n @Prop() bodyContent: string | undefined;\n /**\n * The footer content.\n */\n @Prop() footerContent: string | undefined;\n /**\n * The label for the button rendered when containerHref is not present.\n */\n @Prop() buttonLabel: string | undefined;\n /**\n * The link for the button rendered when containerHref is not present.\n */\n @Prop() buttonHref: string | undefined;\n /**\n * Where to open the link for the button rendered when containerHref is not present.\n */\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the button rendered when containerHref is not present.\n */\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * The link for the containing element.\n */\n @Prop() containerHref: string | undefined;\n /**\n * Where to open the link for the containing element.\n */\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the containing element.\n */\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * The image source.\n */\n @Prop() imageSrc: string | undefined;\n /**\n * The image alternative text.\n */\n @Prop() imageAlt: string | undefined;\n /**\n * The placement of the image.\n */\n @Prop() imagePlacement: 'left' | 'right';\n /**\n * A custom styles object.\n */\n @Prop() customStyles: string | undefined;\n /**\n * The position in the document. Used with the \"document_clicked\" measure event.\n */\n @Prop() documentPosition = 0;\n\n private searchcraftStore = useSearchcraftStore.getState();\n\n private recordMeasureEvent = () => {\n const searchcraft = this.searchcraftStore.getSearchcraftInstance();\n\n if (searchcraft) {\n const document_position = this.documentPosition;\n const search_term = this.searchcraftStore.query;\n const number_of_documents =\n this.searchcraftStore.searchResults?.data?.hits?.length || 0;\n\n searchcraft.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n }\n };\n\n private parseStyles = (): Record<string, { [key: string]: string }> => {\n if (this.customStyles) {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n return {};\n };\n\n render() {\n const styles = this.parseStyles();\n const imageContainer = this.imageSrc && (\n <img\n alt={this.imageAlt}\n class='searchcraft-search-result-image'\n src={this.imageSrc}\n style={styles.image || {}}\n />\n );\n\n const contentContainer = (\n <Fragment>\n {this.imageSrc && this.imagePlacement === 'left' && imageContainer}\n <div class='searchcraft-base-search-result-content-container'>\n {this.titleContent && (\n <h2\n class='searchcraft-base-search-result-title'\n style={styles.title || {}}\n >\n {this.titleContent}\n </h2>\n )}\n {this.subtitleContent && (\n <h3\n class='searchcraft-base-search-result-subtitle'\n style={styles.subtitle || {}}\n >\n {this.subtitleContent}\n </h3>\n )}\n {this.bodyContent && (\n <p\n class='searchcraft-base-search-result-body-content'\n style={styles.primaryContent || {}}\n >\n {this.bodyContent}\n </p>\n )}\n\n {this.footerContent && (\n <p\n class='searchcraft-base-search-result-footer-content'\n style={styles.secondaryContent || {}}\n >\n {this.footerContent}\n </p>\n )}\n {this.buttonHref && !this.containerHref && this.buttonLabel && (\n <a\n class='searchcraft-search-result-button'\n href={this.buttonHref}\n style={styles.button || {}}\n target={this.buttonTarget}\n rel={this.buttonRel}\n >\n {this.buttonLabel}\n </a>\n )}\n </div>\n {this.imageSrc && this.imagePlacement === 'right' && imageContainer}\n </Fragment>\n );\n\n /** Render as an anchor tag if the containerHref prop is present. */\n if (this.containerHref) {\n return (\n <a\n class='searchcraft-search-result-container'\n onClick={this.recordMeasureEvent}\n href={this.containerHref}\n rel={this.containerRel}\n style={styles.container || {}}\n tabindex='0'\n target={this.containerTarget}\n >\n {contentContainer}\n </a>\n );\n }\n\n /** Render as a div if no href prop. */\n return (\n <div\n class='searchcraft-search-result-container'\n style={styles.container || {}}\n >\n {contentContainer}\n </div>\n );\n }\n}\n"]}
|
|
@@ -1,12 +1,53 @@
|
|
|
1
|
+
/** Appearance & Layout */
|
|
1
2
|
:root {
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Border radius of the input form element.
|
|
5
|
+
*/
|
|
4
6
|
--sc-input-border-radius: 8px;
|
|
7
|
+
/**
|
|
8
|
+
* Icon size of the "magnifying glass" icon rendered in the input form.
|
|
9
|
+
*/
|
|
5
10
|
--sc-input-search-icon-size: 20px;
|
|
11
|
+
/**
|
|
12
|
+
* Icon size of the `x` button rendered in the input form.
|
|
13
|
+
*/
|
|
6
14
|
--sc-input-clear-icon-size: 20px;
|
|
15
|
+
/**
|
|
16
|
+
* Padding on the left side of the input form.
|
|
17
|
+
*/
|
|
7
18
|
--sc-input-padding-left: 44px;
|
|
19
|
+
/**
|
|
20
|
+
* Padding on the right side of the input form.
|
|
21
|
+
*/
|
|
8
22
|
--sc-input-padding-right: 44px;
|
|
23
|
+
/**
|
|
24
|
+
* Border radius applied to result images.
|
|
25
|
+
*/
|
|
9
26
|
--sc-image-border-radius: 8px;
|
|
27
|
+
/**
|
|
28
|
+
* Border radius applied to popover form containers.
|
|
29
|
+
*/
|
|
30
|
+
--sc-popover-form-border-radius: 8px;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the list view/results container portion of the popover form.
|
|
33
|
+
*/
|
|
34
|
+
--sc-popover-list-view-height: 400px;
|
|
35
|
+
/**
|
|
36
|
+
* Size of images of list view items in the popoer list view.
|
|
37
|
+
*/
|
|
38
|
+
--sc-popover-list-item-image-size: 60px;
|
|
39
|
+
/**
|
|
40
|
+
* Horizontal padding of popover list items.
|
|
41
|
+
*/
|
|
42
|
+
--sc-popover-list-item-padding-horizontal: 8px;
|
|
43
|
+
/**
|
|
44
|
+
* Vertical padding of popover list items.
|
|
45
|
+
*/
|
|
46
|
+
--sc-popover-list-item-padding-vertical: 8px;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum width of popover forms of type `modal`.
|
|
49
|
+
*/
|
|
50
|
+
--sc-popover-modal-max-width: 570px;
|
|
10
51
|
}
|
|
11
52
|
|
|
12
53
|
:root {
|
|
@@ -97,6 +138,15 @@
|
|
|
97
138
|
--sc-body-small-font-weight: 400;
|
|
98
139
|
}
|
|
99
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Variables that need to be part of the preprocessor can go here.
|
|
143
|
+
*/
|
|
144
|
+
:root {
|
|
145
|
+
--sc-breakpoint-sm: 576px;
|
|
146
|
+
--sc-breakpoint-md: 768px;
|
|
147
|
+
--sc-breakpoint-lg: 992px;
|
|
148
|
+
}
|
|
149
|
+
|
|
100
150
|
.searchcraft-search-result-container {
|
|
101
151
|
all: unset;
|
|
102
152
|
align-items: flex-start;
|
|
@@ -108,7 +158,7 @@
|
|
|
108
158
|
color: inherit;
|
|
109
159
|
background-color: var(--sc-surface-neutral-primary);
|
|
110
160
|
}
|
|
111
|
-
@media (min-width:
|
|
161
|
+
@media (min-width: 768px) {
|
|
112
162
|
.searchcraft-search-result-container {
|
|
113
163
|
flex-direction: row;
|
|
114
164
|
}
|
|
@@ -130,7 +180,7 @@ a.searchcraft-search-result-container {
|
|
|
130
180
|
border-radius: var(--sc-image-border-radius);
|
|
131
181
|
width: 100%;
|
|
132
182
|
}
|
|
133
|
-
@media (min-width:
|
|
183
|
+
@media (min-width: 768px) {
|
|
134
184
|
.searchcraft-search-result-image {
|
|
135
185
|
width: 200px;
|
|
136
186
|
}
|
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import { h, } from "@stencil/core";
|
|
2
2
|
import { useSearchcraftStore } from "../../provider/store";
|
|
3
|
-
import { getDocumentValueFromSearchResultMapping, serializeStyles, } from "../../utils/
|
|
3
|
+
import { getDocumentValueFromSearchResultMapping, serializeStyles, } from "../../utils/index";
|
|
4
|
+
/**
|
|
5
|
+
* This web component is responsible for displaying the results of a search query.
|
|
6
|
+
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
7
|
+
*
|
|
8
|
+
* ## Usage
|
|
9
|
+
* ```html
|
|
10
|
+
* <!-- index.html -->
|
|
11
|
+
* <searchcraft-base-search-results
|
|
12
|
+
* ad-interval="4"
|
|
13
|
+
* place-ad-at-start="false"
|
|
14
|
+
* result-image-placement="right"
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* ```js
|
|
19
|
+
* // index.js
|
|
20
|
+
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
21
|
+
*
|
|
22
|
+
* baseSearchResults.searchResultMappings = containerHref: {
|
|
23
|
+
* fieldNames: [
|
|
24
|
+
* {
|
|
25
|
+
* fieldName: 'canonical_link',
|
|
26
|
+
* dataType: 'text',
|
|
27
|
+
* },
|
|
28
|
+
* ],
|
|
29
|
+
* };
|
|
30
|
+
*
|
|
31
|
+
* baseSearchResults.addEventListener('noResults', () => {
|
|
32
|
+
* console.log('No search results found');
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
4
36
|
export class SearchcraftBaseSearchResults {
|
|
5
37
|
constructor() {
|
|
6
38
|
this.adInterval = 4;
|
|
@@ -116,7 +148,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
116
148
|
"optional": false,
|
|
117
149
|
"docs": {
|
|
118
150
|
"tags": [],
|
|
119
|
-
"text": ""
|
|
151
|
+
"text": "How often ads are injected."
|
|
120
152
|
},
|
|
121
153
|
"attribute": "ad-interval",
|
|
122
154
|
"reflect": false,
|
|
@@ -139,7 +171,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
139
171
|
"optional": false,
|
|
140
172
|
"docs": {
|
|
141
173
|
"tags": [],
|
|
142
|
-
"text": ""
|
|
174
|
+
"text": "A custom styles object."
|
|
143
175
|
},
|
|
144
176
|
"attribute": "custom-styles-for-results",
|
|
145
177
|
"reflect": false
|
|
@@ -162,7 +194,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
162
194
|
"optional": false,
|
|
163
195
|
"docs": {
|
|
164
196
|
"tags": [],
|
|
165
|
-
"text": ""
|
|
197
|
+
"text": "Formats the content rendered for each result."
|
|
166
198
|
}
|
|
167
199
|
},
|
|
168
200
|
"placeAdAtEnd": {
|
|
@@ -177,7 +209,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
177
209
|
"optional": false,
|
|
178
210
|
"docs": {
|
|
179
211
|
"tags": [],
|
|
180
|
-
"text": ""
|
|
212
|
+
"text": "Should an ad be placed at the end of the results."
|
|
181
213
|
},
|
|
182
214
|
"attribute": "place-ad-at-end",
|
|
183
215
|
"reflect": false,
|
|
@@ -195,7 +227,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
195
227
|
"optional": false,
|
|
196
228
|
"docs": {
|
|
197
229
|
"tags": [],
|
|
198
|
-
"text": ""
|
|
230
|
+
"text": "Should an ad be placed at the start of the results."
|
|
199
231
|
},
|
|
200
232
|
"attribute": "place-ad-at-start",
|
|
201
233
|
"reflect": false,
|
|
@@ -213,7 +245,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
213
245
|
"optional": false,
|
|
214
246
|
"docs": {
|
|
215
247
|
"tags": [],
|
|
216
|
-
"text": ""
|
|
248
|
+
"text": "The placement of the image for each result."
|
|
217
249
|
},
|
|
218
250
|
"attribute": "result-image-placement",
|
|
219
251
|
"reflect": false,
|
|
@@ -231,7 +263,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
231
263
|
"optional": false,
|
|
232
264
|
"docs": {
|
|
233
265
|
"tags": [],
|
|
234
|
-
"text": ""
|
|
266
|
+
"text": "The label for the button rendered when containerHref is not present for each result."
|
|
235
267
|
},
|
|
236
268
|
"attribute": "button-label",
|
|
237
269
|
"reflect": false
|
|
@@ -248,7 +280,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
248
280
|
"optional": false,
|
|
249
281
|
"docs": {
|
|
250
282
|
"tags": [],
|
|
251
|
-
"text": ""
|
|
283
|
+
"text": "Where to open the link for the button rendered when containerHref is not present for each result."
|
|
252
284
|
},
|
|
253
285
|
"attribute": "button-target",
|
|
254
286
|
"reflect": false,
|
|
@@ -266,7 +298,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
266
298
|
"optional": false,
|
|
267
299
|
"docs": {
|
|
268
300
|
"tags": [],
|
|
269
|
-
"text": ""
|
|
301
|
+
"text": "The relationship between the current document and the link for the button rendered when containerHref is not present for each result."
|
|
270
302
|
},
|
|
271
303
|
"attribute": "button-rel",
|
|
272
304
|
"reflect": false
|
|
@@ -283,7 +315,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
283
315
|
"optional": false,
|
|
284
316
|
"docs": {
|
|
285
317
|
"tags": [],
|
|
286
|
-
"text": ""
|
|
318
|
+
"text": "Where to open the link for the containing element for each result."
|
|
287
319
|
},
|
|
288
320
|
"attribute": "container-target",
|
|
289
321
|
"reflect": false,
|
|
@@ -301,7 +333,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
301
333
|
"optional": false,
|
|
302
334
|
"docs": {
|
|
303
335
|
"tags": [],
|
|
304
|
-
"text": ""
|
|
336
|
+
"text": "The relationship between the current document and the link for the containing element for each result."
|
|
305
337
|
},
|
|
306
338
|
"attribute": "container-rel",
|
|
307
339
|
"reflect": false
|
|
@@ -324,7 +356,7 @@ export class SearchcraftBaseSearchResults {
|
|
|
324
356
|
"composed": true,
|
|
325
357
|
"docs": {
|
|
326
358
|
"tags": [],
|
|
327
|
-
"text": ""
|
|
359
|
+
"text": "When no results are returned."
|
|
328
360
|
},
|
|
329
361
|
"complexType": {
|
|
330
362
|
"original": "void",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-base-search-results.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,KAAK,EACL,IAAI,EACJ,KAAK,GAEN,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EACL,uCAAuC,EACvC,eAAe,GAChB,MAAM,cAAc,CAAC;AAQtB,MAAM,OAAO,4BAA4B;;0BAClB,CAAC;;;4BAMC,KAAK;8BACH,IAAI;oCACoB,OAAO;;4BAEQ,QAAQ;;+BAEL,QAAQ;;2BAKpD,KAAK;qBACX,EAAE;6BACkC,IAAI;;IAIzD,gBAAgB;QACd,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACzD,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YAC3B,CAAC;YACD,IAAI,CAAC,aAAa,qBAAQ,KAAK,CAAC,aAAa,CAAE,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,Q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ACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Event,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\n\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport {\n getDocumentValueFromSearchResultMapping,\n serializeStyles,\n} from '@utils/utils';\nimport type { SearchResultMappings } from 'types';\n\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResults {\n @Prop() adInterval = 4;\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>>\n | undefined;\n @Prop() searchResultMappings: SearchResultMappings | undefined;\n @Prop() placeAdAtEnd = false;\n @Prop() placeAdAtStart = true;\n @Prop() resultImagePlacement: 'left' | 'right' = 'right';\n @Prop() buttonLabel: string | undefined;\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n\n @Event() noResults: EventEmitter<void>;\n\n @State() hasSearched = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n renderDocument(document: Record<string, unknown>, index: number) {\n /**\n * Index field values -> Result container props mappings.\n */\n const titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.title,\n );\n const subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.subtitle,\n );\n const bodyContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.body,\n );\n const containerHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.containerHref,\n );\n const buttonHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.buttonHref,\n );\n const imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.imageSource,\n );\n const footerContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.footer,\n );\n\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n return (\n <searchcraft-base-search-result\n key={`${document.document_id}-${index}`}\n custom-styles={serializedStyles}\n image-placement={this.resultImagePlacement}\n container-rel={this.containerRel}\n container-target={this.containerTarget}\n button-label={this.buttonLabel || 'View more'}\n button-rel={this.buttonRel}\n button-target={this.buttonTarget}\n document-position={index}\n title-content={titleContent}\n subtitle-content={subtitleContent}\n body-content={bodyContent}\n footer-content={footerContent}\n container-href={containerHref}\n button-href={buttonHref}\n image-src={imageSource}\n />\n );\n }\n\n render() {\n if (this.query.trim() === '') {\n return (\n <div class='searchcraft-search-results-empty-state-container'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n return;\n }\n\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n documents.forEach((document, index) => {\n finalComponents.push(this.renderDocument(document, index));\n\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div\n key={`ad-section-${index + 1}`}\n class='searchcraft-ad-section '\n >\n <p>Ad Section</p>\n </div>,\n );\n }\n });\n } else {\n const documentElements = documents.map((document, index) =>\n this.renderDocument(document, index),\n );\n finalComponents.push(...documentElements);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.query.length > 0 && this.searchResults?.data?.hits?.length === 0) {\n this.noResults.emit();\n }\n\n return (\n <div class='searchcraft-search-results-container'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='searchcraft-search-results-error-message-container'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"searchcraft-base-search-results.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,KAAK,EACL,IAAI,EACJ,KAAK,GAEN,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EACL,uCAAuC,EACvC,eAAe,GAChB,MAAM,QAAQ,CAAC;AAGhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH,MAAM,OAAO,4BAA4B;;0BAIlB,CAAC;;;4BAeC,KAAK;8BAIH,IAAI;oCAIoB,OAAO;;4BAQQ,QAAQ;;+BAQL,QAAQ;;2BAWpD,KAAK;qBACX,EAAE;6B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,CAAC,IAAI,CAAA,MAAA,MAAA,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,0CAAE,IAAI,0CAAE,MAAM,MAAK,CAAC,EAAE,CAAC;YAC1E,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;QAED,OAAO,CACL,WAAK,KAAK,EAAC,sCAAsC;YAC9C,eAAe;YACf,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;gBACpB,CAAA,MAAA,MAAA,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,0CAAE,IAAI,0CAAE,MAAM,MAAK,CAAC,IAAI,CAC9C,WAAK,KAAK,EAAC,oDAAoD;gBAC7D,kDACiB,gCAAgC,IAAI,CAAC,KAAK,SAAS,GAClE,CACE,CACP,CACC,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
|
|
@@ -1,12 +1,53 @@
|
|
|
1
|
+
/** Appearance & Layout */
|
|
1
2
|
:root {
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Border radius of the input form element.
|
|
5
|
+
*/
|
|
4
6
|
--sc-input-border-radius: 8px;
|
|
7
|
+
/**
|
|
8
|
+
* Icon size of the "magnifying glass" icon rendered in the input form.
|
|
9
|
+
*/
|
|
5
10
|
--sc-input-search-icon-size: 20px;
|
|
11
|
+
/**
|
|
12
|
+
* Icon size of the `x` button rendered in the input form.
|
|
13
|
+
*/
|
|
6
14
|
--sc-input-clear-icon-size: 20px;
|
|
15
|
+
/**
|
|
16
|
+
* Padding on the left side of the input form.
|
|
17
|
+
*/
|
|
7
18
|
--sc-input-padding-left: 44px;
|
|
19
|
+
/**
|
|
20
|
+
* Padding on the right side of the input form.
|
|
21
|
+
*/
|
|
8
22
|
--sc-input-padding-right: 44px;
|
|
23
|
+
/**
|
|
24
|
+
* Border radius applied to result images.
|
|
25
|
+
*/
|
|
9
26
|
--sc-image-border-radius: 8px;
|
|
27
|
+
/**
|
|
28
|
+
* Border radius applied to popover form containers.
|
|
29
|
+
*/
|
|
30
|
+
--sc-popover-form-border-radius: 8px;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the list view/results container portion of the popover form.
|
|
33
|
+
*/
|
|
34
|
+
--sc-popover-list-view-height: 400px;
|
|
35
|
+
/**
|
|
36
|
+
* Size of images of list view items in the popoer list view.
|
|
37
|
+
*/
|
|
38
|
+
--sc-popover-list-item-image-size: 60px;
|
|
39
|
+
/**
|
|
40
|
+
* Horizontal padding of popover list items.
|
|
41
|
+
*/
|
|
42
|
+
--sc-popover-list-item-padding-horizontal: 8px;
|
|
43
|
+
/**
|
|
44
|
+
* Vertical padding of popover list items.
|
|
45
|
+
*/
|
|
46
|
+
--sc-popover-list-item-padding-vertical: 8px;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum width of popover forms of type `modal`.
|
|
49
|
+
*/
|
|
50
|
+
--sc-popover-modal-max-width: 570px;
|
|
10
51
|
}
|
|
11
52
|
|
|
12
53
|
:root {
|
|
@@ -97,6 +138,15 @@
|
|
|
97
138
|
--sc-body-small-font-weight: 400;
|
|
98
139
|
}
|
|
99
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Variables that need to be part of the preprocessor can go here.
|
|
143
|
+
*/
|
|
144
|
+
:root {
|
|
145
|
+
--sc-breakpoint-sm: 576px;
|
|
146
|
+
--sc-breakpoint-md: 768px;
|
|
147
|
+
--sc-breakpoint-lg: 992px;
|
|
148
|
+
}
|
|
149
|
+
|
|
100
150
|
.searchcraft-search-results-container {
|
|
101
151
|
display: flex;
|
|
102
152
|
flex-direction: column;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { h, Fragment, } from "@stencil/core";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
+
/**
|
|
4
|
+
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
5
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
6
|
+
* It is consumed within the `searchcraft-input-form` component.
|
|
7
|
+
*/
|
|
3
8
|
export class SearchcraftButton {
|
|
4
9
|
constructor() {
|
|
5
10
|
this.handleClick = () => {
|
|
@@ -12,7 +17,7 @@ export class SearchcraftButton {
|
|
|
12
17
|
this.isRequesting = false;
|
|
13
18
|
}
|
|
14
19
|
render() {
|
|
15
|
-
return (h(Fragment, { key: '
|
|
20
|
+
return (h(Fragment, { key: '52b95f09f5da9f281b250285623e150c5d952dce' }, this.iconOnly ? (h("button", { class: classNames('searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (h("button", { class: classNames('searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.iconElement, h("span", { class: classNames('buttonLabel', 'searchcraft-button-label') }, this.label)))));
|
|
16
21
|
}
|
|
17
22
|
static get is() { return "searchcraft-button"; }
|
|
18
23
|
static get originalStyleUrls() {
|
|
@@ -44,7 +49,7 @@ export class SearchcraftButton {
|
|
|
44
49
|
"optional": true,
|
|
45
50
|
"docs": {
|
|
46
51
|
"tags": [],
|
|
47
|
-
"text": ""
|
|
52
|
+
"text": "The icon element."
|
|
48
53
|
}
|
|
49
54
|
},
|
|
50
55
|
"iconOnly": {
|
|
@@ -59,7 +64,7 @@ export class SearchcraftButton {
|
|
|
59
64
|
"optional": false,
|
|
60
65
|
"docs": {
|
|
61
66
|
"tags": [],
|
|
62
|
-
"text": ""
|
|
67
|
+
"text": "Should the button only display an icon."
|
|
63
68
|
},
|
|
64
69
|
"attribute": "icon-only",
|
|
65
70
|
"reflect": false,
|
|
@@ -77,7 +82,7 @@ export class SearchcraftButton {
|
|
|
77
82
|
"optional": false,
|
|
78
83
|
"docs": {
|
|
79
84
|
"tags": [],
|
|
80
|
-
"text": ""
|
|
85
|
+
"text": "The position of the icon."
|
|
81
86
|
},
|
|
82
87
|
"attribute": "icon-position",
|
|
83
88
|
"reflect": false,
|
|
@@ -95,7 +100,7 @@ export class SearchcraftButton {
|
|
|
95
100
|
"optional": false,
|
|
96
101
|
"docs": {
|
|
97
102
|
"tags": [],
|
|
98
|
-
"text": ""
|
|
103
|
+
"text": "The label for the button."
|
|
99
104
|
},
|
|
100
105
|
"attribute": "label",
|
|
101
106
|
"reflect": false,
|
|
@@ -117,7 +122,7 @@ export class SearchcraftButton {
|
|
|
117
122
|
"composed": true,
|
|
118
123
|
"docs": {
|
|
119
124
|
"tags": [],
|
|
120
|
-
"text": ""
|
|
125
|
+
"text": "When the button is clicked."
|
|
121
126
|
},
|
|
122
127
|
"complexType": {
|
|
123
128
|
"original": "void",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-button.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-button/searchcraft-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,CAAC,EACD,KAAK,EACL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"searchcraft-button.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-button/searchcraft-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,CAAC,EACD,KAAK,EACL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC;;;;GAIG;AAMH,MAAM,OAAO,iBAAiB;;QAyBpB,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC,CAAC;;wBAnBiB,KAAK;4BAID,MAAM;qBAIb,QAAQ;4BAOA,KAAK;;IAM7B,MAAM;QACJ,OAAO,CACL,EAAC,QAAQ,uDACN,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,cACE,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB,mCAA4B,CAC7B,CAAC,CAAC,CAAC,CACF,IAAI,CAAC,WAAW,CACjB,CACM,CACV,CAAC,CAAC,CAAC,CACF,cACE,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ;YAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW;YACjD,YAAM,KAAK,EAAE,UAAU,CAAC,aAAa,EAAE,0BAA0B,CAAC,IAC/D,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,CACZ,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component represents a button to be consumed within the `search-input-form` component.\n * It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.\n * It is consumed within the `searchcraft-input-form` component.\n */\n@Component({\n tag: 'searchcraft-button',\n 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"]}
|
|
@@ -1,12 +1,53 @@
|
|
|
1
|
+
/** Appearance & Layout */
|
|
1
2
|
:root {
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Border radius of the input form element.
|
|
5
|
+
*/
|
|
4
6
|
--sc-input-border-radius: 8px;
|
|
7
|
+
/**
|
|
8
|
+
* Icon size of the "magnifying glass" icon rendered in the input form.
|
|
9
|
+
*/
|
|
5
10
|
--sc-input-search-icon-size: 20px;
|
|
11
|
+
/**
|
|
12
|
+
* Icon size of the `x` button rendered in the input form.
|
|
13
|
+
*/
|
|
6
14
|
--sc-input-clear-icon-size: 20px;
|
|
15
|
+
/**
|
|
16
|
+
* Padding on the left side of the input form.
|
|
17
|
+
*/
|
|
7
18
|
--sc-input-padding-left: 44px;
|
|
19
|
+
/**
|
|
20
|
+
* Padding on the right side of the input form.
|
|
21
|
+
*/
|
|
8
22
|
--sc-input-padding-right: 44px;
|
|
23
|
+
/**
|
|
24
|
+
* Border radius applied to result images.
|
|
25
|
+
*/
|
|
9
26
|
--sc-image-border-radius: 8px;
|
|
27
|
+
/**
|
|
28
|
+
* Border radius applied to popover form containers.
|
|
29
|
+
*/
|
|
30
|
+
--sc-popover-form-border-radius: 8px;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the list view/results container portion of the popover form.
|
|
33
|
+
*/
|
|
34
|
+
--sc-popover-list-view-height: 400px;
|
|
35
|
+
/**
|
|
36
|
+
* Size of images of list view items in the popoer list view.
|
|
37
|
+
*/
|
|
38
|
+
--sc-popover-list-item-image-size: 60px;
|
|
39
|
+
/**
|
|
40
|
+
* Horizontal padding of popover list items.
|
|
41
|
+
*/
|
|
42
|
+
--sc-popover-list-item-padding-horizontal: 8px;
|
|
43
|
+
/**
|
|
44
|
+
* Vertical padding of popover list items.
|
|
45
|
+
*/
|
|
46
|
+
--sc-popover-list-item-padding-vertical: 8px;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum width of popover forms of type `modal`.
|
|
49
|
+
*/
|
|
50
|
+
--sc-popover-modal-max-width: 570px;
|
|
10
51
|
}
|
|
11
52
|
|
|
12
53
|
:root {
|
|
@@ -97,6 +138,15 @@
|
|
|
97
138
|
--sc-body-small-font-weight: 400;
|
|
98
139
|
}
|
|
99
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Variables that need to be part of the preprocessor can go here.
|
|
143
|
+
*/
|
|
144
|
+
:root {
|
|
145
|
+
--sc-breakpoint-sm: 576px;
|
|
146
|
+
--sc-breakpoint-md: 768px;
|
|
147
|
+
--sc-breakpoint-lg: 992px;
|
|
148
|
+
}
|
|
149
|
+
|
|
100
150
|
.searchcraft-button {
|
|
101
151
|
font-family: var(--sc-font-family);
|
|
102
152
|
-webkit-font-smoothing: antialiased;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* ## Usage
|
|
6
|
+
* ```html
|
|
7
|
+
* <!-- index.html -->
|
|
8
|
+
* <searchcraft-error-message error-message="No search results found for query" />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
2
11
|
export class SearchcraftErrorMessage {
|
|
3
12
|
constructor() {
|
|
4
13
|
this.errorMessage = undefined;
|
|
5
14
|
}
|
|
6
15
|
render() {
|
|
7
|
-
return (h("p", { key: '
|
|
16
|
+
return (h("p", { key: '5bdc428adf6f239d66a9b0f946ee6e582de41e86', class: 'searchcraft-error-message' }, this.errorMessage || 'Search term is required.'));
|
|
8
17
|
}
|
|
9
18
|
static get is() { return "searchcraft-error-message"; }
|
|
10
19
|
static get originalStyleUrls() {
|
|
@@ -31,7 +40,7 @@ export class SearchcraftErrorMessage {
|
|
|
31
40
|
"optional": true,
|
|
32
41
|
"docs": {
|
|
33
42
|
"tags": [],
|
|
34
|
-
"text": ""
|
|
43
|
+
"text": "The error message."
|
|
35
44
|
},
|
|
36
45
|
"attribute": "error-message",
|
|
37
46
|
"reflect": false
|
package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-error-message.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-error-message/searchcraft-error-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"searchcraft-error-message.js","sourceRoot":"","sources":["../../../../src/components/searchcraft-error-message/searchcraft-error-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;GAQG;AAMH,MAAM,OAAO,uBAAuB;;;;IAMlC,MAAM;QACJ,OAAO,CACL,0DAAG,KAAK,EAAC,2BAA2B,IACjC,IAAI,CAAC,YAAY,IAAI,0BAA0B,CAC9C,CACL,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
|