@searchcraft/javascript-sdk 0.1.0 → 0.1.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/dist/cjs/index-5b0b9d4c.js +84 -0
- package/dist/cjs/index-5b0b9d4c.js.map +1 -0
- package/dist/cjs/{index-0c2339c7.js → index-e7bd239c.js} +48 -4
- package/dist/cjs/index-e7bd239c.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js +434 -0
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +64 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +18 -0
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-button.cjs.entry.js +37 -0
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/utils-cbbed1f7.js +23 -0
- package/dist/cjs/utils-cbbed1f7.js.map +1 -0
- package/dist/collection/assets/searchcraft-button-icons.js +9 -0
- package/dist/collection/assets/searchcraft-button-icons.js.map +1 -0
- package/dist/collection/assets/searchcraft-clear-icon-set.js +45 -0
- package/dist/collection/assets/searchcraft-clear-icon-set.js.map +1 -0
- package/dist/collection/assets/searchcraft-search-icon-set.js +45 -0
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +1 -0
- package/dist/collection/collection-manifest.json +16 -13
- package/dist/collection/components/{sc-auto-search-form/sc-auto-search-form.js → searchcraft-auto-search-form/searchcraft-auto-search-form.js} +58 -39
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -0
- package/dist/collection/components/{sc-auto-search-form/sc-auto-search-form.module.css → searchcraft-auto-search-form/searchcraft-auto-search-form.module.css} +3 -0
- package/dist/collection/components/{sc-base-search-form/sc-base-search-form.js → searchcraft-base-search-form/searchcraft-base-search-form.js} +6 -6
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -0
- package/dist/collection/components/{sc-base-search-result/sc-base-search-result.js → searchcraft-base-search-result/searchcraft-base-search-result.js} +7 -8
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -0
- package/dist/collection/components/{sc-base-search-results/sc-base-search-results.js → searchcraft-base-search-results/searchcraft-base-search-results.js} +7 -7
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -0
- package/dist/collection/components/{sc-button/sc-button.js → searchcraft-button/searchcraft-button.js} +6 -6
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -0
- package/dist/collection/components/{sc-clear-input-button/sc-clear-input-button.js → searchcraft-clear-input-button/searchcraft-clear-input-button.js} +6 -9
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +1 -0
- package/dist/collection/components/{sc-clear-input-button/sc-clear-input-button.module.css → searchcraft-clear-input-button/searchcraft-clear-input-button.module.css} +4 -2
- package/dist/collection/components/{sc-error-message/sc-error-message.js → searchcraft-error-message/searchcraft-error-message.js} +6 -6
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -0
- package/dist/collection/components/{sc-input/sc-input.js → searchcraft-input/searchcraft-input.js} +51 -26
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -0
- package/dist/collection/components/{sc-input/sc-input.module.css → searchcraft-input/searchcraft-input.module.css} +17 -0
- package/dist/collection/components/{sc-input-caption/sc-input-caption.js → searchcraft-input-caption/searchcraft-input-caption.js} +5 -5
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +1 -0
- package/dist/collection/components/{sc-input-icon/sc-input-icon.js → searchcraft-input-icon/searchcraft-input-icon.js} +6 -7
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +1 -0
- package/dist/collection/components/{sc-input-label/sc-input-label.js → searchcraft-input-label/searchcraft-input-label.js} +14 -11
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -0
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +19 -0
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +1 -0
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +19 -0
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +1 -0
- package/dist/collection/index.js +3 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/utils.js +17 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-04e7305e.js +44 -0
- package/dist/components/p-04e7305e.js.map +1 -0
- package/dist/components/p-0c25e95d.js +41 -0
- package/dist/components/p-0c25e95d.js.map +1 -0
- package/dist/components/p-155f7a59.js +44 -0
- package/dist/components/p-155f7a59.js.map +1 -0
- package/dist/components/p-16a533e3.js +34 -0
- package/dist/components/p-16a533e3.js.map +1 -0
- package/dist/components/p-199065b5.js +61 -0
- package/dist/components/p-199065b5.js.map +1 -0
- package/dist/components/p-1ef23e15.js +21 -0
- package/dist/components/p-1ef23e15.js.map +1 -0
- package/dist/components/p-2cc8c074.js +69 -0
- package/dist/components/p-2cc8c074.js.map +1 -0
- package/dist/components/p-83c9df48.js +76 -0
- package/dist/components/p-83c9df48.js.map +1 -0
- package/dist/components/p-8646a603.js +50 -0
- package/dist/components/p-8646a603.js.map +1 -0
- package/dist/components/p-9283a3c2.js +50 -0
- package/dist/components/p-9283a3c2.js.map +1 -0
- package/dist/components/p-a18c4969.js +135 -0
- package/dist/components/p-a18c4969.js.map +1 -0
- package/dist/components/{p-a912a224.js → p-c69651f6.js} +48 -4
- package/dist/components/p-c69651f6.js.map +1 -0
- package/dist/components/p-e8e40447.js +34 -0
- package/dist/components/p-e8e40447.js.map +1 -0
- package/dist/components/p-f83f2b59.js +62 -0
- package/dist/components/p-f83f2b59.js.map +1 -0
- package/dist/components/searchcraft-auto-search-form.d.ts +11 -0
- package/dist/components/searchcraft-auto-search-form.js +185 -0
- package/dist/components/searchcraft-auto-search-form.js.map +1 -0
- package/dist/components/searchcraft-base-search-form.d.ts +11 -0
- package/dist/components/searchcraft-base-search-form.js +153 -0
- package/dist/components/searchcraft-base-search-form.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.d.ts +11 -0
- package/dist/components/searchcraft-base-search-result.js +8 -0
- package/dist/components/searchcraft-base-search-result.js.map +1 -0
- package/dist/components/searchcraft-base-search-results.d.ts +11 -0
- package/dist/components/searchcraft-base-search-results.js +89 -0
- package/dist/components/searchcraft-base-search-results.js.map +1 -0
- package/dist/components/searchcraft-button-icon.d.ts +11 -0
- package/dist/components/searchcraft-button-icon.js +33 -0
- package/dist/components/searchcraft-button-icon.js.map +1 -0
- package/dist/components/{sc-base-search-form.d.ts → searchcraft-button.d.ts} +4 -4
- package/dist/components/searchcraft-button.js +8 -0
- package/dist/components/searchcraft-button.js.map +1 -0
- package/dist/components/searchcraft-clear-icon-set.d.ts +11 -0
- package/dist/components/searchcraft-clear-icon-set.js +8 -0
- package/dist/components/searchcraft-clear-icon-set.js.map +1 -0
- package/dist/components/searchcraft-clear-input-button.d.ts +11 -0
- package/dist/components/searchcraft-clear-input-button.js +8 -0
- package/dist/components/searchcraft-clear-input-button.js.map +1 -0
- package/dist/components/searchcraft-error-message.d.ts +11 -0
- package/dist/components/searchcraft-error-message.js +8 -0
- package/dist/components/searchcraft-error-message.js.map +1 -0
- package/dist/components/searchcraft-input-caption.d.ts +11 -0
- package/dist/components/searchcraft-input-caption.js +8 -0
- package/dist/components/searchcraft-input-caption.js.map +1 -0
- package/dist/components/searchcraft-input-icon.d.ts +11 -0
- package/dist/components/searchcraft-input-icon.js +8 -0
- package/dist/components/searchcraft-input-icon.js.map +1 -0
- package/dist/components/searchcraft-input-label.d.ts +11 -0
- package/dist/components/searchcraft-input-label.js +8 -0
- package/dist/components/searchcraft-input-label.js.map +1 -0
- package/dist/components/{sc-auto-search-form.d.ts → searchcraft-input.d.ts} +4 -4
- package/dist/components/searchcraft-input.js +8 -0
- package/dist/components/searchcraft-input.js.map +1 -0
- package/dist/components/searchcraft-search-icon-set.d.ts +11 -0
- package/dist/components/searchcraft-search-icon-set.js +8 -0
- package/dist/components/searchcraft-search-icon-set.js.map +1 -0
- package/dist/components/searchcraft-spinner-dark.d.ts +11 -0
- package/dist/components/searchcraft-spinner-dark.js +8 -0
- package/dist/components/searchcraft-spinner-dark.js.map +1 -0
- package/dist/components/searchcraft-spinner-light.d.ts +11 -0
- package/dist/components/searchcraft-spinner-light.js +8 -0
- package/dist/components/searchcraft-spinner-light.js.map +1 -0
- package/dist/esm/{index-c97f8c28.js → index-0d9f850d.js} +48 -4
- package/dist/esm/index-0d9f850d.js.map +1 -0
- package/dist/esm/index-72ac5051.js +82 -0
- package/dist/esm/index-72ac5051.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/searchcraft-auto-search-form_13.entry.js +418 -0
- package/dist/esm/searchcraft-auto-search-form_13.entry.js.map +1 -0
- package/dist/esm/searchcraft-base-search-form.entry.js +60 -0
- package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -0
- package/dist/esm/searchcraft-button-icon.entry.js +14 -0
- package/dist/esm/searchcraft-button-icon.entry.js.map +1 -0
- package/dist/esm/searchcraft-button.entry.js +33 -0
- package/dist/esm/searchcraft-button.entry.js.map +1 -0
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/utils-f221d91f.js +21 -0
- package/dist/esm/utils-f221d91f.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-0a8c2538.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-0a8c2538.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-1ef23e15.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-1ef23e15.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-329c3f66.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-329c3f66.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-40791ead.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-40791ead.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-4d18a44a.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-4d18a44a.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +7 -0
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-c0cb5bb1.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-c0cb5bb1.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/assets/searchcraft-button-icons.d.ts +3 -0
- package/dist/types/assets/searchcraft-clear-icon-set.d.ts +8 -0
- package/dist/types/assets/searchcraft-search-icon-set.d.ts +8 -0
- package/dist/types/components/{sc-auto-search-form/sc-auto-search-form.d.ts → searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts} +4 -18
- package/dist/types/components/{sc-base-search-form/sc-base-search-form.d.ts → searchcraft-base-search-form/searchcraft-base-search-form.d.ts} +2 -2
- package/dist/types/components/{sc-base-search-result/sc-base-search-result.d.ts → searchcraft-base-search-result/searchcraft-base-search-result.d.ts} +1 -1
- package/dist/types/components/{sc-base-search-results/sc-base-search-results.d.ts → searchcraft-base-search-results/searchcraft-base-search-results.d.ts} +1 -1
- package/dist/types/components/{sc-button/sc-button.d.ts → searchcraft-button/searchcraft-button.d.ts} +1 -1
- package/dist/types/components/{sc-clear-input-button/sc-clear-input-button.d.ts → searchcraft-clear-input-button/searchcraft-clear-input-button.d.ts} +1 -1
- package/dist/types/components/{sc-error-message/sc-error-message.d.ts → searchcraft-error-message/searchcraft-error-message.d.ts} +1 -1
- package/dist/types/components/{sc-input/sc-input.d.ts → searchcraft-input/searchcraft-input.d.ts} +4 -3
- package/dist/types/components/{sc-input-caption/sc-input-caption.d.ts → searchcraft-input-caption/searchcraft-input-caption.d.ts} +1 -1
- package/dist/types/components/{sc-input-icon/sc-input-icon.d.ts → searchcraft-input-icon/searchcraft-input-icon.d.ts} +1 -1
- package/dist/types/components/{sc-input-label/sc-input-label.d.ts → searchcraft-input-label/searchcraft-input-label.d.ts} +2 -2
- package/dist/types/components/searchcraft-spinner-dark/searchcraft-spinner-dark.d.ts +3 -0
- package/dist/types/components/searchcraft-spinner-light/searchcraft-spinner-light.d.ts +3 -0
- package/dist/types/components.d.ts +209 -153
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +6 -0
- package/package.json +1 -1
- package/dist/cjs/index-0c2339c7.js.map +0 -1
- package/dist/cjs/sc-auto-search-form.cjs.entry.js +0 -101
- package/dist/cjs/sc-auto-search-form.cjs.entry.js.map +0 -1
- package/dist/cjs/sc-base-search-form_11.cjs.entry.js +0 -471
- package/dist/cjs/sc-base-search-form_11.cjs.entry.js.map +0 -1
- package/dist/cjs/sc-spinner-light-a3bfc8e6.js +0 -20
- package/dist/cjs/sc-spinner-light-a3bfc8e6.js.map +0 -1
- package/dist/cjs/sc-spinner-light.cjs.entry.js +0 -12
- package/dist/cjs/sc-spinner-light.cjs.entry.js.map +0 -1
- package/dist/collection/assets/ButtonIcons.js +0 -3
- package/dist/collection/assets/ButtonIcons.js.map +0 -1
- package/dist/collection/assets/ClearInputIcon.js +0 -6
- package/dist/collection/assets/ClearInputIcon.js.map +0 -1
- package/dist/collection/assets/SearchIcons.js +0 -6
- package/dist/collection/assets/SearchIcons.js.map +0 -1
- package/dist/collection/components/sc-auto-search-form/sc-auto-search-form.js.map +0 -1
- package/dist/collection/components/sc-base-search-form/sc-base-search-form.js.map +0 -1
- package/dist/collection/components/sc-base-search-result/sc-base-search-result.js.map +0 -1
- package/dist/collection/components/sc-base-search-results/sc-base-search-results.js.map +0 -1
- package/dist/collection/components/sc-button/sc-button.js.map +0 -1
- package/dist/collection/components/sc-clear-input-button/sc-clear-input-button.js.map +0 -1
- package/dist/collection/components/sc-error-message/sc-error-message.js.map +0 -1
- package/dist/collection/components/sc-input/sc-input.js.map +0 -1
- package/dist/collection/components/sc-input-caption/sc-input-caption.js.map +0 -1
- package/dist/collection/components/sc-input-icon/sc-input-icon.js.map +0 -1
- package/dist/collection/components/sc-input-label/sc-input-label.js.map +0 -1
- package/dist/collection/components/sc-spinner-dark/sc-spinner-dark.js +0 -19
- package/dist/collection/components/sc-spinner-dark/sc-spinner-dark.js.map +0 -1
- package/dist/collection/components/sc-spinner-light/sc-spinner-light.js +0 -19
- package/dist/collection/components/sc-spinner-light/sc-spinner-light.js.map +0 -1
- package/dist/components/p-074239f9.js +0 -34
- package/dist/components/p-074239f9.js.map +0 -1
- package/dist/components/p-184d9504.js +0 -61
- package/dist/components/p-184d9504.js.map +0 -1
- package/dist/components/p-23bdbb1f.js +0 -58
- package/dist/components/p-23bdbb1f.js.map +0 -1
- package/dist/components/p-255a89f7.js +0 -62
- package/dist/components/p-255a89f7.js.map +0 -1
- package/dist/components/p-5410e357.js +0 -108
- package/dist/components/p-5410e357.js.map +0 -1
- package/dist/components/p-5b7b903a.js +0 -71
- package/dist/components/p-5b7b903a.js.map +0 -1
- package/dist/components/p-75be555b.js +0 -54
- package/dist/components/p-75be555b.js.map +0 -1
- package/dist/components/p-79564f07.js +0 -41
- package/dist/components/p-79564f07.js.map +0 -1
- package/dist/components/p-a912a224.js.map +0 -1
- package/dist/components/p-b05f23e3.js +0 -18
- package/dist/components/p-b05f23e3.js.map +0 -1
- package/dist/components/p-c47cb37f.js +0 -46
- package/dist/components/p-c47cb37f.js.map +0 -1
- package/dist/components/p-c54fdecb.js +0 -164
- package/dist/components/p-c54fdecb.js.map +0 -1
- package/dist/components/p-dfb43eea.js +0 -34
- package/dist/components/p-dfb43eea.js.map +0 -1
- package/dist/components/sc-auto-search-form.js +0 -152
- package/dist/components/sc-auto-search-form.js.map +0 -1
- package/dist/components/sc-base-search-form.js +0 -135
- package/dist/components/sc-base-search-form.js.map +0 -1
- package/dist/components/sc-base-search-result.d.ts +0 -11
- package/dist/components/sc-base-search-result.js +0 -8
- package/dist/components/sc-base-search-result.js.map +0 -1
- package/dist/components/sc-base-search-results.d.ts +0 -11
- package/dist/components/sc-base-search-results.js +0 -83
- package/dist/components/sc-base-search-results.js.map +0 -1
- package/dist/components/sc-button.d.ts +0 -11
- package/dist/components/sc-button.js +0 -8
- package/dist/components/sc-button.js.map +0 -1
- package/dist/components/sc-clear-input-button.d.ts +0 -11
- package/dist/components/sc-clear-input-button.js +0 -8
- package/dist/components/sc-clear-input-button.js.map +0 -1
- package/dist/components/sc-error-message.d.ts +0 -11
- package/dist/components/sc-error-message.js +0 -8
- package/dist/components/sc-error-message.js.map +0 -1
- package/dist/components/sc-input-caption.d.ts +0 -11
- package/dist/components/sc-input-caption.js +0 -8
- package/dist/components/sc-input-caption.js.map +0 -1
- package/dist/components/sc-input-icon.d.ts +0 -11
- package/dist/components/sc-input-icon.js +0 -8
- package/dist/components/sc-input-icon.js.map +0 -1
- package/dist/components/sc-input-label.d.ts +0 -11
- package/dist/components/sc-input-label.js +0 -8
- package/dist/components/sc-input-label.js.map +0 -1
- package/dist/components/sc-input.d.ts +0 -11
- package/dist/components/sc-input.js +0 -8
- package/dist/components/sc-input.js.map +0 -1
- package/dist/components/sc-spinner-dark.d.ts +0 -11
- package/dist/components/sc-spinner-dark.js +0 -8
- package/dist/components/sc-spinner-dark.js.map +0 -1
- package/dist/components/sc-spinner-light.d.ts +0 -11
- package/dist/components/sc-spinner-light.js +0 -8
- package/dist/components/sc-spinner-light.js.map +0 -1
- package/dist/esm/index-c97f8c28.js.map +0 -1
- package/dist/esm/sc-auto-search-form.entry.js +0 -97
- package/dist/esm/sc-auto-search-form.entry.js.map +0 -1
- package/dist/esm/sc-base-search-form_11.entry.js +0 -457
- package/dist/esm/sc-base-search-form_11.entry.js.map +0 -1
- package/dist/esm/sc-spinner-light-cdb79a33.js +0 -18
- package/dist/esm/sc-spinner-light-cdb79a33.js.map +0 -1
- package/dist/esm/sc-spinner-light.entry.js +0 -4
- package/dist/esm/sc-spinner-light.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-8e9ba2cf.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-8e9ba2cf.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-94c68cce.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-94c68cce.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-9545c59a.entry.js +0 -7
- package/dist/searchcraft-javascript-sdk/p-9545c59a.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-c632f66c.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-c632f66c.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-f7dbb9a8.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-f7dbb9a8.entry.js.map +0 -1
- package/dist/types/assets/ButtonIcons.d.ts +0 -1
- package/dist/types/assets/ClearInputIcon.d.ts +0 -4
- package/dist/types/assets/SearchIcons.d.ts +0 -4
- package/dist/types/components/sc-spinner-dark/sc-spinner-dark.d.ts +0 -3
- package/dist/types/components/sc-spinner-light/sc-spinner-light.d.ts +0 -3
- /package/dist/collection/components/{sc-base-search-form/sc-base-search-form.module.css → searchcraft-base-search-form/searchcraft-base-search-form.module.css} +0 -0
- /package/dist/collection/components/{sc-base-search-result/sc-base-search-result.module.css → searchcraft-base-search-result/searchcraft-base-search-result.module.css} +0 -0
- /package/dist/collection/components/{sc-base-search-results/sc-base-search-results.module.css → searchcraft-base-search-results/searchcraft-base-search-results.module.css} +0 -0
- /package/dist/collection/components/{sc-button/sc-button.module.css → searchcraft-button/searchcraft-button.module.css} +0 -0
- /package/dist/collection/components/{sc-error-message/sc-error-message.module.css → searchcraft-error-message/searchcraft-error-message.module.css} +0 -0
- /package/dist/collection/components/{sc-input-caption/sc-input-caption.module.css → searchcraft-input-caption/searchcraft-input-caption.module.css} +0 -0
- /package/dist/collection/components/{sc-input-icon/sc-input-icon.module.css → searchcraft-input-icon/searchcraft-input-icon.module.css} +0 -0
- /package/dist/collection/components/{sc-input-label/sc-input-label.module.css → searchcraft-input-label/searchcraft-input-label.module.css} +0 -0
- /package/dist/collection/components/{sc-spinner-dark/sc-spinner-dark.module.css → searchcraft-spinner-dark/searchcraft-spinner-dark.module.css} +0 -0
- /package/dist/collection/components/{sc-spinner-light/sc-spinner-light.module.css → searchcraft-spinner-light/searchcraft-spinner-light.module.css} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e7bd239c.js');
|
|
6
|
+
const store = require('./store-6c259dd0.js');
|
|
7
|
+
|
|
8
|
+
const searchcraftBaseSearchFormModuleCss = ".formLTR{font-family:Helvetica, Arial, sans-serif;text-align:left}.formRTL{font-family:Helvetica, Arial, sans-serif;text-align:right}.searchContainer{align-items:center;display:flex}";
|
|
9
|
+
const SearchcraftBaseSearchFormStyle0 = searchcraftBaseSearchFormModuleCss;
|
|
10
|
+
|
|
11
|
+
const SearchcraftBaseSearchForm = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
15
|
+
this.clearInput = () => { };
|
|
16
|
+
this.searchStore = store.useSearchcraftStore.getState();
|
|
17
|
+
this.themeStore = store.useThemeStore.getState();
|
|
18
|
+
this.componentDidLoad = () => {
|
|
19
|
+
const searchcraft = new store.g(this.config);
|
|
20
|
+
this.searchStore.initialize(searchcraft, true);
|
|
21
|
+
};
|
|
22
|
+
this.handleFormSubmit = async (event) => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
if (this.query.trim() === '') {
|
|
25
|
+
this.error = true;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.error = false;
|
|
29
|
+
this.searchStore.setQuery(this.query);
|
|
30
|
+
await this.searchStore.search();
|
|
31
|
+
this.searchResults = JSON.stringify(this.searchStore.searchResults);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.handleSearchInputChange = (event) => {
|
|
35
|
+
this.query = event.detail;
|
|
36
|
+
};
|
|
37
|
+
this.handleClearInput = () => {
|
|
38
|
+
this.query = '';
|
|
39
|
+
this === null || this === void 0 ? void 0 : this.clearInput();
|
|
40
|
+
};
|
|
41
|
+
this.toggleTheme = () => {
|
|
42
|
+
this.themeStore.toggleTheme();
|
|
43
|
+
};
|
|
44
|
+
this.config = {
|
|
45
|
+
apiKey: '',
|
|
46
|
+
endpointURL: '',
|
|
47
|
+
index: [],
|
|
48
|
+
};
|
|
49
|
+
this.errorMessage = 'Search was unsuccessful';
|
|
50
|
+
this.labelForInput = 'Search';
|
|
51
|
+
this.rightToLeftOrientation = false;
|
|
52
|
+
this.error = false;
|
|
53
|
+
this.query = '';
|
|
54
|
+
this.searchResults = null;
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return (index.h("form", { key: '6460e91d9c4a48c40476c18762b8b4873c157653', class: this.rightToLeftOrientation ? 'formRTL' : 'formLTR', onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: '9d0a89868c4dafae20e7437101c5639466fc2ffa', label: this.labelForInput }), index.h("div", { key: '441c0923111995fc0b04b0acb799ade4b2018be0', class: 'searchContainer' }, this.rightToLeftOrientation && index.h("searchcraft-button", { key: '2a0dc24c906917cd1ec5bd605e25a0a67bffee21' }), index.h("searchcraft-input", { key: '6744a36c97e03fbd10cc354653e32f0f7eac1c00', onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation, onSearchInputChange: this.handleSearchInputChange, query: this.query }), !this.rightToLeftOrientation && (index.h("searchcraft-button", { key: '50ea437efebe7a62d6122fb6a76942861003884a', onButtonClick: this.handleFormSubmit }))), this.error && (index.h("searchcraft-error-message", { key: 'ae4b2fa7d874771af0b88757244abe5d50679d55', errorMessage: this.errorMessage }))));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
SearchcraftBaseSearchForm.style = SearchcraftBaseSearchFormStyle0;
|
|
61
|
+
|
|
62
|
+
exports.searchcraft_base_search_form = SearchcraftBaseSearchForm;
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=searchcraft-base-search-form.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-base-search-form.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kCAAkC,GAAG,wLAAwL,CAAC;AACpO,wCAAe,kCAAkC;;MCcpC,yBAAyB;;;;QAU3B,eAAU,GAAG,SAAQ,CAAC;QAMvB,gBAAW,GAAGA,yBAAmB,CAAC,QAAQ,EAAE,CAAC;QAC7C,eAAU,GAAGC,mBAAa,CAAC,QAAQ,EAAE,CAAC;QAE9C,qBAAgB,GAAG;YACjB,MAAM,WAAW,GAAG,IAAIC,OAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SAChD,CAAC;QAEF,qBAAgB,GAAG,OAAO,KAAK;YAC7B,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;aACnB;iBAAM;gBACL,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACtC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;gBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;aACrE;SACF,CAAC;QAEF,4BAAuB,GAAG,CAAC,KAAiC;YAC1D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;SAC3B,CAAC;QAEF,qBAAgB,GAAG;YACjB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAChB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,EAAE,CAAC;SACpB,CAAC;QAEF,gBAAW,GAAG;YACZ,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;SAC/B,CAAC;sBA9C8B;YAC9B,MAAM,EAAE,EAAE;YACV,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,EAAE;SACV;4BACsB,yBAAyB;6BACxB,QAAQ;sCACC,KAAK;qBAIrB,KAAK;qBACL,EAAE;6BACqB,IAAI;;IAmC5C,MAAM;QACJ,QACEC,mEACE,KAAK,EAAE,IAAI,CAAC,sBAAsB,GAAG,SAAS,GAAG,SAAS,EAC1D,QAAQ,EAAE,IAAI,CAAC,gBAAgB,IAE/BA,sFAAyB,KAAK,EAAE,IAAI,CAAC,aAAa,GAAI,EACtDA,kEAAK,KAAK,EAAC,iBAAiB,IACzB,IAAI,CAAC,sBAAsB,IAAIA,kFAAsB,EACtDA,gFACE,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,mBAAmB,EAAE,IAAI,CAAC,uBAAuB,EACjD,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,EACD,CAAC,IAAI,CAAC,sBAAsB,KAC3BA,iFAAoB,aAAa,EAAE,IAAI,CAAC,gBAAgB,GAAI,CAC7D,CACG,EACL,IAAI,CAAC,KAAK,KACTA,wFAA2B,YAAY,EAAE,IAAI,CAAC,YAAY,GAAI,CAC/D,CACI,EACP;KACH;;;;;;","names":["useSearchcraftStore","useThemeStore","SearchcraftCore","h"],"sources":["src/components/searchcraft-base-search-form/searchcraft-base-search-form.module.scss?tag=searchcraft-base-search-form&encapsulation=shadow","src/components/searchcraft-base-search-form/searchcraft-base-search-form.tsx"],"sourcesContent":[".formLTR {\n font-family: Helvetica, Arial, sans-serif;\n text-align: left;\n}\n\n.formRTL {\n font-family: Helvetica, Arial, sans-serif;\n text-align: right;\n}\n\n.searchContainer {\n align-items: center;\n display: flex;\n}","import { Component, h, Event, Prop, State } from '@stencil/core';\nimport {\n type CoreConfigSDK,\n CoreSDK as SearchcraftCore,\n} from '@searchcraft/core';\n\nimport { useSearchcraftStore, useThemeStore } from '@provider/store';\n\nimport type { ScInputCustomEvent } from '@components/searchcraft-input/searchcraft-input';\n\n@Component({\n tag: 'searchcraft-base-search-form',\n styleUrl: 'searchcraft-base-search-form.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchForm {\n @Prop() config: CoreConfigSDK = {\n apiKey: '',\n endpointURL: '',\n index: [],\n };\n @Prop() errorMessage = 'Search was unsuccessful';\n @Prop() labelForInput = 'Search';\n @Prop() rightToLeftOrientation = false;\n\n @Event() clearInput = () => {};\n\n @State() error = false;\n @State() query = '';\n @State() searchResults: string | null = null;\n\n private searchStore = useSearchcraftStore.getState();\n private themeStore = useThemeStore.getState();\n\n componentDidLoad = () => {\n const searchcraft = new SearchcraftCore(this.config);\n this.searchStore.initialize(searchcraft, true);\n };\n\n handleFormSubmit = async (event) => {\n event.preventDefault();\n if (this.query.trim() === '') {\n this.error = true;\n } else {\n this.error = false;\n this.searchStore.setQuery(this.query);\n await this.searchStore.search();\n this.searchResults = JSON.stringify(this.searchStore.searchResults);\n }\n };\n\n handleSearchInputChange = (event: ScInputCustomEvent<string>) => {\n this.query = event.detail;\n };\n\n handleClearInput = () => {\n this.query = '';\n this?.clearInput();\n };\n\n toggleTheme = () => {\n this.themeStore.toggleTheme();\n };\n\n render() {\n return (\n <form\n class={this.rightToLeftOrientation ? 'formRTL' : 'formLTR'}\n onSubmit={this.handleFormSubmit}\n >\n <searchcraft-input-label label={this.labelForInput} />\n <div class='searchContainer'>\n {this.rightToLeftOrientation && <searchcraft-button />}\n <searchcraft-input\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n onSearchInputChange={this.handleSearchInputChange}\n query={this.query}\n />\n {!this.rightToLeftOrientation && (\n <searchcraft-button onButtonClick={this.handleFormSubmit} />\n )}\n </div>\n {this.error && (\n <searchcraft-error-message errorMessage={this.errorMessage} />\n )}\n </form>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e7bd239c.js');
|
|
6
|
+
|
|
7
|
+
const SearchcraftButtonIcon = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h("svg", { key: 'f9436b04edcceb412ba9f81dec897e6075f22007', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'button-icon-title' }, index.h("title", { key: 'a9c430e91b2ab60a128393dda5d788e4de4a0401', id: 'button-icon-title' }, "Searchcraft Button Icon"), index.h("path", { key: '52a99156089e2cbf7de1f355bea2ffafd1b66dde', d: 'M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z', stroke: 'white', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.searchcraft_button_icon = SearchcraftButtonIcon;
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=searchcraft-button-icon.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-button-icon.entry.cjs.js","mappings":";;;;;;MAMa,qBAAqB;;;;IAChC,MAAM;QACJ,QACEA,kEACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB,IAEnCA,oEAAO,EAAE,EAAC,mBAAmB,8BAAgC,EAC7DA,mEACE,CAAC,EAAC,8rBAA8rB,EAChsB,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EACN;KACH;;;;;","names":["h"],"sources":["src/assets/searchcraft-button-icons.tsx"],"sourcesContent":["import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-button-icon',\n shadow: true,\n})\nexport class SearchcraftButtonIcon {\n render() {\n return (\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 aria-labelledby='button-icon-title'\n >\n <title id='button-icon-title'>Searchcraft Button Icon</title>\n <path\n d='M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z'\n stroke='white'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e7bd239c.js');
|
|
6
|
+
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
+
|
|
8
|
+
const searchcraftButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.buttonLight{border-radius:8px;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative;background-color:#000;border:1px solid #E6E6E6;color:#FFF}.buttonLight:hover{cursor:pointer}.buttonLight:hover{background-color:#2E2E2E}.buttonLight:focus{outline:2px solid #000000}.buttonDark{border-radius:8px;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative;background-color:#FFF;border:1px solid #404040;color:#292929}.buttonDark:hover{cursor:pointer}.buttonDark:hover{background-color:#FAFAFA}.buttonDark:focus{outline:2px solid #404040}.spinnerMarginRight{left:4px;margin-right:4px;position:absolute}.spinnerMarginLeft{left:4px;margin-left:4px;position:absolute}.buttonLabel{animation:right-and-back 0.2s;margin-left:4px;position:relative}@keyframes right-and-back{0%{right:-6px}50%{right:-12px}75%{right:-6px}100%{right:0px}}";
|
|
9
|
+
const SearchcraftButtonStyle0 = searchcraftButtonModuleCss;
|
|
10
|
+
|
|
11
|
+
const SearchcraftButton = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.buttonClick = index.createEvent(this, "buttonClick", 7);
|
|
15
|
+
this.handleClick = () => {
|
|
16
|
+
this.buttonClick.emit(); // Emit the event instead of calling a function
|
|
17
|
+
};
|
|
18
|
+
this.iconElement = undefined;
|
|
19
|
+
this.iconOnly = false;
|
|
20
|
+
this.iconPosition = 'left';
|
|
21
|
+
this.label = 'Search';
|
|
22
|
+
this.isRequesting = false;
|
|
23
|
+
this.theme = 'light';
|
|
24
|
+
}
|
|
25
|
+
getButtonStyle() {
|
|
26
|
+
return this.theme === 'light' ? 'buttonLight' : 'buttonDark';
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const buttonStyle = this.getButtonStyle();
|
|
30
|
+
return (index.h(index.Fragment, { key: 'f10a9faa6357ef626c4e5414a5c8bdc1fe0b63a1' }, this.iconOnly ? (index.h("button", { class: index$1.classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (index.h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (index.h("button", { class: index$1.classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.isRequesting ? (index.h("div", { class: 'spinner-margin-right' }, index.h("searchcraft-spinner-dark", null))) : (this.iconElement), index.h("span", { class: index$1.classNames(this.isRequesting && 'button-label', 'searchcraft-button-label') }, this.label)))));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
SearchcraftButton.style = SearchcraftButtonStyle0;
|
|
34
|
+
|
|
35
|
+
exports.searchcraft_button = SearchcraftButton;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=searchcraft-button.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-button.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,0BAA0B,GAAG,y/BAAy/B,CAAC;AAC7hC,gCAAe,0BAA0B;;MCe5B,iBAAiB;;;;QAepB,gBAAW,GAAG;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB,CAAC;;wBAfiB,KAAK;4BACD,MAAM;qBACb,QAAQ;4BAIA,KAAK;qBACZ,OAAO;;IAEhB,cAAc;QACpB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,aAAa,GAAG,YAAY,CAAC;KAC9D;IAMD,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAE1C,QACEA,QAACC,cAAQ,uDACN,IAAI,CAAC,QAAQ,IACZD,oBACE,KAAK,EAAEE,kBAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChBF,yCAA4B,KAE5B,IAAI,CAAC,WAAW,CACjB,CACM,KAETA,oBACE,KAAK,EAAEE,kBAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,YAAY,IAChDF,iBAAK,KAAK,EAAC,sBAAsB,IAC/BA,yCAA4B,CACxB,KAEN,IAAI,CAAC,WAAW,CACjB,EACDA,kBACE,KAAK,EAAEE,kBAAU,CACf,IAAI,CAAC,YAAY,IAAI,cAAc,EACnC,0BAA0B,CAC3B,IAEA,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,EACX;KACH;;;;;;","names":["h","Fragment","classNames"],"sources":["src/components/searchcraft-button/searchcraft-button.module.scss?tag=searchcraft-button&encapsulation=shadow","src/components/searchcraft-button/searchcraft-button.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin button-base {\n border-radius: 8px;\n display: flex;\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n padding: 11px 20px;\n position: relative;\n\n &:hover {\n cursor: pointer;\n }\n}\n\n.buttonLight {\n @include button-base;\n background-color: $light-background;\n border: 1px solid $light-button-border;\n color: $light-button-color;\n\n &:hover {\n background-color: $light-button-hover;\n }\n\n &:focus {\n outline: 2px solid $light-button-outline-focus;\n }\n}\n\n.buttonDark {\n @include button-base;\n background-color: $dark-background;\n border: 1px solid $dark-button-border;\n color: $dark-button-color;\n\n &:hover {\n background-color: $dark-button-hover;\n }\n\n &:focus {\n outline: 2px solid $dark-button-outline-focus;\n }\n}\n\n.spinnerMarginRight {\n left: 4px;\n margin-right: 4px;\n position: absolute;\n}\n\n.spinnerMarginLeft {\n left: 4px;\n margin-left: 4px;\n position: absolute;\n}\n\n.buttonLabel {\n animation: right-and-back .2s;\n margin-left: 4px;\n position: relative;\n}\n\n@keyframes right-and-back {\n 0% { right: -6px; }\n 50% { right: -12px; }\n 75% { right: -6px; }\n 100% {right: 0px; }\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftButton {\n @Prop() iconElement?: Element;\n @Prop() iconOnly = false;\n @Prop() iconPosition = 'left';\n @Prop() label = 'Search';\n\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n @State() theme = 'light';\n\n private getButtonStyle() {\n return this.theme === 'light' ? 'buttonLight' : 'buttonDark';\n }\n\n private handleClick = () => {\n this.buttonClick.emit(); // Emit the event instead of calling a function\n };\n\n render() {\n const buttonStyle = this.getButtonStyle();\n\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames(buttonStyle, '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(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.isRequesting ? (\n <div class='spinner-margin-right'>\n <searchcraft-spinner-dark />\n </div>\n ) : (\n this.iconElement\n )}\n <span\n class={classNames(\n this.isRequesting && 'button-label',\n 'searchcraft-button-label',\n )}\n >\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e7bd239c.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["
|
|
22
|
+
return index.bootstrapLazy([["searchcraft-auto-search-form_13.cjs",[[1,"searchcraft-auto-search-form",{"autoSearchFormClass":[1,"auto-search-form-class"],"clearInput":[16],"config":[16],"customStylesForInput":[1,"custom-styles-for-input"],"inputCaptionValue":[1,"input-caption-value"],"labelForInput":[1,"label-for-input"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"searchContainerClass":[1,"search-container-class"],"error":[32],"query":[32],"searchResults":[32]}],[1,"searchcraft-base-search-results",{"query":[32],"searchResults":[32]}],[1,"searchcraft-base-search-result",{"buttonCallbackFn":[16],"buttonLabel":[1,"button-label"],"callbackFn":[16],"imageAltText":[1,"image-alt-text"],"imageSrc":[1,"image-src"],"interactiveResult":[4,"interactive-result"],"keyDownCallbackFn":[16],"resultBodyContent":[1,"result-body-content"],"resultHeading":[1,"result-heading"],"resultSubheading":[1,"result-subheading"],"theme":[1]}],[1,"searchcraft-input",{"customStyles":[1,"custom-styles"],"error":[4],"formClassName":[1,"form-class-name"],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"inputClassName":[1,"input-class-name"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"query":[1],"theme":[32]}],[1,"searchcraft-input-label",{"inputLabelClassName":[1,"input-label-class-name"],"label":[1],"theme":[32]}],[1,"searchcraft-clear-input-button",{"isRequesting":[4,"is-requesting"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}],[1,"searchcraft-input-icon",{"error":[4],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}],[1,"searchcraft-error-message",{"errorMessage":[1,"error-message"],"theme":[1]}],[1,"searchcraft-input-caption",{"error":[4],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}],[1,"searchcraft-search-icon-set",{"type":[1]}],[1,"searchcraft-spinner-light"],[1,"searchcraft-spinner-dark"],[1,"searchcraft-clear-icon-set",{"type":[1]}]]],["searchcraft-base-search-form.cjs",[[1,"searchcraft-base-search-form",{"config":[16],"errorMessage":[1,"error-message"],"labelForInput":[1,"label-for-input"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"error":[32],"query":[32],"searchResults":[32]}]]],["searchcraft-button-icon.cjs",[[1,"searchcraft-button-icon"]]],["searchcraft-button.cjs",[[1,"searchcraft-button",{"iconElement":[16],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"label":[1],"isRequesting":[32],"theme":[32]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility function to parse custom styles from a string or object.
|
|
5
|
+
* @param styles - Custom styles as a stringified JSON or an object.
|
|
6
|
+
* @returns {Record<string, string>} - Parsed styles as an object.
|
|
7
|
+
*/
|
|
8
|
+
function parseCustomStyles(styles) {
|
|
9
|
+
if (typeof styles === 'string') {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(styles);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
console.error('Invalid customStyles format:', styles);
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return styles || {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.parseCustomStyles = parseCustomStyles;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=utils-cbbed1f7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"utils-cbbed1f7.js","mappings":";;AAAA;;;;;SAKgB,iBAAiB,CAC/B,MAAuC;IAEvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;YACtD,OAAO,EAAE,CAAC;SACX;KACF;IACD,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["/**\n * Utility function to parse custom styles from a string or object.\n * @param styles - Custom styles as a stringified JSON or an object.\n * @returns {Record<string, string>} - Parsed styles as an object.\n */\nexport function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n"],"version":3}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class SearchcraftButtonIcon {
|
|
3
|
+
render() {
|
|
4
|
+
return (h("svg", { key: 'f9436b04edcceb412ba9f81dec897e6075f22007', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'button-icon-title' }, h("title", { key: 'a9c430e91b2ab60a128393dda5d788e4de4a0401', id: 'button-icon-title' }, "Searchcraft Button Icon"), h("path", { key: '52a99156089e2cbf7de1f355bea2ffafd1b66dde', d: 'M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z', stroke: 'white', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
5
|
+
}
|
|
6
|
+
static get is() { return "searchcraft-button-icon"; }
|
|
7
|
+
static get encapsulation() { return "shadow"; }
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=searchcraft-button-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchcraft-button-icons.js","sourceRoot":"","sources":["../../src/assets/searchcraft-button-icons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAM7C,MAAM,OAAO,qBAAqB;IAChC,MAAM;QACJ,OAAO,CACL,4DACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB;YAEnC,8DAAO,EAAE,EAAC,mBAAmB,8BAAgC;YAC7D,6DACE,CAAC,EAAC,8rBAA8rB,EAChsB,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;IACJ,CAAC;;;CACF","sourcesContent":["import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-button-icon',\n shadow: true,\n})\nexport class SearchcraftButtonIcon {\n render() {\n return (\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 aria-labelledby='button-icon-title'\n >\n <title id='button-icon-title'>Searchcraft Button Icon</title>\n <path\n d='M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z'\n stroke='white'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class SearchcraftClearIconSet {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.type = 'clear-light';
|
|
5
|
+
}
|
|
6
|
+
render() {
|
|
7
|
+
switch (this.type) {
|
|
8
|
+
case 'clear-light':
|
|
9
|
+
return (h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Light"), h("path", { 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: 'black', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
10
|
+
case 'clear-dark':
|
|
11
|
+
return (h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Dark"), h("path", { 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: 'white', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
12
|
+
case 'arrow-light':
|
|
13
|
+
return (h("svg", { width: '20', height: '21', viewBox: '0 0 20 21', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Light"), h("path", { d: 'M7.5 15.0444L12.5 10.0444L7.5 5.04443', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
14
|
+
case 'arrow-dark':
|
|
15
|
+
return (h("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Dark"), h("path", { d: 'M1.5 11L6.5 6L1.5 1', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
16
|
+
default:
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "searchcraft-clear-icon-set"; }
|
|
21
|
+
static get encapsulation() { return "shadow"; }
|
|
22
|
+
static get properties() {
|
|
23
|
+
return {
|
|
24
|
+
"type": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"mutable": false,
|
|
27
|
+
"complexType": {
|
|
28
|
+
"original": "'clear-light' | 'clear-dark' | 'arrow-light' | 'arrow-dark'",
|
|
29
|
+
"resolved": "\"arrow-dark\" | \"arrow-light\" | \"clear-dark\" | \"clear-light\"",
|
|
30
|
+
"references": {}
|
|
31
|
+
},
|
|
32
|
+
"required": false,
|
|
33
|
+
"optional": false,
|
|
34
|
+
"docs": {
|
|
35
|
+
"tags": [],
|
|
36
|
+
"text": "Type of the icon to display.\nOptions: 'clear-light', 'clear-dark', 'arrow-light', 'arrow-dark'"
|
|
37
|
+
},
|
|
38
|
+
"attribute": "type",
|
|
39
|
+
"reflect": false,
|
|
40
|
+
"defaultValue": "'clear-light'"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=searchcraft-clear-icon-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchcraft-clear-icon-set.js","sourceRoot":"","sources":["../../src/assets/searchcraft-clear-icon-set.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMnD,MAAM,OAAO,uBAAuB;;oBAMhC,aAAa;;IAEf,MAAM;QACJ,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,aAAa;gBAChB,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY;oBAE5B,aAAO,EAAE,EAAC,YAAY,yCAA2C;oBACjE,YACE,CAAC,EAAC,uIAAuI,EACzI,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ,KAAK,YAAY;gBACf,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY;oBAE5B,aAAO,EAAE,EAAC,YAAY,wCAA0C;oBAChE,YACE,CAAC,EAAC,uIAAuI,EACzI,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ,KAAK,aAAa;gBAChB,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY;oBAE5B,aAAO,EAAE,EAAC,YAAY,yCAA2C;oBACjE,YACE,CAAC,EAAC,uCAAuC,EACzC,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ,KAAK,YAAY;gBACf,OAAO,CACL,WACE,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY;oBAE5B,aAAO,EAAE,EAAC,YAAY,wCAA0C;oBAChE,YACE,CAAC,EAAC,qBAAqB,EACvB,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YAEJ;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-clear-icon-set',\n shadow: true,\n})\nexport class SearchcraftClearIconSet {\n /**\n * Type of the icon to display.\n * Options: 'clear-light', 'clear-dark', 'arrow-light', 'arrow-dark'\n */\n @Prop() type: 'clear-light' | 'clear-dark' | 'arrow-light' | 'arrow-dark' =\n 'clear-light';\n\n render() {\n switch (this.type) {\n case 'clear-light':\n return (\n <svg\n width='22'\n height='22'\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'>Searchcraft Clear Input Icon Light</title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='black'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'clear-dark':\n return (\n <svg\n width='22'\n height='22'\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'>Searchcraft Clear Input Icon Dark</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='white'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'arrow-light':\n return (\n <svg\n width='20'\n height='21'\n viewBox='0 0 20 21'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Arrow Right Icon Light</title>\n <path\n d='M7.5 15.0444L12.5 10.0444L7.5 5.04443'\n stroke='#737373'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'arrow-dark':\n return (\n <svg\n width='8'\n height='12'\n viewBox='0 0 8 12'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Arrow Right Icon Dark</title>\n <path\n d='M1.5 11L6.5 6L1.5 1'\n stroke='#BFBFBF'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n\n default:\n return null;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class SearchcraftSearchIconSet {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.type = 'search-dark';
|
|
5
|
+
}
|
|
6
|
+
render() {
|
|
7
|
+
switch (this.type) {
|
|
8
|
+
case 'search-light':
|
|
9
|
+
return (h("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Light"), h("path", { 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: '#404040', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
10
|
+
case 'search-dark':
|
|
11
|
+
return (h("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Dark"), h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#E6E6E6', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
12
|
+
case 'error-light':
|
|
13
|
+
return (h("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Light"), h("path", { 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: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
14
|
+
case 'error-dark':
|
|
15
|
+
return (h("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Dark"), h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
16
|
+
default:
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "searchcraft-search-icon-set"; }
|
|
21
|
+
static get encapsulation() { return "shadow"; }
|
|
22
|
+
static get properties() {
|
|
23
|
+
return {
|
|
24
|
+
"type": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"mutable": false,
|
|
27
|
+
"complexType": {
|
|
28
|
+
"original": "'search-light' | 'search-dark' | 'error-light' | 'error-dark'",
|
|
29
|
+
"resolved": "\"error-dark\" | \"error-light\" | \"search-dark\" | \"search-light\"",
|
|
30
|
+
"references": {}
|
|
31
|
+
},
|
|
32
|
+
"required": false,
|
|
33
|
+
"optional": false,
|
|
34
|
+
"docs": {
|
|
35
|
+
"tags": [],
|
|
36
|
+
"text": "Type of the icon to display.\nOptions: ''search-light', search-dark', 'error-light', 'error-dark'"
|
|
37
|
+
},
|
|
38
|
+
"attribute": "type",
|
|
39
|
+
"reflect": false,
|
|
40
|
+
"defaultValue": "'search-dark'"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=searchcraft-search-icon-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchcraft-search-icon-set.js","sourceRoot":"","sources":["../../src/assets/searchcraft-search-icon-set.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMnD,MAAM,OAAO,wBAAwB;;oBAMjC,aAAa;;IAEf,MAAM;QACJ,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,cAAc;gBACjB,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB;oBAEnC,aAAO,EAAE,EAAC,mBAAmB,oCAAsC;oBACnE,YACE,CAAC,EAAC,mNAAmN,EACrN,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ,KAAK,aAAa;gBAChB,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB;oBAEnC,aAAO,EAAE,EAAC,mBAAmB,mCAAqC;oBAClE,YACE,CAAC,EAAC,mNAAmN,EACrN,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ,KAAK,aAAa;gBAChB,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB;oBAEnC,aAAO,EAAE,EAAC,mBAAmB,0CAErB;oBACR,YACE,CAAC,EAAC,mNAAmN,EACrN,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ,KAAK,YAAY;gBACf,OAAO,CACL,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB;oBAEnC,aAAO,EAAE,EAAC,mBAAmB,yCAErB;oBACR,YACE,CAAC,EAAC,mNAAmN,EACrN,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC;YACJ;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-search-icon-set',\n shadow: true,\n})\nexport class SearchcraftSearchIconSet {\n /**\n * Type of the icon to display.\n * Options: ''search-light', search-dark', 'error-light', 'error-dark'\n */\n @Prop() type: 'search-light' | 'search-dark' | 'error-light' | 'error-dark' =\n 'search-dark';\n\n render() {\n switch (this.type) {\n case 'search-light':\n return (\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 aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>Searchcraft Search Icon Light</title>\n <path\n d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z'\n stroke='#404040'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'search-dark':\n return (\n <svg\n width='18'\n height='18'\n viewBox='0 0 18 18'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>Searchcraft Search Icon Dark</title>\n <path\n d='M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z'\n stroke='#E6E6E6'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'error-light':\n return (\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 aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>\n Searchcraft Error 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='#737373'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'error-dark':\n return (\n <svg\n width='18'\n height='18'\n viewBox='0 0 18 18'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>\n Searchcraft Error Search Icon Dark\n </title>\n <path\n d='M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z'\n stroke='#BFBFBF'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n default:\n return null;\n }\n }\n}\n"]}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"components/
|
|
7
|
-
"components/
|
|
8
|
-
"components/
|
|
9
|
-
"components/
|
|
10
|
-
"components/
|
|
11
|
-
"components/
|
|
12
|
-
"components/
|
|
13
|
-
"components/
|
|
14
|
-
"components/
|
|
15
|
-
"components/
|
|
3
|
+
"assets/searchcraft-button-icons.js",
|
|
4
|
+
"assets/searchcraft-clear-icon-set.js",
|
|
5
|
+
"assets/searchcraft-search-icon-set.js",
|
|
6
|
+
"components/searchcraft-input/searchcraft-input.js",
|
|
7
|
+
"components/searchcraft-auto-search-form/searchcraft-auto-search-form.js",
|
|
8
|
+
"components/searchcraft-base-search-form/searchcraft-base-search-form.js",
|
|
9
|
+
"components/searchcraft-base-search-result/searchcraft-base-search-result.js",
|
|
10
|
+
"components/searchcraft-base-search-results/searchcraft-base-search-results.js",
|
|
11
|
+
"components/searchcraft-button/searchcraft-button.js",
|
|
12
|
+
"components/searchcraft-clear-input-button/searchcraft-clear-input-button.js",
|
|
13
|
+
"components/searchcraft-error-message/searchcraft-error-message.js",
|
|
14
|
+
"components/searchcraft-input-caption/searchcraft-input-caption.js",
|
|
15
|
+
"components/searchcraft-input-icon/searchcraft-input-icon.js",
|
|
16
|
+
"components/searchcraft-input-label/searchcraft-input-label.js",
|
|
17
|
+
"components/searchcraft-spinner-dark/searchcraft-spinner-dark.js",
|
|
18
|
+
"components/searchcraft-spinner-light/searchcraft-spinner-light.js"
|
|
16
19
|
],
|
|
17
20
|
"compiler": {
|
|
18
21
|
"name": "@stencil/core",
|
|
@@ -1,50 +1,37 @@
|
|
|
1
1
|
import { h, } from "@stencil/core";
|
|
2
2
|
import { CoreSDK as SearchcraftCore, } from "@searchcraft/core";
|
|
3
|
+
import { parseCustomStyles } from "../../utils/utils";
|
|
3
4
|
import { useSearchcraftStore } from "../../provider/store";
|
|
4
|
-
export class
|
|
5
|
+
export class SearchcraftAutoSearchForm {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.debounceTimeout = null;
|
|
7
8
|
this.debounceDelay = 300; // 300ms debounce delay
|
|
8
|
-
this.componentDidLoad = () => {
|
|
9
|
-
const searchcraft = new SearchcraftCore(this.config);
|
|
10
|
-
this.searchStore.initialize(searchcraft, true);
|
|
11
|
-
};
|
|
12
|
-
// Initialize searchStore as a private field
|
|
13
9
|
this.searchStore = useSearchcraftStore.getState();
|
|
14
|
-
/**
|
|
15
|
-
* Handles the input change event from sc-input
|
|
16
|
-
*/
|
|
17
10
|
this.handleInputChange = (event) => {
|
|
18
|
-
|
|
19
|
-
this.query
|
|
11
|
+
this.query = event.detail;
|
|
12
|
+
this.querySubmit.emit(this.query);
|
|
13
|
+
// Clear the previous debounce timeout
|
|
20
14
|
if (this.debounceTimeout) {
|
|
21
|
-
clearTimeout(this.debounceTimeout);
|
|
15
|
+
clearTimeout(this.debounceTimeout);
|
|
22
16
|
}
|
|
23
|
-
//
|
|
24
|
-
this.querySubmit.emit(this.query);
|
|
25
|
-
// Set a new debounce timeout to execute search after delay
|
|
17
|
+
// Set a new debounce timeout
|
|
26
18
|
this.debounceTimeout = setTimeout(() => {
|
|
27
|
-
|
|
19
|
+
console.log('Debounced search triggered');
|
|
20
|
+
this.runSearch();
|
|
28
21
|
}, this.debounceDelay);
|
|
29
22
|
};
|
|
30
|
-
/**
|
|
31
|
-
* Handles the clear input event from sc-input
|
|
32
|
-
*/
|
|
33
23
|
this.handleClearInput = () => {
|
|
34
24
|
this.query = '';
|
|
25
|
+
console.log('Input cleared');
|
|
35
26
|
if (typeof this.clearInput === 'function') {
|
|
36
27
|
this.clearInput();
|
|
37
28
|
}
|
|
38
29
|
if (this.debounceTimeout) {
|
|
39
|
-
clearTimeout(this.debounceTimeout);
|
|
30
|
+
clearTimeout(this.debounceTimeout);
|
|
40
31
|
}
|
|
41
|
-
// Reset error and search results
|
|
42
32
|
this.error = false;
|
|
43
33
|
this.searchResults = '';
|
|
44
34
|
};
|
|
45
|
-
/**
|
|
46
|
-
* Runs the search logic
|
|
47
|
-
*/
|
|
48
35
|
this.runSearch = async () => {
|
|
49
36
|
if (this.query.trim() === '') {
|
|
50
37
|
this.error = true;
|
|
@@ -52,17 +39,19 @@ export class ScAutoSearchForm {
|
|
|
52
39
|
}
|
|
53
40
|
else {
|
|
54
41
|
this.error = false;
|
|
55
|
-
this.searchStore.setQuery(this.query);
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
this.searchStore.setQuery(this.query);
|
|
43
|
+
try {
|
|
44
|
+
await this.searchStore.search();
|
|
45
|
+
this.searchResults = JSON.stringify(this.searchStore.searchResults);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.error = true;
|
|
49
|
+
}
|
|
58
50
|
}
|
|
59
51
|
};
|
|
60
|
-
/**
|
|
61
|
-
* Handles the form submission logic
|
|
62
|
-
*/
|
|
63
52
|
this.handleFormSubmit = async (event) => {
|
|
64
53
|
event.preventDefault();
|
|
65
|
-
await this.runSearch();
|
|
54
|
+
await this.runSearch();
|
|
66
55
|
};
|
|
67
56
|
this.autoSearchFormClass = '';
|
|
68
57
|
this.clearInput = () => { };
|
|
@@ -71,8 +60,9 @@ export class ScAutoSearchForm {
|
|
|
71
60
|
endpointURL: '',
|
|
72
61
|
index: [],
|
|
73
62
|
};
|
|
63
|
+
this.customStylesForInput = {};
|
|
74
64
|
this.inputCaptionValue = '';
|
|
75
|
-
this.labelForInput = '
|
|
65
|
+
this.labelForInput = '';
|
|
76
66
|
this.placeholderValue = 'Search here';
|
|
77
67
|
this.rightToLeftOrientation = false;
|
|
78
68
|
this.searchContainerClass = '';
|
|
@@ -80,20 +70,26 @@ export class ScAutoSearchForm {
|
|
|
80
70
|
this.query = '';
|
|
81
71
|
this.searchResults = '';
|
|
82
72
|
}
|
|
73
|
+
componentDidLoad() {
|
|
74
|
+
const searchcraft = new SearchcraftCore(this.config);
|
|
75
|
+
this.searchStore.initialize(searchcraft, true);
|
|
76
|
+
console.log('Component initialized');
|
|
77
|
+
}
|
|
83
78
|
render() {
|
|
84
79
|
const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
|
|
85
|
-
|
|
80
|
+
const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);
|
|
81
|
+
return (h("form", { key: '60978e813198af27c34232ebd1bda4ca4a6f5199', class: `${formClass}`, onSubmit: this.handleFormSubmit }, h("searchcraft-input-label", { key: '4418b675769d041c684f15afb2d9b919f765c133', label: this.labelForInput }), h("div", { key: '73581bf8fee7deee1bcf426f80493c78e92d8ada', class: 'searchContainer' }, h("searchcraft-input", { key: '6e90612f4fc8c773c9f98f5fcfffb303909d3c6f', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, onClearInput: this.handleClearInput, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation })), this.error && (h("searchcraft-error-message", { key: '1637aff0dcac83d975d9d53545e7fee26c41aa7f', errorMessage: 'Please enter a search query.' }))));
|
|
86
82
|
}
|
|
87
|
-
static get is() { return "
|
|
83
|
+
static get is() { return "searchcraft-auto-search-form"; }
|
|
88
84
|
static get encapsulation() { return "shadow"; }
|
|
89
85
|
static get originalStyleUrls() {
|
|
90
86
|
return {
|
|
91
|
-
"$": ["
|
|
87
|
+
"$": ["searchcraft-auto-search-form.module.scss"]
|
|
92
88
|
};
|
|
93
89
|
}
|
|
94
90
|
static get styleUrls() {
|
|
95
91
|
return {
|
|
96
|
-
"$": ["
|
|
92
|
+
"$": ["searchcraft-auto-search-form.module.css"]
|
|
97
93
|
};
|
|
98
94
|
}
|
|
99
95
|
static get properties() {
|
|
@@ -154,6 +150,29 @@ export class ScAutoSearchForm {
|
|
|
154
150
|
},
|
|
155
151
|
"defaultValue": "{\n apiKey: '',\n endpointURL: '',\n index: [],\n }"
|
|
156
152
|
},
|
|
153
|
+
"customStylesForInput": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string | Record<string, string>",
|
|
158
|
+
"resolved": "string | { [x: string]: string; }",
|
|
159
|
+
"references": {
|
|
160
|
+
"Record": {
|
|
161
|
+
"location": "global",
|
|
162
|
+
"id": "global::Record"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": ""
|
|
171
|
+
},
|
|
172
|
+
"attribute": "custom-styles-for-input",
|
|
173
|
+
"reflect": false,
|
|
174
|
+
"defaultValue": "{}"
|
|
175
|
+
},
|
|
157
176
|
"inputCaptionValue": {
|
|
158
177
|
"type": "string",
|
|
159
178
|
"mutable": false,
|
|
@@ -188,7 +207,7 @@ export class ScAutoSearchForm {
|
|
|
188
207
|
},
|
|
189
208
|
"attribute": "label-for-input",
|
|
190
209
|
"reflect": false,
|
|
191
|
-
"defaultValue": "'
|
|
210
|
+
"defaultValue": "''"
|
|
192
211
|
},
|
|
193
212
|
"placeholderValue": {
|
|
194
213
|
"type": "string",
|
|
@@ -262,7 +281,7 @@ export class ScAutoSearchForm {
|
|
|
262
281
|
"composed": true,
|
|
263
282
|
"docs": {
|
|
264
283
|
"tags": [],
|
|
265
|
-
"text": "
|
|
284
|
+
"text": ""
|
|
266
285
|
},
|
|
267
286
|
"complexType": {
|
|
268
287
|
"original": "string",
|
|
@@ -272,4 +291,4 @@ export class ScAutoSearchForm {
|
|
|
272
291
|
}];
|
|
273
292
|
}
|
|
274
293
|
}
|
|
275
|
-
//# sourceMappingURL=
|
|
294
|
+
//# sourceMappingURL=searchcraft-auto-search-form.js.map
|
package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchcraft-auto-search-form.js","sourceRoot":"","sources":["../../../src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,CAAC,GACF,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,OAAO,IAAI,eAAe,GAC3B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAOtD,MAAM,OAAO,yBAAyB;;QAqB5B,oBAAe,GAAyC,IAAI,CAAC;QAC7D,kBAAa,GAAG,GAAG,CAAC,CAAC,uBAAuB;QAC5C,gBAAW,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QAQrD,sBAAiB,GAAG,CAAC,KAAiC,EAAE,EAAE;YACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAElC,sCAAsC;YACtC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBACzB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACrC,CAAC;YAED,6BAA6B;YAC7B,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,GAAG,EAAE;gBACrC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;gBAC1C,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACzB,CAAC,CAAC;QAEF,qBAAgB,GAAG,GAAG,EAAE;YACtB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAE7B,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,CAAC;YAED,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBACzB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACrC,CAAC;YAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QAC1B,CAAC,CAAC;QAEM,cAAS,GAAG,KAAK,IAAI,EAAE;YAC7B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAClB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAEtC,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;oBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;gBACtE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBACpB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,qBAAgB,GAAG,KAAK,EAAE,KAAY,EAAE,EAAE;YACxC,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACzB,CAAC,CAAC;mCAlF4B,EAAE;0BACC,GAAG,EAAE,GAAE,CAAC;sBACT;YAC9B,MAAM,EAAE,EAAE;YACV,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,EAAE;SACV;oCAC+D,EAAE;iCACtC,EAAE;6BACN,EAAE;gCACC,aAAa;sCACP,KAAK;oCACP,EAAE;qBAIhB,KAAK;qBACL,EAAE;6BACM,EAAE;;IAM3B,gBAAgB;QACd,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACvC,CAAC;IAwDD,MAAM;QACJ,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QACtE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACxE,OAAO,CACL,6DAAM,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,gBAAgB;YAC1D,gFAAyB,KAAK,EAAE,IAAI,CAAC,aAAa,GAAI;YACtD,4DAAK,KAAK,EAAC,iBAAiB;gBAC1B,0EACE,YAAY,EAAE,kBAAkB,yBACX,IAAI,CAAC,iBAAiB,EAC3C,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,mBAAmB,EAAE,IAAI,CAAC,iBAAiB,uBACxB,IAAI,CAAC,gBAAgB,EACxC,KAAK,EAAE,IAAI,CAAC,KAAK,+BACU,IAAI,CAAC,sBAAsB,GACtD,CACE;YACL,IAAI,CAAC,KAAK,IAAI,CACb,kFAA2B,YAAY,EAAC,8BAA8B,GAAG,CAC1E,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n State,\n Event,\n type EventEmitter,\n h,\n} from '@stencil/core';\nimport {\n type CoreConfigSDK,\n CoreSDK as SearchcraftCore,\n} from '@searchcraft/core';\n\nimport type { ScInputCustomEvent } from '@components/searchcraft-input/searchcraft-input';\nimport { parseCustomStyles } from '@utils/utils';\nimport { useSearchcraftStore } from '@provider/store';\n\n@Component({\n tag: 'searchcraft-auto-search-form',\n styleUrl: 'searchcraft-auto-search-form.module.scss',\n shadow: true,\n})\nexport class SearchcraftAutoSearchForm {\n @Prop() autoSearchFormClass = '';\n @Prop() clearInput: () => void = () => {};\n @Prop() config: CoreConfigSDK = {\n apiKey: '',\n endpointURL: '',\n index: [],\n };\n @Prop() customStylesForInput: string | Record<string, string> = {};\n @Prop() inputCaptionValue = '';\n @Prop() labelForInput = '';\n @Prop() placeholderValue = 'Search here';\n @Prop() rightToLeftOrientation = false;\n @Prop() searchContainerClass = '';\n\n @Event() querySubmit: EventEmitter<string>;\n\n @State() error = false;\n @State() query = '';\n @State() searchResults = '';\n\n private debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n private debounceDelay = 300; // 300ms debounce delay\n private searchStore = useSearchcraftStore.getState();\n\n componentDidLoad() {\n const searchcraft = new SearchcraftCore(this.config);\n this.searchStore.initialize(searchcraft, true);\n console.log('Component initialized');\n }\n\n handleInputChange = (event: ScInputCustomEvent<string>) => {\n this.query = event.detail;\n this.querySubmit.emit(this.query);\n\n // Clear the previous debounce timeout\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n // Set a new debounce timeout\n this.debounceTimeout = setTimeout(() => {\n console.log('Debounced search triggered');\n this.runSearch();\n }, this.debounceDelay);\n };\n\n handleClearInput = () => {\n this.query = '';\n console.log('Input cleared');\n\n if (typeof this.clearInput === 'function') {\n this.clearInput();\n }\n\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n this.error = false;\n this.searchResults = '';\n };\n\n private runSearch = async () => {\n if (this.query.trim() === '') {\n this.error = true;\n this.searchResults = '';\n } else {\n this.error = false;\n this.searchStore.setQuery(this.query);\n\n try {\n await this.searchStore.search();\n this.searchResults = JSON.stringify(this.searchStore.searchResults);\n } catch (error) {\n this.error = true;\n }\n }\n };\n\n handleFormSubmit = async (event: Event) => {\n event.preventDefault();\n await this.runSearch();\n };\n\n render() {\n const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';\n const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);\n return (\n <form class={`${formClass}`} onSubmit={this.handleFormSubmit}>\n <searchcraft-input-label label={this.labelForInput} />\n <div class='searchContainer'>\n <searchcraft-input\n customStyles={parsedCustomStyles}\n input-caption-value={this.inputCaptionValue}\n onClearInput={this.handleClearInput}\n onSearchInputChange={this.handleInputChange}\n placeholder-value={this.placeholderValue}\n query={this.query}\n right-to-left-orientation={this.rightToLeftOrientation}\n />\n </div>\n {this.error && (\n <searchcraft-error-message errorMessage='Please enter a search query.' />\n )}\n </form>\n );\n }\n}\n"]}
|