@orfium/ictinus 5.43.4 → 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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @orfium/ictinus@5.43.4 build /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
2
+ > @orfium/ictinus@5.43.5 build /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
3
3
  > pnpm build:main && pnpm build:codemods && pnpm build:vanilla
4
4
 
5
5
 
6
- > @orfium/ictinus@5.43.4 build:main /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
6
+ > @orfium/ictinus@5.43.5 build:main /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
7
7
  > vite build --mode production
8
8
 
9
9
  production /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
@@ -52,10 +52,10 @@ computing gzip size...
52
52
  dist/components/Table/components/TBody/TBody.style.js  0.29 kB │ gzip: 0.21 kB
53
53
  dist/hooks/useEscape.js  0.29 kB │ gzip: 0.19 kB
54
54
  dist/hooks/useCombinedRefs.js  0.29 kB │ gzip: 0.20 kB
55
- dist/components/Icon/assets/usersAndStatus/statusIndicator.svg.js  0.30 kB │ gzip: 0.23 kB
56
55
  dist/components/Controls/ControlLabel/ControlHelpText.js  0.30 kB │ gzip: 0.24 kB
57
- dist/components/Chart/Wrapper.js  0.30 kB │ gzip: 0.21 kB
56
+ dist/components/Icon/assets/usersAndStatus/statusIndicator.svg.js  0.30 kB │ gzip: 0.23 kB
58
57
  dist/components/Breadcrumb/Breadcrumb.style.js  0.30 kB │ gzip: 0.23 kB
58
+ dist/components/Chart/Wrapper.js  0.30 kB │ gzip: 0.21 kB
59
59
  dist/components/TableV4/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.style.js  0.30 kB │ gzip: 0.24 kB
60
60
  dist/components/Tabs/components/TabsContainer/TabsContainer.style.js  0.31 kB │ gzip: 0.22 kB
61
61
  dist/components/TableV4/components/TableCell/utils.js  0.31 kB │ gzip: 0.23 kB
@@ -107,8 +107,8 @@ computing gzip size...
107
107
  dist/components/Table/components/TR/TR.style.js  0.48 kB │ gzip: 0.29 kB
108
108
  dist/components/Icon/assets/navigation/triangleRight.svg.js  0.49 kB │ gzip: 0.33 kB
109
109
  dist/components/Select/Select.style.js  0.49 kB │ gzip: 0.33 kB
110
- dist/components/Card/Card.style.js  0.49 kB │ gzip: 0.33 kB
111
110
  dist/components/Icon/assets/navigation/triangleDown.svg.js  0.49 kB │ gzip: 0.34 kB
111
+ dist/components/Card/Card.style.js  0.49 kB │ gzip: 0.33 kB
112
112
  dist/components/Icon/assets/navigation/triangleLeft.svg.js  0.49 kB │ gzip: 0.34 kB
113
113
  dist/components/ProgressIndicator/components/ProgressCircle/ProgressCircle.style.js  0.49 kB │ gzip: 0.26 kB
114
114
  dist/components/Drawer/components/DrawerFooter/DrawerFooter.js  0.49 kB │ gzip: 0.33 kB
@@ -207,8 +207,8 @@ computing gzip size...
207
207
  dist/components/Search/StatefulSearch.js  0.89 kB │ gzip: 0.48 kB
208
208
  dist/components/Slider/components/SliderMark/SliderMark.js  0.89 kB │ gzip: 0.50 kB
209
209
  dist/components/Icon/assets/musicBusiness/recording.svg.js  0.90 kB │ gzip: 0.53 kB
210
- dist/components/TopAppBar/TopAppBar.style.js  0.91 kB │ gzip: 0.46 kB
211
210
  dist/components/Icon/assets/generic/search filled.svg.js  0.91 kB │ gzip: 0.48 kB
211
+ dist/components/TopAppBar/TopAppBar.style.js  0.91 kB │ gzip: 0.46 kB
212
212
  dist/icons/LicenseIcon.js  0.91 kB │ gzip: 0.54 kB
213
213
  dist/components/Icon/assets/audioControls/rewind.svg.js  0.91 kB │ gzip: 0.48 kB
214
214
  dist/components/Icon/Icon.style.js  0.91 kB │ gzip: 0.48 kB
@@ -394,8 +394,8 @@ computing gzip size...
394
394
  dist/components/Icon/assets/musicBusiness/artist.svg.js  1.54 kB │ gzip: 0.81 kB
395
395
  dist/components/Drawer/Drawer.js  1.55 kB │ gzip: 0.70 kB
396
396
  dist/icons/DigitalIcon.js  1.55 kB │ gzip: 0.78 kB
397
- dist/components/Controls/Switch/Switch.style.js  1.55 kB │ gzip: 0.72 kB
398
397
  dist/components/Table/components/OptimizedTableRow.js  1.55 kB │ gzip: 0.73 kB
398
+ dist/components/Controls/Switch/Switch.style.js  1.55 kB │ gzip: 0.72 kB
399
399
  dist/icons/ConflictIcon.js  1.55 kB │ gzip: 0.86 kB
400
400
  dist/icons/AssetIcon.js  1.58 kB │ gzip: 0.85 kB
401
401
  dist/icons/LockIcon.js  1.59 kB │ gzip: 0.81 kB
@@ -605,11 +605,11 @@ computing gzip size...
605
605
  dist/icon/Icon.js  11.30 kB │ gzip: 2.63 kB
606
606
  dist/index.js  13.19 kB │ gzip: 3.19 kB
607
607
  dist/sprinkles/properties.css.js 115.20 kB │ gzip: 14.54 kB
608
- [vite:dts] Declaration files built in 10807ms.
608
+ [vite:dts] Declaration files built in 11443ms.
609
609
 
610
- ✓ built in 15.36s
610
+ ✓ built in 16.06s
611
611
 
612
- > @orfium/ictinus@5.43.4 build:codemods /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
612
+ > @orfium/ictinus@5.43.5 build:codemods /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
613
613
  > vite build --config vite.codemods.config.ts
614
614
 
615
615
  vite v7.3.1 building client environment for production...
@@ -642,19 +642,19 @@ computing gzip size...
642
642
  dist/codemods/drawerCodemod.cjs 1.07 kB │ gzip: 0.42 kB
643
643
  dist/codemods/unchangedIconsCodemod.cjs 1.12 kB │ gzip: 0.56 kB
644
644
  dist/codemods/globalsCodemod.cjs 6.99 kB │ gzip: 1.11 kB
645
- [vite:dts] Declaration files built in 848ms.
645
+ [vite:dts] Declaration files built in 826ms.
646
646
 
647
647
  ✓ built in 1.01s
648
648
 
649
- > @orfium/ictinus@5.43.4 build:vanilla /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
649
+ > @orfium/ictinus@5.43.5 build:vanilla /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
650
650
  > rm -rf dist/vanilla && NODE_ENV=production rollup -c
651
651
 
652
652
  
653
653
  ./src/vanilla/index.ts → dist/vanilla...
654
- created dist/vanilla in 2s
654
+ created dist/vanilla in 2.1s
655
655
  
656
656
  ./src/vanilla/index.ts → dist/vanilla...
657
657
  (!) Unresolved dependencies
658
658
  https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
659
659
  csstype (imported by "node_modules/@vanilla-extract/css/dist/vanilla-extract-css.cjs.d.ts")
660
- created dist/vanilla in 3.4s
660
+ created dist/vanilla in 3.7s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @orfium/ictinus
2
2
 
3
+ ## 5.43.5
4
+
5
+ ### Patch Changes
6
+
7
+ - c672159: control cell props in data table
8
+
3
9
  ## 5.43.4
4
10
 
5
11
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@orfium/ictinus",
3
- "version": "5.43.4",
3
+ "version": "5.43.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -1,4 +1,4 @@
1
- const o = "5.43.4";
1
+ const o = "5.43.5";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,3 +1,4 @@
1
+ import { Row, RowData } from '@tanstack/react-table';
1
2
  import { Table } from '@tanstack/table-core';
2
3
  import { BoxProps } from '../vanilla/Box';
3
4
  export type DataTableProps = BoxProps<'div', {
@@ -426,3 +427,14 @@ export declare const DataTable: import('react').ForwardRefExoticComponent<{
426
427
  asChild?: boolean;
427
428
  className?: string;
428
429
  }>, never> & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "color" | "className"> & import('react').RefAttributes<HTMLDivElement>>;
430
+ declare module '@tanstack/react-table' {
431
+ interface ColumnMeta<TData extends RowData, TValue> {
432
+ align?: 'flex-start' | 'center' | 'flex-end';
433
+ label?: string;
434
+ tooltip?: string;
435
+ contentAlign?: 'left' | 'center' | 'right';
436
+ }
437
+ interface TableMeta<TData extends RowData> {
438
+ getCellProps?: (row: Row<TData>) => Omit<BoxProps<'td'>, 'size'>;
439
+ }
440
+ }
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { ElementType, ComponentPropsWithoutRef, ComponentProps, Ref, ReactNode } from 'react';
3
+ import { RowData, Row } from '@tanstack/react-table';
3
4
  import { Table as Table$1 } from '@tanstack/table-core';
4
5
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
5
6
  import * as react_aria_components from 'react-aria-components';
@@ -1280,6 +1281,17 @@ declare const DataTable: react.ForwardRefExoticComponent<{
1280
1281
  asChild?: boolean;
1281
1282
  className?: string;
1282
1283
  }>, never> & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "color" | "className"> & react.RefAttributes<HTMLDivElement>>;
1284
+ declare module '@tanstack/react-table' {
1285
+ interface ColumnMeta<TData extends RowData, TValue> {
1286
+ align?: 'flex-start' | 'center' | 'flex-end';
1287
+ label?: string;
1288
+ tooltip?: string;
1289
+ contentAlign?: 'left' | 'center' | 'right';
1290
+ }
1291
+ interface TableMeta<TData extends RowData> {
1292
+ getCellProps?: (row: Row<TData>) => Omit<BoxProps<'td'>, 'size'>;
1293
+ }
1294
+ }
1283
1295
 
1284
1296
  type DataTableBodyProps = BoxProps<'div', {
1285
1297
  estimatedRowHeight?: number;
@@ -1,3 +1,3 @@
1
- var version = "5.43.4";
1
+ var version = "5.43.5";
2
2
 
3
3
  export { version };
@@ -19,8 +19,8 @@ import { DataTableHeaderCell } from './DataTableHeaderCell.js';
19
19
  import { DataTableRow } from './DataTableRow.js';
20
20
  import { cell, cellSizeVar, cellOffsetVar, root, totalSizeVar, rightTotalSizeVar, leftTotalSizeVar } from './DataTableBody-css.js';
21
21
 
22
- const COL_VIRTUALIZATION_THRESHOLD = 20;
23
- const ROW_VIRTUALIZATION_THRESHOLD = 20;
22
+ const COL_VIRTUALIZATION_THRESHOLD = 25;
23
+ const ROW_VIRTUALIZATION_THRESHOLD = 25;
24
24
  const DataTableBody = forwardRef(
25
25
  ({
26
26
  className,
@@ -134,93 +134,105 @@ const DataTableBody = forwardRef(
134
134
  })) : virtualRows.map((virtualRow) => ({
135
135
  row: rows[virtualRow.index],
136
136
  virtualRow
137
- })) : rows.map((row) => ({ row, virtualRow: void 0 }))).map(({ row, virtualRow }, index) => /* @__PURE__ */ jsxs(
138
- DataTableRow,
139
- {
140
- "data-index": virtualRow?.index,
141
- display: "flex",
142
- index: virtualRow?.index ?? index,
143
- row,
144
- ref: virtualRow ? rowVirtualizer.measureElement : void 0,
145
- style: virtualRow ? {
146
- position: "absolute",
147
- transform: `translateY(${virtualRow.start}px)`
148
- } : void 0,
149
- children: [
150
- row.getLeftVisibleCells().map((cell$1) => /* @__PURE__ */ jsx(
151
- TableCell,
152
- {
153
- bordered,
154
- size,
155
- justifyContent: cell$1.column.columnDef.meta?.align,
156
- pinned: true,
157
- style: {
158
- ...assignInlineVars({
159
- [cellOffsetVar]: `${cell$1.column.getStart("left")}px`,
160
- [cellSizeVar]: `${cell$1.column.getSize()}`
161
- })
137
+ })) : rows.map((row) => ({ row, virtualRow: void 0 }))).map(({ row, virtualRow }, index) => {
138
+ const cellProps = table.options.meta?.getCellProps?.(row);
139
+ return /* @__PURE__ */ jsxs(
140
+ DataTableRow,
141
+ {
142
+ "data-index": virtualRow?.index,
143
+ display: "flex",
144
+ index: virtualRow?.index ?? index,
145
+ row,
146
+ ref: virtualRow ? rowVirtualizer.measureElement : void 0,
147
+ style: virtualRow ? {
148
+ position: "absolute",
149
+ transform: `translateY(${virtualRow.start}px)`
150
+ } : void 0,
151
+ children: [
152
+ row.getLeftVisibleCells().map((cell$1) => /* @__PURE__ */ jsx(
153
+ TableCell,
154
+ {
155
+ bordered,
156
+ size,
157
+ justifyContent: cell$1.column.columnDef.meta?.align,
158
+ pinned: true,
159
+ ...cellProps,
160
+ style: {
161
+ ...assignInlineVars({
162
+ [cellOffsetVar]: `${cell$1.column.getStart("left")}px`,
163
+ [cellSizeVar]: `${cell$1.column.getSize()}`
164
+ }),
165
+ ...cellProps?.style
166
+ },
167
+ className: cn(
168
+ cell({
169
+ pinned: "left",
170
+ resizable: cell$1.column.getCanResize()
171
+ }),
172
+ cellProps?.className
173
+ ),
174
+ children: flexRender(cell$1.column.columnDef.cell, cell$1.getContext())
162
175
  },
163
- className: cn(
164
- cell({
165
- pinned: "left",
166
- resizable: cell$1.column.getCanResize()
167
- })
168
- ),
169
- children: flexRender(cell$1.column.columnDef.cell, cell$1.getContext())
170
- },
171
- cell$1.id
172
- )),
173
- columnVirtualizer.options.enabled && virtualColumnsOffset > 0 && /* @__PURE__ */ jsx(TableCell, { style: { width: virtualColumnsOffset } }),
174
- (columnVirtualizer.options.enabled ? virtualColumns.map((virtualCell) => {
175
- const cells = row.getCenterVisibleCells();
176
- return cells[virtualCell.index];
177
- }) : row.getCenterVisibleCells()).map((cell$1) => /* @__PURE__ */ jsx(
178
- TableCell,
179
- {
180
- size,
181
- bordered,
182
- justifyContent: cell$1.column.columnDef.meta?.align,
183
- style: {
184
- ...assignInlineVars({
185
- [cellSizeVar]: `${cell$1.column.getSize()}`
186
- })
176
+ cell$1.id
177
+ )),
178
+ columnVirtualizer.options.enabled && virtualColumnsOffset > 0 && /* @__PURE__ */ jsx(TableCell, { style: { width: virtualColumnsOffset } }),
179
+ (columnVirtualizer.options.enabled ? virtualColumns.map((virtualCell) => {
180
+ const cells = row.getCenterVisibleCells();
181
+ return cells[virtualCell.index];
182
+ }) : row.getCenterVisibleCells()).map((cell$1) => /* @__PURE__ */ jsx(
183
+ TableCell,
184
+ {
185
+ size,
186
+ bordered,
187
+ justifyContent: cell$1.column.columnDef.meta?.align,
188
+ ...cellProps,
189
+ style: {
190
+ ...assignInlineVars({
191
+ [cellSizeVar]: `${cell$1.column.getSize()}`
192
+ }),
193
+ ...cellProps?.style
194
+ },
195
+ className: cn(
196
+ cell({
197
+ resizable: cell$1.column.getCanResize()
198
+ }),
199
+ cellProps?.className
200
+ ),
201
+ children: flexRender(cell$1.column.columnDef.cell, cell$1.getContext())
187
202
  },
188
- className: cn(
189
- cell({
190
- resizable: cell$1.column.getCanResize()
191
- })
192
- ),
193
- children: flexRender(cell$1.column.columnDef.cell, cell$1.getContext())
194
- },
195
- cell$1.id
196
- )),
197
- row.getRightVisibleCells().map((cell$1) => /* @__PURE__ */ jsx(
198
- TableCell,
199
- {
200
- size,
201
- bordered,
202
- justifyContent: cell$1.column.columnDef.meta?.align,
203
- pinned: true,
204
- style: {
205
- ...assignInlineVars({
206
- [cellOffsetVar]: `${cell$1.column.getStart("right")}px`,
207
- [cellSizeVar]: `${cell$1.column.getSize()}`
208
- })
203
+ cell$1.id
204
+ )),
205
+ row.getRightVisibleCells().map((cell$1) => /* @__PURE__ */ jsx(
206
+ TableCell,
207
+ {
208
+ size,
209
+ bordered,
210
+ justifyContent: cell$1.column.columnDef.meta?.align,
211
+ pinned: true,
212
+ ...cellProps,
213
+ style: {
214
+ ...assignInlineVars({
215
+ [cellOffsetVar]: `${cell$1.column.getStart("right")}px`,
216
+ [cellSizeVar]: `${cell$1.column.getSize()}`
217
+ }),
218
+ ...cellProps?.style
219
+ },
220
+ className: cn(
221
+ cell({
222
+ pinned: "right",
223
+ resizable: cell$1.column.getCanResize()
224
+ }),
225
+ cellProps?.className
226
+ ),
227
+ children: flexRender(cell$1.column.columnDef.cell, cell$1.getContext())
209
228
  },
210
- className: cn(
211
- cell({
212
- pinned: "right",
213
- resizable: cell$1.column.getCanResize()
214
- })
215
- ),
216
- children: flexRender(cell$1.column.columnDef.cell, cell$1.getContext())
217
- },
218
- cell$1.id
219
- ))
220
- ]
221
- },
222
- row.id
223
- ))
229
+ cell$1.id
230
+ ))
231
+ ]
232
+ },
233
+ row.id
234
+ );
235
+ })
224
236
  }
225
237
  )
226
238
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orfium/ictinus",
3
- "version": "5.43.4",
3
+ "version": "5.43.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -1,3 +1,4 @@
1
+ import type { Row, RowData } from '@tanstack/react-table';
1
2
  import type { Table } from '@tanstack/table-core';
2
3
 
3
4
  import { forwardRef, useState } from 'react';
@@ -34,3 +35,18 @@ export const DataTable = forwardRef<HTMLDivElement, DataTableProps>(
34
35
  );
35
36
 
36
37
  DataTable.displayName = 'DataTable';
38
+
39
+ declare module '@tanstack/react-table' {
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
41
+ interface ColumnMeta<TData extends RowData, TValue> {
42
+ align?: 'flex-start' | 'center' | 'flex-end';
43
+ label?: string;
44
+ tooltip?: string;
45
+ // backward compatibility with old v5 table
46
+ contentAlign?: 'left' | 'center' | 'right';
47
+ }
48
+
49
+ interface TableMeta<TData extends RowData> {
50
+ getCellProps?: (row: Row<TData>) => Omit<BoxProps<'td'>, 'size'>;
51
+ }
52
+ }
@@ -21,8 +21,8 @@ export type DataTableBodyProps = BoxProps<
21
21
  }
22
22
  >;
23
23
 
24
- const COL_VIRTUALIZATION_THRESHOLD = 20;
25
- const ROW_VIRTUALIZATION_THRESHOLD = 20;
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
- <DataTableRow
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
- {columnVirtualizer.options.enabled && virtualColumnsOffset > 0 && (
219
- <TableCell style={{ width: virtualColumnsOffset }} />
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
- {(columnVirtualizer.options.enabled
223
- ? virtualColumns.map((virtualCell) => {
224
- const cells = row.getCenterVisibleCells();
224
+ {columnVirtualizer.options.enabled && virtualColumnsOffset > 0 && (
225
+ <TableCell style={{ width: virtualColumnsOffset }} />
226
+ )}
225
227
 
226
- return cells[virtualCell.index];
227
- })
228
- : row.getCenterVisibleCells()
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
- {row.getRightVisibleCells().map((cell) => (
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
- {flexRender(cell.column.columnDef.cell, cell.getContext())}
271
- </TableCell>
272
- ))}
273
- </DataTableRow>
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>
@@ -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
- }