buildgrid-ui 1.19.1 → 1.19.3
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/data-table/components/active-filters.d.ts +3 -1
- package/dist/blocks/data-table/components/column-visibility-dropdown.d.ts +4 -1
- package/dist/blocks/data-table/components/filter-dropdown.d.ts +2 -1
- package/dist/blocks/data-table/components/selection-info.d.ts +4 -1
- package/dist/blocks/data-table/data-table.d.ts +1 -1
- package/dist/blocks/data-table/types/data-table.d.ts +63 -0
- package/dist/buildgrid-ui.es.js +2102 -2053
- package/dist/buildgrid-ui.umd.js +64 -64
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ interface ActiveFiltersProps<T> {
|
|
|
8
8
|
onClearSearch: () => void;
|
|
9
9
|
onClearFilter: (field: string) => void;
|
|
10
10
|
onClearSort: () => void;
|
|
11
|
+
searchPrefix: string;
|
|
12
|
+
sortPrefix: string;
|
|
11
13
|
}
|
|
12
|
-
export declare function ActiveFilters<T>({ searchTerm, activeFilters, sortState, filters, columns, onClearSearch, onClearFilter, onClearSort, }: ActiveFiltersProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export declare function ActiveFilters<T>({ searchTerm, activeFilters, sortState, filters, columns, onClearSearch, onClearFilter, onClearSort, searchPrefix, sortPrefix, }: ActiveFiltersProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
13
15
|
export {};
|
|
@@ -3,6 +3,9 @@ interface ColumnVisibilityDropdownProps<T> {
|
|
|
3
3
|
columns: DataTableColumn<T>[];
|
|
4
4
|
onToggleVisibility: (key: string, visible: boolean) => void;
|
|
5
5
|
onReset: () => void;
|
|
6
|
+
triggerLabel: string;
|
|
7
|
+
menuLabel: string;
|
|
8
|
+
resetLabel: string;
|
|
6
9
|
}
|
|
7
|
-
export declare function ColumnVisibilityDropdown<T>({ columns, onToggleVisibility, onReset, }: ColumnVisibilityDropdownProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function ColumnVisibilityDropdown<T>({ columns, onToggleVisibility, onReset, triggerLabel, menuLabel, resetLabel, }: ColumnVisibilityDropdownProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -3,6 +3,7 @@ interface FilterDropdownProps<T> {
|
|
|
3
3
|
filter: DataTableFilter<T>;
|
|
4
4
|
value: string;
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
|
+
allOptionLabel: (filterLabel: string) => string;
|
|
6
7
|
}
|
|
7
|
-
export declare function FilterDropdown<T>({ filter, value, onChange }: FilterDropdownProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function FilterDropdown<T>({ filter, value, onChange, allOptionLabel }: FilterDropdownProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
interface SelectionInfoProps {
|
|
2
2
|
selectedCount: number;
|
|
3
3
|
onClearSelection: () => void;
|
|
4
|
+
rowSingular: string;
|
|
5
|
+
rowPlural: string;
|
|
6
|
+
clearLabel: string;
|
|
4
7
|
}
|
|
5
|
-
export declare function SelectionInfo({ selectedCount, onClearSelection }: SelectionInfoProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare function SelectionInfo({ selectedCount, onClearSelection, rowSingular, rowPlural, clearLabel, }: SelectionInfoProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
9
|
export {};
|
|
@@ -3,4 +3,4 @@ import type { DataTableProps, DataTableRef } from './types/data-table';
|
|
|
3
3
|
export declare const DataTable: <T extends Record<string, any>>(props: DataTableProps<T> & {
|
|
4
4
|
ref?: React.Ref<DataTableRef<T>>;
|
|
5
5
|
}) => React.ReactElement;
|
|
6
|
-
export type { DataTableColumn, DataTableFilter, DataTableProps, DataTableRef, } from './types/data-table';
|
|
6
|
+
export type { DataTableColumn, DataTableFilter, DataTableLabels, DataTableProps, DataTableRef, ServerPaginationConfig, } from './types/data-table';
|
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
export interface DataTableLabels {
|
|
3
|
+
/** Search input placeholder. Default: `'Search...'` */
|
|
4
|
+
searchPlaceholder?: string;
|
|
5
|
+
/** Export button text. Default: `'Export CSV'` */
|
|
6
|
+
exportButton?: string;
|
|
7
|
+
/** Clear-all-filters button text. Default: `'Clear All'` */
|
|
8
|
+
clearAllButton?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Pagination counter template. Supports `{{startIndex}}`, `{{endIndex}}`, `{{totalItems}}`.
|
|
11
|
+
* Default: `'Showing {{startIndex}} to {{endIndex}} of {{totalItems}} results'`
|
|
12
|
+
*/
|
|
13
|
+
paginationCounter?: string;
|
|
14
|
+
/** Empty-state label when there is no data. Default: `'No data available.'` */
|
|
15
|
+
noDataAvailable?: string;
|
|
16
|
+
/** Empty-state label when filters produce no results. Default: `'No results found for the current filters.'` */
|
|
17
|
+
noResultsWithFilters?: string;
|
|
18
|
+
/** Prefix shown in the active-search badge. Default: `'Search'` */
|
|
19
|
+
searchBadgePrefix?: string;
|
|
20
|
+
/** Prefix shown in the active-sort badge. Default: `'Sort'` */
|
|
21
|
+
sortBadgePrefix?: string;
|
|
22
|
+
/** Column-visibility dropdown trigger label. Default: `'Columns'` */
|
|
23
|
+
columnsButton?: string;
|
|
24
|
+
/** Column-visibility dropdown menu label. Default: `'Toggle columns'` */
|
|
25
|
+
toggleColumnsMenuLabel?: string;
|
|
26
|
+
/** Reset column-visibility button label. Default: `'Reset columns'` */
|
|
27
|
+
resetColumnsButton?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Factory for the "All" option in filter dropdowns.
|
|
30
|
+
* Receives the filter label and returns the option text.
|
|
31
|
+
* Default: `(label) => \`All \${label}\``
|
|
32
|
+
*/
|
|
33
|
+
allFilterOption?: (filterLabel: string) => string;
|
|
34
|
+
/** Selected-rows label (singular). Default: `'row selected'` */
|
|
35
|
+
rowSelectedSingular?: string;
|
|
36
|
+
/** Selected-rows label (plural). Default: `'rows selected'` */
|
|
37
|
+
rowSelectedPlural?: string;
|
|
38
|
+
/** Clear-selection button label. Default: `'Clear selection'` */
|
|
39
|
+
clearSelectionButton?: string;
|
|
40
|
+
}
|
|
2
41
|
export interface DataTableColumn<T> {
|
|
3
42
|
key: keyof T;
|
|
4
43
|
/** The title of the column, can be a string or a React node */
|
|
@@ -28,6 +67,16 @@ export interface DataTableFilter<T> {
|
|
|
28
67
|
defaultValue?: string;
|
|
29
68
|
options: FilterOption[];
|
|
30
69
|
}
|
|
70
|
+
export interface ServerPaginationConfig {
|
|
71
|
+
/** Total number of items on the server */
|
|
72
|
+
totalItems: number;
|
|
73
|
+
/** Total number of pages on the server */
|
|
74
|
+
totalPages: number;
|
|
75
|
+
/** Current page controlled externally */
|
|
76
|
+
currentPage: number;
|
|
77
|
+
/** Callback invoked when the user requests a different page */
|
|
78
|
+
onPageChange: (page: number) => void;
|
|
79
|
+
}
|
|
31
80
|
export interface DataTableToolsProps {
|
|
32
81
|
search?: {
|
|
33
82
|
placeholder?: string;
|
|
@@ -67,6 +116,20 @@ export interface DataTableProps<T> {
|
|
|
67
116
|
className?: string;
|
|
68
117
|
loading?: boolean;
|
|
69
118
|
tools?: DataTableToolsProps;
|
|
119
|
+
/**
|
|
120
|
+
* Override any text rendered by the table and its sub-components.
|
|
121
|
+
* All fields are optional — omitted ones fall back to English defaults.
|
|
122
|
+
* Existing `tools.*.label` fields take precedence when both are set (backward-compatible).
|
|
123
|
+
*/
|
|
124
|
+
labels?: DataTableLabels;
|
|
125
|
+
/**
|
|
126
|
+
* When provided, the component delegates pagination control to the server.
|
|
127
|
+
* - `data` must contain only the items for the current page (already paginated).
|
|
128
|
+
* - Client-side slicing is skipped; `totalItems`, `totalPages` and `currentPage`
|
|
129
|
+
* from this config are used directly by the pagination UI.
|
|
130
|
+
* - `onPageChange` is called whenever the user navigates to a different page.
|
|
131
|
+
*/
|
|
132
|
+
serverPagination?: ServerPaginationConfig;
|
|
70
133
|
}
|
|
71
134
|
export type SortDirection = 'asc' | 'desc' | null;
|
|
72
135
|
export interface SortState {
|