@join-x5/react-data-grid 1.3.1-alpha-0 → 1.4.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/dist/DataGrid.es.js +87 -65
- package/dist/DataGrid.es.js.map +1 -1
- package/dist/Table/index.es.js +34 -34
- package/dist/Table/index.es.js.map +1 -1
- package/dist/TableBody/DataGridTableBody.d.ts +12 -0
- package/dist/TableBody/DataGridTableBody.es.js +41 -0
- package/dist/TableBody/DataGridTableBody.es.js.map +1 -0
- package/dist/TableBody/DataGridTableBodyVirtual.d.ts +2 -0
- package/dist/TableBody/DataGridTableBodyVirtual.es.js +18 -0
- package/dist/TableBody/DataGridTableBodyVirtual.es.js.map +1 -0
- package/dist/TableBody/hook.d.ts +839 -0
- package/dist/TableBody/hook.es.js +49 -0
- package/dist/TableBody/hook.es.js.map +1 -0
- package/dist/TableBody/index.d.ts +3 -11
- package/dist/TableBody/types.d.ts +2 -0
- package/dist/TableCell/hook.es.js +5 -5
- package/dist/TableCell/hook.es.js.map +1 -1
- package/dist/TableHead/index.d.ts +4 -2
- package/dist/TableHead/index.es.js +16 -13
- package/dist/TableHead/index.es.js.map +1 -1
- package/dist/TableHeadCell/index.es.js +82 -84
- package/dist/TableHeadCell/index.es.js.map +1 -1
- package/dist/TableInputCell/hook.d.ts +30 -30
- package/dist/TableRow/index.d.ts +2 -3
- package/dist/TableRow/index.es.js +16 -17
- package/dist/TableRow/index.es.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +61 -60
- package/dist/index.es.js.map +1 -1
- package/dist/types.d.ts +36 -2
- package/package.json +10 -9
- package/dist/TableBody/index.es.js +0 -26
- package/dist/TableBody/index.es.js.map +0 -1
- package/dist/TableRow/types.d.ts +0 -2
package/dist/index.es.js
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
import { DataGrid as
|
|
1
|
+
import { DataGrid as l } from "./DataGrid.es.js";
|
|
2
2
|
import { ControlPanel as r, ControlPanelContent as o, DataGridTable as d, Table as C, TableFooter as p, TableWrapper as D } from "./Table/index.es.js";
|
|
3
|
-
import { TableBody as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
3
|
+
import { TableBody as x, getDataGridTableBody as n } from "./TableBody/DataGridTableBody.es.js";
|
|
4
|
+
import { getDataGridTableBodyVirtual as b } from "./TableBody/DataGridTableBodyVirtual.es.js";
|
|
5
|
+
import { DataGridTableCell as m, TableCell as f, TableCellContent as g, getDataGridTableCell as u } from "./TableCell/index.es.js";
|
|
6
|
+
import { TableDropdownHeader as H, TableDropdownItem as I } from "./TableDropdown/index.es.js";
|
|
7
|
+
import { TableHead as B, getDataGridTableHead as h } from "./TableHead/index.es.js";
|
|
8
|
+
import { DataGridTableHeadCell as A, TableHeadCell as R, TableHeadCellResizer as k, getDataGridTableHeadCell as E } from "./TableHeadCell/index.es.js";
|
|
9
|
+
import { TableHeadRow as P } from "./TableHeadRow/index.es.js";
|
|
10
|
+
import { ButtonCell as V, DataGridButtonCell as s } from "./TableInputCell/button.es.js";
|
|
11
|
+
import { CheckboxCell as F, DataGridCheckboxCell as W } from "./TableInputCell/checkbox.es.js";
|
|
12
|
+
import { DataGridDateCell as q, DateCell as v, getDataGridDateCell as J } from "./TableInputCell/date.es.js";
|
|
13
|
+
import { DataGridDropdownCell as M, DropdownCell as N, getDataGridDropdownCell as O } from "./TableInputCell/dropdown.es.js";
|
|
14
|
+
import { DataGridExpandingCell as U, ExpandingCell as X } from "./TableInputCell/expanding.es.js";
|
|
15
|
+
import { DataGridIconCell as Z, IconCell as _ } from "./TableInputCell/icon.es.js";
|
|
16
|
+
import { DataGridLabelCell as ee, LabelCell as ae } from "./TableInputCell/label.es.js";
|
|
17
|
+
import { DataGridSwitchCell as te, SwitchCell as re } from "./TableInputCell/switch.es.js";
|
|
18
|
+
import { DataGridTextInputCell as de, TextInputCell as Ce, getDataGridTextInputCell as pe } from "./TableInputCell/text.es.js";
|
|
19
|
+
import { DataGridTextAreaInputCell as ie, TextAreaInputCell as xe, getDataGridTextAreaInputCell as ne } from "./TableInputCell/textarea.es.js";
|
|
20
|
+
import { getDataGridTableRow as be } from "./TableRow/index.es.js";
|
|
21
|
+
import { TableHeadCellVariant as me } from "./TableHeadCell/types.es.js";
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
V as ButtonCell,
|
|
24
|
+
F as CheckboxCell,
|
|
24
25
|
r as ControlPanel,
|
|
25
26
|
o as ControlPanelContent,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
l as DataGrid,
|
|
28
|
+
s as DataGridButtonCell,
|
|
29
|
+
W as DataGridCheckboxCell,
|
|
30
|
+
q as DataGridDateCell,
|
|
31
|
+
M as DataGridDropdownCell,
|
|
32
|
+
U as DataGridExpandingCell,
|
|
33
|
+
Z as DataGridIconCell,
|
|
34
|
+
ee as DataGridLabelCell,
|
|
35
|
+
te as DataGridSwitchCell,
|
|
35
36
|
d as DataGridTable,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
m as DataGridTableCell,
|
|
38
|
+
A as DataGridTableHeadCell,
|
|
39
|
+
ie as DataGridTextAreaInputCell,
|
|
40
|
+
de as DataGridTextInputCell,
|
|
41
|
+
v as DateCell,
|
|
42
|
+
N as DropdownCell,
|
|
43
|
+
X as ExpandingCell,
|
|
44
|
+
_ as IconCell,
|
|
45
|
+
ae as LabelCell,
|
|
46
|
+
re as SwitchCell,
|
|
46
47
|
C as Table,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
x as TableBody,
|
|
49
|
+
f as TableCell,
|
|
50
|
+
g as TableCellContent,
|
|
51
|
+
H as TableDropdownHeader,
|
|
52
|
+
I as TableDropdownItem,
|
|
52
53
|
p as TableFooter,
|
|
53
|
-
|
|
54
|
+
B as TableHead,
|
|
54
55
|
R as TableHeadCell,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ne as TableRow,
|
|
56
|
+
k as TableHeadCellResizer,
|
|
57
|
+
me as TableHeadCellVariant,
|
|
58
|
+
P as TableHeadRow,
|
|
59
59
|
D as TableWrapper,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
xe as TextAreaInputCell,
|
|
61
|
+
Ce as TextInputCell,
|
|
62
|
+
J as getDataGridDateCell,
|
|
63
|
+
O as getDataGridDropdownCell,
|
|
64
64
|
n as getDataGridTableBody,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
b as getDataGridTableBodyVirtual,
|
|
66
|
+
u as getDataGridTableCell,
|
|
67
|
+
h as getDataGridTableHead,
|
|
68
|
+
E as getDataGridTableHeadCell,
|
|
69
|
+
be as getDataGridTableRow,
|
|
70
|
+
ne as getDataGridTextAreaInputCell,
|
|
71
|
+
pe as getDataGridTextInputCell
|
|
71
72
|
};
|
|
72
73
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { ReactNode, TableHTMLAttributes } from 'react';
|
|
1
|
+
import { ReactNode, RefObject, TableHTMLAttributes } from 'react';
|
|
2
2
|
import { ColumnDef, RowData, TableOptions, Cell as ReactTableCell, Header, Row } from '@tanstack/react-table';
|
|
3
|
+
import { VirtualizerOptions } from '@tanstack/react-virtual';
|
|
3
4
|
import { ColumnItem } from '@join-x5/react-data-grid-settings';
|
|
4
5
|
import { CSSProperties, QA } from '@join-x5/react-theme';
|
|
5
6
|
import { TableCellProps } from 'TableCell/types';
|
|
6
7
|
import { TableHeadCellProps } from 'TableHeadCell/types';
|
|
8
|
+
import { TableRowProps } from './TableRow';
|
|
9
|
+
import { TableBodyProps } from './TableBody';
|
|
10
|
+
import { TableHeadProps } from './TableHead';
|
|
7
11
|
type DefaultAny = any;
|
|
8
12
|
export type DataGridColumn<T = DefaultAny, V = DefaultAny> = ColumnDef<T, V>;
|
|
9
13
|
export type DataGridCellBooleanCallback<T = DefaultAny> = (cell: ReactTableCell<T, DefaultAny>) => boolean;
|
|
@@ -13,7 +17,12 @@ export type CellPropsCallback<T = DefaultAny> = (cell: ReactTableCell<T, Default
|
|
|
13
17
|
export type HeadCellPropsCallback<T = DefaultAny> = (cell: Header<T, DefaultAny>) => Partial<TableHeadCellProps & {
|
|
14
18
|
ref?: React.Ref<HTMLTableCellElement>;
|
|
15
19
|
}>;
|
|
16
|
-
export type
|
|
20
|
+
export type RowPropsCallback<T = DefaultAny> = (row: Row<T>) => Partial<TableRowProps & {
|
|
21
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
22
|
+
}>;
|
|
23
|
+
export type GetDataGridTableRow<T = DefaultAny> = (row: Row<T>, props?: Partial<TableRowProps & {
|
|
24
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
25
|
+
}>) => ReactNode;
|
|
17
26
|
export type TableComponents<T = DefaultAny> = {
|
|
18
27
|
row?: GetDataGridTableRow<T>;
|
|
19
28
|
};
|
|
@@ -29,6 +38,13 @@ export type DataGridProps<T = DefaultAny> = {
|
|
|
29
38
|
columnSettings?: ColumnItem[];
|
|
30
39
|
/** Перегрузка свойств TanStack Table (https://tanstack.com/table/latest/docs/introduction) */
|
|
31
40
|
tableProps?: Partial<TableOptions<T>>;
|
|
41
|
+
/** Передача инстанса TanStack Table
|
|
42
|
+
*
|
|
43
|
+
* Используется для кастомизации
|
|
44
|
+
*
|
|
45
|
+
* Не используется `state` для хранения таблицы, используйте `ref`
|
|
46
|
+
*/
|
|
47
|
+
setTable?: (table: any) => void;
|
|
32
48
|
/** Флаг многострочности ячеек
|
|
33
49
|
*
|
|
34
50
|
* Если передан `true`, то все ячейки будут многострочными.
|
|
@@ -39,8 +55,26 @@ export type DataGridProps<T = DefaultAny> = {
|
|
|
39
55
|
cellProps?: Partial<TableCellProps> | CellPropsCallback<T>;
|
|
40
56
|
/** Свойства ячеек */
|
|
41
57
|
headCellProps?: Partial<TableHeadCellProps> | HeadCellPropsCallback<T>;
|
|
58
|
+
/** Свойства строк */
|
|
59
|
+
rowProps?: Partial<TableRowProps> | RowPropsCallback<T>;
|
|
60
|
+
/** Свойства body */
|
|
61
|
+
bodyProps?: Partial<TableBodyProps>;
|
|
62
|
+
/** Свойства head */
|
|
63
|
+
headProps?: Partial<TableHeadProps>;
|
|
42
64
|
/** Перегружаемые компоненты */
|
|
43
65
|
components?: TableComponents;
|
|
66
|
+
/** Виртуализация
|
|
67
|
+
*
|
|
68
|
+
* По умолчанию = `false`
|
|
69
|
+
*
|
|
70
|
+
* Обязательна передача `wrapperRef`
|
|
71
|
+
*/
|
|
72
|
+
virtualize?: boolean | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
|
|
73
|
+
/** Ref на TableWrapper
|
|
74
|
+
*
|
|
75
|
+
* Используется при виртуализации
|
|
76
|
+
*/
|
|
77
|
+
wrapperRef?: RefObject<HTMLDivElement>;
|
|
44
78
|
} & QA & Partial<Pick<TableCellProps, 'size' | 'isBordered' | 'isShadowed' | 'verticalAlign' | 'textAlign' | 'writingMode' | 'userSelect' | 'wordBreak' | 'whiteSpace'>> & Pick<CSSProperties, 'width'> & Omit<TableHTMLAttributes<HTMLTableElement>, 'width'>;
|
|
45
79
|
declare module '@tanstack/react-table' {
|
|
46
80
|
interface ColumnMeta<TData extends RowData, TValue> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@join-x5/react-data-grid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -47,19 +47,20 @@
|
|
|
47
47
|
"@dnd-kit/sortable": "^10.0.0",
|
|
48
48
|
"@emotion/react": "^11.14.0",
|
|
49
49
|
"@emotion/styled": "^11.14.0",
|
|
50
|
-
"@join-x5/react": "1.
|
|
51
|
-
"@join-x5/react-data-grid-settings": "1.
|
|
52
|
-
"@join-x5/react-icons": "1.
|
|
53
|
-
"@join-x5/react-theme": "1.
|
|
54
|
-
"@tanstack/react-table": "^8.21.3"
|
|
50
|
+
"@join-x5/react": "1.4.0",
|
|
51
|
+
"@join-x5/react-data-grid-settings": "1.4.0",
|
|
52
|
+
"@join-x5/react-icons": "1.4.0",
|
|
53
|
+
"@join-x5/react-theme": "1.4.0",
|
|
54
|
+
"@tanstack/react-table": "^8.21.3",
|
|
55
|
+
"@tanstack/react-virtual": "^3.13.12"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"@dnd-kit/core": "^6.2.0",
|
|
58
59
|
"@emotion/react": "^11.14.0",
|
|
59
60
|
"@emotion/styled": "^11.14.0",
|
|
60
|
-
"@join-x5/react": "1.
|
|
61
|
-
"@join-x5/react-icons": "1.
|
|
62
|
-
"@join-x5/react-theme": "1.
|
|
61
|
+
"@join-x5/react": "1.4.0",
|
|
62
|
+
"@join-x5/react-icons": "1.4.0",
|
|
63
|
+
"@join-x5/react-theme": "1.4.0",
|
|
63
64
|
"react": ">=17.0.0",
|
|
64
65
|
"react-dom": ">=17.0.0"
|
|
65
66
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
3
|
-
import R from "@emotion/styled/base";
|
|
4
|
-
import { memo as e, useContext as i } from "react";
|
|
5
|
-
import { DataGridContext as Z } from "../DataGridContext.es.js";
|
|
6
|
-
import { getDataGridTableRow as a } from "../TableRow/index.es.js";
|
|
7
|
-
const n = /* @__PURE__ */ R("tbody", process.env.NODE_ENV === "production" ? {
|
|
8
|
-
target: "e1p3q9a00"
|
|
9
|
-
} : {
|
|
10
|
-
target: "e1p3q9a00",
|
|
11
|
-
label: "TableBody"
|
|
12
|
-
})(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3NhZHlrb3ZzZC9qb2luLXg1L3BhY2thZ2VzL2RhdGEtZ3JpZC9zcmMvVGFibGVCb2R5L2luZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXcUMiLCJmaWxlIjoiL2hvbWUvc2FkeWtvdnNkL2pvaW4teDUvcGFja2FnZXMvZGF0YS1ncmlkL3NyYy9UYWJsZUJvZHkvaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBjbGllbnQnO1xuXG5pbXBvcnQge21lbW8sIHVzZUNvbnRleHR9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW1wb3J0IHtEYXRhR3JpZENvbnRleHR9IGZyb20gJ0RhdGFHcmlkQ29udGV4dCc7XG5pbXBvcnQge2dldERhdGFHcmlkVGFibGVSb3d9IGZyb20gJ1RhYmxlUm93JztcblxuaW1wb3J0IHR5cGUge1RhYmxlfSBmcm9tICdAdGFuc3RhY2svcmVhY3QtdGFibGUnO1xuaW1wb3J0IHR5cGUge0RhdGFHcmlkUHJvcHN9IGZyb20gJ3R5cGVzJztcblxuZXhwb3J0IGNvbnN0IFRhYmxlQm9keSA9IHN0eWxlZC50Ym9keWBgO1xuXG50eXBlIERhdGFHcmlkVGFibGVCb2R5UHJvcHMgPSB7XG4gIHRhYmxlOiBUYWJsZTx1bmtub3duPjtcbn0gJiBQaWNrPERhdGFHcmlkUHJvcHMsICdjb21wb25lbnRzJz47XG5cbmNvbnN0IERhdGFHcmlkVGFibGVCb2R5OiBSZWFjdC5GQzxEYXRhR3JpZFRhYmxlQm9keVByb3BzPiA9ICh7dGFibGUsIGNvbXBvbmVudHN9KSA9PiB7XG4gIGNvbnN0IGNvbnRleHQgPSB1c2VDb250ZXh0KERhdGFHcmlkQ29udGV4dCk7XG4gIGNvbnN0IHJvd3MgPSB0YWJsZS5nZXRSb3dNb2RlbCgpLnJvd3M7XG5cbiAgY29uc3QgaXRlcmF0b3IgPSBjb21wb25lbnRzPy5yb3cgPz8gZ2V0RGF0YUdyaWRUYWJsZVJvdztcblxuICByZXR1cm4gPFRhYmxlQm9keSBkYXRhLXFhPXtgJHtjb250ZXh0LnFhfS1ib2R5YH0+e3Jvd3MubWFwKGl0ZXJhdG9yKX08L1RhYmxlQm9keT47XG59O1xuXG5jb25zdCBNZW1vaXplZERhdGFHcmlkVGFibGVCb2R5ID0gbWVtbyhcbiAgRGF0YUdyaWRUYWJsZUJvZHksXG4gIChwcmV2LCBuZXh0KSA9PiBwcmV2LnRhYmxlLm9wdGlvbnMuZGF0YSA9PT0gbmV4dC50YWJsZS5vcHRpb25zLmRhdGFcbik7XG5cbmV4cG9ydCBjb25zdCBnZXREYXRhR3JpZFRhYmxlQm9keSA9IChcbiAgdGFibGU6IERhdGFHcmlkVGFibGVCb2R5UHJvcHNbJ3RhYmxlJ10sXG4gIGNvbXBvbmVudHM6IERhdGFHcmlkUHJvcHNbJ2NvbXBvbmVudHMnXVxuKSA9PiB7XG4gIGNvbnN0IGlzUmVzaXppbmcgPSB0YWJsZS5nZXRTdGF0ZSgpLmNvbHVtblNpemluZ0luZm8uaXNSZXNpemluZ0NvbHVtbjtcbiAgY29uc3QgQ29tcG9uZW50ID0gaXNSZXNpemluZyA/IE1lbW9pemVkRGF0YUdyaWRUYWJsZUJvZHkgOiBEYXRhR3JpZFRhYmxlQm9keTtcblxuICByZXR1cm4gPENvbXBvbmVudCB0YWJsZT17dGFibGV9IGNvbXBvbmVudHM9e2NvbXBvbmVudHN9IC8+O1xufTtcbiJdfQ== */"), m = ({
|
|
13
|
-
table: G,
|
|
14
|
-
components: b
|
|
15
|
-
}) => {
|
|
16
|
-
const d = i(Z), c = G.getRowModel().rows, t = (b == null ? void 0 : b.row) ?? a;
|
|
17
|
-
return /* @__PURE__ */ l(n, { "data-qa": `${d.qa}-body`, children: c.map(t) });
|
|
18
|
-
}, J = e(m, (G, b) => G.table.options.data === b.table.options.data), u = (G, b) => {
|
|
19
|
-
const c = G.getState().columnSizingInfo.isResizingColumn ? J : m;
|
|
20
|
-
return /* @__PURE__ */ l(c, { table: G, components: b });
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
n as TableBody,
|
|
24
|
-
u as getDataGridTableBody
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../src/TableBody/index.tsx"],"sourcesContent":["'use client';\n\nimport {memo, useContext} from 'react';\nimport styled from '@emotion/styled';\n\nimport {DataGridContext} from 'DataGridContext';\nimport {getDataGridTableRow} from 'TableRow';\n\nimport type {Table} from '@tanstack/react-table';\nimport type {DataGridProps} from 'types';\n\nexport const TableBody = styled.tbody``;\n\ntype DataGridTableBodyProps = {\n table: Table<unknown>;\n} & Pick<DataGridProps, 'components'>;\n\nconst DataGridTableBody: React.FC<DataGridTableBodyProps> = ({table, components}) => {\n const context = useContext(DataGridContext);\n const rows = table.getRowModel().rows;\n\n const iterator = components?.row ?? getDataGridTableRow;\n\n return <TableBody data-qa={`${context.qa}-body`}>{rows.map(iterator)}</TableBody>;\n};\n\nconst MemoizedDataGridTableBody = memo(\n DataGridTableBody,\n (prev, next) => prev.table.options.data === next.table.options.data\n);\n\nexport const getDataGridTableBody = (\n table: DataGridTableBodyProps['table'],\n components: DataGridProps['components']\n) => {\n const isResizing = table.getState().columnSizingInfo.isResizingColumn;\n const Component = isResizing ? MemoizedDataGridTableBody : DataGridTableBody;\n\n return <Component table={table} components={components} />;\n};\n"],"names":["table"],"mappings":";;;;;;AAWO;AAAe;AAAA;AAAA;AAAA;AAAA;AAMuC;AAACA;AAAiB;AAC7E;AAKA;AACF;AAYE;AAEA;AACF;;;;;"}
|
package/dist/TableRow/types.d.ts
DELETED