@searchcraft/javascript-sdk 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/index-5b0b9d4c.js +84 -0
- package/dist/cjs/index-5b0b9d4c.js.map +1 -0
- package/dist/cjs/index-e7bd239c.js +1270 -0
- package/dist/cjs/index-e7bd239c.js.map +1 -0
- package/dist/cjs/index.cjs.js +17 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js +458 -0
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +64 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +18 -0
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-button.cjs.entry.js +37 -0
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +27 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +1 -0
- package/dist/cjs/store-ab3978ce.js +251 -0
- package/dist/cjs/store-ab3978ce.js.map +1 -0
- package/dist/cjs/utils-39791159.js +53 -0
- package/dist/cjs/utils-39791159.js.map +1 -0
- package/dist/collection/assets/searchcraft-button-icons.js +9 -0
- package/dist/collection/assets/searchcraft-button-icons.js.map +1 -0
- package/dist/collection/assets/searchcraft-clear-icon-set.js +45 -0
- package/dist/collection/assets/searchcraft-clear-icon-set.js.map +1 -0
- package/dist/collection/assets/searchcraft-search-icon-set.js +45 -0
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +1 -0
- package/dist/collection/collection-manifest.json +27 -0
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +294 -0
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -0
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +19 -0
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +168 -0
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -0
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +14 -0
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +309 -0
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -0
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +210 -0
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +111 -0
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -0
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +20 -0
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +137 -0
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -0
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +82 -0
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +96 -0
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +1 -0
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +33 -0
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +64 -0
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -0
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +21 -0
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +276 -0
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -0
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +241 -0
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +122 -0
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +1 -0
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +79 -0
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +71 -0
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +1 -0
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +21 -0
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +77 -0
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -0
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +21 -0
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +19 -0
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +1 -0
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +35 -0
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +19 -0
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +1 -0
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +26 -0
- package/dist/collection/index.js +14 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/provider/store.js +68 -0
- package/dist/collection/provider/store.js.map +1 -0
- package/dist/collection/utils/utils.js +45 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js → components/p-04e7305e.js} +25 -7
- package/dist/components/p-04e7305e.js.map +1 -0
- package/dist/components/p-0c25e95d.js +41 -0
- package/dist/components/p-0c25e95d.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js → components/p-155f7a59.js} +25 -7
- package/dist/components/p-155f7a59.js.map +1 -0
- package/dist/components/p-16a533e3.js +34 -0
- package/dist/components/p-16a533e3.js.map +1 -0
- package/dist/components/p-17c94ac1.js +48 -0
- package/dist/components/p-17c94ac1.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/searchcraft-input-caption.entry.js → components/p-199065b5.js} +32 -10
- package/dist/components/p-199065b5.js.map +1 -0
- package/dist/components/p-2cc8c074.js +69 -0
- package/dist/components/p-2cc8c074.js.map +1 -0
- package/dist/components/p-36c95064.js +247 -0
- package/dist/components/p-36c95064.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/searchcraft-input.entry.js → components/p-4244171c.js} +80 -11
- package/dist/components/p-4244171c.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js → components/p-4f201f41.js} +37 -8
- package/dist/components/p-4f201f41.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/index-d6567b9c.js → components/p-5cdc6210.js} +2 -10
- package/dist/components/p-5cdc6210.js.map +1 -0
- package/dist/components/p-9283a3c2.js +50 -0
- package/dist/components/p-9283a3c2.js.map +1 -0
- package/dist/components/p-a7ab9d65.js +50 -0
- package/dist/components/p-a7ab9d65.js.map +1 -0
- package/dist/components/p-c69651f6.js +1106 -0
- package/dist/components/p-c69651f6.js.map +1 -0
- package/dist/components/p-e8e40447.js +34 -0
- package/dist/components/p-e8e40447.js.map +1 -0
- package/dist/components/p-f83f2b59.js +62 -0
- package/dist/components/p-f83f2b59.js.map +1 -0
- package/dist/components/searchcraft-auto-search-form.js +185 -0
- package/dist/components/searchcraft-auto-search-form.js.map +1 -0
- package/dist/components/searchcraft-base-search-form.js +153 -0
- package/dist/components/searchcraft-base-search-form.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +8 -0
- package/dist/components/searchcraft-base-search-result.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js → components/searchcraft-base-search-results.js} +47 -11
- package/dist/components/searchcraft-base-search-results.js.map +1 -0
- package/dist/components/searchcraft-button-icon.js +33 -0
- package/dist/components/searchcraft-button-icon.js.map +1 -0
- package/dist/components/searchcraft-button.js +8 -0
- package/dist/components/searchcraft-button.js.map +1 -0
- package/dist/components/searchcraft-clear-icon-set.js +8 -0
- package/dist/components/searchcraft-clear-icon-set.js.map +1 -0
- package/dist/components/searchcraft-clear-input-button.js +8 -0
- package/dist/components/searchcraft-clear-input-button.js.map +1 -0
- package/dist/components/searchcraft-error-message.js +8 -0
- package/dist/components/searchcraft-error-message.js.map +1 -0
- package/dist/components/searchcraft-input-caption.js +8 -0
- package/dist/components/searchcraft-input-caption.js.map +1 -0
- package/dist/components/searchcraft-input-icon.js +8 -0
- package/dist/components/searchcraft-input-icon.js.map +1 -0
- package/dist/components/searchcraft-input-label.js +8 -0
- package/dist/components/searchcraft-input-label.js.map +1 -0
- package/dist/components/searchcraft-input.js +8 -0
- package/dist/components/searchcraft-input.js.map +1 -0
- package/dist/components/searchcraft-search-icon-set.js +8 -0
- package/dist/components/searchcraft-search-icon-set.js.map +1 -0
- package/dist/components/searchcraft-spinner-dark.js +8 -0
- package/dist/components/searchcraft-spinner-dark.js.map +1 -0
- package/dist/components/searchcraft-spinner-light.js +8 -0
- package/dist/components/searchcraft-spinner-light.js.map +1 -0
- package/dist/esm/index-0d9f850d.js +1242 -0
- package/dist/esm/index-0d9f850d.js.map +1 -0
- package/dist/esm/index-72ac5051.js +82 -0
- package/dist/esm/index-72ac5051.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/searchcraft-auto-search-form_13.entry.js +442 -0
- package/dist/esm/searchcraft-auto-search-form_13.entry.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk → esm}/searchcraft-base-search-form.entry.js +4 -4
- package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk → esm}/searchcraft-button-icon.entry.js +1 -1
- package/dist/esm/searchcraft-button-icon.entry.js.map +1 -0
- package/dist/{searchcraft-javascript-sdk → esm}/searchcraft-button.entry.js +4 -4
- package/dist/esm/searchcraft-button.entry.js.map +1 -0
- package/dist/esm/searchcraft-javascript-sdk.js +22 -0
- package/dist/esm/searchcraft-javascript-sdk.js.map +1 -0
- package/dist/esm/store-e55b12aa.js +247 -0
- package/dist/esm/store-e55b12aa.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/loader/package.json +11 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -14
- package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/p-04e2f067.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-04e2f067.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-09af71e8.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-09af71e8.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-17c94ac1.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-17c94ac1.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-329c3f66.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-329c3f66.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-36c95064.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-36c95064.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-40791ead.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-40791ead.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-4d18a44a.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-4d18a44a.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +7 -0
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-e1255160.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -48
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js +0 -34
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js +0 -3043
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/index-d6567b9c.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +0 -93
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +0 -31
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +0 -22
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +0 -23
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +0 -30
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +0 -17
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +0 -17
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js +0 -334
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js +0 -3008
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js.map +0 -1
- /package/dist/{searchcraft-javascript-sdk → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{searchcraft-javascript-sdk → esm}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{searchcraft-javascript-sdk → esm}/utils-7bff0c78.js +0 -0
- /package/dist/{searchcraft-javascript-sdk → esm}/utils-7bff0c78.js.map +0 -0
package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchcraft-base-search-form.js","sourceRoot":"","sources":["../../../src/components/searchcraft-base-search-form/searchcraft-base-search-form.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, h, Event, Prop, State } from '@stencil/core';\nimport {\n type CoreConfigSDK,\n CoreSDK as SearchcraftCore,\n} from '@searchcraft/core';\n\nimport { useSearchcraftStore, useThemeStore } from '@provider/store';\n\nimport type { ScInputCustomEvent } from '@components/searchcraft-input/searchcraft-input';\n\n@Component({\n tag: 'searchcraft-base-search-form',\n styleUrl: 'searchcraft-base-search-form.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchForm {\n @Prop() config: CoreConfigSDK = {\n apiKey: '',\n endpointURL: '',\n index: [],\n };\n @Prop() errorMessage = 'Search was unsuccessful';\n @Prop() labelForInput = 'Search';\n @Prop() rightToLeftOrientation = false;\n\n @Event() clearInput = () => {};\n\n @State() error = false;\n @State() query = '';\n @State() searchResults: string | null = null;\n\n private searchStore = useSearchcraftStore.getState();\n private themeStore = useThemeStore.getState();\n\n componentDidLoad = () => {\n const searchcraft = new SearchcraftCore(this.config);\n this.searchStore.initialize(searchcraft, true);\n };\n\n handleFormSubmit = async (event) => {\n event.preventDefault();\n if (this.query.trim() === '') {\n this.error = true;\n } else {\n this.error = false;\n this.searchStore.setQuery(this.query);\n await this.searchStore.search();\n this.searchResults = JSON.stringify(this.searchStore.searchResults);\n }\n };\n\n handleSearchInputChange = (event: ScInputCustomEvent<string>) => {\n this.query = event.detail;\n };\n\n handleClearInput = () => {\n this.query = '';\n this?.clearInput();\n };\n\n toggleTheme = () => {\n this.themeStore.toggleTheme();\n };\n\n render() {\n return (\n <form\n class={this.rightToLeftOrientation ? 'formRTL' : 'formLTR'}\n onSubmit={this.handleFormSubmit}\n >\n <searchcraft-input-label label={this.labelForInput} />\n <div class='searchContainer'>\n {this.rightToLeftOrientation && <searchcraft-button />}\n <searchcraft-input\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n onSearchInputChange={this.handleSearchInputChange}\n query={this.query}\n />\n {!this.rightToLeftOrientation && (\n <searchcraft-button onButtonClick={this.handleFormSubmit} />\n )}\n </div>\n {this.error && (\n <searchcraft-error-message errorMessage={this.errorMessage} />\n )}\n </form>\n );\n }\n}\n"]}
|
package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class SearchcraftBaseSearchResult {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.buttonCallback = () => { }; // Callback for button click
|
|
5
|
+
this.keyDownCallback = () => { }; // Callback for key down event
|
|
6
|
+
this.resultCallback = () => { }; // Callback for result container click
|
|
7
|
+
this.handleButtonClick = () => {
|
|
8
|
+
this.buttonCallback();
|
|
9
|
+
};
|
|
10
|
+
this.handleContainerClick = () => {
|
|
11
|
+
if (this.isInteractive) {
|
|
12
|
+
this.resultCallback();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
this.buttonText = '';
|
|
16
|
+
this.imageDescription = '';
|
|
17
|
+
this.imageSource = '';
|
|
18
|
+
this.isInteractive = false;
|
|
19
|
+
this.primaryContent = '';
|
|
20
|
+
this.secondaryContent = '';
|
|
21
|
+
this.tertiaryContent = '';
|
|
22
|
+
this.headingText = '';
|
|
23
|
+
this.subheadingText = '';
|
|
24
|
+
this.themeMode = 'light';
|
|
25
|
+
this.customStyles = '{}';
|
|
26
|
+
}
|
|
27
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
28
|
+
parseStyles() {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(this.customStyles);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Error parsing custom styles:', error);
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
const isLightTheme = this.themeMode === 'light';
|
|
39
|
+
const styles = this.parseStyles();
|
|
40
|
+
return (h("div", { key: '096a8c89cb39b5dca0949b11981747b55c6f374f', class: this.isInteractive
|
|
41
|
+
? isLightTheme
|
|
42
|
+
? 'interactiveResultContainerLight'
|
|
43
|
+
: 'interactiveResultContainerDark'
|
|
44
|
+
: 'resultContainer', style: styles.container || {}, tabindex: '0', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback }, h("div", { key: '91eb80e1c2e68c148e12bd6046bcfbe190c2560f', class: 'imageContainer' }, h("img", { key: 'e83722c85e2b32d359c702f968cdb9e84aab5f04', alt: this.imageDescription, src: this.imageSource, style: styles.image || {}, class: isLightTheme ? 'imageLight' : 'imageDark' })), h("div", { key: '7450df6c0f77ccccd74d23d05e0b8bc4b3211189', class: 'contentContainer' }, h("h2", { key: '480ae0e87ecdcb2bc93551a2bc8288ad38472128', style: styles.heading || {}, class: isLightTheme ? 'headingLight' : 'headingDark' }, this.headingText), h("h3", { key: '67a6e12968a53bcb3e6cb96a020cdbf69d5b66b4', style: styles.subheading || {}, class: isLightTheme ? 'subheadingLight' : 'subheadingDark' }, this.subheadingText), h("p", { key: '9ebc20428528e0abafa5c31f13e32aeb23f95648', style: styles.primaryContent || {}, class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark' }, this.primaryContent), h("p", { key: '6e2d3491d45056f1a9805477d003938c22d5119b', style: styles.secondaryContent || {}, class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark' }, this.secondaryContent), h("p", { key: 'f1eed685d08cfc64a01f350940bbdfc2722ab4a2', style: styles.tertiaryContent || {}, class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark' }, this.tertiaryContent), this.buttonText && (h("button", { key: 'c53407c532f7c70e898cf025e1279f2081a7fb74', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText)))));
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "searchcraft-base-search-result"; }
|
|
47
|
+
static get encapsulation() { return "shadow"; }
|
|
48
|
+
static get originalStyleUrls() {
|
|
49
|
+
return {
|
|
50
|
+
"$": ["searchcraft-base-search-result.module.scss"]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static get styleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["searchcraft-base-search-result.module.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get properties() {
|
|
59
|
+
return {
|
|
60
|
+
"buttonText": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "string",
|
|
65
|
+
"resolved": "string",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": false,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": ""
|
|
73
|
+
},
|
|
74
|
+
"attribute": "button-text",
|
|
75
|
+
"reflect": false,
|
|
76
|
+
"defaultValue": "''"
|
|
77
|
+
},
|
|
78
|
+
"imageDescription": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "string",
|
|
83
|
+
"resolved": "string",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": ""
|
|
91
|
+
},
|
|
92
|
+
"attribute": "image-description",
|
|
93
|
+
"reflect": false,
|
|
94
|
+
"defaultValue": "''"
|
|
95
|
+
},
|
|
96
|
+
"imageSource": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": ""
|
|
109
|
+
},
|
|
110
|
+
"attribute": "image-source",
|
|
111
|
+
"reflect": false,
|
|
112
|
+
"defaultValue": "''"
|
|
113
|
+
},
|
|
114
|
+
"isInteractive": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "boolean",
|
|
119
|
+
"resolved": "boolean",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": ""
|
|
127
|
+
},
|
|
128
|
+
"attribute": "is-interactive",
|
|
129
|
+
"reflect": false,
|
|
130
|
+
"defaultValue": "false"
|
|
131
|
+
},
|
|
132
|
+
"primaryContent": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "string",
|
|
137
|
+
"resolved": "string",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": ""
|
|
145
|
+
},
|
|
146
|
+
"attribute": "primary-content",
|
|
147
|
+
"reflect": false,
|
|
148
|
+
"defaultValue": "''"
|
|
149
|
+
},
|
|
150
|
+
"secondaryContent": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "string",
|
|
155
|
+
"resolved": "string",
|
|
156
|
+
"references": {}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": false,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": ""
|
|
163
|
+
},
|
|
164
|
+
"attribute": "secondary-content",
|
|
165
|
+
"reflect": false,
|
|
166
|
+
"defaultValue": "''"
|
|
167
|
+
},
|
|
168
|
+
"tertiaryContent": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"mutable": false,
|
|
171
|
+
"complexType": {
|
|
172
|
+
"original": "string",
|
|
173
|
+
"resolved": "string",
|
|
174
|
+
"references": {}
|
|
175
|
+
},
|
|
176
|
+
"required": false,
|
|
177
|
+
"optional": false,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": ""
|
|
181
|
+
},
|
|
182
|
+
"attribute": "tertiary-content",
|
|
183
|
+
"reflect": false,
|
|
184
|
+
"defaultValue": "''"
|
|
185
|
+
},
|
|
186
|
+
"headingText": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"mutable": false,
|
|
189
|
+
"complexType": {
|
|
190
|
+
"original": "string",
|
|
191
|
+
"resolved": "string",
|
|
192
|
+
"references": {}
|
|
193
|
+
},
|
|
194
|
+
"required": false,
|
|
195
|
+
"optional": false,
|
|
196
|
+
"docs": {
|
|
197
|
+
"tags": [],
|
|
198
|
+
"text": ""
|
|
199
|
+
},
|
|
200
|
+
"attribute": "heading-text",
|
|
201
|
+
"reflect": false,
|
|
202
|
+
"defaultValue": "''"
|
|
203
|
+
},
|
|
204
|
+
"subheadingText": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"mutable": false,
|
|
207
|
+
"complexType": {
|
|
208
|
+
"original": "string",
|
|
209
|
+
"resolved": "string",
|
|
210
|
+
"references": {}
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"optional": false,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": ""
|
|
217
|
+
},
|
|
218
|
+
"attribute": "subheading-text",
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"defaultValue": "''"
|
|
221
|
+
},
|
|
222
|
+
"themeMode": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "'light' | 'dark'",
|
|
227
|
+
"resolved": "\"dark\" | \"light\"",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": ""
|
|
235
|
+
},
|
|
236
|
+
"attribute": "theme-mode",
|
|
237
|
+
"reflect": false,
|
|
238
|
+
"defaultValue": "'light'"
|
|
239
|
+
},
|
|
240
|
+
"customStyles": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"mutable": false,
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "string",
|
|
245
|
+
"resolved": "string",
|
|
246
|
+
"references": {}
|
|
247
|
+
},
|
|
248
|
+
"required": false,
|
|
249
|
+
"optional": false,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": ""
|
|
253
|
+
},
|
|
254
|
+
"attribute": "custom-styles",
|
|
255
|
+
"reflect": false,
|
|
256
|
+
"defaultValue": "'{}'"
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
static get events() {
|
|
261
|
+
return [{
|
|
262
|
+
"method": "buttonCallback",
|
|
263
|
+
"name": "buttonCallback",
|
|
264
|
+
"bubbles": true,
|
|
265
|
+
"cancelable": true,
|
|
266
|
+
"composed": true,
|
|
267
|
+
"docs": {
|
|
268
|
+
"tags": [],
|
|
269
|
+
"text": ""
|
|
270
|
+
},
|
|
271
|
+
"complexType": {
|
|
272
|
+
"original": "any",
|
|
273
|
+
"resolved": "any",
|
|
274
|
+
"references": {}
|
|
275
|
+
}
|
|
276
|
+
}, {
|
|
277
|
+
"method": "keyDownCallback",
|
|
278
|
+
"name": "keyDownCallback",
|
|
279
|
+
"bubbles": true,
|
|
280
|
+
"cancelable": true,
|
|
281
|
+
"composed": true,
|
|
282
|
+
"docs": {
|
|
283
|
+
"tags": [],
|
|
284
|
+
"text": ""
|
|
285
|
+
},
|
|
286
|
+
"complexType": {
|
|
287
|
+
"original": "any",
|
|
288
|
+
"resolved": "any",
|
|
289
|
+
"references": {}
|
|
290
|
+
}
|
|
291
|
+
}, {
|
|
292
|
+
"method": "resultCallback",
|
|
293
|
+
"name": "resultCallback",
|
|
294
|
+
"bubbles": true,
|
|
295
|
+
"cancelable": true,
|
|
296
|
+
"composed": true,
|
|
297
|
+
"docs": {
|
|
298
|
+
"tags": [],
|
|
299
|
+
"text": ""
|
|
300
|
+
},
|
|
301
|
+
"complexType": {
|
|
302
|
+
"original": "any",
|
|
303
|
+
"resolved": "any",
|
|
304
|
+
"references": {}
|
|
305
|
+
}
|
|
306
|
+
}];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=searchcraft-base-search-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchcraft-base-search-result.js","sourceRoot":"","sources":["../../../src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, Event, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-base-search-result',\n styleUrl: 'searchcraft-base-search-result.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResult {\n @Prop() buttonText = ''; // Label for the button\n @Prop() imageDescription = ''; // Alternative text for the image\n @Prop() imageSource = ''; // Source URL for the image\n @Prop() isInteractive = false; // Determines if the result is interactive\n @Prop() primaryContent = ''; // Primary body content\n @Prop() secondaryContent = ''; // Secondary body content\n @Prop() tertiaryContent = ''; // Tertiary body content\n @Prop() headingText = ''; // Text for the heading\n @Prop() subheadingText = ''; // Text for the subheading\n @Prop() themeMode: 'light' | 'dark' = 'light'; // Light or dark theme context\n @Prop() customStyles = '{}'; // New string prop for serialized styles.\n\n @Event() buttonCallback: () => void = () => {}; // Callback for button click\n @Event() keyDownCallback: () => void = () => {}; // Callback for key down event\n @Event() resultCallback: () => void = () => {}; // Callback for result container click\n\n private handleButtonClick = () => {\n this.buttonCallback();\n };\n\n private handleContainerClick = () => {\n if (this.isInteractive) {\n this.resultCallback();\n }\n };\n\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n private parseStyles(): Record<string, any> {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n\n render() {\n const isLightTheme = this.themeMode === 'light';\n const styles = this.parseStyles();\n\n return (\n <div\n class={\n this.isInteractive\n ? isLightTheme\n ? 'interactiveResultContainerLight'\n : 'interactiveResultContainerDark'\n : 'resultContainer'\n }\n style={styles.container || {}}\n tabindex='0'\n onClick={this.handleContainerClick}\n onKeyDown={this.keyDownCallback}\n >\n <div class='imageContainer'>\n <img\n alt={this.imageDescription}\n src={this.imageSource}\n style={styles.image || {}}\n class={isLightTheme ? 'imageLight' : 'imageDark'}\n />\n </div>\n <div class='contentContainer'>\n <h2\n style={styles.heading || {}}\n class={isLightTheme ? 'headingLight' : 'headingDark'}\n >\n {this.headingText}\n </h2>\n <h3\n style={styles.subheading || {}}\n class={isLightTheme ? 'subheadingLight' : 'subheadingDark'}\n >\n {this.subheadingText}\n </h3>\n <p\n style={styles.primaryContent || {}}\n class={isLightTheme ? 'primaryContentLight' : 'primaryContentDark'}\n >\n {this.primaryContent}\n </p>\n <p\n style={styles.secondaryContent || {}}\n class={\n isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark'\n }\n >\n {this.secondaryContent}\n </p>\n <p\n style={styles.tertiaryContent || {}}\n class={\n isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'\n }\n >\n {this.tertiaryContent}\n </p>\n {this.buttonText && (\n <button\n onClick={this.handleButtonClick}\n style={styles.button || {}}\n type='button'\n >\n {this.buttonText}\n </button>\n )}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--font-stack: Helvetica, Arial, sans-serif;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.interactiveResultContainerLight {
|
|
6
|
+
background-color: #FAFAFA;
|
|
7
|
+
align-items: flex-start;
|
|
8
|
+
border-radius: 16px;
|
|
9
|
+
display: flex;
|
|
10
|
+
position: relative;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
padding: 8px;
|
|
14
|
+
}
|
|
15
|
+
@media (min-width: 600px) {
|
|
16
|
+
.interactiveResultContainerLight {
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.interactiveResultContainerDark {
|
|
22
|
+
background-color: #2E2E2E;
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
border-radius: 16px;
|
|
25
|
+
display: flex;
|
|
26
|
+
position: relative;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: 16px;
|
|
29
|
+
padding: 8px;
|
|
30
|
+
}
|
|
31
|
+
@media (min-width: 600px) {
|
|
32
|
+
.interactiveResultContainerDark {
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.resultContainer {
|
|
38
|
+
align-items: flex-start;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 16px;
|
|
42
|
+
}
|
|
43
|
+
@media (min-width: 600px) {
|
|
44
|
+
.resultContainer {
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.interactiveIconLarge {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
position: absolute;
|
|
52
|
+
right: 5px;
|
|
53
|
+
top: 8px;
|
|
54
|
+
}
|
|
55
|
+
@media (max-width: 600px) {
|
|
56
|
+
.interactiveIconLarge {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.interactiveIconSmall {
|
|
62
|
+
position: absolute;
|
|
63
|
+
right: 5px;
|
|
64
|
+
top: -2px;
|
|
65
|
+
display: inline-block;
|
|
66
|
+
}
|
|
67
|
+
@media (min-width: 600px) {
|
|
68
|
+
.interactiveIconSmall {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.imageContainer {
|
|
74
|
+
max-height: 540px;
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
}
|
|
77
|
+
@media (min-width: 600px) {
|
|
78
|
+
.imageContainer {
|
|
79
|
+
max-height: 100%;
|
|
80
|
+
max-width: 50%;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.contentContainer {
|
|
85
|
+
max-height: 100%;
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
}
|
|
88
|
+
@media (min-width: 600px) {
|
|
89
|
+
.contentContainer {
|
|
90
|
+
max-width: 50%;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.imageLight {
|
|
95
|
+
aspect-ratio: 2/1;
|
|
96
|
+
border-radius: 8px;
|
|
97
|
+
max-height: 100%;
|
|
98
|
+
max-width: 100%;
|
|
99
|
+
border: 1px solid #D9D9D9;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.imageDark {
|
|
103
|
+
aspect-ratio: 2/1;
|
|
104
|
+
border-radius: 8px;
|
|
105
|
+
max-height: 100%;
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
border: 1px solid #333;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.headingLight {
|
|
111
|
+
font-family: var(--font-stack);
|
|
112
|
+
font-size: 16px;
|
|
113
|
+
font-weight: 700;
|
|
114
|
+
line-height: 20px;
|
|
115
|
+
margin-bottom: 4px;
|
|
116
|
+
margin-top: 0px;
|
|
117
|
+
position: relative;
|
|
118
|
+
color: #292929;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.headingDark {
|
|
122
|
+
font-family: var(--font-stack);
|
|
123
|
+
font-size: 16px;
|
|
124
|
+
font-weight: 700;
|
|
125
|
+
line-height: 20px;
|
|
126
|
+
margin-bottom: 4px;
|
|
127
|
+
margin-top: 0px;
|
|
128
|
+
position: relative;
|
|
129
|
+
color: #FFF;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.subheadingLight {
|
|
133
|
+
font-family: var(--font-stack);
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
font-weight: 400;
|
|
136
|
+
line-height: 16px;
|
|
137
|
+
margin-bottom: 4px;
|
|
138
|
+
margin-top: 0px;
|
|
139
|
+
color: #737373;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.subheadingDark {
|
|
143
|
+
font-family: var(--font-stack);
|
|
144
|
+
font-size: 12px;
|
|
145
|
+
font-weight: 400;
|
|
146
|
+
line-height: 16px;
|
|
147
|
+
margin-bottom: 4px;
|
|
148
|
+
margin-top: 0px;
|
|
149
|
+
color: #BFBFBF;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.primaryContentLight {
|
|
153
|
+
font-family: var(--font-stack);
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
font-weight: 400;
|
|
156
|
+
line-height: 20px;
|
|
157
|
+
margin-bottom: 4px;
|
|
158
|
+
margin-top: 0px;
|
|
159
|
+
color: #404040;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.primaryContentDark {
|
|
163
|
+
font-family: var(--font-stack);
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
font-weight: 400;
|
|
166
|
+
line-height: 20px;
|
|
167
|
+
margin-bottom: 4px;
|
|
168
|
+
margin-top: 0px;
|
|
169
|
+
color: #E6E6E6;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.secondaryContentLight {
|
|
173
|
+
font-family: var(--font-stack);
|
|
174
|
+
font-size: 16px;
|
|
175
|
+
font-weight: 400;
|
|
176
|
+
line-height: 20px;
|
|
177
|
+
margin-bottom: 4px;
|
|
178
|
+
margin-top: 0px;
|
|
179
|
+
color: #404040;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.secondaryContentDark {
|
|
183
|
+
font-family: var(--font-stack);
|
|
184
|
+
font-size: 16px;
|
|
185
|
+
font-weight: 400;
|
|
186
|
+
line-height: 20px;
|
|
187
|
+
margin-bottom: 4px;
|
|
188
|
+
margin-top: 0px;
|
|
189
|
+
color: #E6E6E6;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.tertiaryContentLight {
|
|
193
|
+
font-family: var(--font-stack);
|
|
194
|
+
font-size: 16px;
|
|
195
|
+
font-weight: 400;
|
|
196
|
+
line-height: 20px;
|
|
197
|
+
margin-bottom: 4px;
|
|
198
|
+
margin-top: 0px;
|
|
199
|
+
color: #404040;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.tertiaryContentDark {
|
|
203
|
+
font-family: var(--font-stack);
|
|
204
|
+
font-size: 16px;
|
|
205
|
+
font-weight: 400;
|
|
206
|
+
line-height: 20px;
|
|
207
|
+
margin-bottom: 4px;
|
|
208
|
+
margin-top: 0px;
|
|
209
|
+
color: #E6E6E6;
|
|
210
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
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.searchKeys = '';
|
|
9
|
+
this.customStylesForResults = {};
|
|
10
|
+
}
|
|
11
|
+
componentDidLoad() {
|
|
12
|
+
if (!this.searchKeys || this.searchKeys.length === 0) {
|
|
13
|
+
console.warn('No searchKeys provided; using empty keys array.');
|
|
14
|
+
this.searchKeys = '';
|
|
15
|
+
}
|
|
16
|
+
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
17
|
+
this.searchResults = Object.assign({}, state.searchResults);
|
|
18
|
+
this.query = state.query;
|
|
19
|
+
});
|
|
20
|
+
const { searchResults, query } = useSearchcraftStore.getState();
|
|
21
|
+
this.searchResults = searchResults;
|
|
22
|
+
this.query = query;
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
if (this.unsubscribe) {
|
|
26
|
+
this.unsubscribe();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
31
|
+
if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
32
|
+
console.warn('No search results data available');
|
|
33
|
+
return h("div", null, "No results to display.");
|
|
34
|
+
}
|
|
35
|
+
const parsedSearchKeys = parseSearchKeys(this.searchKeys);
|
|
36
|
+
const serializedStyles = typeof this.customStylesForResults === 'string'
|
|
37
|
+
? this.customStylesForResults
|
|
38
|
+
: serializeStyles(this.customStylesForResults);
|
|
39
|
+
return (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 :
|
|
40
|
+
_d.map((document, index) => {
|
|
41
|
+
const { doc: result } = document;
|
|
42
|
+
const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
|
|
43
|
+
return (h("searchcraft-base-search-result", { key: `${dynamicProperties.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 }));
|
|
44
|
+
}), this.query.length > 0 &&
|
|
45
|
+
((_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("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` }))));
|
|
46
|
+
}
|
|
47
|
+
static get is() { return "searchcraft-base-search-results"; }
|
|
48
|
+
static get encapsulation() { return "shadow"; }
|
|
49
|
+
static get originalStyleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["searchcraft-base-search-results.module.scss"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get styleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["searchcraft-base-search-results.module.css"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get properties() {
|
|
60
|
+
return {
|
|
61
|
+
"searchKeys": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "string",
|
|
66
|
+
"resolved": "string",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "Array of keys to dynamically extract properties from each document.\nMust be explicitly set by the parent component."
|
|
74
|
+
},
|
|
75
|
+
"attribute": "search-keys",
|
|
76
|
+
"reflect": false,
|
|
77
|
+
"defaultValue": "''"
|
|
78
|
+
},
|
|
79
|
+
"customStylesForResults": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"mutable": false,
|
|
82
|
+
"complexType": {
|
|
83
|
+
"original": "| string\n | Record<string, Record<string, string>>",
|
|
84
|
+
"resolved": "string | { [x: string]: Record<string, string>; }",
|
|
85
|
+
"references": {
|
|
86
|
+
"Record": {
|
|
87
|
+
"location": "global",
|
|
88
|
+
"id": "global::Record"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": false,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "Custom styles to apply to search results.\nExpected format: JSON string, e.g., '{\"borderRadius\": \"10px\", \"padding\": \"16px\"}'"
|
|
97
|
+
},
|
|
98
|
+
"attribute": "custom-styles-for-results",
|
|
99
|
+
"reflect": false,
|
|
100
|
+
"defaultValue": "{}"
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get states() {
|
|
105
|
+
return {
|
|
106
|
+
"query": {},
|
|
107
|
+
"searchResults": {}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=searchcraft-base-search-results.js.map
|