@searchcraft/javascript-sdk 0.2.9 → 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} +144 -121
- 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 +21 -13
- 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 -12
- 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 +35 -31
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +20 -17
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -1
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +28 -28
- 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 +39 -25
- 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 +19 -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-dd2a4022.js → p-54848b4d.js} +35 -44
- 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 +35 -39
- 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 -18
- 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 +23 -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} +143 -118
- 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/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +3 -1
- 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-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-dd2a4022.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-6c007e2e.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-6c007e2e.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,11 +23,9 @@ 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
|
-
else {
|
|
28
|
-
this.querySubmit.emit(this.query);
|
|
29
|
-
}
|
|
30
29
|
};
|
|
31
30
|
this.handleInputKeyUp = (event) => {
|
|
32
31
|
const target = event.detail;
|
|
@@ -41,6 +40,7 @@ const SearchcraftAutoSearchForm = class {
|
|
|
41
40
|
if (this.query.trim() === '') {
|
|
42
41
|
this.searchResults = null;
|
|
43
42
|
this.searchStore.setSearchResults(null);
|
|
43
|
+
this.inputClearedOrNoResults.emit();
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
this.searchStore.setQuery(this.query);
|
|
@@ -50,6 +50,9 @@ const SearchcraftAutoSearchForm = class {
|
|
|
50
50
|
}, this.debounceDelay);
|
|
51
51
|
};
|
|
52
52
|
this.handleClearInput = () => {
|
|
53
|
+
if (this.query === '' && !this.searchResults) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
53
56
|
this.query = '';
|
|
54
57
|
this.searchResults = null;
|
|
55
58
|
this.searchStore.setQuery('');
|
|
@@ -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")));
|
|
273
296
|
}
|
|
274
|
-
|
|
275
|
-
|
|
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();
|
|
299
|
+
}
|
|
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,16 +451,13 @@ 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 {
|
|
431
|
-
// Add parent filter to selectedFilters
|
|
432
457
|
this.selectedFilters = [...this.selectedFilters, value];
|
|
433
458
|
}
|
|
434
459
|
}
|
|
435
460
|
else {
|
|
436
|
-
// Update selectedFilters for child filters
|
|
437
461
|
this.selectedFilters = isChecked
|
|
438
462
|
? [...this.selectedFilters, value]
|
|
439
463
|
: this.selectedFilters.filter((filter) => filter !== value);
|
|
@@ -445,23 +469,19 @@ const SearchcraftFiltersList = class {
|
|
|
445
469
|
this.searchStore.setSelectedFilters(this.selectedFilters);
|
|
446
470
|
this.searchStore.search();
|
|
447
471
|
}
|
|
448
|
-
formatLabel(label, count) {
|
|
449
|
-
return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
|
|
450
|
-
}
|
|
451
472
|
render() {
|
|
452
473
|
if (!this.query || this.resultsCount === 0) {
|
|
453
474
|
return null;
|
|
454
475
|
}
|
|
455
|
-
return (index.h("div", { class: '
|
|
476
|
+
return (index.h("div", { class: index$1.classNames('filtersListContainer', 'searchcraft-filters-list-container') }, this.dynamicFilters.map((filter) => {
|
|
456
477
|
const isChildSelected = filter.children
|
|
457
478
|
? filter.children.some((child) => this.selectedFilters.includes(child.value))
|
|
458
479
|
: false;
|
|
459
|
-
return (index.h("div", { key: filter.value, class: '
|
|
460
|
-
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: {
|
|
461
481
|
display: this.selectedFilters.includes(filter.value)
|
|
462
482
|
? 'flex'
|
|
463
483
|
: 'none',
|
|
464
|
-
} }, 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('/')
|
|
465
485
|
? child.label.split('/').pop() || child.label
|
|
466
486
|
: child.label, child.count))))))));
|
|
467
487
|
})));
|
|
@@ -469,7 +489,7 @@ const SearchcraftFiltersList = class {
|
|
|
469
489
|
};
|
|
470
490
|
SearchcraftFiltersList.style = SearchcraftFiltersListStyle0;
|
|
471
491
|
|
|
472
|
-
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;
|
|
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%}";
|
|
473
493
|
const SearchcraftInputStyle0 = searchcraftInputModuleCss;
|
|
474
494
|
|
|
475
495
|
const SearchcraftInput = class {
|
|
@@ -478,6 +498,23 @@ const SearchcraftInput = class {
|
|
|
478
498
|
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
479
499
|
this.searchInputChange = index.createEvent(this, "searchInputChange", 7);
|
|
480
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
|
+
};
|
|
481
518
|
this.customStyles = {};
|
|
482
519
|
this.error = false;
|
|
483
520
|
this.formClassName = '';
|
|
@@ -495,35 +532,22 @@ const SearchcraftInput = class {
|
|
|
495
532
|
get isLightTheme() {
|
|
496
533
|
return this.theme === 'light';
|
|
497
534
|
}
|
|
498
|
-
handleInputChange(event) {
|
|
499
|
-
const input = event.target;
|
|
500
|
-
this.searchInputChange.emit(input.value);
|
|
501
|
-
}
|
|
502
|
-
handleInputKeyUp(event) {
|
|
503
|
-
const input = event.target;
|
|
504
|
-
this.inputKeyUp.emit(input.value);
|
|
505
|
-
}
|
|
506
|
-
handleClearInput() {
|
|
507
|
-
if (this.clearInput) {
|
|
508
|
-
this.clearInput.emit();
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
535
|
render() {
|
|
512
536
|
const containerClassName = this.rightToLeftOrientation
|
|
513
537
|
? 'inputContainerRTL'
|
|
514
538
|
: 'inputContainerLTR';
|
|
515
|
-
const inputClassName =
|
|
539
|
+
const inputClassName = this.error
|
|
516
540
|
? this.isLightTheme
|
|
517
541
|
? 'inputErrorLightRTL'
|
|
518
542
|
: 'inputErrorDarkRTL'
|
|
519
543
|
: this.isLightTheme
|
|
520
544
|
? 'inputLightLTR'
|
|
521
|
-
: 'inputDarkLTR'
|
|
545
|
+
: 'inputDarkLTR';
|
|
522
546
|
const validatedCustomStyles = store.parseCustomStyles(this.customStyles);
|
|
523
547
|
const placeholderStyle = {
|
|
524
548
|
fontSize: validatedCustomStyles.placeholderFontSize || '16px',
|
|
525
549
|
};
|
|
526
|
-
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, `
|
|
527
551
|
#searchcraft-input-id::placeholder {
|
|
528
552
|
font-size: ${placeholderStyle.fontSize};
|
|
529
553
|
}
|
|
@@ -558,18 +582,18 @@ const SearchcraftInputCaption = class {
|
|
|
558
582
|
: 'inputCaptionErrorDarkRTL'
|
|
559
583
|
: this.isLightTheme
|
|
560
584
|
? 'inputCaptionLightRTL'
|
|
561
|
-
: 'inputCaptionDarkRTL', this.inputCaptionClassName, '
|
|
585
|
+
: 'inputCaptionDarkRTL', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue)) : (index.h("p", { class: index$1.classNames(this.error
|
|
562
586
|
? this.isLightTheme
|
|
563
587
|
? 'inputCaptionErrorLightLTR'
|
|
564
588
|
: 'inputCaptionErrorDarkLTR'
|
|
565
589
|
: this.isLightTheme
|
|
566
590
|
? 'inputCaptionLightLTR'
|
|
567
|
-
: 'inputCaptionDarkLTR', this.inputCaptionClassName, '
|
|
591
|
+
: 'inputCaptionDarkLTR', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue));
|
|
568
592
|
}
|
|
569
593
|
};
|
|
570
594
|
SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
|
|
571
595
|
|
|
572
|
-
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%)}";
|
|
573
597
|
const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
|
|
574
598
|
|
|
575
599
|
const SearchcraftInputIcon = class {
|
|
@@ -585,12 +609,12 @@ const SearchcraftInputIcon = class {
|
|
|
585
609
|
return this.theme === 'light';
|
|
586
610
|
}
|
|
587
611
|
render() {
|
|
588
|
-
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 }))));
|
|
589
613
|
}
|
|
590
614
|
};
|
|
591
615
|
SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
|
|
592
616
|
|
|
593
|
-
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}";
|
|
594
618
|
const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
|
|
595
619
|
|
|
596
620
|
const SearchcraftInputLabel = class {
|
|
@@ -608,12 +632,12 @@ const SearchcraftInputLabel = class {
|
|
|
608
632
|
return null;
|
|
609
633
|
}
|
|
610
634
|
const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
|
|
611
|
-
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));
|
|
612
636
|
}
|
|
613
637
|
};
|
|
614
638
|
SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
|
|
615
639
|
|
|
616
|
-
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}}";
|
|
617
641
|
const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
|
|
618
642
|
|
|
619
643
|
const SearchcraftResultsInfo = class {
|
|
@@ -630,7 +654,7 @@ const SearchcraftResultsInfo = class {
|
|
|
630
654
|
this.isRequesting = state.isRequesting;
|
|
631
655
|
this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
|
|
632
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);
|
|
633
|
-
this.query = state.query || '';
|
|
657
|
+
this.query = state.query || '';
|
|
634
658
|
});
|
|
635
659
|
}
|
|
636
660
|
disconnectedCallback() {
|
|
@@ -642,7 +666,8 @@ const SearchcraftResultsInfo = class {
|
|
|
642
666
|
if (!this.query || this.resultsCount === 0) {
|
|
643
667
|
return null;
|
|
644
668
|
}
|
|
645
|
-
|
|
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")));
|
|
646
671
|
}
|
|
647
672
|
};
|
|
648
673
|
SearchcraftResultsInfo.style = SearchcraftResultsInfoStyle0;
|
|
@@ -671,15 +696,20 @@ const SearchcraftSearchIconSet = class {
|
|
|
671
696
|
}
|
|
672
697
|
};
|
|
673
698
|
|
|
674
|
-
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}";
|
|
675
700
|
const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
|
|
676
701
|
|
|
677
702
|
const SearchcraftSlider = class {
|
|
678
703
|
constructor(hostRef) {
|
|
679
704
|
index.registerInstance(this, hostRef);
|
|
705
|
+
this.rangeChanged = index.createEvent(this, "rangeChanged", 7);
|
|
680
706
|
this.searchStore = store.useSearchcraftStore.getState();
|
|
681
707
|
this.updateYears = async () => {
|
|
682
708
|
this.searchStore.setYearsRange([this.startYear, this.endYear]);
|
|
709
|
+
this.rangeChanged.emit({
|
|
710
|
+
startYear: this.startYear,
|
|
711
|
+
endYear: this.endYear,
|
|
712
|
+
});
|
|
683
713
|
try {
|
|
684
714
|
if (typeof this.query === 'string' && this.query.trim() !== '') {
|
|
685
715
|
await this.searchStore.search();
|
|
@@ -694,13 +724,17 @@ const SearchcraftSlider = class {
|
|
|
694
724
|
};
|
|
695
725
|
this.handleStartYearChange = (event) => {
|
|
696
726
|
const value = Number.parseInt(event.target.value, 10);
|
|
697
|
-
|
|
698
|
-
|
|
727
|
+
if (value <= this.endYear) {
|
|
728
|
+
this.startYear = value;
|
|
729
|
+
this.updateYears();
|
|
730
|
+
}
|
|
699
731
|
};
|
|
700
732
|
this.handleEndYearChange = (event) => {
|
|
701
733
|
const value = Number.parseInt(event.target.value, 10);
|
|
702
|
-
|
|
703
|
-
|
|
734
|
+
if (value >= this.startYear) {
|
|
735
|
+
this.endYear = value;
|
|
736
|
+
this.updateYears();
|
|
737
|
+
}
|
|
704
738
|
};
|
|
705
739
|
this.maxYear = new Date().getFullYear();
|
|
706
740
|
this.minYear = 2014;
|
|
@@ -733,47 +767,29 @@ const SearchcraftSlider = class {
|
|
|
733
767
|
const rangeMax = this.maxYear;
|
|
734
768
|
const startPercent = ((this.startYear - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
735
769
|
const endPercent = ((this.endYear - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
736
|
-
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: {
|
|
737
771
|
left: `${startPercent}%`,
|
|
738
772
|
width: `${endPercent - startPercent}%`,
|
|
739
|
-
} }), 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))));
|
|
740
774
|
}
|
|
741
775
|
};
|
|
742
776
|
SearchcraftSlider.style = SearchcraftSliderStyle0;
|
|
743
777
|
|
|
744
|
-
const
|
|
745
|
-
const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
|
|
746
|
-
|
|
747
|
-
const SearchcraftSpinnerDark = class {
|
|
748
|
-
constructor(hostRef) {
|
|
749
|
-
index.registerInstance(this, hostRef);
|
|
750
|
-
}
|
|
751
|
-
render() {
|
|
752
|
-
return (index.h("div", { key: 'be34b9a3ecec05fdc169145a5db5a4f37bbd404b', class: 'spinnerContainer' }, index.h("div", { key: 'b59ffd2fe8dd3ac990003bff3085cb571c08730e', class: 'spinnerDark' })));
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
|
|
756
|
-
|
|
757
|
-
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)}}";
|
|
758
|
-
const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
|
|
759
|
-
|
|
760
|
-
const SearchcraftSpinnerLight = class {
|
|
761
|
-
constructor(hostRef) {
|
|
762
|
-
index.registerInstance(this, hostRef);
|
|
763
|
-
}
|
|
764
|
-
render() {
|
|
765
|
-
return (index.h("div", { key: 'a4f73eee03d4d7253c04c47995315bd121e8ded3', class: 'spinnerContainer' }, index.h("div", { key: '53e3486ef7a2fa6029a6107bae2c0655b1608a12', class: 'spinnerLight' })));
|
|
766
|
-
}
|
|
767
|
-
};
|
|
768
|
-
SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
|
|
769
|
-
|
|
770
|
-
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)}";
|
|
771
779
|
const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
|
|
772
780
|
|
|
773
781
|
const SearchcraftToggleButton = class {
|
|
774
782
|
constructor(hostRef) {
|
|
775
783
|
index.registerInstance(this, hostRef);
|
|
784
|
+
this.autoSearchFormElement = null;
|
|
776
785
|
this.searchStore = store.useSearchcraftStore.getState();
|
|
786
|
+
this.handleSearchRequest = () => {
|
|
787
|
+
this.isActive = false;
|
|
788
|
+
this.searchStore.setSearchParams({
|
|
789
|
+
mode: 'fuzzy',
|
|
790
|
+
sort: 'asc',
|
|
791
|
+
});
|
|
792
|
+
};
|
|
777
793
|
this.handleToggle = async () => {
|
|
778
794
|
this.isActive = !this.isActive;
|
|
779
795
|
if (this.type === 'mode') {
|
|
@@ -806,17 +822,26 @@ const SearchcraftToggleButton = class {
|
|
|
806
822
|
this.query = state.query || '';
|
|
807
823
|
this.resultsCount = ((_c = (_b = (_a = state.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;
|
|
808
824
|
});
|
|
825
|
+
this.autoSearchFormElement = document.querySelector('searchcraft-auto-search-form');
|
|
826
|
+
if (this.autoSearchFormElement) {
|
|
827
|
+
this.autoSearchFormElement.addEventListener('querySubmit', this.handleSearchRequest);
|
|
828
|
+
}
|
|
809
829
|
}
|
|
810
830
|
disconnectedCallback() {
|
|
811
831
|
if (this.unsubscribe) {
|
|
812
832
|
this.unsubscribe();
|
|
813
833
|
}
|
|
834
|
+
if (this.autoSearchFormElement) {
|
|
835
|
+
this.autoSearchFormElement.addEventListener('querySubmit', this.handleSearchRequest);
|
|
836
|
+
}
|
|
814
837
|
}
|
|
815
838
|
render() {
|
|
816
839
|
if (!this.query || this.resultsCount === 0) {
|
|
817
840
|
return null;
|
|
818
841
|
}
|
|
819
|
-
|
|
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') })));
|
|
820
845
|
}
|
|
821
846
|
};
|
|
822
847
|
SearchcraftToggleButton.style = SearchcraftToggleButtonStyle0;
|
|
@@ -837,8 +862,6 @@ exports.searchcraft_input_label = SearchcraftInputLabel;
|
|
|
837
862
|
exports.searchcraft_results_info = SearchcraftResultsInfo;
|
|
838
863
|
exports.searchcraft_search_icon_set = SearchcraftSearchIconSet;
|
|
839
864
|
exports.searchcraft_slider = SearchcraftSlider;
|
|
840
|
-
exports.searchcraft_spinner_dark = SearchcraftSpinnerDark;
|
|
841
|
-
exports.searchcraft_spinner_light = SearchcraftSpinnerLight;
|
|
842
865
|
exports.searchcraft_toggle_button = SearchcraftToggleButton;
|
|
843
866
|
|
|
844
|
-
//# sourceMappingURL=searchcraft-auto-search-
|
|
867
|
+
//# sourceMappingURL=searchcraft-auto-search-form_17.cjs.entry.js.map
|