es-grid-template 1.8.65 → 1.8.66
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/grid-component/TempTable.d.ts +2 -2
- package/es/grid-component/TempTable.js +3 -3
- package/es/grid-component/hooks/index.js +0 -1
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/useLazyKVMap.js +0 -4
- package/es/grid-component/hooks/utils.d.ts +3 -4
- package/es/grid-component/hooks/utils.js +2 -1
- package/es/grid-component/styles.scss +1394 -1394
- package/es/grid-component/type.d.ts +0 -414
- package/es/grid-component/type.js +490 -1
- package/es/table-component/type.d.ts +2 -0
- package/es/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/es/table-virtuoso/InternalTable.js +6 -28
- package/es/table-virtuoso/body/TableBodyCell.js +0 -9
- package/es/table-virtuoso/body/TableBodyRow.js +0 -4
- package/es/table-virtuoso/style.js +2 -1
- package/es/table-virtuoso/style.scss +2 -1
- package/es/table-virtuoso/table/Grid.js +0 -4
- package/es/table-virtuoso/table/TableContainer.js +31 -44
- package/es/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/es/table-virtuoso/table/TableWrapper.js +5 -2
- package/lib/grid-component/TempTable.d.ts +2 -2
- package/lib/grid-component/TempTable.js +3 -5
- package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
- package/lib/grid-component/hooks/utils.d.ts +3 -4
- package/lib/grid-component/hooks/utils.js +3 -0
- package/lib/grid-component/styles.scss +1394 -1394
- package/lib/grid-component/type.d.ts +0 -414
- package/lib/grid-component/type.js +490 -4
- package/lib/table-component/type.d.ts +2 -0
- package/lib/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/lib/table-virtuoso/InternalTable.js +6 -28
- package/lib/table-virtuoso/body/TableBodyCell.js +0 -9
- package/lib/table-virtuoso/body/TableBodyRow.js +0 -5
- package/lib/table-virtuoso/style.js +2 -1
- package/lib/table-virtuoso/style.scss +2 -1
- package/lib/table-virtuoso/table/Grid.js +0 -4
- package/lib/table-virtuoso/table/TableContainer.js +29 -42
- package/lib/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/lib/table-virtuoso/table/TableWrapper.js +4 -2
- package/package.json +1 -1
- package/es/grid-component/AdvanceFilter.d.ts +0 -14
- package/es/grid-component/AdvanceFilter.js +0 -454
- package/es/grid-component/CheckboxFilter.d.ts +0 -20
- package/es/grid-component/CheckboxFilter.js +0 -244
- package/es/grid-component/CheckboxFilter2.d.ts +0 -20
- package/es/grid-component/CheckboxFilter2.js +0 -244
- package/es/grid-component/ColumnsChoose.d.ts +0 -10
- package/es/grid-component/ColumnsChoose.js +0 -230
- package/es/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/es/grid-component/ColumnsGroup/ColumnsGroup.js +0 -232
- package/es/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/es/grid-component/ColumnsGroup/index.js +0 -1
- package/es/grid-component/Command.d.ts +0 -8
- package/es/grid-component/Command.js +0 -80
- package/es/grid-component/ContextMenu.d.ts +0 -20
- package/es/grid-component/ContextMenu.js +0 -130
- package/es/grid-component/EditForm/EditForm.d.ts +0 -27
- package/es/grid-component/EditForm/EditForm.js +0 -394
- package/es/grid-component/EditForm/index.d.ts +0 -1
- package/es/grid-component/EditForm/index.js +0 -1
- package/es/grid-component/EditableCell.d.ts +0 -20
- package/es/grid-component/EditableCell.js +0 -1030
- package/es/grid-component/FilterSearch.d.ts +0 -12
- package/es/grid-component/FilterSearch.js +0 -33
- package/es/grid-component/GridStyle.d.ts +0 -8
- package/es/grid-component/GridStyle.js +0 -5
- package/es/grid-component/TableGrid.d.ts +0 -21
- package/es/grid-component/TableGrid.js +0 -493
- package/es/grid-component/async-select/index.d.ts +0 -11
- package/es/grid-component/async-select/index.js +0 -38
- package/es/grid-component/async-table-select/index.d.ts +0 -11
- package/es/grid-component/async-table-select/index.js +0 -40
- package/es/grid-component/checkbox-control/index.d.ts +0 -13
- package/es/grid-component/checkbox-control/index.js +0 -40
- package/es/grid-component/hooks/columns/index.d.ts +0 -10
- package/es/grid-component/hooks/columns/index.js +0 -503
- package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
- package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/es/grid-component/hooks/content/HeaderContent.js +0 -44
- package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/es/grid-component/hooks/content/TooltipContent.js +0 -74
- package/es/grid-component/hooks/useColumns.d.ts +0 -19
- package/es/grid-component/hooks/useColumns.js +0 -317
- package/es/grid-component/number/index.d.ts +0 -10
- package/es/grid-component/number/index.js +0 -39
- package/es/grid-component/number-range/index.d.ts +0 -11
- package/es/grid-component/number-range/index.js +0 -63
- package/es/grid-component/useContext.d.ts +0 -34
- package/es/grid-component/useContext.js +0 -8
- package/es/table-virtuoso/body/TableBody.d.ts +0 -14
- package/es/table-virtuoso/body/TableBody.js +0 -84
- package/lib/grid-component/AdvanceFilter.d.ts +0 -14
- package/lib/grid-component/AdvanceFilter.js +0 -463
- package/lib/grid-component/CheckboxFilter.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter.js +0 -253
- package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter2.js +0 -253
- package/lib/grid-component/ColumnsChoose.d.ts +0 -10
- package/lib/grid-component/ColumnsChoose.js +0 -240
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +0 -243
- package/lib/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/lib/grid-component/ColumnsGroup/index.js +0 -16
- package/lib/grid-component/Command.d.ts +0 -8
- package/lib/grid-component/Command.js +0 -88
- package/lib/grid-component/ContextMenu.d.ts +0 -20
- package/lib/grid-component/ContextMenu.js +0 -140
- package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
- package/lib/grid-component/EditForm/EditForm.js +0 -404
- package/lib/grid-component/EditForm/index.d.ts +0 -1
- package/lib/grid-component/EditForm/index.js +0 -16
- package/lib/grid-component/EditableCell.d.ts +0 -20
- package/lib/grid-component/EditableCell.js +0 -1032
- package/lib/grid-component/FilterSearch.d.ts +0 -12
- package/lib/grid-component/FilterSearch.js +0 -42
- package/lib/grid-component/GridStyle.d.ts +0 -8
- package/lib/grid-component/GridStyle.js +0 -12
- package/lib/grid-component/TableGrid.d.ts +0 -21
- package/lib/grid-component/TableGrid.js +0 -493
- package/lib/grid-component/async-select/index.d.ts +0 -11
- package/lib/grid-component/async-select/index.js +0 -47
- package/lib/grid-component/async-table-select/index.d.ts +0 -11
- package/lib/grid-component/async-table-select/index.js +0 -49
- package/lib/grid-component/checkbox-control/index.d.ts +0 -13
- package/lib/grid-component/checkbox-control/index.js +0 -48
- package/lib/grid-component/hooks/columns/index.d.ts +0 -10
- package/lib/grid-component/hooks/columns/index.js +0 -518
- package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
- package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
- package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
- package/lib/grid-component/hooks/useColumns.d.ts +0 -19
- package/lib/grid-component/hooks/useColumns.js +0 -328
- package/lib/grid-component/number/index.d.ts +0 -10
- package/lib/grid-component/number/index.js +0 -47
- package/lib/grid-component/number-range/index.d.ts +0 -11
- package/lib/grid-component/number-range/index.js +0 -71
- package/lib/grid-component/useContext.d.ts +0 -34
- package/lib/grid-component/useContext.js +0 -13
- package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
- package/lib/table-virtuoso/body/TableBody.js +0 -95
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
const color = "#000000de";
|
|
3
3
|
const BgColor = "#ffffff";
|
|
4
|
+
const rowSelectedBg = "#FEF2EF";
|
|
4
5
|
const tableBorderColor = "#e0e0e0";
|
|
5
6
|
const tableBorderColorDark = "#44485E";
|
|
6
7
|
const BgColorDark = "#343e59";
|
|
@@ -8,4 +9,4 @@ const colorDark = "#e6e4f3e6";
|
|
|
8
9
|
export const GridStyle = styled.div.withConfig({
|
|
9
10
|
displayName: "GridStyle",
|
|
10
11
|
componentId: "es-grid-template__sc-rs980s-0"
|
|
11
|
-
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";}}}.", "-grid-cell{padding:7px 8px;.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;
|
|
12
|
+
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";}}}.", "-grid-cell{padding:7px 8px;.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;outline:1px solid ", ";border:0;&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;outline:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:#33335d !important;}&.disable{background-color:#272A2F;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border:0;outline:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -115,7 +115,6 @@ const Grid = props => {
|
|
|
115
115
|
}, [isSelectionChange, rowSelection, table.getState().rowSelection]);
|
|
116
116
|
React.useEffect(() => {
|
|
117
117
|
if (sorterChange) {
|
|
118
|
-
console.log('12312312313123');
|
|
119
118
|
const aa = table.getState().sorting;
|
|
120
119
|
const rs = aa.map(it => {
|
|
121
120
|
return {
|
|
@@ -135,7 +134,6 @@ const Grid = props => {
|
|
|
135
134
|
React.useEffect(() => {
|
|
136
135
|
if (filterChange) {
|
|
137
136
|
const operatorState = table.getState().operator;
|
|
138
|
-
console.log('operatorState', operatorState);
|
|
139
137
|
const merged = columnFilters.map(filter => {
|
|
140
138
|
const match = operatorState.find(op => op.id === filter.id);
|
|
141
139
|
const col = table.getVisibleFlatColumns().find(it => it.id === filter.id)?.columnDef.meta;
|
|
@@ -147,8 +145,6 @@ const Grid = props => {
|
|
|
147
145
|
operator: match ? match.operator : undefined
|
|
148
146
|
};
|
|
149
147
|
});
|
|
150
|
-
console.log('operatorState', operatorState);
|
|
151
|
-
console.log('merged', merged);
|
|
152
148
|
if (onFilter) {
|
|
153
149
|
onFilter?.(convertFilters(merged));
|
|
154
150
|
} else {
|
|
@@ -5,11 +5,11 @@ import React from 'react';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import Pagination from 'rc-master-ui/es/pagination';
|
|
7
7
|
import { Toolbar } from 'rc-master-ui';
|
|
8
|
-
import { Maximize, Minimize } from 'becoxy-icons';
|
|
8
|
+
import { Collapse2, Expand2, Maximize, Minimize } from 'becoxy-icons';
|
|
9
9
|
import { numericFormatter } from 'react-numeric-component';
|
|
10
10
|
import TableWrapper from "./TableWrapper";
|
|
11
11
|
import { ColumnsChoose } from "../../table-component/ColumnsChoose";
|
|
12
|
-
import { getTableHeight } from "../hook/utils";
|
|
12
|
+
import { convertToObjTrue, findAllChildrenKeys2, getTableHeight, isObjEmpty } from "../hook/utils";
|
|
13
13
|
import { TableContext } from "../useContext";
|
|
14
14
|
// import { ColumnsGroup } from '../../grid-component/ColumnsGroup';
|
|
15
15
|
import { flatColumns2 } from "../../table-component/hook/utils";
|
|
@@ -20,7 +20,7 @@ const TableContainer = props => {
|
|
|
20
20
|
table,
|
|
21
21
|
id,
|
|
22
22
|
prefix,
|
|
23
|
-
|
|
23
|
+
commandClick,
|
|
24
24
|
editAble,
|
|
25
25
|
rowKey,
|
|
26
26
|
format,
|
|
@@ -106,41 +106,28 @@ const TableContainer = props => {
|
|
|
106
106
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
107
107
|
};
|
|
108
108
|
}, []);
|
|
109
|
+
const triggerCommandClick = args => {
|
|
110
|
+
// const { id: idCommand, rowId, rowData, index } = args
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// if (!tableContainerRef.current) {
|
|
113
|
-
// return
|
|
114
|
-
// }
|
|
115
|
-
|
|
116
|
-
// if (columnSizingInfo.isResizingColumn === false) {
|
|
117
|
-
|
|
118
|
-
// const aa = updateColumnWidthsRecursive(propsColumns, columnSizing)
|
|
119
|
-
|
|
120
|
-
// setColumns(aa)
|
|
121
|
-
|
|
122
|
-
// }
|
|
123
|
-
|
|
124
|
-
// }, [columnSizingInfo])
|
|
125
|
-
|
|
126
|
-
// const triggerCommandClick = (args: Omit<CommandClick<RecordType>, 'rows'>) => {
|
|
127
|
-
|
|
128
|
-
// // const { id: idCommand, rowId, rowData, index } = args
|
|
129
|
-
|
|
130
|
-
// // const tmpData = [...dataSource]
|
|
131
|
-
|
|
132
|
-
// if (commandClick) {
|
|
133
|
-
// commandClick({
|
|
134
|
-
// ...args,
|
|
135
|
-
// rows: originData
|
|
136
|
-
// })
|
|
137
|
-
// }
|
|
138
|
-
|
|
139
|
-
// }
|
|
112
|
+
// const tmpData = [...dataSource]
|
|
140
113
|
|
|
114
|
+
if (commandClick) {
|
|
115
|
+
commandClick({
|
|
116
|
+
...args,
|
|
117
|
+
rows: originData
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
141
121
|
const handleOnGroup = value => {
|
|
142
122
|
triggerGroupColumns?.(value);
|
|
143
123
|
};
|
|
124
|
+
const handleCollapseAllGroup = () => {
|
|
125
|
+
setExpanded({});
|
|
126
|
+
};
|
|
127
|
+
const handleExpandAllGroup = () => {
|
|
128
|
+
const allKeys = findAllChildrenKeys2(dataSource, rowKey, 'children');
|
|
129
|
+
setExpanded(convertToObjTrue(allKeys));
|
|
130
|
+
};
|
|
144
131
|
const groupToolbar = () => {
|
|
145
132
|
return /*#__PURE__*/React.createElement("div", {
|
|
146
133
|
style: {
|
|
@@ -158,7 +145,15 @@ const TableContainer = props => {
|
|
|
158
145
|
columns: propsColumns ? flatColumns2(propsColumns) : [],
|
|
159
146
|
columnsGrouped: groupColumns,
|
|
160
147
|
onSubmit: handleOnGroup
|
|
161
|
-
}), /*#__PURE__*/React.createElement(React.Fragment, null)
|
|
148
|
+
}), /*#__PURE__*/React.createElement(React.Fragment, null, !isObjEmpty(expanded) ? /*#__PURE__*/React.createElement(Collapse2, {
|
|
149
|
+
fontSize: 16,
|
|
150
|
+
color: '#555555',
|
|
151
|
+
onClick: handleCollapseAllGroup
|
|
152
|
+
}) : /*#__PURE__*/React.createElement(Expand2, {
|
|
153
|
+
fontSize: 16,
|
|
154
|
+
color: '#555555',
|
|
155
|
+
onClick: handleExpandAllGroup
|
|
156
|
+
})));
|
|
162
157
|
};
|
|
163
158
|
return /*#__PURE__*/React.createElement("div", {
|
|
164
159
|
ref: containerRef,
|
|
@@ -234,7 +229,6 @@ const TableContainer = props => {
|
|
|
234
229
|
setExpanded,
|
|
235
230
|
dataSource,
|
|
236
231
|
originData,
|
|
237
|
-
// triggerFilter,
|
|
238
232
|
wrapSettings,
|
|
239
233
|
recordDoubleClick,
|
|
240
234
|
selectionSettings,
|
|
@@ -245,8 +239,6 @@ const TableContainer = props => {
|
|
|
245
239
|
setFilterChange,
|
|
246
240
|
windowSize,
|
|
247
241
|
isDataTree,
|
|
248
|
-
// focusedCell,
|
|
249
|
-
// setFocusedCell,
|
|
250
242
|
rowClassName,
|
|
251
243
|
onRowStyles,
|
|
252
244
|
onRowFooterStyles,
|
|
@@ -254,12 +246,6 @@ const TableContainer = props => {
|
|
|
254
246
|
table,
|
|
255
247
|
pagination,
|
|
256
248
|
groupSetting
|
|
257
|
-
// visible,
|
|
258
|
-
// setVisible,
|
|
259
|
-
// selectedKeys,
|
|
260
|
-
// setSelectedKeys,
|
|
261
|
-
// currentFilter,
|
|
262
|
-
// setCurrentFilter
|
|
263
249
|
}
|
|
264
250
|
}, /*#__PURE__*/React.createElement(TableWrapper, {
|
|
265
251
|
tableContainerRef: tableContainerRef,
|
|
@@ -269,7 +255,8 @@ const TableContainer = props => {
|
|
|
269
255
|
minHeight: minHeight,
|
|
270
256
|
dataSource: dataSource,
|
|
271
257
|
table: table,
|
|
272
|
-
columns: columns
|
|
258
|
+
columns: columns,
|
|
259
|
+
commandClick: triggerCommandClick
|
|
273
260
|
})), /*#__PURE__*/React.createElement("div", {
|
|
274
261
|
ref: bottomToolbarRef
|
|
275
262
|
}, pagination && !infiniteScroll && /*#__PURE__*/React.createElement(Pagination
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ColumnDef, Table } from "@tanstack/react-table";
|
|
3
|
+
import type { CommandClick } from '../../table-component/type';
|
|
3
4
|
type Props<T> = {
|
|
4
5
|
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
5
6
|
table: Table<T>;
|
|
@@ -11,6 +12,7 @@ type Props<T> = {
|
|
|
11
12
|
dataSource: T[];
|
|
12
13
|
summary?: boolean;
|
|
13
14
|
loading?: boolean;
|
|
15
|
+
commandClick?: (args: Omit<CommandClick<T>, 'rows'>) => void;
|
|
14
16
|
editAble?: boolean;
|
|
15
17
|
showEmptyText?: boolean;
|
|
16
18
|
contextMenuClick?: any;
|
|
@@ -14,6 +14,7 @@ import { TableContext } from "../useContext";
|
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import TableBodyRow from "../body/TableBodyRow";
|
|
16
16
|
import TableFooterCell from "../footer/TableFooterCell";
|
|
17
|
+
|
|
17
18
|
// import type { ColumnsTable, TableProps } from '../type';
|
|
18
19
|
|
|
19
20
|
// type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
|
|
@@ -23,7 +24,8 @@ const TableWrapper = props => {
|
|
|
23
24
|
table,
|
|
24
25
|
// columns,
|
|
25
26
|
height,
|
|
26
|
-
id
|
|
27
|
+
id,
|
|
28
|
+
commandClick
|
|
27
29
|
} = props;
|
|
28
30
|
const {
|
|
29
31
|
prefix
|
|
@@ -83,7 +85,8 @@ const TableWrapper = props => {
|
|
|
83
85
|
return /*#__PURE__*/React.createElement(TableBodyRow, _extends({
|
|
84
86
|
tableId: id,
|
|
85
87
|
row: row,
|
|
86
|
-
table: table
|
|
88
|
+
table: table,
|
|
89
|
+
commandClick: commandClick
|
|
87
90
|
}, props));
|
|
88
91
|
}
|
|
89
92
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
declare const TempTable: <RecordType extends object>(props:
|
|
2
|
+
import type { TableProps } from "../table-component";
|
|
3
|
+
declare const TempTable: <RecordType extends object>(props: TableProps<RecordType>) => React.JSX.Element;
|
|
4
4
|
export default TempTable;
|
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react =
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _tableComponent = _interopRequireDefault(require("../table-component"));
|
|
11
11
|
var _tableVirtuoso = _interopRequireDefault(require("../table-virtuoso"));
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
12
|
const TempTable = props => {
|
|
15
13
|
const {
|
|
16
14
|
groupAble,
|
|
@@ -18,9 +16,9 @@ const TempTable = props => {
|
|
|
18
16
|
...rest
|
|
19
17
|
} = props;
|
|
20
18
|
const TabComponent = groupAble ? _tableVirtuoso.default : _tableComponent.default;
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(TabComponent, (0, _extends2.default)({}, rest, {
|
|
22
20
|
groupAble: groupAble,
|
|
23
21
|
editAble: editAble
|
|
24
|
-
}))
|
|
22
|
+
}));
|
|
25
23
|
};
|
|
26
24
|
var _default = exports.default = TempTable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyObject, GetRowKey } from "../type";
|
|
2
1
|
import type { Key } from "react";
|
|
2
|
+
import type { AnyObject, GetRowKey } from '../../table-component/type';
|
|
3
3
|
declare const useLazyKVMap: <RecordType extends AnyObject = AnyObject>(data: readonly RecordType[], childrenColumnName: string, getRowKey: GetRowKey<RecordType>) => readonly [(key: Key) => RecordType];
|
|
4
4
|
export default useLazyKVMap;
|
|
@@ -9,9 +9,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
9
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
|
|
11
11
|
|
|
12
|
-
// import type { AnyObject } from '../../_util/type';
|
|
13
|
-
// import type { GetRowKey, Key } from '../interface';
|
|
14
|
-
|
|
15
12
|
const useLazyKVMap = (data, childrenColumnName, getRowKey) => {
|
|
16
13
|
const mapCacheRef = React.useRef({});
|
|
17
14
|
function getRecordByKey(key) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
import type { EditType, IColumnType, TypeFilter } from "rc-master-ui";
|
|
4
|
-
import type { ColumnTable, GetRowKey, IFormat } from "../type";
|
|
5
|
-
import type { AnyObject } from "../type";
|
|
6
4
|
import type { Key } from "react";
|
|
7
5
|
import type { ColumnsTable } from "./../index";
|
|
6
|
+
import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../../table-component/type";
|
|
8
7
|
export declare const newGuid: () => any;
|
|
9
8
|
export declare const sumDataByField: (data: any[], field: string) => any;
|
|
10
9
|
export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
@@ -50,7 +49,7 @@ export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
|
50
49
|
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
51
50
|
export declare const getTemplate: (template: any, column?: ColumnTable) => React.ReactNode | React.ReactElement;
|
|
52
51
|
export declare const isObjEmpty: (obj: any) => boolean;
|
|
53
|
-
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) =>
|
|
52
|
+
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) => ColumnTable<T>[];
|
|
54
53
|
export declare const updateData: <Record = AnyObject>(initData: Record[], rows: Record[], key: keyof Record) => Record[];
|
|
55
54
|
export declare const parseBooleanToValue: (value: boolean, type: 'boolean' | 'number') => number | boolean;
|
|
56
55
|
export declare const genPresets: (presets?: import("@ant-design/colors").PalettesProps) => import("antd/es/color-picker/interface").PresetsItem[];
|
|
@@ -105,7 +104,7 @@ export declare const convertFlatColumn: (array: ColumnsTable) => ColumnsTable[];
|
|
|
105
104
|
export declare const checkChild: (inputArray: any[]) => boolean;
|
|
106
105
|
export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean);
|
|
107
106
|
export declare const isArraysEqual: (arr1: any[], arr2: any[]) => boolean;
|
|
108
|
-
export declare const editAbleColumns: <T>(columns: ColumnsTable<T>) =>
|
|
107
|
+
export declare const editAbleColumns: <T>(columns: ColumnsTable<T>) => ColumnTable<T>[];
|
|
109
108
|
export declare const findItemPath: (tree: any[], targetItem: any, rowKey: any, currentPage?: number, pageSize?: number) => any;
|
|
110
109
|
export declare const filterDataByColumns: (data: any[], queries: any) => any[];
|
|
111
110
|
export declare const filterDataByColumns2: (data: any[], queries: any) => any[];
|
|
@@ -48,7 +48,10 @@ var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
|
48
48
|
var _moment = _interopRequireDefault(require("moment/moment"));
|
|
49
49
|
var _uuid = require("uuid");
|
|
50
50
|
var _colors = require("@ant-design/colors");
|
|
51
|
+
// import type {ColumnTable, GetRowKey, IFormat, Presets} from "./../ type"
|
|
52
|
+
|
|
51
53
|
// import type {SelectionSettings} from "../type"
|
|
54
|
+
// import type {AnyObject} from "../type"
|
|
52
55
|
|
|
53
56
|
// import {Table} from "rc-master-ui"
|
|
54
57
|
// import {flatColumns2} from "./columns"
|