@searchcraft/react-sdk 0.10.0 → 0.10.2
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/client/index.js +1714 -1482
- package/dist/client/index.js.map +1 -1
- package/dist/client/themes/hologram.css +1 -0
- package/dist/client/themes/hologram.css.map +1 -0
- package/dist/server/index.d.ts +348 -187
- package/dist/server/index.js +1763 -1531
- package/dist/server/index.js.map +1 -1
- package/package.json +5 -4
package/dist/server/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export type SearchResultFieldName = {
|
|
|
42
42
|
numberFormatLocale?: string;
|
|
43
43
|
/**
|
|
44
44
|
* If it's a number, the number format to apply.
|
|
45
|
-
*
|
|
45
|
+
* Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
46
46
|
*/
|
|
47
47
|
numberFormatOptions?: Intl.NumberFormatOptions;
|
|
48
48
|
/**
|
|
@@ -50,9 +50,14 @@ export type SearchResultFieldName = {
|
|
|
50
50
|
*/
|
|
51
51
|
numberScale?: number;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* The locale to use when formatting dataType: `date`.
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
dateFormatLocale?: string;
|
|
56
|
+
/**
|
|
57
|
+
* If it's a date, the date format to apply.
|
|
58
|
+
* Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
|
|
59
|
+
*/
|
|
60
|
+
dateFormatOptions?: Intl.DateTimeFormatOptions;
|
|
56
61
|
};
|
|
57
62
|
/**
|
|
58
63
|
* A data type representing the mapping of index fields, for the purpose of rendering them
|
|
@@ -138,16 +143,21 @@ export type CustomAdTemplate = (data: {
|
|
|
138
143
|
}, utils: {
|
|
139
144
|
html: TemplateHtml;
|
|
140
145
|
}) => string;
|
|
146
|
+
export type PopoverButtonTemplate = (data: {
|
|
147
|
+
isPopoverVisible: boolean;
|
|
148
|
+
}, utils: {
|
|
149
|
+
html: TemplateHtml;
|
|
150
|
+
}) => string;
|
|
141
151
|
/**
|
|
142
152
|
* The SearchcraftConfig object is used to initialize Searchcraft in your application.
|
|
143
153
|
*/
|
|
144
154
|
export interface SearchcraftConfig {
|
|
145
155
|
/**
|
|
146
|
-
* Host IP Address and port number configured and created using Vektron
|
|
156
|
+
* Host IP Address and port number configured and created using Vektron.
|
|
147
157
|
*/
|
|
148
158
|
endpointURL: string;
|
|
149
159
|
/**
|
|
150
|
-
* Name or names of search indices configured using Vektron. Given as an array of strings
|
|
160
|
+
* Name or names of search indices configured using Vektron. Given as an array of strings.
|
|
151
161
|
*/
|
|
152
162
|
index: string[];
|
|
153
163
|
/**
|
|
@@ -166,6 +176,10 @@ export interface SearchcraftConfig {
|
|
|
166
176
|
* The maximum number of results to return per page.
|
|
167
177
|
*/
|
|
168
178
|
searchResultsPerPage?: number;
|
|
179
|
+
/**
|
|
180
|
+
* The name of the field to use for `order_by` when sorting.
|
|
181
|
+
*/
|
|
182
|
+
indexFieldName?: string;
|
|
169
183
|
/**
|
|
170
184
|
* Name of the ad source to use.
|
|
171
185
|
*/
|
|
@@ -265,7 +279,7 @@ export interface FacetChild {
|
|
|
265
279
|
/**
|
|
266
280
|
* Types of measure requests that can be sent to the /measure/event endpoint.
|
|
267
281
|
*/
|
|
268
|
-
export type MeasureEventName = "sdk_initialized" | "search_requested" | "search_response_received" | "document_clicked";
|
|
282
|
+
export type MeasureEventName = "sdk_initialized" | "search_requested" | "search_response_received" | "search_completed" | "document_clicked";
|
|
269
283
|
/**
|
|
270
284
|
* Properties attached to a measure request.
|
|
271
285
|
*/
|
|
@@ -298,6 +312,56 @@ export interface MeasureRequestUser {
|
|
|
298
312
|
latitude?: number;
|
|
299
313
|
longitude?: number;
|
|
300
314
|
}
|
|
315
|
+
export interface FacetPathsForIndexField {
|
|
316
|
+
fieldName: string;
|
|
317
|
+
value: string;
|
|
318
|
+
}
|
|
319
|
+
export interface RangeValueForIndexField {
|
|
320
|
+
fieldName: string;
|
|
321
|
+
value: string;
|
|
322
|
+
}
|
|
323
|
+
export interface SearchClientRequestProperties {
|
|
324
|
+
/**
|
|
325
|
+
* The search mode, which can be either 'fuzzy' or 'exact'.
|
|
326
|
+
*/
|
|
327
|
+
mode: "fuzzy" | "exact";
|
|
328
|
+
/**
|
|
329
|
+
* The starting point for the results, used for pagination.
|
|
330
|
+
* Optional parameter.
|
|
331
|
+
*/
|
|
332
|
+
offset?: number;
|
|
333
|
+
/**
|
|
334
|
+
* The number of results returned.
|
|
335
|
+
* Optional parameter.
|
|
336
|
+
*/
|
|
337
|
+
limit?: number;
|
|
338
|
+
/**
|
|
339
|
+
* The field to order the results by (e.g., 'date_published', 'title', etc.).
|
|
340
|
+
* Optional parameter.
|
|
341
|
+
*/
|
|
342
|
+
order_by?: string;
|
|
343
|
+
/**
|
|
344
|
+
* The search term provided by the user.
|
|
345
|
+
*/
|
|
346
|
+
searchTerm: string;
|
|
347
|
+
/**
|
|
348
|
+
* The sort order, which can be either 'asc' or 'desc'.
|
|
349
|
+
* Optional parameter.
|
|
350
|
+
*/
|
|
351
|
+
sort?: "asc" | "desc";
|
|
352
|
+
/**
|
|
353
|
+
* The facet path value(s) specified by the `facets` filter items that the `searchcraft-filter-panel` renders.
|
|
354
|
+
* There may be multiple rendered within a single filter panel.
|
|
355
|
+
* Optional parameter.
|
|
356
|
+
*/
|
|
357
|
+
facetPathsForIndexFields?: Record<string, FacetPathsForIndexField>;
|
|
358
|
+
/**
|
|
359
|
+
* The date range slider value(s) specified by the `dateRange` filter items that the `searchcraft-filter-panel` renders.
|
|
360
|
+
* There may be multiple rendered within a single filter panel.
|
|
361
|
+
* Optional parameter.
|
|
362
|
+
*/
|
|
363
|
+
rangeValueForIndexFields?: Record<string, RangeValueForIndexField>;
|
|
364
|
+
}
|
|
301
365
|
/**
|
|
302
366
|
* The structure of a response returned from a Searchcraft operation.
|
|
303
367
|
*/
|
|
@@ -324,13 +388,13 @@ export type SearchcraftResponseError = {
|
|
|
324
388
|
export interface SearchcraftResponseData {
|
|
325
389
|
count?: number;
|
|
326
390
|
facets?: FacetPrime;
|
|
327
|
-
hits?:
|
|
391
|
+
hits?: SearchIndexHit[];
|
|
328
392
|
time_taken?: number;
|
|
329
393
|
}
|
|
330
394
|
/**
|
|
331
395
|
* Represents an entry in the search index returned as part of a search result.
|
|
332
396
|
*/
|
|
333
|
-
export interface
|
|
397
|
+
export interface SearchIndexHit {
|
|
334
398
|
doc?: SearchDocument;
|
|
335
399
|
document_id?: string;
|
|
336
400
|
score?: number;
|
|
@@ -346,54 +410,12 @@ export interface SearchClientResponseItem {
|
|
|
346
410
|
id: string;
|
|
347
411
|
document: SearchDocument;
|
|
348
412
|
}
|
|
349
|
-
export type FacetPathsForIndexField = {
|
|
350
|
-
fieldName: string;
|
|
351
|
-
value: string;
|
|
352
|
-
};
|
|
353
|
-
export type RangeValueForIndexField = {
|
|
354
|
-
fieldName: string;
|
|
355
|
-
value: string;
|
|
356
|
-
};
|
|
357
|
-
/**
|
|
358
|
-
* Parameters required to make a successful Search request.
|
|
359
|
-
*/
|
|
360
|
-
export type SearchParams = {
|
|
361
|
-
/**
|
|
362
|
-
* The search mode, which can be either 'fuzzy' or 'exact'.
|
|
363
|
-
*/
|
|
364
|
-
mode: "fuzzy" | "exact";
|
|
365
|
-
/**
|
|
366
|
-
* The starting point for the results, used for pagination.
|
|
367
|
-
* Optional parameter.
|
|
368
|
-
*/
|
|
369
|
-
offset?: number;
|
|
370
|
-
/**
|
|
371
|
-
* The number of results returned.
|
|
372
|
-
* Optional parameter.
|
|
373
|
-
*/
|
|
374
|
-
limit?: number;
|
|
375
|
-
/**
|
|
376
|
-
* The field to order the results by (e.g., 'date_published', 'title', etc.).
|
|
377
|
-
* Optional parameter.
|
|
378
|
-
*/
|
|
379
|
-
order_by?: string;
|
|
380
|
-
/**
|
|
381
|
-
* The search term provided by the user.
|
|
382
|
-
*/
|
|
383
|
-
searchTerm: string;
|
|
384
|
-
/**
|
|
385
|
-
* The sort order, which can be either 'asc' or 'desc'.
|
|
386
|
-
* Optional parameter.
|
|
387
|
-
*/
|
|
388
|
-
sort?: "asc" | "desc";
|
|
389
|
-
facetPathsForIndexFields?: Record<string, FacetPathsForIndexField>;
|
|
390
|
-
rangeValueForIndexFields?: Record<string, RangeValueForIndexField>;
|
|
391
|
-
};
|
|
392
413
|
export interface SubscriptionEventMap {
|
|
393
414
|
ad_container_rendered: AdContainerRenderedSubscriptionEvent;
|
|
394
415
|
ad_container_viewed: AdContainerViewedSubscriptionEvent;
|
|
395
416
|
query_fetched: QueryFetchedEvent;
|
|
396
417
|
query_submitted: QuerySubmittedEvent;
|
|
418
|
+
initialized: InitializedEvent;
|
|
397
419
|
input_cleared: InputClearedEvent;
|
|
398
420
|
no_results_returned: NoResultsReturnedEvent;
|
|
399
421
|
}
|
|
@@ -431,6 +453,9 @@ export interface InputClearedEvent extends SubscriptionEvent {
|
|
|
431
453
|
export interface NoResultsReturnedEvent extends SubscriptionEvent {
|
|
432
454
|
name: "no_results_returned";
|
|
433
455
|
}
|
|
456
|
+
export interface InitializedEvent extends SubscriptionEvent {
|
|
457
|
+
name: "initialized";
|
|
458
|
+
}
|
|
434
459
|
export type SubscriptionEventName = keyof SubscriptionEventMap;
|
|
435
460
|
export type SubscriptionEventCallback<T extends SubscriptionEventName> = (event: SubscriptionEventMap[T]) => void;
|
|
436
461
|
export type UnsubscribeFunction = () => void;
|
|
@@ -440,9 +465,9 @@ export interface SubscriptionEvent {
|
|
|
440
465
|
declare class AdClient {
|
|
441
466
|
config: SearchcraftConfig;
|
|
442
467
|
constructor(config: SearchcraftConfig);
|
|
443
|
-
|
|
444
|
-
onQuerySubmitted(
|
|
445
|
-
onQueryFetched(
|
|
468
|
+
getAds(_properties: SearchClientRequestProperties): Promise<AdClientResponseItem[]>;
|
|
469
|
+
onQuerySubmitted(_properties: SearchClientRequestProperties): Promise<void>;
|
|
470
|
+
onQueryFetched(_properties: SearchClientRequestProperties, _response: SearchcraftResponse): Promise<void>;
|
|
446
471
|
onInputCleared(): Promise<void>;
|
|
447
472
|
onAdContainerRendered(_data: {
|
|
448
473
|
adClientResponseItem?: AdClientResponseItem;
|
|
@@ -480,22 +505,32 @@ declare class MeasureClient {
|
|
|
480
505
|
* @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
|
|
481
506
|
* @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
|
|
482
507
|
*/
|
|
483
|
-
sendMeasureEvent: (eventName: MeasureEventName, properties?: Partial<MeasureRequestProperties>, user?: Partial<MeasureRequestUser>) => void
|
|
508
|
+
sendMeasureEvent: (eventName: MeasureEventName, properties?: Partial<MeasureRequestProperties>, user?: Partial<MeasureRequestUser>) => Promise<void>;
|
|
484
509
|
}
|
|
485
510
|
declare class SearchClient {
|
|
486
511
|
private config;
|
|
487
512
|
private userId;
|
|
488
513
|
private parent;
|
|
514
|
+
private searchCompletedEventTimeout;
|
|
489
515
|
constructor(parent: SearchcraftCore, config: SearchcraftConfig, userId: string);
|
|
490
516
|
/**
|
|
491
517
|
* Getter for the base url used by the /search endpoint.
|
|
492
518
|
*/
|
|
493
519
|
private get baseSearchUrl();
|
|
494
520
|
/**
|
|
495
|
-
*
|
|
496
|
-
* @param {
|
|
521
|
+
* Make the request to get the search results.
|
|
522
|
+
* @param {properties} properties - The properties for the search.
|
|
523
|
+
* @returns
|
|
497
524
|
*/
|
|
498
|
-
|
|
525
|
+
getSearchResponseItems: (properties: SearchClientRequestProperties | string) => Promise<SearchcraftResponse>;
|
|
526
|
+
private handleGetSearchResponseItemsWithString;
|
|
527
|
+
private handleGetSearchResponseItemsWithObject;
|
|
528
|
+
/**
|
|
529
|
+
* Builds a query object for the SearchClient request.
|
|
530
|
+
* @param {properties} properties - The properties for the search.
|
|
531
|
+
* @returns {SearchClientQuery} - A properly formatted SearchClient query object.
|
|
532
|
+
*/
|
|
533
|
+
private formatParamsForRequest;
|
|
499
534
|
}
|
|
500
535
|
/**
|
|
501
536
|
* Javascript Class providing the functionality to interact with the Searchcraft BE
|
|
@@ -539,30 +574,34 @@ export declare class SearchcraftCore {
|
|
|
539
574
|
* Perform various actions when the input is cleared
|
|
540
575
|
*/
|
|
541
576
|
handleInputCleared(): void;
|
|
542
|
-
|
|
543
|
-
* Gets items from the SearchClient and the AdClient.
|
|
544
|
-
*/
|
|
545
|
-
getItems: (searchParams: SearchParams, itemsCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void, adCallback: (adClientResponseItems: AdClientResponseItem[]) => void) => void;
|
|
577
|
+
getResponseItems: (properties: SearchClientRequestProperties | string, searchCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void, adCallback: (items: AdClientResponseItem[]) => void) => void;
|
|
546
578
|
}
|
|
547
579
|
/**
|
|
548
580
|
* Callable functions made available by the SearchcraftStore.
|
|
549
581
|
*/
|
|
550
582
|
export interface SearchcraftStateFunctions {
|
|
551
|
-
addFacetPathsForIndexField: (
|
|
552
|
-
addRangeValueForIndexField: (
|
|
553
|
-
|
|
554
|
-
|
|
583
|
+
addFacetPathsForIndexField: (field: FacetPathsForIndexField) => void;
|
|
584
|
+
addRangeValueForIndexField: (field: RangeValueForIndexField) => void;
|
|
585
|
+
getSearchcraftCore: () => SearchcraftCore | undefined;
|
|
586
|
+
init: (searchcraft: SearchcraftCore | undefined, debug?: boolean) => void;
|
|
555
587
|
removeFacetPathsForIndexField: (fieldName: string) => void;
|
|
556
588
|
removeRangeValueForIndexField: (fieldName: string) => void;
|
|
557
589
|
resetFacetPaths: () => void;
|
|
558
590
|
search: () => Promise<void>;
|
|
591
|
+
set: (state: Partial<SearchcraftState> | ((state: SearchcraftState) => Partial<SearchcraftState>)) => SearchcraftState;
|
|
592
|
+
setAdClientResponseItems: (items: AdClientResponseItem[]) => void;
|
|
593
|
+
setSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
|
|
594
|
+
setInitialSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
|
|
595
|
+
setInitialQuery: (query: string) => void;
|
|
559
596
|
setPopoverVisibility: (isVisible: boolean) => void;
|
|
560
|
-
|
|
597
|
+
setSearchResultsCount: (count: number) => void;
|
|
598
|
+
setSearchClientResponseItems: (items: SearchClientResponseItem[]) => void;
|
|
561
599
|
setSearchResultsPage: (page: number) => void;
|
|
562
600
|
setSearchResultsPerPage: (perPage: number) => void;
|
|
563
601
|
setSearchTerm: (searchTerm: string) => void;
|
|
564
602
|
setSearchMode: (mode: "fuzzy" | "exact") => void;
|
|
565
603
|
setSortType: (type: "asc" | "desc") => void;
|
|
604
|
+
setHotKeyAndHotKeyModifier: (hotkey?: string, hotkeyModifier?: "ctrl" | "meta" | "alt" | "option") => void;
|
|
566
605
|
}
|
|
567
606
|
/**
|
|
568
607
|
* Values stored in SearchcraftStore.
|
|
@@ -570,8 +609,12 @@ export interface SearchcraftStateFunctions {
|
|
|
570
609
|
export interface SearchcraftStateValues {
|
|
571
610
|
adClientResponseItems: AdClientResponseItem[];
|
|
572
611
|
core: SearchcraftCore | undefined;
|
|
612
|
+
hotkey: string;
|
|
613
|
+
hotkeyModifier: "ctrl" | "meta" | "alt" | "option";
|
|
573
614
|
logger: Logger | undefined;
|
|
574
615
|
facetPathsForIndexFields: Record<string, FacetPathsForIndexField>;
|
|
616
|
+
initialQuery: string;
|
|
617
|
+
initialSearchClientResponseItems: SearchClientResponseItem[];
|
|
575
618
|
isPopoverVisible: boolean;
|
|
576
619
|
isSearchInProgress: boolean;
|
|
577
620
|
rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
|
|
@@ -584,12 +627,11 @@ export interface SearchcraftStateValues {
|
|
|
584
627
|
searchResultsPerPage: number;
|
|
585
628
|
searchTerm: string;
|
|
586
629
|
sortType: "asc" | "desc";
|
|
630
|
+
afterInit: (state: SearchcraftState) => void;
|
|
587
631
|
}
|
|
588
632
|
export interface SearchcraftState extends SearchcraftStateFunctions, SearchcraftStateValues {
|
|
589
633
|
}
|
|
590
634
|
export declare const searchcraftStore: import("zustand").StoreApi<SearchcraftState>;
|
|
591
|
-
export declare function parseCustomStyles(styles: string | Record<string, string>): Record<string, string>;
|
|
592
|
-
export declare function serializeStyles(styles: Record<string, Record<string, string>>): string;
|
|
593
635
|
export type SearchcraftSelectOption = {
|
|
594
636
|
label: string;
|
|
595
637
|
value: string | number;
|
|
@@ -671,10 +713,10 @@ export namespace Components {
|
|
|
671
713
|
}
|
|
672
714
|
/**
|
|
673
715
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
674
|
-
* @import ```jsx
|
|
675
|
-
* // react
|
|
716
|
+
* @react-import ```jsx
|
|
676
717
|
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
677
|
-
*
|
|
718
|
+
* ```
|
|
719
|
+
* @vue-import ```jsx
|
|
678
720
|
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
679
721
|
* ```
|
|
680
722
|
* @js-example ```html
|
|
@@ -704,10 +746,10 @@ export namespace Components {
|
|
|
704
746
|
/**
|
|
705
747
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
706
748
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
707
|
-
* @import ```jsx
|
|
708
|
-
* // react
|
|
749
|
+
* @react-import ```jsx
|
|
709
750
|
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
710
|
-
*
|
|
751
|
+
* ```
|
|
752
|
+
* @vue-import ```jsx
|
|
711
753
|
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
712
754
|
* ```
|
|
713
755
|
* @js-example ```html
|
|
@@ -758,10 +800,10 @@ export namespace Components {
|
|
|
758
800
|
}
|
|
759
801
|
/**
|
|
760
802
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
761
|
-
* @import ```jsx
|
|
762
|
-
* // react
|
|
803
|
+
* @react-import ```jsx
|
|
763
804
|
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
764
|
-
*
|
|
805
|
+
* ```
|
|
806
|
+
* @vue-import ```jsx
|
|
765
807
|
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
766
808
|
* ```
|
|
767
809
|
* @js-example ```html
|
|
@@ -778,36 +820,65 @@ export namespace Components {
|
|
|
778
820
|
}
|
|
779
821
|
/**
|
|
780
822
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
781
|
-
* @import ```jsx
|
|
782
|
-
* // react
|
|
823
|
+
* @react-import ```jsx
|
|
783
824
|
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
784
|
-
*
|
|
825
|
+
* ````
|
|
826
|
+
* @vue-import ```jsx
|
|
785
827
|
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
786
828
|
* ```
|
|
787
829
|
* @js-example ```html
|
|
830
|
+
* <!-- index.html -->
|
|
788
831
|
* <searchcraft-popover-button>
|
|
789
832
|
* Open popover
|
|
790
833
|
* </searchcraft-popover-button>
|
|
791
834
|
* ```
|
|
835
|
+
* ```js
|
|
836
|
+
* // index.js
|
|
837
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
838
|
+
* popoverButton.template = ({ isPopoverVisible }, { html }) => html`
|
|
839
|
+
* <span>Click me</span>
|
|
840
|
+
* `;
|
|
841
|
+
* ```
|
|
792
842
|
* @react-example ```jsx
|
|
793
|
-
* <SearchcraftPopoverButton
|
|
843
|
+
* <SearchcraftPopoverButton
|
|
844
|
+
* template={({ isPopoverVisible }, { html }) => html`
|
|
845
|
+
* <span>Click me</span>
|
|
846
|
+
* `}
|
|
847
|
+
* >
|
|
794
848
|
* Open popover
|
|
795
849
|
* </SearchcraftPopoverButton>
|
|
796
850
|
* ```
|
|
797
851
|
* @vue-example ```jsx
|
|
798
|
-
* <SearchcraftPopoverButton
|
|
852
|
+
* <SearchcraftPopoverButton
|
|
853
|
+
* :template={({ isPopoverVisible }, { html }) => html`
|
|
854
|
+
* <span>Click me</span>
|
|
855
|
+
* `}
|
|
856
|
+
* >
|
|
799
857
|
* Open popover
|
|
800
858
|
* </SearchcraftPopoverButton>
|
|
801
859
|
* ```
|
|
802
860
|
*/
|
|
803
861
|
interface SearchcraftPopoverButton {
|
|
862
|
+
/**
|
|
863
|
+
* A callback function responsible for rendering the button contents.
|
|
864
|
+
*/
|
|
865
|
+
"template"?: PopoverButtonTemplate;
|
|
866
|
+
/**
|
|
867
|
+
* The type of popover button to render.
|
|
868
|
+
*/
|
|
869
|
+
"type"?: "skeuomorphic";
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
873
|
+
*/
|
|
874
|
+
interface SearchcraftPopoverFooter {
|
|
804
875
|
}
|
|
805
876
|
/**
|
|
806
877
|
* 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.
|
|
807
|
-
* @import ```jsx
|
|
808
|
-
* // react
|
|
878
|
+
* @react-import ```jsx
|
|
809
879
|
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
810
|
-
*
|
|
880
|
+
* ```
|
|
881
|
+
* @vue-import ```jsx
|
|
811
882
|
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
812
883
|
* ```
|
|
813
884
|
* @js-example ```html
|
|
@@ -877,10 +948,10 @@ export namespace Components {
|
|
|
877
948
|
}
|
|
878
949
|
/**
|
|
879
950
|
* This web component is designed to display the number of results returned from a search query.
|
|
880
|
-
* @import ```jsx
|
|
881
|
-
* // react
|
|
951
|
+
* @react-import ```jsx
|
|
882
952
|
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
883
|
-
*
|
|
953
|
+
* ```
|
|
954
|
+
* @vue-import ```jsx
|
|
884
955
|
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
885
956
|
* ```
|
|
886
957
|
* @js-example ```html
|
|
@@ -900,17 +971,18 @@ export namespace Components {
|
|
|
900
971
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
901
972
|
* `}
|
|
902
973
|
* />
|
|
974
|
+
* ```
|
|
903
975
|
* @vue-example ```jsx
|
|
904
976
|
* <SearchcraftResultsInfo
|
|
905
977
|
* :template={(info, { html }) => html`
|
|
906
978
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
907
979
|
* `}
|
|
908
980
|
* />
|
|
981
|
+
* ```
|
|
909
982
|
*/
|
|
910
983
|
interface SearchcraftResultsInfo {
|
|
911
984
|
/**
|
|
912
985
|
* A callback function responsible for rendering the results info.
|
|
913
|
-
* @example ```ts resultsInfo.template = html` ${range[0]}-${range[1]} of ${count} results in ${responseTime}ms `; ```
|
|
914
986
|
*/
|
|
915
987
|
"template"?: ResultsInfoTemplate;
|
|
916
988
|
}
|
|
@@ -934,10 +1006,10 @@ export namespace Components {
|
|
|
934
1006
|
}
|
|
935
1007
|
/**
|
|
936
1008
|
* 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.
|
|
937
|
-
* @import ```jsx
|
|
938
|
-
* // react
|
|
1009
|
+
* @react-import ```jsx
|
|
939
1010
|
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
940
|
-
*
|
|
1011
|
+
* ```
|
|
1012
|
+
* @vue-import ```jsx
|
|
941
1013
|
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
942
1014
|
* ```
|
|
943
1015
|
* @js-example ```html
|
|
@@ -974,6 +1046,10 @@ export namespace Components {
|
|
|
974
1046
|
* ```
|
|
975
1047
|
*/
|
|
976
1048
|
interface SearchcraftSearchResults {
|
|
1049
|
+
/**
|
|
1050
|
+
* A query that will appears when the component initializes or the search term is ''..
|
|
1051
|
+
*/
|
|
1052
|
+
"initialQuery"?: string;
|
|
977
1053
|
/**
|
|
978
1054
|
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
979
1055
|
*/
|
|
@@ -981,10 +1057,10 @@ export namespace Components {
|
|
|
981
1057
|
}
|
|
982
1058
|
/**
|
|
983
1059
|
* This web component is designed to choose the number of search results displayed.
|
|
984
|
-
* @import ```jsx
|
|
985
|
-
* // react
|
|
1060
|
+
* @react-import ```jsx
|
|
986
1061
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
987
|
-
*
|
|
1062
|
+
* ```
|
|
1063
|
+
* @vue-import ```jsx
|
|
988
1064
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
989
1065
|
* ```
|
|
990
1066
|
* @js-example ```html
|
|
@@ -1068,10 +1144,10 @@ export namespace Components {
|
|
|
1068
1144
|
}
|
|
1069
1145
|
/**
|
|
1070
1146
|
* 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.'
|
|
1071
|
-
* @import ```jsx
|
|
1072
|
-
* // react
|
|
1147
|
+
* @react-import ```jsx
|
|
1073
1148
|
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
1074
|
-
*
|
|
1149
|
+
* ```
|
|
1150
|
+
* @vue-import ```jsx
|
|
1075
1151
|
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
1076
1152
|
* ```
|
|
1077
1153
|
* @js-example ```html
|
|
@@ -1205,10 +1281,10 @@ declare global {
|
|
|
1205
1281
|
};
|
|
1206
1282
|
/**
|
|
1207
1283
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1208
|
-
* @import ```jsx
|
|
1209
|
-
* // react
|
|
1284
|
+
* @react-import ```jsx
|
|
1210
1285
|
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
1211
|
-
*
|
|
1286
|
+
* ```
|
|
1287
|
+
* @vue-import ```jsx
|
|
1212
1288
|
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
1213
1289
|
* ```
|
|
1214
1290
|
* @js-example ```html
|
|
@@ -1243,10 +1319,10 @@ declare global {
|
|
|
1243
1319
|
/**
|
|
1244
1320
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1245
1321
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1246
|
-
* @import ```jsx
|
|
1247
|
-
* // react
|
|
1322
|
+
* @react-import ```jsx
|
|
1248
1323
|
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
1249
|
-
*
|
|
1324
|
+
* ```
|
|
1325
|
+
* @vue-import ```jsx
|
|
1250
1326
|
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
1251
1327
|
* ```
|
|
1252
1328
|
* @js-example ```html
|
|
@@ -1287,10 +1363,10 @@ declare global {
|
|
|
1287
1363
|
};
|
|
1288
1364
|
/**
|
|
1289
1365
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1290
|
-
* @import ```jsx
|
|
1291
|
-
* // react
|
|
1366
|
+
* @react-import ```jsx
|
|
1292
1367
|
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
1293
|
-
*
|
|
1368
|
+
* ```
|
|
1369
|
+
* @vue-import ```jsx
|
|
1294
1370
|
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
1295
1371
|
* ```
|
|
1296
1372
|
* @js-example ```html
|
|
@@ -1311,24 +1387,40 @@ declare global {
|
|
|
1311
1387
|
};
|
|
1312
1388
|
/**
|
|
1313
1389
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
1314
|
-
* @import ```jsx
|
|
1315
|
-
* // react
|
|
1390
|
+
* @react-import ```jsx
|
|
1316
1391
|
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
1317
|
-
*
|
|
1392
|
+
* ````
|
|
1393
|
+
* @vue-import ```jsx
|
|
1318
1394
|
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
1319
1395
|
* ```
|
|
1320
1396
|
* @js-example ```html
|
|
1397
|
+
* <!-- index.html -->
|
|
1321
1398
|
* <searchcraft-popover-button>
|
|
1322
1399
|
* Open popover
|
|
1323
1400
|
* </searchcraft-popover-button>
|
|
1324
1401
|
* ```
|
|
1402
|
+
* ```js
|
|
1403
|
+
* // index.js
|
|
1404
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
1405
|
+
* popoverButton.template = ({ isPopoverVisible }, { html }) => html`
|
|
1406
|
+
* <span>Click me</span>
|
|
1407
|
+
* `;
|
|
1408
|
+
* ```
|
|
1325
1409
|
* @react-example ```jsx
|
|
1326
|
-
* <SearchcraftPopoverButton
|
|
1410
|
+
* <SearchcraftPopoverButton
|
|
1411
|
+
* template={({ isPopoverVisible }, { html }) => html`
|
|
1412
|
+
* <span>Click me</span>
|
|
1413
|
+
* `}
|
|
1414
|
+
* >
|
|
1327
1415
|
* Open popover
|
|
1328
1416
|
* </SearchcraftPopoverButton>
|
|
1329
1417
|
* ```
|
|
1330
1418
|
* @vue-example ```jsx
|
|
1331
|
-
* <SearchcraftPopoverButton
|
|
1419
|
+
* <SearchcraftPopoverButton
|
|
1420
|
+
* :template={({ isPopoverVisible }, { html }) => html`
|
|
1421
|
+
* <span>Click me</span>
|
|
1422
|
+
* `}
|
|
1423
|
+
* >
|
|
1332
1424
|
* Open popover
|
|
1333
1425
|
* </SearchcraftPopoverButton>
|
|
1334
1426
|
* ```
|
|
@@ -1339,12 +1431,21 @@ declare global {
|
|
|
1339
1431
|
prototype: HTMLSearchcraftPopoverButtonElement;
|
|
1340
1432
|
new (): HTMLSearchcraftPopoverButtonElement;
|
|
1341
1433
|
};
|
|
1434
|
+
/**
|
|
1435
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
1436
|
+
*/
|
|
1437
|
+
interface HTMLSearchcraftPopoverFooterElement extends Components.SearchcraftPopoverFooter, HTMLStencilElement {
|
|
1438
|
+
}
|
|
1439
|
+
var HTMLSearchcraftPopoverFooterElement: {
|
|
1440
|
+
prototype: HTMLSearchcraftPopoverFooterElement;
|
|
1441
|
+
new (): HTMLSearchcraftPopoverFooterElement;
|
|
1442
|
+
};
|
|
1342
1443
|
/**
|
|
1343
1444
|
* 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.
|
|
1344
|
-
* @import ```jsx
|
|
1345
|
-
* // react
|
|
1445
|
+
* @react-import ```jsx
|
|
1346
1446
|
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
1347
|
-
*
|
|
1447
|
+
* ```
|
|
1448
|
+
* @vue-import ```jsx
|
|
1348
1449
|
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
1349
1450
|
* ```
|
|
1350
1451
|
* @js-example ```html
|
|
@@ -1393,10 +1494,10 @@ declare global {
|
|
|
1393
1494
|
};
|
|
1394
1495
|
/**
|
|
1395
1496
|
* This web component is designed to display the number of results returned from a search query.
|
|
1396
|
-
* @import ```jsx
|
|
1397
|
-
* // react
|
|
1497
|
+
* @react-import ```jsx
|
|
1398
1498
|
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
1399
|
-
*
|
|
1499
|
+
* ```
|
|
1500
|
+
* @vue-import ```jsx
|
|
1400
1501
|
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
1401
1502
|
* ```
|
|
1402
1503
|
* @js-example ```html
|
|
@@ -1416,12 +1517,14 @@ declare global {
|
|
|
1416
1517
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1417
1518
|
* `}
|
|
1418
1519
|
* />
|
|
1520
|
+
* ```
|
|
1419
1521
|
* @vue-example ```jsx
|
|
1420
1522
|
* <SearchcraftResultsInfo
|
|
1421
1523
|
* :template={(info, { html }) => html`
|
|
1422
1524
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1423
1525
|
* `}
|
|
1424
1526
|
* />
|
|
1527
|
+
* ```
|
|
1425
1528
|
*/
|
|
1426
1529
|
interface HTMLSearchcraftResultsInfoElement extends Components.SearchcraftResultsInfo, HTMLStencilElement {
|
|
1427
1530
|
}
|
|
@@ -1440,10 +1543,10 @@ declare global {
|
|
|
1440
1543
|
};
|
|
1441
1544
|
/**
|
|
1442
1545
|
* 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.
|
|
1443
|
-
* @import ```jsx
|
|
1444
|
-
* // react
|
|
1546
|
+
* @react-import ```jsx
|
|
1445
1547
|
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
1446
|
-
*
|
|
1548
|
+
* ```
|
|
1549
|
+
* @vue-import ```jsx
|
|
1447
1550
|
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
1448
1551
|
* ```
|
|
1449
1552
|
* @js-example ```html
|
|
@@ -1487,10 +1590,10 @@ declare global {
|
|
|
1487
1590
|
};
|
|
1488
1591
|
/**
|
|
1489
1592
|
* This web component is designed to choose the number of search results displayed.
|
|
1490
|
-
* @import ```jsx
|
|
1491
|
-
* // react
|
|
1593
|
+
* @react-import ```jsx
|
|
1492
1594
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
1493
|
-
*
|
|
1595
|
+
* ```
|
|
1596
|
+
* @vue-import ```jsx
|
|
1494
1597
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
1495
1598
|
* ```
|
|
1496
1599
|
* @js-example ```html
|
|
@@ -1560,10 +1663,10 @@ declare global {
|
|
|
1560
1663
|
};
|
|
1561
1664
|
/**
|
|
1562
1665
|
* 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.'
|
|
1563
|
-
* @import ```jsx
|
|
1564
|
-
* // react
|
|
1666
|
+
* @react-import ```jsx
|
|
1565
1667
|
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
1566
|
-
*
|
|
1668
|
+
* ```
|
|
1669
|
+
* @vue-import ```jsx
|
|
1567
1670
|
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
1568
1671
|
* ```
|
|
1569
1672
|
* @js-example ```html
|
|
@@ -1612,6 +1715,7 @@ declare global {
|
|
|
1612
1715
|
"searchcraft-input-label": HTMLSearchcraftInputLabelElement;
|
|
1613
1716
|
"searchcraft-pagination": HTMLSearchcraftPaginationElement;
|
|
1614
1717
|
"searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
|
|
1718
|
+
"searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
|
|
1615
1719
|
"searchcraft-popover-form": HTMLSearchcraftPopoverFormElement;
|
|
1616
1720
|
"searchcraft-popover-list-item": HTMLSearchcraftPopoverListItemElement;
|
|
1617
1721
|
"searchcraft-popover-list-view": HTMLSearchcraftPopoverListViewElement;
|
|
@@ -1711,10 +1815,10 @@ declare namespace LocalJSX {
|
|
|
1711
1815
|
}
|
|
1712
1816
|
/**
|
|
1713
1817
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1714
|
-
* @import ```jsx
|
|
1715
|
-
* // react
|
|
1818
|
+
* @react-import ```jsx
|
|
1716
1819
|
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
1717
|
-
*
|
|
1820
|
+
* ```
|
|
1821
|
+
* @vue-import ```jsx
|
|
1718
1822
|
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
1719
1823
|
* ```
|
|
1720
1824
|
* @js-example ```html
|
|
@@ -1744,10 +1848,10 @@ declare namespace LocalJSX {
|
|
|
1744
1848
|
/**
|
|
1745
1849
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1746
1850
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1747
|
-
* @import ```jsx
|
|
1748
|
-
* // react
|
|
1851
|
+
* @react-import ```jsx
|
|
1749
1852
|
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
1750
|
-
*
|
|
1853
|
+
* ```
|
|
1854
|
+
* @vue-import ```jsx
|
|
1751
1855
|
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
1752
1856
|
* ```
|
|
1753
1857
|
* @js-example ```html
|
|
@@ -1810,10 +1914,10 @@ declare namespace LocalJSX {
|
|
|
1810
1914
|
}
|
|
1811
1915
|
/**
|
|
1812
1916
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1813
|
-
* @import ```jsx
|
|
1814
|
-
* // react
|
|
1917
|
+
* @react-import ```jsx
|
|
1815
1918
|
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
1816
|
-
*
|
|
1919
|
+
* ```
|
|
1920
|
+
* @vue-import ```jsx
|
|
1817
1921
|
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
1818
1922
|
* ```
|
|
1819
1923
|
* @js-example ```html
|
|
@@ -1830,36 +1934,65 @@ declare namespace LocalJSX {
|
|
|
1830
1934
|
}
|
|
1831
1935
|
/**
|
|
1832
1936
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
1833
|
-
* @import ```jsx
|
|
1834
|
-
* // react
|
|
1937
|
+
* @react-import ```jsx
|
|
1835
1938
|
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
1836
|
-
*
|
|
1939
|
+
* ````
|
|
1940
|
+
* @vue-import ```jsx
|
|
1837
1941
|
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
1838
1942
|
* ```
|
|
1839
1943
|
* @js-example ```html
|
|
1944
|
+
* <!-- index.html -->
|
|
1840
1945
|
* <searchcraft-popover-button>
|
|
1841
1946
|
* Open popover
|
|
1842
1947
|
* </searchcraft-popover-button>
|
|
1843
1948
|
* ```
|
|
1949
|
+
* ```js
|
|
1950
|
+
* // index.js
|
|
1951
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
1952
|
+
* popoverButton.template = ({ isPopoverVisible }, { html }) => html`
|
|
1953
|
+
* <span>Click me</span>
|
|
1954
|
+
* `;
|
|
1955
|
+
* ```
|
|
1844
1956
|
* @react-example ```jsx
|
|
1845
|
-
* <SearchcraftPopoverButton
|
|
1957
|
+
* <SearchcraftPopoverButton
|
|
1958
|
+
* template={({ isPopoverVisible }, { html }) => html`
|
|
1959
|
+
* <span>Click me</span>
|
|
1960
|
+
* `}
|
|
1961
|
+
* >
|
|
1846
1962
|
* Open popover
|
|
1847
1963
|
* </SearchcraftPopoverButton>
|
|
1848
1964
|
* ```
|
|
1849
1965
|
* @vue-example ```jsx
|
|
1850
|
-
* <SearchcraftPopoverButton
|
|
1966
|
+
* <SearchcraftPopoverButton
|
|
1967
|
+
* :template={({ isPopoverVisible }, { html }) => html`
|
|
1968
|
+
* <span>Click me</span>
|
|
1969
|
+
* `}
|
|
1970
|
+
* >
|
|
1851
1971
|
* Open popover
|
|
1852
1972
|
* </SearchcraftPopoverButton>
|
|
1853
1973
|
* ```
|
|
1854
1974
|
*/
|
|
1855
1975
|
interface SearchcraftPopoverButton {
|
|
1976
|
+
/**
|
|
1977
|
+
* A callback function responsible for rendering the button contents.
|
|
1978
|
+
*/
|
|
1979
|
+
"template"?: PopoverButtonTemplate;
|
|
1980
|
+
/**
|
|
1981
|
+
* The type of popover button to render.
|
|
1982
|
+
*/
|
|
1983
|
+
"type"?: "skeuomorphic";
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
1987
|
+
*/
|
|
1988
|
+
interface SearchcraftPopoverFooter {
|
|
1856
1989
|
}
|
|
1857
1990
|
/**
|
|
1858
1991
|
* 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.
|
|
1859
|
-
* @import ```jsx
|
|
1860
|
-
* // react
|
|
1992
|
+
* @react-import ```jsx
|
|
1861
1993
|
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
1862
|
-
*
|
|
1994
|
+
* ```
|
|
1995
|
+
* @vue-import ```jsx
|
|
1863
1996
|
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
1864
1997
|
* ```
|
|
1865
1998
|
* @js-example ```html
|
|
@@ -1929,10 +2062,10 @@ declare namespace LocalJSX {
|
|
|
1929
2062
|
}
|
|
1930
2063
|
/**
|
|
1931
2064
|
* This web component is designed to display the number of results returned from a search query.
|
|
1932
|
-
* @import ```jsx
|
|
1933
|
-
* // react
|
|
2065
|
+
* @react-import ```jsx
|
|
1934
2066
|
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
1935
|
-
*
|
|
2067
|
+
* ```
|
|
2068
|
+
* @vue-import ```jsx
|
|
1936
2069
|
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
1937
2070
|
* ```
|
|
1938
2071
|
* @js-example ```html
|
|
@@ -1952,17 +2085,18 @@ declare namespace LocalJSX {
|
|
|
1952
2085
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1953
2086
|
* `}
|
|
1954
2087
|
* />
|
|
2088
|
+
* ```
|
|
1955
2089
|
* @vue-example ```jsx
|
|
1956
2090
|
* <SearchcraftResultsInfo
|
|
1957
2091
|
* :template={(info, { html }) => html`
|
|
1958
2092
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1959
2093
|
* `}
|
|
1960
2094
|
* />
|
|
2095
|
+
* ```
|
|
1961
2096
|
*/
|
|
1962
2097
|
interface SearchcraftResultsInfo {
|
|
1963
2098
|
/**
|
|
1964
2099
|
* A callback function responsible for rendering the results info.
|
|
1965
|
-
* @example ```ts resultsInfo.template = html` ${range[0]}-${range[1]} of ${count} results in ${responseTime}ms `; ```
|
|
1966
2100
|
*/
|
|
1967
2101
|
"template"?: ResultsInfoTemplate;
|
|
1968
2102
|
}
|
|
@@ -1986,10 +2120,10 @@ declare namespace LocalJSX {
|
|
|
1986
2120
|
}
|
|
1987
2121
|
/**
|
|
1988
2122
|
* 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.
|
|
1989
|
-
* @import ```jsx
|
|
1990
|
-
* // react
|
|
2123
|
+
* @react-import ```jsx
|
|
1991
2124
|
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
1992
|
-
*
|
|
2125
|
+
* ```
|
|
2126
|
+
* @vue-import ```jsx
|
|
1993
2127
|
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
1994
2128
|
* ```
|
|
1995
2129
|
* @js-example ```html
|
|
@@ -2026,6 +2160,10 @@ declare namespace LocalJSX {
|
|
|
2026
2160
|
* ```
|
|
2027
2161
|
*/
|
|
2028
2162
|
interface SearchcraftSearchResults {
|
|
2163
|
+
/**
|
|
2164
|
+
* A query that will appears when the component initializes or the search term is ''..
|
|
2165
|
+
*/
|
|
2166
|
+
"initialQuery"?: string;
|
|
2029
2167
|
/**
|
|
2030
2168
|
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
2031
2169
|
*/
|
|
@@ -2033,10 +2171,10 @@ declare namespace LocalJSX {
|
|
|
2033
2171
|
}
|
|
2034
2172
|
/**
|
|
2035
2173
|
* This web component is designed to choose the number of search results displayed.
|
|
2036
|
-
* @import ```jsx
|
|
2037
|
-
* // react
|
|
2174
|
+
* @react-import ```jsx
|
|
2038
2175
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
2039
|
-
*
|
|
2176
|
+
* ```
|
|
2177
|
+
* @vue-import ```jsx
|
|
2040
2178
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
2041
2179
|
* ```
|
|
2042
2180
|
* @js-example ```html
|
|
@@ -2128,10 +2266,10 @@ declare namespace LocalJSX {
|
|
|
2128
2266
|
}
|
|
2129
2267
|
/**
|
|
2130
2268
|
* 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.'
|
|
2131
|
-
* @import ```jsx
|
|
2132
|
-
* // react
|
|
2269
|
+
* @react-import ```jsx
|
|
2133
2270
|
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
2134
|
-
*
|
|
2271
|
+
* ```
|
|
2272
|
+
* @vue-import ```jsx
|
|
2135
2273
|
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
2136
2274
|
* ```
|
|
2137
2275
|
* @js-example ```html
|
|
@@ -2173,6 +2311,7 @@ declare namespace LocalJSX {
|
|
|
2173
2311
|
"searchcraft-input-label": SearchcraftInputLabel;
|
|
2174
2312
|
"searchcraft-pagination": SearchcraftPagination;
|
|
2175
2313
|
"searchcraft-popover-button": SearchcraftPopoverButton;
|
|
2314
|
+
"searchcraft-popover-footer": SearchcraftPopoverFooter;
|
|
2176
2315
|
"searchcraft-popover-form": SearchcraftPopoverForm;
|
|
2177
2316
|
"searchcraft-popover-list-item": SearchcraftPopoverListItem;
|
|
2178
2317
|
"searchcraft-popover-list-view": SearchcraftPopoverListView;
|
|
@@ -2225,10 +2364,10 @@ declare module "@stencil/core" {
|
|
|
2225
2364
|
"searchcraft-facet-list": LocalJSX.SearchcraftFacetList & JSXBase.HTMLAttributes<HTMLSearchcraftFacetListElement>;
|
|
2226
2365
|
/**
|
|
2227
2366
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
2228
|
-
* @import ```jsx
|
|
2229
|
-
* // react
|
|
2367
|
+
* @react-import ```jsx
|
|
2230
2368
|
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
2231
|
-
*
|
|
2369
|
+
* ```
|
|
2370
|
+
* @vue-import ```jsx
|
|
2232
2371
|
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
2233
2372
|
* ```
|
|
2234
2373
|
* @js-example ```html
|
|
@@ -2253,10 +2392,10 @@ declare module "@stencil/core" {
|
|
|
2253
2392
|
/**
|
|
2254
2393
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
2255
2394
|
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
2256
|
-
* @import ```jsx
|
|
2257
|
-
* // react
|
|
2395
|
+
* @react-import ```jsx
|
|
2258
2396
|
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
2259
|
-
*
|
|
2397
|
+
* ```
|
|
2398
|
+
* @vue-import ```jsx
|
|
2260
2399
|
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
2261
2400
|
* ```
|
|
2262
2401
|
* @js-example ```html
|
|
@@ -2279,10 +2418,10 @@ declare module "@stencil/core" {
|
|
|
2279
2418
|
"searchcraft-input-label": LocalJSX.SearchcraftInputLabel & JSXBase.HTMLAttributes<HTMLSearchcraftInputLabelElement>;
|
|
2280
2419
|
/**
|
|
2281
2420
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
2282
|
-
* @import ```jsx
|
|
2283
|
-
* // react
|
|
2421
|
+
* @react-import ```jsx
|
|
2284
2422
|
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
2285
|
-
*
|
|
2423
|
+
* ```
|
|
2424
|
+
* @vue-import ```jsx
|
|
2286
2425
|
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
2287
2426
|
* ```
|
|
2288
2427
|
* @js-example ```html
|
|
@@ -2298,35 +2437,55 @@ declare module "@stencil/core" {
|
|
|
2298
2437
|
"searchcraft-pagination": LocalJSX.SearchcraftPagination & JSXBase.HTMLAttributes<HTMLSearchcraftPaginationElement>;
|
|
2299
2438
|
/**
|
|
2300
2439
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
2301
|
-
* @import ```jsx
|
|
2302
|
-
* // react
|
|
2440
|
+
* @react-import ```jsx
|
|
2303
2441
|
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
2304
|
-
*
|
|
2442
|
+
* ````
|
|
2443
|
+
* @vue-import ```jsx
|
|
2305
2444
|
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
2306
2445
|
* ```
|
|
2307
2446
|
* @js-example ```html
|
|
2447
|
+
* <!-- index.html -->
|
|
2308
2448
|
* <searchcraft-popover-button>
|
|
2309
2449
|
* Open popover
|
|
2310
2450
|
* </searchcraft-popover-button>
|
|
2311
2451
|
* ```
|
|
2452
|
+
* ```js
|
|
2453
|
+
* // index.js
|
|
2454
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
2455
|
+
* popoverButton.template = ({ isPopoverVisible }, { html }) => html`
|
|
2456
|
+
* <span>Click me</span>
|
|
2457
|
+
* `;
|
|
2458
|
+
* ```
|
|
2312
2459
|
* @react-example ```jsx
|
|
2313
|
-
* <SearchcraftPopoverButton
|
|
2460
|
+
* <SearchcraftPopoverButton
|
|
2461
|
+
* template={({ isPopoverVisible }, { html }) => html`
|
|
2462
|
+
* <span>Click me</span>
|
|
2463
|
+
* `}
|
|
2464
|
+
* >
|
|
2314
2465
|
* Open popover
|
|
2315
2466
|
* </SearchcraftPopoverButton>
|
|
2316
2467
|
* ```
|
|
2317
2468
|
* @vue-example ```jsx
|
|
2318
|
-
* <SearchcraftPopoverButton
|
|
2469
|
+
* <SearchcraftPopoverButton
|
|
2470
|
+
* :template={({ isPopoverVisible }, { html }) => html`
|
|
2471
|
+
* <span>Click me</span>
|
|
2472
|
+
* `}
|
|
2473
|
+
* >
|
|
2319
2474
|
* Open popover
|
|
2320
2475
|
* </SearchcraftPopoverButton>
|
|
2321
2476
|
* ```
|
|
2322
2477
|
*/
|
|
2323
2478
|
"searchcraft-popover-button": LocalJSX.SearchcraftPopoverButton & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverButtonElement>;
|
|
2479
|
+
/**
|
|
2480
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
2481
|
+
*/
|
|
2482
|
+
"searchcraft-popover-footer": LocalJSX.SearchcraftPopoverFooter & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverFooterElement>;
|
|
2324
2483
|
/**
|
|
2325
2484
|
* 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.
|
|
2326
|
-
* @import ```jsx
|
|
2327
|
-
* // react
|
|
2485
|
+
* @react-import ```jsx
|
|
2328
2486
|
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
2329
|
-
*
|
|
2487
|
+
* ```
|
|
2488
|
+
* @vue-import ```jsx
|
|
2330
2489
|
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
2331
2490
|
* ```
|
|
2332
2491
|
* @js-example ```html
|
|
@@ -2360,10 +2519,10 @@ declare module "@stencil/core" {
|
|
|
2360
2519
|
"searchcraft-popover-list-view": LocalJSX.SearchcraftPopoverListView & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverListViewElement>;
|
|
2361
2520
|
/**
|
|
2362
2521
|
* This web component is designed to display the number of results returned from a search query.
|
|
2363
|
-
* @import ```jsx
|
|
2364
|
-
* // react
|
|
2522
|
+
* @react-import ```jsx
|
|
2365
2523
|
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
2366
|
-
*
|
|
2524
|
+
* ```
|
|
2525
|
+
* @vue-import ```jsx
|
|
2367
2526
|
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
2368
2527
|
* ```
|
|
2369
2528
|
* @js-example ```html
|
|
@@ -2383,12 +2542,14 @@ declare module "@stencil/core" {
|
|
|
2383
2542
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2384
2543
|
* `}
|
|
2385
2544
|
* />
|
|
2545
|
+
* ```
|
|
2386
2546
|
* @vue-example ```jsx
|
|
2387
2547
|
* <SearchcraftResultsInfo
|
|
2388
2548
|
* :template={(info, { html }) => html`
|
|
2389
2549
|
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2390
2550
|
* `}
|
|
2391
2551
|
* />
|
|
2552
|
+
* ```
|
|
2392
2553
|
*/
|
|
2393
2554
|
"searchcraft-results-info": LocalJSX.SearchcraftResultsInfo & JSXBase.HTMLAttributes<HTMLSearchcraftResultsInfoElement>;
|
|
2394
2555
|
/**
|
|
@@ -2397,10 +2558,10 @@ declare module "@stencil/core" {
|
|
|
2397
2558
|
"searchcraft-search-result": LocalJSX.SearchcraftSearchResult & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultElement>;
|
|
2398
2559
|
/**
|
|
2399
2560
|
* 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.
|
|
2400
|
-
* @import ```jsx
|
|
2401
|
-
* // react
|
|
2561
|
+
* @react-import ```jsx
|
|
2402
2562
|
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
2403
|
-
*
|
|
2563
|
+
* ```
|
|
2564
|
+
* @vue-import ```jsx
|
|
2404
2565
|
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
2405
2566
|
* ```
|
|
2406
2567
|
* @js-example ```html
|
|
@@ -2439,10 +2600,10 @@ declare module "@stencil/core" {
|
|
|
2439
2600
|
"searchcraft-search-results": LocalJSX.SearchcraftSearchResults & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultsElement>;
|
|
2440
2601
|
/**
|
|
2441
2602
|
* This web component is designed to choose the number of search results displayed.
|
|
2442
|
-
* @import ```jsx
|
|
2443
|
-
* // react
|
|
2603
|
+
* @react-import ```jsx
|
|
2444
2604
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
2445
|
-
*
|
|
2605
|
+
* ```
|
|
2606
|
+
* @vue-import ```jsx
|
|
2446
2607
|
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
2447
2608
|
* ```
|
|
2448
2609
|
* @js-example ```html
|
|
@@ -2475,10 +2636,10 @@ declare module "@stencil/core" {
|
|
|
2475
2636
|
"searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
|
|
2476
2637
|
/**
|
|
2477
2638
|
* 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.'
|
|
2478
|
-
* @import ```jsx
|
|
2479
|
-
* // react
|
|
2639
|
+
* @react-import ```jsx
|
|
2480
2640
|
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
2481
|
-
*
|
|
2641
|
+
* ```
|
|
2642
|
+
* @vue-import ```jsx
|
|
2482
2643
|
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
2483
2644
|
* ```
|
|
2484
2645
|
* @js-example ```html
|