@searchcraft/javascript-sdk 0.1.2 → 0.1.3
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/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js +34 -0
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js +3043 -0
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js.map +1 -0
- package/dist/{esm/index-72ac5051.js → searchcraft-javascript-sdk/index-d6567b9c.js} +10 -2
- package/dist/searchcraft-javascript-sdk/index-d6567b9c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +14 -1
- package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +93 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-base-search-form.entry.js +4 -4
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +1 -0
- package/dist/{components/p-1912bbbd.js → searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js} +22 -47
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js +57 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button-icon.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button.entry.js +5 -5
- package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +1 -0
- package/dist/{components/p-d446eda4.js → searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js} +7 -25
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +31 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +22 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js.map +1 -0
- package/dist/{components/p-cb75ba7a.js → searchcraft-javascript-sdk/searchcraft-input-caption.entry.js} +10 -32
- package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +23 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +30 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +1 -0
- package/dist/{components/p-1bd04bac.js → searchcraft-javascript-sdk/searchcraft-input.entry.js} +11 -80
- package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +48 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/{components/p-d0edf961.js → searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js} +7 -25
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +17 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +17 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js +334 -0
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js +3008 -0
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js.map +1 -0
- package/dist/{esm/utils-02b18bb5.js → searchcraft-javascript-sdk/utils-7bff0c78.js} +11 -7
- package/dist/searchcraft-javascript-sdk/utils-7bff0c78.js.map +1 -0
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +2 -1
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -2
- package/dist/types/components.d.ts +6 -4
- package/dist/types/utils/utils.d.ts +1 -5
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-5b0b9d4c.js +0 -84
- package/dist/cjs/index-5b0b9d4c.js.map +0 -1
- package/dist/cjs/index-e7e9ab69.js +0 -1271
- package/dist/cjs/index-e7e9ab69.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -16
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js +0 -460
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +0 -64
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +0 -18
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button.cjs.entry.js +0 -37
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +0 -27
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +0 -1
- package/dist/cjs/store-ab3978ce.js +0 -251
- package/dist/cjs/store-ab3978ce.js.map +0 -1
- package/dist/cjs/utils-57b6c18f.js +0 -48
- package/dist/cjs/utils-57b6c18f.js.map +0 -1
- package/dist/collection/assets/searchcraft-button-icons.js +0 -9
- package/dist/collection/assets/searchcraft-button-icons.js.map +0 -1
- package/dist/collection/assets/searchcraft-clear-icon-set.js +0 -45
- package/dist/collection/assets/searchcraft-clear-icon-set.js.map +0 -1
- package/dist/collection/assets/searchcraft-search-icon-set.js +0 -45
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -27
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +0 -294
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +0 -1
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +0 -19
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +0 -168
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +0 -14
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +0 -302
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -210
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +0 -123
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -20
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +0 -137
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +0 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -82
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +0 -96
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +0 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +0 -33
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +0 -64
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +0 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -21
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +0 -276
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +0 -1
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +0 -241
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +0 -122
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +0 -1
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +0 -79
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +0 -71
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +0 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +0 -21
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +0 -77
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +0 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -21
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +0 -19
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +0 -1
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +0 -35
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +0 -19
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +0 -1
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +0 -26
- package/dist/collection/index.js +0 -14
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/provider/store.js +0 -68
- package/dist/collection/provider/store.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -41
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js +0 -5
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-066c8210.js +0 -1106
- package/dist/components/p-066c8210.js.map +0 -1
- package/dist/components/p-1912bbbd.js.map +0 -1
- package/dist/components/p-1bd04bac.js.map +0 -1
- package/dist/components/p-36c95064.js +0 -247
- package/dist/components/p-36c95064.js.map +0 -1
- package/dist/components/p-5cdc6210.js +0 -82
- package/dist/components/p-5cdc6210.js.map +0 -1
- package/dist/components/p-5e3152c4.js +0 -44
- package/dist/components/p-5e3152c4.js.map +0 -1
- package/dist/components/p-63035c6a.js +0 -50
- package/dist/components/p-63035c6a.js.map +0 -1
- package/dist/components/p-6f2a72d3.js +0 -41
- package/dist/components/p-6f2a72d3.js.map +0 -1
- package/dist/components/p-8d9551ce.js +0 -34
- package/dist/components/p-8d9551ce.js.map +0 -1
- package/dist/components/p-b1ff2296.js +0 -69
- package/dist/components/p-b1ff2296.js.map +0 -1
- package/dist/components/p-c3838435.js +0 -62
- package/dist/components/p-c3838435.js.map +0 -1
- package/dist/components/p-cb75ba7a.js.map +0 -1
- package/dist/components/p-d0edf961.js.map +0 -1
- package/dist/components/p-d446eda4.js.map +0 -1
- package/dist/components/p-d54bca75.js +0 -50
- package/dist/components/p-d54bca75.js.map +0 -1
- package/dist/components/p-d6616aa5.js +0 -34
- package/dist/components/p-d6616aa5.js.map +0 -1
- package/dist/components/searchcraft-auto-search-form.js +0 -185
- package/dist/components/searchcraft-auto-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-form.js +0 -153
- package/dist/components/searchcraft-base-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-result.js +0 -8
- package/dist/components/searchcraft-base-search-result.js.map +0 -1
- package/dist/components/searchcraft-base-search-results.js +0 -111
- package/dist/components/searchcraft-base-search-results.js.map +0 -1
- package/dist/components/searchcraft-button-icon.js +0 -33
- package/dist/components/searchcraft-button-icon.js.map +0 -1
- package/dist/components/searchcraft-button.js +0 -8
- package/dist/components/searchcraft-button.js.map +0 -1
- package/dist/components/searchcraft-clear-icon-set.js +0 -8
- package/dist/components/searchcraft-clear-icon-set.js.map +0 -1
- package/dist/components/searchcraft-clear-input-button.js +0 -8
- package/dist/components/searchcraft-clear-input-button.js.map +0 -1
- package/dist/components/searchcraft-error-message.js +0 -8
- package/dist/components/searchcraft-error-message.js.map +0 -1
- package/dist/components/searchcraft-input-caption.js +0 -8
- package/dist/components/searchcraft-input-caption.js.map +0 -1
- package/dist/components/searchcraft-input-icon.js +0 -8
- package/dist/components/searchcraft-input-icon.js.map +0 -1
- package/dist/components/searchcraft-input-label.js +0 -8
- package/dist/components/searchcraft-input-label.js.map +0 -1
- package/dist/components/searchcraft-input.js +0 -8
- package/dist/components/searchcraft-input.js.map +0 -1
- package/dist/components/searchcraft-search-icon-set.js +0 -8
- package/dist/components/searchcraft-search-icon-set.js.map +0 -1
- package/dist/components/searchcraft-spinner-dark.js +0 -8
- package/dist/components/searchcraft-spinner-dark.js.map +0 -1
- package/dist/components/searchcraft-spinner-light.js +0 -8
- package/dist/components/searchcraft-spinner-light.js.map +0 -1
- package/dist/esm/index-72ac5051.js.map +0 -1
- package/dist/esm/index-eace3343.js +0 -1242
- package/dist/esm/index-eace3343.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_13.entry.js +0 -444
- package/dist/esm/searchcraft-auto-search-form_13.entry.js.map +0 -1
- package/dist/esm/searchcraft-base-search-form.entry.js.map +0 -1
- package/dist/esm/searchcraft-button-icon.entry.js.map +0 -1
- package/dist/esm/searchcraft-button.entry.js.map +0 -1
- package/dist/esm/searchcraft-javascript-sdk.js +0 -22
- package/dist/esm/searchcraft-javascript-sdk.js.map +0 -1
- package/dist/esm/store-e55b12aa.js +0 -247
- package/dist/esm/store-e55b12aa.js.map +0 -1
- package/dist/esm/utils-02b18bb5.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -1
- package/dist/loader/index.cjs.js +0 -1
- package/dist/loader/index.d.ts +0 -24
- package/dist/loader/index.es2017.js +0 -1
- package/dist/loader/index.js +0 -2
- package/dist/loader/package.json +0 -11
- package/dist/searchcraft-javascript-sdk/p-0ba9029b.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-0ba9029b.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-36c95064.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-36c95064.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-437c6ef9.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-437c6ef9.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-562e923d.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-562e923d.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5959cd6a.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5959cd6a.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +0 -7
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5e3152c4.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5e3152c4.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-e1255160.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-eb632a89.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-eb632a89.entry.js.map +0 -1
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js.map +0 -0
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-e7e9ab69.js');
|
|
6
|
-
const store = require('./store-ab3978ce.js');
|
|
7
|
-
const utils = require('./utils-57b6c18f.js');
|
|
8
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
|
9
|
-
|
|
10
|
-
const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{text-align:left;width:100%}.formRTL{text-align:right;width:100%}.searchContainer{align-items:center;display:flex;width:100%}";
|
|
11
|
-
const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
|
|
12
|
-
|
|
13
|
-
const SearchcraftAutoSearchForm = class {
|
|
14
|
-
constructor(hostRef) {
|
|
15
|
-
index.registerInstance(this, hostRef);
|
|
16
|
-
this.querySubmit = index.createEvent(this, "querySubmit", 7);
|
|
17
|
-
this.debounceTimeout = null;
|
|
18
|
-
this.debounceDelay = 300; // 300ms debounce delay
|
|
19
|
-
this.searchStore = store.useSearchcraftStore.getState();
|
|
20
|
-
this.handleInputChange = (event) => {
|
|
21
|
-
this.query = event.detail;
|
|
22
|
-
this.querySubmit.emit(this.query);
|
|
23
|
-
// Clear the previous debounce timeout
|
|
24
|
-
if (this.debounceTimeout) {
|
|
25
|
-
clearTimeout(this.debounceTimeout);
|
|
26
|
-
}
|
|
27
|
-
// Set a new debounce timeout
|
|
28
|
-
this.debounceTimeout = setTimeout(() => {
|
|
29
|
-
console.log('Debounced search triggered');
|
|
30
|
-
this.runSearch();
|
|
31
|
-
}, this.debounceDelay);
|
|
32
|
-
};
|
|
33
|
-
this.handleClearInput = () => {
|
|
34
|
-
this.query = '';
|
|
35
|
-
console.log('Input cleared');
|
|
36
|
-
if (typeof this.clearInput === 'function') {
|
|
37
|
-
this.clearInput();
|
|
38
|
-
}
|
|
39
|
-
if (this.debounceTimeout) {
|
|
40
|
-
clearTimeout(this.debounceTimeout);
|
|
41
|
-
}
|
|
42
|
-
this.error = false;
|
|
43
|
-
this.searchResults = '';
|
|
44
|
-
};
|
|
45
|
-
this.runSearch = async () => {
|
|
46
|
-
if (this.query.trim() === '') {
|
|
47
|
-
this.error = true;
|
|
48
|
-
this.searchResults = '';
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
this.error = false;
|
|
52
|
-
this.searchStore.setQuery(this.query);
|
|
53
|
-
try {
|
|
54
|
-
await this.searchStore.search();
|
|
55
|
-
this.searchResults = JSON.stringify(this.searchStore.searchResults);
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
this.error = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
this.handleFormSubmit = async (event) => {
|
|
63
|
-
event.preventDefault();
|
|
64
|
-
await this.runSearch();
|
|
65
|
-
};
|
|
66
|
-
this.autoSearchFormClass = '';
|
|
67
|
-
this.clearInput = () => { };
|
|
68
|
-
this.config = {
|
|
69
|
-
apiKey: '',
|
|
70
|
-
endpointURL: '',
|
|
71
|
-
index: [],
|
|
72
|
-
};
|
|
73
|
-
this.customStylesForInput = {};
|
|
74
|
-
this.inputCaptionValue = '';
|
|
75
|
-
this.labelForInput = '';
|
|
76
|
-
this.placeholderValue = 'Search here';
|
|
77
|
-
this.rightToLeftOrientation = false;
|
|
78
|
-
this.searchContainerClass = '';
|
|
79
|
-
this.error = false;
|
|
80
|
-
this.query = '';
|
|
81
|
-
this.searchResults = '';
|
|
82
|
-
}
|
|
83
|
-
componentDidLoad() {
|
|
84
|
-
const searchcraft = new store.g(this.config);
|
|
85
|
-
this.searchStore.initialize(searchcraft, true);
|
|
86
|
-
console.log('Component initialized');
|
|
87
|
-
}
|
|
88
|
-
render() {
|
|
89
|
-
const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
|
|
90
|
-
const parsedCustomStyles = utils.parseCustomStyles(this.customStylesForInput);
|
|
91
|
-
return (index.h("form", { key: '60978e813198af27c34232ebd1bda4ca4a6f5199', class: `${formClass}`, onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: '4418b675769d041c684f15afb2d9b919f765c133', label: this.labelForInput }), index.h("div", { key: '73581bf8fee7deee1bcf426f80493c78e92d8ada', class: 'searchContainer' }, index.h("searchcraft-input", { key: '6e90612f4fc8c773c9f98f5fcfffb303909d3c6f', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, onClearInput: this.handleClearInput, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation })), this.error && (index.h("searchcraft-error-message", { key: '1637aff0dcac83d975d9d53545e7fee26c41aa7f', errorMessage: 'Please enter a search query.' }))));
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
|
|
95
|
-
|
|
96
|
-
const searchcraftBaseSearchResultModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{background-color:#FAFAFA;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{background-color:#2E2E2E;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{position:absolute;right:5px;top:-2px;display:inline-block}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-height:540px;max-width:100%}@media (min-width: 600px){.imageContainer{max-height:100%;max-width:50%}}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.imageLight{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}";
|
|
97
|
-
const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
|
|
98
|
-
|
|
99
|
-
const SearchcraftBaseSearchResult = class {
|
|
100
|
-
constructor(hostRef) {
|
|
101
|
-
index.registerInstance(this, hostRef);
|
|
102
|
-
this.buttonCallback = index.createEvent(this, "buttonCallback", 7);
|
|
103
|
-
this.keyDownCallback = index.createEvent(this, "keyDownCallback", 7);
|
|
104
|
-
this.resultCallback = index.createEvent(this, "resultCallback", 7);
|
|
105
|
-
this.buttonCallback = () => { }; // Callback for button click
|
|
106
|
-
this.keyDownCallback = () => { }; // Callback for key down event
|
|
107
|
-
this.resultCallback = () => { }; // Callback for result container click
|
|
108
|
-
this.handleButtonClick = () => {
|
|
109
|
-
this.buttonCallback();
|
|
110
|
-
};
|
|
111
|
-
this.handleContainerClick = () => {
|
|
112
|
-
if (this.isInteractive) {
|
|
113
|
-
this.resultCallback();
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
this.buttonText = '';
|
|
117
|
-
this.imageDescription = '';
|
|
118
|
-
this.imageSource = '';
|
|
119
|
-
this.isInteractive = false;
|
|
120
|
-
this.primaryContent = '';
|
|
121
|
-
this.secondaryContent = '';
|
|
122
|
-
this.tertiaryContent = '';
|
|
123
|
-
this.headingText = '';
|
|
124
|
-
this.subheadingText = '';
|
|
125
|
-
this.themeMode = 'light';
|
|
126
|
-
this.customStyles = {};
|
|
127
|
-
}
|
|
128
|
-
render() {
|
|
129
|
-
const isLightTheme = this.themeMode === 'light';
|
|
130
|
-
const containerStyle = Object.assign({}, this.customStyles);
|
|
131
|
-
return (index.h("div", { key: '512b19a2637993cd71fe9b0ac1557106f8501cf2', class: this.isInteractive
|
|
132
|
-
? isLightTheme
|
|
133
|
-
? 'interactiveResultContainerLight'
|
|
134
|
-
: 'interactiveResultContainerDark'
|
|
135
|
-
: 'resultContainer', id: 'searchcraft-item', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback, style: containerStyle, tabindex: '0' }, this.isInteractive && (index.h("div", { key: '735b5c931e6bb209cb948d1a4834f689c836528c', class: 'interactiveIconLarge' }, isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'arrow-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'arrow-dark' })))), index.h("div", { key: 'd864f312cc779cb52f7f4529691f32b2460a38c1', class: 'imageContainer' }, index.h("img", { key: 'b705f3ebaa1c02e0a80c181c0cb9e6c5afd1b10c', alt: this.imageDescription, class: isLightTheme ? 'imageLight' : 'imageDark', src: this.imageSource })), index.h("div", { key: 'da90f1ba12456a8a25c5983e1061fba917632ebf', class: 'contentContainer' }, index.h("h2", { key: '27af1079e7b12025a96cc0ac890dc9a2516bfa4a', class: isLightTheme ? 'headingLight' : 'headingDark' }, this.headingText, this.isInteractive && (index.h("div", { key: 'da3f8e81bb039fb68b1afb8e3656ce04adc552ba', class: 'interactiveIconSmall' }, isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'arrow-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'arrow-dark' }))))), index.h("h3", { key: 'f62cd5e67cdf03286387061ed944504ac1b0e0d2', class: isLightTheme ? 'subheadingLight' : 'subheadingDark' }, this.subheadingText), index.h("p", { key: 'b8024831da3be09abfb758370e25b42a7d9e8517', class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark' }, this.primaryContent), index.h("p", { key: 'b9a847323f17b8cda2c8de170c9308359f113cfd', class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark' }, this.secondaryContent), index.h("p", { key: 'cda9259099171541f59fcf6ab4524d4ba3d40f29', class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark' }, this.tertiaryContent), this.buttonText && (index.h("button", { key: 'f527dad1a614f3bf54d8ce724f374423013f8ca2', onClick: this.handleButtonClick, type: 'button' }, this.buttonText)))));
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
|
|
139
|
-
|
|
140
|
-
const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:100px 20px}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}";
|
|
141
|
-
const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss;
|
|
142
|
-
|
|
143
|
-
const SearchcraftBaseSearchResults = class {
|
|
144
|
-
constructor(hostRef) {
|
|
145
|
-
index.registerInstance(this, hostRef);
|
|
146
|
-
this.query = '';
|
|
147
|
-
this.searchResults = null;
|
|
148
|
-
this.searchKeys = '';
|
|
149
|
-
this.customStylesForResults = {};
|
|
150
|
-
}
|
|
151
|
-
componentDidLoad() {
|
|
152
|
-
// Initialize searchKeys if not provided
|
|
153
|
-
if (!this.searchKeys || this.searchKeys.length === 0) {
|
|
154
|
-
console.warn('No searchKeys provided; using empty keys array.');
|
|
155
|
-
this.searchKeys = ''; // Ensure it's explicitly set as an empty array
|
|
156
|
-
}
|
|
157
|
-
// Subscribe to state changes
|
|
158
|
-
this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
|
|
159
|
-
this.searchResults = Object.assign({}, state.searchResults);
|
|
160
|
-
this.query = state.query;
|
|
161
|
-
});
|
|
162
|
-
// Fetch initial state
|
|
163
|
-
const { searchResults, query } = store.useSearchcraftStore.getState();
|
|
164
|
-
this.searchResults = searchResults;
|
|
165
|
-
this.query = query;
|
|
166
|
-
}
|
|
167
|
-
disconnectedCallback() {
|
|
168
|
-
if (this.unsubscribe) {
|
|
169
|
-
this.unsubscribe();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
render() {
|
|
173
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
174
|
-
if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
175
|
-
console.warn('No search results data available');
|
|
176
|
-
return index.h("div", null, "No results to display.");
|
|
177
|
-
}
|
|
178
|
-
const parsedSearchKeys = utils.parseSearchKeys(this.searchKeys);
|
|
179
|
-
const parsedCustomStyles = utils.parseCustomStyles(this.customStylesForResults);
|
|
180
|
-
return (index.h("div", { class: 'resultsContainer' }, (_d = (_c = (_b = this.searchResults) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.hits) === null || _d === void 0 ? void 0 :
|
|
181
|
-
_d.map((document, index$1) => {
|
|
182
|
-
const { doc: result } = document;
|
|
183
|
-
const dynamicProperties = utils.extractDynamicProperties(result, parsedSearchKeys);
|
|
184
|
-
// Render the custom element if present, otherwise fallback to default
|
|
185
|
-
const customElement = this.hostElement.querySelector('[slot="result-template"]');
|
|
186
|
-
if (customElement) {
|
|
187
|
-
// Clone the custom element and pass data to it
|
|
188
|
-
const customElementClone = customElement.cloneNode(true);
|
|
189
|
-
customElementClone.removeAttribute('slot'); // Remove the slot attribute
|
|
190
|
-
customElementClone.setAttribute('data-result', JSON.stringify(result));
|
|
191
|
-
return (index.h("div", { key: `${dynamicProperties.id}-${index$1}` }, customElementClone.outerHTML));
|
|
192
|
-
}
|
|
193
|
-
// Fallback to the default element
|
|
194
|
-
return (index.h("searchcraft-base-search-result", { key: `${dynamicProperties.id}-${index$1}`, "button-callback": () => console.log('button callback'), "result-callback": () => console.log('interactive element'), "keydown-callback": () => console.log('keydown'), "is-interactive": true, "heading-text": dynamicProperties[parsedSearchKeys[0]], "subheading-text": dynamicProperties[parsedSearchKeys[1]], "primary-content": dynamicProperties[parsedSearchKeys[2]], "secondary-content": dynamicProperties[parsedSearchKeys[3]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]], "image-source": dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]], customStyles: parsedCustomStyles }));
|
|
195
|
-
}), this.query.length > 0 &&
|
|
196
|
-
((_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 && (index.h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })), index.h("slot", { name: 'result-template' })));
|
|
197
|
-
}
|
|
198
|
-
get hostElement() { return index.getElement(this); }
|
|
199
|
-
};
|
|
200
|
-
SearchcraftBaseSearchResults.style = SearchcraftBaseSearchResultsStyle0;
|
|
201
|
-
|
|
202
|
-
const SearchcraftClearIconSet = class {
|
|
203
|
-
constructor(hostRef) {
|
|
204
|
-
index.registerInstance(this, hostRef);
|
|
205
|
-
this.type = 'clear-light';
|
|
206
|
-
}
|
|
207
|
-
render() {
|
|
208
|
-
switch (this.type) {
|
|
209
|
-
case 'clear-light':
|
|
210
|
-
return (index.h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Light"), index.h("path", { d: 'M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z', stroke: 'black', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
211
|
-
case 'clear-dark':
|
|
212
|
-
return (index.h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Dark"), index.h("path", { d: 'M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z', stroke: 'white', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
213
|
-
case 'arrow-light':
|
|
214
|
-
return (index.h("svg", { width: '20', height: '21', viewBox: '0 0 20 21', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Light"), index.h("path", { d: 'M7.5 15.0444L12.5 10.0444L7.5 5.04443', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
215
|
-
case 'arrow-dark':
|
|
216
|
-
return (index.h("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Dark"), index.h("path", { d: 'M1.5 11L6.5 6L1.5 1', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
217
|
-
default:
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
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:25px;top:50%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:25px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}";
|
|
224
|
-
const SearchcraftClearInputButtonStyle0 = searchcraftClearInputButtonModuleCss;
|
|
225
|
-
|
|
226
|
-
const SearchcraftClearInputButton = class {
|
|
227
|
-
constructor(hostRef) {
|
|
228
|
-
index.registerInstance(this, hostRef);
|
|
229
|
-
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
230
|
-
// Added a click handler to emit the event
|
|
231
|
-
this.handleClearClick = (event) => {
|
|
232
|
-
event.preventDefault(); // Prevent default if necessary
|
|
233
|
-
this.clearInput.emit(); // Emit the event
|
|
234
|
-
};
|
|
235
|
-
this.isRequesting = false;
|
|
236
|
-
this.rightToLeftOrientation = false;
|
|
237
|
-
this.theme = 'light';
|
|
238
|
-
}
|
|
239
|
-
isLightTheme() {
|
|
240
|
-
return this.theme === 'light';
|
|
241
|
-
}
|
|
242
|
-
render() {
|
|
243
|
-
return this.rightToLeftOrientation ? (index.h("button", { class: index$1.classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (index.h("searchcraft-spinner-light", null)) : (index.h("searchcraft-spinner-dark", null))) : 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', '.sc-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (index.h("searchcraft-spinner-light", null)) : (index.h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
SearchcraftClearInputButton.style = SearchcraftClearInputButtonStyle0;
|
|
247
|
-
|
|
248
|
-
const searchcraftErrorMessageModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.errorMessageLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.errorMessageDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}";
|
|
249
|
-
const SearchcraftErrorMessageStyle0 = searchcraftErrorMessageModuleCss;
|
|
250
|
-
|
|
251
|
-
const SearchcraftErrorMessage = class {
|
|
252
|
-
constructor(hostRef) {
|
|
253
|
-
index.registerInstance(this, hostRef);
|
|
254
|
-
this.errorMessage = undefined;
|
|
255
|
-
this.theme = 'light';
|
|
256
|
-
}
|
|
257
|
-
render() {
|
|
258
|
-
const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
|
|
259
|
-
return (index.h("p", { key: '4e0b94cb24f940e8c404fd752e6f02f977190043', class: index$1.classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
|
|
263
|
-
|
|
264
|
-
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;width:100%;background-color:#EDEDED;color:#292929;margin-right:8px;padding-left:36px;padding-right:16px}.inputLightLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputLightLTR::placeholder{color:#737373}.inputLightLTR:focus{outline:2px solid #000}.inputDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-right:8px;padding-left:36px;padding-right:16px}.inputDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputDarkLTR::placeholder{color:#BFBFBF}.inputDarkLTR:focus{outline:2px solid #FFF}.inputErrorLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorLightLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorLightLTR::placeholder{color:#737373}.inputErrorLightLTR:focus{outline:2px solid #000}.inputErrorLightLTR:focus-visible{outline:2px solid #c00}.inputErrorDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorDarkLTR::placeholder{color:#BFBFBF}.inputErrorDarkLTR:focus{outline:2px solid #FFF}.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;width:100%;background-color:#EDEDED;color:#292929;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputLightRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputLightRTL::placeholder{color:#737373}.inputLightRTL:focus{outline:2px solid #000}.inputDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputDarkRTL::placeholder{color:#BFBFBF}.inputDarkRTL:focus{outline:2px solid #FFF}.inputErrorLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorLightRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorLightRTL::placeholder{color:#737373}.inputErrorLightRTL:focus{outline:2px solid #000}.inputErrorLightRTL:focus-visible{outline:2px solid #c00}.inputErrorDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;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}.inputErrorDarkRTL::placeholder{color:#BFBFBF}.inputErrorDarkRTL:focus{outline:2px solid #FFF}.inputErrorDarkRTL:focus-visible{outline:2px solid #FFB3B3}.inputWrapper{align-items:center;display:flex;position:relative;width:100%}";
|
|
265
|
-
const SearchcraftInputStyle0 = searchcraftInputModuleCss;
|
|
266
|
-
|
|
267
|
-
const SearchcraftInput = class {
|
|
268
|
-
constructor(hostRef) {
|
|
269
|
-
index.registerInstance(this, hostRef);
|
|
270
|
-
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
271
|
-
this.searchInputChange = index.createEvent(this, "searchInputChange", 7);
|
|
272
|
-
this.customStyles = {};
|
|
273
|
-
this.error = false;
|
|
274
|
-
this.formClassName = '';
|
|
275
|
-
this.inputCaptionClassName = '';
|
|
276
|
-
this.inputCaptionValue = '';
|
|
277
|
-
this.inputClassName = '';
|
|
278
|
-
this.placeholderValue = 'Enter Search';
|
|
279
|
-
this.rightToLeftOrientation = false;
|
|
280
|
-
this.query = '';
|
|
281
|
-
this.theme = 'light';
|
|
282
|
-
}
|
|
283
|
-
get isLightTheme() {
|
|
284
|
-
return this.theme === 'light';
|
|
285
|
-
}
|
|
286
|
-
handleInputChange(event) {
|
|
287
|
-
const input = event.target;
|
|
288
|
-
this.searchInputChange.emit(input.value);
|
|
289
|
-
}
|
|
290
|
-
handleClearInput() {
|
|
291
|
-
if (this.clearInput) {
|
|
292
|
-
this.clearInput.emit();
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
render() {
|
|
296
|
-
const containerClassName = this.rightToLeftOrientation
|
|
297
|
-
? 'inputContainerRTL'
|
|
298
|
-
: 'inputContainerLTR';
|
|
299
|
-
const inputClassName = index$1.classNames(this.error
|
|
300
|
-
? this.isLightTheme
|
|
301
|
-
? 'inputErrorLightRTL'
|
|
302
|
-
: 'inputErrorDarkRTL'
|
|
303
|
-
: this.isLightTheme
|
|
304
|
-
? 'inputLightLTR'
|
|
305
|
-
: 'inputDarkLTR', 'searchcraft-input');
|
|
306
|
-
const validatedCustomStyles = utils.parseCustomStyles(this.customStyles);
|
|
307
|
-
const placeholderStyle = {
|
|
308
|
-
fontSize: validatedCustomStyles.placeholderFontSize || '16px',
|
|
309
|
-
};
|
|
310
|
-
return (index.h("div", { key: '3a3fa1335552c53967d35219819024377e726d80', class: index$1.classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (index.h(index.Fragment, null, index.h("input", { class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), index.h("style", null, `
|
|
311
|
-
#searchcraft-input-id::placeholder {
|
|
312
|
-
font-size: ${placeholderStyle.fontSize};
|
|
313
|
-
}
|
|
314
|
-
`), this.inputCaptionValue && (index.h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (index.h("searchcraft-clear-input-button", { onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation })), index.h("searchcraft-input-icon", { error: this.error, rightToLeftOrientation: this.rightToLeftOrientation }))) : (index.h("div", { class: 'inputWrapper' }, index.h("searchcraft-input-icon", { error: this.error, rightToLeftOrientation: this.rightToLeftOrientation }), index.h("input", { class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), index.h("style", null, `
|
|
315
|
-
#searchcraft-input-id::placeholder {
|
|
316
|
-
font-size: ${placeholderStyle.fontSize};
|
|
317
|
-
}
|
|
318
|
-
`), this.inputCaptionValue && (index.h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (index.h("searchcraft-clear-input-button", { onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation }))))));
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
SearchcraftInput.style = SearchcraftInputStyle0;
|
|
322
|
-
|
|
323
|
-
const searchcraftInputCaptionModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputCaptionLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040}.inputCaptionDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6}.inputCaptionErrorLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.inputCaptionErrorDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}.inputCaptionLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040;text-align:right}.inputCaptionDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6;text-align:right}.inputCaptionErrorLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000;text-align:right}.inputCaptionErrorDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3;text-align:right}";
|
|
324
|
-
const SearchcraftInputCaptionStyle0 = searchcraftInputCaptionModuleCss;
|
|
325
|
-
|
|
326
|
-
const SearchcraftInputCaption = class {
|
|
327
|
-
constructor(hostRef) {
|
|
328
|
-
index.registerInstance(this, hostRef);
|
|
329
|
-
this.error = undefined;
|
|
330
|
-
this.inputCaptionClassName = '';
|
|
331
|
-
this.inputCaptionValue = 'Enter Search';
|
|
332
|
-
this.rightToLeftOrientation = false;
|
|
333
|
-
this.theme = 'light';
|
|
334
|
-
}
|
|
335
|
-
isLightTheme() {
|
|
336
|
-
return this.theme === 'light';
|
|
337
|
-
}
|
|
338
|
-
render() {
|
|
339
|
-
return this.rightToLeftOrientation ? (index.h("p", { class: index$1.classNames(this.error
|
|
340
|
-
? this.isLightTheme
|
|
341
|
-
? 'inputCaptionErrorLightRTL'
|
|
342
|
-
: 'inputCaptionErrorDarkRTL'
|
|
343
|
-
: this.isLightTheme
|
|
344
|
-
? 'inputCaptionLightRTL'
|
|
345
|
-
: 'inputCaptionDarkRTL', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue)) : (index.h("p", { class: index$1.classNames(this.error
|
|
346
|
-
? this.isLightTheme
|
|
347
|
-
? 'inputCaptionErrorLightLTR'
|
|
348
|
-
: 'inputCaptionErrorDarkLTR'
|
|
349
|
-
: this.isLightTheme
|
|
350
|
-
? 'inputCaptionLightLTR'
|
|
351
|
-
: 'inputCaptionDarkLTR', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue));
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
|
|
355
|
-
|
|
356
|
-
const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{height:20px;left:15px;position:absolute;top:50%;transform:translateY(-50%);width:20px}.inputIconRTL{height:20px;position:absolute;right:15px;top:50%;transform:translateY(-50%);width:20px}";
|
|
357
|
-
const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
|
|
358
|
-
|
|
359
|
-
const SearchcraftInputIcon = class {
|
|
360
|
-
constructor(hostRef) {
|
|
361
|
-
index.registerInstance(this, hostRef);
|
|
362
|
-
this.error = undefined;
|
|
363
|
-
this.rightToLeftOrientation = false;
|
|
364
|
-
this.theme = 'light';
|
|
365
|
-
}
|
|
366
|
-
isLightTheme() {
|
|
367
|
-
return this.theme === 'light';
|
|
368
|
-
}
|
|
369
|
-
render() {
|
|
370
|
-
return this.error ? (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme ? (index.h("searchcraft-search-icon-set", { type: 'error-light' })) : (index.h("searchcraft-search-icon-set", { type: 'error-dark' })))) : (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme ? (index.h("searchcraft-search-icon-set", { type: 'search-light' })) : (index.h("searchcraft-search-icon-set", { type: 'search-dark' }))));
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
|
|
374
|
-
|
|
375
|
-
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:#FFF}";
|
|
376
|
-
const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
|
|
377
|
-
|
|
378
|
-
const SearchcraftInputLabel = class {
|
|
379
|
-
constructor(hostRef) {
|
|
380
|
-
index.registerInstance(this, hostRef);
|
|
381
|
-
this.inputLabelClassName = '';
|
|
382
|
-
this.label = undefined;
|
|
383
|
-
this.theme = 'light';
|
|
384
|
-
}
|
|
385
|
-
isLightTheme() {
|
|
386
|
-
return this.theme === 'light';
|
|
387
|
-
}
|
|
388
|
-
render() {
|
|
389
|
-
// Render nothing if no label prop is provided
|
|
390
|
-
if (!this.label) {
|
|
391
|
-
return null;
|
|
392
|
-
}
|
|
393
|
-
const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
|
|
394
|
-
return (index.h("label", { class: index$1.classNames(labelStyle, this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
|
|
398
|
-
|
|
399
|
-
const SearchcraftSearchIconSet = class {
|
|
400
|
-
constructor(hostRef) {
|
|
401
|
-
index.registerInstance(this, hostRef);
|
|
402
|
-
this.type = 'search-dark';
|
|
403
|
-
}
|
|
404
|
-
render() {
|
|
405
|
-
switch (this.type) {
|
|
406
|
-
case 'search-light':
|
|
407
|
-
return (index.h("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Light"), index.h("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: '#404040', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
408
|
-
case 'search-dark':
|
|
409
|
-
return (index.h("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Dark"), index.h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#E6E6E6', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
410
|
-
case 'error-light':
|
|
411
|
-
return (index.h("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Light"), index.h("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
412
|
-
case 'error-dark':
|
|
413
|
-
return (index.h("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Dark"), index.h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
|
|
414
|
-
default:
|
|
415
|
-
return null;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
const searchcraftSpinnerDarkModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{height:100%;width:100%;background:conic-gradient(#000 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}.spinnerLight{height:100%;width:100%;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
421
|
-
const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
|
|
422
|
-
|
|
423
|
-
const SearchcraftSpinnerDark = class {
|
|
424
|
-
constructor(hostRef) {
|
|
425
|
-
index.registerInstance(this, hostRef);
|
|
426
|
-
}
|
|
427
|
-
render() {
|
|
428
|
-
return (index.h("div", { key: 'fc32dd86414502f1895b157d8aa28645a5391ff9', class: 'spinnerContainer' }, index.h("div", { key: '260233361f9ff5a17d05b92e41ec2fc13adc2dbf', class: 'spinnerDark' })));
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
|
|
432
|
-
|
|
433
|
-
const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{height:100%;width:100%;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
434
|
-
const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
|
|
435
|
-
|
|
436
|
-
const SearchcraftSpinnerLight = class {
|
|
437
|
-
constructor(hostRef) {
|
|
438
|
-
index.registerInstance(this, hostRef);
|
|
439
|
-
}
|
|
440
|
-
render() {
|
|
441
|
-
return (index.h("div", { key: '0e0faa615a1548868153b07bb467ee85eabcdd09', class: 'spinnerContainer' }, index.h("div", { key: 'a9aac4d029d9072e01cc643da62f3338622f0ef0', class: 'spinnerLight' })));
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
|
|
445
|
-
|
|
446
|
-
exports.searchcraft_auto_search_form = SearchcraftAutoSearchForm;
|
|
447
|
-
exports.searchcraft_base_search_result = SearchcraftBaseSearchResult;
|
|
448
|
-
exports.searchcraft_base_search_results = SearchcraftBaseSearchResults;
|
|
449
|
-
exports.searchcraft_clear_icon_set = SearchcraftClearIconSet;
|
|
450
|
-
exports.searchcraft_clear_input_button = SearchcraftClearInputButton;
|
|
451
|
-
exports.searchcraft_error_message = SearchcraftErrorMessage;
|
|
452
|
-
exports.searchcraft_input = SearchcraftInput;
|
|
453
|
-
exports.searchcraft_input_caption = SearchcraftInputCaption;
|
|
454
|
-
exports.searchcraft_input_icon = SearchcraftInputIcon;
|
|
455
|
-
exports.searchcraft_input_label = SearchcraftInputLabel;
|
|
456
|
-
exports.searchcraft_search_icon_set = SearchcraftSearchIconSet;
|
|
457
|
-
exports.searchcraft_spinner_dark = SearchcraftSpinnerDark;
|
|
458
|
-
exports.searchcraft_spinner_light = SearchcraftSpinnerLight;
|
|
459
|
-
|
|
460
|
-
//# sourceMappingURL=searchcraft-auto-search-form_13.cjs.entry.js.map
|