@searchcraft/javascript-sdk 0.3.0 → 0.3.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-6c5282a0.js → index-264ebadc.js} +290 -9
- package/dist/cjs/index-264ebadc.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-35d3b670.js +68 -0
- package/dist/cjs/package-35d3b670.js.map +1 -0
- package/dist/cjs/{searchcraft-auto-search-form_19.cjs.entry.js → searchcraft-auto-search-form_17.cjs.entry.js} +126 -120
- package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +13 -5
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +1 -1
- package/dist/cjs/searchcraft-button.cjs.entry.js +4 -4
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js +22 -0
- package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-spinner-light.cjs.entry.js +22 -0
- package/dist/cjs/searchcraft-spinner-light.cjs.entry.js.map +1 -0
- package/dist/cjs/store-e3bbdd49.js +1022 -0
- package/dist/cjs/store-e3bbdd49.js.map +1 -0
- package/dist/collection/assets/searchcraft-button-icons.js.map +1 -1
- package/dist/collection/assets/searchcraft-check-icon.js.map +1 -1
- package/dist/collection/assets/searchcraft-clear-icon-set.js.map +1 -1
- package/dist/collection/assets/searchcraft-dash-icon.js.map +1 -1
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +1 -1
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +18 -10
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +17 -10
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +76 -26
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +42 -22
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +50 -10
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +2 -3
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +4 -33
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +4 -5
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +1 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +3 -3
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +3 -4
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +6 -10
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +1 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +26 -25
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +20 -21
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -1
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +44 -52
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +2 -3
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +1 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +2 -2
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +1 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +2 -2
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +1 -2
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +5 -3
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +14 -4
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +34 -8
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +37 -23
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +1 -1
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +4 -2
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +7 -7
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/store.js +1 -0
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/{p-8c38185e.js → p-4f939ba2.js} +7 -7
- package/dist/components/p-4f939ba2.js.map +1 -0
- package/dist/components/{p-498c7ef9.js → p-5015a359.js} +4 -5
- package/dist/components/p-5015a359.js.map +1 -0
- package/dist/components/{p-27a6ca57.js → p-54848b4d.js} +35 -48
- package/dist/components/p-54848b4d.js.map +1 -0
- package/dist/components/{p-a3bd1bc8.js → p-5a872bdf.js} +2 -2
- package/dist/components/{p-a3bd1bc8.js.map → p-5a872bdf.js.map} +1 -1
- package/dist/components/{p-7d1bcd2d.js → p-62c40862.js} +5 -2
- package/dist/components/p-62c40862.js.map +1 -0
- package/dist/components/{p-70722ab2.js → p-62e6b69c.js} +2 -2
- package/dist/components/{p-70722ab2.js.map → p-62e6b69c.js.map} +1 -1
- package/dist/components/{p-6237f03e.js → p-69ee3b9a.js} +5 -6
- package/dist/components/p-69ee3b9a.js.map +1 -0
- package/dist/components/{p-7498e493.js → p-6b353c3e.js} +290 -9
- package/dist/components/p-6b353c3e.js.map +1 -0
- package/dist/components/p-727bfc38.js +925 -0
- package/dist/components/p-727bfc38.js.map +1 -0
- package/dist/components/{p-bc3f9025.js → p-7c280820.js} +2 -2
- package/dist/components/{p-bc3f9025.js.map → p-7c280820.js.map} +1 -1
- package/dist/components/{p-4468fba3.js → p-7d385ffb.js} +7 -8
- package/dist/components/p-7d385ffb.js.map +1 -0
- package/dist/components/p-8524c749.js +54 -0
- package/dist/components/p-8524c749.js.map +1 -0
- package/dist/components/{p-e5471fcf.js → p-aad03c2a.js} +2 -2
- package/dist/components/{p-e5471fcf.js.map → p-aad03c2a.js.map} +1 -1
- package/dist/components/p-b0c1fd63.js +66 -0
- package/dist/components/p-b0c1fd63.js.map +1 -0
- package/dist/components/{p-ae84b899.js → p-b38d171d.js} +5 -6
- package/dist/components/p-b38d171d.js.map +1 -0
- package/dist/components/{p-d3187f5a.js → p-bbf9973a.js} +2 -2
- package/dist/components/{p-d3187f5a.js.map → p-bbf9973a.js.map} +1 -1
- package/dist/components/p-cd9a038a.js +105 -0
- package/dist/components/p-cd9a038a.js.map +1 -0
- package/dist/components/searchcraft-auto-search-form.js +32 -36
- package/dist/components/searchcraft-auto-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-form.js +34 -33
- package/dist/components/searchcraft-base-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +21 -15
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button-icon.js +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-check-icon.js +1 -1
- package/dist/components/searchcraft-clear-icon-set.js +1 -1
- package/dist/components/searchcraft-clear-input-button.js +1 -1
- package/dist/components/searchcraft-dash-icon.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-filters-list.js +12 -16
- package/dist/components/searchcraft-filters-list.js.map +1 -1
- package/dist/components/searchcraft-input-caption.js +1 -1
- package/dist/components/searchcraft-input-icon.js +1 -1
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-input.js +1 -1
- package/dist/components/searchcraft-results-info.js +9 -7
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-icon-set.js +1 -1
- package/dist/components/searchcraft-slider.js +20 -11
- package/dist/components/searchcraft-slider.js.map +1 -1
- package/dist/components/searchcraft-spinner-dark.js +1 -1
- package/dist/components/searchcraft-spinner-light.js +29 -1
- package/dist/components/searchcraft-spinner-light.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +8 -6
- package/dist/components/searchcraft-toggle-button.js.map +1 -1
- package/dist/esm/{index-0ac5bb53.js → index-d851fb46.js} +290 -9
- package/dist/esm/index-d851fb46.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-82baadd7.js +66 -0
- package/dist/esm/package-82baadd7.js.map +1 -0
- package/dist/esm/{searchcraft-auto-search-form_19.entry.js → searchcraft-auto-search-form_17.entry.js} +125 -117
- package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +1 -0
- package/dist/esm/searchcraft-base-search-form.entry.js +13 -5
- package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-button-icon.entry.js +1 -1
- package/dist/esm/searchcraft-button.entry.js +4 -4
- package/dist/esm/searchcraft-button.entry.js.map +1 -1
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/searchcraft-spinner-dark.entry.js +18 -0
- package/dist/esm/searchcraft-spinner-dark.entry.js.map +1 -0
- package/dist/esm/searchcraft-spinner-light.entry.js +18 -0
- package/dist/esm/searchcraft-spinner-light.entry.js.map +1 -0
- package/dist/esm/store-b519dd0b.js +1011 -0
- package/dist/esm/store-b519dd0b.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-5ec960bd.entry.js → p-99356c9a.entry.js} +2 -2
- package/dist/searchcraft-javascript-sdk/p-b0c1fd63.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-b0c1fd63.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-b42eaa55.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-b42eaa55.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +2 -2
- package/dist/types/components/searchcraft-base-search-form/searchcraft-base-search-form.d.ts +2 -2
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +6 -3
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +3 -0
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +0 -6
- package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +1 -1
- package/dist/types/components/searchcraft-input/searchcraft-input.d.ts +3 -3
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +5 -0
- package/dist/types/components.d.ts +48 -22
- package/dist/types/provider/store.d.ts +2 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/index-6c5282a0.js.map +0 -1
- package/dist/cjs/searchcraft-auto-search-form_19.cjs.entry.js.map +0 -1
- package/dist/cjs/store-f3bec622.js +0 -406
- package/dist/cjs/store-f3bec622.js.map +0 -1
- package/dist/components/p-07edaa9b.js +0 -67
- package/dist/components/p-07edaa9b.js.map +0 -1
- package/dist/components/p-27a6ca57.js.map +0 -1
- package/dist/components/p-4468fba3.js.map +0 -1
- package/dist/components/p-498c7ef9.js.map +0 -1
- package/dist/components/p-6237f03e.js.map +0 -1
- package/dist/components/p-7498e493.js.map +0 -1
- package/dist/components/p-7d1bcd2d.js.map +0 -1
- package/dist/components/p-8c38185e.js.map +0 -1
- package/dist/components/p-ae84b899.js.map +0 -1
- package/dist/components/p-bfb22305.js +0 -33
- package/dist/components/p-bfb22305.js.map +0 -1
- package/dist/components/p-c31274dd.js +0 -89
- package/dist/components/p-c31274dd.js.map +0 -1
- package/dist/components/p-ff049f0a.js +0 -313
- package/dist/components/p-ff049f0a.js.map +0 -1
- package/dist/esm/index-0ac5bb53.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_19.entry.js.map +0 -1
- package/dist/esm/store-6af9ea01.js +0 -396
- package/dist/esm/store-6af9ea01.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-05416a3e.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-05416a3e.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-0880cfbb.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-0880cfbb.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-1ab836bf.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-1ab836bf.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-3cb77ee1.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-3cb77ee1.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-72382d90.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-72382d90.entry.js.map +0 -1
- /package/dist/searchcraft-javascript-sdk/{p-5ec960bd.entry.js.map → p-99356c9a.entry.js.map} +0 -0
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const store = require('./store-f3bec622.js');
|
|
5
|
+
const index = require('./index-264ebadc.js');
|
|
7
6
|
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
+
const store = require('./store-e3bbdd49.js');
|
|
8
|
+
const _package = require('./package-35d3b670.js');
|
|
8
9
|
|
|
9
10
|
const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{font-family:var(--font-stack);text-align:left;width:100%}.formRTL{font-family:var(--font-stack);text-align:right;width:100%}";
|
|
10
11
|
const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
|
|
@@ -22,6 +23,7 @@ const SearchcraftAutoSearchForm = class {
|
|
|
22
23
|
this.searchStore.setQuery(this.query);
|
|
23
24
|
if (this.query.trim() === '') {
|
|
24
25
|
this.searchResults = null;
|
|
26
|
+
this.inputClearedOrNoResults.emit();
|
|
25
27
|
this.searchStore.setSearchResults(null);
|
|
26
28
|
}
|
|
27
29
|
};
|
|
@@ -38,6 +40,7 @@ const SearchcraftAutoSearchForm = class {
|
|
|
38
40
|
if (this.query.trim() === '') {
|
|
39
41
|
this.searchResults = null;
|
|
40
42
|
this.searchStore.setSearchResults(null);
|
|
43
|
+
this.inputClearedOrNoResults.emit();
|
|
41
44
|
}
|
|
42
45
|
else {
|
|
43
46
|
this.searchStore.setQuery(this.query);
|
|
@@ -88,9 +91,11 @@ const SearchcraftAutoSearchForm = class {
|
|
|
88
91
|
this.autoSearchFormClass = '';
|
|
89
92
|
this.clearInput = () => { };
|
|
90
93
|
this.config = {
|
|
91
|
-
|
|
94
|
+
readKey: '',
|
|
92
95
|
endpointURL: '',
|
|
93
96
|
index: [],
|
|
97
|
+
organizationId: '',
|
|
98
|
+
applicationId: '',
|
|
94
99
|
};
|
|
95
100
|
this.customStylesForInput = {};
|
|
96
101
|
this.inputCaptionValue = '';
|
|
@@ -106,7 +111,10 @@ const SearchcraftAutoSearchForm = class {
|
|
|
106
111
|
this.searchResults = null;
|
|
107
112
|
}
|
|
108
113
|
componentDidLoad() {
|
|
109
|
-
const searchcraft = new store.
|
|
114
|
+
const searchcraft = new store.ie(this.config, {
|
|
115
|
+
sdkName: _package.packageJson.name,
|
|
116
|
+
sdkVersion: _package.packageJson.version,
|
|
117
|
+
});
|
|
110
118
|
this.searchStore.initialize(searchcraft, true);
|
|
111
119
|
this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
|
|
112
120
|
this.isRequesting = state.isRequesting;
|
|
@@ -121,12 +129,12 @@ const SearchcraftAutoSearchForm = class {
|
|
|
121
129
|
render() {
|
|
122
130
|
const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
|
|
123
131
|
const parsedCustomStyles = store.parseCustomStyles(this.customStylesForInput);
|
|
124
|
-
return (index.h("form", { key: '
|
|
132
|
+
return (index.h("form", { key: '3f8e9a36e827b3f1f8d591622a1c824e7ccc6f83', class: index$1.classNames(`${formClass}`, 'searchcraft-auto-search-form'), onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: 'daf9b6aab7185e045891a975ac70a3bf3b7ff75f', label: this.labelForInput }), index.h("searchcraft-input", { key: '655e92d562a73dcf9857f24075c65c6bbe2215f5', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, "is-requesting": this.isRequesting, onClearInput: this.handleClearInput, onInputKeyUp: this.handleInputKeyUp, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation }), this.error && (index.h("searchcraft-error-message", { key: '988624eb1ff71adde2a2e38ab8adb868a5a12469', errorMessage: 'Please enter a search query.' }))));
|
|
125
133
|
}
|
|
126
134
|
};
|
|
127
135
|
SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
|
|
128
136
|
|
|
129
|
-
const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#
|
|
137
|
+
const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#F7F7F7}@media (min-width: 900px){.interactiveResultContainerLight{flex-direction:row;justify-content:space-between}}.interactiveResultContainerDark{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#2E2E2E}@media (min-width: 900px){.interactiveResultContainerDark{flex-direction:row;justify-content:space-between}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px;all:unset;display:inline;color:inherit;text-decoration:none}.resultContainer:hover{cursor:pointer}@media (min-width: 900px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 900px){.interactiveIconLarge{display:none}}.interactiveIconSmall{display:inline-block;position:absolute;right:5px;top:-2px}@media (min-width: 900px){.interactiveIconSmall{display:none}}.imageContainer{max-width:100%}@media (min-width: 900px){.imageContainer{max-width:400px}}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 900px){.contentContainer{max-width:50%}}.secondaryContentContainer{display:flex}.imageLight{border-radius:8px;max-height:100%;max-width:100%}.imageDark{border-radius:8px;max-height:100%;max-width:100%}.titleLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;-webkit-font-smoothing:antialiased;color:#292929}.titleDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;-webkit-font-smoothing:antialiased;color:#FFFFFF}.subtitleContentLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#737373}.subtitleContentDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.tertiaryContentLight.hasContent::before{color:#404040;content:\"•\";font-size:10px;margin-left:5px;margin-right:5px}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.tertiaryContentDark.hasContent::before{color:#404040;content:\"•\";font-size:10px;margin-left:5px;margin-right:5px}";
|
|
130
138
|
const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
|
|
131
139
|
|
|
132
140
|
const SearchcraftBaseSearchResult = class {
|
|
@@ -135,49 +143,62 @@ const SearchcraftBaseSearchResult = class {
|
|
|
135
143
|
this.buttonCallback = index.createEvent(this, "buttonCallback", 7);
|
|
136
144
|
this.keyDownCallback = index.createEvent(this, "keyDownCallback", 7);
|
|
137
145
|
this.resultCallback = index.createEvent(this, "resultCallback", 7);
|
|
138
|
-
this.buttonCallback = () => { };
|
|
139
|
-
this.keyDownCallback = () => { };
|
|
140
|
-
this.resultCallback = () => { };
|
|
146
|
+
this.buttonCallback = () => { };
|
|
147
|
+
this.keyDownCallback = () => { };
|
|
148
|
+
this.resultCallback = () => { };
|
|
149
|
+
this.searchcraftStore = store.useSearchcraftStore.getState();
|
|
141
150
|
this.handleButtonClick = () => {
|
|
142
151
|
this.buttonCallback();
|
|
143
152
|
};
|
|
144
|
-
this.
|
|
145
|
-
|
|
146
|
-
|
|
153
|
+
this.handleClick = () => {
|
|
154
|
+
var _a, _b, _c;
|
|
155
|
+
const searchcraft = this.searchcraftStore.getSearchcraftInstance();
|
|
156
|
+
if (searchcraft) {
|
|
157
|
+
const document_position = this.documentPosition;
|
|
158
|
+
const search_term = this.searchcraftStore.query;
|
|
159
|
+
const number_of_documents = ((_c = (_b = (_a = this.searchcraftStore.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
|
|
160
|
+
searchcraft.sendMeasureEvent('document_clicked', {
|
|
161
|
+
document_position,
|
|
162
|
+
number_of_documents,
|
|
163
|
+
search_term,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
this.parseStyles = () => {
|
|
168
|
+
try {
|
|
169
|
+
return JSON.parse(this.customStyles);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
console.error('Error parsing custom styles:', error);
|
|
173
|
+
return {};
|
|
147
174
|
}
|
|
148
175
|
};
|
|
149
176
|
this.buttonText = '';
|
|
150
177
|
this.customStyles = '{}';
|
|
151
|
-
this.
|
|
178
|
+
this.titleContent = '';
|
|
152
179
|
this.imageDescription = '';
|
|
153
180
|
this.imageSource = '';
|
|
154
181
|
this.isInteractive = false;
|
|
182
|
+
this.linkHref = '';
|
|
155
183
|
this.primaryContent = '';
|
|
156
184
|
this.secondaryContent = '';
|
|
157
|
-
this.
|
|
185
|
+
this.subtitleContent = '';
|
|
158
186
|
this.tertiaryContent = '';
|
|
159
187
|
this.themeMode = 'light';
|
|
160
188
|
this.placeImageRight = false;
|
|
161
|
-
|
|
162
|
-
parseStyles() {
|
|
163
|
-
try {
|
|
164
|
-
return JSON.parse(this.customStyles);
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
console.error('Error parsing custom styles:', error);
|
|
168
|
-
return {};
|
|
169
|
-
}
|
|
189
|
+
this.documentPosition = 0;
|
|
170
190
|
}
|
|
171
191
|
render() {
|
|
172
192
|
const isLightTheme = this.themeMode === 'light';
|
|
173
193
|
const styles = this.parseStyles();
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
|
|
194
|
+
const imageStyle = isLightTheme ? 'imageLight' : 'imageDark';
|
|
195
|
+
const imageContainer = this.imageSource && (index.h("div", { key: '53541a311548a653d43505356b9a4f25a417093f', class: index$1.classNames('imageContainer', 'searchcraft-base-search-result-image-container') }, index.h("img", { key: '919a46fd856b521a548c2ce6bab8b360507469c2', alt: this.imageDescription, class: index$1.classNames(imageStyle, 'searchcraft-search-result-image'), src: this.imageSource, style: styles.image || {} })));
|
|
196
|
+
const contentContainer = (index.h("div", { key: '944700daf2a0b683769bad992253a8482f71f685', class: index$1.classNames('contentContainer', 'searchcraft-base-search-result-content-container') }, index.h("h2", { key: '623096e2c7cf5f11bac7127cb00342386866089e', class: index$1.classNames(isLightTheme ? 'titleLight' : 'titleDark', 'searchcraft-base-search-result-title'), style: styles.title || {} }, this.titleContent), index.h("h3", { key: '2928f4d872e90d99fac31b75c9fecfee7e2a9a41', class: index$1.classNames(isLightTheme ? 'subtitleContentLight' : 'subtitleContentDark', 'searchcraft-base-search-result-subtitle'), style: styles.subtitle || {} }, this.subtitleContent), index.h("p", { key: '93bd00c9482d492a2d3d6262dba33044d4470d2c', class: index$1.classNames(isLightTheme ? 'primaryContentLight' : 'primaryContentDark', 'searchcraft-base-search-result-primary-content'), style: styles.primaryContent || {} }, this.primaryContent), index.h("div", { key: 'dc3bce7c0f75d121ba3068b3717fd5d934036012', class: index$1.classNames('secondaryContentContainer', 'searchcraft-base-search-result-secondary-content-container') }, index.h("p", { key: '80624ec83a0a7086142b6a35b4ac65d1fdb76a4e', class: index$1.classNames(isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark', 'searchcraft-base-search-result-secondary-content'), style: styles.secondaryContent || {} }, this.secondaryContent), index.h("p", { key: '53bdb3471b16fd4a1f525d99472c3a4d5662b722', class: index$1.classNames(`${isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'}${this.tertiaryContent ? ' hasContent' : ''}`, 'searchcraft-base-search-result-tertiary-content'), style: styles.tertiaryContent || {} }, this.tertiaryContent)), this.buttonText && (index.h("button", { key: '442dc9aebe748ef06710e196382a80bf006a383e', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText))));
|
|
197
|
+
return (index.h("a", { key: '2cf6a6d3768266f6d46e700588083aade92142f7', class: index$1.classNames(this.isInteractive
|
|
177
198
|
? isLightTheme
|
|
178
199
|
? 'interactiveResultContainerLight'
|
|
179
200
|
: 'interactiveResultContainerDark'
|
|
180
|
-
: 'resultContainer', onKeyDown: this.keyDownCallback, onClick: this.
|
|
201
|
+
: 'resultContainer', 'searchcraft-search-result-container'), onKeyDown: this.keyDownCallback, onClick: this.handleClick, href: this.linkHref, rel: 'noreferrer', style: styles.container || {}, tabindex: '0', target: '_blank' }, this.placeImageRight ? (index.h(index.Fragment, null, contentContainer, imageContainer)) : (index.h(index.Fragment, null, imageContainer, contentContainer))));
|
|
181
202
|
}
|
|
182
203
|
};
|
|
183
204
|
SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
|
|
@@ -188,6 +209,7 @@ const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss
|
|
|
188
209
|
const SearchcraftBaseSearchResults = class {
|
|
189
210
|
constructor(hostRef) {
|
|
190
211
|
index.registerInstance(this, hostRef);
|
|
212
|
+
this.noResults = index.createEvent(this, "noResults", 7);
|
|
191
213
|
this.adInterval = 4;
|
|
192
214
|
this.customStylesForResults = {};
|
|
193
215
|
this.documentAttributesForDisplay = '';
|
|
@@ -196,6 +218,7 @@ const SearchcraftBaseSearchResults = class {
|
|
|
196
218
|
this.placeAdAtEnd = false;
|
|
197
219
|
this.placeAdAtStart = true;
|
|
198
220
|
this.placeResultImageRight = false;
|
|
221
|
+
this.isInteractive = false;
|
|
199
222
|
this.hasSearched = false;
|
|
200
223
|
this.query = '';
|
|
201
224
|
this.searchResults = null;
|
|
@@ -226,9 +249,9 @@ const SearchcraftBaseSearchResults = class {
|
|
|
226
249
|
}
|
|
227
250
|
}
|
|
228
251
|
render() {
|
|
229
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
230
253
|
if (!this.hasSearched) {
|
|
231
|
-
return (index.h("div", { class: 'emptyState' }, index.h("slot", { name: 'empty-search' })));
|
|
254
|
+
return (index.h("div", { class: index$1.classNames('emptyState', 'searchcraft-search-results-empty-state-container') }, index.h("slot", { name: 'empty-search' })));
|
|
232
255
|
}
|
|
233
256
|
if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
234
257
|
return;
|
|
@@ -251,17 +274,17 @@ const SearchcraftBaseSearchResults = class {
|
|
|
251
274
|
}
|
|
252
275
|
}
|
|
253
276
|
}
|
|
254
|
-
return (index.h("searchcraft-base-search-result", { "button-callback": () => console.log('button callback'), "custom-styles": serializedStyles, "image-source": dynamicProperties[parsedSearchKeys[
|
|
277
|
+
return (index.h("searchcraft-base-search-result", { "button-callback": () => console.log('button callback'), "custom-styles": serializedStyles, "image-source": dynamicProperties[parsedSearchKeys[5]], "is-interactive": this.isInteractive, key: `${document.document_id}-${index$1}`, "keydown-callback": () => console.log('keydown'), linkHref: dynamicProperties[parsedSearchKeys[6]], "place-image-right": this.placeResultImageRight, "primary-content": dynamicProperties[parsedSearchKeys[2]], "result-callback": () => console.log('interactive element'), "secondary-content": dynamicProperties[parsedSearchKeys[3]], "subtitle-content": dynamicProperties[parsedSearchKeys[1]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]], "title-content": dynamicProperties[parsedSearchKeys[0]], "document-position": index$1 }));
|
|
255
278
|
});
|
|
256
279
|
const finalComponents = [];
|
|
257
280
|
if (this.placeAdAtStart) {
|
|
258
|
-
finalComponents.push(index.h("div", { key: 'ad-section-start', class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
|
|
281
|
+
finalComponents.push(index.h("div", { key: 'ad-section-start', class: index$1.classNames('adSection', 'searchcraft-beginning-injected-ad-section') }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
|
|
259
282
|
}
|
|
260
283
|
if (this.adInterval > 0) {
|
|
261
|
-
resultsComponents.forEach((component, index$
|
|
284
|
+
resultsComponents.forEach((component, index$2) => {
|
|
262
285
|
finalComponents.push(component);
|
|
263
|
-
if ((index$
|
|
264
|
-
finalComponents.push(index.h("div", { key: `ad-section-${index$
|
|
286
|
+
if ((index$2 + 1) % this.adInterval === 0) {
|
|
287
|
+
finalComponents.push(index.h("div", { key: `ad-section-${index$2 + 1}`, class: index$1.classNames('adSection', 'searchcraft-dynamic-injected-ad-section') }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
|
|
265
288
|
}
|
|
266
289
|
});
|
|
267
290
|
}
|
|
@@ -269,10 +292,13 @@ const SearchcraftBaseSearchResults = class {
|
|
|
269
292
|
finalComponents.push(...resultsComponents);
|
|
270
293
|
}
|
|
271
294
|
if (this.placeAdAtEnd) {
|
|
272
|
-
finalComponents.push(index.h("div", { key: 'ad-section-end', class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
|
|
295
|
+
finalComponents.push(index.h("div", { key: 'ad-section-end', class: index$1.classNames('adSection', 'searchcraft-end-injected-ad-section') }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
|
|
296
|
+
}
|
|
297
|
+
if (this.query.length > 0 && ((_g = (_f = (_e = this.searchResults) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.hits) === null || _g === void 0 ? void 0 : _g.length) === 0) {
|
|
298
|
+
this.noResults.emit();
|
|
273
299
|
}
|
|
274
|
-
return (index.h("div", { class: 'resultsContainer' }, finalComponents, this.query.length > 0 &&
|
|
275
|
-
((
|
|
300
|
+
return (index.h("div", { class: index$1.classNames('resultsContainer', 'searchcraft-search-results-container') }, finalComponents, this.query.length > 0 &&
|
|
301
|
+
((_k = (_j = (_h = this.searchResults) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.hits) === null || _k === void 0 ? void 0 : _k.length) === 0 && (index.h("div", { class: index$1.classNames('errorMessageContainer', 'searchcraft-search-results-error-message-container') }, index.h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })))));
|
|
276
302
|
}
|
|
277
303
|
};
|
|
278
304
|
SearchcraftBaseSearchResults.style = SearchcraftBaseSearchResultsStyle0;
|
|
@@ -307,13 +333,16 @@ const SearchcraftClearIconSet = class {
|
|
|
307
333
|
}
|
|
308
334
|
};
|
|
309
335
|
|
|
310
|
-
const searchcraftClearInputButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:
|
|
336
|
+
const searchcraftClearInputButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:16px;top:52%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:0px;padding:0;position:absolute;top:52%;transform:translateY(-50%);width:20px}";
|
|
311
337
|
const SearchcraftClearInputButtonStyle0 = searchcraftClearInputButtonModuleCss;
|
|
312
338
|
|
|
313
339
|
const SearchcraftClearInputButton = class {
|
|
314
340
|
constructor(hostRef) {
|
|
315
341
|
index.registerInstance(this, hostRef);
|
|
316
342
|
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
343
|
+
this.isLightTheme = () => {
|
|
344
|
+
return this.theme === 'light';
|
|
345
|
+
};
|
|
317
346
|
this.handleClearClick = (event) => {
|
|
318
347
|
event.preventDefault();
|
|
319
348
|
this.clearInput.emit();
|
|
@@ -322,11 +351,8 @@ const SearchcraftClearInputButton = class {
|
|
|
322
351
|
this.rightToLeftOrientation = false;
|
|
323
352
|
this.theme = 'light';
|
|
324
353
|
}
|
|
325
|
-
isLightTheme() {
|
|
326
|
-
return this.theme === 'light';
|
|
327
|
-
}
|
|
328
354
|
render() {
|
|
329
|
-
return this.rightToLeftOrientation ? (index.h("button", { class: index$1.classNames('inputClearButtonRTL', '
|
|
355
|
+
return this.rightToLeftOrientation ? (index.h("button", { class: index$1.classNames('inputClearButtonRTL', 'searchcraft-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (index.h("button", { class: index$1.classNames('inputClearButtonLTR', 'searchcraft-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
|
|
330
356
|
}
|
|
331
357
|
};
|
|
332
358
|
SearchcraftClearInputButton.style = SearchcraftClearInputButtonStyle0;
|
|
@@ -351,12 +377,12 @@ const SearchcraftErrorMessage = class {
|
|
|
351
377
|
}
|
|
352
378
|
render() {
|
|
353
379
|
const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
|
|
354
|
-
return (index.h("p", { key: '
|
|
380
|
+
return (index.h("p", { key: '877438178c5fe951ff4cd184de7130e4e46739a1', class: index$1.classNames(errorMessageStyle, 'searchcraft-error-message') }, this.errorMessage || 'Search term is required.'));
|
|
355
381
|
}
|
|
356
382
|
};
|
|
357
383
|
SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
|
|
358
384
|
|
|
359
|
-
const searchcraftFiltersListModuleCss = ".
|
|
385
|
+
const searchcraftFiltersListModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:var(--font-stack);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EBEBEB;border:1px solid #D9D9D9;border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid #000000}.filterCheckboxLabel input[type=checkbox]:checked{background-color:#000000;position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:var(--font-stack);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EBEBEB;border:1px solid #D9D9D9;border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid #000000}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:#000000;position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}";
|
|
360
386
|
const SearchcraftFiltersListStyle0 = searchcraftFiltersListModuleCss;
|
|
361
387
|
|
|
362
388
|
const SearchcraftFiltersList = class {
|
|
@@ -370,6 +396,7 @@ const SearchcraftFiltersList = class {
|
|
|
370
396
|
this.searchStore.setSelectedFilters([]);
|
|
371
397
|
this.emitFiltersUpdate();
|
|
372
398
|
};
|
|
399
|
+
this.formatLabel = (label, count) => `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
373
400
|
this.filters = [];
|
|
374
401
|
this.dynamicFilters = [];
|
|
375
402
|
this.selectedFilters = [];
|
|
@@ -424,7 +451,6 @@ const SearchcraftFiltersList = class {
|
|
|
424
451
|
const parentFilter = this.dynamicFilters.find((filter) => filter.value === value);
|
|
425
452
|
const childValues = ((_a = parentFilter === null || parentFilter === void 0 ? void 0 : parentFilter.children) === null || _a === void 0 ? void 0 : _a.map((child) => child.value)) || [];
|
|
426
453
|
if (!isChecked) {
|
|
427
|
-
// Remove children from selectedFilters when parent is unchecked
|
|
428
454
|
this.selectedFilters = this.selectedFilters.filter((filter) => filter !== value && !childValues.includes(filter));
|
|
429
455
|
}
|
|
430
456
|
else {
|
|
@@ -443,23 +469,19 @@ const SearchcraftFiltersList = class {
|
|
|
443
469
|
this.searchStore.setSelectedFilters(this.selectedFilters);
|
|
444
470
|
this.searchStore.search();
|
|
445
471
|
}
|
|
446
|
-
formatLabel(label, count) {
|
|
447
|
-
return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
448
|
-
}
|
|
449
472
|
render() {
|
|
450
473
|
if (!this.query || this.resultsCount === 0) {
|
|
451
474
|
return null;
|
|
452
475
|
}
|
|
453
|
-
return (index.h("div", { class: '
|
|
476
|
+
return (index.h("div", { class: index$1.classNames('filtersListContainer', 'searchcraft-filters-list-container') }, this.dynamicFilters.map((filter) => {
|
|
454
477
|
const isChildSelected = filter.children
|
|
455
478
|
? filter.children.some((child) => this.selectedFilters.includes(child.value))
|
|
456
479
|
: false;
|
|
457
|
-
return (index.h("div", { key: filter.value, class: '
|
|
458
|
-
marginLeft: '20px',
|
|
480
|
+
return (index.h("div", { key: filter.value, class: index$1.classNames('searchcraft-filters-list-item') }, index.h("label", { class: index$1.classNames('filterCheckboxLabel', 'searchcraft-filters-list-checkbox-label') }, index.h("input", { checked: this.selectedFilters.includes(filter.value), onChange: (event) => this.handleCheckboxChange(filter.value, event.target.checked, true), type: 'checkbox' }), isChildSelected ? (index.h("div", { class: index$1.classNames('dashContainer', 'searchcraft-filter-list-dash-container') }, index.h("searchcraft-dash-icon", null))) : (index.h("div", { class: index$1.classNames('checkContainer', 'searchcraft-filter-list-check-container') }, index.h("searchcraft-check-icon", null))), this.formatLabel(filter.label, filter.count)), filter.children && filter.children.length > 0 && (index.h(index.Fragment, null, filter.children.map((child) => (index.h("label", { key: child.value, class: index$1.classNames('childFilterCheckboxLabel', 'searchcraft-child-filter-checkbox-label'), style: {
|
|
459
481
|
display: this.selectedFilters.includes(filter.value)
|
|
460
482
|
? 'flex'
|
|
461
483
|
: 'none',
|
|
462
|
-
} }, index.h("input", {
|
|
484
|
+
} }, index.h("input", { checked: this.selectedFilters.includes(child.value), onChange: (event) => this.handleCheckboxChange(child.value, event.target.checked), type: 'checkbox' }), index.h("div", { class: index$1.classNames('checkContainer', 'searchcraft-filter-list-check-container') }, index.h("searchcraft-check-icon", null)), this.formatLabel(child.label.includes('/')
|
|
463
485
|
? child.label.split('/').pop() || child.label
|
|
464
486
|
: child.label, child.count))))))));
|
|
465
487
|
})));
|
|
@@ -467,7 +489,7 @@ const SearchcraftFiltersList = class {
|
|
|
467
489
|
};
|
|
468
490
|
SearchcraftFiltersList.style = SearchcraftFiltersListStyle0;
|
|
469
491
|
|
|
470
|
-
const searchcraftInputModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputContainerLTR{position:relative;width:100%}.inputContainerRTL{position:relative;width:100%;margin-left:8px}.inputLightLTR{border:none;border-radius:8px;font-family
|
|
492
|
+
const searchcraftInputModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputContainerLTR{position:relative;width:100%}.inputContainerRTL{position:relative;width:100%;margin-left:8px}.inputLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;margin-right:8px;padding-left:36px;padding-right:16px}.inputLightLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputLightLTR::placeholder{color:#737373}.inputLightLTR:focus{outline:2px solid #000000}.inputDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;margin-right:8px;padding-left:36px;padding-right:16px}.inputDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputDarkLTR::placeholder{color:#BFBFBF}.inputDarkLTR:focus{outline:2px solid #FFFFFF}.inputErrorLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;outline:2px solid #CC0000;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorLightLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorLightLTR::placeholder{color:#737373}.inputErrorLightLTR:focus{outline:2px solid #000000}.inputErrorLightLTR:focus-visible{outline:2px solid #CC0000}.inputErrorDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;outline:2px solid #FFB3B3;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorDarkLTR::placeholder{color:#BFBFBF}.inputErrorDarkLTR:focus{outline:2px solid #FFFFFF}.inputErrorDarkLTR:focus-visible{outline:2px solid #FFB3B3}.inputLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputLightRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputLightRTL::placeholder{color:#737373}.inputLightRTL:focus{outline:2px solid #000000}.inputDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputDarkRTL::placeholder{color:#BFBFBF}.inputDarkRTL:focus{outline:2px solid #FFFFFF}.inputErrorLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;outline:2px solid #CC0000;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorLightRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorLightRTL::placeholder{color:#737373}.inputErrorLightRTL:focus{outline:2px solid #000000}.inputErrorLightRTL:focus-visible{outline:2px solid #CC0000}.inputErrorDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;outline:2px solid #FFB3B3;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorDarkRTL::placeholder{color:#BFBFBF}.inputErrorDarkRTL:focus{outline:2px solid #FFFFFF}.inputErrorDarkRTL:focus-visible{outline:2px solid #FFB3B3}.inputWrapper{align-items:center;display:flex;position:relative;width:100%}";
|
|
471
493
|
const SearchcraftInputStyle0 = searchcraftInputModuleCss;
|
|
472
494
|
|
|
473
495
|
const SearchcraftInput = class {
|
|
@@ -476,6 +498,23 @@ const SearchcraftInput = class {
|
|
|
476
498
|
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
477
499
|
this.searchInputChange = index.createEvent(this, "searchInputChange", 7);
|
|
478
500
|
this.inputKeyUp = index.createEvent(this, "inputKeyUp", 7);
|
|
501
|
+
this.handleInputChange = (event) => {
|
|
502
|
+
const input = event.target;
|
|
503
|
+
this.searchInputChange.emit(input.value);
|
|
504
|
+
};
|
|
505
|
+
this.handleInputKeyUp = (event) => {
|
|
506
|
+
const input = event.target;
|
|
507
|
+
this.inputKeyUp.emit(input.value);
|
|
508
|
+
};
|
|
509
|
+
this.handleClearInput = () => {
|
|
510
|
+
if (this.query === '') {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
this.query = '';
|
|
514
|
+
if (this.clearInput) {
|
|
515
|
+
this.clearInput.emit();
|
|
516
|
+
}
|
|
517
|
+
};
|
|
479
518
|
this.customStyles = {};
|
|
480
519
|
this.error = false;
|
|
481
520
|
this.formClassName = '';
|
|
@@ -493,39 +532,22 @@ const SearchcraftInput = class {
|
|
|
493
532
|
get isLightTheme() {
|
|
494
533
|
return this.theme === 'light';
|
|
495
534
|
}
|
|
496
|
-
handleInputChange(event) {
|
|
497
|
-
const input = event.target;
|
|
498
|
-
this.searchInputChange.emit(input.value);
|
|
499
|
-
}
|
|
500
|
-
handleInputKeyUp(event) {
|
|
501
|
-
const input = event.target;
|
|
502
|
-
this.inputKeyUp.emit(input.value);
|
|
503
|
-
}
|
|
504
|
-
handleClearInput() {
|
|
505
|
-
if (this.query === '') {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
this.query = '';
|
|
509
|
-
if (this.clearInput) {
|
|
510
|
-
this.clearInput.emit();
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
535
|
render() {
|
|
514
536
|
const containerClassName = this.rightToLeftOrientation
|
|
515
537
|
? 'inputContainerRTL'
|
|
516
538
|
: 'inputContainerLTR';
|
|
517
|
-
const inputClassName =
|
|
539
|
+
const inputClassName = this.error
|
|
518
540
|
? this.isLightTheme
|
|
519
541
|
? 'inputErrorLightRTL'
|
|
520
542
|
: 'inputErrorDarkRTL'
|
|
521
543
|
: this.isLightTheme
|
|
522
544
|
? 'inputLightLTR'
|
|
523
|
-
: 'inputDarkLTR'
|
|
545
|
+
: 'inputDarkLTR';
|
|
524
546
|
const validatedCustomStyles = store.parseCustomStyles(this.customStyles);
|
|
525
547
|
const placeholderStyle = {
|
|
526
548
|
fontSize: validatedCustomStyles.placeholderFontSize || '16px',
|
|
527
549
|
};
|
|
528
|
-
return (index.h("div", { key: '
|
|
550
|
+
return (index.h("div", { key: '931c969802f73f4fa4d44ea591b506e5d1f9caf1', class: index$1.classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (index.h(index.Fragment, null, index.h("input", { autoComplete: 'off', class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), onKeyUp: this.handleInputKeyUp.bind(this), placeholder: this.placeholderValue, style: validatedCustomStyles, type: 'text', value: this.query }), index.h("style", null, `
|
|
529
551
|
#searchcraft-input-id::placeholder {
|
|
530
552
|
font-size: ${placeholderStyle.fontSize};
|
|
531
553
|
}
|
|
@@ -560,18 +582,18 @@ const SearchcraftInputCaption = class {
|
|
|
560
582
|
: 'inputCaptionErrorDarkRTL'
|
|
561
583
|
: this.isLightTheme
|
|
562
584
|
? 'inputCaptionLightRTL'
|
|
563
|
-
: 'inputCaptionDarkRTL', this.inputCaptionClassName, '
|
|
585
|
+
: 'inputCaptionDarkRTL', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue)) : (index.h("p", { class: index$1.classNames(this.error
|
|
564
586
|
? this.isLightTheme
|
|
565
587
|
? 'inputCaptionErrorLightLTR'
|
|
566
588
|
: 'inputCaptionErrorDarkLTR'
|
|
567
589
|
: this.isLightTheme
|
|
568
590
|
? 'inputCaptionLightLTR'
|
|
569
|
-
: 'inputCaptionDarkLTR', this.inputCaptionClassName, '
|
|
591
|
+
: 'inputCaptionDarkLTR', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue));
|
|
570
592
|
}
|
|
571
593
|
};
|
|
572
594
|
SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
|
|
573
595
|
|
|
574
|
-
const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:
|
|
596
|
+
const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:52%;transform:translateY(-50%)}.inputIconRTL{position:absolute;right:15px;top:52%;transform:translateY(-50%)}";
|
|
575
597
|
const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
|
|
576
598
|
|
|
577
599
|
const SearchcraftInputIcon = class {
|
|
@@ -587,12 +609,12 @@ const SearchcraftInputIcon = class {
|
|
|
587
609
|
return this.theme === 'light';
|
|
588
610
|
}
|
|
589
611
|
render() {
|
|
590
|
-
return this.error ? (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
|
|
612
|
+
return this.error ? (index.h("div", { class: index$1.classNames(this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR', 'searchcraft-input-icon-container') }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (index.h("div", { class: index$1.classNames(this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR', 'searchcraft-input-icon-container') }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
|
|
591
613
|
}
|
|
592
614
|
};
|
|
593
615
|
SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
|
|
594
616
|
|
|
595
|
-
const searchcraftInputLabelModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#
|
|
617
|
+
const searchcraftInputLabelModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFFFFF}";
|
|
596
618
|
const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
|
|
597
619
|
|
|
598
620
|
const SearchcraftInputLabel = class {
|
|
@@ -610,12 +632,12 @@ const SearchcraftInputLabel = class {
|
|
|
610
632
|
return null;
|
|
611
633
|
}
|
|
612
634
|
const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
|
|
613
|
-
return (index.h("label", { class: index$1.classNames(labelStyle, this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
|
|
635
|
+
return (index.h("label", { class: index$1.classNames(labelStyle, this.inputLabelClassName, 'searchcraft-input-label'), htmlFor: 'searchcraft-input-id' }, this.label));
|
|
614
636
|
}
|
|
615
637
|
};
|
|
616
638
|
SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
|
|
617
639
|
|
|
618
|
-
const searchcraftResultsInfoModuleCss = ".
|
|
640
|
+
const searchcraftResultsInfoModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsInfoContainer{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfoContent{color:#292929;font-family:var(--font-stack);font-size:18px;font-weight:600;line-height:20px;margin:24px 0 8px}@media (max-width: 900px){.resultsInfoContent{margin:0;margin-bottom:8px}}";
|
|
619
641
|
const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
|
|
620
642
|
|
|
621
643
|
const SearchcraftResultsInfo = class {
|
|
@@ -632,7 +654,7 @@ const SearchcraftResultsInfo = class {
|
|
|
632
654
|
this.isRequesting = state.isRequesting;
|
|
633
655
|
this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
|
|
634
656
|
this.responseTime = ((((_d = (_c = state.searchResults) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.time_taken) || 0) * 1000).toFixed(2);
|
|
635
|
-
this.query = state.query || '';
|
|
657
|
+
this.query = state.query || '';
|
|
636
658
|
});
|
|
637
659
|
}
|
|
638
660
|
disconnectedCallback() {
|
|
@@ -644,7 +666,8 @@ const SearchcraftResultsInfo = class {
|
|
|
644
666
|
if (!this.query || this.resultsCount === 0) {
|
|
645
667
|
return null;
|
|
646
668
|
}
|
|
647
|
-
|
|
669
|
+
const formattedResults = store.formatNumberWithCommas(this.resultsCount);
|
|
670
|
+
return (index.h("div", { class: index$1.classNames('resultsInfoContainer', 'searchcraft-results-info-container') }, index.h("p", { class: index$1.classNames('resultsInfoContent', 'searchcraft-results-info-content') }, formattedResults, " results found in ", this.responseTime, "ms")));
|
|
648
671
|
}
|
|
649
672
|
};
|
|
650
673
|
SearchcraftResultsInfo.style = SearchcraftResultsInfoStyle0;
|
|
@@ -673,15 +696,20 @@ const SearchcraftSearchIconSet = class {
|
|
|
673
696
|
}
|
|
674
697
|
};
|
|
675
698
|
|
|
676
|
-
const searchcraftSliderModuleCss = ".sliderContainer{display:flex;flex-direction:column;gap:10px;
|
|
699
|
+
const searchcraftSliderModuleCss = ".sliderContainer{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.rangeContainer{align-items:center;background-color:#D9D9D9;border-radius:999px;display:flex;position:relative;height:4px;width:100%}.rangeContainer::-webkit-slider-runnable-track{pointer-events:none}.rangeContainer .activeRange{background-color:#000000;border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.rangeContainer .activeRange::-webkit-slider-runnable-track{pointer-events:none}.rangeContainer .activeRange::-moz-range-track{pointer-events:none}.rangeContainer .rangeSlider{appearance:none;background:transparent;border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.rangeContainer .rangeSlider::-webkit-slider-thumb{background-color:#FFFFFF;border-radius:50%;border:2px solid #E6E6E6;cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.rangeContainer .rangeSlider::-moz-range-thumb{background-color:#FFFFFF;border-radius:50%;border:2px solid #E6E6E6;cursor:pointer;height:20px;pointer-events:all;width:20px}.yearLabels{color:#292929;display:flex;font-family:\"Source Sans Pro\", sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.yearLabel{min-width:30px;text-align:center}";
|
|
677
700
|
const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
|
|
678
701
|
|
|
679
702
|
const SearchcraftSlider = class {
|
|
680
703
|
constructor(hostRef) {
|
|
681
704
|
index.registerInstance(this, hostRef);
|
|
705
|
+
this.rangeChanged = index.createEvent(this, "rangeChanged", 7);
|
|
682
706
|
this.searchStore = store.useSearchcraftStore.getState();
|
|
683
707
|
this.updateYears = async () => {
|
|
684
708
|
this.searchStore.setYearsRange([this.startYear, this.endYear]);
|
|
709
|
+
this.rangeChanged.emit({
|
|
710
|
+
startYear: this.startYear,
|
|
711
|
+
endYear: this.endYear,
|
|
712
|
+
});
|
|
685
713
|
try {
|
|
686
714
|
if (typeof this.query === 'string' && this.query.trim() !== '') {
|
|
687
715
|
await this.searchStore.search();
|
|
@@ -696,13 +724,17 @@ const SearchcraftSlider = class {
|
|
|
696
724
|
};
|
|
697
725
|
this.handleStartYearChange = (event) => {
|
|
698
726
|
const value = Number.parseInt(event.target.value, 10);
|
|
699
|
-
|
|
700
|
-
|
|
727
|
+
if (value <= this.endYear) {
|
|
728
|
+
this.startYear = value;
|
|
729
|
+
this.updateYears();
|
|
730
|
+
}
|
|
701
731
|
};
|
|
702
732
|
this.handleEndYearChange = (event) => {
|
|
703
733
|
const value = Number.parseInt(event.target.value, 10);
|
|
704
|
-
|
|
705
|
-
|
|
734
|
+
if (value >= this.startYear) {
|
|
735
|
+
this.endYear = value;
|
|
736
|
+
this.updateYears();
|
|
737
|
+
}
|
|
706
738
|
};
|
|
707
739
|
this.maxYear = new Date().getFullYear();
|
|
708
740
|
this.minYear = 2014;
|
|
@@ -735,41 +767,15 @@ const SearchcraftSlider = class {
|
|
|
735
767
|
const rangeMax = this.maxYear;
|
|
736
768
|
const startPercent = ((this.startYear - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
737
769
|
const endPercent = ((this.endYear - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
738
|
-
return (index.h("div", { class: 'sliderContainer' }, index.h("div", { class: 'rangeContainer' }, index.h("div", { class: 'activeRange', style: {
|
|
770
|
+
return (index.h("div", { class: index$1.classNames('sliderContainer', 'searchcraft-slider-container') }, index.h("div", { class: index$1.classNames('rangeContainer', 'searchcraft-slider-range-container') }, index.h("div", { class: index$1.classNames('activeRange', 'searchcraft-slider-active-range'), style: {
|
|
739
771
|
left: `${startPercent}%`,
|
|
740
772
|
width: `${endPercent - startPercent}%`,
|
|
741
|
-
} }), index.h("input", { class: 'rangeSlider', max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), index.h("input", { class: 'rangeSlider', max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), index.h("div", { class: 'yearLabels' }, index.h("span", { class: 'yearLabel' }, this.startYear), index.h("span", { class: 'yearLabel' }, this.endYear))));
|
|
773
|
+
} }), index.h("input", { class: index$1.classNames('rangeSlider', 'searchcraft-slider-range-slider-start-thumb'), max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), index.h("input", { class: index$1.classNames('rangeSlider', 'searchcraft-slider-range-slider-end-thumb'), max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), index.h("div", { class: index$1.classNames('yearLabels', 'searchcraft-slider-year-label-container') }, index.h("span", { class: index$1.classNames('yearLabel', 'searchcraft-slider-start-year-label') }, this.startYear), index.h("span", { class: index$1.classNames('yearLabel', 'searchcraft-slider-end-year-label') }, this.endYear))));
|
|
742
774
|
}
|
|
743
775
|
};
|
|
744
776
|
SearchcraftSlider.style = SearchcraftSliderStyle0;
|
|
745
777
|
|
|
746
|
-
const
|
|
747
|
-
const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
|
|
748
|
-
|
|
749
|
-
const SearchcraftSpinnerDark = class {
|
|
750
|
-
constructor(hostRef) {
|
|
751
|
-
index.registerInstance(this, hostRef);
|
|
752
|
-
}
|
|
753
|
-
render() {
|
|
754
|
-
return (index.h("div", { key: 'be34b9a3ecec05fdc169145a5db5a4f37bbd404b', class: 'spinnerContainer' }, index.h("div", { key: 'b59ffd2fe8dd3ac990003bff3085cb571c08730e', class: 'spinnerDark' })));
|
|
755
|
-
}
|
|
756
|
-
};
|
|
757
|
-
SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
|
|
758
|
-
|
|
759
|
-
const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
760
|
-
const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
|
|
761
|
-
|
|
762
|
-
const SearchcraftSpinnerLight = class {
|
|
763
|
-
constructor(hostRef) {
|
|
764
|
-
index.registerInstance(this, hostRef);
|
|
765
|
-
}
|
|
766
|
-
render() {
|
|
767
|
-
return (index.h("div", { key: 'a4f73eee03d4d7253c04c47995315bd121e8ded3', class: 'spinnerContainer' }, index.h("div", { key: '53e3486ef7a2fa6029a6107bae2c0655b1608a12', class: 'spinnerLight' })));
|
|
768
|
-
}
|
|
769
|
-
};
|
|
770
|
-
SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
|
|
771
|
-
|
|
772
|
-
const searchcraftToggleButtonModuleCss = ".toggle-wrapper{background:#ddd;border:none;border-radius:16px;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);cursor:pointer;height:26px;margin-left:10px;position:relative;width:44px}.toggle-wrapper.active{background:#007DB3;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.toggle-wrapper .toggle-switch{background:#fff;border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.toggle-wrapper .toggle-switch.active{transform:translateX(16px)}";
|
|
778
|
+
const searchcraftToggleButtonModuleCss = ".toggleWrapper{background:#D9D9D9;border:none;border-radius:16px;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);cursor:pointer;height:26px;margin-left:10px;position:relative;width:44px}.toggleWrapper.active{background:#000000;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.toggleWrapper .toggleSwitch{background:#FFFFFF;border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.toggleWrapper .toggleSwitch.active{transform:translateX(16px)}";
|
|
773
779
|
const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
|
|
774
780
|
|
|
775
781
|
const SearchcraftToggleButton = class {
|
|
@@ -833,7 +839,9 @@ const SearchcraftToggleButton = class {
|
|
|
833
839
|
if (!this.query || this.resultsCount === 0) {
|
|
834
840
|
return null;
|
|
835
841
|
}
|
|
836
|
-
|
|
842
|
+
const toggleContainerStyle = `toggleWrapper ${this.isActive ? 'active' : ''}`;
|
|
843
|
+
const toggleSwitchStyle = `toggleSwitch ${this.isActive ? 'active' : ''}`;
|
|
844
|
+
return (index.h("button", { class: index$1.classNames(toggleContainerStyle, 'searchcraft-toggle-button-container'), onClick: this.handleToggle, type: 'button' }, index.h("div", { class: index$1.classNames(toggleSwitchStyle, 'searchcraft-toggle-switch') })));
|
|
837
845
|
}
|
|
838
846
|
};
|
|
839
847
|
SearchcraftToggleButton.style = SearchcraftToggleButtonStyle0;
|
|
@@ -854,8 +862,6 @@ exports.searchcraft_input_label = SearchcraftInputLabel;
|
|
|
854
862
|
exports.searchcraft_results_info = SearchcraftResultsInfo;
|
|
855
863
|
exports.searchcraft_search_icon_set = SearchcraftSearchIconSet;
|
|
856
864
|
exports.searchcraft_slider = SearchcraftSlider;
|
|
857
|
-
exports.searchcraft_spinner_dark = SearchcraftSpinnerDark;
|
|
858
|
-
exports.searchcraft_spinner_light = SearchcraftSpinnerLight;
|
|
859
865
|
exports.searchcraft_toggle_button = SearchcraftToggleButton;
|
|
860
866
|
|
|
861
|
-
//# sourceMappingURL=searchcraft-auto-search-
|
|
867
|
+
//# sourceMappingURL=searchcraft-auto-search-form_17.cjs.entry.js.map
|