@searchcraft/javascript-sdk 0.8.2 → 0.9.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 +25 -37
- package/dist/components/defineCustomElements.d.ts +1 -0
- package/dist/components/defineCustomElements.js +46 -0
- package/dist/components/index.d.ts +44 -11
- package/dist/components/index.js +104 -53
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-05872320.js +1462 -0
- package/dist/components/p-05872320.js.map +1 -0
- package/dist/components/{p-433f974c.js → p-11b05b94.js} +5 -5
- package/dist/components/p-11b05b94.js.map +1 -0
- package/dist/components/{p-ec0d230e.js → p-3568414f.js} +4 -4
- package/dist/components/p-3568414f.js.map +1 -0
- package/dist/components/{p-6e2eef88.js → p-5bd5c3cb.js} +17 -126
- package/dist/components/p-5bd5c3cb.js.map +1 -0
- package/dist/{cjs/SearchcraftStore-75fac5e0.js → components/p-6d8b0ead.js} +1408 -1350
- package/dist/components/p-6d8b0ead.js.map +1 -0
- package/dist/components/{p-fc7cda96.js → p-7777d986.js} +4 -4
- package/dist/components/{p-fc7cda96.js.map → p-7777d986.js.map} +1 -1
- package/dist/components/p-b0bc5cee.js +102 -0
- package/dist/components/p-b0bc5cee.js.map +1 -0
- package/dist/components/{p-4e9cd62e.js → p-bb12ab5a.js} +3 -3
- package/dist/components/{p-4e9cd62e.js.map → p-bb12ab5a.js.map} +1 -1
- package/dist/components/{p-97332d3e.js → p-cd9ba361.js} +3 -3
- package/dist/components/p-cd9ba361.js.map +1 -0
- package/dist/components/searchcraft-ad.d.ts +11 -0
- package/dist/components/searchcraft-ad.js +8 -0
- package/dist/components/searchcraft-ad.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +79 -29
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +9 -9
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +1 -1
- package/dist/components/searchcraft-pagination.js +2 -2
- package/dist/components/searchcraft-pagination.js.map +1 -1
- package/dist/components/searchcraft-popover-button.js +3 -3
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-form.js +28 -35
- 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 +2 -2
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-results-per-page.js +3 -3
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-theme.js +5 -5
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +19 -0
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +5 -5
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +15 -12
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +1 -1
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +6 -31
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +2 -12
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +4 -0
- package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +2 -2
- package/dist/types/components.d.ts +62 -189
- package/dist/types/index.d.ts +14 -1
- package/dist/types/store/SearchcraftStore.d.ts +4 -0
- package/dist/types/{provider → store}/SearchcraftStore.types.d.ts +2 -1
- package/dist/{collection/provider/store.js → types/store/index.d.ts} +2 -2
- package/package.json +8 -17
- package/dist/cjs/SearchcraftStore-75fac5e0.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-5b0b9d4c.js +0 -84
- package/dist/cjs/index-5b0b9d4c.js.map +0 -1
- package/dist/cjs/index-a81df4f0.js +0 -1577
- package/dist/cjs/index-a81df4f0.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -14
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/searchcraft-base-search-result_2.cjs.entry.js +0 -152
- package/dist/cjs/searchcraft-base-search-result_2.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +0 -97
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button_3.cjs.entry.js +0 -88
- package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +0 -393
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +0 -113
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +0 -260
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +0 -27
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +0 -1
- package/dist/cjs/searchcraft-pagination.cjs.entry.js +0 -106
- package/dist/cjs/searchcraft-pagination.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js +0 -22
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js +0 -234
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-list-item_2.cjs.entry.js +0 -101
- package/dist/cjs/searchcraft-popover-list-item_2.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-results-info.cjs.entry.js +0 -80
- package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-search-results-per-page.cjs.entry.js +0 -75
- package/dist/cjs/searchcraft-search-results-per-page.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-select.cjs.entry.js +0 -70
- package/dist/cjs/searchcraft-select.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-theme.cjs.entry.js +0 -56
- package/dist/cjs/searchcraft-theme.cjs.entry.js.map +0 -1
- package/dist/cjs/styles-7b2d06f2.js +0 -28
- package/dist/cjs/styles-7b2d06f2.js.map +0 -1
- package/dist/cjs/units-fe4d8083.js +0 -88
- package/dist/cjs/units-fe4d8083.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -32
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +0 -302
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.js +0 -73
- package/dist/collection/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +0 -313
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +0 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +0 -217
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +0 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +0 -44
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +0 -1
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +0 -200
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +0 -1
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +0 -149
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +0 -1
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +0 -443
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +0 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +0 -67
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +0 -1
- package/dist/collection/components/searchcraft-pagination/searchcraft-pagination.js +0 -141
- package/dist/collection/components/searchcraft-pagination/searchcraft-pagination.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +0 -15
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +0 -381
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +0 -128
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-list-item-ad/searchcraft-popover-list-item-ad.js +0 -73
- package/dist/collection/components/searchcraft-popover-list-item-ad/searchcraft-popover-list-item-ad.js.map +0 -1
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +0 -141
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js.map +0 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +0 -138
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +0 -1
- package/dist/collection/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.js +0 -129
- package/dist/collection/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.js.map +0 -1
- package/dist/collection/components/searchcraft-select/searchcraft-select.js +0 -261
- package/dist/collection/components/searchcraft-select/searchcraft-select.js.map +0 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +0 -194
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +0 -1
- package/dist/collection/components/searchcraft-theme/searchcraft-theme.js +0 -97
- package/dist/collection/components/searchcraft-theme/searchcraft-theme.js.map +0 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +0 -118
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +0 -1
- package/dist/collection/index.js +0 -3
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/provider/SearchcraftStore.js +0 -160
- package/dist/collection/provider/SearchcraftStore.js.map +0 -1
- package/dist/collection/provider/SearchcraftStore.types.js +0 -2
- package/dist/collection/provider/SearchcraftStore.types.js.map +0 -1
- package/dist/collection/provider/store.js.map +0 -1
- package/dist/collection/utils/facets.js +0 -128
- package/dist/collection/utils/facets.js.map +0 -1
- package/dist/collection/utils/index.js +0 -4
- package/dist/collection/utils/index.js.map +0 -1
- package/dist/collection/utils/styles.js +0 -22
- package/dist/collection/utils/styles.js.map +0 -1
- package/dist/collection/utils/units.js +0 -83
- package/dist/collection/utils/units.js.map +0 -1
- package/dist/components/p-25ee7496.js +0 -58
- package/dist/components/p-25ee7496.js.map +0 -1
- package/dist/components/p-38419178.js +0 -1625
- package/dist/components/p-38419178.js.map +0 -1
- package/dist/components/p-433f974c.js.map +0 -1
- package/dist/components/p-6e2eef88.js.map +0 -1
- package/dist/components/p-97332d3e.js.map +0 -1
- package/dist/components/p-bff4d3fc.js +0 -65
- package/dist/components/p-bff4d3fc.js.map +0 -1
- package/dist/components/p-de4a48b1.js +0 -65
- package/dist/components/p-de4a48b1.js.map +0 -1
- package/dist/components/p-ec0d230e.js.map +0 -1
- package/dist/components/searchcraft-base-search-result-ad.d.ts +0 -11
- package/dist/components/searchcraft-base-search-result-ad.js +0 -8
- package/dist/components/searchcraft-base-search-result-ad.js.map +0 -1
- package/dist/components/searchcraft-popover-list-item-ad.d.ts +0 -11
- package/dist/components/searchcraft-popover-list-item-ad.js +0 -8
- package/dist/components/searchcraft-popover-list-item-ad.js.map +0 -1
- package/dist/esm/SearchcraftStore-3cfd565a.js +0 -1625
- package/dist/esm/SearchcraftStore-3cfd565a.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-3608c57d.js +0 -1548
- package/dist/esm/index-3608c57d.js.map +0 -1
- package/dist/esm/index-72ac5051.js +0 -82
- package/dist/esm/index-72ac5051.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/searchcraft-base-search-result_2.entry.js +0 -147
- package/dist/esm/searchcraft-base-search-result_2.entry.js.map +0 -1
- package/dist/esm/searchcraft-base-search-results.entry.js +0 -93
- package/dist/esm/searchcraft-base-search-results.entry.js.map +0 -1
- package/dist/esm/searchcraft-button_3.entry.js +0 -82
- package/dist/esm/searchcraft-button_3.entry.js.map +0 -1
- package/dist/esm/searchcraft-facet-list_3.entry.js +0 -387
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +0 -1
- package/dist/esm/searchcraft-filter-panel.entry.js +0 -109
- package/dist/esm/searchcraft-filter-panel.entry.js.map +0 -1
- package/dist/esm/searchcraft-input-form_2.entry.js +0 -255
- package/dist/esm/searchcraft-input-form_2.entry.js.map +0 -1
- package/dist/esm/searchcraft-javascript-sdk.js +0 -22
- package/dist/esm/searchcraft-javascript-sdk.js.map +0 -1
- package/dist/esm/searchcraft-pagination.entry.js +0 -102
- package/dist/esm/searchcraft-pagination.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-button.entry.js +0 -18
- package/dist/esm/searchcraft-popover-button.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-form.entry.js +0 -230
- package/dist/esm/searchcraft-popover-form.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-list-item_2.entry.js +0 -96
- package/dist/esm/searchcraft-popover-list-item_2.entry.js.map +0 -1
- package/dist/esm/searchcraft-results-info.entry.js +0 -76
- package/dist/esm/searchcraft-results-info.entry.js.map +0 -1
- package/dist/esm/searchcraft-search-results-per-page.entry.js +0 -71
- package/dist/esm/searchcraft-search-results-per-page.entry.js.map +0 -1
- package/dist/esm/searchcraft-select.entry.js +0 -66
- package/dist/esm/searchcraft-select.entry.js.map +0 -1
- package/dist/esm/searchcraft-theme.entry.js +0 -52
- package/dist/esm/searchcraft-theme.entry.js.map +0 -1
- package/dist/esm/styles-961644ef.js +0 -25
- package/dist/esm/styles-961644ef.js.map +0 -1
- package/dist/esm/units-daaf96f5.js +0 -84
- package/dist/esm/units-daaf96f5.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -1
- package/dist/loader/index.cjs.js +0 -1
- package/dist/loader/index.d.ts +0 -24
- package/dist/loader/index.es2017.js +0 -1
- package/dist/loader/index.js +0 -2
- package/dist/loader/package.json +0 -11
- package/dist/searchcraft-javascript-sdk/index.esm.js +0 -2
- package/dist/searchcraft-javascript-sdk/index.esm.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-279f3e15.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-279f3e15.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-2bc82b48.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-2bc82b48.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-2dc07b47.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-2dc07b47.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-37842dee.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-37842dee.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-38419178.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-38419178.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-3be70f20.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-3be70f20.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +0 -7
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5e064c07.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5e064c07.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-6104fe5d.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-6104fe5d.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-6bffd3f5.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-6bffd3f5.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-7813f3cc.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-7813f3cc.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-7e13c128.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-7e13c128.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-7f4dd50c.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-7f4dd50c.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-9340f4e4.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-9340f4e4.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a84b1548.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a84b1548.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-b8ea0454.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-b8ea0454.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-c4a9d8ab.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-c4a9d8ab.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-d9551738.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-d9551738.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-e11de2d6.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-e11de2d6.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-e1255160.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +0 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +0 -1
- package/dist/types/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.d.ts +0 -14
- package/dist/types/components/searchcraft-popover-list-item-ad/searchcraft-popover-list-item-ad.d.ts +0 -14
- package/dist/types/provider/SearchcraftStore.d.ts +0 -4
- package/dist/types/provider/store.d.ts +0 -3
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-3608c57d.js';
|
|
2
|
-
import { u as useSearchcraftStore, g as ge } from './SearchcraftStore-3cfd565a.js';
|
|
3
|
-
import { p as parseCustomStyles } from './styles-961644ef.js';
|
|
4
|
-
import { c as classNames } from './index-72ac5051.js';
|
|
5
|
-
|
|
6
|
-
const name = "@searchcraft/javascript-sdk";
|
|
7
|
-
const version = "0.8.2";
|
|
8
|
-
const description = "Searchcraft Javascript SDK";
|
|
9
|
-
const author = "Searchcraft";
|
|
10
|
-
const license = "Apache-2.0";
|
|
11
|
-
const main = "dist/index.cjs.js";
|
|
12
|
-
const module = "dist/index.js";
|
|
13
|
-
const types = "dist/types/index.d.ts";
|
|
14
|
-
const collection = "dist/collection/collection-manifest.json";
|
|
15
|
-
const unpkg = "dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js";
|
|
16
|
-
const exports = {
|
|
17
|
-
".": {
|
|
18
|
-
"import": "./dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js",
|
|
19
|
-
require: "./dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.cjs.js",
|
|
20
|
-
types: "./dist/types/index.d.ts"
|
|
21
|
-
},
|
|
22
|
-
"./components": {
|
|
23
|
-
"import": "./dist/components/index.js",
|
|
24
|
-
types: "./dist/components/index.d.ts"
|
|
25
|
-
},
|
|
26
|
-
"./loader": {
|
|
27
|
-
"import": "./dist/loader/index.js",
|
|
28
|
-
require: "./dist/loader/index.cjs",
|
|
29
|
-
types: "./dist/loader/index.d.ts"
|
|
30
|
-
},
|
|
31
|
-
"./dist/components/*": {
|
|
32
|
-
"import": "./dist/components/*",
|
|
33
|
-
types: "./dist/components/*"
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const repository = {
|
|
37
|
-
type: "git",
|
|
38
|
-
url: "https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/"
|
|
39
|
-
};
|
|
40
|
-
const files = [
|
|
41
|
-
"dist/"
|
|
42
|
-
];
|
|
43
|
-
const scripts = {
|
|
44
|
-
build: "stencil build && yarn docs",
|
|
45
|
-
docs: "typedoc --options typedoc.json",
|
|
46
|
-
dev: "stencil build --dev --watch",
|
|
47
|
-
test: "stencil test --spec --e2e",
|
|
48
|
-
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
49
|
-
generate: "stencil generate"
|
|
50
|
-
};
|
|
51
|
-
const dependencies = {
|
|
52
|
-
"@stencil/vue-output-target": "^0.9.2",
|
|
53
|
-
classnames: "^2.3.2"
|
|
54
|
-
};
|
|
55
|
-
const devDependencies = {
|
|
56
|
-
"@searchcraft/core": "^0.8.2",
|
|
57
|
-
"@searchcraft/javascript-sdk": "*",
|
|
58
|
-
"@stencil/core": "^4.7.0",
|
|
59
|
-
"@stencil/react-output-target": "^0.8.2",
|
|
60
|
-
"@stencil/sass": "^3.0.12",
|
|
61
|
-
"@types/node": "^16.18.11",
|
|
62
|
-
zustand: "^5.0.1"
|
|
63
|
-
};
|
|
64
|
-
const packageJson = {
|
|
65
|
-
name: name,
|
|
66
|
-
"private": false,
|
|
67
|
-
version: version,
|
|
68
|
-
description: description,
|
|
69
|
-
author: author,
|
|
70
|
-
license: license,
|
|
71
|
-
main: main,
|
|
72
|
-
module: module,
|
|
73
|
-
types: types,
|
|
74
|
-
collection: collection,
|
|
75
|
-
"collection:main": "dist/collection/index.js",
|
|
76
|
-
unpkg: unpkg,
|
|
77
|
-
exports: exports,
|
|
78
|
-
repository: repository,
|
|
79
|
-
files: files,
|
|
80
|
-
scripts: scripts,
|
|
81
|
-
dependencies: dependencies,
|
|
82
|
-
devDependencies: devDependencies
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const SearchcraftInput = class {
|
|
86
|
-
constructor(hostRef) {
|
|
87
|
-
registerInstance(this, hostRef);
|
|
88
|
-
this.inputCleared = createEvent(this, "inputCleared", 7);
|
|
89
|
-
this.noResultsReceived = createEvent(this, "noResultsReceived", 7);
|
|
90
|
-
this.inputFocus = createEvent(this, "inputFocus", 7);
|
|
91
|
-
this.inputBlur = createEvent(this, "inputBlur", 7);
|
|
92
|
-
this.inputInit = createEvent(this, "inputInit", 7);
|
|
93
|
-
this.querySubmit = createEvent(this, "querySubmit", 7);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* The Searchcraft config object.
|
|
97
|
-
*/
|
|
98
|
-
config;
|
|
99
|
-
/**
|
|
100
|
-
* Whether or not to automatically submit the search term when the input changes.
|
|
101
|
-
*/
|
|
102
|
-
autoSearch = true;
|
|
103
|
-
/**
|
|
104
|
-
* Where to place the search button.
|
|
105
|
-
*/
|
|
106
|
-
buttonPlacement = 'none';
|
|
107
|
-
/**
|
|
108
|
-
* The label for the submit button.
|
|
109
|
-
*/
|
|
110
|
-
buttonLabel;
|
|
111
|
-
/**
|
|
112
|
-
* The label rendered above the input.
|
|
113
|
-
*/
|
|
114
|
-
inputLabel;
|
|
115
|
-
/**
|
|
116
|
-
* A custom styles object to be applied to the input element.
|
|
117
|
-
*/
|
|
118
|
-
customStyles = {};
|
|
119
|
-
/**
|
|
120
|
-
* The input element's placeholder value.
|
|
121
|
-
*/
|
|
122
|
-
placeholderValue = 'Enter Search';
|
|
123
|
-
/**
|
|
124
|
-
* The starting value of the input element.
|
|
125
|
-
*/
|
|
126
|
-
searchTerm = '';
|
|
127
|
-
/**
|
|
128
|
-
* When the input is cleared.
|
|
129
|
-
*/
|
|
130
|
-
inputCleared;
|
|
131
|
-
/**
|
|
132
|
-
* When no results are returned.
|
|
133
|
-
*/
|
|
134
|
-
noResultsReceived;
|
|
135
|
-
/**
|
|
136
|
-
* When the input becomes focused.
|
|
137
|
-
*/
|
|
138
|
-
inputFocus;
|
|
139
|
-
/**
|
|
140
|
-
* When the input becomes unfocused.
|
|
141
|
-
*/
|
|
142
|
-
inputBlur;
|
|
143
|
-
/**
|
|
144
|
-
* Event emitted when input initializes.
|
|
145
|
-
*/
|
|
146
|
-
inputInit;
|
|
147
|
-
/**
|
|
148
|
-
* Event emitted when a query has been submitted.
|
|
149
|
-
*/
|
|
150
|
-
querySubmit;
|
|
151
|
-
inputValue = this.searchTerm;
|
|
152
|
-
error = false;
|
|
153
|
-
isSearchcraftInitialized = false;
|
|
154
|
-
searchStore = useSearchcraftStore.getState();
|
|
155
|
-
init() {
|
|
156
|
-
if (this.config && !this.isSearchcraftInitialized) {
|
|
157
|
-
const searchcraft = new ge(this.config, {
|
|
158
|
-
sdkName: packageJson.name,
|
|
159
|
-
sdkVersion: packageJson.version,
|
|
160
|
-
});
|
|
161
|
-
this.searchStore.initialize(searchcraft, true);
|
|
162
|
-
this.isSearchcraftInitialized = true;
|
|
163
|
-
this.inputInit?.emit();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
componentDidLoad() {
|
|
167
|
-
this.init();
|
|
168
|
-
}
|
|
169
|
-
onConfigChange() {
|
|
170
|
-
this.init();
|
|
171
|
-
}
|
|
172
|
-
handleOnInput = (event) => {
|
|
173
|
-
const input = event.target;
|
|
174
|
-
this.inputValue = input.value;
|
|
175
|
-
if (!this.autoSearch) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
if (input.value.trim() === '') {
|
|
179
|
-
this.inputCleared?.emit();
|
|
180
|
-
}
|
|
181
|
-
this.performSearch(input.value);
|
|
182
|
-
};
|
|
183
|
-
performSearch = async (value) => {
|
|
184
|
-
if (value === useSearchcraftStore.getState().searchTerm) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
this.searchTerm = value.trim();
|
|
188
|
-
this.error = false;
|
|
189
|
-
this.searchStore.setSearchTerm(this.searchTerm);
|
|
190
|
-
this.querySubmit?.emit(this.searchTerm);
|
|
191
|
-
try {
|
|
192
|
-
await this.searchStore.search();
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
this.error = true;
|
|
196
|
-
this.inputCleared?.emit();
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
handleClearInput = () => {
|
|
200
|
-
this.inputValue = '';
|
|
201
|
-
this.searchTerm = '';
|
|
202
|
-
this.searchStore.setSearchTerm('');
|
|
203
|
-
this.searchStore.setSearchClientResponseItems([]);
|
|
204
|
-
this.error = false;
|
|
205
|
-
this.inputCleared?.emit();
|
|
206
|
-
};
|
|
207
|
-
handleFormSubmit = async (event) => {
|
|
208
|
-
event.preventDefault();
|
|
209
|
-
await this.performSearch(this.searchTerm);
|
|
210
|
-
};
|
|
211
|
-
render() {
|
|
212
|
-
const validatedCustomStyles = parseCustomStyles(this.customStyles);
|
|
213
|
-
const isShowingClearButton = this.inputValue.length > 0;
|
|
214
|
-
const inputGridClassNames = classNames('searchcraft-input-grid', {
|
|
215
|
-
'searchcraft-input-grid-buttonLeft': this.buttonPlacement === 'left',
|
|
216
|
-
'searchcraft-input-grid-buttonRight': this.buttonPlacement === 'right',
|
|
217
|
-
'searchcraft-input-grid-buttonNone': this.buttonPlacement === 'none',
|
|
218
|
-
});
|
|
219
|
-
const shouldHaveVerticalGap = this.inputLabel || this.error;
|
|
220
|
-
const inputGridStyles = {
|
|
221
|
-
gap: shouldHaveVerticalGap ? '4px 8px' : '0px 8px',
|
|
222
|
-
};
|
|
223
|
-
return (h("form", { key: 'bc665c50db8de601a3c95266bdf063ebb988d6a8', class: 'searchcraft-input-form', onSubmit: this.handleFormSubmit }, h("div", { key: 'a6936858c08d866b66b887c7ae03b35961cf04a1', class: inputGridClassNames, style: inputGridStyles }, h("div", { key: '915ac892fccb771f1c5338cd2d52f16f1793615d', class: 'searchcraft-input-button-wrapper' }, h("searchcraft-button", { key: '81447da28dcb9cb80a8cdf0c6765c909c2746585', onButtonClick: this.handleFormSubmit, label: this.buttonLabel })), this.inputLabel && (h("div", { key: '939c3407d16075be25ff23bf9b379c05ba1a66d4', class: 'searchcraft-input-label-wrapper' }, h("searchcraft-input-label", { key: '9d9c4043c04132b27710cca47abf102a188a80b9', label: this.inputLabel }))), this.error && (h("div", { key: '7e309f8a5c81a41bdd593f4e4ee1ba30c531c97d', class: 'searchcraft-input-error-wrapper' }, h("searchcraft-error-message", { key: 'de947c04f0948e36786f50ac65720eeb598ae7bf', errorMessage: 'Something went wrong.' }))), h("div", { key: 'bcf774e3fa5164ab838b634badf2002495437fe7', class: 'searchcraft-input-wrapper' }, h("input", { key: 'fd9759559712a39d3493e069ddddf7c267879c84', autoComplete: 'off', class: 'searchcraft-input', onFocus: () => this.inputFocus?.emit(), onBlur: () => this.inputBlur?.emit(), onInput: (event) => {
|
|
224
|
-
this.handleOnInput(event);
|
|
225
|
-
}, placeholder: this.placeholderValue, style: validatedCustomStyles, type: 'text', value: this.inputValue }), h("div", { key: '8564b18962feeea8d9ab8bb46af4ba28a089d8f4', class: 'searchcraft-input-search-icon-wrapper' }, h("svg", { key: '90c3636ea306ed70887d76deaf058ab3ace61134', class: 'searchcraft-input-search-icon', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { key: 'c9921263b87df28e06bab9990e324aa1bebac767', id: 'searchcraft-title' }, "Searchcraft Search Icon Light"), h("path", { key: 'bb82073fd722ff4a74e1a86c74cdf0dd9a8080b4', 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', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), isShowingClearButton && (h("button", { key: 'e708cb9426171bfdfb29e0a98206d086fa14e15e', type: 'button', class: 'searchcraft-input-clear-button', onClick: this.handleClearInput }, h("svg", { key: '243b6eacc68fa8cc57d5e11b9b317d7fe581406f', class: 'searchcraft-input-clear-icon', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { key: 'd8a8b44fe04345b5b27ba33ec4ba510500eab3bf', id: 'icon-title' }, "Searchcraft Clear Input Icon Light"), h("path", { key: '0602cbff7aac6755dabb496b84e6ef3e4e2ac7a6', 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', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))))))));
|
|
226
|
-
}
|
|
227
|
-
static get watchers() { return {
|
|
228
|
-
"config": ["onConfigChange"]
|
|
229
|
-
}; }
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const SearchcraftPopoverListView = class {
|
|
233
|
-
constructor(hostRef) {
|
|
234
|
-
registerInstance(this, hostRef);
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* The mappings that define how the data in the documents are mapped to the
|
|
238
|
-
* list-view-item elements.
|
|
239
|
-
*/
|
|
240
|
-
popoverResultMappings;
|
|
241
|
-
/**
|
|
242
|
-
* The items to render in the list view.
|
|
243
|
-
*/
|
|
244
|
-
searchClientResponseItems;
|
|
245
|
-
adClientResponseItems;
|
|
246
|
-
searchResultsPage;
|
|
247
|
-
searchResultsPerPage;
|
|
248
|
-
render() {
|
|
249
|
-
return (h("div", { key: 'a869d98e96f6fbbc80ecb79058c4753b4a3a8b1d', class: 'searchcraft-popover-list-view' }, this.adClientResponseItems?.map((item) => (h("searchcraft-popover-list-item-ad", { adClientResponseItem: item, key: item.adId }))), this.searchClientResponseItems?.map((item, index) => (h("searchcraft-popover-list-item", { item: item, key: item.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + index })))));
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
export { SearchcraftInput as searchcraft_input_form, SearchcraftPopoverListView as searchcraft_popover_list_view };
|
|
254
|
-
|
|
255
|
-
//# sourceMappingURL=searchcraft-input-form_2.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"searchcraft-input-form.searchcraft-popover-list-view.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Ca,gBAAgB;;;;;;;;;;;;;IAInB,MAAM,CAAgC;;;;IAItC,UAAU,GAAG,IAAI,CAAC;;;;IAIlB,eAAe,GAA8B,MAAM,CAAC;;;;IAIpD,WAAW,CAAqB;;;;IAIhC,UAAU,CAAqB;;;;IAI/B,YAAY,GAAoC,EAAE,CAAC;;;;IAInD,gBAAgB,GAAG,cAAc,CAAC;;;;IAIlC,UAAU,GAAG,EAAE,CAAC;;;;IAIf,YAAY,CAAsB;;;;IAIlC,iBAAiB,CAAsB;;;;IAIvC,UAAU,CAAsB;;;;IAIhC,SAAS,CAAsB;;;;IAI/B,SAAS,CAAsB;;;;IAI/B,WAAW,CAAwB;IAEnC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,KAAK,GAAG,KAAK,CAAC;IACd,wBAAwB,GAAG,KAAK,CAAC;IAElC,WAAW,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;IAErD,IAAI;QACF,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE;YACjD,MAAM,WAAW,GAAG,IAAIA,EAAe,CAAC,IAAI,CAAC,MAAM,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ACE,KAAK,EAAC,8BAA8B,EACpC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY,IAE5B,8DAAO,EAAE,EAAC,YAAY,yCAEd,EACR,6DACE,CAAC,EAAC,uIAAuI,EACzI,MAAM,EAAC,cAAc,kBACR,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACC,CACV,CACG,CACF,CACD,EACP;KACH;;;;;;MChQU,0BAA0B;;;;;;;;IAK7B,qBAAqB,CAAoC;;;;IAIzD,yBAAyB,CAAyC;IAClE,qBAAqB,CAAqC;IAC1D,iBAAiB,CAAU;IAC3B,oBAAoB,CAAU;IAEtC,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC,IAAI,MACpC,wCACE,oBAAoB,EAAE,IAAI,EAC1B,GAAG,EAAE,IAAI,CAAC,IAAI,GACd,CACH,CAAC,EACD,IAAI,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MAC/C,qCACE,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,gBAAgB,EACd,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,GAAG,KAAK,GAElE,CACH,CAAC,CACE,EACN;KACH;;;;;","names":["SearchcraftCore"],"sources":["src/components/searchcraft-input-form/searchcraft-input-form.tsx","src/components/searchcraft-popover-list-view/searchcraft-popover-list-view.tsx"],"sourcesContent":["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\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 * searchInputForm.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 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 (!this.autoSearch) {\n return;\n }\n\n if (input.value.trim() === '') {\n this.inputCleared?.emit();\n }\n\n this.performSearch(input.value);\n };\n\n private performSearch = async (value: string) => {\n if (value === useSearchcraftStore.getState().searchTerm) {\n return;\n }\n\n this.searchTerm = value.trim();\n this.error = false;\n this.searchStore.setSearchTerm(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.setSearchTerm('');\n this.searchStore.setSearchClientResponseItems([]);\n this.error = false;\n\n this.inputCleared?.emit();\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='currentColor'\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='currentColor'\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","import type {\n AdClientResponseItem,\n SearchClientResponseItem,\n} from '@searchcraft/core';\nimport { Component, h, Prop } from '@stencil/core';\n\nimport type { PopoverResultMappings } from '@searchcraft/core';\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 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 items to render in the list view.\n */\n @Prop() searchClientResponseItems: SearchClientResponseItem[] | undefined;\n @Prop() adClientResponseItems: AdClientResponseItem[] | undefined;\n @Prop() searchResultsPage!: number;\n @Prop() searchResultsPerPage!: number;\n\n render() {\n return (\n <div class='searchcraft-popover-list-view'>\n {this.adClientResponseItems?.map((item) => (\n <searchcraft-popover-list-item-ad\n adClientResponseItem={item}\n key={item.adId}\n />\n ))}\n {this.searchClientResponseItems?.map((item, index) => (\n <searchcraft-popover-list-item\n item={item}\n key={item.id}\n popoverResultMappings={this.popoverResultMappings}\n documentPosition={\n this.searchResultsPerPage * (this.searchResultsPage - 1) + index\n }\n />\n ))}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-3608c57d.js';
|
|
2
|
-
export { s as setNonce } from './index-3608c57d.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
Stencil Client Patch Browser v4.25.0 | MIT Licensed | https://stenciljs.com
|
|
7
|
-
*/
|
|
8
|
-
var patchBrowser = () => {
|
|
9
|
-
const importMeta = import.meta.url;
|
|
10
|
-
const opts = {};
|
|
11
|
-
if (importMeta !== "") {
|
|
12
|
-
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
-
}
|
|
14
|
-
return promiseResolve(opts);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
patchBrowser().then(async (options) => {
|
|
18
|
-
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["searchcraft-base-search-results",[[4,"searchcraft-base-search-results",{"customStylesForResults":[1,"custom-styles-for-results"],"searchResultMappings":[16],"resultImagePlacement":[1,"result-image-placement"],"buttonLabel":[1,"button-label"],"buttonTarget":[1,"button-target"],"buttonRel":[1,"button-rel"],"containerTarget":[1,"container-target"],"containerRel":[1,"container-rel"],"searchTerm":[32],"searchClientResponseItems":[32],"adClientResponseItems":[32],"searchResultsPerPage":[32],"searchResultsPage":[32]}]]],["searchcraft-filter-panel",[[0,"searchcraft-filter-panel",{"items":[16],"unsubscribe":[32],"lastSearchTerm":[32]}]]],["searchcraft-pagination",[[0,"searchcraft-pagination",{"customStyles":[1,"custom-styles"],"searchTerm":[32],"searchResultsPerPage":[32],"searchResultsPage":[32],"searchResultsCount":[32],"searchResultsPagesCount":[32],"searchResultsRangeMin":[32],"searchResultsRangeMax":[32],"setSearchResultsPage":[32]}]]],["searchcraft-search-results-per-page",[[0,"searchcraft-search-results-per-page",{"increment":[8],"customStyles":[1,"custom-styles"],"searchTerm":[32],"searchResultsPage":[32],"searchResultsPerPage":[32],"searchResultsCount":[32],"searchResultsPagesCount":[32],"initialSearchResultsPerPage":[32],"setSearchResultsPerPage":[32],"setSearchResultsPage":[32]}]]],["searchcraft-popover-button",[[4,"searchcraft-popover-button"]]],["searchcraft-results-info",[[0,"searchcraft-results-info",{"customFormatter":[16],"customStyles":[1,"custom-styles"],"searchTerm":[32],"searchResultsPage":[32],"searchResultsPerPage":[32],"searchResultsCount":[32],"count":[32],"range":[32],"responseTime":[32]}]]],["searchcraft-theme",[[0,"searchcraft-theme",{"theme":[1],"customTheme":[1,"custom-theme"]}]]],["searchcraft-input-form_2",[[0,"searchcraft-input-form",{"config":[16],"autoSearch":[4,"auto-search"],"buttonPlacement":[1,"button-placement"],"buttonLabel":[1,"button-label"],"inputLabel":[1,"input-label"],"customStyles":[1,"custom-styles"],"placeholderValue":[1,"placeholder-value"],"searchTerm":[1,"search-term"],"inputValue":[32],"error":[32],"isSearchcraftInitialized":[32]},null,{"config":["onConfigChange"]}],[0,"searchcraft-popover-list-view",{"popoverResultMappings":[16],"searchClientResponseItems":[16],"adClientResponseItems":[16],"searchResultsPage":[2,"search-results-page"],"searchResultsPerPage":[2,"search-results-per-page"]}]]],["searchcraft-popover-form",[[0,"searchcraft-popover-form",{"config":[16],"type":[1],"popoverResultMappings":[16],"hotkey":[1],"hotkeyModifier":[1,"hotkey-modifier"],"isPopoverVisibleInState":[32],"unsubscribe":[32],"searchClientResponseItems":[32],"adClientResponseItems":[32],"searchTerm":[32],"isFocused":[32],"breakpointSm":[32],"breakpointMd":[32],"breakpointLg":[32],"searchResultsPage":[32],"searchResultsPerPage":[32],"modalElement":[32]}]]],["searchcraft-select",[[0,"searchcraft-select",{"caption":[1],"disabled":[4],"inputId":[1,"input-id"],"label":[1],"labelId":[1,"label-id"],"name":[1],"options":[1],"customStyles":[1,"custom-styles"],"searchResultsPerPage":[32],"setSearchResultsPage":[32],"setSearchResultsPerPage":[32]}]]],["searchcraft-base-search-result_2",[[0,"searchcraft-base-search-result",{"item":[16],"searchResultMappings":[16],"containerTarget":[1,"container-target"],"containerRel":[1,"container-rel"],"buttonTarget":[1,"button-target"],"buttonRel":[1,"button-rel"],"imagePlacement":[1,"image-placement"],"customStyles":[1,"custom-styles"],"documentPosition":[2,"document-position"],"titleContent":[32],"subtitleContent":[32],"bodyContent":[32],"footerContent":[32],"buttonLabel":[32],"buttonHref":[32],"containerHref":[32],"imageSrc":[32],"imageAlt":[32]}],[0,"searchcraft-base-search-result-ad",{"adClientResponseItem":[16]}]]],["searchcraft-facet-list_3",[[0,"searchcraft-facet-list",{"fieldName":[1,"field-name"],"baseFacetRoot":[32],"facetRoot":[32],"selectedPaths":[32],"lastTimeTaken":[32],"hasNewSearchTerm":[32],"lastSearchTerm":[32],"lastSearchMode":[32],"lastSortType":[32],"unsubscribe":[32]}],[0,"searchcraft-slider",{"max":[2],"min":[2],"granularity":[2],"dataType":[1,"data-type"],"endValue":[32],"startValue":[32],"lastFocusedHandle":[32]}],[0,"searchcraft-toggle-button",{"label":[1],"subLabel":[1,"sub-label"],"isActive":[32],"unsubscribe":[32],"lastSearchTerm":[32]}]]],["searchcraft-popover-list-item_2",[[0,"searchcraft-popover-list-item",{"item":[16],"popoverResultMappings":[16],"documentPosition":[2,"document-position"],"href":[32],"imageSrc":[32],"imageAlt":[32],"titleContent":[32],"subtitleContent":[32]}],[0,"searchcraft-popover-list-item-ad",{"adClientResponseItem":[16]}]]],["searchcraft-button_3",[[0,"searchcraft-input-label",{"inputLabelClassName":[1,"input-label-class-name"],"label":[1]}],[0,"searchcraft-button",{"hierarchy":[1],"disabled":[4],"icon":[16],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"label":[1],"type":[1]}],[0,"searchcraft-error-message",{"errorMessage":[1,"error-message"]}]]]], options);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=searchcraft-javascript-sdk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"searchcraft-javascript-sdk.js","mappings":";;;;AAAA;AACA;AACA;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACrC,EAAE,MAAM,IAAI,GAAiE,EAAE,CAAC;AAChF,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AACtD,GAAG;AACH,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAM,aAAa,EAAE,CAAC;AACxB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC","names":[],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.25.0 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-3608c57d.js';
|
|
2
|
-
import { u as useSearchcraftStore } from './SearchcraftStore-3cfd565a.js';
|
|
3
|
-
import { c as classNames } from './index-72ac5051.js';
|
|
4
|
-
import { p as parseCustomStyles } from './styles-961644ef.js';
|
|
5
|
-
|
|
6
|
-
const SearchcraftPagination = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The custom styles object.
|
|
12
|
-
*/
|
|
13
|
-
customStyles;
|
|
14
|
-
// store vars
|
|
15
|
-
searchTerm;
|
|
16
|
-
searchResultsPerPage;
|
|
17
|
-
searchResultsPage;
|
|
18
|
-
searchResultsCount;
|
|
19
|
-
// local vars
|
|
20
|
-
searchResultsPagesCount = 1;
|
|
21
|
-
searchResultsRangeMin = 1;
|
|
22
|
-
searchResultsRangeMax = 1;
|
|
23
|
-
// store functions
|
|
24
|
-
setSearchResultsPage = () => { };
|
|
25
|
-
unsubscribe = () => { };
|
|
26
|
-
componentDidLoad() {
|
|
27
|
-
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
28
|
-
// store vars
|
|
29
|
-
this.searchTerm = state.searchTerm;
|
|
30
|
-
this.searchResultsPerPage = state.searchResultsPerPage;
|
|
31
|
-
this.searchResultsPage = state.searchResultsPage;
|
|
32
|
-
this.searchResultsCount = state.searchResultsCount;
|
|
33
|
-
// local vars
|
|
34
|
-
this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
|
|
35
|
-
this.searchResultsRangeMin =
|
|
36
|
-
(this.searchResultsPage - 1) * this.searchResultsPerPage + 1;
|
|
37
|
-
this.searchResultsRangeMax =
|
|
38
|
-
(this.searchResultsPerPage - 1) * this.searchResultsPerPage +
|
|
39
|
-
this.searchResultsPerPage;
|
|
40
|
-
// store functions
|
|
41
|
-
this.setSearchResultsPage = state.setSearchResultsPage;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
disconnectedCallback() {
|
|
45
|
-
this.unsubscribe?.();
|
|
46
|
-
}
|
|
47
|
-
handleGoToPage(page) {
|
|
48
|
-
this.setSearchResultsPage(page);
|
|
49
|
-
}
|
|
50
|
-
renderOddPaginationItem(page) {
|
|
51
|
-
return (h("li", null, h("button", { class: classNames('searchcraft-pagination-item', {
|
|
52
|
-
'searchcraft-pagination-item-active': this.searchResultsPage === page,
|
|
53
|
-
}), onClick: () => this.handleGoToPage(page), type: 'button' }, page)));
|
|
54
|
-
}
|
|
55
|
-
renderEvenPaginationItem(page) {
|
|
56
|
-
if (this.searchResultsPagesCount <= page) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (this.searchResultsPagesCount <= 5 ||
|
|
60
|
-
page < Math.ceil(this.searchResultsPagesCount / 2) // is the first or second even pagination item
|
|
61
|
-
? this.searchResultsPage <= page + 1
|
|
62
|
-
: this.searchResultsPage >= page - 1) {
|
|
63
|
-
return (h("li", null, h("button", { class: classNames('searchcraft-pagination-item', {
|
|
64
|
-
'searchcraft-pagination-item-active': this.searchResultsPage === page,
|
|
65
|
-
}), onClick: () => this.handleGoToPage(page), type: 'button' }, page)));
|
|
66
|
-
}
|
|
67
|
-
return (h("li", null, h("span", { class: 'searchcraft-pagination-item' }, "...")));
|
|
68
|
-
}
|
|
69
|
-
renderMiddlePaginationItem() {
|
|
70
|
-
if (this.searchResultsPagesCount <= 3) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (this.searchResultsPagesCount <= 5 ||
|
|
74
|
-
this.searchResultsPage <= 3 ||
|
|
75
|
-
this.searchResultsPage >= this.searchResultsPagesCount - 2) {
|
|
76
|
-
return (h("li", null, h("button", { class: classNames('searchcraft-pagination-item', {
|
|
77
|
-
'searchcraft-pagination-item-active': this.searchResultsPage === 3 ||
|
|
78
|
-
this.searchResultsPage === this.searchResultsPagesCount - 2,
|
|
79
|
-
}), type: 'button', onClick: () => this.handleGoToPage(this.searchResultsPage >= this.searchResultsPagesCount - 2
|
|
80
|
-
? this.searchResultsPagesCount - 2
|
|
81
|
-
: 3) }, this.searchResultsPage >= this.searchResultsPagesCount - 2
|
|
82
|
-
? this.searchResultsPagesCount - 2
|
|
83
|
-
: 3)));
|
|
84
|
-
}
|
|
85
|
-
return (h("li", null, h("span", { class: 'searchcraft-pagination-item searchcraft-pagination-item-active' }, this.searchResultsPage)));
|
|
86
|
-
}
|
|
87
|
-
render() {
|
|
88
|
-
// early return if there isn't a searchTerm or there is 1 or fewer pages of results
|
|
89
|
-
if (!this.searchTerm || this.searchResultsPagesCount <= 1) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
return (h("div", { class: classNames('searchcraft-pagination', parseCustomStyles(this.customStyles || {})) }, h("div", { class: 'searchcraft-pagination-control' }, h("searchcraft-button", { disabled: this.searchResultsPage === 1, hierarchy: 'tertiary', onButtonClick: () => this.handleGoToPage(Math.max(1, this.searchResultsPage - 1)), label: 'Previous', iconPosition: 'left', icon: h("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, h("title", null, "Previous page icon"), h("path", { d: 'M12.5 15L7.5 10L12.5 5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })), iconOnly: true })), h("ul", { class: 'searchcraft-pagination-list' }, this.renderOddPaginationItem(1), this.renderEvenPaginationItem(2), this.renderMiddlePaginationItem(), this.renderEvenPaginationItem(this.searchResultsPagesCount > 4
|
|
93
|
-
? this.searchResultsPagesCount - 1
|
|
94
|
-
: 4), this.renderOddPaginationItem(this.searchResultsPagesCount)), h("div", { class: 'searchcraft-pagination-control' }, h("searchcraft-button", { disabled: this.searchResultsPage === this.searchResultsPagesCount, hierarchy: 'tertiary', onButtonClick: () => {
|
|
95
|
-
this.handleGoToPage(Math.min(this.searchResultsPagesCount, this.searchResultsPage + 1));
|
|
96
|
-
}, label: 'Next', iconPosition: 'right', icon: h("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, h("title", null, "Next page icon"), h("path", { d: 'M7.5 15L12.5 10L7.5 5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })), iconOnly: true }))));
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export { SearchcraftPagination as searchcraft_pagination };
|
|
101
|
-
|
|
102
|
-
//# sourceMappingURL=searchcraft-pagination.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"searchcraft-pagination.entry.js","mappings":";;;;;MAoBa,qBAAqB;;;;;;;IAIxB,YAAY,CAAU;;IAGrB,UAAU,CAAC;IACX,oBAAoB,CAAC;IACrB,iBAAiB,CAAC;IAClB,kBAAkB,CAAC;;IAGnB,uBAAuB,GAAG,CAAC,CAAC;IAC5B,qBAAqB,GAAG,CAAC,CAAC;IAC1B,qBAAqB,GAAG,CAAC,CAAC;;IAG1B,oBAAoB,GAA2B,SAAQ,CAAC;IAEzD,WAAW,GAAe,SAAQ,CAAC;IAE3C,gBAAgB;QACd,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK;;YAErD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,CAAC;YACvD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,i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ACjB,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,uBAAuB,EAC5B,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAC3B,CACF,CAAC;aACH,EACD,KAAK,EAAC,MAAM,EACZ,YAAY,EAAC,OAAO,EACpB,IAAI,EACF,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,IAElC,kCAA6B,EAC7B,YACE,CAAC,EAAC,uBAAuB,EACzB,MAAM,EAAC,cAAc,kBACR,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EAER,QAAQ,SACR,CACE,CACF,EACN;KACH;;;;;","names":[],"sources":["src/components/searchcraft-pagination/searchcraft-pagination.tsx"],"sourcesContent":["import { useSearchcraftStore } from '@provider/store';\nimport { Component, h, State, Prop } from '@stencil/core';\nimport classNames from 'classnames';\n\nimport { parseCustomStyles } from '@utils';\n\n/**\n * This web component is designed to facilitate pagination of search results.\n * Once a query is submitted, calculates the number for pages.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-pagination />\n * ```\n */\n@Component({\n tag: 'searchcraft-pagination',\n shadow: false,\n})\nexport class SearchcraftPagination {\n /**\n * The custom styles object.\n */\n @Prop() customStyles?: string;\n\n // store vars\n @State() searchTerm;\n @State() searchResultsPerPage;\n @State() searchResultsPage;\n @State() searchResultsCount;\n\n // local vars\n @State() searchResultsPagesCount = 1;\n @State() searchResultsRangeMin = 1;\n @State() searchResultsRangeMax = 1;\n\n // store functions\n @State() setSearchResultsPage: (page: number) => void = () => {};\n\n private unsubscribe: () => void = () => {};\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n // store vars\n this.searchTerm = state.searchTerm;\n this.searchResultsPerPage = state.searchResultsPerPage;\n this.searchResultsPage = state.searchResultsPage;\n this.searchResultsCount = state.searchResultsCount;\n\n // local vars\n this.searchResultsPagesCount = Math.ceil(\n this.searchResultsCount / this.searchResultsPerPage,\n );\n this.searchResultsRangeMin =\n (this.searchResultsPage - 1) * this.searchResultsPerPage + 1;\n this.searchResultsRangeMax =\n (this.searchResultsPerPage - 1) * this.searchResultsPerPage +\n this.searchResultsPerPage;\n\n // store functions\n this.setSearchResultsPage = state.setSearchResultsPage;\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n }\n\n handleGoToPage(page: number) {\n this.setSearchResultsPage(page);\n }\n\n renderOddPaginationItem(page: number) {\n return (\n <li>\n <button\n class={classNames('searchcraft-pagination-item', {\n 'searchcraft-pagination-item-active':\n this.searchResultsPage === page,\n })}\n onClick={() => this.handleGoToPage(page)}\n type='button'\n >\n {page}\n </button>\n </li>\n );\n }\n\n renderEvenPaginationItem(page: number) {\n if (this.searchResultsPagesCount <= page) {\n return;\n }\n\n if (\n this.searchResultsPagesCount <= 5 ||\n page < Math.ceil(this.searchResultsPagesCount / 2) // is the first or second even pagination item\n ? this.searchResultsPage <= page + 1\n : this.searchResultsPage >= page - 1\n ) {\n return (\n <li>\n <button\n class={classNames('searchcraft-pagination-item', {\n 'searchcraft-pagination-item-active':\n this.searchResultsPage === page,\n })}\n onClick={() => this.handleGoToPage(page)}\n type='button'\n >\n {page}\n </button>\n </li>\n );\n }\n\n return (\n <li>\n <span class='searchcraft-pagination-item'>...</span>\n </li>\n );\n }\n\n renderMiddlePaginationItem() {\n if (this.searchResultsPagesCount <= 3) {\n return;\n }\n\n if (\n this.searchResultsPagesCount <= 5 ||\n this.searchResultsPage <= 3 ||\n this.searchResultsPage >= this.searchResultsPagesCount - 2\n ) {\n return (\n <li>\n <button\n class={classNames('searchcraft-pagination-item', {\n 'searchcraft-pagination-item-active':\n this.searchResultsPage === 3 ||\n this.searchResultsPage === this.searchResultsPagesCount - 2,\n })}\n type='button'\n onClick={() =>\n this.handleGoToPage(\n this.searchResultsPage >= this.searchResultsPagesCount - 2\n ? this.searchResultsPagesCount - 2\n : 3,\n )\n }\n >\n {this.searchResultsPage >= this.searchResultsPagesCount - 2\n ? this.searchResultsPagesCount - 2\n : 3}\n </button>\n </li>\n );\n }\n\n return (\n <li>\n <span class='searchcraft-pagination-item searchcraft-pagination-item-active'>\n {this.searchResultsPage}\n </span>\n </li>\n );\n }\n\n render() {\n // early return if there isn't a searchTerm or there is 1 or fewer pages of results\n if (!this.searchTerm || this.searchResultsPagesCount <= 1) {\n return;\n }\n\n return (\n <div\n class={classNames(\n 'searchcraft-pagination',\n parseCustomStyles(this.customStyles || {}),\n )}\n >\n <div class='searchcraft-pagination-control'>\n <searchcraft-button\n disabled={this.searchResultsPage === 1}\n hierarchy='tertiary'\n onButtonClick={() =>\n this.handleGoToPage(Math.max(1, this.searchResultsPage - 1))\n }\n label='Previous'\n iconPosition='left'\n icon={\n <svg\n width='20'\n height='20'\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <title>Previous page icon</title>\n <path\n d='M12.5 15L7.5 10L12.5 5'\n stroke='currentColor'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n }\n iconOnly\n />\n </div>\n <ul class='searchcraft-pagination-list'>\n {this.renderOddPaginationItem(1)}\n {this.renderEvenPaginationItem(2)}\n {this.renderMiddlePaginationItem()}\n {this.renderEvenPaginationItem(\n this.searchResultsPagesCount > 4\n ? this.searchResultsPagesCount - 1\n : 4,\n )}\n {this.renderOddPaginationItem(this.searchResultsPagesCount)}\n </ul>\n <div class='searchcraft-pagination-control'>\n <searchcraft-button\n disabled={this.searchResultsPage === this.searchResultsPagesCount}\n hierarchy='tertiary'\n onButtonClick={() => {\n this.handleGoToPage(\n Math.min(\n this.searchResultsPagesCount,\n this.searchResultsPage + 1,\n ),\n );\n }}\n label='Next'\n iconPosition='right'\n icon={\n <svg\n width='20'\n height='20'\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <title>Next page icon</title>\n <path\n d='M7.5 15L12.5 10L7.5 5'\n stroke='currentColor'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n }\n iconOnly\n />\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-3608c57d.js';
|
|
2
|
-
import { u as useSearchcraftStore } from './SearchcraftStore-3cfd565a.js';
|
|
3
|
-
|
|
4
|
-
const SearchcraftPopoverButton = class {
|
|
5
|
-
constructor(hostRef) {
|
|
6
|
-
registerInstance(this, hostRef);
|
|
7
|
-
}
|
|
8
|
-
handleOnClick() {
|
|
9
|
-
useSearchcraftStore.getState().setPopoverVisibility(true);
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return (h("button", { key: '538e1e8506bea196e6ba45482f9daa75d032462f', type: 'button', onClick: this.handleOnClick.bind(this) }, h("slot", { key: '788b70da6edcbfb283d373ada36709582ad16e51' })));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { SearchcraftPopoverButton as searchcraft_popover_button };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=searchcraft-popover-button.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"searchcraft-popover-button.entry.js","mappings":";;;MAUa,wBAAwB;;;;IACnC,aAAa;QACX,mBAAmB,CAAC,QAAQ,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;KAC3D;IAED,MAAM;QACJ,QACE,+DAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAC1D,8DAAQ,CACD,EACT;KACH;;;;;","names":[],"sources":["src/components/searchcraft-popover-button/searchcraft-popover-button.tsx"],"sourcesContent":["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 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"],"version":3}
|