@searchcraft/javascript-sdk 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js +34 -0
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js +3043 -0
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js.map +1 -0
- package/dist/{esm/index-72ac5051.js → searchcraft-javascript-sdk/index-d6567b9c.js} +10 -2
- package/dist/searchcraft-javascript-sdk/index-d6567b9c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +14 -1
- package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +93 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-base-search-form.entry.js +4 -4
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +1 -0
- package/dist/{components/p-1912bbbd.js → searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js} +22 -47
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js +57 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button-icon.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button.entry.js +5 -5
- package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +1 -0
- package/dist/{components/p-d446eda4.js → searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js} +7 -25
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +31 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +22 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js.map +1 -0
- package/dist/{components/p-cb75ba7a.js → searchcraft-javascript-sdk/searchcraft-input-caption.entry.js} +10 -32
- package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +23 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +30 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +1 -0
- package/dist/{components/p-1bd04bac.js → searchcraft-javascript-sdk/searchcraft-input.entry.js} +11 -80
- package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +48 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/{components/p-d0edf961.js → searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js} +7 -25
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +17 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +17 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js +334 -0
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js +3008 -0
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js.map +1 -0
- package/dist/{esm/utils-02b18bb5.js → searchcraft-javascript-sdk/utils-7bff0c78.js} +11 -7
- package/dist/searchcraft-javascript-sdk/utils-7bff0c78.js.map +1 -0
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +2 -1
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -2
- package/dist/types/components.d.ts +6 -4
- package/dist/types/utils/utils.d.ts +1 -5
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-5b0b9d4c.js +0 -84
- package/dist/cjs/index-5b0b9d4c.js.map +0 -1
- package/dist/cjs/index-e7e9ab69.js +0 -1271
- package/dist/cjs/index-e7e9ab69.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -16
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js +0 -460
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +0 -64
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +0 -18
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button.cjs.entry.js +0 -37
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +0 -27
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +0 -1
- package/dist/cjs/store-ab3978ce.js +0 -251
- package/dist/cjs/store-ab3978ce.js.map +0 -1
- package/dist/cjs/utils-57b6c18f.js +0 -48
- package/dist/cjs/utils-57b6c18f.js.map +0 -1
- package/dist/collection/assets/searchcraft-button-icons.js +0 -9
- package/dist/collection/assets/searchcraft-button-icons.js.map +0 -1
- package/dist/collection/assets/searchcraft-clear-icon-set.js +0 -45
- package/dist/collection/assets/searchcraft-clear-icon-set.js.map +0 -1
- package/dist/collection/assets/searchcraft-search-icon-set.js +0 -45
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -27
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +0 -294
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +0 -1
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +0 -19
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +0 -168
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +0 -14
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +0 -302
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -210
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +0 -123
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -20
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +0 -137
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +0 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -82
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +0 -96
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +0 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +0 -33
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +0 -64
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +0 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -21
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +0 -276
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +0 -1
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +0 -241
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +0 -122
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +0 -1
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +0 -79
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +0 -71
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +0 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +0 -21
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +0 -77
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +0 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -21
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +0 -19
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +0 -1
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +0 -35
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +0 -19
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +0 -1
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +0 -26
- package/dist/collection/index.js +0 -14
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/provider/store.js +0 -68
- package/dist/collection/provider/store.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -41
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js +0 -5
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-066c8210.js +0 -1106
- package/dist/components/p-066c8210.js.map +0 -1
- package/dist/components/p-1912bbbd.js.map +0 -1
- package/dist/components/p-1bd04bac.js.map +0 -1
- package/dist/components/p-36c95064.js +0 -247
- package/dist/components/p-36c95064.js.map +0 -1
- package/dist/components/p-5cdc6210.js +0 -82
- package/dist/components/p-5cdc6210.js.map +0 -1
- package/dist/components/p-5e3152c4.js +0 -44
- package/dist/components/p-5e3152c4.js.map +0 -1
- package/dist/components/p-63035c6a.js +0 -50
- package/dist/components/p-63035c6a.js.map +0 -1
- package/dist/components/p-6f2a72d3.js +0 -41
- package/dist/components/p-6f2a72d3.js.map +0 -1
- package/dist/components/p-8d9551ce.js +0 -34
- package/dist/components/p-8d9551ce.js.map +0 -1
- package/dist/components/p-b1ff2296.js +0 -69
- package/dist/components/p-b1ff2296.js.map +0 -1
- package/dist/components/p-c3838435.js +0 -62
- package/dist/components/p-c3838435.js.map +0 -1
- package/dist/components/p-cb75ba7a.js.map +0 -1
- package/dist/components/p-d0edf961.js.map +0 -1
- package/dist/components/p-d446eda4.js.map +0 -1
- package/dist/components/p-d54bca75.js +0 -50
- package/dist/components/p-d54bca75.js.map +0 -1
- package/dist/components/p-d6616aa5.js +0 -34
- package/dist/components/p-d6616aa5.js.map +0 -1
- package/dist/components/searchcraft-auto-search-form.js +0 -185
- package/dist/components/searchcraft-auto-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-form.js +0 -153
- package/dist/components/searchcraft-base-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-result.js +0 -8
- package/dist/components/searchcraft-base-search-result.js.map +0 -1
- package/dist/components/searchcraft-base-search-results.js +0 -111
- package/dist/components/searchcraft-base-search-results.js.map +0 -1
- package/dist/components/searchcraft-button-icon.js +0 -33
- package/dist/components/searchcraft-button-icon.js.map +0 -1
- package/dist/components/searchcraft-button.js +0 -8
- package/dist/components/searchcraft-button.js.map +0 -1
- package/dist/components/searchcraft-clear-icon-set.js +0 -8
- package/dist/components/searchcraft-clear-icon-set.js.map +0 -1
- package/dist/components/searchcraft-clear-input-button.js +0 -8
- package/dist/components/searchcraft-clear-input-button.js.map +0 -1
- package/dist/components/searchcraft-error-message.js +0 -8
- package/dist/components/searchcraft-error-message.js.map +0 -1
- package/dist/components/searchcraft-input-caption.js +0 -8
- package/dist/components/searchcraft-input-caption.js.map +0 -1
- package/dist/components/searchcraft-input-icon.js +0 -8
- package/dist/components/searchcraft-input-icon.js.map +0 -1
- package/dist/components/searchcraft-input-label.js +0 -8
- package/dist/components/searchcraft-input-label.js.map +0 -1
- package/dist/components/searchcraft-input.js +0 -8
- package/dist/components/searchcraft-input.js.map +0 -1
- package/dist/components/searchcraft-search-icon-set.js +0 -8
- package/dist/components/searchcraft-search-icon-set.js.map +0 -1
- package/dist/components/searchcraft-spinner-dark.js +0 -8
- package/dist/components/searchcraft-spinner-dark.js.map +0 -1
- package/dist/components/searchcraft-spinner-light.js +0 -8
- package/dist/components/searchcraft-spinner-light.js.map +0 -1
- package/dist/esm/index-72ac5051.js.map +0 -1
- package/dist/esm/index-eace3343.js +0 -1242
- package/dist/esm/index-eace3343.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_13.entry.js +0 -444
- package/dist/esm/searchcraft-auto-search-form_13.entry.js.map +0 -1
- package/dist/esm/searchcraft-base-search-form.entry.js.map +0 -1
- package/dist/esm/searchcraft-button-icon.entry.js.map +0 -1
- package/dist/esm/searchcraft-button.entry.js.map +0 -1
- package/dist/esm/searchcraft-javascript-sdk.js +0 -22
- package/dist/esm/searchcraft-javascript-sdk.js.map +0 -1
- package/dist/esm/store-e55b12aa.js +0 -247
- package/dist/esm/store-e55b12aa.js.map +0 -1
- package/dist/esm/utils-02b18bb5.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -1
- package/dist/loader/index.cjs.js +0 -1
- package/dist/loader/index.d.ts +0 -24
- package/dist/loader/index.es2017.js +0 -1
- package/dist/loader/index.js +0 -2
- package/dist/loader/package.json +0 -11
- package/dist/searchcraft-javascript-sdk/p-0ba9029b.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-0ba9029b.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-36c95064.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-36c95064.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-437c6ef9.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-437c6ef9.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-562e923d.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-562e923d.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5959cd6a.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5959cd6a.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +0 -7
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5e3152c4.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5e3152c4.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-e1255160.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-eb632a89.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-eb632a89.entry.js.map +0 -1
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js.map +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
2
|
+
|
|
1
3
|
var classnames = {exports: {}};
|
|
2
4
|
|
|
3
5
|
/*!
|
|
@@ -10,6 +12,7 @@ var classnames = {exports: {}};
|
|
|
10
12
|
/* global define */
|
|
11
13
|
|
|
12
14
|
(function () {
|
|
15
|
+
'use strict';
|
|
13
16
|
|
|
14
17
|
var hasOwn = {}.hasOwnProperty;
|
|
15
18
|
|
|
@@ -66,9 +69,14 @@ var classnames = {exports: {}};
|
|
|
66
69
|
return value + newClass;
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
if (module.exports) {
|
|
72
|
+
if ('object' !== 'undefined' && module.exports) {
|
|
70
73
|
classNames.default = classNames;
|
|
71
74
|
module.exports = classNames;
|
|
75
|
+
} else if (typeof undefined === 'function' && typeof undefined.amd === 'object' && undefined.amd) {
|
|
76
|
+
// register as 'classnames', consistent with npm package name
|
|
77
|
+
undefined('classnames', [], function () {
|
|
78
|
+
return classNames;
|
|
79
|
+
});
|
|
72
80
|
} else {
|
|
73
81
|
window.classNames = classNames;
|
|
74
82
|
}
|
|
@@ -79,4 +87,4 @@ const classNames = classnames.exports;
|
|
|
79
87
|
|
|
80
88
|
export { classNames as c };
|
|
81
89
|
|
|
82
|
-
//# sourceMappingURL=index-
|
|
90
|
+
//# sourceMappingURL=index-d6567b9c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index-d6567b9c.js","mappings":";;;;;;;;;;;AAKA;AACA;AACA,CAAC,YAAY;AACb,CAAC,YAAY,CAAC;AACd;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG,IAAI,GAAG,EAAE;AACZ,IAAI,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,IAAI;AACJ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,GAAG,GAAG,QAAQ,CAAC;AACjC,GAAG;AACH;AACA,EAAE,OAAO,KAAK,GAAG,QAAQ,CAAC;AAC1B,EAAE;AACF;AACA,CAAC,IAAI,QAAa,KAAK,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE;AACtD,EAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;AAClC,EAAE,iBAAiB,UAAU,CAAC;AAC9B,EAAE,MAAM,IAAI,OAAOA,SAAM,KAAK,UAAU,IAAI,OAAOA,SAAM,CAAC,GAAG,KAAK,QAAQ,IAAIA,SAAM,CAAC,GAAG,EAAE;AAC1F;AACA,EAAEA,SAAM,CAAC,YAAY,EAAE,EAAE,EAAE,YAAY;AACvC,GAAG,OAAO,UAAU,CAAC;AACrB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM;AACR,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AACjC,EAAE;AACF,CAAC,EAAE;;;;;;;","names":["define"],"sources":["../../node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"version":3}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
export{e as extractDynamicProperties,p as parseCustomStyles,a as parseSearchKeys}from
|
|
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-b50263a1.js';
|
|
3
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview entry point for your component library
|
|
7
|
+
*
|
|
8
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
9
|
+
* constants or data structure that accompany your components.
|
|
10
|
+
*
|
|
11
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
12
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
13
|
+
*/
|
|
14
|
+
|
|
2
15
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +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}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-be6bffea.js';
|
|
2
|
+
import { u as useSearchcraftStore, g } from './store-b50263a1.js';
|
|
3
|
+
import { p as parseCustomStyles } from './utils-7bff0c78.js';
|
|
4
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
5
|
+
|
|
6
|
+
const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{text-align:left;width:100%}.formRTL{text-align:right;width:100%}.searchContainer{align-items:center;display:flex;width:100%}";
|
|
7
|
+
|
|
8
|
+
const SearchcraftAutoSearchForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.querySubmit = createEvent(this, "querySubmit", 7);
|
|
12
|
+
this.debounceTimeout = null;
|
|
13
|
+
this.debounceDelay = 300; // 300ms debounce delay
|
|
14
|
+
this.searchStore = useSearchcraftStore.getState();
|
|
15
|
+
this.handleInputChange = (event) => {
|
|
16
|
+
this.query = event.detail;
|
|
17
|
+
this.querySubmit.emit(this.query);
|
|
18
|
+
// Clear the previous debounce timeout
|
|
19
|
+
if (this.debounceTimeout) {
|
|
20
|
+
clearTimeout(this.debounceTimeout);
|
|
21
|
+
}
|
|
22
|
+
// Set a new debounce timeout
|
|
23
|
+
this.debounceTimeout = setTimeout(() => {
|
|
24
|
+
console.log('Debounced search triggered');
|
|
25
|
+
this.runSearch();
|
|
26
|
+
}, this.debounceDelay);
|
|
27
|
+
};
|
|
28
|
+
this.handleClearInput = () => {
|
|
29
|
+
this.query = '';
|
|
30
|
+
console.log('Input cleared');
|
|
31
|
+
if (typeof this.clearInput === 'function') {
|
|
32
|
+
this.clearInput();
|
|
33
|
+
}
|
|
34
|
+
if (this.debounceTimeout) {
|
|
35
|
+
clearTimeout(this.debounceTimeout);
|
|
36
|
+
}
|
|
37
|
+
this.error = false;
|
|
38
|
+
this.searchResults = '';
|
|
39
|
+
};
|
|
40
|
+
this.runSearch = async () => {
|
|
41
|
+
if (this.query.trim() === '') {
|
|
42
|
+
this.error = true;
|
|
43
|
+
this.searchResults = '';
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.error = false;
|
|
47
|
+
this.searchStore.setQuery(this.query);
|
|
48
|
+
try {
|
|
49
|
+
await this.searchStore.search();
|
|
50
|
+
this.searchResults = JSON.stringify(this.searchStore.searchResults);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
this.error = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
this.handleFormSubmit = async (event) => {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
await this.runSearch();
|
|
60
|
+
};
|
|
61
|
+
this.autoSearchFormClass = '';
|
|
62
|
+
this.clearInput = () => { };
|
|
63
|
+
this.config = {
|
|
64
|
+
apiKey: '',
|
|
65
|
+
endpointURL: '',
|
|
66
|
+
index: [],
|
|
67
|
+
};
|
|
68
|
+
this.customStylesForInput = {};
|
|
69
|
+
this.inputCaptionValue = '';
|
|
70
|
+
this.labelForInput = '';
|
|
71
|
+
this.placeholderValue = 'Search here';
|
|
72
|
+
this.rightToLeftOrientation = false;
|
|
73
|
+
this.searchContainerClass = '';
|
|
74
|
+
this.error = false;
|
|
75
|
+
this.query = '';
|
|
76
|
+
this.searchResults = '';
|
|
77
|
+
}
|
|
78
|
+
componentDidLoad() {
|
|
79
|
+
const searchcraft = new g(this.config);
|
|
80
|
+
this.searchStore.initialize(searchcraft, true);
|
|
81
|
+
console.log('Component initialized');
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
|
|
85
|
+
const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);
|
|
86
|
+
return (h("form", { key: '60978e813198af27c34232ebd1bda4ca4a6f5199', class: `${formClass}`, onSubmit: this.handleFormSubmit }, h("searchcraft-input-label", { key: '4418b675769d041c684f15afb2d9b919f765c133', label: this.labelForInput }), h("div", { key: '73581bf8fee7deee1bcf426f80493c78e92d8ada', class: 'searchContainer' }, h("searchcraft-input", { key: '6e90612f4fc8c773c9f98f5fcfffb303909d3c6f', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, onClearInput: this.handleClearInput, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation })), this.error && (h("searchcraft-error-message", { key: '1637aff0dcac83d975d9d53545e7fee26c41aa7f', errorMessage: 'Please enter a search query.' }))));
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
SearchcraftAutoSearchForm.style = searchcraftAutoSearchFormModuleCss;
|
|
90
|
+
|
|
91
|
+
export { SearchcraftAutoSearchForm as searchcraft_auto_search_form };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=searchcraft-auto-search-form.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-auto-search-form.entry.esm.js","mappings":";;;;;AAAA,MAAM,kCAAkC,GAAG,uLAAuL;;MCsBrN,yBAAyB;;;;QAqB5B,oBAAe,GAAyC,IAAI,CAAC;QAC7D,kBAAa,GAAG,GAAG,CAAC;QACpB,gBAAW,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QAQrD,sBAAiB,GAAG,CAAC,KAAiC;YACpD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC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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() 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() 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\n componentDidLoad() {\n const searchcraft = new SearchcraftCore(this.config);\n this.searchStore.initialize(searchcraft, true);\n console.log('Component initialized');\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 console.log('Debounced search triggered');\n this.runSearch();\n }, this.debounceDelay);\n };\n\n handleClearInput = () => {\n this.query = '';\n console.log('Input cleared');\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 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,8 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import { u as useSearchcraftStore, a as useThemeStore, g } from './store-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-be6bffea.js';
|
|
2
|
+
import { u as useSearchcraftStore, a as useThemeStore, g } from './store-b50263a1.js';
|
|
3
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
3
4
|
|
|
4
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}";
|
|
5
|
-
const SearchcraftBaseSearchFormStyle0 = searchcraftBaseSearchFormModuleCss;
|
|
6
6
|
|
|
7
7
|
const SearchcraftBaseSearchForm = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -53,7 +53,7 @@ const SearchcraftBaseSearchForm = class {
|
|
|
53
53
|
return (h("form", { key: '6460e91d9c4a48c40476c18762b8b4873c157653', class: this.rightToLeftOrientation ? 'formRTL' : 'formLTR', onSubmit: this.handleFormSubmit }, h("searchcraft-input-label", { key: '9d0a89868c4dafae20e7437101c5639466fc2ffa', label: this.labelForInput }), h("div", { key: '441c0923111995fc0b04b0acb799ade4b2018be0', class: 'searchContainer' }, this.rightToLeftOrientation && h("searchcraft-button", { key: '2a0dc24c906917cd1ec5bd605e25a0a67bffee21' }), h("searchcraft-input", { key: '6744a36c97e03fbd10cc354653e32f0f7eac1c00', onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation, onSearchInputChange: this.handleSearchInputChange, query: this.query }), !this.rightToLeftOrientation && (h("searchcraft-button", { key: '50ea437efebe7a62d6122fb6a76942861003884a', onButtonClick: this.handleFormSubmit }))), this.error && (h("searchcraft-error-message", { key: 'ae4b2fa7d874771af0b88757244abe5d50679d55', errorMessage: this.errorMessage }))));
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
SearchcraftBaseSearchForm.style =
|
|
56
|
+
SearchcraftBaseSearchForm.style = searchcraftBaseSearchFormModuleCss;
|
|
57
57
|
|
|
58
58
|
export { SearchcraftBaseSearchForm as searchcraft_base_search_form };
|
|
59
59
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-base-search-form.entry.esm.js","mappings":";;;;AAAA,MAAM,kCAAkC,GAAG,wLAA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,yBAAyB;6BACxB,QAAQ;sCACC,KAAK;qBAIrB,KAAK;qBACL,EAAE;6BACqB,IAAI;;IAmC5C,MAAM;QACJ,QACE,6DACE,KAAK,EAAE,IAAI,CAAC,sBAAsB,GAAG,SAAS,GAAG,SAAS,EAC1D,QAAQ,EAAE,IAAI,CAAC,gBAAgB,IAE/B,gFAAyB,KAAK,EAAE,IAAI,CAAC,aAAa,GAAI,EACtD,4DAAK,KAAK,EAAC,iBAAiB,IACzB,IAAI,CAAC,sBAAsB,IAAI,4EAAsB,EACtD,0EACE,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,mBAAmB,EAAE,IAAI,CAAC,uBAAuB,EACjD,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,EACD,CAAC,IAAI,CAAC,sBAAsB,KAC3B,2EAAoB,aAAa,EAAE,IAAI,CAAC,gBAAgB,GAAI,CAC7D,CACG,EACL,IAAI,CAAC,KAAK,KACT,kFAA2B,YAAY,EAAE,IAAI,CAAC,YAAY,GAAI,CAC/D,CACI,EACP;KACH;;;;;;","names":["SearchcraftCore"],"sources":["src/components/searchcraft-base-search-form/searchcraft-base-search-form.module.scss?tag=searchcraft-base-search-form&encapsulation=shadow","src/components/searchcraft-base-search-form/searchcraft-base-search-form.tsx"],"sourcesContent":[".formLTR {\n font-family: Helvetica, Arial, sans-serif;\n text-align: left;\n}\n\n.formRTL {\n font-family: Helvetica, Arial, sans-serif;\n text-align: right;\n}\n\n.searchContainer {\n align-items: center;\n display: flex;\n}","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"],"version":3}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as defineCustomElement$1 } from './p-d446eda4.js';
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-be6bffea.js';
|
|
3
2
|
|
|
4
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:100%;max-width:50%}}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.imageLight{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}";
|
|
5
|
-
const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
|
|
6
4
|
|
|
7
|
-
const SearchcraftBaseSearchResult =
|
|
8
|
-
constructor() {
|
|
9
|
-
|
|
10
|
-
this.__registerHost();
|
|
11
|
-
this.__attachShadow();
|
|
5
|
+
const SearchcraftBaseSearchResult = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
12
8
|
this.buttonCallback = createEvent(this, "buttonCallback", 7);
|
|
13
9
|
this.keyDownCallback = createEvent(this, "keyDownCallback", 7);
|
|
14
10
|
this.resultCallback = createEvent(this, "resultCallback", 7);
|
|
@@ -33,51 +29,30 @@ const SearchcraftBaseSearchResult = /*@__PURE__*/ proxyCustomElement(class Searc
|
|
|
33
29
|
this.headingText = '';
|
|
34
30
|
this.subheadingText = '';
|
|
35
31
|
this.themeMode = 'light';
|
|
36
|
-
this.customStyles = {};
|
|
32
|
+
this.customStyles = '{}';
|
|
33
|
+
}
|
|
34
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
35
|
+
parseStyles() {
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(this.customStyles);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error('Error parsing custom styles:', error);
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
render() {
|
|
39
45
|
const isLightTheme = this.themeMode === 'light';
|
|
40
|
-
const
|
|
41
|
-
return (h("div", { key: '
|
|
46
|
+
const styles = this.parseStyles();
|
|
47
|
+
return (h("div", { key: '096a8c89cb39b5dca0949b11981747b55c6f374f', class: this.isInteractive
|
|
42
48
|
? isLightTheme
|
|
43
49
|
? 'interactiveResultContainerLight'
|
|
44
50
|
: 'interactiveResultContainerDark'
|
|
45
|
-
: 'resultContainer',
|
|
46
|
-
}
|
|
47
|
-
static get style() { return SearchcraftBaseSearchResultStyle0; }
|
|
48
|
-
}, [1, "searchcraft-base-search-result", {
|
|
49
|
-
"buttonText": [1, "button-text"],
|
|
50
|
-
"imageDescription": [1, "image-description"],
|
|
51
|
-
"imageSource": [1, "image-source"],
|
|
52
|
-
"isInteractive": [4, "is-interactive"],
|
|
53
|
-
"primaryContent": [1, "primary-content"],
|
|
54
|
-
"secondaryContent": [1, "secondary-content"],
|
|
55
|
-
"tertiaryContent": [1, "tertiary-content"],
|
|
56
|
-
"headingText": [1, "heading-text"],
|
|
57
|
-
"subheadingText": [1, "subheading-text"],
|
|
58
|
-
"themeMode": [1, "theme-mode"],
|
|
59
|
-
"customStyles": [16]
|
|
60
|
-
}]);
|
|
61
|
-
function defineCustomElement() {
|
|
62
|
-
if (typeof customElements === "undefined") {
|
|
63
|
-
return;
|
|
51
|
+
: '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)))));
|
|
64
52
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
case "searchcraft-base-search-result":
|
|
68
|
-
if (!customElements.get(tagName)) {
|
|
69
|
-
customElements.define(tagName, SearchcraftBaseSearchResult);
|
|
70
|
-
}
|
|
71
|
-
break;
|
|
72
|
-
case "searchcraft-clear-icon-set":
|
|
73
|
-
if (!customElements.get(tagName)) {
|
|
74
|
-
defineCustomElement$1();
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
} });
|
|
78
|
-
}
|
|
79
|
-
defineCustomElement();
|
|
53
|
+
};
|
|
54
|
+
SearchcraftBaseSearchResult.style = searchcraftBaseSearchResultModuleCss;
|
|
80
55
|
|
|
81
|
-
export { SearchcraftBaseSearchResult as
|
|
56
|
+
export { SearchcraftBaseSearchResult as searchcraft_base_search_result };
|
|
82
57
|
|
|
83
|
-
//# sourceMappingURL=
|
|
58
|
+
//# sourceMappingURL=searchcraft-base-search-result.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-base-search-result.entry.esm.js","mappings":";;AAAA,MAAM,oCAAo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KAAK,EAAE,YAAY,GAAG,YAAY,GAAG,WAAW,GAChD,CACE,EACN,4DAAK,KAAK,EAAC,kBAAkB,IAC3B,2DACE,KAAK,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE,EAC3B,KAAK,EAAE,YAAY,GAAG,cAAc,GAAG,aAAa,IAEnD,IAAI,CAAC,WAAW,CACd,EACL,2DACE,KAAK,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,EAC9B,KAAK,EAAE,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,IAEzD,IAAI,CAAC,cAAc,CACjB,EACL,0DACE,KAAK,EAAE,MAAM,CAAC,cAAc,IAAI,EAAE,EAClC,KAAK,EAAE,YAAY,GAAG,qBAAqB,GAAG,oBAAoB,IAEjE,IAAI,CAAC,cAAc,CAClB,EACJ,0DACE,KAAK,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,EACH,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: 100%;\n max-width: 50%;\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 // 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"],"version":3}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-be6bffea.js';
|
|
2
|
+
import { u as useSearchcraftStore } from './store-b50263a1.js';
|
|
3
|
+
import { a as parseSearchKeys, s as serializeStyles, e as extractDynamicProperties } from './utils-7bff0c78.js';
|
|
4
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
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}";
|
|
7
|
+
|
|
8
|
+
const SearchcraftBaseSearchResults = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.query = '';
|
|
12
|
+
this.searchResults = null;
|
|
13
|
+
this.searchKeys = '';
|
|
14
|
+
this.customStylesForResults = {};
|
|
15
|
+
}
|
|
16
|
+
componentDidLoad() {
|
|
17
|
+
if (!this.searchKeys || this.searchKeys.length === 0) {
|
|
18
|
+
console.warn('No searchKeys provided; using empty keys array.');
|
|
19
|
+
this.searchKeys = '';
|
|
20
|
+
}
|
|
21
|
+
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
22
|
+
this.searchResults = Object.assign({}, state.searchResults);
|
|
23
|
+
this.query = state.query;
|
|
24
|
+
});
|
|
25
|
+
const { searchResults, query } = useSearchcraftStore.getState();
|
|
26
|
+
this.searchResults = searchResults;
|
|
27
|
+
this.query = query;
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
if (this.unsubscribe) {
|
|
31
|
+
this.unsubscribe();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
36
|
+
if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
37
|
+
console.warn('No search results data available');
|
|
38
|
+
return h("div", null, "No results to display.");
|
|
39
|
+
}
|
|
40
|
+
const parsedSearchKeys = parseSearchKeys(this.searchKeys);
|
|
41
|
+
const serializedStyles = typeof this.customStylesForResults === 'string'
|
|
42
|
+
? this.customStylesForResults
|
|
43
|
+
: serializeStyles(this.customStylesForResults);
|
|
44
|
+
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 :
|
|
45
|
+
_d.map((document, index) => {
|
|
46
|
+
const { doc: result } = document;
|
|
47
|
+
const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
|
|
48
|
+
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 }));
|
|
49
|
+
}), this.query.length > 0 &&
|
|
50
|
+
((_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
|
+
}
|
|
52
|
+
};
|
|
53
|
+
SearchcraftBaseSearchResults.style = searchcraftBaseSearchResultsModuleCss;
|
|
54
|
+
|
|
55
|
+
export { SearchcraftBaseSearchResults as searchcraft_base_search_results };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=searchcraft-base-search-results.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-base-search-results.entry.esm.js","mappings":";;;;;AAAA,MAAM,qCAAqC,GAAG,kRAAkR;;MCenT,4BAA4B;;;qBACtB,EAAE;6BACkC,IAAI;0BAMpC,EAAE;sCAOsB,EAAE;;IAI/C,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,IA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E,IAAI,KAAK,EAAE,qBACtB,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,qBACpC,MAAM,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,sBACvC,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,oBAC9B,IAAI,kBACN,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,qBACnC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,qBACtC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,uBACpC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,sBACvC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,kBAEtD,iBAAiB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,mBAEnD,gBAAgB,GAC/B,EACF;aACH,CAAC,EACD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACpB,CAAA,MAAA,MAAA,MAAA,IAAI,CAAC,aAAa,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","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 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 return (\n <div class='resultsContainer'>\n {this.searchResults?.data?.hits?.map((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={`${dynamicProperties.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 {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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-button-icon.entry.esm.js","mappings":";;MAMa,qBAAqB;;;;IAChC,MAAM;QACJ,QACE,4DACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,mBAAmB,IAEnC,8DAAO,EAAE,EAAC,mBAAmB,8BAAgC,EAC7D,6DACE,CAAC,EAAC,8rBAA8rB,EAChsB,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EACN;KACH;;;;;","names":[],"sources":["src/assets/searchcraft-button-icons.tsx"],"sourcesContent":["import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-button-icon',\n shadow: true,\n})\nexport class SearchcraftButtonIcon {\n render() {\n return (\n <svg\n width='20'\n height='20'\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='button-icon-title'\n >\n <title id='button-icon-title'>Searchcraft Button Icon</title>\n <path\n d='M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z'\n stroke='white'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import { c as classNames } from './index-
|
|
1
|
+
import { r as registerInstance, a as createEvent, h, F as Fragment } from './index-be6bffea.js';
|
|
2
|
+
import { c as classNames } from './index-d6567b9c.js';
|
|
3
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
3
4
|
|
|
4
5
|
const searchcraftButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.buttonLight{border-radius:8px;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative;background-color:#000;border:1px solid #E6E6E6;color:#FFF}.buttonLight:hover{cursor:pointer}.buttonLight:hover{background-color:#2E2E2E}.buttonLight:focus{outline:2px solid #000000}.buttonDark{border-radius:8px;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative;background-color:#FFF;border:1px solid #404040;color:#292929}.buttonDark:hover{cursor:pointer}.buttonDark:hover{background-color:#FAFAFA}.buttonDark:focus{outline:2px solid #404040}.spinnerMarginRight{left:4px;margin-right:4px;position:absolute}.spinnerMarginLeft{left:4px;margin-left:4px;position:absolute}.buttonLabel{animation:right-and-back 0.2s;margin-left:4px;position:relative}@keyframes right-and-back{0%{right:-6px}50%{right:-12px}75%{right:-6px}100%{right:0px}}";
|
|
5
|
-
const SearchcraftButtonStyle0 = searchcraftButtonModuleCss;
|
|
6
6
|
|
|
7
7
|
const SearchcraftButton = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -23,10 +23,10 @@ const SearchcraftButton = class {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
const buttonStyle = this.getButtonStyle();
|
|
26
|
-
return (h(Fragment, { key: '
|
|
26
|
+
return (h(Fragment, { key: 'f10a9faa6357ef626c4e5414a5c8bdc1fe0b63a1' }, this.iconOnly ? (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.isRequesting ? (h("div", { class: 'spinner-margin-right' }, h("searchcraft-spinner-dark", null))) : (this.iconElement), h("span", { class: classNames(this.isRequesting && 'button-label', 'searchcraft-button-label') }, this.label)))));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
SearchcraftButton.style =
|
|
29
|
+
SearchcraftButton.style = searchcraftButtonModuleCss;
|
|
30
30
|
|
|
31
31
|
export { SearchcraftButton as searchcraft_button };
|
|
32
32
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-button.entry.esm.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,y/BAAy/B;;MCgB/gC,iBAAiB;;;;QAepB,gBAAW,GAAG;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB,CAAC;;wBAfiB,KAAK;4BACD,MAAM;qBACb,QAAQ;4BAIA,KAAK;qBACZ,OAAO;;IAEhB,cAAc;QACpB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,aAAa,GAAG,YAAY,CAAC;KAC9D;IAMD,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAE1C,QACE,EAAC,QAAQ,uDACN,IAAI,CAAC,QAAQ,IACZ,cACE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChB,mCAA4B,KAE5B,IAAI,CAAC,WAAW,CACjB,CACM,KAET,cACE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,YAAY,IAChD,WAAK,KAAK,EAAC,sBAAsB,IAC/B,mCAA4B,CACxB,KAEN,IAAI,CAAC,WAAW,CACjB,EACD,YACE,KAAK,EAAE,UAAU,CACf,IAAI,CAAC,YAAY,IAAI,cAAc,EACnC,0BAA0B,CAC3B,IAEA,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,EACX;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-button/searchcraft-button.module.scss?tag=searchcraft-button&encapsulation=shadow","src/components/searchcraft-button/searchcraft-button.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin button-base {\n border-radius: 8px;\n display: flex;\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n padding: 11px 20px;\n position: relative;\n\n &:hover {\n cursor: pointer;\n }\n}\n\n.buttonLight {\n @include button-base;\n background-color: $light-background;\n border: 1px solid $light-button-border;\n color: $light-button-color;\n\n &:hover {\n background-color: $light-button-hover;\n }\n\n &:focus {\n outline: 2px solid $light-button-outline-focus;\n }\n}\n\n.buttonDark {\n @include button-base;\n background-color: $dark-background;\n border: 1px solid $dark-button-border;\n color: $dark-button-color;\n\n &:hover {\n background-color: $dark-button-hover;\n }\n\n &:focus {\n outline: 2px solid $dark-button-outline-focus;\n }\n}\n\n.spinnerMarginRight {\n left: 4px;\n margin-right: 4px;\n position: absolute;\n}\n\n.spinnerMarginLeft {\n left: 4px;\n margin-left: 4px;\n position: absolute;\n}\n\n.buttonLabel {\n animation: right-and-back .2s;\n margin-left: 4px;\n position: relative;\n}\n\n@keyframes right-and-back {\n 0% { right: -6px; }\n 50% { right: -12px; }\n 75% { right: -6px; }\n 100% {right: 0px; }\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftButton {\n @Prop() iconElement?: Element;\n @Prop() iconOnly = false;\n @Prop() iconPosition = 'left';\n @Prop() label = 'Search';\n\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n @State() theme = 'light';\n\n private getButtonStyle() {\n return this.theme === 'light' ? 'buttonLight' : 'buttonDark';\n }\n\n private handleClick = () => {\n this.buttonClick.emit(); // Emit the event instead of calling a function\n };\n\n render() {\n const buttonStyle = this.getButtonStyle();\n\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.isRequesting ? (\n <searchcraft-spinner-dark />\n ) : (\n this.iconElement\n )}\n </button>\n ) : (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.isRequesting ? (\n <div class='spinner-margin-right'>\n <searchcraft-spinner-dark />\n </div>\n ) : (\n this.iconElement\n )}\n <span\n class={classNames(\n this.isRequesting && 'button-label',\n 'searchcraft-button-label',\n )}\n >\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as registerInstance, h } from './index-be6bffea.js';
|
|
2
2
|
|
|
3
|
-
const SearchcraftClearIconSet =
|
|
4
|
-
constructor() {
|
|
5
|
-
|
|
6
|
-
this.__registerHost();
|
|
7
|
-
this.__attachShadow();
|
|
3
|
+
const SearchcraftClearIconSet = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
8
6
|
this.type = 'clear-light';
|
|
9
7
|
}
|
|
10
8
|
render() {
|
|
@@ -21,24 +19,8 @@ const SearchcraftClearIconSet = /*@__PURE__*/ proxyCustomElement(class Searchcra
|
|
|
21
19
|
return null;
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
}
|
|
25
|
-
"type": [1]
|
|
26
|
-
}]);
|
|
27
|
-
function defineCustomElement() {
|
|
28
|
-
if (typeof customElements === "undefined") {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const components = ["searchcraft-clear-icon-set"];
|
|
32
|
-
components.forEach(tagName => { switch (tagName) {
|
|
33
|
-
case "searchcraft-clear-icon-set":
|
|
34
|
-
if (!customElements.get(tagName)) {
|
|
35
|
-
customElements.define(tagName, SearchcraftClearIconSet);
|
|
36
|
-
}
|
|
37
|
-
break;
|
|
38
|
-
} });
|
|
39
|
-
}
|
|
40
|
-
defineCustomElement();
|
|
22
|
+
};
|
|
41
23
|
|
|
42
|
-
export { SearchcraftClearIconSet as
|
|
24
|
+
export { SearchcraftClearIconSet as searchcraft_clear_icon_set };
|
|
43
25
|
|
|
44
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=searchcraft-clear-icon-set.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-clear-icon-set.entry.esm.js","mappings":";;MAMa,uBAAuB;;;oBAMhC,aAAa;;IAEf,MAAM;QACJ,QAAQ,IAAI,CAAC,IAAI;YACf,KAAK,aAAa;gBAChB,QACE,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY,IAE5B,aAAO,EAAE,EAAC,YAAY,yCAA2C,EACjE,YACE,CAAC,EAAC,uIAAuI,EACzI,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EACN;YACJ,KAAK,YAAY;gBACf,QACE,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY,IAE5B,aAAO,EAAE,EAAC,YAAY,wCAA0C,EAChE,YACE,CAAC,EAAC,uIAAuI,EACzI,MAAM,EAAC,OAAO,kBACD,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EACN;YACJ,KAAK,aAAa;gBAChB,QACE,WACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY,IAE5B,aAAO,EAAE,EAAC,YAAY,yCAA2C,EACjE,YACE,CAAC,EAAC,uCAAuC,EACzC,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EACN;YACJ,KAAK,YAAY;gBACf,QACE,WACE,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,qBAClB,YAAY,IAE5B,aAAO,EAAE,EAAC,YAAY,wCAA0C,EAChE,YACE,CAAC,EAAC,qBAAqB,EACvB,MAAM,EAAC,SAAS,kBACH,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,EACN;YAEJ;gBACE,OAAO,IAAI,CAAC;SACf;KACF;;;;;","names":[],"sources":["src/assets/searchcraft-clear-icon-set.tsx"],"sourcesContent":["import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-clear-icon-set',\n shadow: true,\n})\nexport class SearchcraftClearIconSet {\n /**\n * Type of the icon to display.\n * Options: 'clear-light', 'clear-dark', 'arrow-light', 'arrow-dark'\n */\n @Prop() type: 'clear-light' | 'clear-dark' | 'arrow-light' | 'arrow-dark' =\n 'clear-light';\n\n render() {\n switch (this.type) {\n case 'clear-light':\n return (\n <svg\n width='22'\n height='22'\n viewBox='0 0 22 22'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Clear Input Icon Light</title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='black'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'clear-dark':\n return (\n <svg\n width='22'\n height='22'\n viewBox='0 0 22 22'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Clear Input Icon Dark</title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='white'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'arrow-light':\n return (\n <svg\n width='20'\n height='21'\n viewBox='0 0 20 21'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Arrow Right Icon Light</title>\n <path\n d='M7.5 15.0444L12.5 10.0444L7.5 5.04443'\n stroke='#737373'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'arrow-dark':\n return (\n <svg\n width='8'\n height='12'\n viewBox='0 0 8 12'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Arrow Right Icon Dark</title>\n <path\n d='M1.5 11L6.5 6L1.5 1'\n stroke='#BFBFBF'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n\n default:\n return null;\n }\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { r as registerInstance, a as createEvent, h } from './index-be6bffea.js';
|
|
2
|
+
import { c as classNames } from './index-d6567b9c.js';
|
|
3
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
4
|
+
|
|
5
|
+
const searchcraftClearInputButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:25px;top:50%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:25px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}";
|
|
6
|
+
|
|
7
|
+
const SearchcraftClearInputButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.clearInput = createEvent(this, "clearInput", 7);
|
|
11
|
+
// Added a click handler to emit the event
|
|
12
|
+
this.handleClearClick = (event) => {
|
|
13
|
+
event.preventDefault(); // Prevent default if necessary
|
|
14
|
+
this.clearInput.emit(); // Emit the event
|
|
15
|
+
};
|
|
16
|
+
this.isRequesting = false;
|
|
17
|
+
this.rightToLeftOrientation = false;
|
|
18
|
+
this.theme = 'light';
|
|
19
|
+
}
|
|
20
|
+
isLightTheme() {
|
|
21
|
+
return this.theme === 'light';
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return this.rightToLeftOrientation ? (h("button", { class: classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (h("searchcraft-spinner-light", null)) : (h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (h("button", { class: classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (h("searchcraft-spinner-light", null)) : (h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
SearchcraftClearInputButton.style = searchcraftClearInputButtonModuleCss;
|
|
28
|
+
|
|
29
|
+
export { SearchcraftClearInputButton as searchcraft_clear_input_button };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=searchcraft-clear-input-button.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"searchcraft-clear-input-button.entry.esm.js","mappings":";;;;AAAA,MAAM,oCAAoC,GAAG,mcAAmc;;MCene,2BAA2B;;;;;QAc9B,qBAAgB,GAAG,CAAC,KAAiB;YAC3C,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;SACxB,CAAC;4BAhBsB,KAAK;sCACI,KAAK;qBAKrB,OAAO;;IAEhB,YAAY;QAClB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAQD,MAAM;QACJ,OAAO,IAAI,CAAC,sBAAsB,IAChC,cACE,KAAK,EAAE,UAAU,CAAC,qBAAqB,EAAE,4BAA4B,CAAC,EACtE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChB,IAAI,CAAC,YAAY,IACf,oCAA6B,KAE7B,mCAA4B,CAC7B,IACC,IAAI,CAAC,YAAY,IACnB,kCAA4B,IAAI,EAAC,aAAa,GAAG,KAEjD,kCAA4B,IAAI,EAAC,YAAY,GAAG,CACjD,CACM,KAET,cACE,KAAK,EAAE,UAAU,CAAC,qBAAqB,EAAE,4BAA4B,CAAC,EACtE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChB,IAAI,CAAC,YAAY,IACf,oCAA6B,KAE7B,mCAA4B,CAC7B,IACC,IAAI,CAAC,YAAY,IACnB,kCAA4B,IAAI,EAAC,aAAa,GAAG,KAEjD,kCAA4B,IAAI,EAAC,YAAY,GAAG,CACjD,CACM,CACV,CAAC;KACH;;;;;;","names":[],"sources":["src/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.scss?tag=searchcraft-clear-input-button&encapsulation=shadow","src/components/searchcraft-clear-input-button/searchcraft-clear-input-button.tsx"],"sourcesContent":[":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.inputClearButtonLTR {\n align-items: center;\n background: none;\n border: none;\n display: flex;\n height: 20px;\n justify-content: center;\n padding: 0;\n position: absolute;\n right: 25px;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n}\n\n.inputClearButtonRTL {\n align-items: center;\n background: none;\n border: none;\n display: flex;\n height: 20px;\n justify-content: center;\n left: 25px;\n padding: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-clear-input-button',\n styleUrl: 'searchcraft-clear-input-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftClearInputButton {\n @Prop() isRequesting? = false;\n @Prop() rightToLeftOrientation = false;\n\n // Updated `clearInput` to an EventEmitter\n @Event() clearInput: EventEmitter<void>;\n\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n // Added a click handler to emit the event\n private handleClearClick = (event: MouseEvent) => {\n event.preventDefault(); // Prevent default if necessary\n this.clearInput.emit(); // Emit the event\n };\n\n render() {\n return this.rightToLeftOrientation ? (\n <button\n class={classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl')}\n onClick={this.handleClearClick}\n type='button'\n >\n {this.isRequesting ? (\n this.isLightTheme ? (\n <searchcraft-spinner-light />\n ) : (\n <searchcraft-spinner-dark />\n )\n ) : this.isLightTheme ? (\n <searchcraft-clear-icon-set type='clear-light' />\n ) : (\n <searchcraft-clear-icon-set type='clear-dark' />\n )}\n </button>\n ) : (\n <button\n class={classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr')}\n onClick={this.handleClearClick}\n type='button'\n >\n {this.isRequesting ? (\n this.isLightTheme ? (\n <searchcraft-spinner-light />\n ) : (\n <searchcraft-spinner-dark />\n )\n ) : this.isLightTheme ? (\n <searchcraft-clear-icon-set type='clear-light' />\n ) : (\n <searchcraft-clear-icon-set type='clear-dark' />\n )}\n </button>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-be6bffea.js';
|
|
2
|
+
import { c as classNames } from './index-d6567b9c.js';
|
|
3
|
+
import './_commonjsHelpers-63cbe26c.js';
|
|
4
|
+
|
|
5
|
+
const searchcraftErrorMessageModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.errorMessageLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.errorMessageDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}";
|
|
6
|
+
|
|
7
|
+
const SearchcraftErrorMessage = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.errorMessage = undefined;
|
|
11
|
+
this.theme = 'light';
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
|
|
15
|
+
return (h("p", { key: '544903d700810ed5d6efdefedab646cafed2376d', class: classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
SearchcraftErrorMessage.style = searchcraftErrorMessageModuleCss;
|
|
19
|
+
|
|
20
|
+
export { SearchcraftErrorMessage as searchcraft_error_message };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=searchcraft-error-message.entry.js.map
|