buildgrid-ui 1.19.3 → 1.19.7
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/blocks/paginated-items/paginated-items.d.ts +33 -1
- package/dist/buildgrid-ui.css +1 -1
- package/dist/buildgrid-ui.es.js +9432 -8515
- package/dist/buildgrid-ui.umd.js +144 -125
- package/dist/components/alert/alert.d.ts +4 -3
- package/dist/components/toaster/toast.d.ts +2 -47
- package/package.json +22 -18
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
export interface PaginatedItemsServerPagination {
|
|
3
|
+
/** Total number of items on the server. */
|
|
4
|
+
totalItems: number;
|
|
5
|
+
/** Total number of pages on the server. */
|
|
6
|
+
totalPages: number;
|
|
7
|
+
/** Current active page (controlled externally). */
|
|
8
|
+
currentPage: number;
|
|
9
|
+
/** Called when the user navigates to a different page. */
|
|
10
|
+
onPageChange: (page: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface PaginatedItemsLabels {
|
|
13
|
+
/**
|
|
14
|
+
* Text shown in the default empty state.
|
|
15
|
+
* Ignored when `emptyState` prop is provided.
|
|
16
|
+
* Default: `'No item found!'`
|
|
17
|
+
*/
|
|
18
|
+
noItemsFound?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Pagination counter template. Supports `{{startIndex}}`, `{{endIndex}}`, `{{totalItems}}`.
|
|
21
|
+
* Superseded by the top-level `counterText` prop when both are set.
|
|
22
|
+
*/
|
|
23
|
+
paginationCounter?: string;
|
|
24
|
+
}
|
|
2
25
|
interface PaginatedItemsProps<Entry> {
|
|
3
26
|
data: Entry[];
|
|
4
27
|
perPage?: number;
|
|
@@ -7,9 +30,18 @@ interface PaginatedItemsProps<Entry> {
|
|
|
7
30
|
children: (item: Entry, index: number) => React.ReactNode;
|
|
8
31
|
emptyState?: ReactNode;
|
|
9
32
|
isLoading?: boolean;
|
|
10
|
-
|
|
33
|
+
/** Height class for skeleton items (e.g. `'h-24'`). Default: `'h-24'`. */
|
|
34
|
+
skeletonHeight?: string;
|
|
11
35
|
showItemsCounter?: boolean;
|
|
36
|
+
/** Custom pagination counter text. Takes priority over `labels.paginationCounter`. */
|
|
12
37
|
counterText?: string;
|
|
38
|
+
/**
|
|
39
|
+
* When provided, the component delegates pagination to the caller.
|
|
40
|
+
* `data` must contain only the items for the current page.
|
|
41
|
+
*/
|
|
42
|
+
serverPagination?: PaginatedItemsServerPagination;
|
|
43
|
+
/** Override text rendered by the component. All fields are optional. */
|
|
44
|
+
labels?: PaginatedItemsLabels;
|
|
13
45
|
}
|
|
14
46
|
export declare const PaginatedItems: <Entry extends {
|
|
15
47
|
id?: string;
|