@searchcraft/javascript-sdk 0.1.3 → 0.1.5
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/{index-be6bffea.js → index-2e19f875.js} +2 -2
- package/dist/searchcraft-javascript-sdk/{index-be6bffea.js.map → index-2e19f875.js.map} +1 -1
- package/dist/searchcraft-javascript-sdk/index.esm.js +2 -2
- package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +14 -6
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js +2 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js +4 -5
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js +28 -9
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js +2 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +2 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +4 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js +7 -4
- package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +3 -3
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js +8 -5
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +2 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +2 -2
- package/dist/searchcraft-javascript-sdk/{store-b50263a1.js → store-7a83a5d7.js} +2 -2
- package/dist/searchcraft-javascript-sdk/{store-b50263a1.js.map → store-7a83a5d7.js.map} +1 -1
- package/dist/types/assets/searchcraft-search-icon-set.d.ts +3 -1
- package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +5 -0
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +9 -0
- package/dist/types/components/searchcraft-input/searchcraft-input.d.ts +3 -0
- package/dist/types/components/searchcraft-input-icon/searchcraft-input-icon.d.ts +8 -0
- package/dist/types/components.d.ts +48 -2
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { e as extractDynamicProperties, p as parseCustomStyles, a as parseSearchKeys } from './utils-7bff0c78.js';
|
|
2
|
-
export { u as useSearchcraftStore, a as useThemeStore } from './store-
|
|
1
|
+
export { e as extractDynamicProperties, p as parseCustomStyles, a as parseSearchKeys, s as serializeStyles } from './utils-7bff0c78.js';
|
|
2
|
+
export { u as useSearchcraftStore, a as useThemeStore } from './store-7a83a5d7.js';
|
|
3
3
|
import './_commonjsHelpers-63cbe26c.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.esm.js","mappings":";;;;AAAA;;;;;;;;","names":[],"sources":["src/index.ts"],"sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\n\nexport type * from './components';\n\n// Export utility functions\nexport {\n extractDynamicProperties,\n parseCustomStyles,\n parseSearchKeys,\n} from './utils/utils';\n\n// Export Zustand store and useTheme hook\nexport { useSearchcraftStore, useThemeStore } from './provider/store';\n"],"version":3}
|
|
1
|
+
{"file":"index.esm.js","mappings":";;;;AAAA;;;;;;;;","names":[],"sources":["src/index.ts"],"sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\n\nexport type * from './components';\n\n// Export utility functions\nexport {\n extractDynamicProperties,\n parseCustomStyles,\n parseSearchKeys,\n serializeStyles,\n} from './utils/utils';\n\n// Export Zustand store and useTheme hook\nexport { useSearchcraftStore, useThemeStore } from './provider/store';\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h } from './index-
|
|
2
|
-
import { u as useSearchcraftStore, g } from './store-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-2e19f875.js';
|
|
2
|
+
import { u as useSearchcraftStore, g } from './store-7a83a5d7.js';
|
|
3
3
|
import { p as parseCustomStyles } from './utils-7bff0c78.js';
|
|
4
4
|
import './_commonjsHelpers-63cbe26c.js';
|
|
5
5
|
|
|
@@ -21,13 +21,11 @@ const SearchcraftAutoSearchForm = class {
|
|
|
21
21
|
}
|
|
22
22
|
// Set a new debounce timeout
|
|
23
23
|
this.debounceTimeout = setTimeout(() => {
|
|
24
|
-
console.log('Debounced search triggered');
|
|
25
24
|
this.runSearch();
|
|
26
25
|
}, this.debounceDelay);
|
|
27
26
|
};
|
|
28
27
|
this.handleClearInput = () => {
|
|
29
28
|
this.query = '';
|
|
30
|
-
console.log('Input cleared');
|
|
31
29
|
if (typeof this.clearInput === 'function') {
|
|
32
30
|
this.clearInput();
|
|
33
31
|
}
|
|
@@ -67,23 +65,33 @@ const SearchcraftAutoSearchForm = class {
|
|
|
67
65
|
};
|
|
68
66
|
this.customStylesForInput = {};
|
|
69
67
|
this.inputCaptionValue = '';
|
|
68
|
+
this.inputIconHeight = 20;
|
|
69
|
+
this.inputIconWidth = 20;
|
|
70
70
|
this.labelForInput = '';
|
|
71
71
|
this.placeholderValue = 'Search here';
|
|
72
72
|
this.rightToLeftOrientation = false;
|
|
73
73
|
this.searchContainerClass = '';
|
|
74
74
|
this.error = false;
|
|
75
|
+
this.isRequesting = false;
|
|
75
76
|
this.query = '';
|
|
76
77
|
this.searchResults = '';
|
|
77
78
|
}
|
|
78
79
|
componentDidLoad() {
|
|
79
80
|
const searchcraft = new g(this.config);
|
|
80
81
|
this.searchStore.initialize(searchcraft, true);
|
|
81
|
-
|
|
82
|
+
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
83
|
+
this.isRequesting = state.isRequesting;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
if (this.unsubscribe) {
|
|
88
|
+
this.unsubscribe();
|
|
89
|
+
}
|
|
82
90
|
}
|
|
83
91
|
render() {
|
|
84
92
|
const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
|
|
85
93
|
const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);
|
|
86
|
-
return (h("form", { key: '
|
|
94
|
+
return (h("form", { key: '6b735bbdba6e7ff105d176fffa32b9431d5c4e49', class: `${formClass}`, onSubmit: this.handleFormSubmit }, h("searchcraft-input-label", { key: 'c7284dead137677ee7cd6aedac4dbfb38fac8c4c', label: this.labelForInput }), h("div", { key: 'a59294d9b406a1df9beb6264808f6e6a43cedbdd', class: 'searchContainer' }, h("searchcraft-input", { key: 'c1faa2d11c94ec3d4d39456612209e72fd208629', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "is-requesting": this.isRequesting, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, onClearInput: this.handleClearInput, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation })), this.error && (h("searchcraft-error-message", { key: 'b8b1e5b4b212a30f07f3756c8ce33c142e520420', errorMessage: 'Please enter a search query.' }))));
|
|
87
95
|
}
|
|
88
96
|
};
|
|
89
97
|
SearchcraftAutoSearchForm.style = searchcraftAutoSearchFormModuleCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-auto-search-form.entry.esm.js","mappings":";;;;;AAAA,MAAM,kCAAkC,GAAG,uLAAuL;;MCsBrN,yBAAyB;;;;
|
|
1
|
+
{"file":"searchcraft-auto-search-form.entry.esm.js","mappings":";;;;;AAAA,MAAM,kCAAkC,GAAG,uLAAuL;;MCsBrN,yBAAyB;;;;QAwB5B,oBAAe,GAAyC,IAAI,CAAC;QAC7D,kBAAa,GAAG,GAAG,CAAC;QACpB,gBAAW,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QAkBrD,sBAAiB,GAAG,CAAC,KAAiC;YACpD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;YAGlC,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACpC;;YAGD,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC;gBAChC,IAAI,CAAC,SAAS,EAAE,CAAC;aAClB,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;SACxB,CAAC;QAEF,qBAAgB,GAAG;YACjB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAEhB,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE;gBACzC,IAAI,CAAC,UAAU,EAAE,CAAC;aACnB;YAED,IAAI,IAAI,CAAC,eA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AAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAE/C,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK;YACrD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;SACxC,CAAC,CAAC;KACJ;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;KACF;IAsDD,MAAM;QACJ,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,GAAG,SAAS,GAAG,SAAS,CAAC;QACtE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACxE,QACE,6DAAM,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,gBAAgB,IAC1D,gFAAyB,KAAK,EAAE,IAAI,CAAC,aAAa,GAAI,EACtD,4DAAK,KAAK,EAAC,iBAAiB,IAC1B,0EACE,YAAY,EAAE,kBAAkB,yBACX,IAAI,CAAC,iBAAiB,mBAC5B,IAAI,CAAC,YAAY,uBACb,IAAI,CAAC,eAAe,sBACrB,IAAI,CAAC,cAAc,EACrC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,mBAAmB,EAAE,IAAI,CAAC,iBAAiB,uBACxB,IAAI,CAAC,gBAAgB,EACxC,KAAK,EAAE,IAAI,CAAC,KAAK,+BACU,IAAI,CAAC,sBAAsB,GACtD,CACE,EACL,IAAI,CAAC,KAAK,KACT,kFAA2B,YAAY,EAAC,8BAA8B,GAAG,CAC1E,CACI,EACP;KACH;;;;;;","names":["SearchcraftCore"],"sources":["src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.scss?tag=searchcraft-auto-search-form&encapsulation=shadow","src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.tsx"],"sourcesContent":[":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.formLTR {\n text-align: left;\n width: 100%;\n}\n\n.formRTL {\n text-align: right;\n width: 100%;\n}\n\n.searchContainer {\n align-items: center;\n display: flex;\n width: 100%;\n}","import {\n Component,\n Prop,\n State,\n Event,\n type EventEmitter,\n h,\n} from '@stencil/core';\nimport {\n type CoreConfigSDK,\n CoreSDK as SearchcraftCore,\n} from '@searchcraft/core';\n\nimport type { ScInputCustomEvent } from '@components/searchcraft-input/searchcraft-input';\nimport { parseCustomStyles } from '@utils/utils';\nimport { useSearchcraftStore } from '@provider/store';\n\n@Component({\n tag: 'searchcraft-auto-search-form',\n styleUrl: 'searchcraft-auto-search-form.module.scss',\n shadow: true,\n})\nexport class SearchcraftAutoSearchForm {\n @Prop() autoSearchFormClass = '';\n @Prop() clearInput: () => void = () => {};\n @Prop() config: CoreConfigSDK = {\n apiKey: '',\n endpointURL: '',\n index: [],\n };\n @Prop() customStylesForInput: string | Record<string, string> = {};\n @Prop() inputCaptionValue = '';\n @Prop() inputIconHeight = 20;\n @Prop() inputIconWidth = 20;\n @Prop() labelForInput = '';\n @Prop() placeholderValue = 'Search here';\n @Prop() rightToLeftOrientation = false;\n @Prop() searchContainerClass = '';\n\n @Event() querySubmit: EventEmitter<string>;\n\n @State() error = false;\n @State() isRequesting = false;\n @State() query = '';\n @State() searchResults = '';\n\n private debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n private debounceDelay = 300; // 300ms debounce delay\n private searchStore = useSearchcraftStore.getState();\n unsubscribe: () => void;\n\n componentDidLoad() {\n const searchcraft = new SearchcraftCore(this.config);\n this.searchStore.initialize(searchcraft, true);\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n handleInputChange = (event: ScInputCustomEvent<string>) => {\n this.query = event.detail;\n this.querySubmit.emit(this.query);\n\n // Clear the previous debounce timeout\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n // Set a new debounce timeout\n this.debounceTimeout = setTimeout(() => {\n this.runSearch();\n }, this.debounceDelay);\n };\n\n handleClearInput = () => {\n this.query = '';\n\n if (typeof this.clearInput === 'function') {\n this.clearInput();\n }\n\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n this.error = false;\n this.searchResults = '';\n };\n\n private runSearch = async () => {\n if (this.query.trim() === '') {\n this.error = true;\n this.searchResults = '';\n } else {\n this.error = false;\n this.searchStore.setQuery(this.query);\n\n try {\n await this.searchStore.search();\n this.searchResults = JSON.stringify(this.searchStore.searchResults);\n } catch (error) {\n this.error = true;\n }\n }\n };\n\n handleFormSubmit = async (event: Event) => {\n event.preventDefault();\n await this.runSearch();\n };\n\n render() {\n const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';\n const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);\n return (\n <form class={`${formClass}`} onSubmit={this.handleFormSubmit}>\n <searchcraft-input-label label={this.labelForInput} />\n <div class='searchContainer'>\n <searchcraft-input\n customStyles={parsedCustomStyles}\n input-caption-value={this.inputCaptionValue}\n is-requesting={this.isRequesting}\n input-icon-height={this.inputIconHeight}\n input-icon-width={this.inputIconWidth}\n onClearInput={this.handleClearInput}\n onSearchInputChange={this.handleInputChange}\n placeholder-value={this.placeholderValue}\n query={this.query}\n right-to-left-orientation={this.rightToLeftOrientation}\n />\n </div>\n {this.error && (\n <searchcraft-error-message errorMessage='Please enter a search query.' />\n )}\n </form>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h } from './index-
|
|
2
|
-
import { u as useSearchcraftStore, a as useThemeStore, g } from './store-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-2e19f875.js';
|
|
2
|
+
import { u as useSearchcraftStore, a as useThemeStore, g } from './store-7a83a5d7.js';
|
|
3
3
|
import './_commonjsHelpers-63cbe26c.js';
|
|
4
4
|
|
|
5
5
|
const searchcraftBaseSearchFormModuleCss = ".formLTR{font-family:Helvetica, Arial, sans-serif;text-align:left}.formRTL{font-family:Helvetica, Arial, sans-serif;text-align:right}.searchContainer{align-items:center;display:flex}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-2e19f875.js';
|
|
2
2
|
|
|
3
|
-
const searchcraftBaseSearchResultModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{background-color:#FAFAFA;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{background-color:#2E2E2E;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{position:absolute;right:5px;top:-2px;display:inline-block}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-height:540px;max-width:100%}@media (min-width: 600px){.imageContainer{max-height:
|
|
3
|
+
const searchcraftBaseSearchResultModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{background-color:#FAFAFA;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{background-color:#2E2E2E;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{position:absolute;right:5px;top:-2px;display:inline-block}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-height:540px;max-width:100%}@media (min-width: 600px){.imageContainer{max-height:175px;max-width:100%}}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.imageLight{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}";
|
|
4
4
|
|
|
5
5
|
const SearchcraftBaseSearchResult = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -31,7 +31,6 @@ const SearchcraftBaseSearchResult = class {
|
|
|
31
31
|
this.themeMode = 'light';
|
|
32
32
|
this.customStyles = '{}';
|
|
33
33
|
}
|
|
34
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
35
34
|
parseStyles() {
|
|
36
35
|
try {
|
|
37
36
|
return JSON.parse(this.customStyles);
|
|
@@ -44,11 +43,11 @@ const SearchcraftBaseSearchResult = class {
|
|
|
44
43
|
render() {
|
|
45
44
|
const isLightTheme = this.themeMode === 'light';
|
|
46
45
|
const styles = this.parseStyles();
|
|
47
|
-
return (h("div", { key: '
|
|
46
|
+
return (h("div", { key: 'e16bae2d337d064e057645cfb0ebf52346229b83', class: this.isInteractive
|
|
48
47
|
? isLightTheme
|
|
49
48
|
? 'interactiveResultContainerLight'
|
|
50
49
|
: 'interactiveResultContainerDark'
|
|
51
|
-
: 'resultContainer', style: styles.container || {}, tabindex: '0', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback }, h("div", { key: '
|
|
50
|
+
: 'resultContainer', style: styles.container || {}, tabindex: '0', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback }, h("div", { key: 'f2154ce85febbe54956a7f28292b13113e3048dd', class: 'imageContainer' }, h("img", { key: '8063fa3b88ba56b9cba63ded99967c8097b8b185', alt: this.imageDescription, src: this.imageSource, style: styles.image || {}, class: isLightTheme ? 'imageLight' : 'imageDark' })), h("div", { key: 'e04a38165dc98b0d72f215e4252f7065db3664d6', class: 'contentContainer' }, h("h2", { key: '33d2d3483d7c0f4e1ae7e15ba5895a8b15b45a34', style: styles.heading || {}, class: isLightTheme ? 'headingLight' : 'headingDark' }, this.headingText), h("h3", { key: '9587d0acea25ede251eba3e79dba932a5565f51a', style: styles.subheading || {}, class: isLightTheme ? 'subheadingLight' : 'subheadingDark' }, this.subheadingText), h("p", { key: '74f55a23963d5ddc8753d68b164587865da2dd13', style: styles.primaryContent || {}, class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark' }, this.primaryContent), h("div", { key: 'db4e498b08c7075b276e90d8ed233dd48992ecdd' }, h("p", { key: 'c09d3164a15452c5fbfa23a54028f2080dd56550', style: styles.secondaryContent || {}, class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark' }, this.secondaryContent), h("p", { key: 'ae78c4f53d9b12d62cad6b408aad5caf103303db', style: styles.tertiaryContent || {}, class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark' }, this.tertiaryContent)), this.buttonText && (h("button", { key: '3ea036c680f3970e9d6f1b00b3505f11e338922c', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText)))));
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
53
|
SearchcraftBaseSearchResult.style = searchcraftBaseSearchResultModuleCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-base-search-result.entry.esm.js","mappings":";;AAAA,MAAM,oCAAoC,GAAG,
|
|
1
|
+
{"file":"searchcraft-base-search-result.entry.esm.js","mappings":";;AAAA,MAAM,oCAAoC,GAAG,y0FAAy0F;;MCOz2F,2BAA2B;;;;;;QAa7B,mBAAc,GAAe,SAAQ,CAAC;QACtC,oBAAe,GAAe,SAAQ,CAAC;QACvC,mBAAc,GAAe,SAAQ,CAAC;QAEvC,sBAAiB,GAAG;YAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB,CAAC;QAEM,yBAAoB,GAAG;YAC7B,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,IAAI,CAAC,cAAc,EAAE,CAAC;aACvB;SACF,CAAC;0BAxBmB,EAAE;gCACI,EAAE;2BACP,EAAE;6BACA,KAAK;8BACJ,EAAE;gCACA,EAAE;+BACH,EAAE;2BACN,EAAE;8BACC,EAAE;yBACW,OAAO;4BACtB,IAAI;;IAgBnB,WAAW;QACjB,IAAI;YACF,OAAO,IAAI,CAAC,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AAK,EAAE,MAAM,CAAC,gBAAgB,IAAI,EAAE,EACpC,KAAK,EACH,YAAY,GAAG,uBAAuB,GAAG,sBAAsB,IAGhE,IAAI,CAAC,gBAAgB,CACpB,EACJ,0DACE,KAAK,EAAE,MAAM,CAAC,eAAe,IAAI,EAAE,EACnC,KAAK,EACH,YAAY,GAAG,sBAAsB,GAAG,qBAAqB,IAG9D,IAAI,CAAC,eAAe,CACnB,CACA,EACL,IAAI,CAAC,UAAU,KACd,+DACE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAC1B,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,UAAU,CACT,CACV,CACG,CACF,EACN;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-base-search-result/searchcraft-base-search-result.module.scss?tag=searchcraft-base-search-result&encapsulation=shadow","src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin interactive-result-container-base {\n align-items: flex-start;\n border-radius: 16px;\n display: flex;\n position: relative;\n flex-direction: column;\n gap: 16px;\n padding: 8px;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveResultContainerLight {\n background-color: $light-search-result-container-background;\n @include interactive-result-container-base;\n}\n\n.interactiveResultContainerDark {\n background-color: $dark-search-result-container-background;\n @include interactive-result-container-base;\n}\n\n.resultContainer {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveIconLarge {\n display: inline-block;\n position: absolute;\n right: 5px;\n top: 8px;\n\n\n @media (max-width: 600px) {\n display: none;\n }\n}\n\n.interactiveIconSmall {\n position: absolute;\n right: 5px;\n top: -2px;\n display: inline-block;\n\n\n @media (min-width: 600px) {\n display: none;\n }\n}\n\n.imageContainer {\n max-height: 540px;\n max-width: 100%;\n\n @media (min-width: 600px) {\n max-height: 175px;\n max-width: 100%;\n }\n}\n\n.contentContainer {\n max-height: 100%;\n max-width: 100%;\n\n @media (min-width: 600px) {\n max-width: 50%;\n }\n}\n\n@mixin image-base {\n aspect-ratio: 2 / 1;\n border-radius: 8px;\n max-height: 100%;\n max-width: 100%;\n}\n\n.imageLight {\n @include image-base;\n border: 1px solid $light-search-result-image-border;\n}\n\n.imageDark {\n @include image-base;\n border: 1px solid $dark-search-result-image-border;\n}\n\n@mixin heading-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0px;\n position: relative;\n}\n\n.headingLight {\n @include heading-base;\n color: $light-search-result-heading-color;\n}\n\n.headingDark {\n @include heading-base;\n color: $dark-search-result-heading-color;\n}\n\n@mixin subheading-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.subheadingLight {\n @include subheading-base;\n color: $light-search-result-subheading-color;\n}\n\n.subheadingDark {\n @include subheading-base;\n color: $dark-search-result-subheading-color\n}\n\n@mixin body-content-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 400;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.primaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.primaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.secondaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.secondaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.tertiaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.tertiaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}","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 private parseStyles(): Record<string, { [key: string]: string }> {\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 <div>\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 </div>\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"],"version":3}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { u as useSearchcraftStore } from './store-
|
|
1
|
+
import { r as registerInstance, h } from './index-2e19f875.js';
|
|
2
|
+
import { u as useSearchcraftStore } from './store-7a83a5d7.js';
|
|
3
3
|
import { a as parseSearchKeys, s as serializeStyles, e as extractDynamicProperties } from './utils-7bff0c78.js';
|
|
4
4
|
import './_commonjsHelpers-63cbe26c.js';
|
|
5
5
|
|
|
6
|
-
const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:100px 20px}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}";
|
|
6
|
+
const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:100px 20px}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;border:1px solid #DCDDDE;display:flex;flex-direction:column;font-size:16px;justify-content:center;margin:auto;min-height:150px;text-align:center;width:100%}.adSection p{margin-top:5px}";
|
|
7
7
|
|
|
8
8
|
const SearchcraftBaseSearchResults = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -12,6 +12,8 @@ const SearchcraftBaseSearchResults = class {
|
|
|
12
12
|
this.searchResults = null;
|
|
13
13
|
this.searchKeys = '';
|
|
14
14
|
this.customStylesForResults = {};
|
|
15
|
+
this.placeAdAtEnd = false;
|
|
16
|
+
this.adInterval = 4;
|
|
15
17
|
}
|
|
16
18
|
componentDidLoad() {
|
|
17
19
|
if (!this.searchKeys || this.searchKeys.length === 0) {
|
|
@@ -41,12 +43,29 @@ const SearchcraftBaseSearchResults = class {
|
|
|
41
43
|
const serializedStyles = typeof this.customStylesForResults === 'string'
|
|
42
44
|
? this.customStylesForResults
|
|
43
45
|
: serializeStyles(this.customStylesForResults);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
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) => {
|
|
47
|
+
const { doc: result } = document;
|
|
48
|
+
const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
|
|
49
|
+
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 }));
|
|
50
|
+
});
|
|
51
|
+
const finalComponents = [];
|
|
52
|
+
// Add ads at specified intervals
|
|
53
|
+
if (this.adInterval > 0) {
|
|
54
|
+
resultsComponents.forEach((component, index) => {
|
|
55
|
+
finalComponents.push(component);
|
|
56
|
+
if ((index + 1) % this.adInterval === 0) {
|
|
57
|
+
finalComponents.push(h("div", { key: `ad-section-${index + 1}`, class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
finalComponents.push(...resultsComponents);
|
|
63
|
+
}
|
|
64
|
+
// Add ad at the end if specified
|
|
65
|
+
if (this.placeAdAtEnd) {
|
|
66
|
+
finalComponents.push(h("div", { key: 'ad-section-end', class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
|
|
67
|
+
}
|
|
68
|
+
return (h("div", { class: 'resultsContainer' }, finalComponents, this.query.length > 0 &&
|
|
50
69
|
((_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` }))));
|
|
51
70
|
}
|
|
52
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-base-search-results.entry.esm.js","mappings":";;;;;AAAA,MAAM,qCAAqC,GAAG,
|
|
1
|
+
{"file":"searchcraft-base-search-results.entry.esm.js","mappings":";;;;;AAAA,MAAM,qCAAqC,GAAG,weAAwe;;MCezgB,4BAA4B;;;qBACtB,EAAE;6BACkC,IAAI;0BAMpC,EAAE;sCAOsB,EAAE;4BAKxB,KAAK;0BAMP,CAAC;;IAItB,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACpD,OAAO,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;YAChE,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;SACtB;QAED,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK;YACrD,IAAI,CAAC,aAAa,qBAAQ,KAAK,CAAC,aAAa,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0CAAE,IAAI,0CAAE,IAAI,0CAAE,MAAM,MAAK,CAAC,KAC1C,kDACiB,gCAAgC,IAAI,CAAC,KAAK,SAAS,GAClE,CACH,CACC,EACN;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-base-search-results/searchcraft-base-search-results.module.scss?tag=searchcraft-base-search-results&encapsulation=shadow","src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"sourcesContent":[":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.resultsContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: 100px 20px;\n\n & > p {\n align-self: center;\n }\n\n & > div {\n margin-bottom: 20px;\n img {\n height: 300px;\n width: 200px;\n }\n }\n}\n\n.adSection {\n align-items: center;\n border: 1px solid #DCDDDE;\n display: flex;\n flex-direction: column;\n font-size: 16px;\n justify-content: center;\n margin: auto;\n min-height: 150px;\n text-align: center;\n width: 100%;\n\n p {\n margin-top: 5px;\n }\n}\n","import { Component, h, Prop, State } from '@stencil/core';\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\n /**\n * Array of keys to dynamically extract properties from each document.\n * Must be explicitly set by the parent component.\n */\n @Prop() searchKeys = '';\n /**\n * Custom styles to apply to search results.\n * Expected format: JSON string, e.g., '{\"borderRadius\": \"10px\", \"padding\": \"16px\"}'\n */\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>> = {};\n\n /**\n * Place ad at the end of the results.\n */\n @Prop() placeAdAtEnd = false;\n\n /**\n * Place ad every N results (e.g., every 4 results).\n * Default value: 4\n */\n @Prop() adInterval = 4;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n if (!this.searchKeys || this.searchKeys.length === 0) {\n console.warn('No searchKeys provided; using empty keys array.');\n this.searchKeys = '';\n }\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\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 render() {\n if (!this.searchResults?.data) {\n console.warn('No search results data available');\n return <div>No results to display.</div>;\n }\n\n const parsedSearchKeys = parseSearchKeys(this.searchKeys);\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 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 // Add ads at specified intervals\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 // Add ad at the end if specified\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 <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h, F as Fragment } from './index-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h, F as Fragment } from './index-2e19f875.js';
|
|
2
2
|
import { c as classNames } from './index-d6567b9c.js';
|
|
3
3
|
import './_commonjsHelpers-63cbe26c.js';
|
|
4
4
|
|
|
@@ -23,7 +23,7 @@ const SearchcraftButton = class {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
const buttonStyle = this.getButtonStyle();
|
|
26
|
-
return (h(Fragment, { key: '
|
|
26
|
+
return (h(Fragment, { key: '2a29411990063b67c92c60a3f1f805818bea047f' }, 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)))));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
SearchcraftButton.style = searchcraftButtonModuleCss;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-2e19f875.js';
|
|
2
2
|
import { c as classNames } from './index-d6567b9c.js';
|
|
3
3
|
import './_commonjsHelpers-63cbe26c.js';
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ const SearchcraftErrorMessage = class {
|
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
14
|
const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
|
|
15
|
-
return (h("p", { key: '
|
|
15
|
+
return (h("p", { key: 'f520ac38f2f42e9780454aef5e25576095ae5ee9', class: classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
SearchcraftErrorMessage.style = searchcraftErrorMessageModuleCss;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-2e19f875.js';
|
|
2
2
|
|
|
3
3
|
const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{height:20px;left:15px;position:absolute;top:50%;transform:translateY(-50%);width:20px}.inputIconRTL{height:20px;position:absolute;right:15px;top:50%;transform:translateY(-50%);width:20px}";
|
|
4
4
|
|
|
@@ -7,13 +7,15 @@ const SearchcraftInputIcon = class {
|
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.error = undefined;
|
|
9
9
|
this.rightToLeftOrientation = false;
|
|
10
|
+
this.height = 20;
|
|
11
|
+
this.width = 20;
|
|
10
12
|
this.theme = 'light';
|
|
11
13
|
}
|
|
12
14
|
isLightTheme() {
|
|
13
15
|
return this.theme === 'light';
|
|
14
16
|
}
|
|
15
17
|
render() {
|
|
16
|
-
return this.error ? (h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme ? (h("searchcraft-search-icon-set", { type: 'error-light' })) : (h("searchcraft-search-icon-set", { type: 'error-dark' })))) : (h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme ? (h("searchcraft-search-icon-set", { type: 'search-light' })) : (h("searchcraft-search-icon-set", { type: 'search-dark' }))));
|
|
18
|
+
return this.error ? (h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
21
|
SearchcraftInputIcon.style = searchcraftInputIconModuleCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-input-icon.entry.esm.js","mappings":";;AAAA,MAAM,6BAA6B,GAAG,2PAA2P;;MCOpR,oBAAoB;;;;
|
|
1
|
+
{"file":"searchcraft-input-icon.entry.esm.js","mappings":";;AAAA,MAAM,6BAA6B,GAAG,2PAA2P;;MCOpR,oBAAoB;;;;sCASE,KAAK;sBACrB,EAAE;qBACH,EAAE;qBAED,OAAO;;IAEhB,YAAY;QAClB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,IACf,WACE,KAAK,EAAE,IAAI,CAAC,sBAAsB,GAAG,cAAc,GAAG,cAAc,IAEnE,IAAI,CAAC,YAAY,EAAE,IAClB,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,KAEF,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,YAAY,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACH,CACG,KAEN,WACE,KAAK,EAAE,IAAI,CAAC,sBAAsB,GAAG,cAAc,GAAG,cAAc,IAEnE,IAAI,CAAC,YAAY,EAAE,IAClB,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,KAEF,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACH,CACG,CACP,CAAC;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-input-icon/searchcraft-input-icon.module.scss?tag=searchcraft-input-icon&encapsulation=shadow","src/components/searchcraft-input-icon/searchcraft-input-icon.tsx"],"sourcesContent":[":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.inputIconLTR {\n height: 20px;\n left: 15px;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n}\n\n.inputIconRTL {\n height: 20px;\n position: absolute;\n right: 15px;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n}","import { Component, Prop, h, State } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-input-icon',\n styleUrl: 'searchcraft-input-icon.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputIcon {\n /**\n * Determines if an error icon should be displayed.\n */\n @Prop() error?: boolean;\n\n /**\n * Determines if the layout should be right-to-left.\n */\n @Prop() rightToLeftOrientation = false;\n @Prop() height = 20;\n @Prop() width = 20;\n\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n return this.error ? (\n <div\n class={this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR'}\n >\n {this.isLightTheme() ? (\n <searchcraft-search-icon-set\n height={this.height}\n type='error-light'\n width={this.width}\n />\n ) : (\n <searchcraft-search-icon-set\n height={this.height}\n type='error-dark'\n width={this.width}\n />\n )}\n </div>\n ) : (\n <div\n class={this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR'}\n >\n {this.isLightTheme() ? (\n <searchcraft-search-icon-set\n height={this.height}\n type='search-light'\n width={this.width}\n />\n ) : (\n <searchcraft-search-icon-set\n height={this.height}\n type='search-dark'\n width={this.width}\n />\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h, F as Fragment } from './index-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h, F as Fragment } from './index-2e19f875.js';
|
|
2
2
|
import { c as classNames } from './index-d6567b9c.js';
|
|
3
3
|
import { p as parseCustomStyles } from './utils-7bff0c78.js';
|
|
4
4
|
import './_commonjsHelpers-63cbe26c.js';
|
|
@@ -16,6 +16,9 @@ const SearchcraftInput = class {
|
|
|
16
16
|
this.inputCaptionClassName = '';
|
|
17
17
|
this.inputCaptionValue = '';
|
|
18
18
|
this.inputClassName = '';
|
|
19
|
+
this.inputIconHeight = 20;
|
|
20
|
+
this.inputIconWidth = 20;
|
|
21
|
+
this.isRequesting = false;
|
|
19
22
|
this.placeholderValue = 'Enter Search';
|
|
20
23
|
this.rightToLeftOrientation = false;
|
|
21
24
|
this.query = '';
|
|
@@ -48,15 +51,15 @@ const SearchcraftInput = class {
|
|
|
48
51
|
const placeholderStyle = {
|
|
49
52
|
fontSize: validatedCustomStyles.placeholderFontSize || '16px',
|
|
50
53
|
};
|
|
51
|
-
return (h("div", { key: '
|
|
54
|
+
return (h("div", { key: '41f29f98e95d5811e81dd885cd282cd8f50cb776', class: classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (h(Fragment, null, h("input", { class: classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), h("style", null, `
|
|
52
55
|
#searchcraft-input-id::placeholder {
|
|
53
56
|
font-size: ${placeholderStyle.fontSize};
|
|
54
57
|
}
|
|
55
|
-
`), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation })), h("searchcraft-input-icon", { error: this.error, rightToLeftOrientation: this.rightToLeftOrientation }))) : (h("div", { class: 'inputWrapper' }, h("searchcraft-input-icon", { error: this.error, rightToLeftOrientation: this.rightToLeftOrientation }), h("input", { class: classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), h("style", null, `
|
|
58
|
+
`), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation })), h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }))) : (h("div", { class: 'inputWrapper' }, h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }), h("input", { class: classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), h("style", null, `
|
|
56
59
|
#searchcraft-input-id::placeholder {
|
|
57
60
|
font-size: ${placeholderStyle.fontSize};
|
|
58
61
|
}
|
|
59
|
-
`), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation }))))));
|
|
62
|
+
`), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation }))))));
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
SearchcraftInput.style = searchcraftInputModuleCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-input.entry.esm.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,2sHAA2sH;;MCuBhuH,gBAAgB;;;;;4BAC6B,EAAE;qBAC1C,KAAK;6BACG,EAAE;qCACM,EAAE;iCACN,EAAE;8BACL,EAAE;gCACA,cAAc;sCACR,KAAK;qBACtB,EAAE;qBAKD,OAAO;;IAExB,IAAY,YAAY;QACtB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAED,iBAAiB,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,gBAAgB;QACd,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAED,MAAM;QACJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB;cAClD,mBAAmB;cACnB,mBAAmB,CAAC;QAExB,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAI,CAAC,KAAK;cACN,IAAI,CAAC,YAAY;kBACf,oBAAoB;kBACpB,mBAAmB;cACrB,IAAI,CAAC,YAAY;kBACf,eAAe;kBACf,cAAc,EACpB,mBAAmB,CACpB,CAAC;QAEF,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,IAAI,CAAC,YA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BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC3C,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,qBAAqB,GAC5B,EACF,iBACG;;+BAEgB,gBAAgB,CAAC,QAAQ;;eAEzC,CACK,EACP,IAAI,CAAC,iBAAiB,KACrB,iCACE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GACnD,CACH,EACA,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,KACpB,sCACE,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GACnD,CACH,CACG,CACP,CACG,EACN;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-input/searchcraft-input.module.scss?tag=searchcraft-input&encapsulation=shadow","src/components/searchcraft-input/searchcraft-input.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-container-base {\n position: relative;\n width: 100%;\n}\n\n@mixin input-base {\n border: none;\n border-radius: 8px;\n font-family: var(--font-stack);\n outline: none;\n padding-bottom: 15px;\n padding-top: 15px;\n width: 100%;\n\n &::placeholder {\n font-family: var(--font-stack);\n font-size: 16px;\n }\n}\n\n@mixin input-base-light {\n @include input-base;\n background-color: $light-input-background-color;\n color: $light-input-label-color;\n\n &::placeholder {\n color: $light-input-placeholder-color;\n }\n\n &:focus {\n outline: 2px solid $light-input-outline-focus;\n }\n}\n\n@mixin input-base-dark {\n @include input-base;\n background-color: $dark-input-background-color;\n color: $dark-input-label-color;\n\n &::placeholder {\n color: $dark-input-placeholder-color;\n }\n\n &:focus {\n outline: 2px solid $dark-input-outline-focus;\n }\n}\n\n@mixin input-error-base-light {\n @include input-base-light;\n outline: 2px solid $light-input-error-outline;\n\n &:focus-visible {\n outline: 2px solid $light-input-error-outline,\n }\n}\n\n@mixin input-error-base-dark {\n @include input-base-dark;\n outline: 2px solid $dark-input-error-outline;\n\n &:focus-visible {\n outline: 2px solid $dark-input-error-outline;\n }\n}\n\n.inputContainerLTR {\n @include input-container-base;\n}\n\n.inputContainerRTL {\n @include input-container-base;\n margin-left: 8px;\n}\n\n@mixin align-LTR {\n margin-right: 8px;\n padding-left: 36px;\n padding-right: 16px;\n}\n\n.inputLightLTR {\n @include input-base-light;\n @include align-LTR;\n}\n\n.inputDarkLTR {\n @include input-base-dark;\n @include align-LTR;\n}\n\n.inputErrorLightLTR {\n @include input-error-base-light;\n @include align-LTR;\n}\n\n.inputErrorDarkLTR {\n @include input-error-base-dark;\n @include align-LTR;\n}\n\n@mixin align-RTL {\n margin-left: 8px;\n padding-left: 16px;\n padding-right: 36px;\n text-align: right;\n}\n\n.inputLightRTL {\n @include input-base-light;\n @include align-RTL;\n}\n\n.inputDarkRTL {\n @include input-base-dark;\n @include align-RTL;\n}\n\n.inputErrorLightRTL {\n @include input-error-base-light;\n @include align-RTL;\n}\n\n.inputErrorDarkRTL {\n @include input-error-base-dark;\n @include align-RTL;\n}\n\n.inputWrapper {\n align-items: center;\n display: flex;\n position: relative;\n width: 100%;\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Event,\n Fragment,\n type EventEmitter,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\nimport { parseCustomStyles } from '@utils/utils';\n\nexport interface ScInputCustomEvent<T> extends CustomEvent<T> {\n detail: T;\n target: HTMLSearchcraftInputElement;\n}\n\n@Component({\n tag: 'searchcraft-input',\n styleUrl: 'searchcraft-input.module.scss',\n shadow: true,\n})\nexport class SearchcraftInput {\n @Prop() customStyles: string | Record<string, string> = {};\n @Prop() error = false;\n @Prop() formClassName = '';\n @Prop() inputCaptionClassName = '';\n @Prop() inputCaptionValue = '';\n @Prop() inputClassName = '';\n @Prop() placeholderValue = 'Enter Search';\n @Prop() rightToLeftOrientation = false;\n @Prop() query = '';\n\n @Event() clearInput: EventEmitter<void>;\n @Event() searchInputChange: EventEmitter<string>;\n\n @State() theme = 'light';\n\n private get isLightTheme() {\n return this.theme === 'light';\n }\n\n handleInputChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.searchInputChange.emit(input.value);\n }\n\n handleClearInput() {\n if (this.clearInput) {\n this.clearInput.emit();\n }\n }\n\n render() {\n const containerClassName = this.rightToLeftOrientation\n ? 'inputContainerRTL'\n : 'inputContainerLTR';\n\n const inputClassName = classNames(\n this.error\n ? this.isLightTheme\n ? 'inputErrorLightRTL'\n : 'inputErrorDarkRTL'\n : this.isLightTheme\n ? 'inputLightLTR'\n : 'inputDarkLTR',\n 'searchcraft-input',\n );\n\n const validatedCustomStyles = parseCustomStyles(this.customStyles);\n\n const placeholderStyle = {\n fontSize: validatedCustomStyles.placeholderFontSize || '16px',\n };\n return (\n <div\n class={classNames(\n containerClassName,\n this.formClassName,\n 'searchcraft-input-form',\n )}\n >\n {this.rightToLeftOrientation ? (\n <Fragment>\n <input\n class={classNames(inputClassName, 'searchcraft-input')}\n id='searchcraft-input-id'\n onChange={this.handleInputChange.bind(this)}\n placeholder={this.placeholderValue}\n type='text'\n value={this.query}\n style={validatedCustomStyles}\n />\n <style>\n {`\n #searchcraft-input-id::placeholder {\n font-size: ${placeholderStyle.fontSize};\n }\n `}\n </style>\n {this.inputCaptionValue && (\n <searchcraft-input-caption\n inputCaptionClassName={this.inputCaptionClassName}\n inputCaptionValue={this.inputCaptionValue}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n {this.query.length > 0 && (\n <searchcraft-clear-input-button\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n <searchcraft-input-icon\n error={this.error}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n </Fragment>\n ) : (\n <div class='inputWrapper'>\n <searchcraft-input-icon\n error={this.error}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n <input\n class={classNames(inputClassName, 'searchcraft-input')}\n id='searchcraft-input-id'\n onChange={this.handleInputChange.bind(this)}\n placeholder={this.placeholderValue}\n type='text'\n value={this.query}\n style={validatedCustomStyles}\n />\n <style>\n {`\n #searchcraft-input-id::placeholder {\n font-size: ${placeholderStyle.fontSize};\n }\n `}\n </style>\n {this.inputCaptionValue && (\n <searchcraft-input-caption\n inputCaptionClassName={this.inputCaptionClassName}\n inputCaptionValue={this.inputCaptionValue}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n {this.query.length > 0 && (\n <searchcraft-clear-input-button\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"searchcraft-input.entry.esm.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,2sHAA2sH;;MCuBhuH,gBAAgB;;;;;4BAC6B,EAAE;qBAC1C,KAAK;6BACG,EAAE;qCACM,EAAE;iCACN,EAAE;8BACL,EAAE;+BACD,EAAE;8BACH,EAAE;4BACJ,KAAK;gCACD,cAAc;sCACR,KAAK;qBACtB,EAAE;qBAKD,OAAO;;IAExB,IAAY,YAAY;QACtB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAED,iBAAiB,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,gBAAgB;QACd,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAED,MAAM;QACJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB;cAClD,mBAAmB;cACnB,mBAAmB,CAAC;QAExB,MAAM,cAAc,GAAG,UAAU,C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AAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,KAAK,EAAE,IAAI,CAAC,cAAc,GAC1B,CACO,KAEX,WAAK,KAAK,EAAC,cAAc,IACvB,8BACE,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,eAAe,EAC5B,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,KAAK,EAAE,IAAI,CAAC,cAAc,GAC1B,EACF,aACE,KAAK,EAAE,UAAU,CAAC,cAAc,EAAE,mBAAmB,CAAC,EACtD,EAAE,EAAC,sBAAsB,EACzB,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC3C,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,qBAAqB,GAC5B,EACF,iBACG;;+BAEgB,gBAAgB,CAAC,QAAQ;;eAEzC,CACK,EACP,IAAI,CAAC,iBAAiB,KACrB,iCACE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GACnD,CACH,EACA,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,KACpB,sCACE,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GACnD,CACH,CACG,CACP,CACG,EACN;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-input/searchcraft-input.module.scss?tag=searchcraft-input&encapsulation=shadow","src/components/searchcraft-input/searchcraft-input.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-container-base {\n position: relative;\n width: 100%;\n}\n\n@mixin input-base {\n border: none;\n border-radius: 8px;\n font-family: var(--font-stack);\n outline: none;\n padding-bottom: 15px;\n padding-top: 15px;\n width: 100%;\n\n &::placeholder {\n font-family: var(--font-stack);\n font-size: 16px;\n }\n}\n\n@mixin input-base-light {\n @include input-base;\n background-color: $light-input-background-color;\n color: $light-input-label-color;\n\n &::placeholder {\n color: $light-input-placeholder-color;\n }\n\n &:focus {\n outline: 2px solid $light-input-outline-focus;\n }\n}\n\n@mixin input-base-dark {\n @include input-base;\n background-color: $dark-input-background-color;\n color: $dark-input-label-color;\n\n &::placeholder {\n color: $dark-input-placeholder-color;\n }\n\n &:focus {\n outline: 2px solid $dark-input-outline-focus;\n }\n}\n\n@mixin input-error-base-light {\n @include input-base-light;\n outline: 2px solid $light-input-error-outline;\n\n &:focus-visible {\n outline: 2px solid $light-input-error-outline,\n }\n}\n\n@mixin input-error-base-dark {\n @include input-base-dark;\n outline: 2px solid $dark-input-error-outline;\n\n &:focus-visible {\n outline: 2px solid $dark-input-error-outline;\n }\n}\n\n.inputContainerLTR {\n @include input-container-base;\n}\n\n.inputContainerRTL {\n @include input-container-base;\n margin-left: 8px;\n}\n\n@mixin align-LTR {\n margin-right: 8px;\n padding-left: 36px;\n padding-right: 16px;\n}\n\n.inputLightLTR {\n @include input-base-light;\n @include align-LTR;\n}\n\n.inputDarkLTR {\n @include input-base-dark;\n @include align-LTR;\n}\n\n.inputErrorLightLTR {\n @include input-error-base-light;\n @include align-LTR;\n}\n\n.inputErrorDarkLTR {\n @include input-error-base-dark;\n @include align-LTR;\n}\n\n@mixin align-RTL {\n margin-left: 8px;\n padding-left: 16px;\n padding-right: 36px;\n text-align: right;\n}\n\n.inputLightRTL {\n @include input-base-light;\n @include align-RTL;\n}\n\n.inputDarkRTL {\n @include input-base-dark;\n @include align-RTL;\n}\n\n.inputErrorLightRTL {\n @include input-error-base-light;\n @include align-RTL;\n}\n\n.inputErrorDarkRTL {\n @include input-error-base-dark;\n @include align-RTL;\n}\n\n.inputWrapper {\n align-items: center;\n display: flex;\n position: relative;\n width: 100%;\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Event,\n Fragment,\n type EventEmitter,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\nimport { parseCustomStyles } from '@utils/utils';\n\nexport interface ScInputCustomEvent<T> extends CustomEvent<T> {\n detail: T;\n target: HTMLSearchcraftInputElement;\n}\n\n@Component({\n tag: 'searchcraft-input',\n styleUrl: 'searchcraft-input.module.scss',\n shadow: true,\n})\nexport class SearchcraftInput {\n @Prop() customStyles: string | Record<string, string> = {};\n @Prop() error = false;\n @Prop() formClassName = '';\n @Prop() inputCaptionClassName = '';\n @Prop() inputCaptionValue = '';\n @Prop() inputClassName = '';\n @Prop() inputIconHeight = 20;\n @Prop() inputIconWidth = 20;\n @Prop() isRequesting = false;\n @Prop() placeholderValue = 'Enter Search';\n @Prop() rightToLeftOrientation = false;\n @Prop() query = '';\n\n @Event() clearInput: EventEmitter<void>;\n @Event() searchInputChange: EventEmitter<string>;\n\n @State() theme = 'light';\n\n private get isLightTheme() {\n return this.theme === 'light';\n }\n\n handleInputChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.searchInputChange.emit(input.value);\n }\n\n handleClearInput() {\n if (this.clearInput) {\n this.clearInput.emit();\n }\n }\n\n render() {\n const containerClassName = this.rightToLeftOrientation\n ? 'inputContainerRTL'\n : 'inputContainerLTR';\n\n const inputClassName = classNames(\n this.error\n ? this.isLightTheme\n ? 'inputErrorLightRTL'\n : 'inputErrorDarkRTL'\n : this.isLightTheme\n ? 'inputLightLTR'\n : 'inputDarkLTR',\n 'searchcraft-input',\n );\n\n const validatedCustomStyles = parseCustomStyles(this.customStyles);\n\n const placeholderStyle = {\n fontSize: validatedCustomStyles.placeholderFontSize || '16px',\n };\n return (\n <div\n class={classNames(\n containerClassName,\n this.formClassName,\n 'searchcraft-input-form',\n )}\n >\n {this.rightToLeftOrientation ? (\n <Fragment>\n <input\n class={classNames(inputClassName, 'searchcraft-input')}\n id='searchcraft-input-id'\n onChange={this.handleInputChange.bind(this)}\n placeholder={this.placeholderValue}\n type='text'\n value={this.query}\n style={validatedCustomStyles}\n />\n <style>\n {`\n #searchcraft-input-id::placeholder {\n font-size: ${placeholderStyle.fontSize};\n }\n `}\n </style>\n {this.inputCaptionValue && (\n <searchcraft-input-caption\n inputCaptionClassName={this.inputCaptionClassName}\n inputCaptionValue={this.inputCaptionValue}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n {this.query.length > 0 && (\n <searchcraft-clear-input-button\n isRequesting={this.isRequesting}\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n <searchcraft-input-icon\n error={this.error}\n height={this.inputIconHeight}\n rightToLeftOrientation={this.rightToLeftOrientation}\n width={this.inputIconWidth}\n />\n </Fragment>\n ) : (\n <div class='inputWrapper'>\n <searchcraft-input-icon\n error={this.error}\n height={this.inputIconHeight}\n rightToLeftOrientation={this.rightToLeftOrientation}\n width={this.inputIconWidth}\n />\n <input\n class={classNames(inputClassName, 'searchcraft-input')}\n id='searchcraft-input-id'\n onChange={this.handleInputChange.bind(this)}\n placeholder={this.placeholderValue}\n type='text'\n value={this.query}\n style={validatedCustomStyles}\n />\n <style>\n {`\n #searchcraft-input-id::placeholder {\n font-size: ${placeholderStyle.fontSize};\n }\n `}\n </style>\n {this.inputCaptionValue && (\n <searchcraft-input-caption\n inputCaptionClassName={this.inputCaptionClassName}\n inputCaptionValue={this.inputCaptionValue}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n {this.query.length > 0 && (\n <searchcraft-clear-input-button\n isRequesting={this.isRequesting}\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BUILD, c as consoleDevInfo, H, d as doc, N as NAMESPACE, p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { B as BUILD, c as consoleDevInfo, H, d as doc, N as NAMESPACE, p as promiseResolve, b as bootstrapLazy } from './index-2e19f875.js';
|
|
2
|
+
export { s as setNonce } from './index-2e19f875.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -43,7 +43,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
43
43
|
|
|
44
44
|
patchBrowser().then(async (options) => {
|
|
45
45
|
await globalScripts();
|
|
46
|
-
return bootstrapLazy([["searchcraft-base-search-form",[[1,"searchcraft-base-search-form",{"config":[16],"errorMessage":[1,"error-message"],"labelForInput":[1,"label-for-input"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"error":[32],"query":[32],"searchResults":[32]}]]],["searchcraft-auto-search-form",[[1,"searchcraft-auto-search-form",{"autoSearchFormClass":[1,"auto-search-form-class"],"clearInput":[16],"config":[16],"customStylesForInput":[1,"custom-styles-for-input"],"inputCaptionValue":[1,"input-caption-value"],"labelForInput":[1,"label-for-input"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"searchContainerClass":[1,"search-container-class"],"error":[32],"query":[32],"searchResults":[32]}]]],["searchcraft-button",[[1,"searchcraft-button",{"iconElement":[16],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"label":[1],"isRequesting":[32],"theme":[32]}]]],["searchcraft-base-search-result",[[1,"searchcraft-base-search-result",{"buttonText":[1,"button-text"],"imageDescription":[1,"image-description"],"imageSource":[1,"image-source"],"isInteractive":[4,"is-interactive"],"primaryContent":[1,"primary-content"],"secondaryContent":[1,"secondary-content"],"tertiaryContent":[1,"tertiary-content"],"headingText":[1,"heading-text"],"subheadingText":[1,"subheading-text"],"themeMode":[1,"theme-mode"],"customStyles":[1,"custom-styles"]}]]],["searchcraft-error-message",[[1,"searchcraft-error-message",{"errorMessage":[1,"error-message"],"theme":[1]}]]],["searchcraft-base-search-results",[[1,"searchcraft-base-search-results",{"searchKeys":[1,"search-keys"],"customStylesForResults":[1,"custom-styles-for-results"],"query":[32],"searchResults":[32]}]]],["searchcraft-button-icon",[[1,"searchcraft-button-icon"]]],["searchcraft-spinner-light",[[1,"searchcraft-spinner-light"]]],["searchcraft-clear-input-button",[[1,"searchcraft-clear-input-button",{"isRequesting":[4,"is-requesting"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}]]],["searchcraft-search-icon-set",[[1,"searchcraft-search-icon-set",{"type":[1]}]]],["searchcraft-input-icon",[[1,"searchcraft-input-icon",{"error":[4],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}]]],["searchcraft-input-caption",[[1,"searchcraft-input-caption",{"error":[4],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}]]],["searchcraft-input",[[1,"searchcraft-input",{"customStyles":[1,"custom-styles"],"error":[4],"formClassName":[1,"form-class-name"],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"inputClassName":[1,"input-class-name"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"query":[1],"theme":[32]}]]],["searchcraft-input-label",[[1,"searchcraft-input-label",{"inputLabelClassName":[1,"input-label-class-name"],"label":[1],"theme":[32]}]]],["searchcraft-clear-icon-set",[[1,"searchcraft-clear-icon-set",{"type":[1]}]]],["searchcraft-spinner-dark",[[1,"searchcraft-spinner-dark"]]]], options);
|
|
46
|
+
return bootstrapLazy([["searchcraft-base-search-form",[[1,"searchcraft-base-search-form",{"config":[16],"errorMessage":[1,"error-message"],"labelForInput":[1,"label-for-input"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"error":[32],"query":[32],"searchResults":[32]}]]],["searchcraft-auto-search-form",[[1,"searchcraft-auto-search-form",{"autoSearchFormClass":[1,"auto-search-form-class"],"clearInput":[16],"config":[16],"customStylesForInput":[1,"custom-styles-for-input"],"inputCaptionValue":[1,"input-caption-value"],"inputIconHeight":[2,"input-icon-height"],"inputIconWidth":[2,"input-icon-width"],"labelForInput":[1,"label-for-input"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"searchContainerClass":[1,"search-container-class"],"error":[32],"isRequesting":[32],"query":[32],"searchResults":[32]}]]],["searchcraft-button",[[1,"searchcraft-button",{"iconElement":[16],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"label":[1],"isRequesting":[32],"theme":[32]}]]],["searchcraft-base-search-result",[[1,"searchcraft-base-search-result",{"buttonText":[1,"button-text"],"imageDescription":[1,"image-description"],"imageSource":[1,"image-source"],"isInteractive":[4,"is-interactive"],"primaryContent":[1,"primary-content"],"secondaryContent":[1,"secondary-content"],"tertiaryContent":[1,"tertiary-content"],"headingText":[1,"heading-text"],"subheadingText":[1,"subheading-text"],"themeMode":[1,"theme-mode"],"customStyles":[1,"custom-styles"]}]]],["searchcraft-error-message",[[1,"searchcraft-error-message",{"errorMessage":[1,"error-message"],"theme":[1]}]]],["searchcraft-base-search-results",[[1,"searchcraft-base-search-results",{"searchKeys":[1,"search-keys"],"customStylesForResults":[1,"custom-styles-for-results"],"placeAdAtEnd":[4,"place-ad-at-end"],"adInterval":[2,"ad-interval"],"query":[32],"searchResults":[32]}]]],["searchcraft-button-icon",[[1,"searchcraft-button-icon"]]],["searchcraft-spinner-light",[[1,"searchcraft-spinner-light"]]],["searchcraft-clear-input-button",[[1,"searchcraft-clear-input-button",{"isRequesting":[4,"is-requesting"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}]]],["searchcraft-search-icon-set",[[1,"searchcraft-search-icon-set",{"type":[1],"width":[2],"height":[2]}]]],["searchcraft-input-icon",[[1,"searchcraft-input-icon",{"error":[4],"rightToLeftOrientation":[4,"right-to-left-orientation"],"height":[2],"width":[2],"theme":[32]}]]],["searchcraft-input-caption",[[1,"searchcraft-input-caption",{"error":[4],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}]]],["searchcraft-input",[[1,"searchcraft-input",{"customStyles":[1,"custom-styles"],"error":[4],"formClassName":[1,"form-class-name"],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"inputClassName":[1,"input-class-name"],"inputIconHeight":[2,"input-icon-height"],"inputIconWidth":[2,"input-icon-width"],"isRequesting":[4,"is-requesting"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"query":[1],"theme":[32]}]]],["searchcraft-input-label",[[1,"searchcraft-input-label",{"inputLabelClassName":[1,"input-label-class-name"],"label":[1],"theme":[32]}]]],["searchcraft-clear-icon-set",[[1,"searchcraft-clear-icon-set",{"type":[1]}]]],["searchcraft-spinner-dark",[[1,"searchcraft-spinner-dark"]]]], options);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
//# sourceMappingURL=searchcraft-javascript-sdk.esm.js.map
|