@orfium/ictinus 5.43.3 → 5.43.5
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/.turbo/turbo-build.log +20 -20
- package/CHANGELOG.md +12 -0
- package/dist/components/IconButton/IconButton.js +16 -17
- package/dist/components/Modal/Modal.js +27 -27
- package/dist/components/Table/components/TPagination/TPagination.js +26 -27
- package/dist/index.js +237 -236
- package/dist/package.json.d.ts +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/components/Icon/Icon.d.ts +5 -0
- package/dist/src/components/IconButton/IconButton.d.ts +9 -4
- package/dist/src/components/Menu/Menu.d.ts +5 -0
- package/dist/src/data-table/DataTable.d.ts +12 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/vanilla/index.d.ts +12 -0
- package/dist/vanilla/package.json.js +1 -1
- package/dist/vanilla/src/components/IconButton/IconButton.js +15 -6
- package/dist/vanilla/src/data-table/DataTableBody.js +98 -86
- package/package.json +1 -1
- package/src/components/Icon/Icon.tsx +5 -0
- package/src/components/IconButton/IconButton.tsx +23 -9
- package/src/components/Menu/Menu.tsx +5 -0
- package/src/components/Modal/Modal.tsx +1 -2
- package/src/components/Table/components/TPagination/TPagination.tsx +0 -5
- package/src/data-table/DataTable.tsx +16 -0
- package/src/data-table/DataTableBody.tsx +108 -95
- package/src/index.ts +2 -0
- package/src/data-table/react-table.d.ts +0 -12
|
@@ -21,8 +21,8 @@ export type DataTableBodyProps = BoxProps<
|
|
|
21
21
|
}
|
|
22
22
|
>;
|
|
23
23
|
|
|
24
|
-
const COL_VIRTUALIZATION_THRESHOLD =
|
|
25
|
-
const ROW_VIRTUALIZATION_THRESHOLD =
|
|
24
|
+
const COL_VIRTUALIZATION_THRESHOLD = 25;
|
|
25
|
+
const ROW_VIRTUALIZATION_THRESHOLD = 25;
|
|
26
26
|
|
|
27
27
|
export const DataTableBody = forwardRef<HTMLDivElement, DataTableBodyProps>(
|
|
28
28
|
(
|
|
@@ -174,104 +174,117 @@ export const DataTableBody = forwardRef<HTMLDivElement, DataTableBodyProps>(
|
|
|
174
174
|
virtualRow,
|
|
175
175
|
}))
|
|
176
176
|
: rows.map((row) => ({ row, virtualRow: undefined }))
|
|
177
|
-
).map(({ row, virtualRow }, index) =>
|
|
178
|
-
|
|
179
|
-
data-index={virtualRow?.index}
|
|
180
|
-
display="flex"
|
|
181
|
-
key={row.id}
|
|
182
|
-
index={virtualRow?.index ?? index}
|
|
183
|
-
row={row}
|
|
184
|
-
ref={virtualRow ? rowVirtualizer.measureElement : undefined}
|
|
185
|
-
style={
|
|
186
|
-
virtualRow
|
|
187
|
-
? {
|
|
188
|
-
position: 'absolute',
|
|
189
|
-
transform: `translateY(${virtualRow.start}px)`,
|
|
190
|
-
}
|
|
191
|
-
: undefined
|
|
192
|
-
}
|
|
193
|
-
>
|
|
194
|
-
{row.getLeftVisibleCells().map((cell) => (
|
|
195
|
-
<TableCell
|
|
196
|
-
bordered={bordered}
|
|
197
|
-
size={size}
|
|
198
|
-
justifyContent={cell.column.columnDef.meta?.align}
|
|
199
|
-
key={cell.id}
|
|
200
|
-
pinned
|
|
201
|
-
style={{
|
|
202
|
-
...assignInlineVars({
|
|
203
|
-
[styles.cellOffsetVar]: `${cell.column.getStart('left')}px`,
|
|
204
|
-
[styles.cellSizeVar]: `${cell.column.getSize()}`,
|
|
205
|
-
}),
|
|
206
|
-
}}
|
|
207
|
-
className={cn(
|
|
208
|
-
styles.cell({
|
|
209
|
-
pinned: 'left',
|
|
210
|
-
resizable: cell.column.getCanResize(),
|
|
211
|
-
})
|
|
212
|
-
)}
|
|
213
|
-
>
|
|
214
|
-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
215
|
-
</TableCell>
|
|
216
|
-
))}
|
|
177
|
+
).map(({ row, virtualRow }, index) => {
|
|
178
|
+
const cellProps = table.options.meta?.getCellProps?.(row);
|
|
217
179
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
180
|
+
return (
|
|
181
|
+
<DataTableRow
|
|
182
|
+
data-index={virtualRow?.index}
|
|
183
|
+
display="flex"
|
|
184
|
+
key={row.id}
|
|
185
|
+
index={virtualRow?.index ?? index}
|
|
186
|
+
row={row}
|
|
187
|
+
ref={virtualRow ? rowVirtualizer.measureElement : undefined}
|
|
188
|
+
style={
|
|
189
|
+
virtualRow
|
|
190
|
+
? {
|
|
191
|
+
position: 'absolute',
|
|
192
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
193
|
+
}
|
|
194
|
+
: undefined
|
|
195
|
+
}
|
|
196
|
+
>
|
|
197
|
+
{row.getLeftVisibleCells().map((cell) => (
|
|
198
|
+
<TableCell
|
|
199
|
+
bordered={bordered}
|
|
200
|
+
size={size}
|
|
201
|
+
justifyContent={cell.column.columnDef.meta?.align}
|
|
202
|
+
key={cell.id}
|
|
203
|
+
pinned
|
|
204
|
+
{...cellProps}
|
|
205
|
+
style={{
|
|
206
|
+
...assignInlineVars({
|
|
207
|
+
[styles.cellOffsetVar]: `${cell.column.getStart('left')}px`,
|
|
208
|
+
[styles.cellSizeVar]: `${cell.column.getSize()}`,
|
|
209
|
+
}),
|
|
210
|
+
...cellProps?.style,
|
|
211
|
+
}}
|
|
212
|
+
className={cn(
|
|
213
|
+
styles.cell({
|
|
214
|
+
pinned: 'left',
|
|
215
|
+
resizable: cell.column.getCanResize(),
|
|
216
|
+
}),
|
|
217
|
+
cellProps?.className
|
|
218
|
+
)}
|
|
219
|
+
>
|
|
220
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
221
|
+
</TableCell>
|
|
222
|
+
))}
|
|
221
223
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
{columnVirtualizer.options.enabled && virtualColumnsOffset > 0 && (
|
|
225
|
+
<TableCell style={{ width: virtualColumnsOffset }} />
|
|
226
|
+
)}
|
|
225
227
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
).map((cell) => (
|
|
230
|
-
<TableCell
|
|
231
|
-
key={cell.id}
|
|
232
|
-
size={size}
|
|
233
|
-
bordered={bordered}
|
|
234
|
-
justifyContent={cell.column.columnDef.meta?.align}
|
|
235
|
-
style={{
|
|
236
|
-
...assignInlineVars({
|
|
237
|
-
[styles.cellSizeVar]: `${cell.column.getSize()}`,
|
|
238
|
-
}),
|
|
239
|
-
}}
|
|
240
|
-
className={cn(
|
|
241
|
-
styles.cell({
|
|
242
|
-
resizable: cell.column.getCanResize(),
|
|
243
|
-
})
|
|
244
|
-
)}
|
|
245
|
-
>
|
|
246
|
-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
247
|
-
</TableCell>
|
|
248
|
-
))}
|
|
228
|
+
{(columnVirtualizer.options.enabled
|
|
229
|
+
? virtualColumns.map((virtualCell) => {
|
|
230
|
+
const cells = row.getCenterVisibleCells();
|
|
249
231
|
|
|
250
|
-
|
|
251
|
-
<TableCell
|
|
252
|
-
key={cell.id}
|
|
253
|
-
size={size}
|
|
254
|
-
bordered={bordered}
|
|
255
|
-
justifyContent={cell.column.columnDef.meta?.align}
|
|
256
|
-
pinned
|
|
257
|
-
style={{
|
|
258
|
-
...assignInlineVars({
|
|
259
|
-
[styles.cellOffsetVar]: `${cell.column.getStart('right')}px`,
|
|
260
|
-
[styles.cellSizeVar]: `${cell.column.getSize()}`,
|
|
261
|
-
}),
|
|
262
|
-
}}
|
|
263
|
-
className={cn(
|
|
264
|
-
styles.cell({
|
|
265
|
-
pinned: 'right',
|
|
266
|
-
resizable: cell.column.getCanResize(),
|
|
232
|
+
return cells[virtualCell.index];
|
|
267
233
|
})
|
|
268
|
-
)
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
234
|
+
: row.getCenterVisibleCells()
|
|
235
|
+
).map((cell) => (
|
|
236
|
+
<TableCell
|
|
237
|
+
key={cell.id}
|
|
238
|
+
size={size}
|
|
239
|
+
bordered={bordered}
|
|
240
|
+
justifyContent={cell.column.columnDef.meta?.align}
|
|
241
|
+
{...cellProps}
|
|
242
|
+
style={{
|
|
243
|
+
...assignInlineVars({
|
|
244
|
+
[styles.cellSizeVar]: `${cell.column.getSize()}`,
|
|
245
|
+
}),
|
|
246
|
+
...cellProps?.style,
|
|
247
|
+
}}
|
|
248
|
+
className={cn(
|
|
249
|
+
styles.cell({
|
|
250
|
+
resizable: cell.column.getCanResize(),
|
|
251
|
+
}),
|
|
252
|
+
cellProps?.className
|
|
253
|
+
)}
|
|
254
|
+
>
|
|
255
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
256
|
+
</TableCell>
|
|
257
|
+
))}
|
|
258
|
+
|
|
259
|
+
{row.getRightVisibleCells().map((cell) => (
|
|
260
|
+
<TableCell
|
|
261
|
+
key={cell.id}
|
|
262
|
+
size={size}
|
|
263
|
+
bordered={bordered}
|
|
264
|
+
justifyContent={cell.column.columnDef.meta?.align}
|
|
265
|
+
pinned
|
|
266
|
+
{...cellProps}
|
|
267
|
+
style={{
|
|
268
|
+
...assignInlineVars({
|
|
269
|
+
[styles.cellOffsetVar]: `${cell.column.getStart('right')}px`,
|
|
270
|
+
[styles.cellSizeVar]: `${cell.column.getSize()}`,
|
|
271
|
+
}),
|
|
272
|
+
...cellProps?.style,
|
|
273
|
+
}}
|
|
274
|
+
className={cn(
|
|
275
|
+
styles.cell({
|
|
276
|
+
pinned: 'right',
|
|
277
|
+
resizable: cell.column.getCanResize(),
|
|
278
|
+
}),
|
|
279
|
+
cellProps?.className
|
|
280
|
+
)}
|
|
281
|
+
>
|
|
282
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
283
|
+
</TableCell>
|
|
284
|
+
))}
|
|
285
|
+
</DataTableRow>
|
|
286
|
+
);
|
|
287
|
+
})}
|
|
275
288
|
</TableBody>
|
|
276
289
|
</Table>
|
|
277
290
|
</Box>
|
package/src/index.ts
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
declare module '@tanstack/react-table' {
|
|
4
|
-
// eslint-disable-next-line no-undef, @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
|
|
5
|
-
interface ColumnMeta<TData extends RowData, TValue> {
|
|
6
|
-
align?: 'flex-start' | 'center' | 'flex-end';
|
|
7
|
-
label?: string;
|
|
8
|
-
tooltip?: string;
|
|
9
|
-
// backward compatibility with old v5 table
|
|
10
|
-
contentAlign?: 'left' | 'center' | 'right';
|
|
11
|
-
}
|
|
12
|
-
}
|