@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext as x } from "react";
|
|
3
|
+
import { useVirtualizer as b } from "@tanstack/react-virtual";
|
|
4
|
+
import { DataGridContext as h } from "../DataGridContext.es.js";
|
|
5
|
+
import { getDataGridTableRow as y } from "../TableRow/index.es.js";
|
|
6
|
+
const v = (c) => {
|
|
7
|
+
const {
|
|
8
|
+
table: u,
|
|
9
|
+
components: r,
|
|
10
|
+
rowProps: e,
|
|
11
|
+
wrapperRef: n,
|
|
12
|
+
virtualize: s,
|
|
13
|
+
...m
|
|
14
|
+
} = c, p = x(h), i = u.getRowModel().rows, o = b({
|
|
15
|
+
count: i.length,
|
|
16
|
+
estimateSize: () => 40,
|
|
17
|
+
getScrollElement: () => n.current,
|
|
18
|
+
measureElement: (t) => t.getBoundingClientRect().height,
|
|
19
|
+
overscan: 5,
|
|
20
|
+
...typeof s == "object" ? s : void 0
|
|
21
|
+
}), d = (r == null ? void 0 : r.row) ?? y, f = (t) => o.measureElement(t), g = o.getVirtualItems().map((t) => {
|
|
22
|
+
const a = i[t.index], l = {
|
|
23
|
+
ref: f,
|
|
24
|
+
"data-index": t.index,
|
|
25
|
+
style: {
|
|
26
|
+
position: "absolute",
|
|
27
|
+
left: 0,
|
|
28
|
+
top: 0,
|
|
29
|
+
width: "100%",
|
|
30
|
+
transform: `translateY(${t.start}px)`
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return e && Object.assign(l, typeof e == "function" ? e(a) : e), d(a, l);
|
|
34
|
+
}), w = {
|
|
35
|
+
"data-qa": `${p.qa}-body`,
|
|
36
|
+
style: {
|
|
37
|
+
height: o.getTotalSize(),
|
|
38
|
+
...m.style
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return n.current || setTimeout(o.measure), {
|
|
42
|
+
containerProps: w,
|
|
43
|
+
child: g
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
v as useVirtualTableBody
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=hook.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.es.js","sources":["../../src/TableBody/hook.ts"],"sourcesContent":["'use client';\n\nimport {useContext} from 'react';\nimport {useVirtualizer} from '@tanstack/react-virtual';\n\nimport {DataGridContext} from 'DataGridContext';\nimport {getDataGridTableRow} from 'TableRow';\n\nimport type {Table} from '@tanstack/react-table';\nimport type {VirtualItem} from '@tanstack/react-virtual';\nimport type {TableRowProps} from 'TableRow';\nimport type {DataGridProps} from 'types';\nimport type {TableBodyProps} from './types';\n\nexport type DataGridTableBodyVirtualProps = {\n table: Table<unknown>;\n} & Pick<DataGridProps, 'components' | 'rowProps'> &\n Required<Pick<DataGridProps, 'virtualize' | 'wrapperRef'>> &\n TableBodyProps;\n\nexport const useVirtualTableBody = (props: DataGridTableBodyVirtualProps) => {\n const {table, components, rowProps, wrapperRef, virtualize, ...rest} = props;\n\n const context = useContext(DataGridContext);\n const rows = table.getRowModel().rows;\n\n const rowVirtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({\n count: rows.length,\n estimateSize: () => 40,\n getScrollElement: () => wrapperRef.current,\n measureElement: el => el.getBoundingClientRect().height,\n overscan: 5,\n\n ...(typeof virtualize === 'object' ? virtualize : undefined),\n });\n\n const iterator = components?.row ?? getDataGridTableRow;\n const rowRef = (node: HTMLTableRowElement) => rowVirtualizer.measureElement(node);\n\n const child = rowVirtualizer.getVirtualItems().map((item: VirtualItem) => {\n const row = rows[item.index];\n\n const itemProps = {\n ref: rowRef,\n\n 'data-index': item.index,\n\n style: {\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n transform: `translateY(${item.start}px)`,\n },\n } as TableRowProps;\n\n if (rowProps) {\n Object.assign(itemProps, typeof rowProps === 'function' ? rowProps(row) : rowProps);\n }\n\n return iterator(row, itemProps);\n });\n\n const containerProps = {\n 'data-qa': `${context.qa}-body`,\n\n style: {\n height: rowVirtualizer.getTotalSize(),\n\n ...rest.style,\n },\n };\n\n if (!wrapperRef.current) {\n setTimeout(rowVirtualizer.measure);\n }\n\n return {containerProps, child};\n};\n"],"names":["table","components","rowProps","wrapperRef","virtualize","rest","length","current","height","undefined","rowRef","index","getTotalSize","style","containerProps","child"],"mappings":";;;;;AAoBO;AACL;AAAM;AAACA;AAAOC;AAAYC;AAAUC;AAAYC;AAAeC;AAKY;AAC7DC;AACQ;AACeC;AACcC;AACvC;AAEwCC;AAOlD;AAEkB;AACXC;AAEcC;AAEZ;AACK;AACJ;AACD;AACE;AAC4B;AAAA;AAIvC;AAI8B;AAGT;AACG;AAEjB;AACkBC;AAEfC;AAAAA;AAIZ;AAIO;AAACC;AAAgBC;AAC1B;;;;"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
theme?: import('@emotion/react').Theme;
|
|
5
|
-
as?: React.ElementType;
|
|
6
|
-
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, {}>;
|
|
7
|
-
type DataGridTableBodyProps = {
|
|
8
|
-
table: Table<unknown>;
|
|
9
|
-
} & Pick<DataGridProps, 'components'>;
|
|
10
|
-
export declare const getDataGridTableBody: (table: DataGridTableBodyProps["table"], components: DataGridProps["components"]) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
1
|
+
export * from './DataGridTableBody';
|
|
2
|
+
export { getDataGridTableBodyVirtual } from './DataGridTableBodyVirtual';
|
|
3
|
+
export * from './types';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useContext as o } from "react";
|
|
3
3
|
import { ColumnArea as r } from "@join-x5/react-data-grid-settings";
|
|
4
4
|
import { DataGridContext as d } from "../DataGridContext.es.js";
|
|
5
|
-
const
|
|
5
|
+
const g = (t, e) => {
|
|
6
6
|
const i = t.getIsPinned();
|
|
7
7
|
e.columnArea = (() => {
|
|
8
8
|
switch (t.getIsPinned()) {
|
|
@@ -14,8 +14,8 @@ const c = (t, e) => {
|
|
|
14
14
|
return r.Default;
|
|
15
15
|
})(), i && (e.style ?? (e.style = {}), i === "left" ? (e.style.left = `${t.getStart("left")}px`, e.isLastFixed = t.getIsLastColumn("left")) : (e.style.right = `${t.getAfter("right")}px`, e.isLastFixed = t.getIsFirstColumn("right")));
|
|
16
16
|
}, h = (t) => {
|
|
17
|
-
var
|
|
18
|
-
const e = o(d), i = typeof e.isMultiline == "boolean" ? e.isMultiline : (
|
|
17
|
+
var l, a;
|
|
18
|
+
const e = o(d), i = typeof e.isMultiline == "boolean" ? e.isMultiline : (l = e.isMultiline) == null ? void 0 : l.call(e, t), n = `calc(var(--header-${(a = t.column) == null ? void 0 : a.id}-size) * 1px)`, s = {
|
|
19
19
|
isMultiline: i,
|
|
20
20
|
qa: e.qa,
|
|
21
21
|
isBordered: e.isBordered,
|
|
@@ -33,10 +33,10 @@ const c = (t, e) => {
|
|
|
33
33
|
maxWidth: n
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return g(t.column, s), e.cellProps && Object.assign(s, typeof e.cellProps == "function" ? e.cellProps(t) : e.cellProps), s;
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
g as areaProps,
|
|
40
40
|
h as useDataGridTableCell
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=hook.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.es.js","sources":["../../src/TableCell/hook.ts"],"sourcesContent":["'use client';\n\nimport {useContext} from 'react';\n\nimport {ColumnArea} from '@join-x5/react-data-grid-settings';\n\nimport {DataGridContext} from 'DataGridContext';\n\nimport type {Column, Cell as ReactTableCell} from '@tanstack/react-table';\nimport type {TableCellProps} from './types';\n\nexport const areaProps = (column: Column<unknown>, props: TableCellProps): void => {\n const isPinned = column.getIsPinned();\n\n props.columnArea = (() => {\n switch (column.getIsPinned()) {\n case 'left':\n return ColumnArea.FixedLeft;\n case 'right':\n return ColumnArea.FixedRight;\n }\n\n return ColumnArea.Default;\n })();\n\n if (!isPinned) {\n return;\n }\n\n props.style ??= {};\n\n if (isPinned === 'left') {\n props.style.left = `${column.getStart('left')}px`;\n props.isLastFixed = column.getIsLastColumn('left');\n } else {\n props.style.right = `${column.getAfter('right')}px`;\n props.isLastFixed = column.getIsFirstColumn('right');\n }\n};\n\nexport const useDataGridTableCell = (cell: ReactTableCell<unknown, unknown>) => {\n const context = useContext(DataGridContext);\n\n const isMultiline = typeof context.isMultiline === 'boolean' ? context.isMultiline : context.isMultiline?.(cell);\n const width = `calc(var(--header-${cell.column?.id}-size) * 1px)`;\n\n const resultProps: TableCellProps = {\n isMultiline,\n\n qa: context.qa,\n isBordered: context.isBordered,\n isShadowed: context.isShadowed,\n size: context.size,\n verticalAlign: context.verticalAlign,\n writingMode: context.writingMode,\n userSelect: context.userSelect,\n wordBreak: context.wordBreak,\n whiteSpace: context.whiteSpace,\n\n isRowSelected: cell.row.getIsSelected(),\n isResizing: cell.column.getIsResizing(),\n\n style: {\n width,\n maxWidth: width,\n },\n };\n\n areaProps(cell.column, resultProps);\n\n if (context.cellProps) {\n Object.assign(resultProps, context.cellProps
|
|
1
|
+
{"version":3,"file":"hook.es.js","sources":["../../src/TableCell/hook.ts"],"sourcesContent":["'use client';\n\nimport {useContext} from 'react';\n\nimport {ColumnArea} from '@join-x5/react-data-grid-settings';\n\nimport {DataGridContext} from 'DataGridContext';\n\nimport type {Column, Cell as ReactTableCell} from '@tanstack/react-table';\nimport type {TableCellProps} from './types';\n\nexport const areaProps = (column: Column<unknown>, props: TableCellProps): void => {\n const isPinned = column.getIsPinned();\n\n props.columnArea = (() => {\n switch (column.getIsPinned()) {\n case 'left':\n return ColumnArea.FixedLeft;\n case 'right':\n return ColumnArea.FixedRight;\n }\n\n return ColumnArea.Default;\n })();\n\n if (!isPinned) {\n return;\n }\n\n props.style ??= {};\n\n if (isPinned === 'left') {\n props.style.left = `${column.getStart('left')}px`;\n props.isLastFixed = column.getIsLastColumn('left');\n } else {\n props.style.right = `${column.getAfter('right')}px`;\n props.isLastFixed = column.getIsFirstColumn('right');\n }\n};\n\nexport const useDataGridTableCell = (cell: ReactTableCell<unknown, unknown>) => {\n const context = useContext(DataGridContext);\n\n const isMultiline = typeof context.isMultiline === 'boolean' ? context.isMultiline : context.isMultiline?.(cell);\n const width = `calc(var(--header-${cell.column?.id}-size) * 1px)`;\n\n const resultProps: TableCellProps = {\n isMultiline,\n\n qa: context.qa,\n isBordered: context.isBordered,\n isShadowed: context.isShadowed,\n size: context.size,\n verticalAlign: context.verticalAlign,\n writingMode: context.writingMode,\n userSelect: context.userSelect,\n wordBreak: context.wordBreak,\n whiteSpace: context.whiteSpace,\n\n isRowSelected: cell.row.getIsSelected(),\n isResizing: cell.column.getIsResizing(),\n\n style: {\n width,\n maxWidth: width,\n },\n };\n\n areaProps(cell.column, resultProps);\n\n if (context.cellProps) {\n Object.assign(resultProps, typeof context.cellProps === 'function' ? context.cellProps(cell) : context.cellProps);\n }\n\n return resultProps;\n};\n"],"names":["FixedLeft","FixedRight","Default","isMultiline","qa","isBordered","isShadowed","size","verticalAlign","writingMode","userSelect","wordBreak","whiteSpace","getIsSelected","getIsResizing","width","areaProps"],"mappings":";;;;AAWO;AACL;AAaA;AAVE;AAA2B;AAEvB;AAAkBA;AAElB;AAAkBC;AAGtB;AAAkBC;AAgBtB;;AAGE;AAKoC;AAClCC;AAEYC;AACQC;AACAC;AACNC;AACSC;AACFC;AACDC;AACDC;AACCC;AAEIC;AACAC;AAEjB;AACLC;AACUA;AAAAA;AAIdC;AAOF;;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
1
2
|
import { Table } from '@tanstack/react-table';
|
|
3
|
+
export type TableHeadProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
2
4
|
export declare const TableHead: import('@emotion/styled').StyledComponent<{
|
|
3
5
|
theme?: import('@emotion/react').Theme;
|
|
4
6
|
as?: React.ElementType;
|
|
5
|
-
}, import('react').DetailedHTMLProps<
|
|
6
|
-
export declare const getDataGridTableHead: (table: Table<unknown
|
|
7
|
+
}, import('react').DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, {}>;
|
|
8
|
+
export declare const getDataGridTableHead: (table: Table<unknown>, props?: TableHeadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { DataGridContext as
|
|
2
|
+
import { jsx as c } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import I from "@emotion/styled/base";
|
|
4
|
+
import { useContext as n } from "react";
|
|
5
|
+
import { DataGridContext as i } from "../DataGridContext.es.js";
|
|
6
6
|
import { getDataGridTableHeadCell as a } from "../TableHeadCell/index.es.js";
|
|
7
|
-
import { TableHeadRow as
|
|
7
|
+
import { TableHeadRow as o } from "../TableHeadRow/index.es.js";
|
|
8
8
|
function Z() {
|
|
9
9
|
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const g = /* @__PURE__ */ I("thead", process.env.NODE_ENV === "production" ? {
|
|
12
12
|
target: "etxjaz80"
|
|
13
13
|
} : {
|
|
14
14
|
target: "etxjaz80",
|
|
@@ -18,14 +18,17 @@ const I = /* @__PURE__ */ n("thead", process.env.NODE_ENV === "production" ? {
|
|
|
18
18
|
styles: "position:sticky;top:0;z-index:2"
|
|
19
19
|
} : {
|
|
20
20
|
name: "2hn84s",
|
|
21
|
-
styles: "position:sticky;top:0;z-index:2/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
21
|
+
styles: "position:sticky;top:0;z-index:2/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3NhZHlrb3ZzZC9qb2luLXg1L3BhY2thZ2VzL2RhdGEtZ3JpZC9zcmMvVGFibGVIZWFkL2luZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjcUMiLCJmaWxlIjoiL2hvbWUvc2FkeWtvdnNkL2pvaW4teDUvcGFja2FnZXMvZGF0YS1ncmlkL3NyYy9UYWJsZUhlYWQvaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBjbGllbnQnO1xuXG5pbXBvcnQge3VzZUNvbnRleHR9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW1wb3J0IHtEYXRhR3JpZENvbnRleHR9IGZyb20gJ0RhdGFHcmlkQ29udGV4dCc7XG5pbXBvcnQge2dldERhdGFHcmlkVGFibGVIZWFkQ2VsbH0gZnJvbSAnVGFibGVIZWFkQ2VsbCc7XG5pbXBvcnQge1RhYmxlSGVhZFJvd30gZnJvbSAnVGFibGVIZWFkUm93JztcblxuaW1wb3J0IHR5cGUge0hUTUxBdHRyaWJ1dGVzfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdHlwZSB7VGFibGV9IGZyb20gJ0B0YW5zdGFjay9yZWFjdC10YWJsZSc7XG5cbmV4cG9ydCB0eXBlIFRhYmxlSGVhZFByb3BzID0gSFRNTEF0dHJpYnV0ZXM8SFRNTFRhYmxlU2VjdGlvbkVsZW1lbnQ+O1xuXG5leHBvcnQgY29uc3QgVGFibGVIZWFkID0gc3R5bGVkLnRoZWFkYFxuICBwb3NpdGlvbjogc3RpY2t5O1xuICB0b3A6IDA7XG4gIHotaW5kZXg6IDI7XG5gO1xuXG50eXBlIERhdGFHcmlkVGFibGVIZWFkUHJvcHMgPSB7XG4gIHRhYmxlOiBUYWJsZTx1bmtub3duPjtcbn0gJiBUYWJsZUhlYWRQcm9wcztcblxuY29uc3QgRGF0YUdyaWRUYWJsZUhlYWQ6IFJlYWN0LkZDPERhdGFHcmlkVGFibGVIZWFkUHJvcHM+ID0gKHt0YWJsZSwgLi4ucHJvcHN9KSA9PiB7XG4gIGNvbnN0IGNvbnRleHQgPSB1c2VDb250ZXh0KERhdGFHcmlkQ29udGV4dCk7XG5cbiAgY29uc3QgY29udGVudCA9IHRhYmxlXG4gICAgLmdldEhlYWRlckdyb3VwcygpXG4gICAgLm1hcChoZWFkZXJHcm91cCA9PiAoXG4gICAgICA8VGFibGVIZWFkUm93IGtleT17aGVhZGVyR3JvdXAuaWR9PlxuICAgICAgICB7aGVhZGVyR3JvdXAuaGVhZGVycy5tYXAoaGVhZGVyID0+IGdldERhdGFHcmlkVGFibGVIZWFkQ2VsbChoZWFkZXIpKX1cbiAgICAgIDwvVGFibGVIZWFkUm93PlxuICAgICkpO1xuXG4gIHJldHVybiAoXG4gICAgPFRhYmxlSGVhZCBkYXRhLXFhPXtgJHtjb250ZXh0LnFhfS1oZWFkYH0gey4uLnByb3BzfT5cbiAgICAgIHtjb250ZW50fVxuICAgIDwvVGFibGVIZWFkPlxuICApO1xufTtcblxuZXhwb3J0IGNvbnN0IGdldERhdGFHcmlkVGFibGVIZWFkID0gKHRhYmxlOiBUYWJsZTx1bmtub3duPiwgcHJvcHM/OiBUYWJsZUhlYWRQcm9wcykgPT4ge1xuICByZXR1cm4gPERhdGFHcmlkVGFibGVIZWFkIHRhYmxlPXt0YWJsZX0gey4uLnByb3BzfSAvPjtcbn07XG4iXX0= */",
|
|
22
22
|
toString: Z
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
23
|
+
}), V = ({
|
|
24
|
+
table: t,
|
|
25
|
+
...G
|
|
26
|
+
}) => {
|
|
27
|
+
const e = n(i), l = t.getHeaderGroups().map((b) => /* @__PURE__ */ c(o, { children: b.headers.map((d) => a(d)) }, b.id));
|
|
28
|
+
return /* @__PURE__ */ c(g, { "data-qa": `${e.qa}-head`, ...G, children: l });
|
|
29
|
+
}, R = (t, G) => /* @__PURE__ */ c(V, { table: t, ...G });
|
|
27
30
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
g as TableHead,
|
|
32
|
+
R as getDataGridTableHead
|
|
30
33
|
};
|
|
31
34
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../src/TableHead/index.tsx"],"sourcesContent":["'use client';\n\nimport {useContext} from 'react';\nimport styled from '@emotion/styled';\n\nimport {DataGridContext} from 'DataGridContext';\nimport {getDataGridTableHeadCell} from 'TableHeadCell';\nimport {TableHeadRow} from 'TableHeadRow';\n\nimport type {Table} from '@tanstack/react-table';\n\nexport const TableHead = styled.thead`\n position: sticky;\n top: 0;\n z-index: 2;\n`;\n\ntype DataGridTableHeadProps = {\n table: Table<unknown>;\n};\n\nconst DataGridTableHead: React.FC<DataGridTableHeadProps> = props => {\n const context = useContext(DataGridContext);\n\n const content =
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../src/TableHead/index.tsx"],"sourcesContent":["'use client';\n\nimport {useContext} from 'react';\nimport styled from '@emotion/styled';\n\nimport {DataGridContext} from 'DataGridContext';\nimport {getDataGridTableHeadCell} from 'TableHeadCell';\nimport {TableHeadRow} from 'TableHeadRow';\n\nimport type {HTMLAttributes} from 'react';\nimport type {Table} from '@tanstack/react-table';\n\nexport type TableHeadProps = HTMLAttributes<HTMLTableSectionElement>;\n\nexport const TableHead = styled.thead`\n position: sticky;\n top: 0;\n z-index: 2;\n`;\n\ntype DataGridTableHeadProps = {\n table: Table<unknown>;\n} & TableHeadProps;\n\nconst DataGridTableHead: React.FC<DataGridTableHeadProps> = ({table, ...props}) => {\n const context = useContext(DataGridContext);\n\n const content = table\n .getHeaderGroups()\n .map(headerGroup => (\n <TableHeadRow key={headerGroup.id}>\n {headerGroup.headers.map(header => getDataGridTableHeadCell(header))}\n </TableHeadRow>\n ));\n\n return (\n <TableHead data-qa={`${context.qa}-head`} {...props}>\n {content}\n </TableHead>\n );\n};\n\nexport const getDataGridTableHead = (table: Table<unknown>, props?: TableHeadProps) => {\n return <DataGridTableHead table={table} {...props} />;\n};\n"],"names":["table"],"mappings":";;;;;;;AAAa;AAAA;AAAA;AAcN;AAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUuC;AAACA;AAAe;AAC3E;AAUA;AAKF;;;;;"}
|