@backstage/plugin-search-react 1.4.0-next.2 → 1.5.0-next.0
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/CHANGELOG.md +63 -0
- package/dist/index.d.ts +170 -132
- package/dist/index.esm.js +275 -168
- package/dist/index.esm.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @backstage/plugin-search-react
|
|
2
2
|
|
|
3
|
+
## 1.5.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0eaa579f89: - Create the search results extensions, for more details see the documentation [here](https://backstage.io/docs/features/search/how-to-guides#how-to-render-search-results-using-extensions);
|
|
8
|
+
- Update the `SearchResult`, `SearchResultList` and `SearchResultGroup` components to use extensions and default their props to optionally accept a query, when the query is not passed, the component tries to get it from the search context.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/core-components@0.12.4-next.0
|
|
14
|
+
- @backstage/core-plugin-api@1.3.0
|
|
15
|
+
- @backstage/theme@0.2.16
|
|
16
|
+
- @backstage/types@1.0.2
|
|
17
|
+
- @backstage/version-bridge@1.0.3
|
|
18
|
+
- @backstage/plugin-search-common@1.2.1
|
|
19
|
+
|
|
20
|
+
## 1.4.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 6d9a93def8: Allow customizing empty state component through `noResultsComponent` property.
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
<SearchResult noResultsComponent={<>No results were found</>}>
|
|
30
|
+
{({ results }) => (
|
|
31
|
+
<List>
|
|
32
|
+
{results.map(({ type, document }) => {
|
|
33
|
+
switch (type) {
|
|
34
|
+
case 'custom-result-item':
|
|
35
|
+
return (
|
|
36
|
+
<CustomResultListItem
|
|
37
|
+
key={document.location}
|
|
38
|
+
result={document}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
default:
|
|
42
|
+
return (
|
|
43
|
+
<DefaultResultListItem
|
|
44
|
+
key={document.location}
|
|
45
|
+
result={document}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
})}
|
|
50
|
+
</List>
|
|
51
|
+
)}
|
|
52
|
+
</SearchResult>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- 80ce4e8c29: Small updates to some components to ensure theme typography properties are inherited correctly.
|
|
58
|
+
- Updated dependencies
|
|
59
|
+
- @backstage/core-components@0.12.3
|
|
60
|
+
- @backstage/core-plugin-api@1.3.0
|
|
61
|
+
- @backstage/theme@0.2.16
|
|
62
|
+
- @backstage/types@1.0.2
|
|
63
|
+
- @backstage/version-bridge@1.0.3
|
|
64
|
+
- @backstage/plugin-search-common@1.2.1
|
|
65
|
+
|
|
3
66
|
## 1.4.0-next.2
|
|
4
67
|
|
|
5
68
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
|
+
import { Extension } from '@backstage/core-plugin-api';
|
|
3
4
|
import { SearchQuery, SearchResultSet, SearchResult as SearchResult$1, SearchDocument, ResultHighlight } from '@backstage/plugin-search-common';
|
|
4
|
-
import React, {
|
|
5
|
-
import { InputBaseProps, ListItemTextProps,
|
|
5
|
+
import React, { ReactNode, ForwardRefExoticComponent, ReactElement, PropsWithChildren } from 'react';
|
|
6
|
+
import { ListProps, InputBaseProps, ListItemTextProps, TypographyProps } from '@material-ui/core';
|
|
6
7
|
import { AutocompleteProps } from '@material-ui/lab';
|
|
7
8
|
import { AsyncState } from 'react-use/lib/useAsync';
|
|
8
9
|
import { JsonValue, JsonObject } from '@backstage/types';
|
|
@@ -29,6 +30,53 @@ declare class MockSearchApi implements SearchApi {
|
|
|
29
30
|
query(): Promise<SearchResultSet>;
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
* Options for {@link createSearchResultListItemExtension}.
|
|
36
|
+
*/
|
|
37
|
+
declare type SearchResultListItemExtensionOptions<Component extends (props: any) => JSX.Element | null> = {
|
|
38
|
+
/**
|
|
39
|
+
* The extension name.
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* The extension component.
|
|
44
|
+
*/
|
|
45
|
+
component: () => Promise<Component>;
|
|
46
|
+
/**
|
|
47
|
+
* When an extension defines a predicate, it returns true if the result should be rendered by that extension.
|
|
48
|
+
* Defaults to a predicate that returns true, which means it renders all sorts of results.
|
|
49
|
+
*/
|
|
50
|
+
predicate?: (result: SearchResult$1) => boolean;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @public
|
|
54
|
+
* Creates a search result item extension.
|
|
55
|
+
* @param options - The extension options, see {@link SearchResultListItemExtensionOptions} for more details.
|
|
56
|
+
*/
|
|
57
|
+
declare const createSearchResultListItemExtension: <Component extends (props: any) => JSX.Element | null>(options: SearchResultListItemExtensionOptions<Component>) => Extension<Component>;
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
* Returns a function that renders a result using extensions.
|
|
61
|
+
*/
|
|
62
|
+
declare const useSearchResultListItemExtensions: (children: ReactNode) => (result: SearchResult$1, key?: number) => JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* @public
|
|
65
|
+
* Props for {@link SearchResultListItemExtensions}
|
|
66
|
+
*/
|
|
67
|
+
declare type SearchResultListItemExtensionsProps = Omit<ListProps, 'results'> & {
|
|
68
|
+
/**
|
|
69
|
+
* Search result list.
|
|
70
|
+
*/
|
|
71
|
+
results: SearchResult$1[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @public
|
|
75
|
+
* Render results using search extensions.
|
|
76
|
+
* @param props - see {@link SearchResultListItemExtensionsProps}
|
|
77
|
+
*/
|
|
78
|
+
declare const SearchResultListItemExtensions: (props: SearchResultListItemExtensionsProps) => JSX.Element;
|
|
79
|
+
|
|
32
80
|
/**
|
|
33
81
|
* Props for {@link HighlightedSearchResultText}.
|
|
34
82
|
*
|
|
@@ -186,6 +234,92 @@ declare const SearchFilter: {
|
|
|
186
234
|
Autocomplete(props: SearchAutocompleteFilterProps): JSX.Element;
|
|
187
235
|
};
|
|
188
236
|
|
|
237
|
+
/**
|
|
238
|
+
* A page limit option, this value must not be greater than 100.
|
|
239
|
+
* @public
|
|
240
|
+
*/
|
|
241
|
+
declare type SearchPaginationLimitOption<Current extends number = 101, Accumulator extends number[] = []> = Accumulator['length'] extends Current ? Accumulator[number] : SearchPaginationLimitOption<Current, [
|
|
242
|
+
...Accumulator,
|
|
243
|
+
Accumulator['length']
|
|
244
|
+
]>;
|
|
245
|
+
/**
|
|
246
|
+
* A page limit text, this function is called with a "\{ from, to, page, count \}" object.
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
declare type SearchPaginationLimitText = (params: {
|
|
250
|
+
from: number;
|
|
251
|
+
to: number;
|
|
252
|
+
page: number;
|
|
253
|
+
count: number;
|
|
254
|
+
}) => ReactNode;
|
|
255
|
+
/**
|
|
256
|
+
* Props for {@link SearchPaginationBase}.
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
declare type SearchPaginationBaseProps = {
|
|
260
|
+
/**
|
|
261
|
+
* The component class name.
|
|
262
|
+
*/
|
|
263
|
+
className?: string;
|
|
264
|
+
/**
|
|
265
|
+
* The total number of results.
|
|
266
|
+
* For an unknown number of items, provide -1.
|
|
267
|
+
* Defaults to -1.
|
|
268
|
+
*/
|
|
269
|
+
total?: number;
|
|
270
|
+
/**
|
|
271
|
+
* The cursor for the current page.
|
|
272
|
+
*/
|
|
273
|
+
cursor?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Callback fired when the current page cursor is changed.
|
|
276
|
+
*/
|
|
277
|
+
onCursorChange?: (pageCursor: string) => void;
|
|
278
|
+
/**
|
|
279
|
+
* The limit of results per page.
|
|
280
|
+
* Set -1 to display all the results.
|
|
281
|
+
*/
|
|
282
|
+
limit?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Customize the results per page label.
|
|
285
|
+
* Defaults to "Results per page:".
|
|
286
|
+
*/
|
|
287
|
+
limitLabel?: ReactNode;
|
|
288
|
+
/**
|
|
289
|
+
* Customize the results per page text.
|
|
290
|
+
* Defaults to "(\{ from, to, count \}) =\> count \> 0 ? `of $\{count\}` : `$\{from\}-$\{to\}`".
|
|
291
|
+
*/
|
|
292
|
+
limitText?: SearchPaginationLimitText;
|
|
293
|
+
/**
|
|
294
|
+
* Options for setting how many results show per page.
|
|
295
|
+
* If less than two options are available, no select field will be displayed.
|
|
296
|
+
* Use -1 for the value with a custom label to show all the results.
|
|
297
|
+
* Defaults to [10, 25, 50, 100].
|
|
298
|
+
*/
|
|
299
|
+
limitOptions?: SearchPaginationLimitOption[];
|
|
300
|
+
/**
|
|
301
|
+
* Callback fired when the number of results per page is changed.
|
|
302
|
+
*/
|
|
303
|
+
onLimitChange?: (value: number) => void;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* A component with controls for search results pagination.
|
|
307
|
+
* @param props - See {@link SearchPaginationBaseProps}.
|
|
308
|
+
* @public
|
|
309
|
+
*/
|
|
310
|
+
declare const SearchPaginationBase: (props: SearchPaginationBaseProps) => JSX.Element;
|
|
311
|
+
/**
|
|
312
|
+
* Props for {@link SearchPagination}.
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
declare type SearchPaginationProps = Omit<SearchPaginationBaseProps, 'pageLimit' | 'onPageLimitChange' | 'pageCursor' | 'onPageCursorChange'>;
|
|
316
|
+
/**
|
|
317
|
+
* A component for setting the search context page limit and cursor.
|
|
318
|
+
* @param props - See {@link SearchPaginationProps}.
|
|
319
|
+
* @public
|
|
320
|
+
*/
|
|
321
|
+
declare const SearchPagination: (props: SearchPaginationProps) => JSX.Element;
|
|
322
|
+
|
|
189
323
|
/**
|
|
190
324
|
* Props for {@link SearchResultContext}
|
|
191
325
|
* @public
|
|
@@ -194,7 +328,7 @@ declare type SearchResultContextProps = {
|
|
|
194
328
|
/**
|
|
195
329
|
* A child function that receives an asynchronous result set and returns a react element.
|
|
196
330
|
*/
|
|
197
|
-
children: (state: AsyncState<SearchResultSet>) => JSX.Element | null;
|
|
331
|
+
children: (state: AsyncState<SearchResultSet>, query: Partial<SearchQuery>) => JSX.Element | null;
|
|
198
332
|
};
|
|
199
333
|
/**
|
|
200
334
|
* Provides context-based results to a child function.
|
|
@@ -293,8 +427,8 @@ declare const SearchResultState: (props: SearchResultStateProps) => JSX.Element;
|
|
|
293
427
|
* Props for {@link SearchResult}
|
|
294
428
|
* @public
|
|
295
429
|
*/
|
|
296
|
-
declare type SearchResultProps = Pick<SearchResultStateProps, 'query'> & {
|
|
297
|
-
children
|
|
430
|
+
declare type SearchResultProps = Pick<SearchResultStateProps, 'query'> & Omit<SearchResultListItemExtensionsProps, 'results' | 'children'> & {
|
|
431
|
+
children?: ReactNode | ((resultSet: SearchResultSet) => JSX.Element);
|
|
298
432
|
noResultsComponent?: JSX.Element;
|
|
299
433
|
};
|
|
300
434
|
/**
|
|
@@ -312,101 +446,18 @@ declare const SearchResultComponent: (props: SearchResultProps) => JSX.Element;
|
|
|
312
446
|
declare const SearchResult: (props: SearchResultProps) => JSX.Element;
|
|
313
447
|
|
|
314
448
|
/**
|
|
449
|
+
* Props for {@link SearchResultListLayout}
|
|
315
450
|
* @public
|
|
316
451
|
*/
|
|
317
|
-
declare
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* A page limit option, this value must not be greater than 100.
|
|
321
|
-
* @public
|
|
322
|
-
*/
|
|
323
|
-
declare type SearchPaginationLimitOption<Current extends number = 101, Accumulator extends number[] = []> = Accumulator['length'] extends Current ? Accumulator[number] : SearchPaginationLimitOption<Current, [
|
|
324
|
-
...Accumulator,
|
|
325
|
-
Accumulator['length']
|
|
326
|
-
]>;
|
|
327
|
-
/**
|
|
328
|
-
* A page limit text, this function is called with a "\{ from, to, page, count \}" object.
|
|
329
|
-
* @public
|
|
330
|
-
*/
|
|
331
|
-
declare type SearchPaginationLimitText = (params: {
|
|
332
|
-
from: number;
|
|
333
|
-
to: number;
|
|
334
|
-
page: number;
|
|
335
|
-
count: number;
|
|
336
|
-
}) => ReactNode;
|
|
337
|
-
/**
|
|
338
|
-
* Props for {@link SearchPaginationBase}.
|
|
339
|
-
* @public
|
|
340
|
-
*/
|
|
341
|
-
declare type SearchPaginationBaseProps = {
|
|
342
|
-
/**
|
|
343
|
-
* The component class name.
|
|
344
|
-
*/
|
|
345
|
-
className?: string;
|
|
346
|
-
/**
|
|
347
|
-
* The total number of results.
|
|
348
|
-
* For an unknown number of items, provide -1.
|
|
349
|
-
* Defaults to -1.
|
|
350
|
-
*/
|
|
351
|
-
total?: number;
|
|
352
|
-
/**
|
|
353
|
-
* The cursor for the current page.
|
|
354
|
-
*/
|
|
355
|
-
cursor?: string;
|
|
356
|
-
/**
|
|
357
|
-
* Callback fired when the current page cursor is changed.
|
|
358
|
-
*/
|
|
359
|
-
onCursorChange?: (pageCursor: string) => void;
|
|
360
|
-
/**
|
|
361
|
-
* The limit of results per page.
|
|
362
|
-
* Set -1 to display all the results.
|
|
363
|
-
*/
|
|
364
|
-
limit?: number;
|
|
365
|
-
/**
|
|
366
|
-
* Customize the results per page label.
|
|
367
|
-
* Defaults to "Results per page:".
|
|
368
|
-
*/
|
|
369
|
-
limitLabel?: ReactNode;
|
|
370
|
-
/**
|
|
371
|
-
* Customize the results per page text.
|
|
372
|
-
* Defaults to "(\{ from, to, count \}) =\> count \> 0 ? `of $\{count\}` : `$\{from\}-$\{to\}`".
|
|
373
|
-
*/
|
|
374
|
-
limitText?: SearchPaginationLimitText;
|
|
452
|
+
declare type SearchResultListLayoutProps = ListProps & {
|
|
375
453
|
/**
|
|
376
|
-
*
|
|
377
|
-
* If less than two options are available, no select field will be displayed.
|
|
378
|
-
* Use -1 for the value with a custom label to show all the results.
|
|
379
|
-
* Defaults to [10, 25, 50, 100].
|
|
454
|
+
* If defined, will render a default error panel.
|
|
380
455
|
*/
|
|
381
|
-
|
|
456
|
+
error?: Error;
|
|
382
457
|
/**
|
|
383
|
-
*
|
|
458
|
+
* If defined, will render a default loading progress.
|
|
384
459
|
*/
|
|
385
|
-
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* A component with controls for search results pagination.
|
|
389
|
-
* @param props - See {@link SearchPaginationBaseProps}.
|
|
390
|
-
* @public
|
|
391
|
-
*/
|
|
392
|
-
declare const SearchPaginationBase: (props: SearchPaginationBaseProps) => JSX.Element;
|
|
393
|
-
/**
|
|
394
|
-
* Props for {@link SearchPagination}.
|
|
395
|
-
* @public
|
|
396
|
-
*/
|
|
397
|
-
declare type SearchPaginationProps = Omit<SearchPaginationBaseProps, 'pageLimit' | 'onPageLimitChange' | 'pageCursor' | 'onPageCursorChange'>;
|
|
398
|
-
/**
|
|
399
|
-
* A component for setting the search context page limit and cursor.
|
|
400
|
-
* @param props - See {@link SearchPaginationProps}.
|
|
401
|
-
* @public
|
|
402
|
-
*/
|
|
403
|
-
declare const SearchPagination: (props: SearchPaginationProps) => JSX.Element;
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Props for {@link SearchResultListLayout}
|
|
407
|
-
* @public
|
|
408
|
-
*/
|
|
409
|
-
declare type SearchResultListLayoutProps = ListProps & {
|
|
460
|
+
loading?: boolean;
|
|
410
461
|
/**
|
|
411
462
|
* Search results to be rendered as a list.
|
|
412
463
|
*/
|
|
@@ -415,18 +466,14 @@ declare type SearchResultListLayoutProps = ListProps & {
|
|
|
415
466
|
* Function to customize how result items are rendered.
|
|
416
467
|
*/
|
|
417
468
|
renderResultItem?: (value: SearchResult$1, index: number, array: SearchResult$1[]) => JSX.Element | null;
|
|
418
|
-
/**
|
|
419
|
-
* If defined, will render a default error panel.
|
|
420
|
-
*/
|
|
421
|
-
error?: Error;
|
|
422
|
-
/**
|
|
423
|
-
* If defined, will render a default loading progress.
|
|
424
|
-
*/
|
|
425
|
-
loading?: boolean;
|
|
426
469
|
/**
|
|
427
470
|
* Optional component to render when no results. Default to <EmptyState /> component.
|
|
428
471
|
*/
|
|
429
472
|
noResultsComponent?: ReactNode;
|
|
473
|
+
/**
|
|
474
|
+
* Optional property to provide if component should not render the component when no results are found.
|
|
475
|
+
*/
|
|
476
|
+
disableRenderingWithNoResults?: boolean;
|
|
430
477
|
};
|
|
431
478
|
/**
|
|
432
479
|
* Default layout for rendering search results in a list.
|
|
@@ -438,16 +485,7 @@ declare const SearchResultListLayout: (props: SearchResultListLayoutProps) => JS
|
|
|
438
485
|
* Props for {@link SearchResultList}.
|
|
439
486
|
* @public
|
|
440
487
|
*/
|
|
441
|
-
declare type SearchResultListProps = Omit<SearchResultListLayoutProps, 'loading' | 'error' | 'resultItems'
|
|
442
|
-
/**
|
|
443
|
-
* A search query used for requesting the results to be listed.
|
|
444
|
-
*/
|
|
445
|
-
query: Partial<SearchQuery>;
|
|
446
|
-
/**
|
|
447
|
-
* Optional property to provide if component should not render the component when no results are found.
|
|
448
|
-
*/
|
|
449
|
-
disableRenderingWithNoResults?: boolean;
|
|
450
|
-
};
|
|
488
|
+
declare type SearchResultListProps = Pick<SearchResultStateProps, 'query'> & Omit<SearchResultListLayoutProps, 'loading' | 'error' | 'resultItems'>;
|
|
451
489
|
/**
|
|
452
490
|
* Given a query, search for results and render them as a list.
|
|
453
491
|
* @param props - See {@link SearchResultListProps}.
|
|
@@ -529,6 +567,14 @@ declare const SearchResultGroupSelectFilterField: (props: SearchResultGroupSelec
|
|
|
529
567
|
* @public
|
|
530
568
|
*/
|
|
531
569
|
declare type SearchResultGroupLayoutProps<FilterOption> = ListProps & {
|
|
570
|
+
/**
|
|
571
|
+
* If defined, will render a default error panel.
|
|
572
|
+
*/
|
|
573
|
+
error?: Error;
|
|
574
|
+
/**
|
|
575
|
+
* If defined, will render a default loading progress.
|
|
576
|
+
*/
|
|
577
|
+
loading?: boolean;
|
|
532
578
|
/**
|
|
533
579
|
* Icon that representing a result group.
|
|
534
580
|
*/
|
|
@@ -574,18 +620,14 @@ declare type SearchResultGroupLayoutProps<FilterOption> = ListProps & {
|
|
|
574
620
|
* Function to customize how result items are rendered.
|
|
575
621
|
*/
|
|
576
622
|
renderResultItem?: (value: SearchResult$1, index: number, array: SearchResult$1[]) => JSX.Element | null;
|
|
577
|
-
/**
|
|
578
|
-
* If defined, will render a default error panel.
|
|
579
|
-
*/
|
|
580
|
-
error?: Error;
|
|
581
|
-
/**
|
|
582
|
-
* If defined, will render a default loading progress.
|
|
583
|
-
*/
|
|
584
|
-
loading?: boolean;
|
|
585
623
|
/**
|
|
586
624
|
* Optional component to render when no results. Default to <EmptyState /> component.
|
|
587
625
|
*/
|
|
588
626
|
noResultsComponent?: ReactNode;
|
|
627
|
+
/**
|
|
628
|
+
* Optional property to provide if component should not render the component when no results are found.
|
|
629
|
+
*/
|
|
630
|
+
disableRenderingWithNoResults?: boolean;
|
|
589
631
|
};
|
|
590
632
|
/**
|
|
591
633
|
* Default layout for rendering search results in a group.
|
|
@@ -597,16 +639,7 @@ declare function SearchResultGroupLayout<FilterOption>(props: SearchResultGroupL
|
|
|
597
639
|
* Props for {@link SearchResultGroup}.
|
|
598
640
|
* @public
|
|
599
641
|
*/
|
|
600
|
-
declare type SearchResultGroupProps<FilterOption> = Omit<SearchResultGroupLayoutProps<FilterOption>, 'loading' | 'error' | 'resultItems' | 'filterFields'
|
|
601
|
-
/**
|
|
602
|
-
* A search query used for requesting the results to be grouped.
|
|
603
|
-
*/
|
|
604
|
-
query: Partial<SearchQuery>;
|
|
605
|
-
/**
|
|
606
|
-
* Optional property to provide if component should not render the group when no results are found.
|
|
607
|
-
*/
|
|
608
|
-
disableRenderingWithNoResults?: boolean;
|
|
609
|
-
};
|
|
642
|
+
declare type SearchResultGroupProps<FilterOption> = Pick<SearchResultStateProps, 'query'> & Omit<SearchResultGroupLayoutProps<FilterOption>, 'loading' | 'error' | 'resultItems' | 'filterFields'>;
|
|
610
643
|
/**
|
|
611
644
|
* Given a query, search for results and render them as a group.
|
|
612
645
|
* @param props - See {@link SearchResultGroupProps}.
|
|
@@ -614,6 +647,11 @@ declare type SearchResultGroupProps<FilterOption> = Omit<SearchResultGroupLayout
|
|
|
614
647
|
*/
|
|
615
648
|
declare function SearchResultGroup<FilterOption>(props: SearchResultGroupProps<FilterOption>): JSX.Element;
|
|
616
649
|
|
|
650
|
+
/**
|
|
651
|
+
* @public
|
|
652
|
+
*/
|
|
653
|
+
declare const SearchResultPager: () => JSX.Element;
|
|
654
|
+
|
|
617
655
|
/**
|
|
618
656
|
* Props for {@link DefaultResultListItem}
|
|
619
657
|
*
|
|
@@ -622,7 +660,7 @@ declare function SearchResultGroup<FilterOption>(props: SearchResultGroupProps<F
|
|
|
622
660
|
declare type DefaultResultListItemProps = {
|
|
623
661
|
icon?: ReactNode;
|
|
624
662
|
secondaryAction?: ReactNode;
|
|
625
|
-
result
|
|
663
|
+
result?: SearchDocument;
|
|
626
664
|
highlight?: ResultHighlight;
|
|
627
665
|
rank?: number;
|
|
628
666
|
lineClamp?: number;
|
|
@@ -700,4 +738,4 @@ declare type SearchContextProviderProps = PropsWithChildren<{
|
|
|
700
738
|
*/
|
|
701
739
|
declare const SearchContextProvider: (props: SearchContextProviderProps) => JSX.Element;
|
|
702
740
|
|
|
703
|
-
export { AutocompleteFilter, CheckboxFilter, HigherOrderDefaultResultListItem as DefaultResultListItem, DefaultResultListItemProps, HighlightedSearchResultText, HighlightedSearchResultTextProps, MockSearchApi, SearchApi, SearchAutocomplete, SearchAutocompleteComponent, SearchAutocompleteDefaultOption, SearchAutocompleteDefaultOptionProps, SearchAutocompleteFilterProps, SearchAutocompleteProps, SearchBar, SearchBarBase, SearchBarBaseProps, SearchBarProps, SearchContextProvider, SearchContextProviderProps, SearchContextState, SearchContextValue, SearchFilter, SearchFilterComponentProps, SearchFilterWrapperProps, SearchPagination, SearchPaginationBase, SearchPaginationBaseProps, SearchPaginationLimitOption, SearchPaginationLimitText, SearchPaginationProps, SearchResult, SearchResultApi, SearchResultApiProps, SearchResultComponent, SearchResultContext, SearchResultContextProps, SearchResultGroup, SearchResultGroupFilterFieldLayout, SearchResultGroupFilterFieldLayoutProps, SearchResultGroupFilterFieldPropsWith, SearchResultGroupLayout, SearchResultGroupLayoutProps, SearchResultGroupProps, SearchResultGroupSelectFilterField, SearchResultGroupSelectFilterFieldProps, SearchResultGroupTextFilterField, SearchResultGroupTextFilterFieldProps, SearchResultList, SearchResultListLayout, SearchResultListLayoutProps, SearchResultListProps, SearchResultPager, SearchResultProps, SearchResultState, SearchResultStateProps, SelectFilter, searchApiRef, useSearch, useSearchContextCheck };
|
|
741
|
+
export { AutocompleteFilter, CheckboxFilter, HigherOrderDefaultResultListItem as DefaultResultListItem, DefaultResultListItemProps, HighlightedSearchResultText, HighlightedSearchResultTextProps, MockSearchApi, SearchApi, SearchAutocomplete, SearchAutocompleteComponent, SearchAutocompleteDefaultOption, SearchAutocompleteDefaultOptionProps, SearchAutocompleteFilterProps, SearchAutocompleteProps, SearchBar, SearchBarBase, SearchBarBaseProps, SearchBarProps, SearchContextProvider, SearchContextProviderProps, SearchContextState, SearchContextValue, SearchFilter, SearchFilterComponentProps, SearchFilterWrapperProps, SearchPagination, SearchPaginationBase, SearchPaginationBaseProps, SearchPaginationLimitOption, SearchPaginationLimitText, SearchPaginationProps, SearchResult, SearchResultApi, SearchResultApiProps, SearchResultComponent, SearchResultContext, SearchResultContextProps, SearchResultGroup, SearchResultGroupFilterFieldLayout, SearchResultGroupFilterFieldLayoutProps, SearchResultGroupFilterFieldPropsWith, SearchResultGroupLayout, SearchResultGroupLayoutProps, SearchResultGroupProps, SearchResultGroupSelectFilterField, SearchResultGroupSelectFilterFieldProps, SearchResultGroupTextFilterField, SearchResultGroupTextFilterFieldProps, SearchResultList, SearchResultListItemExtensionOptions, SearchResultListItemExtensions, SearchResultListItemExtensionsProps, SearchResultListLayout, SearchResultListLayoutProps, SearchResultListProps, SearchResultPager, SearchResultProps, SearchResultState, SearchResultStateProps, SelectFilter, createSearchResultListItemExtension, searchApiRef, useSearch, useSearchContextCheck, useSearchResultListItemExtensions };
|