@caffeinebounce/ui 0.62.3 → 0.63.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/README.md +1 -1
- package/dist/blog.js +7 -6
- package/dist/blog.mjs +2 -1
- package/dist/charts.d.cts +1 -1
- package/dist/charts.d.ts +1 -1
- package/dist/{chunk-6DVWMJ3H.mjs → chunk-2EFVMX6V.mjs} +3 -3
- package/dist/{chunk-6ZJCK6KH.js → chunk-375DECW4.js} +31 -31
- package/dist/{chunk-PZRI43EZ.js → chunk-46JYKBRX.js} +0 -43
- package/dist/chunk-5D55OVD5.js +75 -0
- package/dist/{chunk-JORVSG52.js → chunk-663CFAHS.js} +211 -269
- package/dist/chunk-6HKJDV43.mjs +48 -0
- package/dist/chunk-6NCRGHV3.mjs +64 -0
- package/dist/{chunk-OLAAXLXY.mjs → chunk-6QAKQG57.mjs} +4 -4
- package/dist/{chunk-N6AFNFZR.mjs → chunk-7ERVZXIN.mjs} +214 -270
- package/dist/chunk-APFEP5B7.mjs +100 -0
- package/dist/chunk-C3OADNSG.js +348 -0
- package/dist/{chunk-GIJQE3JR.js → chunk-DH5Z3ETN.js} +66 -45
- package/dist/chunk-DYWZ23QT.mjs +90 -0
- package/dist/{chunk-DTVWRRFN.mjs → chunk-E67IR6HU.mjs} +30 -9
- package/dist/{chunk-OVNLC5RD.mjs → chunk-EXQSWHLD.mjs} +6 -6
- package/dist/{chunk-ZOA7B32D.js → chunk-F35KL6TX.js} +9 -9
- package/dist/{chunk-YSLD2HLP.mjs → chunk-FFJC66KO.mjs} +1 -1
- package/dist/{chunk-MPZFPU4X.js → chunk-GMBLPQ3I.js} +3 -3
- package/dist/chunk-IJFPPLQW.js +50 -0
- package/dist/{chunk-BMFQG6RA.mjs → chunk-KJIX6V32.mjs} +107 -1885
- package/dist/chunk-LABHD4PU.js +109 -0
- package/dist/{chunk-GAIQJCAZ.js → chunk-LT5VD4KR.js} +149 -1953
- package/dist/{chunk-7DHKQODW.mjs → chunk-LTLCIRZY.mjs} +256 -474
- package/dist/chunk-N5BHXWR3.mjs +34 -0
- package/dist/chunk-OCO3Z5YA.js +37 -0
- package/dist/chunk-OIJ7XMDV.mjs +71 -0
- package/dist/chunk-ORBH4IBC.mjs +316 -0
- package/dist/chunk-OWWOAYIY.js +2652 -0
- package/dist/chunk-PFHOXDSW.mjs +10 -0
- package/dist/chunk-QRS7DJGS.js +103 -0
- package/dist/{chunk-NXPEJ2UR.mjs → chunk-R3X4B4JJ.mjs} +53 -6
- package/dist/chunk-RM7ACPTM.mjs +2601 -0
- package/dist/chunk-RODSGPBB.mjs +75 -0
- package/dist/{chunk-T6ZBA6VJ.js → chunk-UHAV34YX.js} +8 -8
- package/dist/{chunk-GUSTCU2W.mjs → chunk-ULANYJ7Y.mjs} +1 -59
- package/dist/chunk-ULDE7QSN.js +70 -0
- package/dist/chunk-UT36VNVZ.mjs +47 -0
- package/dist/chunk-UY3H4PKB.js +71 -0
- package/dist/{chunk-KB7UXIQZ.mjs → chunk-VIVWFQG5.mjs} +2 -1
- package/dist/{chunk-ESZ7CBA2.js → chunk-VKBJ3SGT.js} +6 -5
- package/dist/{chunk-UM7WMXIU.js → chunk-W3YOQ5ZD.js} +264 -505
- package/dist/{chunk-GHOFYK2E.js → chunk-XGJL6DLV.js} +55 -5
- package/dist/chunk-YRIBFIQ5.js +116 -0
- package/dist/chunk-ZWWJ3RRA.js +15 -0
- package/dist/data-grid.d.cts +241 -0
- package/dist/data-grid.d.ts +241 -0
- package/dist/data-grid.js +6486 -0
- package/dist/data-grid.mjs +6459 -0
- package/dist/data-table-CDQBo-Ve.d.ts +818 -0
- package/dist/data-table-jLzt6plY.d.cts +818 -0
- package/dist/data-table.d.cts +8 -42
- package/dist/data-table.d.ts +8 -42
- package/dist/data-table.js +61 -187
- package/dist/data-table.mjs +11 -5
- package/dist/finance.d.cts +534 -0
- package/dist/finance.d.ts +534 -0
- package/dist/finance.js +188 -0
- package/dist/finance.mjs +15 -0
- package/dist/forms.js +9 -6
- package/dist/forms.mjs +7 -4
- package/dist/{hooks-B2jU1GVT.d.ts → hooks-A55E0fgf.d.ts} +3 -2
- package/dist/{hooks-8ORd7T1A.d.cts → hooks-Bys_AZPI.d.cts} +3 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +26 -23
- package/dist/hooks.mjs +6 -3
- package/dist/index.d.cts +536 -665
- package/dist/index.d.ts +536 -665
- package/dist/index.js +3829 -3408
- package/dist/index.mjs +2067 -1767
- package/dist/layouts.js +25 -25
- package/dist/layouts.mjs +4 -4
- package/dist/marketing.js +74 -74
- package/dist/marketing.mjs +4 -4
- package/dist/navigation.js +28 -28
- package/dist/navigation.mjs +6 -6
- package/dist/primitives.d.cts +72 -109
- package/dist/primitives.d.ts +72 -109
- package/dist/primitives.js +78 -72
- package/dist/primitives.mjs +8 -6
- package/dist/settings.js +9 -9
- package/dist/settings.mjs +4 -4
- package/package.json +17 -1
- package/dist/UnifiedTableControls-CG299y9h.d.ts +0 -1233
- package/dist/UnifiedTableControls-CIjRpNhy.d.cts +0 -1233
- package/dist/chunk-GMBGWOCR.mjs +0 -49
- package/dist/chunk-HBLKVQIQ.mjs +0 -23
- package/dist/chunk-HMAMMC72.js +0 -26
- package/dist/chunk-MVYRNJA6.js +0 -75
- /package/dist/{chunk-RVEFPVZF.mjs → chunk-C57MX3BG.mjs} +0 -0
- /package/dist/{chunk-C4UT5V3P.js → chunk-OWHI5VGJ.js} +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { RowData, Cell, TableMeta, TableOptions, ColumnDef, Column } from '@tanstack/react-table';
|
|
4
|
+
import * as _tanstack_virtual_core from '@tanstack/virtual-core';
|
|
5
|
+
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
6
|
+
|
|
7
|
+
type Direction = "ltr" | "rtl";
|
|
8
|
+
type RowHeightValue = "short" | "medium" | "tall" | "extra-tall";
|
|
9
|
+
interface CellSelectOption {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
icon?: React.ComponentType<React.ComponentProps<"svg">>;
|
|
13
|
+
count?: number;
|
|
14
|
+
}
|
|
15
|
+
type CellOpts = {
|
|
16
|
+
variant: "short-text";
|
|
17
|
+
} | {
|
|
18
|
+
variant: "long-text";
|
|
19
|
+
} | {
|
|
20
|
+
variant: "number";
|
|
21
|
+
min?: number;
|
|
22
|
+
max?: number;
|
|
23
|
+
step?: number;
|
|
24
|
+
} | {
|
|
25
|
+
variant: "select";
|
|
26
|
+
options: CellSelectOption[];
|
|
27
|
+
} | {
|
|
28
|
+
variant: "multi-select";
|
|
29
|
+
options: CellSelectOption[];
|
|
30
|
+
} | {
|
|
31
|
+
variant: "checkbox";
|
|
32
|
+
} | {
|
|
33
|
+
variant: "date";
|
|
34
|
+
} | {
|
|
35
|
+
variant: "url";
|
|
36
|
+
} | {
|
|
37
|
+
variant: "file";
|
|
38
|
+
maxFileSize?: number;
|
|
39
|
+
maxFiles?: number;
|
|
40
|
+
accept?: string;
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
};
|
|
43
|
+
interface CellUpdate {
|
|
44
|
+
rowIndex: number;
|
|
45
|
+
columnId: string;
|
|
46
|
+
value: unknown;
|
|
47
|
+
}
|
|
48
|
+
declare module "@tanstack/react-table" {
|
|
49
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
50
|
+
label?: string;
|
|
51
|
+
cell?: CellOpts;
|
|
52
|
+
}
|
|
53
|
+
interface TableMeta<TData extends RowData> {
|
|
54
|
+
dataGridRef?: React.RefObject<HTMLElement | null>;
|
|
55
|
+
cellMapRef?: React.RefObject<Map<string, HTMLDivElement>>;
|
|
56
|
+
focusedCell?: CellPosition | null;
|
|
57
|
+
editingCell?: CellPosition | null;
|
|
58
|
+
selectionState?: SelectionState;
|
|
59
|
+
searchOpen?: boolean;
|
|
60
|
+
getIsCellSelected?: (rowIndex: number, columnId: string) => boolean;
|
|
61
|
+
getIsSearchMatch?: (rowIndex: number, columnId: string) => boolean;
|
|
62
|
+
getIsActiveSearchMatch?: (rowIndex: number, columnId: string) => boolean;
|
|
63
|
+
getVisualRowIndex?: (rowId: string) => number | undefined;
|
|
64
|
+
scrollToCell?: (rowIndex: number, columnId: string, align?: "auto" | "start" | "center" | "end") => void;
|
|
65
|
+
rowHeight?: RowHeightValue;
|
|
66
|
+
onRowHeightChange?: (value: RowHeightValue) => void;
|
|
67
|
+
onRowSelect?: (rowId: string, checked: boolean, shiftKey: boolean) => void;
|
|
68
|
+
onDataUpdate?: (params: CellUpdate | Array<CellUpdate>) => void;
|
|
69
|
+
onRowsDelete?: (rowIndices: number[]) => void | Promise<void>;
|
|
70
|
+
onColumnClick?: (columnId: string) => void;
|
|
71
|
+
onCellClick?: (rowIndex: number, columnId: string, event?: React.MouseEvent) => void;
|
|
72
|
+
onCellDoubleClick?: (rowIndex: number, columnId: string) => void;
|
|
73
|
+
onCellMouseDown?: (rowIndex: number, columnId: string, event: React.MouseEvent) => void;
|
|
74
|
+
onCellMouseEnter?: (rowIndex: number, columnId: string) => void;
|
|
75
|
+
onCellMouseUp?: () => void;
|
|
76
|
+
onCellContextMenu?: (rowIndex: number, columnId: string, event: React.MouseEvent) => void;
|
|
77
|
+
onCellEditingStart?: (rowIndex: number, columnId: string) => void;
|
|
78
|
+
onCellEditingStop?: (opts?: {
|
|
79
|
+
direction?: NavigationDirection;
|
|
80
|
+
moveToNextRow?: boolean;
|
|
81
|
+
}) => void;
|
|
82
|
+
onCellsCopy?: () => void;
|
|
83
|
+
onCellsCut?: () => void;
|
|
84
|
+
onCellsPaste?: (expand?: boolean) => void;
|
|
85
|
+
onSelectionClear?: () => void;
|
|
86
|
+
onFilesUpload?: (params: {
|
|
87
|
+
files: File[];
|
|
88
|
+
rowIndex: number;
|
|
89
|
+
columnId: string;
|
|
90
|
+
}) => Promise<FileCellData[]>;
|
|
91
|
+
onFilesDelete?: (params: {
|
|
92
|
+
fileIds: string[];
|
|
93
|
+
rowIndex: number;
|
|
94
|
+
columnId: string;
|
|
95
|
+
}) => void | Promise<void>;
|
|
96
|
+
contextMenu?: ContextMenuState;
|
|
97
|
+
onContextMenuOpenChange?: (open: boolean) => void;
|
|
98
|
+
pasteDialog?: PasteDialogState;
|
|
99
|
+
onPasteDialogOpenChange?: (open: boolean) => void;
|
|
100
|
+
readOnly?: boolean;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
interface CellPosition {
|
|
104
|
+
rowIndex: number;
|
|
105
|
+
columnId: string;
|
|
106
|
+
}
|
|
107
|
+
interface CellRange {
|
|
108
|
+
start: CellPosition;
|
|
109
|
+
end: CellPosition;
|
|
110
|
+
}
|
|
111
|
+
interface SelectionState {
|
|
112
|
+
selectedCells: Set<string>;
|
|
113
|
+
selectionRange: CellRange | null;
|
|
114
|
+
isSelecting: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface ContextMenuState {
|
|
117
|
+
open: boolean;
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
}
|
|
121
|
+
interface PasteDialogState {
|
|
122
|
+
open: boolean;
|
|
123
|
+
rowsNeeded: number;
|
|
124
|
+
clipboardText: string;
|
|
125
|
+
}
|
|
126
|
+
type NavigationDirection = "up" | "down" | "left" | "right" | "home" | "end" | "ctrl+up" | "ctrl+down" | "ctrl+home" | "ctrl+end" | "pageup" | "pagedown" | "pageleft" | "pageright";
|
|
127
|
+
interface SearchState {
|
|
128
|
+
searchMatches: CellPosition[];
|
|
129
|
+
matchIndex: number;
|
|
130
|
+
searchOpen: boolean;
|
|
131
|
+
onSearchOpenChange: (open: boolean) => void;
|
|
132
|
+
searchQuery: string;
|
|
133
|
+
onSearchQueryChange: (query: string) => void;
|
|
134
|
+
onSearch: (query: string) => void;
|
|
135
|
+
onNavigateToNextMatch: () => void;
|
|
136
|
+
onNavigateToPrevMatch: () => void;
|
|
137
|
+
}
|
|
138
|
+
interface DataGridCellProps<TData> {
|
|
139
|
+
cell: Cell<TData, unknown>;
|
|
140
|
+
tableMeta: TableMeta<TData>;
|
|
141
|
+
rowIndex: number;
|
|
142
|
+
columnId: string;
|
|
143
|
+
rowHeight: RowHeightValue;
|
|
144
|
+
isEditing: boolean;
|
|
145
|
+
isFocused: boolean;
|
|
146
|
+
isSelected: boolean;
|
|
147
|
+
isSearchMatch: boolean;
|
|
148
|
+
isActiveSearchMatch: boolean;
|
|
149
|
+
readOnly: boolean;
|
|
150
|
+
}
|
|
151
|
+
interface FileCellData {
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
size: number;
|
|
155
|
+
type: string;
|
|
156
|
+
url?: string;
|
|
157
|
+
}
|
|
158
|
+
type TextFilterOperator = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty";
|
|
159
|
+
type NumberFilterOperator = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "isBetween" | "isEmpty" | "isNotEmpty";
|
|
160
|
+
type DateFilterOperator = "equals" | "notEquals" | "before" | "after" | "onOrBefore" | "onOrAfter" | "isBetween" | "isEmpty" | "isNotEmpty";
|
|
161
|
+
type SelectFilterOperator = "is" | "isNot" | "isAnyOf" | "isNoneOf" | "isEmpty" | "isNotEmpty";
|
|
162
|
+
type BooleanFilterOperator = "isTrue" | "isFalse";
|
|
163
|
+
type FilterOperator = TextFilterOperator | NumberFilterOperator | DateFilterOperator | SelectFilterOperator | BooleanFilterOperator;
|
|
164
|
+
interface FilterValue {
|
|
165
|
+
operator: FilterOperator;
|
|
166
|
+
value?: string | number | string[];
|
|
167
|
+
endValue?: string | number;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface UseDataGridProps<TData> extends Omit<TableOptions<TData>, "pageCount" | "getCoreRowModel"> {
|
|
171
|
+
onDataChange?: (data: TData[]) => void;
|
|
172
|
+
onRowAdd?: (event?: React$1.MouseEvent<HTMLDivElement>) => Partial<CellPosition> | Promise<Partial<CellPosition> | null> | null;
|
|
173
|
+
onRowsAdd?: (count: number) => void | Promise<void>;
|
|
174
|
+
onRowsDelete?: (rows: TData[], rowIndices: number[]) => void | Promise<void>;
|
|
175
|
+
onPaste?: (updates: Array<CellUpdate>) => void | Promise<void>;
|
|
176
|
+
onFilesUpload?: (params: {
|
|
177
|
+
files: File[];
|
|
178
|
+
rowIndex: number;
|
|
179
|
+
columnId: string;
|
|
180
|
+
}) => Promise<FileCellData[]>;
|
|
181
|
+
onFilesDelete?: (params: {
|
|
182
|
+
fileIds: string[];
|
|
183
|
+
rowIndex: number;
|
|
184
|
+
columnId: string;
|
|
185
|
+
}) => void | Promise<void>;
|
|
186
|
+
rowHeight?: RowHeightValue;
|
|
187
|
+
onRowHeightChange?: (rowHeight: RowHeightValue) => void;
|
|
188
|
+
overscan?: number;
|
|
189
|
+
dir?: Direction;
|
|
190
|
+
autoFocus?: boolean | Partial<CellPosition>;
|
|
191
|
+
enableSingleCellSelection?: boolean;
|
|
192
|
+
enableColumnSelection?: boolean;
|
|
193
|
+
enableSearch?: boolean;
|
|
194
|
+
enablePaste?: boolean;
|
|
195
|
+
readOnly?: boolean;
|
|
196
|
+
}
|
|
197
|
+
declare function useDataGrid<TData>({ data, columns, rowHeight: rowHeightProp, overscan, dir: dirProp, initialState, ...props }: UseDataGridProps<TData>): {
|
|
198
|
+
dataGridRef: React$1.RefObject<HTMLDivElement | null>;
|
|
199
|
+
headerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
200
|
+
rowMapRef: React$1.RefObject<Map<number, HTMLDivElement>>;
|
|
201
|
+
footerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
202
|
+
dir: "ltr" | "rtl";
|
|
203
|
+
table: _tanstack_table_core.Table<TData>;
|
|
204
|
+
tableMeta: TableMeta<TData>;
|
|
205
|
+
virtualTotalSize: number;
|
|
206
|
+
virtualItems: _tanstack_virtual_core.VirtualItem[];
|
|
207
|
+
measureElement: (node: Element | null) => void;
|
|
208
|
+
columns: ColumnDef<TData, any>[];
|
|
209
|
+
columnSizeVars: {
|
|
210
|
+
[key: string]: number;
|
|
211
|
+
};
|
|
212
|
+
searchState: SearchState | undefined;
|
|
213
|
+
searchMatchesByRow: Map<number, Set<string>> | null;
|
|
214
|
+
activeSearchMatch: CellPosition | null;
|
|
215
|
+
cellSelectionMap: Map<number, Set<string>> | null;
|
|
216
|
+
focusedCell: CellPosition | null;
|
|
217
|
+
editingCell: CellPosition | null;
|
|
218
|
+
rowHeight: RowHeightValue;
|
|
219
|
+
contextMenu: ContextMenuState;
|
|
220
|
+
pasteDialog: PasteDialogState;
|
|
221
|
+
onRowAdd: ((event?: React$1.MouseEvent<HTMLDivElement>) => Promise<void>) | undefined;
|
|
222
|
+
adjustLayout: boolean;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
interface DataGridProps<TData> extends Omit<ReturnType<typeof useDataGrid<TData>>, "dir">, Omit<React$1.ComponentProps<"div">, "contextMenu"> {
|
|
226
|
+
dir?: Direction;
|
|
227
|
+
height?: number;
|
|
228
|
+
stretchColumns?: boolean;
|
|
229
|
+
}
|
|
230
|
+
declare function DataGrid<TData>({ dataGridRef, headerRef, rowMapRef, footerRef, dir, table, tableMeta, virtualTotalSize, virtualItems, measureElement, columns, columnSizeVars, searchState, searchMatchesByRow, activeSearchMatch, cellSelectionMap, focusedCell, editingCell, rowHeight, contextMenu, pasteDialog, onRowAdd: onRowAddProp, height, stretchColumns, adjustLayout, className, ...props }: DataGridProps<TData>): react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
declare function getCellKey(rowIndex: number, columnId: string): string;
|
|
233
|
+
declare function parseCellKey(cellKey: string): Required<CellPosition>;
|
|
234
|
+
declare function getRowHeightValue(rowHeight: RowHeightValue): number;
|
|
235
|
+
declare function getColumnPinningStyle<TData>(params: {
|
|
236
|
+
column: Column<TData>;
|
|
237
|
+
withBorder?: boolean;
|
|
238
|
+
dir?: Direction;
|
|
239
|
+
}): React$1.CSSProperties;
|
|
240
|
+
|
|
241
|
+
export { type BooleanFilterOperator, type CellOpts, type CellPosition, type CellRange, type CellSelectOption, type CellUpdate, type ContextMenuState, DataGrid, type DataGridCellProps, type DateFilterOperator, type Direction, type FileCellData, type FilterOperator, type FilterValue, type NavigationDirection, type NumberFilterOperator, type PasteDialogState, type RowHeightValue, type SearchState, type SelectFilterOperator, type SelectionState, type TextFilterOperator, type UseDataGridProps, getCellKey, getColumnPinningStyle as getGridColumnPinningStyle, getRowHeightValue, parseCellKey, useDataGrid };
|