@searchcraft/javascript-sdk 0.2.2 → 0.2.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-8211f330.js +3043 -0
- package/dist/searchcraft-javascript-sdk/index-8211f330.js.map +1 -0
- package/dist/{components/p-5cdc6210.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 +113 -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 +6 -6
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js +57 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +1 -0
- package/dist/{components/searchcraft-base-search-results.js → searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js} +22 -83
- 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 +4 -4
- package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +1 -0
- package/dist/{components/p-70722ab2.js → searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js} +7 -24
- 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 +30 -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/searchcraft-filters-list.js → searchcraft-javascript-sdk/searchcraft-filters-list.entry.js} +16 -43
- package/dist/searchcraft-javascript-sdk/searchcraft-filters-list.entry.js.map +1 -0
- package/dist/{components/p-6237f03e.js → searchcraft-javascript-sdk/searchcraft-input-caption.entry.js} +10 -31
- package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +25 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +29 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +1 -0
- package/dist/{components/p-2350c0ab.js → searchcraft-javascript-sdk/searchcraft-input.entry.js} +12 -83
- 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/{collection/components/searchcraft-results-info/searchcraft-results-info.js → searchcraft-javascript-sdk/searchcraft-results-info.entry.js} +15 -26
- package/dist/searchcraft-javascript-sdk/searchcraft-results-info.entry.js.map +1 -0
- package/dist/{components/p-a3bd1bc8.js → searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js} +7 -26
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-slider.entry.js +76 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-slider.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/{collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js → searchcraft-javascript-sdk/searchcraft-toggle-button.entry.js} +15 -47
- package/dist/searchcraft-javascript-sdk/searchcraft-toggle-button.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-0451a982.js +3070 -0
- package/dist/searchcraft-javascript-sdk/store-0451a982.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/store-18b7e3ea.js +3071 -0
- package/dist/searchcraft-javascript-sdk/store-18b7e3ea.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/store-910b9836.js +3071 -0
- package/dist/searchcraft-javascript-sdk/store-910b9836.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/store-935525f8.js +3071 -0
- package/dist/searchcraft-javascript-sdk/store-935525f8.js.map +1 -0
- package/dist/{components/p-aff5cd24.js → searchcraft-javascript-sdk/utils-6d98c145.js} +21 -2
- package/dist/searchcraft-javascript-sdk/utils-6d98c145.js.map +1 -0
- package/dist/{esm/utils-e2076797.js → searchcraft-javascript-sdk/utils-d88ac15c.js} +22 -4
- package/dist/searchcraft-javascript-sdk/utils-d88ac15c.js.map +1 -0
- package/dist/{cjs/utils-bd99e8b0.js → searchcraft-javascript-sdk/utils-dbb6302b.js} +23 -10
- package/dist/searchcraft-javascript-sdk/utils-dbb6302b.js.map +1 -0
- package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +1 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +3 -3
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +8 -9
- package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +1 -1
- package/dist/types/components/searchcraft-input-icon/searchcraft-input-icon.d.ts +1 -7
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +4 -4
- package/dist/types/components.d.ts +1 -13
- package/dist/types/provider/store.d.ts +8 -8
- package/dist/types/utils/utils.d.ts +1 -0
- 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-6c5282a0.js +0 -1279
- package/dist/cjs/index-6c5282a0.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -17
- 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_17.cjs.entry.js +0 -804
- package/dist/cjs/searchcraft-auto-search-form_17.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-ccdd30e6.js +0 -314
- package/dist/cjs/store-ccdd30e6.js.map +0 -1
- package/dist/cjs/utils-bd99e8b0.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 -84
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -31
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +0 -365
- 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 -13
- 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 -308
- 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 -216
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +0 -271
- 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 -47
- 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-filters-list/searchcraft-filters-list.js +0 -155
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +0 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +0 -70
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +0 -352
- 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 -109
- 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 -17
- 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-results-info/searchcraft-results-info.js.map +0 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +0 -16
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +0 -121
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +0 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +0 -77
- 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/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +0 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +0 -31
- package/dist/collection/index.js +0 -14
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/provider/store.js +0 -97
- package/dist/collection/provider/store.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -45
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js +0 -58
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-1101288c.js +0 -53
- package/dist/components/p-1101288c.js.map +0 -1
- package/dist/components/p-15dd4fe4.js +0 -33
- package/dist/components/p-15dd4fe4.js.map +0 -1
- package/dist/components/p-2350c0ab.js.map +0 -1
- package/dist/components/p-5cdc6210.js.map +0 -1
- package/dist/components/p-6237f03e.js.map +0 -1
- package/dist/components/p-70722ab2.js.map +0 -1
- package/dist/components/p-7498e493.js +0 -1113
- package/dist/components/p-7498e493.js.map +0 -1
- package/dist/components/p-848301b7.js +0 -40
- package/dist/components/p-848301b7.js.map +0 -1
- package/dist/components/p-85693c64.js +0 -61
- package/dist/components/p-85693c64.js.map +0 -1
- package/dist/components/p-8fe6289d.js +0 -49
- package/dist/components/p-8fe6289d.js.map +0 -1
- package/dist/components/p-99971aa9.js +0 -310
- package/dist/components/p-99971aa9.js.map +0 -1
- package/dist/components/p-a3bd1bc8.js.map +0 -1
- package/dist/components/p-aff5cd24.js.map +0 -1
- package/dist/components/p-bd90d9b4.js +0 -85
- package/dist/components/p-bd90d9b4.js.map +0 -1
- package/dist/components/p-c70cd874.js +0 -68
- package/dist/components/p-c70cd874.js.map +0 -1
- package/dist/components/p-c815eb98.js +0 -33
- package/dist/components/p-c815eb98.js.map +0 -1
- package/dist/components/searchcraft-auto-search-form.js +0 -207
- package/dist/components/searchcraft-auto-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-form.js +0 -152
- 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.map +0 -1
- package/dist/components/searchcraft-button-icon.js +0 -32
- 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-filters-list.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-results-info.js +0 -63
- package/dist/components/searchcraft-results-info.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-slider.js +0 -95
- package/dist/components/searchcraft-slider.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/components/searchcraft-toggle-button.js +0 -83
- package/dist/components/searchcraft-toggle-button.js.map +0 -1
- package/dist/esm/index-0ac5bb53.js +0 -1251
- package/dist/esm/index-0ac5bb53.js.map +0 -1
- package/dist/esm/index-72ac5051.js +0 -82
- package/dist/esm/index-72ac5051.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_17.entry.js +0 -784
- package/dist/esm/searchcraft-auto-search-form_17.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-311de204.js +0 -310
- package/dist/esm/store-311de204.js.map +0 -1
- package/dist/esm/utils-e2076797.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-0880cfbb.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-0880cfbb.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-5ec960bd.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5ec960bd.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-80ea9602.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-80ea9602.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-aff5cd24.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-aff5cd24.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-cc454542.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-cc454542.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-e1255160.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +0 -1
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js.map +0 -0
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { useSearchcraftStore } from "../../provider/store";
|
|
3
|
-
import { extractDynamicProperties, parseSearchKeys, serializeStyles, } from "../../utils/utils";
|
|
4
|
-
export class SearchcraftBaseSearchResults {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.query = '';
|
|
7
|
-
this.searchResults = null;
|
|
8
|
-
this.hasSearched = false;
|
|
9
|
-
this.documentAttributesForDisplay = '';
|
|
10
|
-
this.customStylesForResults = {};
|
|
11
|
-
this.placeAdAtStart = true;
|
|
12
|
-
this.placeAdAtEnd = false;
|
|
13
|
-
this.adInterval = 4;
|
|
14
|
-
this.formatTime = true;
|
|
15
|
-
this.fallbackElement = null;
|
|
16
|
-
}
|
|
17
|
-
componentDidLoad() {
|
|
18
|
-
if (!this.documentAttributesForDisplay ||
|
|
19
|
-
this.documentAttributesForDisplay.length === 0) {
|
|
20
|
-
console.warn('No document attributes provided; using empty keys array.');
|
|
21
|
-
this.documentAttributesForDisplay = '';
|
|
22
|
-
}
|
|
23
|
-
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
24
|
-
if (state.query.length > 0) {
|
|
25
|
-
this.hasSearched = true;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this.hasSearched = false;
|
|
29
|
-
}
|
|
30
|
-
this.searchResults = Object.assign({}, state.searchResults);
|
|
31
|
-
this.query = state.query;
|
|
32
|
-
});
|
|
33
|
-
const { searchResults, query } = useSearchcraftStore.getState();
|
|
34
|
-
this.searchResults = searchResults;
|
|
35
|
-
this.query = query;
|
|
36
|
-
}
|
|
37
|
-
disconnectedCallback() {
|
|
38
|
-
if (this.unsubscribe) {
|
|
39
|
-
this.unsubscribe();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
timeAgo(timestamp) {
|
|
43
|
-
const now = new Date();
|
|
44
|
-
const inputTime = new Date(timestamp);
|
|
45
|
-
const diffInSeconds = Math.floor((now.getTime() - inputTime.getTime()) / 1000);
|
|
46
|
-
const minutes = Math.floor(diffInSeconds / 60);
|
|
47
|
-
const hours = Math.floor(minutes / 60);
|
|
48
|
-
const days = Math.floor(hours / 24);
|
|
49
|
-
const years = Math.floor(days / 365);
|
|
50
|
-
if (minutes < 60) {
|
|
51
|
-
return `${minutes}m ago`;
|
|
52
|
-
}
|
|
53
|
-
if (hours < 24) {
|
|
54
|
-
return `${hours}h ago`;
|
|
55
|
-
}
|
|
56
|
-
if (days < 365) {
|
|
57
|
-
return `${days}d ago`;
|
|
58
|
-
}
|
|
59
|
-
return `${years}y ago`;
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
63
|
-
if (!this.hasSearched) {
|
|
64
|
-
return (h("div", { class: 'emptyState' }, h("slot", { name: 'empty-search' })));
|
|
65
|
-
}
|
|
66
|
-
if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
67
|
-
console.warn('No search results data available');
|
|
68
|
-
return h("div", { class: 'emptyState' }, "No results to display.");
|
|
69
|
-
}
|
|
70
|
-
const parsedSearchKeys = parseSearchKeys(this.documentAttributesForDisplay);
|
|
71
|
-
const serializedStyles = typeof this.customStylesForResults === 'string'
|
|
72
|
-
? this.customStylesForResults
|
|
73
|
-
: serializeStyles(this.customStylesForResults);
|
|
74
|
-
const resultsComponents = (_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 : _d.map((document, index) => {
|
|
75
|
-
const { doc: result } = document;
|
|
76
|
-
const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
|
|
77
|
-
// Apply timeAgo formatting if formatTime is true
|
|
78
|
-
if (this.formatTime) {
|
|
79
|
-
for (const key of parsedSearchKeys) {
|
|
80
|
-
if (dynamicProperties[key]) {
|
|
81
|
-
const value = dynamicProperties[key];
|
|
82
|
-
// Check if the value is a valid ISO timestamp
|
|
83
|
-
if (typeof value === 'string' &&
|
|
84
|
-
!Number.isNaN(Date.parse(value))) {
|
|
85
|
-
dynamicProperties[key] = this.timeAgo(value);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return (h("searchcraft-base-search-result", { key: `${document.document_id}-${index}`, "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]], "custom-styles": serializedStyles }));
|
|
91
|
-
});
|
|
92
|
-
const finalComponents = [];
|
|
93
|
-
if (this.placeAdAtStart) {
|
|
94
|
-
finalComponents.push(h("div", { key: 'ad-section-start', class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
|
|
95
|
-
}
|
|
96
|
-
if (this.adInterval > 0) {
|
|
97
|
-
resultsComponents.forEach((component, index) => {
|
|
98
|
-
finalComponents.push(component);
|
|
99
|
-
if ((index + 1) % this.adInterval === 0) {
|
|
100
|
-
finalComponents.push(h("div", { key: `ad-section-${index + 1}`, class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
finalComponents.push(...resultsComponents);
|
|
106
|
-
}
|
|
107
|
-
if (this.placeAdAtEnd) {
|
|
108
|
-
finalComponents.push(h("div", { key: 'ad-section-end', class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
|
|
109
|
-
}
|
|
110
|
-
return (h("div", { class: 'resultsContainer' }, finalComponents, this.query.length > 0 &&
|
|
111
|
-
((_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 && (h("div", { class: 'errorMessageContainer' }, h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })))));
|
|
112
|
-
}
|
|
113
|
-
static get is() { return "searchcraft-base-search-results"; }
|
|
114
|
-
static get encapsulation() { return "shadow"; }
|
|
115
|
-
static get originalStyleUrls() {
|
|
116
|
-
return {
|
|
117
|
-
"$": ["searchcraft-base-search-results.module.scss"]
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
static get styleUrls() {
|
|
121
|
-
return {
|
|
122
|
-
"$": ["searchcraft-base-search-results.module.css"]
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
static get properties() {
|
|
126
|
-
return {
|
|
127
|
-
"documentAttributesForDisplay": {
|
|
128
|
-
"type": "string",
|
|
129
|
-
"mutable": false,
|
|
130
|
-
"complexType": {
|
|
131
|
-
"original": "string",
|
|
132
|
-
"resolved": "string",
|
|
133
|
-
"references": {}
|
|
134
|
-
},
|
|
135
|
-
"required": false,
|
|
136
|
-
"optional": false,
|
|
137
|
-
"docs": {
|
|
138
|
-
"tags": [],
|
|
139
|
-
"text": ""
|
|
140
|
-
},
|
|
141
|
-
"attribute": "document-attributes-for-display",
|
|
142
|
-
"reflect": false,
|
|
143
|
-
"defaultValue": "''"
|
|
144
|
-
},
|
|
145
|
-
"customStylesForResults": {
|
|
146
|
-
"type": "string",
|
|
147
|
-
"mutable": false,
|
|
148
|
-
"complexType": {
|
|
149
|
-
"original": "| string\n | Record<string, Record<string, string>>",
|
|
150
|
-
"resolved": "string | { [x: string]: Record<string, string>; }",
|
|
151
|
-
"references": {
|
|
152
|
-
"Record": {
|
|
153
|
-
"location": "global",
|
|
154
|
-
"id": "global::Record"
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"required": false,
|
|
159
|
-
"optional": false,
|
|
160
|
-
"docs": {
|
|
161
|
-
"tags": [],
|
|
162
|
-
"text": ""
|
|
163
|
-
},
|
|
164
|
-
"attribute": "custom-styles-for-results",
|
|
165
|
-
"reflect": false,
|
|
166
|
-
"defaultValue": "{}"
|
|
167
|
-
},
|
|
168
|
-
"placeAdAtStart": {
|
|
169
|
-
"type": "boolean",
|
|
170
|
-
"mutable": false,
|
|
171
|
-
"complexType": {
|
|
172
|
-
"original": "boolean",
|
|
173
|
-
"resolved": "boolean",
|
|
174
|
-
"references": {}
|
|
175
|
-
},
|
|
176
|
-
"required": false,
|
|
177
|
-
"optional": false,
|
|
178
|
-
"docs": {
|
|
179
|
-
"tags": [],
|
|
180
|
-
"text": ""
|
|
181
|
-
},
|
|
182
|
-
"attribute": "place-ad-at-start",
|
|
183
|
-
"reflect": false,
|
|
184
|
-
"defaultValue": "true"
|
|
185
|
-
},
|
|
186
|
-
"placeAdAtEnd": {
|
|
187
|
-
"type": "boolean",
|
|
188
|
-
"mutable": false,
|
|
189
|
-
"complexType": {
|
|
190
|
-
"original": "boolean",
|
|
191
|
-
"resolved": "boolean",
|
|
192
|
-
"references": {}
|
|
193
|
-
},
|
|
194
|
-
"required": false,
|
|
195
|
-
"optional": false,
|
|
196
|
-
"docs": {
|
|
197
|
-
"tags": [],
|
|
198
|
-
"text": ""
|
|
199
|
-
},
|
|
200
|
-
"attribute": "place-ad-at-end",
|
|
201
|
-
"reflect": false,
|
|
202
|
-
"defaultValue": "false"
|
|
203
|
-
},
|
|
204
|
-
"adInterval": {
|
|
205
|
-
"type": "number",
|
|
206
|
-
"mutable": false,
|
|
207
|
-
"complexType": {
|
|
208
|
-
"original": "number",
|
|
209
|
-
"resolved": "number",
|
|
210
|
-
"references": {}
|
|
211
|
-
},
|
|
212
|
-
"required": false,
|
|
213
|
-
"optional": false,
|
|
214
|
-
"docs": {
|
|
215
|
-
"tags": [],
|
|
216
|
-
"text": ""
|
|
217
|
-
},
|
|
218
|
-
"attribute": "ad-interval",
|
|
219
|
-
"reflect": false,
|
|
220
|
-
"defaultValue": "4"
|
|
221
|
-
},
|
|
222
|
-
"formatTime": {
|
|
223
|
-
"type": "boolean",
|
|
224
|
-
"mutable": false,
|
|
225
|
-
"complexType": {
|
|
226
|
-
"original": "boolean",
|
|
227
|
-
"resolved": "boolean",
|
|
228
|
-
"references": {}
|
|
229
|
-
},
|
|
230
|
-
"required": false,
|
|
231
|
-
"optional": false,
|
|
232
|
-
"docs": {
|
|
233
|
-
"tags": [],
|
|
234
|
-
"text": ""
|
|
235
|
-
},
|
|
236
|
-
"attribute": "format-time",
|
|
237
|
-
"reflect": false,
|
|
238
|
-
"defaultValue": "true"
|
|
239
|
-
},
|
|
240
|
-
"fallbackElement": {
|
|
241
|
-
"type": "unknown",
|
|
242
|
-
"mutable": false,
|
|
243
|
-
"complexType": {
|
|
244
|
-
"original": "HTMLElement | null",
|
|
245
|
-
"resolved": "HTMLElement",
|
|
246
|
-
"references": {
|
|
247
|
-
"HTMLElement": {
|
|
248
|
-
"location": "global",
|
|
249
|
-
"id": "global::HTMLElement"
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
"required": false,
|
|
254
|
-
"optional": false,
|
|
255
|
-
"docs": {
|
|
256
|
-
"tags": [],
|
|
257
|
-
"text": ""
|
|
258
|
-
},
|
|
259
|
-
"defaultValue": "null"
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
static get states() {
|
|
264
|
-
return {
|
|
265
|
-
"query": {},
|
|
266
|
-
"searchResults": {},
|
|
267
|
-
"hasSearched": {}
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
//# sourceMappingURL=searchcraft-base-search-results.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-base-search-results.js","sourceRoot":"","sources":["../../../src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,eAAe,GAChB,MAAM,cAAc,CAAC;AAOtB,MAAM,OAAO,4BAA4B;;qBACtB,EAAE;6BACkC,IAAI;2BAClC,KAAK;4CAEW,EAAE;sCAGI,EAAE;8BACtB,IAAI;4BACN,KAAK;0BACP,CAAC;0BACD,IAAI;+BACqB,IAAI;;IAIlD,gBAAgB;QACd,IACE,CAAC,IAAI,CAAC,4BAA4B;YAClC,IAAI,CAAC,4BAA4B,CAAC,MAAM,KAAK,CAAC,EAC9C,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;YACzE,IAAI,CAAC,4BAA4B,GAAG,EAAE,CAAC;QACzC,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACzD,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,WA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';\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\nimport {\n extractDynamicProperties,\n parseSearchKeys,\n serializeStyles,\n} from '@utils/utils';\n\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResults {\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n @State() hasSearched = false;\n\n @Prop() documentAttributesForDisplay = '';\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>> = {};\n @Prop() placeAdAtStart = true;\n @Prop() placeAdAtEnd = false;\n @Prop() adInterval = 4;\n @Prop() formatTime = true;\n @Prop() fallbackElement: HTMLElement | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n if (\n !this.documentAttributesForDisplay ||\n this.documentAttributesForDisplay.length === 0\n ) {\n console.warn('No document attributes provided; using empty keys array.');\n this.documentAttributesForDisplay = '';\n }\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n timeAgo(timestamp: string): string {\n const now = new Date();\n const inputTime = new Date(timestamp);\n const diffInSeconds = Math.floor(\n (now.getTime() - inputTime.getTime()) / 1000,\n );\n\n const minutes = Math.floor(diffInSeconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const years = Math.floor(days / 365);\n\n if (minutes < 60) {\n return `${minutes}m ago`;\n }\n if (hours < 24) {\n return `${hours}h ago`;\n }\n if (days < 365) {\n return `${days}d ago`;\n }\n return `${years}y ago`;\n }\n\n render() {\n if (!this.hasSearched) {\n return (\n <div class='emptyState'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n console.warn('No search results data available');\n return <div class='emptyState'>No results to display.</div>;\n }\n\n const parsedSearchKeys = parseSearchKeys(this.documentAttributesForDisplay);\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n const resultsComponents = this.searchResults?.data?.hits?.map(\n (document, index) => {\n const { doc: result } = document;\n const dynamicProperties = extractDynamicProperties(\n result,\n parsedSearchKeys,\n );\n\n // Apply timeAgo formatting if formatTime is true\n if (this.formatTime) {\n for (const key of parsedSearchKeys) {\n if (dynamicProperties[key]) {\n const value = dynamicProperties[key];\n // Check if the value is a valid ISO timestamp\n if (\n typeof value === 'string' &&\n !Number.isNaN(Date.parse(value))\n ) {\n dynamicProperties[key] = this.timeAgo(value);\n }\n }\n }\n }\n\n return (\n <searchcraft-base-search-result\n key={`${document.document_id}-${index}`}\n button-callback={() => console.log('button callback')}\n result-callback={() => console.log('interactive element')}\n keydown-callback={() => console.log('keydown')}\n is-interactive={true}\n heading-text={dynamicProperties[parsedSearchKeys[0]]}\n subheading-text={dynamicProperties[parsedSearchKeys[1]]}\n primary-content={dynamicProperties[parsedSearchKeys[2]]}\n secondary-content={dynamicProperties[parsedSearchKeys[3]]}\n tertiary-content={dynamicProperties[parsedSearchKeys[4]]}\n image-source={\n dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]]\n }\n custom-styles={serializedStyles}\n />\n );\n },\n );\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='adSection'>\n <span>##</span>\n <p> Ad Impressions</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n resultsComponents.forEach((component, index) => {\n finalComponents.push(component);\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div key={`ad-section-${index + 1}`} class='adSection'>\n <span>##</span>\n <p> Ad Impressions</p>\n </div>,\n );\n }\n });\n } else {\n finalComponents.push(...resultsComponents);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='adSection'>\n <span>##</span>\n <p> Ad Impressions</p>\n </div>,\n );\n }\n\n return (\n <div class='resultsContainer'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='errorMessageContainer'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--font-stack: Helvetica, Arial, sans-serif;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.resultsContainer {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
margin: 16px 0;
|
|
10
|
-
}
|
|
11
|
-
.resultsContainer > p {
|
|
12
|
-
align-self: center;
|
|
13
|
-
}
|
|
14
|
-
.resultsContainer > div {
|
|
15
|
-
margin-bottom: 20px;
|
|
16
|
-
}
|
|
17
|
-
.resultsContainer > div img {
|
|
18
|
-
height: 300px;
|
|
19
|
-
width: 200px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.adSection {
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: #F1F1F1;
|
|
25
|
-
border: 1px solid #DCDDDE;
|
|
26
|
-
border-radius: 16px;
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
font-size: 16px;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
margin: auto;
|
|
32
|
-
min-height: 150px;
|
|
33
|
-
text-align: center;
|
|
34
|
-
width: 100%;
|
|
35
|
-
}
|
|
36
|
-
.adSection p {
|
|
37
|
-
margin-top: 5px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.emptyState {
|
|
41
|
-
width: 100%;
|
|
42
|
-
text-align: center;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.errorMessageContainer {
|
|
46
|
-
text-align: center;
|
|
47
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { h, Fragment, } from "@stencil/core";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
export class SearchcraftButton {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.handleClick = () => {
|
|
6
|
-
this.buttonClick.emit(); // Emit the event instead of calling a function
|
|
7
|
-
};
|
|
8
|
-
this.iconElement = undefined;
|
|
9
|
-
this.iconOnly = false;
|
|
10
|
-
this.iconPosition = 'left';
|
|
11
|
-
this.label = 'Search';
|
|
12
|
-
this.isRequesting = false;
|
|
13
|
-
this.theme = 'light';
|
|
14
|
-
}
|
|
15
|
-
getButtonStyle() {
|
|
16
|
-
return this.theme === 'light' ? 'buttonLight' : 'buttonDark';
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
const buttonStyle = this.getButtonStyle();
|
|
20
|
-
return (h(Fragment, { key: 'f10a9faa6357ef626c4e5414a5c8bdc1fe0b63a1' }, this.iconOnly ? (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.isRequesting ? (h("div", { class: 'spinner-margin-right' }, h("searchcraft-spinner-dark", null))) : (this.iconElement), h("span", { class: classNames(this.isRequesting && 'button-label', 'searchcraft-button-label') }, this.label)))));
|
|
21
|
-
}
|
|
22
|
-
static get is() { return "searchcraft-button"; }
|
|
23
|
-
static get encapsulation() { return "shadow"; }
|
|
24
|
-
static get originalStyleUrls() {
|
|
25
|
-
return {
|
|
26
|
-
"$": ["searchcraft-button.module.scss"]
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
static get styleUrls() {
|
|
30
|
-
return {
|
|
31
|
-
"$": ["searchcraft-button.module.css"]
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
static get properties() {
|
|
35
|
-
return {
|
|
36
|
-
"iconElement": {
|
|
37
|
-
"type": "unknown",
|
|
38
|
-
"mutable": false,
|
|
39
|
-
"complexType": {
|
|
40
|
-
"original": "Element",
|
|
41
|
-
"resolved": "Element",
|
|
42
|
-
"references": {
|
|
43
|
-
"Element": {
|
|
44
|
-
"location": "global",
|
|
45
|
-
"id": "global::Element"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"required": false,
|
|
50
|
-
"optional": true,
|
|
51
|
-
"docs": {
|
|
52
|
-
"tags": [],
|
|
53
|
-
"text": ""
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"iconOnly": {
|
|
57
|
-
"type": "boolean",
|
|
58
|
-
"mutable": false,
|
|
59
|
-
"complexType": {
|
|
60
|
-
"original": "boolean",
|
|
61
|
-
"resolved": "boolean",
|
|
62
|
-
"references": {}
|
|
63
|
-
},
|
|
64
|
-
"required": false,
|
|
65
|
-
"optional": false,
|
|
66
|
-
"docs": {
|
|
67
|
-
"tags": [],
|
|
68
|
-
"text": ""
|
|
69
|
-
},
|
|
70
|
-
"attribute": "icon-only",
|
|
71
|
-
"reflect": false,
|
|
72
|
-
"defaultValue": "false"
|
|
73
|
-
},
|
|
74
|
-
"iconPosition": {
|
|
75
|
-
"type": "string",
|
|
76
|
-
"mutable": false,
|
|
77
|
-
"complexType": {
|
|
78
|
-
"original": "string",
|
|
79
|
-
"resolved": "string",
|
|
80
|
-
"references": {}
|
|
81
|
-
},
|
|
82
|
-
"required": false,
|
|
83
|
-
"optional": false,
|
|
84
|
-
"docs": {
|
|
85
|
-
"tags": [],
|
|
86
|
-
"text": ""
|
|
87
|
-
},
|
|
88
|
-
"attribute": "icon-position",
|
|
89
|
-
"reflect": false,
|
|
90
|
-
"defaultValue": "'left'"
|
|
91
|
-
},
|
|
92
|
-
"label": {
|
|
93
|
-
"type": "string",
|
|
94
|
-
"mutable": false,
|
|
95
|
-
"complexType": {
|
|
96
|
-
"original": "string",
|
|
97
|
-
"resolved": "string",
|
|
98
|
-
"references": {}
|
|
99
|
-
},
|
|
100
|
-
"required": false,
|
|
101
|
-
"optional": false,
|
|
102
|
-
"docs": {
|
|
103
|
-
"tags": [],
|
|
104
|
-
"text": ""
|
|
105
|
-
},
|
|
106
|
-
"attribute": "label",
|
|
107
|
-
"reflect": false,
|
|
108
|
-
"defaultValue": "'Search'"
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
static get states() {
|
|
113
|
-
return {
|
|
114
|
-
"isRequesting": {},
|
|
115
|
-
"theme": {}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
static get events() {
|
|
119
|
-
return [{
|
|
120
|
-
"method": "buttonClick",
|
|
121
|
-
"name": "buttonClick",
|
|
122
|
-
"bubbles": true,
|
|
123
|
-
"cancelable": true,
|
|
124
|
-
"composed": true,
|
|
125
|
-
"docs": {
|
|
126
|
-
"tags": [],
|
|
127
|
-
"text": ""
|
|
128
|
-
},
|
|
129
|
-
"complexType": {
|
|
130
|
-
"original": "void",
|
|
131
|
-
"resolved": "void",
|
|
132
|
-
"references": {}
|
|
133
|
-
}
|
|
134
|
-
}];
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=searchcraft-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-button.js","sourceRoot":"","sources":["../../../src/components/searchcraft-button/searchcraft-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,CAAC,EACD,KAAK,EACL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,MAAM,OAAO,iBAAiB;;QAepB,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAA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\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftButton {\n @Prop() iconElement?: Element;\n @Prop() iconOnly = false;\n @Prop() iconPosition = 'left';\n @Prop() label = 'Search';\n\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n @State() theme = 'light';\n\n private getButtonStyle() {\n return this.theme === 'light' ? 'buttonLight' : 'buttonDark';\n }\n\n private handleClick = () => {\n this.buttonClick.emit(); // Emit the event instead of calling a function\n };\n\n render() {\n const buttonStyle = this.getButtonStyle();\n\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.isRequesting ? (\n <searchcraft-spinner-dark />\n ) : (\n this.iconElement\n )}\n </button>\n ) : (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.isRequesting ? (\n <div class='spinner-margin-right'>\n <searchcraft-spinner-dark />\n </div>\n ) : (\n this.iconElement\n )}\n <span\n class={classNames(\n this.isRequesting && 'button-label',\n 'searchcraft-button-label',\n )}\n >\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n"]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--font-stack: Helvetica, Arial, sans-serif;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.buttonLight {
|
|
6
|
-
border-radius: 8px;
|
|
7
|
-
display: flex;
|
|
8
|
-
font-family: var(--font-stack);
|
|
9
|
-
font-size: 16px;
|
|
10
|
-
font-weight: 700;
|
|
11
|
-
line-height: 20px;
|
|
12
|
-
padding: 11px 20px;
|
|
13
|
-
position: relative;
|
|
14
|
-
background-color: #000;
|
|
15
|
-
border: 1px solid #E6E6E6;
|
|
16
|
-
color: #FFF;
|
|
17
|
-
}
|
|
18
|
-
.buttonLight:hover {
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
}
|
|
21
|
-
.buttonLight:hover {
|
|
22
|
-
background-color: #2E2E2E;
|
|
23
|
-
}
|
|
24
|
-
.buttonLight:focus {
|
|
25
|
-
outline: 2px solid #000000;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.buttonDark {
|
|
29
|
-
border-radius: 8px;
|
|
30
|
-
display: flex;
|
|
31
|
-
font-family: var(--font-stack);
|
|
32
|
-
font-size: 16px;
|
|
33
|
-
font-weight: 700;
|
|
34
|
-
line-height: 20px;
|
|
35
|
-
padding: 11px 20px;
|
|
36
|
-
position: relative;
|
|
37
|
-
background-color: #FFF;
|
|
38
|
-
border: 1px solid #404040;
|
|
39
|
-
color: #292929;
|
|
40
|
-
}
|
|
41
|
-
.buttonDark:hover {
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
}
|
|
44
|
-
.buttonDark:hover {
|
|
45
|
-
background-color: #FAFAFA;
|
|
46
|
-
}
|
|
47
|
-
.buttonDark:focus {
|
|
48
|
-
outline: 2px solid #404040;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.spinnerMarginRight {
|
|
52
|
-
left: 4px;
|
|
53
|
-
margin-right: 4px;
|
|
54
|
-
position: absolute;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.spinnerMarginLeft {
|
|
58
|
-
left: 4px;
|
|
59
|
-
margin-left: 4px;
|
|
60
|
-
position: absolute;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.buttonLabel {
|
|
64
|
-
animation: right-and-back 0.2s;
|
|
65
|
-
margin-left: 4px;
|
|
66
|
-
position: relative;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@keyframes right-and-back {
|
|
70
|
-
0% {
|
|
71
|
-
right: -6px;
|
|
72
|
-
}
|
|
73
|
-
50% {
|
|
74
|
-
right: -12px;
|
|
75
|
-
}
|
|
76
|
-
75% {
|
|
77
|
-
right: -6px;
|
|
78
|
-
}
|
|
79
|
-
100% {
|
|
80
|
-
right: 0px;
|
|
81
|
-
}
|
|
82
|
-
}
|
package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { h, } from "@stencil/core";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
export class SearchcraftClearInputButton {
|
|
4
|
-
constructor() {
|
|
5
|
-
// Added a click handler to emit the event
|
|
6
|
-
this.handleClearClick = (event) => {
|
|
7
|
-
event.preventDefault(); // Prevent default if necessary
|
|
8
|
-
this.clearInput.emit(); // Emit the event
|
|
9
|
-
};
|
|
10
|
-
this.isRequesting = false;
|
|
11
|
-
this.rightToLeftOrientation = false;
|
|
12
|
-
this.theme = 'light';
|
|
13
|
-
}
|
|
14
|
-
isLightTheme() {
|
|
15
|
-
return this.theme === 'light';
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return this.rightToLeftOrientation ? (h("button", { class: classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (h("searchcraft-spinner-light", null)) : (h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (h("button", { class: classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (h("searchcraft-spinner-light", null)) : (h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
|
|
19
|
-
}
|
|
20
|
-
static get is() { return "searchcraft-clear-input-button"; }
|
|
21
|
-
static get encapsulation() { return "shadow"; }
|
|
22
|
-
static get originalStyleUrls() {
|
|
23
|
-
return {
|
|
24
|
-
"$": ["searchcraft-clear-input-button.module.scss"]
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
static get styleUrls() {
|
|
28
|
-
return {
|
|
29
|
-
"$": ["searchcraft-clear-input-button.module.css"]
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
static get properties() {
|
|
33
|
-
return {
|
|
34
|
-
"isRequesting": {
|
|
35
|
-
"type": "boolean",
|
|
36
|
-
"mutable": false,
|
|
37
|
-
"complexType": {
|
|
38
|
-
"original": "boolean",
|
|
39
|
-
"resolved": "boolean",
|
|
40
|
-
"references": {}
|
|
41
|
-
},
|
|
42
|
-
"required": false,
|
|
43
|
-
"optional": true,
|
|
44
|
-
"docs": {
|
|
45
|
-
"tags": [],
|
|
46
|
-
"text": ""
|
|
47
|
-
},
|
|
48
|
-
"attribute": "is-requesting",
|
|
49
|
-
"reflect": false,
|
|
50
|
-
"defaultValue": "false"
|
|
51
|
-
},
|
|
52
|
-
"rightToLeftOrientation": {
|
|
53
|
-
"type": "boolean",
|
|
54
|
-
"mutable": false,
|
|
55
|
-
"complexType": {
|
|
56
|
-
"original": "boolean",
|
|
57
|
-
"resolved": "boolean",
|
|
58
|
-
"references": {}
|
|
59
|
-
},
|
|
60
|
-
"required": false,
|
|
61
|
-
"optional": false,
|
|
62
|
-
"docs": {
|
|
63
|
-
"tags": [],
|
|
64
|
-
"text": ""
|
|
65
|
-
},
|
|
66
|
-
"attribute": "right-to-left-orientation",
|
|
67
|
-
"reflect": false,
|
|
68
|
-
"defaultValue": "false"
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
static get states() {
|
|
73
|
-
return {
|
|
74
|
-
"theme": {}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
static get events() {
|
|
78
|
-
return [{
|
|
79
|
-
"method": "clearInput",
|
|
80
|
-
"name": "clearInput",
|
|
81
|
-
"bubbles": true,
|
|
82
|
-
"cancelable": true,
|
|
83
|
-
"composed": true,
|
|
84
|
-
"docs": {
|
|
85
|
-
"tags": [],
|
|
86
|
-
"text": ""
|
|
87
|
-
},
|
|
88
|
-
"complexType": {
|
|
89
|
-
"original": "void",
|
|
90
|
-
"resolved": "void",
|
|
91
|
-
"references": {}
|
|
92
|
-
}
|
|
93
|
-
}];
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=searchcraft-clear-input-button.js.map
|