@expcat/tigercat-core 1.0.7 → 1.2.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/datepicker-DXzS_8l8.d.cts +130 -0
- package/dist/datepicker-DXzS_8l8.d.ts +130 -0
- package/dist/datepicker-locales/ar-SA.cjs +46 -0
- package/dist/datepicker-locales/ar-SA.d.cts +6 -0
- package/dist/datepicker-locales/ar-SA.d.ts +6 -0
- package/dist/datepicker-locales/ar-SA.js +20 -0
- package/dist/datepicker-locales/de-DE.cjs +46 -0
- package/dist/datepicker-locales/de-DE.d.cts +6 -0
- package/dist/datepicker-locales/de-DE.d.ts +6 -0
- package/dist/datepicker-locales/de-DE.js +20 -0
- package/dist/datepicker-locales/en-US.cjs +46 -0
- package/dist/datepicker-locales/en-US.d.cts +6 -0
- package/dist/datepicker-locales/en-US.d.ts +6 -0
- package/dist/datepicker-locales/en-US.js +20 -0
- package/dist/datepicker-locales/es-ES.cjs +46 -0
- package/dist/datepicker-locales/es-ES.d.cts +6 -0
- package/dist/datepicker-locales/es-ES.d.ts +6 -0
- package/dist/datepicker-locales/es-ES.js +20 -0
- package/dist/datepicker-locales/fr-FR.cjs +46 -0
- package/dist/datepicker-locales/fr-FR.d.cts +6 -0
- package/dist/datepicker-locales/fr-FR.d.ts +6 -0
- package/dist/datepicker-locales/fr-FR.js +20 -0
- package/dist/datepicker-locales/id-ID.cjs +46 -0
- package/dist/datepicker-locales/id-ID.d.cts +6 -0
- package/dist/datepicker-locales/id-ID.d.ts +6 -0
- package/dist/datepicker-locales/id-ID.js +20 -0
- package/dist/datepicker-locales/ja-JP.cjs +46 -0
- package/dist/datepicker-locales/ja-JP.d.cts +6 -0
- package/dist/datepicker-locales/ja-JP.d.ts +6 -0
- package/dist/datepicker-locales/ja-JP.js +20 -0
- package/dist/datepicker-locales/ko-KR.cjs +46 -0
- package/dist/datepicker-locales/ko-KR.d.cts +6 -0
- package/dist/datepicker-locales/ko-KR.d.ts +6 -0
- package/dist/datepicker-locales/ko-KR.js +20 -0
- package/dist/datepicker-locales/pt-BR.cjs +46 -0
- package/dist/datepicker-locales/pt-BR.d.cts +6 -0
- package/dist/datepicker-locales/pt-BR.d.ts +6 -0
- package/dist/datepicker-locales/pt-BR.js +20 -0
- package/dist/datepicker-locales/th-TH.cjs +46 -0
- package/dist/datepicker-locales/th-TH.d.cts +6 -0
- package/dist/datepicker-locales/th-TH.d.ts +6 -0
- package/dist/datepicker-locales/th-TH.js +20 -0
- package/dist/datepicker-locales/vi-VN.cjs +46 -0
- package/dist/datepicker-locales/vi-VN.d.cts +6 -0
- package/dist/datepicker-locales/vi-VN.d.ts +6 -0
- package/dist/datepicker-locales/vi-VN.js +20 -0
- package/dist/datepicker-locales/zh-CN.cjs +46 -0
- package/dist/datepicker-locales/zh-CN.d.cts +6 -0
- package/dist/datepicker-locales/zh-CN.d.ts +6 -0
- package/dist/datepicker-locales/zh-CN.js +20 -0
- package/dist/datepicker-locales/zh-TW.cjs +46 -0
- package/dist/datepicker-locales/zh-TW.d.cts +6 -0
- package/dist/datepicker-locales/zh-TW.d.ts +6 -0
- package/dist/datepicker-locales/zh-TW.js +20 -0
- package/dist/icons/common.cjs +54 -0
- package/dist/icons/common.d.cts +20 -0
- package/dist/icons/common.d.ts +20 -0
- package/dist/icons/common.js +21 -0
- package/dist/icons/picker.cjs +75 -0
- package/dist/icons/picker.d.cts +53 -0
- package/dist/icons/picker.d.ts +53 -0
- package/dist/icons/picker.js +35 -0
- package/dist/icons/status.cjs +47 -0
- package/dist/icons/status.d.cts +13 -0
- package/dist/icons/status.d.ts +13 -0
- package/dist/icons/status.js +18 -0
- package/dist/icons/table.cjs +48 -0
- package/dist/icons/table.d.cts +25 -0
- package/dist/icons/table.d.ts +25 -0
- package/dist/icons/table.js +17 -0
- package/dist/index.cjs +7064 -886
- package/dist/index.d.cts +3826 -1238
- package/dist/index.d.ts +3826 -1238
- package/dist/index.js +6705 -1011
- package/dist/locale-9-B-d0mp.d.cts +97 -0
- package/dist/locale-Bc3zz2b0.d.ts +97 -0
- package/dist/locales/ar-SA.cjs +155 -0
- package/dist/locales/ar-SA.d.cts +10 -0
- package/dist/locales/ar-SA.d.ts +10 -0
- package/dist/locales/ar-SA.js +128 -0
- package/dist/locales/de-DE.cjs +155 -0
- package/dist/locales/de-DE.d.cts +10 -0
- package/dist/locales/de-DE.d.ts +10 -0
- package/dist/locales/de-DE.js +128 -0
- package/dist/locales/en-US.cjs +69 -0
- package/dist/locales/en-US.d.cts +10 -0
- package/dist/locales/en-US.d.ts +10 -0
- package/dist/locales/en-US.js +44 -0
- package/dist/locales/es-ES.cjs +155 -0
- package/dist/locales/es-ES.d.cts +10 -0
- package/dist/locales/es-ES.d.ts +10 -0
- package/dist/locales/es-ES.js +128 -0
- package/dist/locales/fr-FR.cjs +155 -0
- package/dist/locales/fr-FR.d.cts +10 -0
- package/dist/locales/fr-FR.d.ts +10 -0
- package/dist/locales/fr-FR.js +128 -0
- package/dist/locales/id-ID.cjs +69 -0
- package/dist/locales/id-ID.d.cts +10 -0
- package/dist/locales/id-ID.d.ts +10 -0
- package/dist/locales/id-ID.js +44 -0
- package/dist/locales/ja-JP.cjs +69 -0
- package/dist/locales/ja-JP.d.cts +10 -0
- package/dist/locales/ja-JP.d.ts +10 -0
- package/dist/locales/ja-JP.js +44 -0
- package/dist/locales/ko-KR.cjs +69 -0
- package/dist/locales/ko-KR.d.cts +10 -0
- package/dist/locales/ko-KR.d.ts +10 -0
- package/dist/locales/ko-KR.js +44 -0
- package/dist/locales/pt-BR.cjs +155 -0
- package/dist/locales/pt-BR.d.cts +10 -0
- package/dist/locales/pt-BR.d.ts +10 -0
- package/dist/locales/pt-BR.js +128 -0
- package/dist/locales/th-TH.cjs +69 -0
- package/dist/locales/th-TH.d.cts +10 -0
- package/dist/locales/th-TH.d.ts +10 -0
- package/dist/locales/th-TH.js +44 -0
- package/dist/locales/vi-VN.cjs +69 -0
- package/dist/locales/vi-VN.d.cts +10 -0
- package/dist/locales/vi-VN.d.ts +10 -0
- package/dist/locales/vi-VN.js +44 -0
- package/dist/locales/zh-CN.cjs +69 -0
- package/dist/locales/zh-CN.d.cts +10 -0
- package/dist/locales/zh-CN.d.ts +10 -0
- package/dist/locales/zh-CN.js +44 -0
- package/dist/locales/zh-TW.cjs +69 -0
- package/dist/locales/zh-TW.d.cts +10 -0
- package/dist/locales/zh-TW.d.ts +10 -0
- package/dist/locales/zh-TW.js +44 -0
- package/dist/table-export-6ISYSoVB.d.cts +490 -0
- package/dist/table-export-6ISYSoVB.d.ts +490 -0
- package/dist/tailwind/modern.cjs +353 -0
- package/dist/tailwind/modern.d.cts +6 -0
- package/dist/tailwind/modern.d.ts +6 -0
- package/dist/tailwind/modern.js +320 -0
- package/dist/tailwind-entry-D4_sseNi.d.ts +218 -0
- package/dist/tailwind-entry-DUchHtjs.d.cts +218 -0
- package/dist/tailwind.cjs +206 -0
- package/dist/tailwind.d.cts +3 -0
- package/dist/tailwind.d.ts +3 -0
- package/dist/tailwind.js +173 -0
- package/dist/types-CJYAW1ql.d-DDBFn6KB.d.cts +126 -0
- package/dist/types-CJYAW1ql.d-DDBFn6KB.d.ts +126 -0
- package/dist/utils/table-export.cjs +112 -0
- package/dist/utils/table-export.d.cts +1 -0
- package/dist/utils/table-export.d.ts +1 -0
- package/dist/utils/table-export.js +79 -0
- package/package.json +190 -12
- package/tokens/figma-variables.json +2553 -0
- package/tokens/tailwind-tokens.js +145 -0
- package/tokens/tokens.css +640 -0
- package/tokens/tokens.json +395 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table component types and interfaces
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Table size types
|
|
6
|
+
*/
|
|
7
|
+
type TableSize = 'sm' | 'md' | 'lg';
|
|
8
|
+
type TableExportFormat = 'csv' | 'excel';
|
|
9
|
+
type TableResponsiveMode = 'card' | 'scroll';
|
|
10
|
+
/**
|
|
11
|
+
* Sort direction
|
|
12
|
+
*/
|
|
13
|
+
type SortDirection = 'asc' | 'desc' | null;
|
|
14
|
+
/**
|
|
15
|
+
* Sort state
|
|
16
|
+
*/
|
|
17
|
+
interface SortState {
|
|
18
|
+
/**
|
|
19
|
+
* Column key to sort by
|
|
20
|
+
*/
|
|
21
|
+
key: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Sort direction
|
|
24
|
+
*/
|
|
25
|
+
direction: SortDirection;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Column alignment
|
|
29
|
+
*/
|
|
30
|
+
type ColumnAlign = 'left' | 'center' | 'right';
|
|
31
|
+
/**
|
|
32
|
+
* Filter type
|
|
33
|
+
*/
|
|
34
|
+
type FilterType = 'text' | 'select' | 'custom';
|
|
35
|
+
/**
|
|
36
|
+
* Filter option for select filter
|
|
37
|
+
*/
|
|
38
|
+
interface FilterOption {
|
|
39
|
+
/**
|
|
40
|
+
* Option label
|
|
41
|
+
*/
|
|
42
|
+
label: string;
|
|
43
|
+
/**
|
|
44
|
+
* Option value
|
|
45
|
+
*/
|
|
46
|
+
value: string | number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Column filter configuration
|
|
50
|
+
*/
|
|
51
|
+
interface ColumnFilter {
|
|
52
|
+
/**
|
|
53
|
+
* Filter type
|
|
54
|
+
* @default 'text'
|
|
55
|
+
*/
|
|
56
|
+
type?: FilterType;
|
|
57
|
+
/**
|
|
58
|
+
* Filter options (for select type)
|
|
59
|
+
*/
|
|
60
|
+
options?: FilterOption[];
|
|
61
|
+
/**
|
|
62
|
+
* Placeholder text
|
|
63
|
+
*/
|
|
64
|
+
placeholder?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Custom filter function
|
|
67
|
+
* @param value - Cell value
|
|
68
|
+
* @param filterValue - Current filter value
|
|
69
|
+
* @returns Whether the row should be shown
|
|
70
|
+
*/
|
|
71
|
+
filterFn?: (value: unknown, filterValue: unknown) => boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Table column configuration
|
|
75
|
+
*/
|
|
76
|
+
interface TableColumn<T = Record<string, unknown>> {
|
|
77
|
+
/**
|
|
78
|
+
* Column key (must be unique)
|
|
79
|
+
*/
|
|
80
|
+
key: string;
|
|
81
|
+
/**
|
|
82
|
+
* Column title/header text
|
|
83
|
+
*/
|
|
84
|
+
title: string;
|
|
85
|
+
/**
|
|
86
|
+
* Data key to access in row object
|
|
87
|
+
* If not provided, uses `key`
|
|
88
|
+
*/
|
|
89
|
+
dataKey?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Column width (CSS value)
|
|
92
|
+
*/
|
|
93
|
+
width?: string | number;
|
|
94
|
+
/**
|
|
95
|
+
* Column alignment
|
|
96
|
+
* @default 'left'
|
|
97
|
+
*/
|
|
98
|
+
align?: ColumnAlign;
|
|
99
|
+
/**
|
|
100
|
+
* Whether column is sortable
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
sortable?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Custom sort function
|
|
106
|
+
* @param a - First value
|
|
107
|
+
* @param b - Second value
|
|
108
|
+
* @returns Sort comparison result
|
|
109
|
+
*/
|
|
110
|
+
sortFn?: (a: unknown, b: unknown) => number;
|
|
111
|
+
/**
|
|
112
|
+
* Column filter configuration
|
|
113
|
+
*/
|
|
114
|
+
filter?: ColumnFilter;
|
|
115
|
+
/**
|
|
116
|
+
* Whether column is fixed
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
fixed?: 'left' | 'right' | false;
|
|
120
|
+
/**
|
|
121
|
+
* Custom render function for cell content
|
|
122
|
+
* Framework-specific implementations will handle this differently
|
|
123
|
+
*/
|
|
124
|
+
render?: (record: T, index: number) => unknown;
|
|
125
|
+
/**
|
|
126
|
+
* Custom render function for header
|
|
127
|
+
*/
|
|
128
|
+
renderHeader?: () => unknown;
|
|
129
|
+
/**
|
|
130
|
+
* CSS class for column cells
|
|
131
|
+
*/
|
|
132
|
+
className?: string;
|
|
133
|
+
/**
|
|
134
|
+
* CSS class for header cell
|
|
135
|
+
*/
|
|
136
|
+
headerClassName?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Pagination configuration
|
|
140
|
+
*/
|
|
141
|
+
interface PaginationConfig {
|
|
142
|
+
/**
|
|
143
|
+
* Current page number (1-indexed)
|
|
144
|
+
* @default 1
|
|
145
|
+
*/
|
|
146
|
+
current?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Default current page number (1-indexed) for uncontrolled mode.
|
|
149
|
+
* Used when `current` is not provided.
|
|
150
|
+
* @default 1
|
|
151
|
+
*/
|
|
152
|
+
defaultCurrent?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Number of items per page
|
|
155
|
+
* @default 10
|
|
156
|
+
*/
|
|
157
|
+
pageSize?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Default page size for uncontrolled mode.
|
|
160
|
+
* Used when `pageSize` is not provided.
|
|
161
|
+
* @default 10
|
|
162
|
+
*/
|
|
163
|
+
defaultPageSize?: number;
|
|
164
|
+
/**
|
|
165
|
+
* Total number of items
|
|
166
|
+
*/
|
|
167
|
+
total?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Available page size options
|
|
170
|
+
* @default [10, 20, 50, 100]
|
|
171
|
+
*/
|
|
172
|
+
pageSizeOptions?: number[];
|
|
173
|
+
/**
|
|
174
|
+
* Whether to show page size selector
|
|
175
|
+
* @default true
|
|
176
|
+
*/
|
|
177
|
+
showSizeChanger?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Whether to show total count
|
|
180
|
+
* @default true
|
|
181
|
+
*/
|
|
182
|
+
showTotal?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Custom total text render function
|
|
185
|
+
*/
|
|
186
|
+
totalText?: (total: number, range: [number, number]) => string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Table row selection configuration
|
|
190
|
+
*/
|
|
191
|
+
interface RowSelectionConfig<T = Record<string, unknown>> {
|
|
192
|
+
/**
|
|
193
|
+
* Selected row keys
|
|
194
|
+
*/
|
|
195
|
+
selectedRowKeys?: (string | number)[];
|
|
196
|
+
/**
|
|
197
|
+
* Default selected row keys for uncontrolled mode.
|
|
198
|
+
* Used when `selectedRowKeys` is not provided.
|
|
199
|
+
*/
|
|
200
|
+
defaultSelectedRowKeys?: (string | number)[];
|
|
201
|
+
/**
|
|
202
|
+
* Function to get row key
|
|
203
|
+
* @default (record) => record.id
|
|
204
|
+
*/
|
|
205
|
+
getRowKey?: (record: T) => string | number;
|
|
206
|
+
/**
|
|
207
|
+
* Whether to show checkbox column
|
|
208
|
+
* @default true
|
|
209
|
+
*/
|
|
210
|
+
showCheckbox?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Selection type
|
|
213
|
+
* @default 'checkbox'
|
|
214
|
+
*/
|
|
215
|
+
type?: 'checkbox' | 'radio';
|
|
216
|
+
/**
|
|
217
|
+
* Function to determine if row can be selected
|
|
218
|
+
*/
|
|
219
|
+
getCheckboxProps?: (record: T) => {
|
|
220
|
+
disabled?: boolean;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Table row expansion configuration
|
|
225
|
+
*/
|
|
226
|
+
interface ExpandableConfig<T = Record<string, unknown>> {
|
|
227
|
+
/**
|
|
228
|
+
* Currently expanded row keys (controlled mode).
|
|
229
|
+
* When provided, internal expand state will not be mutated.
|
|
230
|
+
*/
|
|
231
|
+
expandedRowKeys?: (string | number)[];
|
|
232
|
+
/**
|
|
233
|
+
* Default expanded row keys for uncontrolled mode.
|
|
234
|
+
* Used when `expandedRowKeys` is not provided.
|
|
235
|
+
*/
|
|
236
|
+
defaultExpandedRowKeys?: (string | number)[];
|
|
237
|
+
/**
|
|
238
|
+
* Render function for expanded row content.
|
|
239
|
+
* Framework-specific implementations may also support slots/children.
|
|
240
|
+
*/
|
|
241
|
+
expandedRowRender?: (record: T, index: number) => unknown;
|
|
242
|
+
/**
|
|
243
|
+
* Determine whether a row is expandable.
|
|
244
|
+
* Return false to hide the expand icon for that row.
|
|
245
|
+
* @default () => true
|
|
246
|
+
*/
|
|
247
|
+
rowExpandable?: (record: T) => boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Whether clicking the entire row toggles expand state.
|
|
250
|
+
* When false, only clicking the expand icon triggers expansion.
|
|
251
|
+
* @default false
|
|
252
|
+
*/
|
|
253
|
+
expandRowByClick?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Position of the expand toggle column.
|
|
256
|
+
* @default 'start'
|
|
257
|
+
*/
|
|
258
|
+
expandIconPosition?: 'start' | 'end';
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Base table props interface
|
|
262
|
+
*/
|
|
263
|
+
interface TableProps<T = Record<string, unknown>> {
|
|
264
|
+
/**
|
|
265
|
+
* Table columns configuration
|
|
266
|
+
*/
|
|
267
|
+
columns: TableColumn<T>[];
|
|
268
|
+
/**
|
|
269
|
+
* Whether to show a lock button in each column header.
|
|
270
|
+
* Clicking the lock toggles the column fixed state.
|
|
271
|
+
* @default false
|
|
272
|
+
*/
|
|
273
|
+
columnLockable?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Table data source
|
|
276
|
+
* @default []
|
|
277
|
+
*/
|
|
278
|
+
dataSource?: T[];
|
|
279
|
+
/**
|
|
280
|
+
* Controlled sort state.
|
|
281
|
+
* When provided, internal sort state will not be mutated.
|
|
282
|
+
*/
|
|
283
|
+
sort?: SortState;
|
|
284
|
+
/**
|
|
285
|
+
* Default sort state for uncontrolled mode.
|
|
286
|
+
*/
|
|
287
|
+
defaultSort?: SortState;
|
|
288
|
+
/**
|
|
289
|
+
* Controlled filters.
|
|
290
|
+
* When provided, internal filter state will not be mutated.
|
|
291
|
+
*/
|
|
292
|
+
filters?: Record<string, unknown>;
|
|
293
|
+
/**
|
|
294
|
+
* Default filters for uncontrolled mode.
|
|
295
|
+
*/
|
|
296
|
+
defaultFilters?: Record<string, unknown>;
|
|
297
|
+
/**
|
|
298
|
+
* Table size
|
|
299
|
+
* @default 'md'
|
|
300
|
+
*/
|
|
301
|
+
size?: TableSize;
|
|
302
|
+
/**
|
|
303
|
+
* Whether to show border
|
|
304
|
+
* @default false
|
|
305
|
+
*/
|
|
306
|
+
bordered?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Whether to show striped rows
|
|
309
|
+
* @default false
|
|
310
|
+
*/
|
|
311
|
+
striped?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Whether to highlight row on hover
|
|
314
|
+
* @default true
|
|
315
|
+
*/
|
|
316
|
+
hoverable?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Loading state
|
|
319
|
+
* @default false
|
|
320
|
+
*/
|
|
321
|
+
loading?: boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Empty state text
|
|
324
|
+
* @default 'No data'
|
|
325
|
+
*/
|
|
326
|
+
emptyText?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Pagination configuration
|
|
329
|
+
* Set to false to disable pagination
|
|
330
|
+
*/
|
|
331
|
+
pagination?: PaginationConfig | false;
|
|
332
|
+
/**
|
|
333
|
+
* Row selection configuration
|
|
334
|
+
*/
|
|
335
|
+
rowSelection?: RowSelectionConfig<T>;
|
|
336
|
+
/**
|
|
337
|
+
* Row expansion configuration.
|
|
338
|
+
* Adds an expand toggle column and renders expanded content below each row.
|
|
339
|
+
*/
|
|
340
|
+
expandable?: ExpandableConfig<T>;
|
|
341
|
+
/**
|
|
342
|
+
* Function to get row key
|
|
343
|
+
* @default (record) => record.id
|
|
344
|
+
*/
|
|
345
|
+
rowKey?: string | ((record: T) => string | number);
|
|
346
|
+
/**
|
|
347
|
+
* Custom row class name
|
|
348
|
+
*/
|
|
349
|
+
rowClassName?: string | ((record: T, index: number) => string);
|
|
350
|
+
/**
|
|
351
|
+
* Whether table head is sticky
|
|
352
|
+
* @default false
|
|
353
|
+
*/
|
|
354
|
+
stickyHeader?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Max height for scrollable table
|
|
357
|
+
*/
|
|
358
|
+
maxHeight?: string | number;
|
|
359
|
+
/**
|
|
360
|
+
* Table layout algorithm
|
|
361
|
+
* @default 'auto'
|
|
362
|
+
*/
|
|
363
|
+
tableLayout?: 'auto' | 'fixed';
|
|
364
|
+
/**
|
|
365
|
+
* Mobile layout below 640px. `scroll` keeps the table horizontally scrollable;
|
|
366
|
+
* `card` renders each row as a stacked card list.
|
|
367
|
+
* @default 'scroll'
|
|
368
|
+
*/
|
|
369
|
+
responsiveMode?: TableResponsiveMode;
|
|
370
|
+
/**
|
|
371
|
+
* Enable virtual scrolling for large datasets
|
|
372
|
+
* @default false
|
|
373
|
+
*/
|
|
374
|
+
virtual?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Automatically enable Table's virtual scroll container for very large data sets.
|
|
377
|
+
* @default true
|
|
378
|
+
*/
|
|
379
|
+
autoVirtual?: boolean;
|
|
380
|
+
/**
|
|
381
|
+
* Virtual scroll viewport height (px)
|
|
382
|
+
* @default 400
|
|
383
|
+
*/
|
|
384
|
+
virtualHeight?: number;
|
|
385
|
+
/**
|
|
386
|
+
* Virtual scroll row height (px)
|
|
387
|
+
* @default 40
|
|
388
|
+
*/
|
|
389
|
+
virtualItemHeight?: number;
|
|
390
|
+
/**
|
|
391
|
+
* Row count at which Table enables virtual mode automatically when `autoVirtual` is true.
|
|
392
|
+
* @default 10000
|
|
393
|
+
*/
|
|
394
|
+
autoVirtualThreshold?: number;
|
|
395
|
+
/**
|
|
396
|
+
* Row count at which Table marks virtual rendering as recommended.
|
|
397
|
+
* Table does not enable virtualization automatically; use this signal to
|
|
398
|
+
* switch to `virtual` or the dedicated `VirtualTable` component.
|
|
399
|
+
* @default 1000
|
|
400
|
+
*/
|
|
401
|
+
virtualThreshold?: number;
|
|
402
|
+
/**
|
|
403
|
+
* Enable cell editing
|
|
404
|
+
* @default false
|
|
405
|
+
*/
|
|
406
|
+
editable?: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Set of editable cells: Map<columnKey, Set<rowIndex>>
|
|
409
|
+
* If not provided and editable=true, all cells are editable
|
|
410
|
+
*/
|
|
411
|
+
editableCells?: Map<string, Set<number>>;
|
|
412
|
+
/**
|
|
413
|
+
* Filter mode
|
|
414
|
+
* @default 'basic'
|
|
415
|
+
*/
|
|
416
|
+
filterMode?: 'basic' | 'advanced';
|
|
417
|
+
/**
|
|
418
|
+
* Advanced filter rules (used when filterMode='advanced')
|
|
419
|
+
*/
|
|
420
|
+
advancedFilterRules?: FilterRule[];
|
|
421
|
+
/**
|
|
422
|
+
* Enable column drag reorder
|
|
423
|
+
* @default false
|
|
424
|
+
*/
|
|
425
|
+
columnDraggable?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* Enable row drag reorder.
|
|
428
|
+
* @default false
|
|
429
|
+
*/
|
|
430
|
+
rowDraggable?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Summary row configuration
|
|
433
|
+
*/
|
|
434
|
+
summaryRow?: {
|
|
435
|
+
show: boolean;
|
|
436
|
+
data: Record<string, unknown>;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Group rows by column key
|
|
440
|
+
*/
|
|
441
|
+
groupBy?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Enable table export
|
|
444
|
+
* @default false
|
|
445
|
+
*/
|
|
446
|
+
exportable?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Export format.
|
|
449
|
+
* @default 'csv'
|
|
450
|
+
*/
|
|
451
|
+
exportFormat?: TableExportFormat;
|
|
452
|
+
/**
|
|
453
|
+
* Export filename (without extension)
|
|
454
|
+
* @default 'export'
|
|
455
|
+
*/
|
|
456
|
+
exportFilename?: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Filter rule for advanced filtering
|
|
460
|
+
*/
|
|
461
|
+
interface FilterRule {
|
|
462
|
+
column: string;
|
|
463
|
+
operator: 'equals' | 'contains' | 'gt' | 'lt' | 'between' | 'notEquals';
|
|
464
|
+
value: unknown;
|
|
465
|
+
valueTo?: unknown;
|
|
466
|
+
logic?: 'and' | 'or';
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Table export utilities (CSV / Excel-compatible HTML worksheet)
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Export table data to CSV string
|
|
475
|
+
*/
|
|
476
|
+
declare function exportTableToCsv<T>(columns: TableColumn<T>[], data: T[], _filename?: string): string;
|
|
477
|
+
declare function exportTableToExcel<T>(columns: TableColumn<T>[], data: T[]): string;
|
|
478
|
+
/**
|
|
479
|
+
* Trigger a CSV file download in the browser
|
|
480
|
+
*/
|
|
481
|
+
declare function downloadCsv(csvContent: string, filename?: string): void;
|
|
482
|
+
declare function downloadExcel(excelContent: string, filename?: string): void;
|
|
483
|
+
declare function exportTableData<T>(columns: TableColumn<T>[], data: T[], format?: TableExportFormat): string;
|
|
484
|
+
declare function downloadTableExport(content: string, filename?: string, format?: TableExportFormat): void;
|
|
485
|
+
/**
|
|
486
|
+
* Get export button classes
|
|
487
|
+
*/
|
|
488
|
+
declare const tableExportButtonClasses = "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] text-[var(--tiger-text,#111827)] bg-[var(--tiger-surface,#ffffff)] hover:bg-[var(--tiger-surface-muted,#f9fafb)] transition-colors";
|
|
489
|
+
|
|
490
|
+
export { type ColumnAlign as C, type ExpandableConfig as E, type FilterOption as F, type PaginationConfig as P, type RowSelectionConfig as R, type SortDirection as S, type TableResponsiveMode as T, type TableColumn as a, type TableSize as b, type TableProps as c, type FilterRule as d, type ColumnFilter as e, type SortState as f, exportTableToCsv as g, exportTableToExcel as h, downloadCsv as i, downloadExcel as j, exportTableData as k, downloadTableExport as l, type TableExportFormat as m, type FilterType as n, tableExportButtonClasses as t };
|