@searchcraft/javascript-sdk 0.9.7 → 0.10.1
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/README.md +2 -2
- package/dist/components/defineCustomElements.js +8 -6
- package/dist/components/index.d.ts +2632 -68
- package/dist/components/index.js +51 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-e41b0f43.js → p-0077f677.js} +14 -21
- package/dist/components/p-0077f677.js.map +1 -0
- package/dist/components/p-13e81b5d.js +147 -0
- package/dist/components/p-13e81b5d.js.map +1 -0
- package/dist/components/p-172a848d.js +93 -0
- package/dist/components/p-172a848d.js.map +1 -0
- package/dist/components/{p-580c09dc.js → p-17c646e2.js} +226 -190
- package/dist/components/p-17c646e2.js.map +1 -0
- package/dist/components/{p-e55a7970.js → p-1adf78b9.js} +2 -2
- package/dist/components/p-1adf78b9.js.map +1 -0
- package/dist/components/{p-e27a0dab.js → p-2be1a382.js} +5 -7
- package/dist/components/p-2be1a382.js.map +1 -0
- package/dist/components/{p-4df578e4.js → p-3e65aa91.js} +8 -8
- package/dist/components/p-3e65aa91.js.map +1 -0
- package/dist/components/{p-8f854dec.js → p-5d17ace0.js} +14 -13
- package/dist/components/p-5d17ace0.js.map +1 -0
- package/dist/components/{p-bf6a086a.js → p-73db9122.js} +3 -10
- package/dist/components/p-73db9122.js.map +1 -0
- package/dist/components/p-810a7850.js +17 -0
- package/dist/components/p-810a7850.js.map +1 -0
- package/dist/components/p-84e2cbd6.js +46 -0
- package/dist/components/p-84e2cbd6.js.map +1 -0
- package/dist/components/{p-bb12ab5a.js → p-868803f9.js} +4 -3
- package/dist/components/p-868803f9.js.map +1 -0
- package/dist/components/{p-60f05735.js → p-a62a2e74.js} +4 -4
- package/dist/components/p-a62a2e74.js.map +1 -0
- package/dist/components/{p-5fdaf1e6.js → p-a64b4cba.js} +2 -145
- package/dist/components/p-a64b4cba.js.map +1 -0
- package/dist/components/{p-71cc28c1.js → p-acf23bab.js} +2 -2
- package/dist/components/p-acf23bab.js.map +1 -0
- package/dist/components/{p-0e393fe1.js → p-f2585cdf.js} +3 -9
- package/dist/components/p-f2585cdf.js.map +1 -0
- package/dist/components/searchcraft-ad.js +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +6 -5
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +2 -2
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-pagination.js +3 -9
- package/dist/components/searchcraft-pagination.js.map +1 -1
- package/dist/components/searchcraft-popover-button.js +95 -3
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-footer.d.ts +11 -0
- package/dist/components/searchcraft-popover-footer.js +8 -0
- package/dist/components/searchcraft-popover-footer.js.map +1 -0
- package/dist/components/searchcraft-popover-form.js +36 -27
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +12 -23
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-result.d.ts +11 -0
- package/dist/components/searchcraft-search-result.js +8 -0
- package/dist/components/searchcraft-search-result.js.map +1 -0
- package/dist/components/searchcraft-search-results-per-page.js +3 -10
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
- package/dist/components/searchcraft-search-results.d.ts +11 -0
- package/dist/components/{searchcraft-base-search-results.js → searchcraft-search-results.js} +25 -71
- package/dist/components/searchcraft-search-results.js.map +1 -0
- package/dist/components/searchcraft-select.js +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-theme.js +4 -42
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/hydrate/index.d.ts +242 -0
- package/dist/hydrate/index.js +23479 -0
- package/dist/hydrate/index.mjs +23471 -0
- package/dist/hydrate/package.json +12 -0
- package/dist/themes/hologram.css +1 -0
- package/dist/themes/hologram.css.map +1 -0
- package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +2 -0
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +3 -2
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +6 -7
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +3 -1
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +30 -1
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +23 -14
- package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +3 -2
- package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +22 -8
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +74 -0
- package/dist/types/components/searchcraft-popover-footer/searchcraft-popover-footer.d.ts +13 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +27 -15
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +5 -3
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +3 -2
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +41 -19
- package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +28 -0
- package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +81 -0
- package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +21 -5
- package/dist/types/components/searchcraft-select/searchcraft-select.d.ts +3 -5
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +3 -3
- package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +24 -16
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
- package/dist/types/components.d.ts +947 -612
- package/dist/types/index.d.ts +5 -4
- package/dist/types/store/SearchcraftStore.types.d.ts +3 -0
- package/dist/types/utils/html.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +13 -7
- package/dist/components/bundled.types.d.ts +0 -2275
- package/dist/components/p-0e393fe1.js.map +0 -1
- package/dist/components/p-19fe91f1.js +0 -136
- package/dist/components/p-19fe91f1.js.map +0 -1
- package/dist/components/p-4df578e4.js.map +0 -1
- package/dist/components/p-580c09dc.js.map +0 -1
- package/dist/components/p-5fdaf1e6.js.map +0 -1
- package/dist/components/p-60f05735.js.map +0 -1
- package/dist/components/p-71cc28c1.js.map +0 -1
- package/dist/components/p-8f854dec.js.map +0 -1
- package/dist/components/p-bb12ab5a.js.map +0 -1
- package/dist/components/p-bf6a086a.js.map +0 -1
- package/dist/components/p-d9551738.js +0 -25
- package/dist/components/p-d9551738.js.map +0 -1
- package/dist/components/p-e27a0dab.js.map +0 -1
- package/dist/components/p-e41b0f43.js.map +0 -1
- package/dist/components/p-e55a7970.js.map +0 -1
- package/dist/components/searchcraft-base-search-result.d.ts +0 -11
- 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.d.ts +0 -11
- package/dist/components/searchcraft-base-search-results.js.map +0 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +0 -55
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +0 -89
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import { AdClientResponseItem, FilterItem, PopoverResultMappings, SearchClientResponseItem, SearchcraftAdSource, SearchcraftCore,
|
|
8
|
+
import { AdClientResponseItem, FilterItem, PopoverButtonTemplate, PopoverResultMappings, ResultsInfoTemplate, SearchClientResponseItem, SearchcraftAdSource, SearchcraftCore, SearchResultTemplate, SearchResultTemplateData } from "@searchcraft/core";
|
|
9
9
|
import { SearchcraftSelectOption } from "./components/searchcraft-select/searchcraft-select";
|
|
10
|
-
export { AdClientResponseItem, FilterItem, PopoverResultMappings, SearchClientResponseItem, SearchcraftAdSource, SearchcraftCore,
|
|
10
|
+
export { AdClientResponseItem, FilterItem, PopoverButtonTemplate, PopoverResultMappings, ResultsInfoTemplate, SearchClientResponseItem, SearchcraftAdSource, SearchcraftCore, SearchResultTemplate, SearchResultTemplateData } from "@searchcraft/core";
|
|
11
11
|
export { SearchcraftSelectOption } from "./components/searchcraft-select/searchcraft-select";
|
|
12
12
|
export namespace Components {
|
|
13
13
|
/**
|
|
@@ -19,109 +19,8 @@ export namespace Components {
|
|
|
19
19
|
"adSource": SearchcraftAdSource;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* This web component
|
|
23
|
-
* Once a query is submitted, the component formats and presents the result.
|
|
24
|
-
* It is consumed within the `searchcraft-base-search-results` component.
|
|
25
|
-
*/
|
|
26
|
-
interface SearchcraftBaseSearchResult {
|
|
27
|
-
/**
|
|
28
|
-
* The relationship between the current document and the link for the button rendered when containerHref is not present.
|
|
29
|
-
*/
|
|
30
|
-
"buttonRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
31
|
-
/**
|
|
32
|
-
* Where to open the link for the button rendered when containerHref is not present.
|
|
33
|
-
*/
|
|
34
|
-
"buttonTarget": '_blank' | '_self' | '_top' | '_parent';
|
|
35
|
-
/**
|
|
36
|
-
* The relationship between the current document and the link for the containing element.
|
|
37
|
-
*/
|
|
38
|
-
"containerRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
39
|
-
/**
|
|
40
|
-
* Where to open the link for the containing element.
|
|
41
|
-
*/
|
|
42
|
-
"containerTarget": '_blank' | '_self' | '_top' | '_parent';
|
|
43
|
-
/**
|
|
44
|
-
* A custom styles object.
|
|
45
|
-
*/
|
|
46
|
-
"customStyles"?: string;
|
|
47
|
-
/**
|
|
48
|
-
* The position in the document. Used with the "document_clicked" measure event.
|
|
49
|
-
*/
|
|
50
|
-
"documentPosition": number;
|
|
51
|
-
/**
|
|
52
|
-
* The placement of the image.
|
|
53
|
-
*/
|
|
54
|
-
"imagePlacement": 'left' | 'right';
|
|
55
|
-
"item"?: SearchClientResponseItem;
|
|
56
|
-
"searchResultMappings"?: SearchResultMappings;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* This web component is responsible for displaying the results of a search query.
|
|
60
|
-
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
61
|
-
* ## Usage
|
|
62
|
-
* ```html
|
|
63
|
-
* <!-- index.html -->
|
|
64
|
-
* <searchcraft-base-search-results
|
|
65
|
-
* ad-interval="4"
|
|
66
|
-
* place-ad-at-start="false"
|
|
67
|
-
* result-image-placement="right"
|
|
68
|
-
* />
|
|
69
|
-
* ```
|
|
70
|
-
* ```js
|
|
71
|
-
* // index.js
|
|
72
|
-
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
73
|
-
* baseSearchResults.searchResultMappings = containerHref: {
|
|
74
|
-
* fieldNames: [
|
|
75
|
-
* {
|
|
76
|
-
* fieldName: 'canonical_link',
|
|
77
|
-
* dataType: 'text',
|
|
78
|
-
* },
|
|
79
|
-
* ],
|
|
80
|
-
* };
|
|
81
|
-
* baseSearchResults.addEventListener('noResults', () => {
|
|
82
|
-
* console.log('No search results found');
|
|
83
|
-
* });
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
interface SearchcraftBaseSearchResults {
|
|
87
|
-
/**
|
|
88
|
-
* The label for the button rendered when containerHref is not present for each result.
|
|
89
|
-
*/
|
|
90
|
-
"buttonLabel"?: string;
|
|
91
|
-
/**
|
|
92
|
-
* The relationship between the current document and the link for the button rendered when containerHref is not present for each result.
|
|
93
|
-
*/
|
|
94
|
-
"buttonRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
95
|
-
/**
|
|
96
|
-
* Where to open the link for the button rendered when containerHref is not present for each result.
|
|
97
|
-
*/
|
|
98
|
-
"buttonTarget": '_blank' | '_self' | '_top' | '_parent';
|
|
99
|
-
/**
|
|
100
|
-
* The relationship between the current document and the link for the containing element for each result.
|
|
101
|
-
*/
|
|
102
|
-
"containerRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
103
|
-
/**
|
|
104
|
-
* Where to open the link for the containing element for each result.
|
|
105
|
-
*/
|
|
106
|
-
"containerTarget": '_blank' | '_self' | '_top' | '_parent';
|
|
107
|
-
/**
|
|
108
|
-
* A custom styles object.
|
|
109
|
-
*/
|
|
110
|
-
"customStylesForResults"?: | string
|
|
111
|
-
| Record<string, Record<string, string>>;
|
|
112
|
-
/**
|
|
113
|
-
* The placement of the image for each result.
|
|
114
|
-
*/
|
|
115
|
-
"resultImagePlacement": 'left' | 'right';
|
|
116
|
-
/**
|
|
117
|
-
* Formats the content rendered for each result.
|
|
118
|
-
*/
|
|
119
|
-
"searchResultMappings"?: SearchResultMappings;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
22
|
+
* This web component represents a button.
|
|
123
23
|
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
124
|
-
* It is consumed within the `searchcraft-input-form` component.
|
|
125
24
|
*/
|
|
126
25
|
interface SearchcraftButton {
|
|
127
26
|
/**
|
|
@@ -155,23 +54,18 @@ export namespace Components {
|
|
|
155
54
|
}
|
|
156
55
|
/**
|
|
157
56
|
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
57
|
+
* @js-example ```html
|
|
58
|
+
* <searchcraft-error-message>
|
|
59
|
+
* No search results found for query
|
|
60
|
+
* </searchcraft-error-message>
|
|
162
61
|
* ```
|
|
163
62
|
*/
|
|
164
63
|
interface SearchcraftErrorMessage {
|
|
165
|
-
/**
|
|
166
|
-
* The error message.
|
|
167
|
-
*/
|
|
168
|
-
"errorMessage"?: string;
|
|
169
64
|
}
|
|
170
65
|
/**
|
|
171
66
|
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
172
67
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
173
|
-
*
|
|
174
|
-
* ```html
|
|
68
|
+
* @js-example ```html
|
|
175
69
|
* <!-- index.html -->
|
|
176
70
|
* <searchcraft-facet-list field-name="title" />
|
|
177
71
|
* ```
|
|
@@ -191,11 +85,29 @@ export namespace Components {
|
|
|
191
85
|
}
|
|
192
86
|
/**
|
|
193
87
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
194
|
-
*
|
|
195
|
-
*
|
|
88
|
+
* @react-import ```jsx
|
|
89
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
90
|
+
* ```
|
|
91
|
+
* @vue-import ```jsx
|
|
92
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
93
|
+
* ```
|
|
94
|
+
* @js-example ```html
|
|
196
95
|
* <!-- index.html -->
|
|
197
96
|
* <searchcraft-filter-panel />
|
|
198
97
|
* ```
|
|
98
|
+
* ```js
|
|
99
|
+
* // index.js
|
|
100
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
101
|
+
* if (filterPanel) {
|
|
102
|
+
* filterPanel.items = [];
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
* @react-example ```jsx
|
|
106
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
107
|
+
* ```
|
|
108
|
+
* @vue-example ```jsx
|
|
109
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
110
|
+
* ```
|
|
199
111
|
*/
|
|
200
112
|
interface SearchcraftFilterPanel {
|
|
201
113
|
/**
|
|
@@ -206,21 +118,27 @@ export namespace Components {
|
|
|
206
118
|
/**
|
|
207
119
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
208
120
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* <!-- index.html -->
|
|
212
|
-
* <searchcraft-input-form placeholder-value="Search here" />
|
|
121
|
+
* @react-import ```jsx
|
|
122
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
213
123
|
* ```
|
|
214
|
-
* ```
|
|
215
|
-
*
|
|
216
|
-
*
|
|
124
|
+
* @vue-import ```jsx
|
|
125
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
126
|
+
* ```
|
|
127
|
+
* @js-example ```html
|
|
128
|
+
* <searchcraft-input-form auto-search />
|
|
129
|
+
* ```
|
|
130
|
+
* @react-example ```jsx
|
|
131
|
+
* <SearchcraftInputForm autoSearch />
|
|
132
|
+
* ```
|
|
133
|
+
* @vue-example ```jsx
|
|
134
|
+
* <SearchcraftInputForm autoSearch />
|
|
217
135
|
* ```
|
|
218
136
|
*/
|
|
219
137
|
interface SearchcraftInputForm {
|
|
220
138
|
/**
|
|
221
139
|
* Whether or not to automatically submit the search term when the input changes.
|
|
222
140
|
*/
|
|
223
|
-
"autoSearch"
|
|
141
|
+
"autoSearch"?: boolean;
|
|
224
142
|
/**
|
|
225
143
|
* The label for the submit button.
|
|
226
144
|
*/
|
|
@@ -228,12 +146,8 @@ export namespace Components {
|
|
|
228
146
|
/**
|
|
229
147
|
* Where to place the search button.
|
|
230
148
|
*/
|
|
231
|
-
"buttonPlacement"
|
|
149
|
+
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
232
150
|
"core"?: SearchcraftCore;
|
|
233
|
-
/**
|
|
234
|
-
* A custom styles object to be applied to the input element.
|
|
235
|
-
*/
|
|
236
|
-
"customStyles": string | Record<string, string>;
|
|
237
151
|
/**
|
|
238
152
|
* The label rendered above the input.
|
|
239
153
|
*/
|
|
@@ -241,13 +155,11 @@ export namespace Components {
|
|
|
241
155
|
/**
|
|
242
156
|
* The input element's placeholder value.
|
|
243
157
|
*/
|
|
244
|
-
"placeholderValue"
|
|
158
|
+
"placeholderValue"?: string;
|
|
245
159
|
}
|
|
246
160
|
/**
|
|
247
161
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
248
|
-
*
|
|
249
|
-
* ```html
|
|
250
|
-
* <!-- index.html -->
|
|
162
|
+
* @js-example ```html
|
|
251
163
|
* <searchcraft-input-label label="Search" />
|
|
252
164
|
* ```
|
|
253
165
|
*/
|
|
@@ -259,63 +171,121 @@ export namespace Components {
|
|
|
259
171
|
"label": string;
|
|
260
172
|
}
|
|
261
173
|
/**
|
|
262
|
-
* This web component is designed to facilitate pagination of search results.
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
* ```
|
|
266
|
-
*
|
|
174
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
175
|
+
* @react-import ```jsx
|
|
176
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
177
|
+
* ```
|
|
178
|
+
* @vue-import ```jsx
|
|
179
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
180
|
+
* ```
|
|
181
|
+
* @js-example ```html
|
|
267
182
|
* <searchcraft-pagination />
|
|
268
183
|
* ```
|
|
184
|
+
* @react-example ```jsx
|
|
185
|
+
* <SearchcraftPagination />
|
|
186
|
+
* ```
|
|
187
|
+
* @vue-example ```jsx
|
|
188
|
+
* <SearchcraftPagination />
|
|
189
|
+
* ```
|
|
269
190
|
*/
|
|
270
191
|
interface SearchcraftPagination {
|
|
271
|
-
/**
|
|
272
|
-
* The custom styles object.
|
|
273
|
-
*/
|
|
274
|
-
"customStyles"?: string;
|
|
275
192
|
}
|
|
276
193
|
/**
|
|
277
194
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
195
|
+
* @react-import ```jsx
|
|
196
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
197
|
+
* ````
|
|
198
|
+
* @vue-import ```jsx
|
|
199
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
200
|
+
* ```
|
|
201
|
+
* @js-example ```html
|
|
202
|
+
* <!-- index.html -->
|
|
203
|
+
* <searchcraft-popover-button>
|
|
204
|
+
* Open popover
|
|
205
|
+
* </searchcraft-popover-button>
|
|
206
|
+
* ```
|
|
207
|
+
* ```js
|
|
208
|
+
* // index.js
|
|
209
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
210
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
211
|
+
* <span>Click me</span>
|
|
212
|
+
* `;
|
|
213
|
+
* ```
|
|
214
|
+
* @react-example ```jsx
|
|
215
|
+
* <SearchcraftPopoverButton
|
|
216
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
217
|
+
* <span>Click me</span>
|
|
218
|
+
* `}
|
|
219
|
+
* >
|
|
220
|
+
* Open popover
|
|
221
|
+
* </SearchcraftPopoverButton>
|
|
222
|
+
* ```
|
|
223
|
+
* @vue-example ```jsx
|
|
224
|
+
* <SearchcraftPopoverButton
|
|
225
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
226
|
+
* <span>Click me</span>
|
|
227
|
+
* `}
|
|
228
|
+
* >
|
|
229
|
+
* Open popover
|
|
230
|
+
* </SearchcraftPopoverButton>
|
|
231
|
+
* ```
|
|
278
232
|
*/
|
|
279
233
|
interface SearchcraftPopoverButton {
|
|
234
|
+
/**
|
|
235
|
+
* A callback function responsible for rendering the button contents.
|
|
236
|
+
*/
|
|
237
|
+
"template"?: PopoverButtonTemplate;
|
|
238
|
+
/**
|
|
239
|
+
* The type of popover button to render.
|
|
240
|
+
*/
|
|
241
|
+
"type"?: 'skeuomorphic';
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
245
|
+
*/
|
|
246
|
+
interface SearchcraftPopoverFooter {
|
|
280
247
|
}
|
|
281
248
|
/**
|
|
282
249
|
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
283
|
-
*
|
|
284
|
-
*
|
|
250
|
+
* @react-import ```jsx
|
|
251
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
252
|
+
* ```
|
|
253
|
+
* @vue-import ```jsx
|
|
254
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
255
|
+
* ```
|
|
256
|
+
* @js-example ```html
|
|
285
257
|
* <!-- index.html -->
|
|
286
|
-
* <searchcraft-popover-form type="
|
|
258
|
+
* <searchcraft-popover-form type="inline" />
|
|
287
259
|
* ```
|
|
288
260
|
* ```js
|
|
289
261
|
* // index.js
|
|
290
262
|
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
291
|
-
* popoverForm.popoverResultMappings = {
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
* ],
|
|
299
|
-
* };
|
|
263
|
+
* popoverForm.popoverResultMappings = {};
|
|
264
|
+
* ```
|
|
265
|
+
* @react-example ```jsx
|
|
266
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
267
|
+
* ```
|
|
268
|
+
* @vue-example ```jsx
|
|
269
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
300
270
|
* ```
|
|
301
271
|
*/
|
|
302
272
|
interface SearchcraftPopoverForm {
|
|
303
273
|
/**
|
|
304
274
|
* The hotkey that activates the popover.
|
|
305
275
|
*/
|
|
306
|
-
"hotkey"
|
|
276
|
+
"hotkey"?: string;
|
|
307
277
|
/**
|
|
308
278
|
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
309
279
|
*/
|
|
310
|
-
"hotkeyModifier"
|
|
280
|
+
"hotkeyModifier"?: 'ctrl' | 'meta' | 'alt' | 'option';
|
|
311
281
|
/**
|
|
312
282
|
* Formats the content rendered for each result.
|
|
313
283
|
*/
|
|
314
284
|
"popoverResultMappings"?: PopoverResultMappings;
|
|
315
285
|
/**
|
|
316
|
-
* The type of popover form to render.
|
|
286
|
+
* The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
|
|
317
287
|
*/
|
|
318
|
-
"type"
|
|
288
|
+
"type"?: 'inline' | 'fullscreen' | 'modal';
|
|
319
289
|
}
|
|
320
290
|
/**
|
|
321
291
|
* A single list item rendered in a searchcraft-popover-list-view.
|
|
@@ -331,9 +301,7 @@ export namespace Components {
|
|
|
331
301
|
/**
|
|
332
302
|
* This web component is designed to display a list of results within a popover interface.
|
|
333
303
|
* It is consumed within the `searchcraft-popover-form` component.
|
|
334
|
-
*
|
|
335
|
-
* ```html
|
|
336
|
-
* <!-- index.html -->
|
|
304
|
+
* @js-example ```html
|
|
337
305
|
* <searchcraft-popover-list-view />
|
|
338
306
|
* ```
|
|
339
307
|
*/
|
|
@@ -352,45 +320,129 @@ export namespace Components {
|
|
|
352
320
|
}
|
|
353
321
|
/**
|
|
354
322
|
* This web component is designed to display the number of results returned from a search query.
|
|
355
|
-
*
|
|
356
|
-
*
|
|
323
|
+
* @react-import ```jsx
|
|
324
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
325
|
+
* ```
|
|
326
|
+
* @vue-import ```jsx
|
|
327
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
328
|
+
* ```
|
|
329
|
+
* @js-example ```html
|
|
357
330
|
* <!-- index.html -->
|
|
358
|
-
* <script>
|
|
359
|
-
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
360
|
-
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
361
|
-
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
362
|
-
* </script>
|
|
363
331
|
* <searchcraft-results-info />
|
|
364
332
|
* ```
|
|
333
|
+
* ```js
|
|
334
|
+
* // index.js
|
|
335
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
336
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
337
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
338
|
+
* `;
|
|
339
|
+
* ```
|
|
340
|
+
* @react-example ```jsx
|
|
341
|
+
* <SearchcraftResultsInfo
|
|
342
|
+
* template={(info, { html }) => html`
|
|
343
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
344
|
+
* `}
|
|
345
|
+
* />
|
|
346
|
+
* ```
|
|
347
|
+
* @vue-example ```jsx
|
|
348
|
+
* <SearchcraftResultsInfo
|
|
349
|
+
* :template={(info, { html }) => html`
|
|
350
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
351
|
+
* `}
|
|
352
|
+
* />
|
|
353
|
+
* ```
|
|
365
354
|
*/
|
|
366
355
|
interface SearchcraftResultsInfo {
|
|
367
356
|
/**
|
|
368
|
-
*
|
|
369
|
-
* @example ```ts resultsInfo.customFormatter = (range, count, responseTime) => `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`; ```
|
|
357
|
+
* A callback function responsible for rendering the results info.
|
|
370
358
|
*/
|
|
371
|
-
"
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
359
|
+
"template"?: ResultsInfoTemplate;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
363
|
+
*/
|
|
364
|
+
interface SearchcraftSearchResult {
|
|
365
|
+
/**
|
|
366
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
367
|
+
*/
|
|
368
|
+
"documentPosition": number;
|
|
369
|
+
/**
|
|
370
|
+
* The index.
|
|
371
|
+
*/
|
|
372
|
+
"index": number;
|
|
373
|
+
"item"?: SearchClientResponseItem;
|
|
376
374
|
/**
|
|
377
|
-
*
|
|
375
|
+
* A callback function responsible for rendering a result.
|
|
378
376
|
*/
|
|
379
|
-
"
|
|
377
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
381
|
+
* @react-import ```jsx
|
|
382
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
383
|
+
* ```
|
|
384
|
+
* @vue-import ```jsx
|
|
385
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
386
|
+
* ```
|
|
387
|
+
* @js-example ```html
|
|
388
|
+
* <!-- index.html -->
|
|
389
|
+
* <searchcraft-search-results
|
|
390
|
+
* ad-interval="4"
|
|
391
|
+
* place-ad-at-start="true"
|
|
392
|
+
* />
|
|
393
|
+
* ```
|
|
394
|
+
* ```js
|
|
395
|
+
* // index.js
|
|
396
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
397
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
398
|
+
* <h2>${item.title}</h2>
|
|
399
|
+
* `;
|
|
400
|
+
* ```
|
|
401
|
+
* @react-example ```jsx
|
|
402
|
+
* <SearchcraftSearchResults
|
|
403
|
+
* adInterval={4}
|
|
404
|
+
* placeAdAtState={true}
|
|
405
|
+
* template={(item, index, { html }) => html`
|
|
406
|
+
* <h2>${item.title}</h2>
|
|
407
|
+
* `}
|
|
408
|
+
* />
|
|
409
|
+
* ```
|
|
410
|
+
* @vue-example ```jsx
|
|
411
|
+
* <SearchcraftSearchResults
|
|
412
|
+
* adInterval={4}
|
|
413
|
+
* placeAdAtState={true}
|
|
414
|
+
* :template={(item, index, { html }) => html`
|
|
415
|
+
* <h2>${item.title}</h2>
|
|
416
|
+
* `}
|
|
417
|
+
* />
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
interface SearchcraftSearchResults {
|
|
421
|
+
/**
|
|
422
|
+
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
423
|
+
*/
|
|
424
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
380
425
|
}
|
|
381
426
|
/**
|
|
382
427
|
* This web component is designed to choose the number of search results displayed.
|
|
383
|
-
*
|
|
384
|
-
*
|
|
428
|
+
* @react-import ```jsx
|
|
429
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
430
|
+
* ```
|
|
431
|
+
* @vue-import ```jsx
|
|
432
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
433
|
+
* ```
|
|
434
|
+
* @js-example ```html
|
|
385
435
|
* <!-- index.html -->
|
|
386
436
|
* <searchcraft-search-results-per-page increment="20" />
|
|
387
437
|
* ```
|
|
438
|
+
* @react-example ```jsx
|
|
439
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
440
|
+
* ```
|
|
441
|
+
* @vue-example ```jsx
|
|
442
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
443
|
+
* ```
|
|
388
444
|
*/
|
|
389
445
|
interface SearchcraftSearchResultsPerPage {
|
|
390
|
-
/**
|
|
391
|
-
* The custom styles object.
|
|
392
|
-
*/
|
|
393
|
-
"customStyles"?: string;
|
|
394
446
|
/**
|
|
395
447
|
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
396
448
|
*/
|
|
@@ -398,8 +450,7 @@ export namespace Components {
|
|
|
398
450
|
}
|
|
399
451
|
/**
|
|
400
452
|
* This web component is designed to allow users to select between a group of options.
|
|
401
|
-
*
|
|
402
|
-
* ```html
|
|
453
|
+
* @js-example ```html
|
|
403
454
|
* <!-- index.html -->
|
|
404
455
|
* <searchcraft-select
|
|
405
456
|
* inputId="searchcraft-select"
|
|
@@ -413,10 +464,6 @@ export namespace Components {
|
|
|
413
464
|
* The caption displayed below the select input.
|
|
414
465
|
*/
|
|
415
466
|
"caption"?: string;
|
|
416
|
-
/**
|
|
417
|
-
* A custom styles object.
|
|
418
|
-
*/
|
|
419
|
-
"customStyles"?: string;
|
|
420
467
|
/**
|
|
421
468
|
* Whether the select input is disabled.
|
|
422
469
|
*/
|
|
@@ -443,9 +490,7 @@ export namespace Components {
|
|
|
443
490
|
"options": SearchcraftSelectOption[] | string;
|
|
444
491
|
}
|
|
445
492
|
/**
|
|
446
|
-
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
447
|
-
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
448
|
-
* It is consumed by the `searchcraft-filter-panel` component.
|
|
493
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
449
494
|
*/
|
|
450
495
|
interface SearchcraftSlider {
|
|
451
496
|
/**
|
|
@@ -466,27 +511,27 @@ export namespace Components {
|
|
|
466
511
|
"min": number;
|
|
467
512
|
}
|
|
468
513
|
/**
|
|
469
|
-
* This web component adds Searchcraft's built-in css theme to your page
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
* ```
|
|
473
|
-
*
|
|
474
|
-
*
|
|
514
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
515
|
+
* @react-import ```jsx
|
|
516
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
517
|
+
* ```
|
|
518
|
+
* @vue-import ```jsx
|
|
519
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
520
|
+
* ```
|
|
521
|
+
* @js-example ```html
|
|
522
|
+
* <searchcraft-theme />
|
|
523
|
+
* ```
|
|
524
|
+
* @react-example ```jsx
|
|
525
|
+
* <SearchcraftTheme />
|
|
526
|
+
* ```
|
|
527
|
+
* @vue-example ```jsx
|
|
528
|
+
* <SearchcraftTheme />
|
|
475
529
|
* ```
|
|
476
530
|
*/
|
|
477
531
|
interface SearchcraftTheme {
|
|
478
|
-
/**
|
|
479
|
-
* The custom theme configuration object.
|
|
480
|
-
*/
|
|
481
|
-
"customTheme"?: string;
|
|
482
|
-
/**
|
|
483
|
-
* The name of the theme.
|
|
484
|
-
*/
|
|
485
|
-
"theme"?: string;
|
|
486
532
|
}
|
|
487
533
|
/**
|
|
488
534
|
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
489
|
-
* It is consumed within the `searchcraft-filter-panel` component.
|
|
490
535
|
*/
|
|
491
536
|
interface SearchcraftToggleButton {
|
|
492
537
|
/**
|
|
@@ -533,58 +578,12 @@ declare global {
|
|
|
533
578
|
prototype: HTMLSearchcraftAdElement;
|
|
534
579
|
new (): HTMLSearchcraftAdElement;
|
|
535
580
|
};
|
|
536
|
-
/**
|
|
537
|
-
* This web component is designed to display detailed information for a single search result.
|
|
538
|
-
* Once a query is submitted, the component formats and presents the result.
|
|
539
|
-
* It is consumed within the `searchcraft-base-search-results` component.
|
|
540
|
-
*/
|
|
541
|
-
interface HTMLSearchcraftBaseSearchResultElement extends Components.SearchcraftBaseSearchResult, HTMLStencilElement {
|
|
542
|
-
}
|
|
543
|
-
var HTMLSearchcraftBaseSearchResultElement: {
|
|
544
|
-
prototype: HTMLSearchcraftBaseSearchResultElement;
|
|
545
|
-
new (): HTMLSearchcraftBaseSearchResultElement;
|
|
546
|
-
};
|
|
547
|
-
/**
|
|
548
|
-
* This web component is responsible for displaying the results of a search query.
|
|
549
|
-
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
550
|
-
* ## Usage
|
|
551
|
-
* ```html
|
|
552
|
-
* <!-- index.html -->
|
|
553
|
-
* <searchcraft-base-search-results
|
|
554
|
-
* ad-interval="4"
|
|
555
|
-
* place-ad-at-start="false"
|
|
556
|
-
* result-image-placement="right"
|
|
557
|
-
* />
|
|
558
|
-
* ```
|
|
559
|
-
* ```js
|
|
560
|
-
* // index.js
|
|
561
|
-
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
562
|
-
* baseSearchResults.searchResultMappings = containerHref: {
|
|
563
|
-
* fieldNames: [
|
|
564
|
-
* {
|
|
565
|
-
* fieldName: 'canonical_link',
|
|
566
|
-
* dataType: 'text',
|
|
567
|
-
* },
|
|
568
|
-
* ],
|
|
569
|
-
* };
|
|
570
|
-
* baseSearchResults.addEventListener('noResults', () => {
|
|
571
|
-
* console.log('No search results found');
|
|
572
|
-
* });
|
|
573
|
-
* ```
|
|
574
|
-
*/
|
|
575
|
-
interface HTMLSearchcraftBaseSearchResultsElement extends Components.SearchcraftBaseSearchResults, HTMLStencilElement {
|
|
576
|
-
}
|
|
577
|
-
var HTMLSearchcraftBaseSearchResultsElement: {
|
|
578
|
-
prototype: HTMLSearchcraftBaseSearchResultsElement;
|
|
579
|
-
new (): HTMLSearchcraftBaseSearchResultsElement;
|
|
580
|
-
};
|
|
581
581
|
interface HTMLSearchcraftButtonElementEventMap {
|
|
582
582
|
"buttonClick": void;
|
|
583
583
|
}
|
|
584
584
|
/**
|
|
585
|
-
* This web component represents a button
|
|
585
|
+
* This web component represents a button.
|
|
586
586
|
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
587
|
-
* It is consumed within the `searchcraft-input-form` component.
|
|
588
587
|
*/
|
|
589
588
|
interface HTMLSearchcraftButtonElement extends Components.SearchcraftButton, HTMLStencilElement {
|
|
590
589
|
addEventListener<K extends keyof HTMLSearchcraftButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftButtonElement, ev: SearchcraftButtonCustomEvent<HTMLSearchcraftButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -602,10 +601,10 @@ declare global {
|
|
|
602
601
|
};
|
|
603
602
|
/**
|
|
604
603
|
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
604
|
+
* @js-example ```html
|
|
605
|
+
* <searchcraft-error-message>
|
|
606
|
+
* No search results found for query
|
|
607
|
+
* </searchcraft-error-message>
|
|
609
608
|
* ```
|
|
610
609
|
*/
|
|
611
610
|
interface HTMLSearchcraftErrorMessageElement extends Components.SearchcraftErrorMessage, HTMLStencilElement {
|
|
@@ -620,8 +619,7 @@ declare global {
|
|
|
620
619
|
/**
|
|
621
620
|
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
622
621
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
623
|
-
*
|
|
624
|
-
* ```html
|
|
622
|
+
* @js-example ```html
|
|
625
623
|
* <!-- index.html -->
|
|
626
624
|
* <searchcraft-facet-list field-name="title" />
|
|
627
625
|
* ```
|
|
@@ -649,11 +647,29 @@ declare global {
|
|
|
649
647
|
};
|
|
650
648
|
/**
|
|
651
649
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
652
|
-
*
|
|
653
|
-
*
|
|
650
|
+
* @react-import ```jsx
|
|
651
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
652
|
+
* ```
|
|
653
|
+
* @vue-import ```jsx
|
|
654
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
655
|
+
* ```
|
|
656
|
+
* @js-example ```html
|
|
654
657
|
* <!-- index.html -->
|
|
655
658
|
* <searchcraft-filter-panel />
|
|
656
659
|
* ```
|
|
660
|
+
* ```js
|
|
661
|
+
* // index.js
|
|
662
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
663
|
+
* if (filterPanel) {
|
|
664
|
+
* filterPanel.items = [];
|
|
665
|
+
* }
|
|
666
|
+
* ```
|
|
667
|
+
* @react-example ```jsx
|
|
668
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
669
|
+
* ```
|
|
670
|
+
* @vue-example ```jsx
|
|
671
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
672
|
+
* ```
|
|
657
673
|
*/
|
|
658
674
|
interface HTMLSearchcraftFilterPanelElement extends Components.SearchcraftFilterPanel, HTMLStencilElement {
|
|
659
675
|
}
|
|
@@ -669,14 +685,20 @@ declare global {
|
|
|
669
685
|
/**
|
|
670
686
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
671
687
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* <!-- index.html -->
|
|
675
|
-
* <searchcraft-input-form placeholder-value="Search here" />
|
|
688
|
+
* @react-import ```jsx
|
|
689
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
676
690
|
* ```
|
|
677
|
-
* ```
|
|
678
|
-
*
|
|
679
|
-
*
|
|
691
|
+
* @vue-import ```jsx
|
|
692
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
693
|
+
* ```
|
|
694
|
+
* @js-example ```html
|
|
695
|
+
* <searchcraft-input-form auto-search />
|
|
696
|
+
* ```
|
|
697
|
+
* @react-example ```jsx
|
|
698
|
+
* <SearchcraftInputForm autoSearch />
|
|
699
|
+
* ```
|
|
700
|
+
* @vue-example ```jsx
|
|
701
|
+
* <SearchcraftInputForm autoSearch />
|
|
680
702
|
* ```
|
|
681
703
|
*/
|
|
682
704
|
interface HTMLSearchcraftInputFormElement extends Components.SearchcraftInputForm, HTMLStencilElement {
|
|
@@ -695,9 +717,7 @@ declare global {
|
|
|
695
717
|
};
|
|
696
718
|
/**
|
|
697
719
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
698
|
-
*
|
|
699
|
-
* ```html
|
|
700
|
-
* <!-- index.html -->
|
|
720
|
+
* @js-example ```html
|
|
701
721
|
* <searchcraft-input-label label="Search" />
|
|
702
722
|
* ```
|
|
703
723
|
*/
|
|
@@ -708,13 +728,22 @@ declare global {
|
|
|
708
728
|
new (): HTMLSearchcraftInputLabelElement;
|
|
709
729
|
};
|
|
710
730
|
/**
|
|
711
|
-
* This web component is designed to facilitate pagination of search results.
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
* ```
|
|
715
|
-
*
|
|
731
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
732
|
+
* @react-import ```jsx
|
|
733
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
734
|
+
* ```
|
|
735
|
+
* @vue-import ```jsx
|
|
736
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
737
|
+
* ```
|
|
738
|
+
* @js-example ```html
|
|
716
739
|
* <searchcraft-pagination />
|
|
717
740
|
* ```
|
|
741
|
+
* @react-example ```jsx
|
|
742
|
+
* <SearchcraftPagination />
|
|
743
|
+
* ```
|
|
744
|
+
* @vue-example ```jsx
|
|
745
|
+
* <SearchcraftPagination />
|
|
746
|
+
* ```
|
|
718
747
|
*/
|
|
719
748
|
interface HTMLSearchcraftPaginationElement extends Components.SearchcraftPagination, HTMLStencilElement {
|
|
720
749
|
}
|
|
@@ -724,6 +753,43 @@ declare global {
|
|
|
724
753
|
};
|
|
725
754
|
/**
|
|
726
755
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
756
|
+
* @react-import ```jsx
|
|
757
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
758
|
+
* ````
|
|
759
|
+
* @vue-import ```jsx
|
|
760
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
761
|
+
* ```
|
|
762
|
+
* @js-example ```html
|
|
763
|
+
* <!-- index.html -->
|
|
764
|
+
* <searchcraft-popover-button>
|
|
765
|
+
* Open popover
|
|
766
|
+
* </searchcraft-popover-button>
|
|
767
|
+
* ```
|
|
768
|
+
* ```js
|
|
769
|
+
* // index.js
|
|
770
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
771
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
772
|
+
* <span>Click me</span>
|
|
773
|
+
* `;
|
|
774
|
+
* ```
|
|
775
|
+
* @react-example ```jsx
|
|
776
|
+
* <SearchcraftPopoverButton
|
|
777
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
778
|
+
* <span>Click me</span>
|
|
779
|
+
* `}
|
|
780
|
+
* >
|
|
781
|
+
* Open popover
|
|
782
|
+
* </SearchcraftPopoverButton>
|
|
783
|
+
* ```
|
|
784
|
+
* @vue-example ```jsx
|
|
785
|
+
* <SearchcraftPopoverButton
|
|
786
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
787
|
+
* <span>Click me</span>
|
|
788
|
+
* `}
|
|
789
|
+
* >
|
|
790
|
+
* Open popover
|
|
791
|
+
* </SearchcraftPopoverButton>
|
|
792
|
+
* ```
|
|
727
793
|
*/
|
|
728
794
|
interface HTMLSearchcraftPopoverButtonElement extends Components.SearchcraftPopoverButton, HTMLStencilElement {
|
|
729
795
|
}
|
|
@@ -731,25 +797,37 @@ declare global {
|
|
|
731
797
|
prototype: HTMLSearchcraftPopoverButtonElement;
|
|
732
798
|
new (): HTMLSearchcraftPopoverButtonElement;
|
|
733
799
|
};
|
|
800
|
+
/**
|
|
801
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
802
|
+
*/
|
|
803
|
+
interface HTMLSearchcraftPopoverFooterElement extends Components.SearchcraftPopoverFooter, HTMLStencilElement {
|
|
804
|
+
}
|
|
805
|
+
var HTMLSearchcraftPopoverFooterElement: {
|
|
806
|
+
prototype: HTMLSearchcraftPopoverFooterElement;
|
|
807
|
+
new (): HTMLSearchcraftPopoverFooterElement;
|
|
808
|
+
};
|
|
734
809
|
/**
|
|
735
810
|
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
736
|
-
*
|
|
737
|
-
*
|
|
811
|
+
* @react-import ```jsx
|
|
812
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
813
|
+
* ```
|
|
814
|
+
* @vue-import ```jsx
|
|
815
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
816
|
+
* ```
|
|
817
|
+
* @js-example ```html
|
|
738
818
|
* <!-- index.html -->
|
|
739
|
-
* <searchcraft-popover-form type="
|
|
819
|
+
* <searchcraft-popover-form type="inline" />
|
|
740
820
|
* ```
|
|
741
821
|
* ```js
|
|
742
822
|
* // index.js
|
|
743
823
|
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
744
|
-
* popoverForm.popoverResultMappings = {
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
* ],
|
|
752
|
-
* };
|
|
824
|
+
* popoverForm.popoverResultMappings = {};
|
|
825
|
+
* ```
|
|
826
|
+
* @react-example ```jsx
|
|
827
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
828
|
+
* ```
|
|
829
|
+
* @vue-example ```jsx
|
|
830
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
753
831
|
* ```
|
|
754
832
|
*/
|
|
755
833
|
interface HTMLSearchcraftPopoverFormElement extends Components.SearchcraftPopoverForm, HTMLStencilElement {
|
|
@@ -770,9 +848,7 @@ declare global {
|
|
|
770
848
|
/**
|
|
771
849
|
* This web component is designed to display a list of results within a popover interface.
|
|
772
850
|
* It is consumed within the `searchcraft-popover-form` component.
|
|
773
|
-
*
|
|
774
|
-
* ```html
|
|
775
|
-
* <!-- index.html -->
|
|
851
|
+
* @js-example ```html
|
|
776
852
|
* <searchcraft-popover-list-view />
|
|
777
853
|
* ```
|
|
778
854
|
*/
|
|
@@ -784,16 +860,37 @@ declare global {
|
|
|
784
860
|
};
|
|
785
861
|
/**
|
|
786
862
|
* This web component is designed to display the number of results returned from a search query.
|
|
787
|
-
*
|
|
788
|
-
*
|
|
863
|
+
* @react-import ```jsx
|
|
864
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
865
|
+
* ```
|
|
866
|
+
* @vue-import ```jsx
|
|
867
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
868
|
+
* ```
|
|
869
|
+
* @js-example ```html
|
|
789
870
|
* <!-- index.html -->
|
|
790
|
-
* <script>
|
|
791
|
-
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
792
|
-
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
793
|
-
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
794
|
-
* </script>
|
|
795
871
|
* <searchcraft-results-info />
|
|
796
872
|
* ```
|
|
873
|
+
* ```js
|
|
874
|
+
* // index.js
|
|
875
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
876
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
877
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
878
|
+
* `;
|
|
879
|
+
* ```
|
|
880
|
+
* @react-example ```jsx
|
|
881
|
+
* <SearchcraftResultsInfo
|
|
882
|
+
* template={(info, { html }) => html`
|
|
883
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
884
|
+
* `}
|
|
885
|
+
* />
|
|
886
|
+
* ```
|
|
887
|
+
* @vue-example ```jsx
|
|
888
|
+
* <SearchcraftResultsInfo
|
|
889
|
+
* :template={(info, { html }) => html`
|
|
890
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
891
|
+
* `}
|
|
892
|
+
* />
|
|
893
|
+
* ```
|
|
797
894
|
*/
|
|
798
895
|
interface HTMLSearchcraftResultsInfoElement extends Components.SearchcraftResultsInfo, HTMLStencilElement {
|
|
799
896
|
}
|
|
@@ -801,13 +898,80 @@ declare global {
|
|
|
801
898
|
prototype: HTMLSearchcraftResultsInfoElement;
|
|
802
899
|
new (): HTMLSearchcraftResultsInfoElement;
|
|
803
900
|
};
|
|
901
|
+
/**
|
|
902
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
903
|
+
*/
|
|
904
|
+
interface HTMLSearchcraftSearchResultElement extends Components.SearchcraftSearchResult, HTMLStencilElement {
|
|
905
|
+
}
|
|
906
|
+
var HTMLSearchcraftSearchResultElement: {
|
|
907
|
+
prototype: HTMLSearchcraftSearchResultElement;
|
|
908
|
+
new (): HTMLSearchcraftSearchResultElement;
|
|
909
|
+
};
|
|
910
|
+
/**
|
|
911
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
912
|
+
* @react-import ```jsx
|
|
913
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
914
|
+
* ```
|
|
915
|
+
* @vue-import ```jsx
|
|
916
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
917
|
+
* ```
|
|
918
|
+
* @js-example ```html
|
|
919
|
+
* <!-- index.html -->
|
|
920
|
+
* <searchcraft-search-results
|
|
921
|
+
* ad-interval="4"
|
|
922
|
+
* place-ad-at-start="true"
|
|
923
|
+
* />
|
|
924
|
+
* ```
|
|
925
|
+
* ```js
|
|
926
|
+
* // index.js
|
|
927
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
928
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
929
|
+
* <h2>${item.title}</h2>
|
|
930
|
+
* `;
|
|
931
|
+
* ```
|
|
932
|
+
* @react-example ```jsx
|
|
933
|
+
* <SearchcraftSearchResults
|
|
934
|
+
* adInterval={4}
|
|
935
|
+
* placeAdAtState={true}
|
|
936
|
+
* template={(item, index, { html }) => html`
|
|
937
|
+
* <h2>${item.title}</h2>
|
|
938
|
+
* `}
|
|
939
|
+
* />
|
|
940
|
+
* ```
|
|
941
|
+
* @vue-example ```jsx
|
|
942
|
+
* <SearchcraftSearchResults
|
|
943
|
+
* adInterval={4}
|
|
944
|
+
* placeAdAtState={true}
|
|
945
|
+
* :template={(item, index, { html }) => html`
|
|
946
|
+
* <h2>${item.title}</h2>
|
|
947
|
+
* `}
|
|
948
|
+
* />
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
951
|
+
interface HTMLSearchcraftSearchResultsElement extends Components.SearchcraftSearchResults, HTMLStencilElement {
|
|
952
|
+
}
|
|
953
|
+
var HTMLSearchcraftSearchResultsElement: {
|
|
954
|
+
prototype: HTMLSearchcraftSearchResultsElement;
|
|
955
|
+
new (): HTMLSearchcraftSearchResultsElement;
|
|
956
|
+
};
|
|
804
957
|
/**
|
|
805
958
|
* This web component is designed to choose the number of search results displayed.
|
|
806
|
-
*
|
|
807
|
-
*
|
|
959
|
+
* @react-import ```jsx
|
|
960
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
961
|
+
* ```
|
|
962
|
+
* @vue-import ```jsx
|
|
963
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
964
|
+
* ```
|
|
965
|
+
* @js-example ```html
|
|
808
966
|
* <!-- index.html -->
|
|
809
967
|
* <searchcraft-search-results-per-page increment="20" />
|
|
810
968
|
* ```
|
|
969
|
+
* @react-example ```jsx
|
|
970
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
971
|
+
* ```
|
|
972
|
+
* @vue-example ```jsx
|
|
973
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
974
|
+
* ```
|
|
811
975
|
*/
|
|
812
976
|
interface HTMLSearchcraftSearchResultsPerPageElement extends Components.SearchcraftSearchResultsPerPage, HTMLStencilElement {
|
|
813
977
|
}
|
|
@@ -820,8 +984,7 @@ declare global {
|
|
|
820
984
|
}
|
|
821
985
|
/**
|
|
822
986
|
* This web component is designed to allow users to select between a group of options.
|
|
823
|
-
*
|
|
824
|
-
* ```html
|
|
987
|
+
* @js-example ```html
|
|
825
988
|
* <!-- index.html -->
|
|
826
989
|
* <searchcraft-select
|
|
827
990
|
* inputId="searchcraft-select"
|
|
@@ -848,9 +1011,7 @@ declare global {
|
|
|
848
1011
|
"rangeChanged": any;
|
|
849
1012
|
}
|
|
850
1013
|
/**
|
|
851
|
-
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
852
|
-
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
853
|
-
* It is consumed by the `searchcraft-filter-panel` component.
|
|
1014
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
854
1015
|
*/
|
|
855
1016
|
interface HTMLSearchcraftSliderElement extends Components.SearchcraftSlider, HTMLStencilElement {
|
|
856
1017
|
addEventListener<K extends keyof HTMLSearchcraftSliderElementEventMap>(type: K, listener: (this: HTMLSearchcraftSliderElement, ev: SearchcraftSliderCustomEvent<HTMLSearchcraftSliderElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -867,12 +1028,21 @@ declare global {
|
|
|
867
1028
|
new (): HTMLSearchcraftSliderElement;
|
|
868
1029
|
};
|
|
869
1030
|
/**
|
|
870
|
-
* This web component adds Searchcraft's built-in css theme to your page
|
|
871
|
-
*
|
|
872
|
-
*
|
|
873
|
-
* ```
|
|
874
|
-
*
|
|
875
|
-
*
|
|
1031
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
1032
|
+
* @react-import ```jsx
|
|
1033
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
1034
|
+
* ```
|
|
1035
|
+
* @vue-import ```jsx
|
|
1036
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
1037
|
+
* ```
|
|
1038
|
+
* @js-example ```html
|
|
1039
|
+
* <searchcraft-theme />
|
|
1040
|
+
* ```
|
|
1041
|
+
* @react-example ```jsx
|
|
1042
|
+
* <SearchcraftTheme />
|
|
1043
|
+
* ```
|
|
1044
|
+
* @vue-example ```jsx
|
|
1045
|
+
* <SearchcraftTheme />
|
|
876
1046
|
* ```
|
|
877
1047
|
*/
|
|
878
1048
|
interface HTMLSearchcraftThemeElement extends Components.SearchcraftTheme, HTMLStencilElement {
|
|
@@ -886,7 +1056,6 @@ declare global {
|
|
|
886
1056
|
}
|
|
887
1057
|
/**
|
|
888
1058
|
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
889
|
-
* It is consumed within the `searchcraft-filter-panel` component.
|
|
890
1059
|
*/
|
|
891
1060
|
interface HTMLSearchcraftToggleButtonElement extends Components.SearchcraftToggleButton, HTMLStencilElement {
|
|
892
1061
|
addEventListener<K extends keyof HTMLSearchcraftToggleButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftToggleButtonElement, ev: SearchcraftToggleButtonCustomEvent<HTMLSearchcraftToggleButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -904,8 +1073,6 @@ declare global {
|
|
|
904
1073
|
};
|
|
905
1074
|
interface HTMLElementTagNameMap {
|
|
906
1075
|
"searchcraft-ad": HTMLSearchcraftAdElement;
|
|
907
|
-
"searchcraft-base-search-result": HTMLSearchcraftBaseSearchResultElement;
|
|
908
|
-
"searchcraft-base-search-results": HTMLSearchcraftBaseSearchResultsElement;
|
|
909
1076
|
"searchcraft-button": HTMLSearchcraftButtonElement;
|
|
910
1077
|
"searchcraft-error-message": HTMLSearchcraftErrorMessageElement;
|
|
911
1078
|
"searchcraft-facet-list": HTMLSearchcraftFacetListElement;
|
|
@@ -914,10 +1081,13 @@ declare global {
|
|
|
914
1081
|
"searchcraft-input-label": HTMLSearchcraftInputLabelElement;
|
|
915
1082
|
"searchcraft-pagination": HTMLSearchcraftPaginationElement;
|
|
916
1083
|
"searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
|
|
1084
|
+
"searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
|
|
917
1085
|
"searchcraft-popover-form": HTMLSearchcraftPopoverFormElement;
|
|
918
1086
|
"searchcraft-popover-list-item": HTMLSearchcraftPopoverListItemElement;
|
|
919
1087
|
"searchcraft-popover-list-view": HTMLSearchcraftPopoverListViewElement;
|
|
920
1088
|
"searchcraft-results-info": HTMLSearchcraftResultsInfoElement;
|
|
1089
|
+
"searchcraft-search-result": HTMLSearchcraftSearchResultElement;
|
|
1090
|
+
"searchcraft-search-results": HTMLSearchcraftSearchResultsElement;
|
|
921
1091
|
"searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
|
|
922
1092
|
"searchcraft-select": HTMLSearchcraftSelectElement;
|
|
923
1093
|
"searchcraft-slider": HTMLSearchcraftSliderElement;
|
|
@@ -935,109 +1105,8 @@ declare namespace LocalJSX {
|
|
|
935
1105
|
"adSource"?: SearchcraftAdSource;
|
|
936
1106
|
}
|
|
937
1107
|
/**
|
|
938
|
-
* This web component
|
|
939
|
-
* Once a query is submitted, the component formats and presents the result.
|
|
940
|
-
* It is consumed within the `searchcraft-base-search-results` component.
|
|
941
|
-
*/
|
|
942
|
-
interface SearchcraftBaseSearchResult {
|
|
943
|
-
/**
|
|
944
|
-
* The relationship between the current document and the link for the button rendered when containerHref is not present.
|
|
945
|
-
*/
|
|
946
|
-
"buttonRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
947
|
-
/**
|
|
948
|
-
* Where to open the link for the button rendered when containerHref is not present.
|
|
949
|
-
*/
|
|
950
|
-
"buttonTarget"?: '_blank' | '_self' | '_top' | '_parent';
|
|
951
|
-
/**
|
|
952
|
-
* The relationship between the current document and the link for the containing element.
|
|
953
|
-
*/
|
|
954
|
-
"containerRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
955
|
-
/**
|
|
956
|
-
* Where to open the link for the containing element.
|
|
957
|
-
*/
|
|
958
|
-
"containerTarget"?: '_blank' | '_self' | '_top' | '_parent';
|
|
959
|
-
/**
|
|
960
|
-
* A custom styles object.
|
|
961
|
-
*/
|
|
962
|
-
"customStyles"?: string;
|
|
963
|
-
/**
|
|
964
|
-
* The position in the document. Used with the "document_clicked" measure event.
|
|
965
|
-
*/
|
|
966
|
-
"documentPosition"?: number;
|
|
967
|
-
/**
|
|
968
|
-
* The placement of the image.
|
|
969
|
-
*/
|
|
970
|
-
"imagePlacement"?: 'left' | 'right';
|
|
971
|
-
"item"?: SearchClientResponseItem;
|
|
972
|
-
"searchResultMappings"?: SearchResultMappings;
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* This web component is responsible for displaying the results of a search query.
|
|
976
|
-
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
977
|
-
* ## Usage
|
|
978
|
-
* ```html
|
|
979
|
-
* <!-- index.html -->
|
|
980
|
-
* <searchcraft-base-search-results
|
|
981
|
-
* ad-interval="4"
|
|
982
|
-
* place-ad-at-start="false"
|
|
983
|
-
* result-image-placement="right"
|
|
984
|
-
* />
|
|
985
|
-
* ```
|
|
986
|
-
* ```js
|
|
987
|
-
* // index.js
|
|
988
|
-
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
989
|
-
* baseSearchResults.searchResultMappings = containerHref: {
|
|
990
|
-
* fieldNames: [
|
|
991
|
-
* {
|
|
992
|
-
* fieldName: 'canonical_link',
|
|
993
|
-
* dataType: 'text',
|
|
994
|
-
* },
|
|
995
|
-
* ],
|
|
996
|
-
* };
|
|
997
|
-
* baseSearchResults.addEventListener('noResults', () => {
|
|
998
|
-
* console.log('No search results found');
|
|
999
|
-
* });
|
|
1000
|
-
* ```
|
|
1001
|
-
*/
|
|
1002
|
-
interface SearchcraftBaseSearchResults {
|
|
1003
|
-
/**
|
|
1004
|
-
* The label for the button rendered when containerHref is not present for each result.
|
|
1005
|
-
*/
|
|
1006
|
-
"buttonLabel"?: string;
|
|
1007
|
-
/**
|
|
1008
|
-
* The relationship between the current document and the link for the button rendered when containerHref is not present for each result.
|
|
1009
|
-
*/
|
|
1010
|
-
"buttonRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
1011
|
-
/**
|
|
1012
|
-
* Where to open the link for the button rendered when containerHref is not present for each result.
|
|
1013
|
-
*/
|
|
1014
|
-
"buttonTarget"?: '_blank' | '_self' | '_top' | '_parent';
|
|
1015
|
-
/**
|
|
1016
|
-
* The relationship between the current document and the link for the containing element for each result.
|
|
1017
|
-
*/
|
|
1018
|
-
"containerRel"?: 'noreferrer' | 'noopener' | 'nofollow';
|
|
1019
|
-
/**
|
|
1020
|
-
* Where to open the link for the containing element for each result.
|
|
1021
|
-
*/
|
|
1022
|
-
"containerTarget"?: '_blank' | '_self' | '_top' | '_parent';
|
|
1023
|
-
/**
|
|
1024
|
-
* A custom styles object.
|
|
1025
|
-
*/
|
|
1026
|
-
"customStylesForResults"?: | string
|
|
1027
|
-
| Record<string, Record<string, string>>;
|
|
1028
|
-
/**
|
|
1029
|
-
* The placement of the image for each result.
|
|
1030
|
-
*/
|
|
1031
|
-
"resultImagePlacement"?: 'left' | 'right';
|
|
1032
|
-
/**
|
|
1033
|
-
* Formats the content rendered for each result.
|
|
1034
|
-
*/
|
|
1035
|
-
"searchResultMappings"?: SearchResultMappings;
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
1108
|
+
* This web component represents a button.
|
|
1039
1109
|
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
1040
|
-
* It is consumed within the `searchcraft-input-form` component.
|
|
1041
1110
|
*/
|
|
1042
1111
|
interface SearchcraftButton {
|
|
1043
1112
|
/**
|
|
@@ -1075,23 +1144,18 @@ declare namespace LocalJSX {
|
|
|
1075
1144
|
}
|
|
1076
1145
|
/**
|
|
1077
1146
|
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
1078
|
-
*
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1081
|
-
*
|
|
1147
|
+
* @js-example ```html
|
|
1148
|
+
* <searchcraft-error-message>
|
|
1149
|
+
* No search results found for query
|
|
1150
|
+
* </searchcraft-error-message>
|
|
1082
1151
|
* ```
|
|
1083
1152
|
*/
|
|
1084
1153
|
interface SearchcraftErrorMessage {
|
|
1085
|
-
/**
|
|
1086
|
-
* The error message.
|
|
1087
|
-
*/
|
|
1088
|
-
"errorMessage"?: string;
|
|
1089
1154
|
}
|
|
1090
1155
|
/**
|
|
1091
1156
|
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
1092
1157
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
1093
|
-
*
|
|
1094
|
-
* ```html
|
|
1158
|
+
* @js-example ```html
|
|
1095
1159
|
* <!-- index.html -->
|
|
1096
1160
|
* <searchcraft-facet-list field-name="title" />
|
|
1097
1161
|
* ```
|
|
@@ -1115,11 +1179,29 @@ declare namespace LocalJSX {
|
|
|
1115
1179
|
}
|
|
1116
1180
|
/**
|
|
1117
1181
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1182
|
+
* @react-import ```jsx
|
|
1183
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
1184
|
+
* ```
|
|
1185
|
+
* @vue-import ```jsx
|
|
1186
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
1187
|
+
* ```
|
|
1188
|
+
* @js-example ```html
|
|
1120
1189
|
* <!-- index.html -->
|
|
1121
1190
|
* <searchcraft-filter-panel />
|
|
1122
1191
|
* ```
|
|
1192
|
+
* ```js
|
|
1193
|
+
* // index.js
|
|
1194
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
1195
|
+
* if (filterPanel) {
|
|
1196
|
+
* filterPanel.items = [];
|
|
1197
|
+
* }
|
|
1198
|
+
* ```
|
|
1199
|
+
* @react-example ```jsx
|
|
1200
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
1201
|
+
* ```
|
|
1202
|
+
* @vue-example ```jsx
|
|
1203
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
1204
|
+
* ```
|
|
1123
1205
|
*/
|
|
1124
1206
|
interface SearchcraftFilterPanel {
|
|
1125
1207
|
/**
|
|
@@ -1130,14 +1212,20 @@ declare namespace LocalJSX {
|
|
|
1130
1212
|
/**
|
|
1131
1213
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1132
1214
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1135
|
-
* <!-- index.html -->
|
|
1136
|
-
* <searchcraft-input-form placeholder-value="Search here" />
|
|
1215
|
+
* @react-import ```jsx
|
|
1216
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
1137
1217
|
* ```
|
|
1138
|
-
* ```
|
|
1139
|
-
*
|
|
1140
|
-
*
|
|
1218
|
+
* @vue-import ```jsx
|
|
1219
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
1220
|
+
* ```
|
|
1221
|
+
* @js-example ```html
|
|
1222
|
+
* <searchcraft-input-form auto-search />
|
|
1223
|
+
* ```
|
|
1224
|
+
* @react-example ```jsx
|
|
1225
|
+
* <SearchcraftInputForm autoSearch />
|
|
1226
|
+
* ```
|
|
1227
|
+
* @vue-example ```jsx
|
|
1228
|
+
* <SearchcraftInputForm autoSearch />
|
|
1141
1229
|
* ```
|
|
1142
1230
|
*/
|
|
1143
1231
|
interface SearchcraftInputForm {
|
|
@@ -1154,10 +1242,6 @@ declare namespace LocalJSX {
|
|
|
1154
1242
|
*/
|
|
1155
1243
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
1156
1244
|
"core"?: SearchcraftCore;
|
|
1157
|
-
/**
|
|
1158
|
-
* A custom styles object to be applied to the input element.
|
|
1159
|
-
*/
|
|
1160
|
-
"customStyles"?: string | Record<string, string>;
|
|
1161
1245
|
/**
|
|
1162
1246
|
* The label rendered above the input.
|
|
1163
1247
|
*/
|
|
@@ -1181,9 +1265,7 @@ declare namespace LocalJSX {
|
|
|
1181
1265
|
}
|
|
1182
1266
|
/**
|
|
1183
1267
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
1184
|
-
*
|
|
1185
|
-
* ```html
|
|
1186
|
-
* <!-- index.html -->
|
|
1268
|
+
* @js-example ```html
|
|
1187
1269
|
* <searchcraft-input-label label="Search" />
|
|
1188
1270
|
* ```
|
|
1189
1271
|
*/
|
|
@@ -1195,44 +1277,102 @@ declare namespace LocalJSX {
|
|
|
1195
1277
|
"label"?: string;
|
|
1196
1278
|
}
|
|
1197
1279
|
/**
|
|
1198
|
-
* This web component is designed to facilitate pagination of search results.
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
* ```
|
|
1202
|
-
*
|
|
1280
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1281
|
+
* @react-import ```jsx
|
|
1282
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
1283
|
+
* ```
|
|
1284
|
+
* @vue-import ```jsx
|
|
1285
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
1286
|
+
* ```
|
|
1287
|
+
* @js-example ```html
|
|
1203
1288
|
* <searchcraft-pagination />
|
|
1204
1289
|
* ```
|
|
1290
|
+
* @react-example ```jsx
|
|
1291
|
+
* <SearchcraftPagination />
|
|
1292
|
+
* ```
|
|
1293
|
+
* @vue-example ```jsx
|
|
1294
|
+
* <SearchcraftPagination />
|
|
1295
|
+
* ```
|
|
1205
1296
|
*/
|
|
1206
1297
|
interface SearchcraftPagination {
|
|
1207
|
-
/**
|
|
1208
|
-
* The custom styles object.
|
|
1209
|
-
*/
|
|
1210
|
-
"customStyles"?: string;
|
|
1211
1298
|
}
|
|
1212
1299
|
/**
|
|
1213
1300
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
1301
|
+
* @react-import ```jsx
|
|
1302
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
1303
|
+
* ````
|
|
1304
|
+
* @vue-import ```jsx
|
|
1305
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
1306
|
+
* ```
|
|
1307
|
+
* @js-example ```html
|
|
1308
|
+
* <!-- index.html -->
|
|
1309
|
+
* <searchcraft-popover-button>
|
|
1310
|
+
* Open popover
|
|
1311
|
+
* </searchcraft-popover-button>
|
|
1312
|
+
* ```
|
|
1313
|
+
* ```js
|
|
1314
|
+
* // index.js
|
|
1315
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
1316
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
1317
|
+
* <span>Click me</span>
|
|
1318
|
+
* `;
|
|
1319
|
+
* ```
|
|
1320
|
+
* @react-example ```jsx
|
|
1321
|
+
* <SearchcraftPopoverButton
|
|
1322
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
1323
|
+
* <span>Click me</span>
|
|
1324
|
+
* `}
|
|
1325
|
+
* >
|
|
1326
|
+
* Open popover
|
|
1327
|
+
* </SearchcraftPopoverButton>
|
|
1328
|
+
* ```
|
|
1329
|
+
* @vue-example ```jsx
|
|
1330
|
+
* <SearchcraftPopoverButton
|
|
1331
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
1332
|
+
* <span>Click me</span>
|
|
1333
|
+
* `}
|
|
1334
|
+
* >
|
|
1335
|
+
* Open popover
|
|
1336
|
+
* </SearchcraftPopoverButton>
|
|
1337
|
+
* ```
|
|
1214
1338
|
*/
|
|
1215
1339
|
interface SearchcraftPopoverButton {
|
|
1340
|
+
/**
|
|
1341
|
+
* A callback function responsible for rendering the button contents.
|
|
1342
|
+
*/
|
|
1343
|
+
"template"?: PopoverButtonTemplate;
|
|
1344
|
+
/**
|
|
1345
|
+
* The type of popover button to render.
|
|
1346
|
+
*/
|
|
1347
|
+
"type"?: 'skeuomorphic';
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
1351
|
+
*/
|
|
1352
|
+
interface SearchcraftPopoverFooter {
|
|
1216
1353
|
}
|
|
1217
1354
|
/**
|
|
1218
1355
|
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1356
|
+
* @react-import ```jsx
|
|
1357
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
1358
|
+
* ```
|
|
1359
|
+
* @vue-import ```jsx
|
|
1360
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
1361
|
+
* ```
|
|
1362
|
+
* @js-example ```html
|
|
1221
1363
|
* <!-- index.html -->
|
|
1222
|
-
* <searchcraft-popover-form type="
|
|
1364
|
+
* <searchcraft-popover-form type="inline" />
|
|
1223
1365
|
* ```
|
|
1224
1366
|
* ```js
|
|
1225
1367
|
* // index.js
|
|
1226
1368
|
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
1227
|
-
* popoverForm.popoverResultMappings = {
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
*
|
|
1234
|
-
* ],
|
|
1235
|
-
* };
|
|
1369
|
+
* popoverForm.popoverResultMappings = {};
|
|
1370
|
+
* ```
|
|
1371
|
+
* @react-example ```jsx
|
|
1372
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
1373
|
+
* ```
|
|
1374
|
+
* @vue-example ```jsx
|
|
1375
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
1236
1376
|
* ```
|
|
1237
1377
|
*/
|
|
1238
1378
|
interface SearchcraftPopoverForm {
|
|
@@ -1249,7 +1389,7 @@ declare namespace LocalJSX {
|
|
|
1249
1389
|
*/
|
|
1250
1390
|
"popoverResultMappings"?: PopoverResultMappings;
|
|
1251
1391
|
/**
|
|
1252
|
-
* The type of popover form to render.
|
|
1392
|
+
* The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
|
|
1253
1393
|
*/
|
|
1254
1394
|
"type"?: 'inline' | 'fullscreen' | 'modal';
|
|
1255
1395
|
}
|
|
@@ -1267,9 +1407,7 @@ declare namespace LocalJSX {
|
|
|
1267
1407
|
/**
|
|
1268
1408
|
* This web component is designed to display a list of results within a popover interface.
|
|
1269
1409
|
* It is consumed within the `searchcraft-popover-form` component.
|
|
1270
|
-
*
|
|
1271
|
-
* ```html
|
|
1272
|
-
* <!-- index.html -->
|
|
1410
|
+
* @js-example ```html
|
|
1273
1411
|
* <searchcraft-popover-list-view />
|
|
1274
1412
|
* ```
|
|
1275
1413
|
*/
|
|
@@ -1288,45 +1426,129 @@ declare namespace LocalJSX {
|
|
|
1288
1426
|
}
|
|
1289
1427
|
/**
|
|
1290
1428
|
* This web component is designed to display the number of results returned from a search query.
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
1429
|
+
* @react-import ```jsx
|
|
1430
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
1431
|
+
* ```
|
|
1432
|
+
* @vue-import ```jsx
|
|
1433
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
1434
|
+
* ```
|
|
1435
|
+
* @js-example ```html
|
|
1293
1436
|
* <!-- index.html -->
|
|
1294
|
-
* <script>
|
|
1295
|
-
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
1296
|
-
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
1297
|
-
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
1298
|
-
* </script>
|
|
1299
1437
|
* <searchcraft-results-info />
|
|
1300
1438
|
* ```
|
|
1439
|
+
* ```js
|
|
1440
|
+
* // index.js
|
|
1441
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
1442
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
1443
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1444
|
+
* `;
|
|
1445
|
+
* ```
|
|
1446
|
+
* @react-example ```jsx
|
|
1447
|
+
* <SearchcraftResultsInfo
|
|
1448
|
+
* template={(info, { html }) => html`
|
|
1449
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1450
|
+
* `}
|
|
1451
|
+
* />
|
|
1452
|
+
* ```
|
|
1453
|
+
* @vue-example ```jsx
|
|
1454
|
+
* <SearchcraftResultsInfo
|
|
1455
|
+
* :template={(info, { html }) => html`
|
|
1456
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1457
|
+
* `}
|
|
1458
|
+
* />
|
|
1459
|
+
* ```
|
|
1301
1460
|
*/
|
|
1302
1461
|
interface SearchcraftResultsInfo {
|
|
1303
1462
|
/**
|
|
1304
|
-
*
|
|
1305
|
-
* @example ```ts resultsInfo.customFormatter = (range, count, responseTime) => `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`; ```
|
|
1463
|
+
* A callback function responsible for rendering the results info.
|
|
1306
1464
|
*/
|
|
1307
|
-
"
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1465
|
+
"template"?: ResultsInfoTemplate;
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
1469
|
+
*/
|
|
1470
|
+
interface SearchcraftSearchResult {
|
|
1312
1471
|
/**
|
|
1313
|
-
* The
|
|
1472
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
1314
1473
|
*/
|
|
1315
|
-
"
|
|
1474
|
+
"documentPosition"?: number;
|
|
1475
|
+
/**
|
|
1476
|
+
* The index.
|
|
1477
|
+
*/
|
|
1478
|
+
"index": number;
|
|
1479
|
+
"item"?: SearchClientResponseItem;
|
|
1480
|
+
/**
|
|
1481
|
+
* A callback function responsible for rendering a result.
|
|
1482
|
+
*/
|
|
1483
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
1487
|
+
* @react-import ```jsx
|
|
1488
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
1489
|
+
* ```
|
|
1490
|
+
* @vue-import ```jsx
|
|
1491
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
1492
|
+
* ```
|
|
1493
|
+
* @js-example ```html
|
|
1494
|
+
* <!-- index.html -->
|
|
1495
|
+
* <searchcraft-search-results
|
|
1496
|
+
* ad-interval="4"
|
|
1497
|
+
* place-ad-at-start="true"
|
|
1498
|
+
* />
|
|
1499
|
+
* ```
|
|
1500
|
+
* ```js
|
|
1501
|
+
* // index.js
|
|
1502
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
1503
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
1504
|
+
* <h2>${item.title}</h2>
|
|
1505
|
+
* `;
|
|
1506
|
+
* ```
|
|
1507
|
+
* @react-example ```jsx
|
|
1508
|
+
* <SearchcraftSearchResults
|
|
1509
|
+
* adInterval={4}
|
|
1510
|
+
* placeAdAtState={true}
|
|
1511
|
+
* template={(item, index, { html }) => html`
|
|
1512
|
+
* <h2>${item.title}</h2>
|
|
1513
|
+
* `}
|
|
1514
|
+
* />
|
|
1515
|
+
* ```
|
|
1516
|
+
* @vue-example ```jsx
|
|
1517
|
+
* <SearchcraftSearchResults
|
|
1518
|
+
* adInterval={4}
|
|
1519
|
+
* placeAdAtState={true}
|
|
1520
|
+
* :template={(item, index, { html }) => html`
|
|
1521
|
+
* <h2>${item.title}</h2>
|
|
1522
|
+
* `}
|
|
1523
|
+
* />
|
|
1524
|
+
* ```
|
|
1525
|
+
*/
|
|
1526
|
+
interface SearchcraftSearchResults {
|
|
1527
|
+
/**
|
|
1528
|
+
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
1529
|
+
*/
|
|
1530
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
1316
1531
|
}
|
|
1317
1532
|
/**
|
|
1318
1533
|
* This web component is designed to choose the number of search results displayed.
|
|
1319
|
-
*
|
|
1320
|
-
*
|
|
1534
|
+
* @react-import ```jsx
|
|
1535
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
1536
|
+
* ```
|
|
1537
|
+
* @vue-import ```jsx
|
|
1538
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
1539
|
+
* ```
|
|
1540
|
+
* @js-example ```html
|
|
1321
1541
|
* <!-- index.html -->
|
|
1322
1542
|
* <searchcraft-search-results-per-page increment="20" />
|
|
1323
1543
|
* ```
|
|
1544
|
+
* @react-example ```jsx
|
|
1545
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
1546
|
+
* ```
|
|
1547
|
+
* @vue-example ```jsx
|
|
1548
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
1549
|
+
* ```
|
|
1324
1550
|
*/
|
|
1325
1551
|
interface SearchcraftSearchResultsPerPage {
|
|
1326
|
-
/**
|
|
1327
|
-
* The custom styles object.
|
|
1328
|
-
*/
|
|
1329
|
-
"customStyles"?: string;
|
|
1330
1552
|
/**
|
|
1331
1553
|
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
1332
1554
|
*/
|
|
@@ -1334,8 +1556,7 @@ declare namespace LocalJSX {
|
|
|
1334
1556
|
}
|
|
1335
1557
|
/**
|
|
1336
1558
|
* This web component is designed to allow users to select between a group of options.
|
|
1337
|
-
*
|
|
1338
|
-
* ```html
|
|
1559
|
+
* @js-example ```html
|
|
1339
1560
|
* <!-- index.html -->
|
|
1340
1561
|
* <searchcraft-select
|
|
1341
1562
|
* inputId="searchcraft-select"
|
|
@@ -1349,10 +1570,6 @@ declare namespace LocalJSX {
|
|
|
1349
1570
|
* The caption displayed below the select input.
|
|
1350
1571
|
*/
|
|
1351
1572
|
"caption"?: string;
|
|
1352
|
-
/**
|
|
1353
|
-
* A custom styles object.
|
|
1354
|
-
*/
|
|
1355
|
-
"customStyles"?: string;
|
|
1356
1573
|
/**
|
|
1357
1574
|
* Whether the select input is disabled.
|
|
1358
1575
|
*/
|
|
@@ -1383,9 +1600,7 @@ declare namespace LocalJSX {
|
|
|
1383
1600
|
"options"?: SearchcraftSelectOption[] | string;
|
|
1384
1601
|
}
|
|
1385
1602
|
/**
|
|
1386
|
-
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
1387
|
-
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
1388
|
-
* It is consumed by the `searchcraft-filter-panel` component.
|
|
1603
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
1389
1604
|
*/
|
|
1390
1605
|
interface SearchcraftSlider {
|
|
1391
1606
|
/**
|
|
@@ -1410,27 +1625,27 @@ declare namespace LocalJSX {
|
|
|
1410
1625
|
"onRangeChanged"?: (event: SearchcraftSliderCustomEvent<any>) => void;
|
|
1411
1626
|
}
|
|
1412
1627
|
/**
|
|
1413
|
-
* This web component adds Searchcraft's built-in css theme to your page
|
|
1414
|
-
*
|
|
1415
|
-
*
|
|
1416
|
-
* ```
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
1628
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
1629
|
+
* @react-import ```jsx
|
|
1630
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
1631
|
+
* ```
|
|
1632
|
+
* @vue-import ```jsx
|
|
1633
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
1634
|
+
* ```
|
|
1635
|
+
* @js-example ```html
|
|
1636
|
+
* <searchcraft-theme />
|
|
1637
|
+
* ```
|
|
1638
|
+
* @react-example ```jsx
|
|
1639
|
+
* <SearchcraftTheme />
|
|
1640
|
+
* ```
|
|
1641
|
+
* @vue-example ```jsx
|
|
1642
|
+
* <SearchcraftTheme />
|
|
1419
1643
|
* ```
|
|
1420
1644
|
*/
|
|
1421
1645
|
interface SearchcraftTheme {
|
|
1422
|
-
/**
|
|
1423
|
-
* The custom theme configuration object.
|
|
1424
|
-
*/
|
|
1425
|
-
"customTheme"?: string;
|
|
1426
|
-
/**
|
|
1427
|
-
* The name of the theme.
|
|
1428
|
-
*/
|
|
1429
|
-
"theme"?: string;
|
|
1430
1646
|
}
|
|
1431
1647
|
/**
|
|
1432
1648
|
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
1433
|
-
* It is consumed within the `searchcraft-filter-panel` component.
|
|
1434
1649
|
*/
|
|
1435
1650
|
interface SearchcraftToggleButton {
|
|
1436
1651
|
/**
|
|
@@ -1448,8 +1663,6 @@ declare namespace LocalJSX {
|
|
|
1448
1663
|
}
|
|
1449
1664
|
interface IntrinsicElements {
|
|
1450
1665
|
"searchcraft-ad": SearchcraftAd;
|
|
1451
|
-
"searchcraft-base-search-result": SearchcraftBaseSearchResult;
|
|
1452
|
-
"searchcraft-base-search-results": SearchcraftBaseSearchResults;
|
|
1453
1666
|
"searchcraft-button": SearchcraftButton;
|
|
1454
1667
|
"searchcraft-error-message": SearchcraftErrorMessage;
|
|
1455
1668
|
"searchcraft-facet-list": SearchcraftFacetList;
|
|
@@ -1458,10 +1671,13 @@ declare namespace LocalJSX {
|
|
|
1458
1671
|
"searchcraft-input-label": SearchcraftInputLabel;
|
|
1459
1672
|
"searchcraft-pagination": SearchcraftPagination;
|
|
1460
1673
|
"searchcraft-popover-button": SearchcraftPopoverButton;
|
|
1674
|
+
"searchcraft-popover-footer": SearchcraftPopoverFooter;
|
|
1461
1675
|
"searchcraft-popover-form": SearchcraftPopoverForm;
|
|
1462
1676
|
"searchcraft-popover-list-item": SearchcraftPopoverListItem;
|
|
1463
1677
|
"searchcraft-popover-list-view": SearchcraftPopoverListView;
|
|
1464
1678
|
"searchcraft-results-info": SearchcraftResultsInfo;
|
|
1679
|
+
"searchcraft-search-result": SearchcraftSearchResult;
|
|
1680
|
+
"searchcraft-search-results": SearchcraftSearchResults;
|
|
1465
1681
|
"searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
|
|
1466
1682
|
"searchcraft-select": SearchcraftSelect;
|
|
1467
1683
|
"searchcraft-slider": SearchcraftSlider;
|
|
@@ -1478,60 +1694,23 @@ declare module "@stencil/core" {
|
|
|
1478
1694
|
*/
|
|
1479
1695
|
"searchcraft-ad": LocalJSX.SearchcraftAd & JSXBase.HTMLAttributes<HTMLSearchcraftAdElement>;
|
|
1480
1696
|
/**
|
|
1481
|
-
* This web component
|
|
1482
|
-
* Once a query is submitted, the component formats and presents the result.
|
|
1483
|
-
* It is consumed within the `searchcraft-base-search-results` component.
|
|
1484
|
-
*/
|
|
1485
|
-
"searchcraft-base-search-result": LocalJSX.SearchcraftBaseSearchResult & JSXBase.HTMLAttributes<HTMLSearchcraftBaseSearchResultElement>;
|
|
1486
|
-
/**
|
|
1487
|
-
* This web component is responsible for displaying the results of a search query.
|
|
1488
|
-
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
1489
|
-
* ## Usage
|
|
1490
|
-
* ```html
|
|
1491
|
-
* <!-- index.html -->
|
|
1492
|
-
* <searchcraft-base-search-results
|
|
1493
|
-
* ad-interval="4"
|
|
1494
|
-
* place-ad-at-start="false"
|
|
1495
|
-
* result-image-placement="right"
|
|
1496
|
-
* />
|
|
1497
|
-
* ```
|
|
1498
|
-
* ```js
|
|
1499
|
-
* // index.js
|
|
1500
|
-
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
1501
|
-
* baseSearchResults.searchResultMappings = containerHref: {
|
|
1502
|
-
* fieldNames: [
|
|
1503
|
-
* {
|
|
1504
|
-
* fieldName: 'canonical_link',
|
|
1505
|
-
* dataType: 'text',
|
|
1506
|
-
* },
|
|
1507
|
-
* ],
|
|
1508
|
-
* };
|
|
1509
|
-
* baseSearchResults.addEventListener('noResults', () => {
|
|
1510
|
-
* console.log('No search results found');
|
|
1511
|
-
* });
|
|
1512
|
-
* ```
|
|
1513
|
-
*/
|
|
1514
|
-
"searchcraft-base-search-results": LocalJSX.SearchcraftBaseSearchResults & JSXBase.HTMLAttributes<HTMLSearchcraftBaseSearchResultsElement>;
|
|
1515
|
-
/**
|
|
1516
|
-
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
1697
|
+
* This web component represents a button.
|
|
1517
1698
|
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
1518
|
-
* It is consumed within the `searchcraft-input-form` component.
|
|
1519
1699
|
*/
|
|
1520
1700
|
"searchcraft-button": LocalJSX.SearchcraftButton & JSXBase.HTMLAttributes<HTMLSearchcraftButtonElement>;
|
|
1521
1701
|
/**
|
|
1522
1702
|
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1526
|
-
*
|
|
1703
|
+
* @js-example ```html
|
|
1704
|
+
* <searchcraft-error-message>
|
|
1705
|
+
* No search results found for query
|
|
1706
|
+
* </searchcraft-error-message>
|
|
1527
1707
|
* ```
|
|
1528
1708
|
*/
|
|
1529
1709
|
"searchcraft-error-message": LocalJSX.SearchcraftErrorMessage & JSXBase.HTMLAttributes<HTMLSearchcraftErrorMessageElement>;
|
|
1530
1710
|
/**
|
|
1531
1711
|
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
1532
1712
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
1533
|
-
*
|
|
1534
|
-
* ```html
|
|
1713
|
+
* @js-example ```html
|
|
1535
1714
|
* <!-- index.html -->
|
|
1536
1715
|
* <searchcraft-facet-list field-name="title" />
|
|
1537
1716
|
* ```
|
|
@@ -1546,69 +1725,144 @@ declare module "@stencil/core" {
|
|
|
1546
1725
|
"searchcraft-facet-list": LocalJSX.SearchcraftFacetList & JSXBase.HTMLAttributes<HTMLSearchcraftFacetListElement>;
|
|
1547
1726
|
/**
|
|
1548
1727
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1549
|
-
*
|
|
1550
|
-
*
|
|
1728
|
+
* @react-import ```jsx
|
|
1729
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
1730
|
+
* ```
|
|
1731
|
+
* @vue-import ```jsx
|
|
1732
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
1733
|
+
* ```
|
|
1734
|
+
* @js-example ```html
|
|
1551
1735
|
* <!-- index.html -->
|
|
1552
1736
|
* <searchcraft-filter-panel />
|
|
1553
1737
|
* ```
|
|
1738
|
+
* ```js
|
|
1739
|
+
* // index.js
|
|
1740
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
1741
|
+
* if (filterPanel) {
|
|
1742
|
+
* filterPanel.items = [];
|
|
1743
|
+
* }
|
|
1744
|
+
* ```
|
|
1745
|
+
* @react-example ```jsx
|
|
1746
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
1747
|
+
* ```
|
|
1748
|
+
* @vue-example ```jsx
|
|
1749
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
1750
|
+
* ```
|
|
1554
1751
|
*/
|
|
1555
1752
|
"searchcraft-filter-panel": LocalJSX.SearchcraftFilterPanel & JSXBase.HTMLAttributes<HTMLSearchcraftFilterPanelElement>;
|
|
1556
1753
|
/**
|
|
1557
1754
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1558
1755
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1559
|
-
*
|
|
1560
|
-
*
|
|
1561
|
-
* <!-- index.html -->
|
|
1562
|
-
* <searchcraft-input-form placeholder-value="Search here" />
|
|
1756
|
+
* @react-import ```jsx
|
|
1757
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
1563
1758
|
* ```
|
|
1564
|
-
* ```
|
|
1565
|
-
*
|
|
1566
|
-
*
|
|
1759
|
+
* @vue-import ```jsx
|
|
1760
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
1761
|
+
* ```
|
|
1762
|
+
* @js-example ```html
|
|
1763
|
+
* <searchcraft-input-form auto-search />
|
|
1764
|
+
* ```
|
|
1765
|
+
* @react-example ```jsx
|
|
1766
|
+
* <SearchcraftInputForm autoSearch />
|
|
1767
|
+
* ```
|
|
1768
|
+
* @vue-example ```jsx
|
|
1769
|
+
* <SearchcraftInputForm autoSearch />
|
|
1567
1770
|
* ```
|
|
1568
1771
|
*/
|
|
1569
1772
|
"searchcraft-input-form": LocalJSX.SearchcraftInputForm & JSXBase.HTMLAttributes<HTMLSearchcraftInputFormElement>;
|
|
1570
1773
|
/**
|
|
1571
1774
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
1572
|
-
*
|
|
1573
|
-
* ```html
|
|
1574
|
-
* <!-- index.html -->
|
|
1775
|
+
* @js-example ```html
|
|
1575
1776
|
* <searchcraft-input-label label="Search" />
|
|
1576
1777
|
* ```
|
|
1577
1778
|
*/
|
|
1578
1779
|
"searchcraft-input-label": LocalJSX.SearchcraftInputLabel & JSXBase.HTMLAttributes<HTMLSearchcraftInputLabelElement>;
|
|
1579
1780
|
/**
|
|
1580
|
-
* This web component is designed to facilitate pagination of search results.
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1583
|
-
* ```
|
|
1584
|
-
*
|
|
1781
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1782
|
+
* @react-import ```jsx
|
|
1783
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
1784
|
+
* ```
|
|
1785
|
+
* @vue-import ```jsx
|
|
1786
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
1787
|
+
* ```
|
|
1788
|
+
* @js-example ```html
|
|
1585
1789
|
* <searchcraft-pagination />
|
|
1586
1790
|
* ```
|
|
1791
|
+
* @react-example ```jsx
|
|
1792
|
+
* <SearchcraftPagination />
|
|
1793
|
+
* ```
|
|
1794
|
+
* @vue-example ```jsx
|
|
1795
|
+
* <SearchcraftPagination />
|
|
1796
|
+
* ```
|
|
1587
1797
|
*/
|
|
1588
1798
|
"searchcraft-pagination": LocalJSX.SearchcraftPagination & JSXBase.HTMLAttributes<HTMLSearchcraftPaginationElement>;
|
|
1589
1799
|
/**
|
|
1590
1800
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
1801
|
+
* @react-import ```jsx
|
|
1802
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
1803
|
+
* ````
|
|
1804
|
+
* @vue-import ```jsx
|
|
1805
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
1806
|
+
* ```
|
|
1807
|
+
* @js-example ```html
|
|
1808
|
+
* <!-- index.html -->
|
|
1809
|
+
* <searchcraft-popover-button>
|
|
1810
|
+
* Open popover
|
|
1811
|
+
* </searchcraft-popover-button>
|
|
1812
|
+
* ```
|
|
1813
|
+
* ```js
|
|
1814
|
+
* // index.js
|
|
1815
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
1816
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
1817
|
+
* <span>Click me</span>
|
|
1818
|
+
* `;
|
|
1819
|
+
* ```
|
|
1820
|
+
* @react-example ```jsx
|
|
1821
|
+
* <SearchcraftPopoverButton
|
|
1822
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
1823
|
+
* <span>Click me</span>
|
|
1824
|
+
* `}
|
|
1825
|
+
* >
|
|
1826
|
+
* Open popover
|
|
1827
|
+
* </SearchcraftPopoverButton>
|
|
1828
|
+
* ```
|
|
1829
|
+
* @vue-example ```jsx
|
|
1830
|
+
* <SearchcraftPopoverButton
|
|
1831
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
1832
|
+
* <span>Click me</span>
|
|
1833
|
+
* `}
|
|
1834
|
+
* >
|
|
1835
|
+
* Open popover
|
|
1836
|
+
* </SearchcraftPopoverButton>
|
|
1837
|
+
* ```
|
|
1591
1838
|
*/
|
|
1592
1839
|
"searchcraft-popover-button": LocalJSX.SearchcraftPopoverButton & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverButtonElement>;
|
|
1840
|
+
/**
|
|
1841
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
1842
|
+
*/
|
|
1843
|
+
"searchcraft-popover-footer": LocalJSX.SearchcraftPopoverFooter & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverFooterElement>;
|
|
1593
1844
|
/**
|
|
1594
1845
|
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
1595
|
-
*
|
|
1596
|
-
*
|
|
1846
|
+
* @react-import ```jsx
|
|
1847
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
1848
|
+
* ```
|
|
1849
|
+
* @vue-import ```jsx
|
|
1850
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
1851
|
+
* ```
|
|
1852
|
+
* @js-example ```html
|
|
1597
1853
|
* <!-- index.html -->
|
|
1598
|
-
* <searchcraft-popover-form type="
|
|
1854
|
+
* <searchcraft-popover-form type="inline" />
|
|
1599
1855
|
* ```
|
|
1600
1856
|
* ```js
|
|
1601
1857
|
* // index.js
|
|
1602
1858
|
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
1603
|
-
* popoverForm.popoverResultMappings = {
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1609
|
-
*
|
|
1610
|
-
* ],
|
|
1611
|
-
* };
|
|
1859
|
+
* popoverForm.popoverResultMappings = {};
|
|
1860
|
+
* ```
|
|
1861
|
+
* @react-example ```jsx
|
|
1862
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
1863
|
+
* ```
|
|
1864
|
+
* @vue-example ```jsx
|
|
1865
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
1612
1866
|
* ```
|
|
1613
1867
|
*/
|
|
1614
1868
|
"searchcraft-popover-form": LocalJSX.SearchcraftPopoverForm & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverFormElement>;
|
|
@@ -1619,40 +1873,115 @@ declare module "@stencil/core" {
|
|
|
1619
1873
|
/**
|
|
1620
1874
|
* This web component is designed to display a list of results within a popover interface.
|
|
1621
1875
|
* It is consumed within the `searchcraft-popover-form` component.
|
|
1622
|
-
*
|
|
1623
|
-
* ```html
|
|
1624
|
-
* <!-- index.html -->
|
|
1876
|
+
* @js-example ```html
|
|
1625
1877
|
* <searchcraft-popover-list-view />
|
|
1626
1878
|
* ```
|
|
1627
1879
|
*/
|
|
1628
1880
|
"searchcraft-popover-list-view": LocalJSX.SearchcraftPopoverListView & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverListViewElement>;
|
|
1629
1881
|
/**
|
|
1630
1882
|
* This web component is designed to display the number of results returned from a search query.
|
|
1631
|
-
*
|
|
1632
|
-
*
|
|
1883
|
+
* @react-import ```jsx
|
|
1884
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
1885
|
+
* ```
|
|
1886
|
+
* @vue-import ```jsx
|
|
1887
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
1888
|
+
* ```
|
|
1889
|
+
* @js-example ```html
|
|
1633
1890
|
* <!-- index.html -->
|
|
1634
|
-
* <script>
|
|
1635
|
-
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
1636
|
-
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
1637
|
-
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
1638
|
-
* </script>
|
|
1639
1891
|
* <searchcraft-results-info />
|
|
1640
1892
|
* ```
|
|
1893
|
+
* ```js
|
|
1894
|
+
* // index.js
|
|
1895
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
1896
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
1897
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1898
|
+
* `;
|
|
1899
|
+
* ```
|
|
1900
|
+
* @react-example ```jsx
|
|
1901
|
+
* <SearchcraftResultsInfo
|
|
1902
|
+
* template={(info, { html }) => html`
|
|
1903
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1904
|
+
* `}
|
|
1905
|
+
* />
|
|
1906
|
+
* ```
|
|
1907
|
+
* @vue-example ```jsx
|
|
1908
|
+
* <SearchcraftResultsInfo
|
|
1909
|
+
* :template={(info, { html }) => html`
|
|
1910
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1911
|
+
* `}
|
|
1912
|
+
* />
|
|
1913
|
+
* ```
|
|
1641
1914
|
*/
|
|
1642
1915
|
"searchcraft-results-info": LocalJSX.SearchcraftResultsInfo & JSXBase.HTMLAttributes<HTMLSearchcraftResultsInfoElement>;
|
|
1916
|
+
/**
|
|
1917
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
1918
|
+
*/
|
|
1919
|
+
"searchcraft-search-result": LocalJSX.SearchcraftSearchResult & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultElement>;
|
|
1920
|
+
/**
|
|
1921
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
1922
|
+
* @react-import ```jsx
|
|
1923
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
1924
|
+
* ```
|
|
1925
|
+
* @vue-import ```jsx
|
|
1926
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
1927
|
+
* ```
|
|
1928
|
+
* @js-example ```html
|
|
1929
|
+
* <!-- index.html -->
|
|
1930
|
+
* <searchcraft-search-results
|
|
1931
|
+
* ad-interval="4"
|
|
1932
|
+
* place-ad-at-start="true"
|
|
1933
|
+
* />
|
|
1934
|
+
* ```
|
|
1935
|
+
* ```js
|
|
1936
|
+
* // index.js
|
|
1937
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
1938
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
1939
|
+
* <h2>${item.title}</h2>
|
|
1940
|
+
* `;
|
|
1941
|
+
* ```
|
|
1942
|
+
* @react-example ```jsx
|
|
1943
|
+
* <SearchcraftSearchResults
|
|
1944
|
+
* adInterval={4}
|
|
1945
|
+
* placeAdAtState={true}
|
|
1946
|
+
* template={(item, index, { html }) => html`
|
|
1947
|
+
* <h2>${item.title}</h2>
|
|
1948
|
+
* `}
|
|
1949
|
+
* />
|
|
1950
|
+
* ```
|
|
1951
|
+
* @vue-example ```jsx
|
|
1952
|
+
* <SearchcraftSearchResults
|
|
1953
|
+
* adInterval={4}
|
|
1954
|
+
* placeAdAtState={true}
|
|
1955
|
+
* :template={(item, index, { html }) => html`
|
|
1956
|
+
* <h2>${item.title}</h2>
|
|
1957
|
+
* `}
|
|
1958
|
+
* />
|
|
1959
|
+
* ```
|
|
1960
|
+
*/
|
|
1961
|
+
"searchcraft-search-results": LocalJSX.SearchcraftSearchResults & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultsElement>;
|
|
1643
1962
|
/**
|
|
1644
1963
|
* This web component is designed to choose the number of search results displayed.
|
|
1645
|
-
*
|
|
1646
|
-
*
|
|
1964
|
+
* @react-import ```jsx
|
|
1965
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
1966
|
+
* ```
|
|
1967
|
+
* @vue-import ```jsx
|
|
1968
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
1969
|
+
* ```
|
|
1970
|
+
* @js-example ```html
|
|
1647
1971
|
* <!-- index.html -->
|
|
1648
1972
|
* <searchcraft-search-results-per-page increment="20" />
|
|
1649
1973
|
* ```
|
|
1974
|
+
* @react-example ```jsx
|
|
1975
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
1976
|
+
* ```
|
|
1977
|
+
* @vue-example ```jsx
|
|
1978
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
1979
|
+
* ```
|
|
1650
1980
|
*/
|
|
1651
1981
|
"searchcraft-search-results-per-page": LocalJSX.SearchcraftSearchResultsPerPage & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultsPerPageElement>;
|
|
1652
1982
|
/**
|
|
1653
1983
|
* This web component is designed to allow users to select between a group of options.
|
|
1654
|
-
*
|
|
1655
|
-
* ```html
|
|
1984
|
+
* @js-example ```html
|
|
1656
1985
|
* <!-- index.html -->
|
|
1657
1986
|
* <searchcraft-select
|
|
1658
1987
|
* inputId="searchcraft-select"
|
|
@@ -1663,24 +1992,30 @@ declare module "@stencil/core" {
|
|
|
1663
1992
|
*/
|
|
1664
1993
|
"searchcraft-select": LocalJSX.SearchcraftSelect & JSXBase.HTMLAttributes<HTMLSearchcraftSelectElement>;
|
|
1665
1994
|
/**
|
|
1666
|
-
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
1667
|
-
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
1668
|
-
* It is consumed by the `searchcraft-filter-panel` component.
|
|
1995
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
1669
1996
|
*/
|
|
1670
1997
|
"searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
|
|
1671
1998
|
/**
|
|
1672
|
-
* This web component adds Searchcraft's built-in css theme to your page
|
|
1673
|
-
*
|
|
1674
|
-
*
|
|
1675
|
-
* ```
|
|
1676
|
-
*
|
|
1677
|
-
*
|
|
1999
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
2000
|
+
* @react-import ```jsx
|
|
2001
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
2002
|
+
* ```
|
|
2003
|
+
* @vue-import ```jsx
|
|
2004
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
2005
|
+
* ```
|
|
2006
|
+
* @js-example ```html
|
|
2007
|
+
* <searchcraft-theme />
|
|
2008
|
+
* ```
|
|
2009
|
+
* @react-example ```jsx
|
|
2010
|
+
* <SearchcraftTheme />
|
|
2011
|
+
* ```
|
|
2012
|
+
* @vue-example ```jsx
|
|
2013
|
+
* <SearchcraftTheme />
|
|
1678
2014
|
* ```
|
|
1679
2015
|
*/
|
|
1680
2016
|
"searchcraft-theme": LocalJSX.SearchcraftTheme & JSXBase.HTMLAttributes<HTMLSearchcraftThemeElement>;
|
|
1681
2017
|
/**
|
|
1682
2018
|
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
1683
|
-
* It is consumed within the `searchcraft-filter-panel` component.
|
|
1684
2019
|
*/
|
|
1685
2020
|
"searchcraft-toggle-button": LocalJSX.SearchcraftToggleButton & JSXBase.HTMLAttributes<HTMLSearchcraftToggleButtonElement>;
|
|
1686
2021
|
}
|