@searchcraft/javascript-sdk 0.12.2 → 0.13.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/dist/components/index.d.ts +91 -1
- package/dist/components/index.js +62 -634
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-e8d97093.js → p-BV4HUriZ.js} +15 -10
- package/dist/components/p-BV4HUriZ.js.map +1 -0
- package/dist/components/p-B_415D4A.js +34 -0
- package/dist/components/p-B_415D4A.js.map +1 -0
- package/dist/components/{p-c9b65e8f.js → p-BbSxfaD7.js} +14 -11
- package/dist/components/p-BbSxfaD7.js.map +1 -0
- package/dist/components/p-BfTCfPZ1.js +95 -0
- package/dist/components/p-BfTCfPZ1.js.map +1 -0
- package/dist/components/p-BlYgaV0q.js +1373 -0
- package/dist/components/p-BlYgaV0q.js.map +1 -0
- package/dist/components/{p-870f81fd.js → p-C-wcIch1.js} +18 -15
- package/dist/components/p-C-wcIch1.js.map +1 -0
- package/dist/components/{p-87435aac.js → p-C1S92_N8.js} +12 -8
- package/dist/components/p-C1S92_N8.js.map +1 -0
- package/dist/components/{p-acf23bab.js → p-C681KruS.js} +10 -7
- package/dist/components/p-C681KruS.js.map +1 -0
- package/dist/components/{p-1d5c5536.js → p-C7ZK8CYu.js} +13 -10
- package/dist/components/p-C7ZK8CYu.js.map +1 -0
- package/dist/components/{p-fc8ccffa.js → p-Cju73I1E.js} +12 -9
- package/dist/components/p-Cju73I1E.js.map +1 -0
- package/dist/components/{p-e30203b1.js → p-D0j0UFpV.js} +2 -1
- package/dist/components/p-D0j0UFpV.js.map +1 -0
- package/dist/components/{p-02ad136b.js → p-D5p2scT9.js} +13 -10
- package/dist/components/p-D5p2scT9.js.map +1 -0
- package/dist/components/{p-5365011f.js → p-DO5g2x-l.js} +861 -186
- package/dist/components/p-DO5g2x-l.js.map +1 -0
- package/dist/components/{p-73db9122.js → p-Dc7S4y3b.js} +9 -6
- package/dist/components/p-Dc7S4y3b.js.map +1 -0
- package/dist/components/{p-f2585cdf.js → p-DjPZkCLP.js} +8 -5
- package/dist/components/p-DjPZkCLP.js.map +1 -0
- package/dist/components/{p-3286bbb3.js → p-DotXR-Gz.js} +10 -7
- package/dist/components/p-DotXR-Gz.js.map +1 -0
- package/dist/components/{p-b13c7fbb.js → p-Dr9rPC9v.js} +11 -8
- package/dist/components/p-Dr9rPC9v.js.map +1 -0
- package/dist/components/{p-1adf78b9.js → p-L4PwHqQC.js} +10 -7
- package/dist/components/p-L4PwHqQC.js.map +1 -0
- package/dist/components/{p-b4b67072.js → p-_aHgRsRD.js} +4 -3
- package/dist/components/p-_aHgRsRD.js.map +1 -0
- package/dist/components/{p-d54771ef.js → p-i8oXh7db.js} +2 -1
- package/dist/components/p-i8oXh7db.js.map +1 -0
- package/dist/components/searchcraft-ad.js +2 -1
- package/dist/components/searchcraft-button.js +2 -1
- package/dist/components/searchcraft-error-message.js +2 -1
- package/dist/components/searchcraft-facet-list.js +2 -1
- package/dist/components/searchcraft-filter-panel.js +169 -11
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +2 -1
- package/dist/components/searchcraft-input-label.js +2 -1
- package/dist/components/searchcraft-loading.js +2 -1
- package/dist/components/searchcraft-pagination.js +12 -8
- package/dist/components/searchcraft-pagination.js.map +1 -1
- package/dist/components/searchcraft-popover-button.js +10 -7
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-footer.js +2 -1
- package/dist/components/searchcraft-popover-form.js +17 -14
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +2 -1
- package/dist/components/searchcraft-popover-list-view.js +2 -1
- package/dist/components/searchcraft-results-info.js +10 -7
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-result.js +2 -1
- package/dist/components/searchcraft-search-results-per-page.js +11 -7
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
- package/dist/components/searchcraft-search-results.js +11 -8
- package/dist/components/searchcraft-search-results.js.map +1 -1
- package/dist/components/searchcraft-select.js +2 -1
- package/dist/components/searchcraft-slider.js +2 -1
- package/dist/components/searchcraft-summary-box.js +13 -68
- package/dist/components/searchcraft-summary-box.js.map +1 -1
- package/dist/components/searchcraft-theme.js +9 -6
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +2 -1
- package/dist/hydrate/index.d.ts +40 -7
- package/dist/hydrate/index.js +3285 -2405
- package/dist/hydrate/index.mjs +3284 -2404
- package/dist/themes/hologram.css +1 -1
- package/dist/themes/hologram.css.map +1 -1
- package/dist/types/classes/SearchcraftCore.d.ts +1 -0
- package/dist/types/clients/MeasureClient.d.ts +2 -1
- package/dist/types/clients/SearchClient.d.ts +1 -1
- package/dist/types/clients/ad-clients/AdClient.d.ts +1 -1
- package/dist/types/clients/ad-clients/NativoClient.d.ts +1 -1
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +40 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +1 -1
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +1 -1
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -1
- package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +2 -2
- package/dist/types/components.d.ts +86 -0
- package/dist/types/stencil-public-runtime.d.ts +84 -8
- package/dist/types/store/SearchcraftStore.types.d.ts +2 -0
- package/package.json +2 -2
- package/dist/components/p-02ad136b.js.map +0 -1
- package/dist/components/p-1adf78b9.js.map +0 -1
- package/dist/components/p-1d5c5536.js.map +0 -1
- package/dist/components/p-3286bbb3.js.map +0 -1
- package/dist/components/p-5365011f.js.map +0 -1
- package/dist/components/p-5cdc6210.js +0 -82
- package/dist/components/p-5cdc6210.js.map +0 -1
- package/dist/components/p-73db9122.js.map +0 -1
- package/dist/components/p-870f81fd.js.map +0 -1
- package/dist/components/p-87435aac.js.map +0 -1
- package/dist/components/p-919734fe.js +0 -31
- package/dist/components/p-919734fe.js.map +0 -1
- package/dist/components/p-acf23bab.js.map +0 -1
- package/dist/components/p-b13c7fbb.js.map +0 -1
- package/dist/components/p-b4b67072.js.map +0 -1
- package/dist/components/p-c9b65e8f.js.map +0 -1
- package/dist/components/p-d54771ef.js.map +0 -1
- package/dist/components/p-e2a10337.js +0 -1355
- package/dist/components/p-e2a10337.js.map +0 -1
- package/dist/components/p-e30203b1.js.map +0 -1
- package/dist/components/p-e8d97093.js.map +0 -1
- package/dist/components/p-f2585cdf.js.map +0 -1
- package/dist/components/p-fc8ccffa.js.map +0 -1
|
@@ -15,9 +15,13 @@ export namespace Components {
|
|
|
15
15
|
*/
|
|
16
16
|
interface SearchcraftAd {
|
|
17
17
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
18
|
+
/**
|
|
19
|
+
* @default 'Custom'
|
|
20
|
+
*/
|
|
18
21
|
"adSource": 'Custom' | 'Nativo' | 'adMarketplace';
|
|
19
22
|
/**
|
|
20
23
|
* Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
|
|
24
|
+
* @default 'interstitial'
|
|
21
25
|
*/
|
|
22
26
|
"renderPosition": 'interstitial' | 'top' | 'bottom';
|
|
23
27
|
/**
|
|
@@ -32,10 +36,12 @@ export namespace Components {
|
|
|
32
36
|
interface SearchcraftButton {
|
|
33
37
|
/**
|
|
34
38
|
* Whether the button is disabled.
|
|
39
|
+
* @default false
|
|
35
40
|
*/
|
|
36
41
|
"disabled"?: boolean;
|
|
37
42
|
/**
|
|
38
43
|
* Controls the visual representation of the button.
|
|
44
|
+
* @default 'primary'
|
|
39
45
|
*/
|
|
40
46
|
"hierarchy"?: 'primary' | 'tertiary';
|
|
41
47
|
/**
|
|
@@ -44,18 +50,22 @@ export namespace Components {
|
|
|
44
50
|
"icon"?: Element;
|
|
45
51
|
/**
|
|
46
52
|
* Should the button only display an icon.
|
|
53
|
+
* @default false
|
|
47
54
|
*/
|
|
48
55
|
"iconOnly"?: boolean;
|
|
49
56
|
/**
|
|
50
57
|
* The position of the icon.
|
|
58
|
+
* @default 'left'
|
|
51
59
|
*/
|
|
52
60
|
"iconPosition"?: 'left' | 'right';
|
|
53
61
|
/**
|
|
54
62
|
* The label for the button.
|
|
63
|
+
* @default 'Search'
|
|
55
64
|
*/
|
|
56
65
|
"label": string;
|
|
57
66
|
/**
|
|
58
67
|
* The type of the button.
|
|
68
|
+
* @default 'button'
|
|
59
69
|
*/
|
|
60
70
|
"type"?: 'submit' | 'reset' | 'button';
|
|
61
71
|
}
|
|
@@ -91,6 +101,7 @@ export namespace Components {
|
|
|
91
101
|
"exclude"?: string[];
|
|
92
102
|
/**
|
|
93
103
|
* The name of the field where facets are applied.
|
|
104
|
+
* @default ''
|
|
94
105
|
*/
|
|
95
106
|
"fieldName": string;
|
|
96
107
|
/**
|
|
@@ -127,8 +138,19 @@ export namespace Components {
|
|
|
127
138
|
interface SearchcraftFilterPanel {
|
|
128
139
|
/**
|
|
129
140
|
* The items to filter.
|
|
141
|
+
* @default []
|
|
130
142
|
*/
|
|
131
143
|
"items": FilterItem[];
|
|
144
|
+
/**
|
|
145
|
+
* Controls whether the filter panel automatically hides/shows based on window size. - 'auto': Automatically hide/show based on window width - 'manual': User controls visibility manually
|
|
146
|
+
* @default 'auto'
|
|
147
|
+
*/
|
|
148
|
+
"responsiveBehavior"?: 'auto' | 'manual';
|
|
149
|
+
/**
|
|
150
|
+
* The breakpoint (in pixels) below which the filter panel will be hidden. Defaults to 768px (--sc-breakpoint-md).
|
|
151
|
+
* @default 768
|
|
152
|
+
*/
|
|
153
|
+
"responsiveBreakpoint"?: number;
|
|
132
154
|
/**
|
|
133
155
|
* The id of the Searchcraft instance that this component should use.
|
|
134
156
|
*/
|
|
@@ -156,6 +178,7 @@ export namespace Components {
|
|
|
156
178
|
interface SearchcraftInputForm {
|
|
157
179
|
/**
|
|
158
180
|
* Whether or not to automatically submit the search term when the input changes.
|
|
181
|
+
* @default true
|
|
159
182
|
*/
|
|
160
183
|
"autoSearch"?: boolean;
|
|
161
184
|
/**
|
|
@@ -164,6 +187,7 @@ export namespace Components {
|
|
|
164
187
|
"buttonLabel"?: string;
|
|
165
188
|
/**
|
|
166
189
|
* Where to place the search button.
|
|
190
|
+
* @default 'none'
|
|
167
191
|
*/
|
|
168
192
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
169
193
|
/**
|
|
@@ -176,6 +200,7 @@ export namespace Components {
|
|
|
176
200
|
"placeholderBehavior"?: 'hide-on-focus' | 'hide-on-text-entered';
|
|
177
201
|
/**
|
|
178
202
|
* The input element's placeholder value.
|
|
203
|
+
* @default 'Enter Search'
|
|
179
204
|
*/
|
|
180
205
|
"placeholderValue"?: string;
|
|
181
206
|
/**
|
|
@@ -196,8 +221,12 @@ export namespace Components {
|
|
|
196
221
|
interface SearchcraftInputLabel {
|
|
197
222
|
/**
|
|
198
223
|
* The classname applied to the label element.
|
|
224
|
+
* @default ''
|
|
199
225
|
*/
|
|
200
226
|
"inputLabelClassName"?: string | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* @default ''
|
|
229
|
+
*/
|
|
201
230
|
"label": string;
|
|
202
231
|
}
|
|
203
232
|
/**
|
|
@@ -320,10 +349,12 @@ export namespace Components {
|
|
|
320
349
|
interface SearchcraftPopoverForm {
|
|
321
350
|
/**
|
|
322
351
|
* The hotkey that activates the popover.
|
|
352
|
+
* @default 'k'
|
|
323
353
|
*/
|
|
324
354
|
"hotkey"?: string;
|
|
325
355
|
/**
|
|
326
356
|
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
357
|
+
* @default 'meta'
|
|
327
358
|
*/
|
|
328
359
|
"hotkeyModifier"?: 'ctrl' | 'meta' | 'alt' | 'option';
|
|
329
360
|
/**
|
|
@@ -332,6 +363,7 @@ export namespace Components {
|
|
|
332
363
|
"placeholderBehavior"?: 'hide-on-focus' | 'hide-on-text-entered';
|
|
333
364
|
/**
|
|
334
365
|
* The input element's placeholder value.
|
|
366
|
+
* @default 'Enter Search'
|
|
335
367
|
*/
|
|
336
368
|
"placeholderValue"?: string;
|
|
337
369
|
/**
|
|
@@ -344,6 +376,7 @@ export namespace Components {
|
|
|
344
376
|
"searchcraftId"?: string;
|
|
345
377
|
/**
|
|
346
378
|
* 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.
|
|
379
|
+
* @default 'inline'
|
|
347
380
|
*/
|
|
348
381
|
"type"?: 'inline' | 'fullscreen' | 'modal';
|
|
349
382
|
}
|
|
@@ -353,6 +386,7 @@ export namespace Components {
|
|
|
353
386
|
interface SearchcraftPopoverListItem {
|
|
354
387
|
/**
|
|
355
388
|
* The document position relative to the search results (For Measure)
|
|
389
|
+
* @default 0
|
|
356
390
|
*/
|
|
357
391
|
"documentPosition": number;
|
|
358
392
|
"item": SearchClientResponseItem | undefined;
|
|
@@ -436,6 +470,7 @@ export namespace Components {
|
|
|
436
470
|
interface SearchcraftSearchResult {
|
|
437
471
|
/**
|
|
438
472
|
* The position in the document. Used with the "document_clicked" measure event.
|
|
473
|
+
* @default 0
|
|
439
474
|
*/
|
|
440
475
|
"documentPosition": number;
|
|
441
476
|
/**
|
|
@@ -529,6 +564,7 @@ export namespace Components {
|
|
|
529
564
|
interface SearchcraftSearchResultsPerPage {
|
|
530
565
|
/**
|
|
531
566
|
* 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.
|
|
567
|
+
* @default 20
|
|
532
568
|
*/
|
|
533
569
|
"increment": string | number;
|
|
534
570
|
/**
|
|
@@ -554,6 +590,7 @@ export namespace Components {
|
|
|
554
590
|
"caption"?: string;
|
|
555
591
|
/**
|
|
556
592
|
* Whether the select input is disabled.
|
|
593
|
+
* @default false
|
|
557
594
|
*/
|
|
558
595
|
"disabled"?: boolean;
|
|
559
596
|
/**
|
|
@@ -574,6 +611,7 @@ export namespace Components {
|
|
|
574
611
|
"name": string;
|
|
575
612
|
/**
|
|
576
613
|
* The options for the select input.
|
|
614
|
+
* @default []
|
|
577
615
|
*/
|
|
578
616
|
"options": SearchcraftSelectOption[] | string;
|
|
579
617
|
}
|
|
@@ -583,6 +621,7 @@ export namespace Components {
|
|
|
583
621
|
interface SearchcraftSlider {
|
|
584
622
|
/**
|
|
585
623
|
* The type of data the sliders are using.
|
|
624
|
+
* @default 'number'
|
|
586
625
|
*/
|
|
587
626
|
"dataType": 'number' | 'date';
|
|
588
627
|
/**
|
|
@@ -591,14 +630,17 @@ export namespace Components {
|
|
|
591
630
|
"dateGranularity"?: 'year' | 'month' | 'day' | 'hour';
|
|
592
631
|
/**
|
|
593
632
|
* The maximum value allowed.
|
|
633
|
+
* @default 100
|
|
594
634
|
*/
|
|
595
635
|
"max": number;
|
|
596
636
|
/**
|
|
597
637
|
* The minimum value allowed.
|
|
638
|
+
* @default 0
|
|
598
639
|
*/
|
|
599
640
|
"min": number;
|
|
600
641
|
/**
|
|
601
642
|
* The step amount for the slider inputs.
|
|
643
|
+
* @default 1
|
|
602
644
|
*/
|
|
603
645
|
"step": number;
|
|
604
646
|
}
|
|
@@ -655,6 +697,7 @@ export namespace Components {
|
|
|
655
697
|
interface SearchcraftToggleButton {
|
|
656
698
|
/**
|
|
657
699
|
* The label.
|
|
700
|
+
* @default 'Toggle'
|
|
658
701
|
*/
|
|
659
702
|
"label": string;
|
|
660
703
|
/**
|
|
@@ -1262,9 +1305,13 @@ declare namespace LocalJSX {
|
|
|
1262
1305
|
*/
|
|
1263
1306
|
interface SearchcraftAd {
|
|
1264
1307
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
1308
|
+
/**
|
|
1309
|
+
* @default 'Custom'
|
|
1310
|
+
*/
|
|
1265
1311
|
"adSource"?: 'Custom' | 'Nativo' | 'adMarketplace';
|
|
1266
1312
|
/**
|
|
1267
1313
|
* Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
|
|
1314
|
+
* @default 'interstitial'
|
|
1268
1315
|
*/
|
|
1269
1316
|
"renderPosition"?: 'interstitial' | 'top' | 'bottom';
|
|
1270
1317
|
/**
|
|
@@ -1279,10 +1326,12 @@ declare namespace LocalJSX {
|
|
|
1279
1326
|
interface SearchcraftButton {
|
|
1280
1327
|
/**
|
|
1281
1328
|
* Whether the button is disabled.
|
|
1329
|
+
* @default false
|
|
1282
1330
|
*/
|
|
1283
1331
|
"disabled"?: boolean;
|
|
1284
1332
|
/**
|
|
1285
1333
|
* Controls the visual representation of the button.
|
|
1334
|
+
* @default 'primary'
|
|
1286
1335
|
*/
|
|
1287
1336
|
"hierarchy"?: 'primary' | 'tertiary';
|
|
1288
1337
|
/**
|
|
@@ -1291,14 +1340,17 @@ declare namespace LocalJSX {
|
|
|
1291
1340
|
"icon"?: Element;
|
|
1292
1341
|
/**
|
|
1293
1342
|
* Should the button only display an icon.
|
|
1343
|
+
* @default false
|
|
1294
1344
|
*/
|
|
1295
1345
|
"iconOnly"?: boolean;
|
|
1296
1346
|
/**
|
|
1297
1347
|
* The position of the icon.
|
|
1348
|
+
* @default 'left'
|
|
1298
1349
|
*/
|
|
1299
1350
|
"iconPosition"?: 'left' | 'right';
|
|
1300
1351
|
/**
|
|
1301
1352
|
* The label for the button.
|
|
1353
|
+
* @default 'Search'
|
|
1302
1354
|
*/
|
|
1303
1355
|
"label"?: string;
|
|
1304
1356
|
/**
|
|
@@ -1307,6 +1359,7 @@ declare namespace LocalJSX {
|
|
|
1307
1359
|
"onButtonClick"?: (event: SearchcraftButtonCustomEvent<void>) => void;
|
|
1308
1360
|
/**
|
|
1309
1361
|
* The type of the button.
|
|
1362
|
+
* @default 'button'
|
|
1310
1363
|
*/
|
|
1311
1364
|
"type"?: 'submit' | 'reset' | 'button';
|
|
1312
1365
|
}
|
|
@@ -1342,6 +1395,7 @@ declare namespace LocalJSX {
|
|
|
1342
1395
|
"exclude"?: string[];
|
|
1343
1396
|
/**
|
|
1344
1397
|
* The name of the field where facets are applied.
|
|
1398
|
+
* @default ''
|
|
1345
1399
|
*/
|
|
1346
1400
|
"fieldName"?: string;
|
|
1347
1401
|
/**
|
|
@@ -1382,8 +1436,19 @@ declare namespace LocalJSX {
|
|
|
1382
1436
|
interface SearchcraftFilterPanel {
|
|
1383
1437
|
/**
|
|
1384
1438
|
* The items to filter.
|
|
1439
|
+
* @default []
|
|
1385
1440
|
*/
|
|
1386
1441
|
"items"?: FilterItem[];
|
|
1442
|
+
/**
|
|
1443
|
+
* Controls whether the filter panel automatically hides/shows based on window size. - 'auto': Automatically hide/show based on window width - 'manual': User controls visibility manually
|
|
1444
|
+
* @default 'auto'
|
|
1445
|
+
*/
|
|
1446
|
+
"responsiveBehavior"?: 'auto' | 'manual';
|
|
1447
|
+
/**
|
|
1448
|
+
* The breakpoint (in pixels) below which the filter panel will be hidden. Defaults to 768px (--sc-breakpoint-md).
|
|
1449
|
+
* @default 768
|
|
1450
|
+
*/
|
|
1451
|
+
"responsiveBreakpoint"?: number;
|
|
1387
1452
|
/**
|
|
1388
1453
|
* The id of the Searchcraft instance that this component should use.
|
|
1389
1454
|
*/
|
|
@@ -1411,6 +1476,7 @@ declare namespace LocalJSX {
|
|
|
1411
1476
|
interface SearchcraftInputForm {
|
|
1412
1477
|
/**
|
|
1413
1478
|
* Whether or not to automatically submit the search term when the input changes.
|
|
1479
|
+
* @default true
|
|
1414
1480
|
*/
|
|
1415
1481
|
"autoSearch"?: boolean;
|
|
1416
1482
|
/**
|
|
@@ -1419,6 +1485,7 @@ declare namespace LocalJSX {
|
|
|
1419
1485
|
"buttonLabel"?: string;
|
|
1420
1486
|
/**
|
|
1421
1487
|
* Where to place the search button.
|
|
1488
|
+
* @default 'none'
|
|
1422
1489
|
*/
|
|
1423
1490
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
1424
1491
|
/**
|
|
@@ -1443,6 +1510,7 @@ declare namespace LocalJSX {
|
|
|
1443
1510
|
"placeholderBehavior"?: 'hide-on-focus' | 'hide-on-text-entered';
|
|
1444
1511
|
/**
|
|
1445
1512
|
* The input element's placeholder value.
|
|
1513
|
+
* @default 'Enter Search'
|
|
1446
1514
|
*/
|
|
1447
1515
|
"placeholderValue"?: string;
|
|
1448
1516
|
/**
|
|
@@ -1463,8 +1531,12 @@ declare namespace LocalJSX {
|
|
|
1463
1531
|
interface SearchcraftInputLabel {
|
|
1464
1532
|
/**
|
|
1465
1533
|
* The classname applied to the label element.
|
|
1534
|
+
* @default ''
|
|
1466
1535
|
*/
|
|
1467
1536
|
"inputLabelClassName"?: string | undefined;
|
|
1537
|
+
/**
|
|
1538
|
+
* @default ''
|
|
1539
|
+
*/
|
|
1468
1540
|
"label"?: string;
|
|
1469
1541
|
}
|
|
1470
1542
|
/**
|
|
@@ -1587,10 +1659,12 @@ declare namespace LocalJSX {
|
|
|
1587
1659
|
interface SearchcraftPopoverForm {
|
|
1588
1660
|
/**
|
|
1589
1661
|
* The hotkey that activates the popover.
|
|
1662
|
+
* @default 'k'
|
|
1590
1663
|
*/
|
|
1591
1664
|
"hotkey"?: string;
|
|
1592
1665
|
/**
|
|
1593
1666
|
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
1667
|
+
* @default 'meta'
|
|
1594
1668
|
*/
|
|
1595
1669
|
"hotkeyModifier"?: 'ctrl' | 'meta' | 'alt' | 'option';
|
|
1596
1670
|
/**
|
|
@@ -1599,6 +1673,7 @@ declare namespace LocalJSX {
|
|
|
1599
1673
|
"placeholderBehavior"?: 'hide-on-focus' | 'hide-on-text-entered';
|
|
1600
1674
|
/**
|
|
1601
1675
|
* The input element's placeholder value.
|
|
1676
|
+
* @default 'Enter Search'
|
|
1602
1677
|
*/
|
|
1603
1678
|
"placeholderValue"?: string;
|
|
1604
1679
|
/**
|
|
@@ -1611,6 +1686,7 @@ declare namespace LocalJSX {
|
|
|
1611
1686
|
"searchcraftId"?: string;
|
|
1612
1687
|
/**
|
|
1613
1688
|
* 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.
|
|
1689
|
+
* @default 'inline'
|
|
1614
1690
|
*/
|
|
1615
1691
|
"type"?: 'inline' | 'fullscreen' | 'modal';
|
|
1616
1692
|
}
|
|
@@ -1620,6 +1696,7 @@ declare namespace LocalJSX {
|
|
|
1620
1696
|
interface SearchcraftPopoverListItem {
|
|
1621
1697
|
/**
|
|
1622
1698
|
* The document position relative to the search results (For Measure)
|
|
1699
|
+
* @default 0
|
|
1623
1700
|
*/
|
|
1624
1701
|
"documentPosition"?: number;
|
|
1625
1702
|
"item"?: SearchClientResponseItem | undefined;
|
|
@@ -1703,6 +1780,7 @@ declare namespace LocalJSX {
|
|
|
1703
1780
|
interface SearchcraftSearchResult {
|
|
1704
1781
|
/**
|
|
1705
1782
|
* The position in the document. Used with the "document_clicked" measure event.
|
|
1783
|
+
* @default 0
|
|
1706
1784
|
*/
|
|
1707
1785
|
"documentPosition"?: number;
|
|
1708
1786
|
/**
|
|
@@ -1796,6 +1874,7 @@ declare namespace LocalJSX {
|
|
|
1796
1874
|
interface SearchcraftSearchResultsPerPage {
|
|
1797
1875
|
/**
|
|
1798
1876
|
* 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.
|
|
1877
|
+
* @default 20
|
|
1799
1878
|
*/
|
|
1800
1879
|
"increment"?: string | number;
|
|
1801
1880
|
/**
|
|
@@ -1821,6 +1900,7 @@ declare namespace LocalJSX {
|
|
|
1821
1900
|
"caption"?: string;
|
|
1822
1901
|
/**
|
|
1823
1902
|
* Whether the select input is disabled.
|
|
1903
|
+
* @default false
|
|
1824
1904
|
*/
|
|
1825
1905
|
"disabled"?: boolean;
|
|
1826
1906
|
/**
|
|
@@ -1845,6 +1925,7 @@ declare namespace LocalJSX {
|
|
|
1845
1925
|
"onSelectChange"?: (event: SearchcraftSelectCustomEvent<string>) => void;
|
|
1846
1926
|
/**
|
|
1847
1927
|
* The options for the select input.
|
|
1928
|
+
* @default []
|
|
1848
1929
|
*/
|
|
1849
1930
|
"options"?: SearchcraftSelectOption[] | string;
|
|
1850
1931
|
}
|
|
@@ -1854,6 +1935,7 @@ declare namespace LocalJSX {
|
|
|
1854
1935
|
interface SearchcraftSlider {
|
|
1855
1936
|
/**
|
|
1856
1937
|
* The type of data the sliders are using.
|
|
1938
|
+
* @default 'number'
|
|
1857
1939
|
*/
|
|
1858
1940
|
"dataType"?: 'number' | 'date';
|
|
1859
1941
|
/**
|
|
@@ -1862,10 +1944,12 @@ declare namespace LocalJSX {
|
|
|
1862
1944
|
"dateGranularity"?: 'year' | 'month' | 'day' | 'hour';
|
|
1863
1945
|
/**
|
|
1864
1946
|
* The maximum value allowed.
|
|
1947
|
+
* @default 100
|
|
1865
1948
|
*/
|
|
1866
1949
|
"max"?: number;
|
|
1867
1950
|
/**
|
|
1868
1951
|
* The minimum value allowed.
|
|
1952
|
+
* @default 0
|
|
1869
1953
|
*/
|
|
1870
1954
|
"min"?: number;
|
|
1871
1955
|
/**
|
|
@@ -1874,6 +1958,7 @@ declare namespace LocalJSX {
|
|
|
1874
1958
|
"onRangeChanged"?: (event: SearchcraftSliderCustomEvent<any>) => void;
|
|
1875
1959
|
/**
|
|
1876
1960
|
* The step amount for the slider inputs.
|
|
1961
|
+
* @default 1
|
|
1877
1962
|
*/
|
|
1878
1963
|
"step"?: number;
|
|
1879
1964
|
}
|
|
@@ -1930,6 +2015,7 @@ declare namespace LocalJSX {
|
|
|
1930
2015
|
interface SearchcraftToggleButton {
|
|
1931
2016
|
/**
|
|
1932
2017
|
* The label.
|
|
2018
|
+
* @default 'Toggle'
|
|
1933
2019
|
*/
|
|
1934
2020
|
"label"?: string;
|
|
1935
2021
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type CustomMethodDecorator<T> = (target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
|
|
2
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
3
|
+
type MixinInstance<F> = F extends (base: MixedInCtor) => MixedInCtor<infer I> ? I : never;
|
|
2
4
|
export interface ComponentDecorator {
|
|
3
5
|
(opts?: ComponentOptions): ClassDecorator;
|
|
4
6
|
}
|
|
@@ -151,7 +153,13 @@ export interface StateDecorator {
|
|
|
151
153
|
(): PropertyDecorator;
|
|
152
154
|
}
|
|
153
155
|
export interface WatchDecorator {
|
|
154
|
-
(propName:
|
|
156
|
+
(propName: any): CustomMethodDecorator<(newValue?: any, oldValue?: any, propName?: any, ...args: any[]) => any | void>;
|
|
157
|
+
}
|
|
158
|
+
export interface PropSerializeDecorator {
|
|
159
|
+
(propName: any): CustomMethodDecorator<(newValue?: any, propName?: string, ...args: any[]) => string | null>;
|
|
160
|
+
}
|
|
161
|
+
export interface AttrDeserializeDecorator {
|
|
162
|
+
(propName: any): CustomMethodDecorator<(newValue?: any, propName?: string, ...args: any[]) => any>;
|
|
155
163
|
}
|
|
156
164
|
export interface UserBuildConditionals {
|
|
157
165
|
isDev: boolean;
|
|
@@ -233,6 +241,14 @@ export declare const State: StateDecorator;
|
|
|
233
241
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
234
242
|
*/
|
|
235
243
|
export declare const Watch: WatchDecorator;
|
|
244
|
+
/**
|
|
245
|
+
* Decorator to serialize a property to an attribute string.
|
|
246
|
+
*/
|
|
247
|
+
export declare const PropSerialize: PropSerializeDecorator;
|
|
248
|
+
/**
|
|
249
|
+
* Decorator to deserialize an attribute string to a property.
|
|
250
|
+
*/
|
|
251
|
+
export declare const AttrDeserialize: AttrDeserializeDecorator;
|
|
236
252
|
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
237
253
|
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
238
254
|
/**
|
|
@@ -260,6 +276,25 @@ export declare function setPlatformHelpers(helpers: {
|
|
|
260
276
|
* @returns the base path
|
|
261
277
|
*/
|
|
262
278
|
export declare function getAssetPath(path: string): string;
|
|
279
|
+
/**
|
|
280
|
+
* Method to render a virtual DOM tree to a container element.
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```tsx
|
|
284
|
+
* import { render } from '@stencil/core';
|
|
285
|
+
*
|
|
286
|
+
* const vnode = (
|
|
287
|
+
* <div>
|
|
288
|
+
* <h1>Hello, world!</h1>
|
|
289
|
+
* </div>
|
|
290
|
+
* );
|
|
291
|
+
* render(vnode, document.body);
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* @param vnode - The virtual DOM tree to render
|
|
295
|
+
* @param container - The container element to render the virtual DOM tree to
|
|
296
|
+
*/
|
|
297
|
+
export declare function render(vnode: VNode, container: Element): void;
|
|
263
298
|
/**
|
|
264
299
|
* Used to manually set the base path where assets can be found. For lazy-loaded
|
|
265
300
|
* builds the asset path is automatically set and assets copied to the correct
|
|
@@ -330,6 +365,37 @@ export declare function readTask(task: RafCallback): void;
|
|
|
330
365
|
* Unhandled exception raised while rendering, during event handling, or lifecycles will trigger the custom event handler.
|
|
331
366
|
*/
|
|
332
367
|
export declare const setErrorHandler: (handler: ErrorHandler) => void;
|
|
368
|
+
/**
|
|
369
|
+
* @deprecated - Use `MixedInCtor` instead:
|
|
370
|
+
* ```ts
|
|
371
|
+
* import { MixedInCtor } from '@stencil/core';
|
|
372
|
+
*
|
|
373
|
+
* const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
export type MixinFactory = (base: MixedInCtor) => MixedInCtor;
|
|
377
|
+
export type MixedInCtor<T = {}> = new (...args: any[]) => T;
|
|
378
|
+
/**
|
|
379
|
+
* Compose multiple mixin classes into a single constructor.
|
|
380
|
+
* The resulting class has the combined instance types of all mixed-in classes.
|
|
381
|
+
*
|
|
382
|
+
* Example:
|
|
383
|
+
* ```ts
|
|
384
|
+
* import { Mixin, MixedInCtor } from '@stencil/core';
|
|
385
|
+
*
|
|
386
|
+
* const AWrap = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
|
|
387
|
+
* const BWrap = <B extends MixedInCtor>(Base: B) => {class B extends Base { propB = B }; return B;}
|
|
388
|
+
* const CWrap = <B extends MixedInCtor>(Base: B) => {class C extends Base { propC = C }; return C;}
|
|
389
|
+
*
|
|
390
|
+
* class X extends Mixin(AWrap, BWrap, CWrap) {
|
|
391
|
+
* render() { return <div>{this.propA} {this.propB} {this.propC}</div>; }
|
|
392
|
+
* }
|
|
393
|
+
* ```
|
|
394
|
+
*
|
|
395
|
+
* @param mixinFactories mixin factory functions that return a class which extends from the provided class.
|
|
396
|
+
* @returns a class that is composed from extending each of the provided classes in the order they were provided.
|
|
397
|
+
*/
|
|
398
|
+
export declare function Mixin<const TMixins extends readonly MixinFactory[]>(...mixinFactories: TMixins): abstract new (...args: any[]) => UnionToIntersection<MixinInstance<TMixins[number]>>;
|
|
333
399
|
/**
|
|
334
400
|
* This file gets copied to all distributions of stencil component collections.
|
|
335
401
|
* - no imports
|
|
@@ -826,7 +892,8 @@ export declare namespace JSXBase {
|
|
|
826
892
|
}
|
|
827
893
|
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
828
894
|
open?: boolean;
|
|
829
|
-
|
|
895
|
+
name?: string;
|
|
896
|
+
onToggle?: (event: ToggleEvent) => void;
|
|
830
897
|
}
|
|
831
898
|
interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
832
899
|
cite?: string;
|
|
@@ -1532,6 +1599,13 @@ export declare namespace JSXBase {
|
|
|
1532
1599
|
z?: number | string;
|
|
1533
1600
|
zoomAndPan?: string;
|
|
1534
1601
|
}
|
|
1602
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent) */
|
|
1603
|
+
interface ToggleEvent extends Event {
|
|
1604
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/newState) */
|
|
1605
|
+
readonly newState: string;
|
|
1606
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/oldState) */
|
|
1607
|
+
readonly oldState: string;
|
|
1608
|
+
}
|
|
1535
1609
|
interface DOMAttributes<T> extends JSXAttributes<T> {
|
|
1536
1610
|
slot?: string;
|
|
1537
1611
|
part?: string;
|
|
@@ -1548,6 +1622,10 @@ export declare namespace JSXBase {
|
|
|
1548
1622
|
onCompositionstartCapture?: (event: CompositionEvent) => void;
|
|
1549
1623
|
onCompositionupdate?: (event: CompositionEvent) => void;
|
|
1550
1624
|
onCompositionupdateCapture?: (event: CompositionEvent) => void;
|
|
1625
|
+
onBeforeToggle?: (event: ToggleEvent) => void;
|
|
1626
|
+
onBeforeToggleCapture?: (event: ToggleEvent) => void;
|
|
1627
|
+
onToggle?: (event: ToggleEvent) => void;
|
|
1628
|
+
onToggleCapture?: (event: ToggleEvent) => void;
|
|
1551
1629
|
onFocus?: (event: FocusEvent) => void;
|
|
1552
1630
|
onFocusCapture?: (event: FocusEvent) => void;
|
|
1553
1631
|
onFocusin?: (event: FocusEvent) => void;
|
|
@@ -1566,10 +1644,6 @@ export declare namespace JSXBase {
|
|
|
1566
1644
|
onSubmitCapture?: (event: Event) => void;
|
|
1567
1645
|
onInvalid?: (event: Event) => void;
|
|
1568
1646
|
onInvalidCapture?: (event: Event) => void;
|
|
1569
|
-
onBeforeToggle?: (event: Event) => void;
|
|
1570
|
-
onBeforeToggleCapture?: (event: Event) => void;
|
|
1571
|
-
onToggle?: (event: Event) => void;
|
|
1572
|
-
onToggleCapture?: (event: Event) => void;
|
|
1573
1647
|
onLoad?: (event: Event) => void;
|
|
1574
1648
|
onLoadCapture?: (event: Event) => void;
|
|
1575
1649
|
onError?: (event: Event) => void;
|
|
@@ -1581,7 +1655,7 @@ export declare namespace JSXBase {
|
|
|
1581
1655
|
onKeyUp?: (event: KeyboardEvent) => void;
|
|
1582
1656
|
onKeyUpCapture?: (event: KeyboardEvent) => void;
|
|
1583
1657
|
onAuxClick?: (event: MouseEvent) => void;
|
|
1584
|
-
onClick?: (event:
|
|
1658
|
+
onClick?: (event: PointerEvent) => void;
|
|
1585
1659
|
onClickCapture?: (event: MouseEvent) => void;
|
|
1586
1660
|
onContextMenu?: (event: MouseEvent) => void;
|
|
1587
1661
|
onContextMenuCapture?: (event: MouseEvent) => void;
|
|
@@ -1661,6 +1735,8 @@ export declare namespace JSXBase {
|
|
|
1661
1735
|
onTransitionRunCapture?: (event: TransitionEvent) => void;
|
|
1662
1736
|
onTransitionStart?: (event: TransitionEvent) => void;
|
|
1663
1737
|
onTransitionStartCapture?: (event: TransitionEvent) => void;
|
|
1738
|
+
[key: `aria-${string}`]: string | boolean | undefined;
|
|
1739
|
+
[key: `aria${string}`]: string | boolean | undefined;
|
|
1664
1740
|
}
|
|
1665
1741
|
}
|
|
1666
1742
|
export interface JSXAttributes<T = Element> {
|
|
@@ -14,6 +14,7 @@ export interface SearchcraftStateFunctions {
|
|
|
14
14
|
search: (options?: {
|
|
15
15
|
skipSummary?: boolean;
|
|
16
16
|
}) => Promise<void>;
|
|
17
|
+
setFilterPanelVisibility: (isVisible: boolean) => void;
|
|
17
18
|
setPopoverVisibility: (isVisible: boolean) => void;
|
|
18
19
|
setSearchResultsCount: (count: number) => void;
|
|
19
20
|
setSearchResultsPage: (page: number) => void;
|
|
@@ -36,6 +37,7 @@ export interface SearchcraftStateValues {
|
|
|
36
37
|
hotkey: string;
|
|
37
38
|
hotkeyModifier: 'ctrl' | 'meta' | 'alt' | 'option';
|
|
38
39
|
facetPathsForIndexFields: Record<string, FacetPathsForIndexField>;
|
|
40
|
+
isFilterPanelVisible: boolean;
|
|
39
41
|
isPopoverVisible: boolean;
|
|
40
42
|
isSearchInProgress: boolean;
|
|
41
43
|
rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchcraft/javascript-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.1",
|
|
5
5
|
"description": "Searchcraft Javascript SDK",
|
|
6
6
|
"author": "Searchcraft Inc.",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"nanoid": "^5.0.9",
|
|
56
56
|
"zustand": "^5.0.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "9c32e0fbced9754db2337c5e4c5e7c8bb7baa484"
|
|
59
59
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-02ad136b.js","mappings":";;;;MAqBa,uBAAuB;;;;;;;;;IAI1B,KAAK,GAAG,QAAQ,CAAC;;;;IAIjB,QAAQ,CAAqB;;;;IAI7B,aAAa,CAAU;;;;IAKtB,aAAa,CAAyB;IAEtC,QAAQ,GAAG,KAAK,CAAC;IACjB,cAAc,CAAqB;IACpC,WAAW,CAA2B;IACtC,WAAW,CAAc;IAEzB,YAAY,GAAG;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACzC,CAAC;IAEF,eAAe,CAAC,IAAqB;;QAEnC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK;YAC5C,IACE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,cAAc;gBACxC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACpC;gBACA,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;aACvB;YACD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC;SACxC,CAAC,CAAC;KACJ;IAED,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,eAAe,CACzC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAChC,CAAC;KACH;IAED,oBAAoB;QAClB,IAAI,CAAC,WAAW,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,CAAC;KACtB;IAED,MAAM;QACJ,QACE,4DACE,KAAK,EAAE,UAAU,CAAC,2BAA2B,EAAE;gBAC7C,kCAAkC,EAAE,IAAI,CAAC,QAAQ;aAClD,CAAC,IAEF,8DACE,0DAAG,KAAK,EAAC,iCAAiC,IAAE,IAAI,CAAC,KAAK,CAAK,EAC1D,IAAI,CAAC,QAAQ,KACZ,0DAAG,KAAK,EAAC,qCAAqC,IAAE,IAAI,CAAC,QAAQ,CAAK,CACnE,CACG,EACN,+DACE,KAAK,EAAC,sCAAsC,EAC5C,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,IAAI,EAAC,QAAQ,IAEb,4DAAK,KAAK,EAAC,kCAAkC,GAAG,CACzC,CACL,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-toggle-button/searchcraft-toggle-button.tsx"],"sourcesContent":["import type { SearchcraftCore } from '@classes';\nimport { registry } from '@classes/CoreInstanceRegistry';\nimport {\n Component,\n Event,\n h,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-toggle-button',\n shadow: false,\n})\nexport class SearchcraftToggleButton {\n /**\n * The label.\n */\n @Prop() label = 'Toggle';\n /**\n * The secondary label displayed below the main label.\n */\n @Prop() subLabel: string | undefined;\n /**\n * The id of the Searchcraft instance that this component should use.\n */\n @Prop() searchcraftId?: string;\n\n /**\n * When the toggle element is changed.\n */\n @Event() toggleUpdated?: EventEmitter<boolean>;\n\n @State() isActive = false;\n @State() lastSearchTerm: string | undefined;\n private unsubscribe: (() => void) | undefined;\n private cleanupCore?: () => void;\n\n private handleToggle = async () => {\n this.isActive = !this.isActive;\n this.toggleUpdated?.emit(this.isActive);\n };\n\n onCoreAvailable(core: SearchcraftCore) {\n /** When the query changes, sets toggle button state back to inactive. */\n this.unsubscribe = core.store.subscribe((state) => {\n if (\n state.searchTerm !== this.lastSearchTerm &&\n state.searchTerm.trim().length === 0\n ) {\n this.isActive = false;\n }\n this.lastSearchTerm = state.searchTerm;\n });\n }\n\n connectedCallback() {\n this.cleanupCore = registry.useCoreInstance(\n this.searchcraftId,\n this.onCoreAvailable.bind(this),\n );\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n this.cleanupCore?.();\n }\n\n render() {\n return (\n <div\n class={classNames('searchcraft-toggle-button', {\n 'searchcraft-toggle-button-active': this.isActive,\n })}\n >\n <div>\n <p class='searchcraft-toggle-button-label'>{this.label}</p>\n {this.subLabel && (\n <p class='searchcraft-toggle-button-sub-label'>{this.subLabel}</p>\n )}\n </div>\n <button\n class='searchcraft-toggle-button-background'\n onClick={this.handleToggle}\n type='button'\n >\n <div class='searchcraft-toggle-button-handle' />\n </button>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-1adf78b9.js","mappings":";;;MAiBa,qBAAqB;;;;;;;;IAIxB,mBAAmB,GAAI,EAAE,CAAC;IAC1B,KAAK,GAAG,EAAE,CAAC;IAEnB,MAAM;QACJ,QACE,8DACE,KAAK,EAAE,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,mBAAmB,CAAC,EACtE,OAAO,EAAC,sBAAsB,IAE7B,IAAI,CAAC,KAAK,CACL,EACR;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-input-label/searchcraft-input-label.tsx"],"sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component serves as the input label for the searchcraft-input-form component.\n *\n * @js-example\n * ```html\n * <searchcraft-input-label label=\"Search\" />\n * ```\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-input-label',\n shadow: false,\n})\nexport class SearchcraftInputLabel {\n /**\n * The classname applied to the label element.\n */\n @Prop() inputLabelClassName? = '';\n @Prop() label = '';\n\n render() {\n return (\n <label\n class={classNames('searchcraft-input-label', this.inputLabelClassName)}\n htmlFor='searchcraft-input-id'\n >\n {this.label}\n </label>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-1d5c5536.js","mappings":";;;;;MAea,wBAAwB;;;;;;;;IAI3B,aAAa,CAAU;IACtB,kBAAkB,CAAC;IAEpB,WAAW,GAAe,SAAQ,CAAC;IACnC,WAAW,CAAc;IAEjC,eAAe,CAAC,IAAqB;QACnC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC;QAEnE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK;YAC5C,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;SACpD,CAAC,CAAC;KACJ;IAED,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,eAAe,CACzC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAChC,CAAC;KACH;IAED,oBAAoB;QAClB,IAAI,CAAC,WAAW,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,CAAC;KACtB;IAED,MAAM;QACJ,QACE,+DAAQ,KAAK,EAAC,4BAA4B,IACxC,0DAAG,KAAK,EAAC,yCAAyC,IAC/C,IAAI,CAAC,kBAAkB;cACpB,GAAG,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,gBAAgB;cAClE,GAAG,CACL,EACJ,0DACE,KAAK,EAAC,iCAAiC,EACvC,IAAI,EAAC,yBAAyB,EAC9B,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,IAEhB,4DACE,KAAK,EAAC,uCAAuC,EAC7C,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,YAAY,EACpB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,IAElC,yFAAqC,EACrC,6DACE,CAAC,EAAC,kmOAAkmO,EACpmO,IAAI,EAAC,cAAc,GACnB,CACE,CACJ,CACG,EACT;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-popover-footer/searchcraft-popover-footer.tsx"],"sourcesContent":["import type { SearchcraftCore } from '@classes';\nimport { registry } from '@classes/CoreInstanceRegistry';\nimport { Component, h, Prop, State } from '@stencil/core';\n\nimport { formatNumberWithCommas } from '@utils';\n\n/**\n * Renders the footer for the searchcraft-popover-form.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-popover-footer',\n shadow: false,\n})\nexport class SearchcraftPopoverFooter {\n /**\n * The id of the Searchcraft instance that this component should use.\n */\n @Prop() searchcraftId?: string;\n @State() searchResultsCount;\n\n private unsubscribe: () => void = () => {};\n private cleanupCore?: () => void;\n\n onCoreAvailable(core: SearchcraftCore) {\n this.searchResultsCount = core.store.getState().searchResultsCount;\n\n this.unsubscribe = core.store.subscribe((state) => {\n this.searchResultsCount = state.searchResultsCount;\n });\n }\n\n connectedCallback() {\n this.cleanupCore = registry.useCoreInstance(\n this.searchcraftId,\n this.onCoreAvailable.bind(this),\n );\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n this.cleanupCore?.();\n }\n\n render() {\n return (\n <footer class='searchcraft-popover-footer'>\n <p class='searchcraft-popover-footer-results-info'>\n {this.searchResultsCount\n ? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`\n : ' '}\n </p>\n <a\n class='searchcraft-popover-footer-link'\n href='https://searchcraft.io/'\n target='_blank'\n rel='noreferrer'\n >\n <svg\n class='searchcraft-popover-footer-link-image'\n width='169'\n height='16'\n viewBox='0 0 169 16'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <title>Powered by Searchcraft</title>\n <path\n d='M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z'\n fill='currentColor'\n />\n </svg>\n </a>\n </footer>\n );\n }\n}\n"],"version":3}
|