es-grid-template 1.8.2 → 1.8.22
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/es/table-component/TableContainerEdit.js +2 -1
- package/es/table-component/body/TableBodyCell.js +0 -1
- package/es/table-component/body/TableBodyCellEdit.js +14 -6
- package/es/table-component/header/TableHead.js +1 -1
- package/es/table-component/header/TableHeadCell2.js +5 -4
- package/es/table-component/useContext.d.ts +2 -1
- package/lib/table-component/TableContainerEdit.js +2 -1
- package/lib/table-component/body/TableBodyCell.js +0 -1
- package/lib/table-component/body/TableBodyCellEdit.js +14 -6
- package/lib/table-component/header/TableHead.js +1 -1
- package/lib/table-component/header/TableHeadCell2.js +5 -4
- package/lib/table-component/useContext.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1819,7 +1819,8 @@ const TableContainerEdit = props => {
|
|
|
1819
1819
|
handleAddMulti,
|
|
1820
1820
|
dataErrors,
|
|
1821
1821
|
windowSize,
|
|
1822
|
-
handleCellClick
|
|
1822
|
+
handleCellClick,
|
|
1823
|
+
pagination
|
|
1823
1824
|
}
|
|
1824
1825
|
}, /*#__PURE__*/React.createElement(TableWrapper, {
|
|
1825
1826
|
contextMenuItems: contextMenuItems,
|
|
@@ -358,7 +358,6 @@ const TableBodyCell = props => {
|
|
|
358
358
|
// height: '36px',
|
|
359
359
|
...getCommonPinningStyles(cell.column)
|
|
360
360
|
},
|
|
361
|
-
onMouseDown: () => {},
|
|
362
361
|
onMouseEnter: e => {
|
|
363
362
|
if (e.target.firstChild?.clientWidth < e.target.firstChild?.scrollWidth) {
|
|
364
363
|
setIsOpenTooltip(true);
|
|
@@ -19,13 +19,19 @@ import { nonActionColumn } from "../hook/constant";
|
|
|
19
19
|
const renderCellIndex = props => {
|
|
20
20
|
const {
|
|
21
21
|
parrents,
|
|
22
|
-
cell
|
|
22
|
+
cell,
|
|
23
|
+
pagination
|
|
23
24
|
} = props;
|
|
25
|
+
if (parrents && parrents.length > 0) {
|
|
26
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
className: "ui-rc_cell-content"
|
|
28
|
+
}, parrents.map(pr => {
|
|
29
|
+
return `${pr.index + 1}.`;
|
|
30
|
+
}), cell.row.index + 1);
|
|
31
|
+
}
|
|
24
32
|
return /*#__PURE__*/React.createElement("span", {
|
|
25
33
|
className: "ui-rc_cell-content"
|
|
26
|
-
},
|
|
27
|
-
return `${pr.index + 1}.`;
|
|
28
|
-
}), cell.row.index + 1);
|
|
34
|
+
}, cell.row.index + (pagination ? (pagination.currentPage ?? 1 - 1) * (pagination?.pageSize ?? 0) : 0) + 1);
|
|
29
35
|
};
|
|
30
36
|
const renderCommand = args => {
|
|
31
37
|
const {
|
|
@@ -189,7 +195,8 @@ const TableBodyCellEdit = props => {
|
|
|
189
195
|
isDataTree,
|
|
190
196
|
handleCellClick,
|
|
191
197
|
setIsSelectionChange,
|
|
192
|
-
selectionSettings
|
|
198
|
+
selectionSettings,
|
|
199
|
+
pagination
|
|
193
200
|
} = React.useContext(TableContext);
|
|
194
201
|
const expandIconColumnIndex = expandable?.expandIconColumnIndex;
|
|
195
202
|
const record = cell.row.original;
|
|
@@ -828,7 +835,8 @@ const TableBodyCellEdit = props => {
|
|
|
828
835
|
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
|
|
829
836
|
}))), renderCellIndex({
|
|
830
837
|
parrents,
|
|
831
|
-
cell
|
|
838
|
+
cell,
|
|
839
|
+
pagination
|
|
832
840
|
}));
|
|
833
841
|
}
|
|
834
842
|
if (cell.column.id === "command") {
|
|
@@ -28,7 +28,7 @@ const TableHead = ({
|
|
|
28
28
|
zIndex: 1,
|
|
29
29
|
// gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
|
|
30
30
|
// gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
|
|
31
|
-
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}
|
|
31
|
+
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
|
|
32
32
|
}
|
|
33
33
|
}, leafColumns.map(column => {
|
|
34
34
|
const depth = column.depth ?? 0;
|
|
@@ -226,17 +226,18 @@ const TableHeadCell2 = props => {
|
|
|
226
226
|
// rowSpan={rowSpan}
|
|
227
227
|
,
|
|
228
228
|
|
|
229
|
-
key:
|
|
229
|
+
key: column.id,
|
|
230
230
|
style: {
|
|
231
231
|
// display: 'flex',
|
|
232
232
|
// width: column.getSize(),
|
|
233
|
-
minWidth:
|
|
233
|
+
minWidth: column.getSize(),
|
|
234
234
|
// flex: 1,
|
|
235
|
-
flexGrow:
|
|
235
|
+
// flexGrow: column.getSize(),
|
|
236
|
+
|
|
236
237
|
gridRow: `${depth + 1} / span ${rowSpan}`,
|
|
237
238
|
gridColumn: `span ${colSpan}`,
|
|
238
239
|
// maxWidth: header.getSize(),
|
|
239
|
-
...getCommonPinningStyles(
|
|
240
|
+
...getCommonPinningStyles(column),
|
|
240
241
|
width: 'auto',
|
|
241
242
|
...style
|
|
242
243
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, RangeState, RecordDoubleClickEventArgs, SelectionSettings } from "./type";
|
|
2
|
+
import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, SelectionSettings } from "./type";
|
|
3
3
|
import type { SubmitHandler } from "react-hook-form";
|
|
4
4
|
import type { ExpandedState } from '@tanstack/react-table';
|
|
5
5
|
export type IPositionCell = {
|
|
@@ -67,6 +67,7 @@ export interface IContext<T> {
|
|
|
67
67
|
dataErrors?: any[];
|
|
68
68
|
isDataTree: boolean;
|
|
69
69
|
handleCellClick?: (rowNumber: number, record: T, column: ColumnTable, rowId: string, cellValue: any) => void;
|
|
70
|
+
pagination?: false | PaginationConfig;
|
|
70
71
|
}
|
|
71
72
|
export declare const TableContext: import("react").Context<IContext<any>>;
|
|
72
73
|
export type ContextCellChange = {
|
|
@@ -1826,7 +1826,8 @@ const TableContainerEdit = props => {
|
|
|
1826
1826
|
handleAddMulti,
|
|
1827
1827
|
dataErrors,
|
|
1828
1828
|
windowSize,
|
|
1829
|
-
handleCellClick
|
|
1829
|
+
handleCellClick,
|
|
1830
|
+
pagination
|
|
1830
1831
|
}
|
|
1831
1832
|
}, /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
|
|
1832
1833
|
contextMenuItems: contextMenuItems,
|
|
@@ -365,7 +365,6 @@ const TableBodyCell = props => {
|
|
|
365
365
|
// height: '36px',
|
|
366
366
|
...(0, _utils.getCommonPinningStyles)(cell.column)
|
|
367
367
|
},
|
|
368
|
-
onMouseDown: () => {},
|
|
369
368
|
onMouseEnter: e => {
|
|
370
369
|
if (e.target.firstChild?.clientWidth < e.target.firstChild?.scrollWidth) {
|
|
371
370
|
setIsOpenTooltip(true);
|
|
@@ -25,13 +25,19 @@ var _constant = require("../hook/constant");
|
|
|
25
25
|
const renderCellIndex = props => {
|
|
26
26
|
const {
|
|
27
27
|
parrents,
|
|
28
|
-
cell
|
|
28
|
+
cell,
|
|
29
|
+
pagination
|
|
29
30
|
} = props;
|
|
31
|
+
if (parrents && parrents.length > 0) {
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
33
|
+
className: "ui-rc_cell-content"
|
|
34
|
+
}, parrents.map(pr => {
|
|
35
|
+
return `${pr.index + 1}.`;
|
|
36
|
+
}), cell.row.index + 1);
|
|
37
|
+
}
|
|
30
38
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
31
39
|
className: "ui-rc_cell-content"
|
|
32
|
-
},
|
|
33
|
-
return `${pr.index + 1}.`;
|
|
34
|
-
}), cell.row.index + 1);
|
|
40
|
+
}, cell.row.index + (pagination ? (pagination.currentPage ?? 1 - 1) * (pagination?.pageSize ?? 0) : 0) + 1);
|
|
35
41
|
};
|
|
36
42
|
const renderCommand = args => {
|
|
37
43
|
const {
|
|
@@ -195,7 +201,8 @@ const TableBodyCellEdit = props => {
|
|
|
195
201
|
isDataTree,
|
|
196
202
|
handleCellClick,
|
|
197
203
|
setIsSelectionChange,
|
|
198
|
-
selectionSettings
|
|
204
|
+
selectionSettings,
|
|
205
|
+
pagination
|
|
199
206
|
} = _react.default.useContext(_useContext.TableContext);
|
|
200
207
|
const expandIconColumnIndex = expandable?.expandIconColumnIndex;
|
|
201
208
|
const record = cell.row.original;
|
|
@@ -834,7 +841,8 @@ const TableBodyCellEdit = props => {
|
|
|
834
841
|
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
|
|
835
842
|
}))), renderCellIndex({
|
|
836
843
|
parrents,
|
|
837
|
-
cell
|
|
844
|
+
cell,
|
|
845
|
+
pagination
|
|
838
846
|
}));
|
|
839
847
|
}
|
|
840
848
|
if (cell.column.id === "command") {
|
|
@@ -38,7 +38,7 @@ const TableHead = ({
|
|
|
38
38
|
zIndex: 1,
|
|
39
39
|
// gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
|
|
40
40
|
// gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
|
|
41
|
-
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}
|
|
41
|
+
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
|
|
42
42
|
}
|
|
43
43
|
}, leafColumns.map(column => {
|
|
44
44
|
const depth = column.depth ?? 0;
|
|
@@ -235,17 +235,18 @@ const TableHeadCell2 = props => {
|
|
|
235
235
|
// rowSpan={rowSpan}
|
|
236
236
|
,
|
|
237
237
|
|
|
238
|
-
key:
|
|
238
|
+
key: column.id,
|
|
239
239
|
style: {
|
|
240
240
|
// display: 'flex',
|
|
241
241
|
// width: column.getSize(),
|
|
242
|
-
minWidth:
|
|
242
|
+
minWidth: column.getSize(),
|
|
243
243
|
// flex: 1,
|
|
244
|
-
flexGrow:
|
|
244
|
+
// flexGrow: column.getSize(),
|
|
245
|
+
|
|
245
246
|
gridRow: `${depth + 1} / span ${rowSpan}`,
|
|
246
247
|
gridColumn: `span ${colSpan}`,
|
|
247
248
|
// maxWidth: header.getSize(),
|
|
248
|
-
...(0, _utils.getCommonPinningStyles)(
|
|
249
|
+
...(0, _utils.getCommonPinningStyles)(column),
|
|
249
250
|
width: 'auto',
|
|
250
251
|
...style
|
|
251
252
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, RangeState, RecordDoubleClickEventArgs, SelectionSettings } from "./type";
|
|
2
|
+
import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, SelectionSettings } from "./type";
|
|
3
3
|
import type { SubmitHandler } from "react-hook-form";
|
|
4
4
|
import type { ExpandedState } from '@tanstack/react-table';
|
|
5
5
|
export type IPositionCell = {
|
|
@@ -67,6 +67,7 @@ export interface IContext<T> {
|
|
|
67
67
|
dataErrors?: any[];
|
|
68
68
|
isDataTree: boolean;
|
|
69
69
|
handleCellClick?: (rowNumber: number, record: T, column: ColumnTable, rowId: string, cellValue: any) => void;
|
|
70
|
+
pagination?: false | PaginationConfig;
|
|
70
71
|
}
|
|
71
72
|
export declare const TableContext: import("react").Context<IContext<any>>;
|
|
72
73
|
export type ContextCellChange = {
|