@chainberry/ui-components 1.0.7 → 1.0.8
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/index.cjs +1 -1
- package/dist/index.d.ts +16 -28
- package/dist/index.mjs +727 -827
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -268,7 +268,7 @@ export declare type Column<T> = {
|
|
|
268
268
|
/** header label — also the label shown in the Columns menu */
|
|
269
269
|
header: string;
|
|
270
270
|
cell: (row: T) => ReactNode;
|
|
271
|
-
align?:
|
|
271
|
+
align?: 'start' | 'end';
|
|
272
272
|
/** enable click-to-sort on this column (requires `sortValue`) */
|
|
273
273
|
sortable?: boolean;
|
|
274
274
|
/** comparable value used for sorting (number sorts numerically) */
|
|
@@ -460,43 +460,28 @@ export declare function DailyBalancesTable({ data, pageSize, }: {
|
|
|
460
460
|
pageSize?: number;
|
|
461
461
|
}): JSX.Element;
|
|
462
462
|
|
|
463
|
-
export declare function DataTable<T>({ columns, data, getRowId, layout, density, pageSize,
|
|
463
|
+
export declare function DataTable<T>({ columns, data, getRowId, layout, density, pageSize, totalItems, currentPage, onPageChange, loading, skeletonRows, columnVisibility: columnVisibilityProp, onRowClick, rowLeading, emptyMessage, toolbarBelow, sort, onSortChange, }: DataTableProps<T>): JSX.Element;
|
|
464
464
|
|
|
465
465
|
export declare type DataTableProps<T> = {
|
|
466
466
|
columns: Column<T>[];
|
|
467
467
|
data: T[];
|
|
468
468
|
/** stable unique key per row */
|
|
469
469
|
getRowId: (row: T) => string;
|
|
470
|
-
|
|
470
|
+
/** Sort */
|
|
471
|
+
sort?: SortState;
|
|
472
|
+
onSortChange?: (sort: SortState) => void;
|
|
473
|
+
layout?: 'auto' | 'fill';
|
|
471
474
|
/** row vertical padding: "comfortable" (default) or "compact" (shorter rows) */
|
|
472
|
-
density?:
|
|
475
|
+
density?: 'comfortable' | 'compact';
|
|
473
476
|
/** rows per page; omit to show all rows and hide the footer */
|
|
474
477
|
pageSize?: number;
|
|
478
|
+
totalItems?: number;
|
|
479
|
+
currentPage?: number;
|
|
480
|
+
onPageChange?: (page: number) => void;
|
|
475
481
|
loading?: boolean;
|
|
476
482
|
/** skeleton rows to render while loading (default 10) */
|
|
477
483
|
skeletonRows?: number;
|
|
478
|
-
/** render a search input in the toolbar (needs `searchFilter`) */
|
|
479
|
-
searchable?: boolean;
|
|
480
|
-
searchPlaceholder?: string;
|
|
481
|
-
searchFilter?: (row: T, query: string) => boolean;
|
|
482
|
-
/** Optional field-scope dropdown at the right of the search box. UI only:
|
|
483
|
-
picking a scope swaps the placeholder to "Search by <label>" and notifies
|
|
484
|
-
`onSearchScopeChange`; it does NOT filter (that's the backend's job). */
|
|
485
|
-
searchScopes?: {
|
|
486
|
-
value: string;
|
|
487
|
-
label: string;
|
|
488
|
-
}[];
|
|
489
|
-
defaultSearchScope?: string;
|
|
490
|
-
onSearchScopeChange?: (value: string) => void;
|
|
491
|
-
/** controlled search query — drives filtering even when the built-in search
|
|
492
|
-
input isn't rendered (e.g. when an external toolbar owns it) */
|
|
493
|
-
query?: string;
|
|
494
|
-
onQueryChange?: (value: string) => void;
|
|
495
|
-
/** render the Columns visibility menu in the toolbar */
|
|
496
|
-
columnToggle?: boolean;
|
|
497
|
-
/** controlled column visibility (else internal state) */
|
|
498
484
|
columnVisibility?: Record<string, boolean>;
|
|
499
|
-
onColumnVisibilityChange?: (id: string, next: boolean) => void;
|
|
500
485
|
onRowClick?: (row: T) => void;
|
|
501
486
|
/** leading cell before the first column (e.g. a status dot) */
|
|
502
487
|
rowLeading?: (row: T) => ReactNode;
|
|
@@ -1668,6 +1653,11 @@ export declare function SortHeader({ label, sort, onSort, align, }: {
|
|
|
1668
1653
|
align?: "start" | "end";
|
|
1669
1654
|
}): JSX.Element;
|
|
1670
1655
|
|
|
1656
|
+
declare type SortState = {
|
|
1657
|
+
id: string;
|
|
1658
|
+
dir: 'asc' | 'desc';
|
|
1659
|
+
} | null;
|
|
1660
|
+
|
|
1671
1661
|
/** Named treasury wallets available as withdrawal sources. */
|
|
1672
1662
|
declare const SOURCE_WALLETS: SourceWallet[];
|
|
1673
1663
|
|
|
@@ -1937,7 +1927,7 @@ export declare namespace transactionsStatuses {
|
|
|
1937
1927
|
}
|
|
1938
1928
|
}
|
|
1939
1929
|
|
|
1940
|
-
export declare function TransactionsTable({ data, loading, onRowClick,
|
|
1930
|
+
export declare function TransactionsTable({ data, loading, onRowClick, columnVisibility, presets, }: TransactionsTableProps): JSX.Element;
|
|
1941
1931
|
|
|
1942
1932
|
export declare function TransactionsTableOptions({ search, onSearchChange, searchScopes, searchScope, onSearchScopeChange, searchPlaceholder, segment, onSegmentChange, tabs, tabCounts, onFilter, filterCount, columns, columnVisibility, onColumnChange, onRefresh, refreshing, onDownload, show, className, }: {
|
|
1943
1933
|
search: string;
|
|
@@ -1975,8 +1965,6 @@ export declare type TransactionsTableProps = {
|
|
|
1975
1965
|
data: Transaction[];
|
|
1976
1966
|
loading?: boolean;
|
|
1977
1967
|
onRowClick?: (tx: Transaction) => void;
|
|
1978
|
-
/** controlled search query (owned by the page, shared with the toolbar) */
|
|
1979
|
-
query?: string;
|
|
1980
1968
|
/** controlled column visibility (owned by the page, shared with the toolbar) */
|
|
1981
1969
|
columnVisibility?: Record<string, boolean>;
|
|
1982
1970
|
/** the SavedPresetsBar row, rendered just above the table */
|