es-grid-template 1.8.65 → 1.8.67
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/constant.d.ts +1 -0
- package/es/grid-component/hooks/constant.js +2 -1
- 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/TableContainerEdit.js +2 -127
- package/es/table-component/body/TableBodyCellEdit.js +2 -9
- package/es/table-component/header/TableHeadCell.js +1 -10
- package/es/table-component/header/TableHeadCell2.js +1 -1
- package/es/table-component/type.d.ts +3 -1
- 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/constant.d.ts +1 -0
- package/lib/grid-component/hooks/constant.js +3 -2
- 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/TableContainerEdit.js +1 -126
- package/lib/table-component/body/TableBodyCellEdit.js +5 -11
- package/lib/table-component/header/TableHeadCell.js +4 -13
- package/lib/table-component/header/TableHeadCell2.js +4 -4
- package/lib/table-component/type.d.ts +3 -1
- 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-component/hook/constant.d.ts +0 -73
- package/es/table-component/hook/constant.js +0 -240
- 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-component/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
- package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
- package/lib/table-virtuoso/body/TableBody.js +0 -95
|
@@ -15,14 +15,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _useContext = require("../useContext");
|
|
17
17
|
var _EditableCell = _interopRequireDefault(require("./EditableCell"));
|
|
18
|
-
var
|
|
18
|
+
var _hooks = require("../../grid-component/hooks");
|
|
19
19
|
var _useColumns = require("../hook/useColumns");
|
|
20
|
-
// import { nonActionColumn } from "../hook/constant";
|
|
21
|
-
|
|
22
|
-
// import type { Dispatch, SetStateAction } from "react";
|
|
23
|
-
|
|
24
|
-
// import { nonActionColumn } from "../hook/constant";
|
|
25
|
-
|
|
26
20
|
const renderCellIndex = props => {
|
|
27
21
|
const {
|
|
28
22
|
parrents,
|
|
@@ -646,7 +640,7 @@ const TableBodyCellEdit = props => {
|
|
|
646
640
|
if (e.key === 'ArrowRight') {
|
|
647
641
|
e.preventDefault();
|
|
648
642
|
e.stopPropagation();
|
|
649
|
-
const allCols = table.getVisibleLeafColumns().filter(it => !
|
|
643
|
+
const allCols = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
650
644
|
const currentColIndex = allCols.findIndex(it => it.id === cell.column.id);
|
|
651
645
|
const nextCol = allCols[currentColIndex + 1];
|
|
652
646
|
if (nextCol) {
|
|
@@ -677,7 +671,7 @@ const TableBodyCellEdit = props => {
|
|
|
677
671
|
}
|
|
678
672
|
if (e.key === 'ArrowLeft') {
|
|
679
673
|
e.preventDefault();
|
|
680
|
-
const allCols = table.getVisibleLeafColumns().filter(it => !
|
|
674
|
+
const allCols = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
681
675
|
|
|
682
676
|
// const currentColIndex = table.getColumn(colId)?.getIndex() ?? 0;
|
|
683
677
|
const currentColIndex = allCols.findIndex(it => it.id === cell.column.id);
|
|
@@ -825,7 +819,7 @@ const TableBodyCellEdit = props => {
|
|
|
825
819
|
}
|
|
826
820
|
const handleMouseDownIndex = rowId => {
|
|
827
821
|
setIsSelecting?.(true);
|
|
828
|
-
const allColumns = table.getVisibleLeafColumns().filter(it => !
|
|
822
|
+
const allColumns = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
829
823
|
const firstCOl = (0, _utils.findFirst)(allColumns);
|
|
830
824
|
const startCol = allColumns[0].id;
|
|
831
825
|
const endCol = allColumns[allColumns.length - 1].id;
|
|
@@ -853,7 +847,7 @@ const TableBodyCellEdit = props => {
|
|
|
853
847
|
};
|
|
854
848
|
const handleMouseEnterIndex = rowId => {
|
|
855
849
|
if (isSelecting) {
|
|
856
|
-
const allColumns = table.getVisibleLeafColumns().filter(it => !
|
|
850
|
+
const allColumns = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
857
851
|
|
|
858
852
|
// const firstCOl = findFirst(allColumns)
|
|
859
853
|
|
|
@@ -11,22 +11,13 @@ var _antd = require("antd");
|
|
|
11
11
|
var _becoxyIcons = require("becoxy-icons");
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _rcMasterUi = require("rc-master-ui");
|
|
14
|
-
var
|
|
14
|
+
var _hooks = require("../../grid-component/hooks");
|
|
15
15
|
var _utils = require("../hook/utils");
|
|
16
16
|
var _useContext = require("../useContext");
|
|
17
17
|
var _renderFilter = require("./renderFilter");
|
|
18
18
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
19
19
|
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); }
|
|
20
20
|
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; }
|
|
21
|
-
// import { useSortable } from "@dnd-kit/sortable"
|
|
22
|
-
|
|
23
|
-
// import { CSS } from '@dnd-kit/utilities'
|
|
24
|
-
// import type { Virtualizer } from '@tanstack/react-virtual'
|
|
25
|
-
|
|
26
|
-
// import { ColumnTable } from "../type";
|
|
27
|
-
|
|
28
|
-
// import { Tooltip } from 'react-tooltip'
|
|
29
|
-
|
|
30
21
|
const TableHeadCell = props => {
|
|
31
22
|
const {
|
|
32
23
|
header,
|
|
@@ -149,7 +140,7 @@ const TableHeadCell = props => {
|
|
|
149
140
|
dropdownRender: () => {
|
|
150
141
|
const type = (0, _utils.getTypeFilter)(originalColumn);
|
|
151
142
|
const operatorValue = header.column.getFilterOperator() ?? (0, _utils.getDefaultOperator)(originalColumn);
|
|
152
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
143
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
153
144
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
154
145
|
// className='ui-rc-table-filter-dropdown'
|
|
155
146
|
|
|
@@ -163,7 +154,7 @@ const TableHeadCell = props => {
|
|
|
163
154
|
}, /*#__PURE__*/_react.default.createElement("div", null), column.meta?.showOperator !== false && column.meta?.typeFilter !== 'DateRange' && column.meta?.typeFilter !== 'NumberRange' && /*#__PURE__*/_react.default.createElement("div", {
|
|
164
155
|
className: 'mb-1'
|
|
165
156
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
166
|
-
options: (0,
|
|
157
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
167
158
|
style: {
|
|
168
159
|
width: '100%',
|
|
169
160
|
marginBottom: 8
|
|
@@ -271,7 +262,7 @@ const TableHeadCell = props => {
|
|
|
271
262
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
272
263
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
273
264
|
})
|
|
274
|
-
}, cellContent)), !
|
|
265
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(header.column.id) && header.subHeaders.length < 2 && /*#__PURE__*/_react.default.createElement("span", {
|
|
275
266
|
className: "ui-rc-header-trigger"
|
|
276
267
|
}, header.column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
277
268
|
style: {
|
|
@@ -11,11 +11,11 @@ var _antd = require("antd");
|
|
|
11
11
|
var _becoxyIcons = require("becoxy-icons");
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _rcMasterUi = require("rc-master-ui");
|
|
14
|
-
var _constant = require("../hook/constant");
|
|
15
14
|
var _utils = require("../hook/utils");
|
|
16
15
|
var _useContext = require("../useContext");
|
|
17
16
|
var _renderFilter = require("./renderFilter");
|
|
18
17
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
18
|
+
var _hooks = require("../../grid-component/hooks");
|
|
19
19
|
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); }
|
|
20
20
|
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; }
|
|
21
21
|
const TableHeadCell2 = props => {
|
|
@@ -133,7 +133,7 @@ const TableHeadCell2 = props => {
|
|
|
133
133
|
dropdownRender: () => {
|
|
134
134
|
const type = (0, _utils.getTypeFilter)(originalColumn);
|
|
135
135
|
const operatorValue = column.getFilterOperator() ?? (0, _utils.getDefaultOperator)(originalColumn);
|
|
136
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
136
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
137
137
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
138
|
// className='ui-rc-table-filter-dropdown'
|
|
139
139
|
|
|
@@ -147,7 +147,7 @@ const TableHeadCell2 = props => {
|
|
|
147
147
|
}, /*#__PURE__*/_react.default.createElement("div", null), column.columnDef?.meta?.showOperator !== false && column.columnDef?.meta?.typeFilter !== 'DateRange' && column.columnDef?.meta?.typeFilter !== 'NumberRange' && /*#__PURE__*/_react.default.createElement("div", {
|
|
148
148
|
className: 'mb-1'
|
|
149
149
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
150
|
-
options: (0,
|
|
150
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
151
151
|
style: {
|
|
152
152
|
width: '100%',
|
|
153
153
|
marginBottom: 8
|
|
@@ -266,7 +266,7 @@ const TableHeadCell2 = props => {
|
|
|
266
266
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
267
267
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
268
268
|
})
|
|
269
|
-
}, cellContent)), !
|
|
269
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(column.id) && column.columns.length < 1 && /*#__PURE__*/_react.default.createElement("span", {
|
|
270
270
|
className: "ui-rc-header-trigger"
|
|
271
271
|
}, column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
272
272
|
style: {
|
|
@@ -2,9 +2,9 @@ import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
|
|
|
2
2
|
import type { ItemType } from 'rc-master-ui/es/menu/interface';
|
|
3
3
|
import type { Cell, Header, OnChangeFn, Row } from '@tanstack/react-table';
|
|
4
4
|
import type { ReactElement, ReactNode } from 'react';
|
|
5
|
-
import type { IOperator } from './hook/constant';
|
|
6
5
|
import type { ColorPickerProps } from 'antd';
|
|
7
6
|
import type { TableLocale } from "rc-master-ui/lib/table/interface";
|
|
7
|
+
import type { IOperator } from '../grid-component/hooks';
|
|
8
8
|
declare module "@tanstack/table-core" {
|
|
9
9
|
interface ColumnMeta<any, any> extends ColumnTable {
|
|
10
10
|
rowSpan?: number;
|
|
@@ -80,6 +80,7 @@ export type ColumnTemplate<RecordType> = {
|
|
|
80
80
|
index: number;
|
|
81
81
|
field: string;
|
|
82
82
|
};
|
|
83
|
+
export type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
|
|
83
84
|
export type ColumnTable<RecordType = AnyObject> = {
|
|
84
85
|
field: string;
|
|
85
86
|
width?: number;
|
|
@@ -200,6 +201,7 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
200
201
|
title?: ReactNode | ((data: RecordType) => ReactNode);
|
|
201
202
|
fullScreenTitle?: ReactNode | (() => ReactNode);
|
|
202
203
|
editAble?: boolean;
|
|
204
|
+
rowKey?: string;
|
|
203
205
|
infiniteScroll?: boolean;
|
|
204
206
|
next?: () => void;
|
|
205
207
|
locale?: Locale;
|
|
@@ -37,12 +37,9 @@ const ColumnsGroup = props => {
|
|
|
37
37
|
const menuRef = (0, _react.useRef)();
|
|
38
38
|
const [tempGroup, setTempGroup] = (0, _react.useState)([]);
|
|
39
39
|
const [clicked, setClicked] = (0, _react.useState)(false);
|
|
40
|
-
console.log('columns', columns);
|
|
41
|
-
console.log('columnsGrouped', columnsGrouped);
|
|
42
40
|
const rsCol = _react.default.useMemo(() => {
|
|
43
41
|
return columns.filter(it => it.visible !== false && !tempGroup.includes(it.field) && it.field !== '#' && it.field !== 'selection_column' && it.field !== 'command');
|
|
44
42
|
}, [columns, tempGroup]);
|
|
45
|
-
console.log('rsCol', rsCol);
|
|
46
43
|
const options = _react.default.useMemo(() => {
|
|
47
44
|
return rsCol.map(it => ({
|
|
48
45
|
...it,
|
|
@@ -235,6 +232,7 @@ const ColumnsGroup = props => {
|
|
|
235
232
|
title: 'Nhóm dữ liệu'
|
|
236
233
|
}, /*#__PURE__*/_react.default.createElement(_becoxyIcons.Group, {
|
|
237
234
|
fontSize: 18,
|
|
235
|
+
color: "#555555",
|
|
238
236
|
style: {
|
|
239
237
|
cursor: 'pointer'
|
|
240
238
|
}
|
|
@@ -23,12 +23,6 @@ var _utils2 = require("../table-component/hook/utils");
|
|
|
23
23
|
var _operator = require("../table-component/features/operator");
|
|
24
24
|
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); }
|
|
25
25
|
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; }
|
|
26
|
-
// import './style.scss'
|
|
27
|
-
|
|
28
|
-
// import { convertColumns } from './hook/convert'
|
|
29
|
-
|
|
30
|
-
// import { ColumnsGroup } from '../grid-component/ColumnsGroup'
|
|
31
|
-
|
|
32
26
|
_dayjs.default.extend(_customParseFormat.default);
|
|
33
27
|
const SELECTION_COLUMN = exports.SELECTION_COLUMN = {};
|
|
34
28
|
const InternalTable = props => {
|
|
@@ -135,24 +129,6 @@ const InternalTable = props => {
|
|
|
135
129
|
// setColumns(updateWidthsByOther(propsColumns, columns))
|
|
136
130
|
setColumns(propsColumns);
|
|
137
131
|
}, [propsColumns]);
|
|
138
|
-
|
|
139
|
-
// const convertData = React.useMemo(() => {
|
|
140
|
-
|
|
141
|
-
// if (groupAble && groupSetting && groupSetting.client !== false) {
|
|
142
|
-
|
|
143
|
-
// const bbc = addRowIdArray(dataSource)
|
|
144
|
-
|
|
145
|
-
// const abc = groupArrayByColumns(bbc, groupColumns)
|
|
146
|
-
|
|
147
|
-
// return abc
|
|
148
|
-
// } else {
|
|
149
|
-
|
|
150
|
-
// return addRowIdArray(dataSource)
|
|
151
|
-
|
|
152
|
-
// }
|
|
153
|
-
|
|
154
|
-
// }, [dataSource, groupAble, groupColumns, groupSetting])
|
|
155
|
-
|
|
156
132
|
const mergedColumns = _react.default.useMemo(() => {
|
|
157
133
|
return (0, _useColumns.convertToTanStackColumns)({
|
|
158
134
|
t,
|
|
@@ -160,8 +136,6 @@ const InternalTable = props => {
|
|
|
160
136
|
format,
|
|
161
137
|
editAble
|
|
162
138
|
});
|
|
163
|
-
|
|
164
|
-
// return convertToTanStackColumns<RecordType>(columns)
|
|
165
139
|
}, [t, columns, format, editAble]);
|
|
166
140
|
const isDataTree = _react.default.useMemo(() => {
|
|
167
141
|
return (0, _utils.isTreeArray)(tableData);
|
|
@@ -200,8 +174,12 @@ const InternalTable = props => {
|
|
|
200
174
|
|
|
201
175
|
_react.default.useEffect(() => {
|
|
202
176
|
const a = (0, _utils.getInvisibleColumns)(columns);
|
|
203
|
-
|
|
204
|
-
|
|
177
|
+
const bcd = (0, _utils.convertToObj)(groupColumns);
|
|
178
|
+
setColumnVisibility({
|
|
179
|
+
...a,
|
|
180
|
+
...bcd
|
|
181
|
+
});
|
|
182
|
+
}, [columns, groupColumns]);
|
|
205
183
|
const [columnsHiddenKeys, setColumnsHiddenKeys] = (0, _useMergedState.default)(undefined, {
|
|
206
184
|
value: undefined
|
|
207
185
|
});
|
|
@@ -15,8 +15,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
var _useContext = require("../useContext");
|
|
16
16
|
var _useColumns = require("../hook/useColumns");
|
|
17
17
|
var _Command = _interopRequireDefault(require("../../table-component/components/command/Command"));
|
|
18
|
-
// import Command from "../components/command/Command";
|
|
19
|
-
|
|
20
18
|
const renderCellIndex = props => {
|
|
21
19
|
const {
|
|
22
20
|
cell,
|
|
@@ -68,7 +66,6 @@ const renderCommand = args => {
|
|
|
68
66
|
onClick: () => {
|
|
69
67
|
commandClick?.({
|
|
70
68
|
id: item.id,
|
|
71
|
-
// rowId: getRowKey(record, index) as any,
|
|
72
69
|
rowId: record.rowId,
|
|
73
70
|
rowData: record,
|
|
74
71
|
index: cell.row.index,
|
|
@@ -193,12 +190,6 @@ const TableBodyCell = props => {
|
|
|
193
190
|
const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
|
|
194
191
|
const isFirstRightPinnedColumn = isPinned === "right" && cell.column.getIsFirstColumn("right");
|
|
195
192
|
const enableClick = typeof columnMeta.allowSelection === 'function' ? columnMeta.allowSelection(record) : columnMeta.allowSelection;
|
|
196
|
-
|
|
197
|
-
// const firstVisibleNormalColumn = table.getVisibleLeafColumns().filter(col => col.id !== 'selection' && col.id !== '#')[0];
|
|
198
|
-
// const firstVisibleNormalColumn = table.getVisibleLeafColumns().filter(col => col.id !== 'selection' && col.id !== '#')[0];
|
|
199
|
-
|
|
200
|
-
// const parrents = cell.row.getParentRows();
|
|
201
|
-
|
|
202
193
|
if (cell.column.id === "#") {
|
|
203
194
|
return /*#__PURE__*/_react.default.createElement("td", {
|
|
204
195
|
key: cell.id,
|
|
@@ -11,8 +11,6 @@ var _reactTable = require("@tanstack/react-table");
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _useContext = require("../useContext");
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
// import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual"
|
|
15
|
-
|
|
16
14
|
const TableBodyRow = ({
|
|
17
15
|
tableId,
|
|
18
16
|
table,
|
|
@@ -75,9 +73,6 @@ const TableBodyRow = ({
|
|
|
75
73
|
field
|
|
76
74
|
} = row.original ?? {};
|
|
77
75
|
const cellGroup = allCells.find(it => it.column.id === field);
|
|
78
|
-
|
|
79
|
-
// const header = allColumns.find((it) => it.id === field)
|
|
80
|
-
|
|
81
76
|
const headerContext = cellGroup && groupSetting?.showHeaderColumn !== false ? {
|
|
82
77
|
table,
|
|
83
78
|
column: cellGroup.column,
|
|
@@ -8,6 +8,7 @@ exports.GridStyle = void 0;
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
const color = "#000000de";
|
|
10
10
|
const BgColor = "#ffffff";
|
|
11
|
+
const rowSelectedBg = "#FEF2EF";
|
|
11
12
|
const tableBorderColor = "#e0e0e0";
|
|
12
13
|
const tableBorderColorDark = "#44485E";
|
|
13
14
|
const BgColorDark = "#343e59";
|
|
@@ -15,4 +16,4 @@ const colorDark = "#e6e4f3e6";
|
|
|
15
16
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
16
17
|
displayName: "GridStyle",
|
|
17
18
|
componentId: "es-grid-template__sc-rs980s-0"
|
|
18
|
-
})(["&.", "-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;
|
|
19
|
+
})(["&.", "-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);
|
|
@@ -124,7 +124,6 @@ const Grid = props => {
|
|
|
124
124
|
}, [isSelectionChange, rowSelection, table.getState().rowSelection]);
|
|
125
125
|
_react.default.useEffect(() => {
|
|
126
126
|
if (sorterChange) {
|
|
127
|
-
console.log('12312312313123');
|
|
128
127
|
const aa = table.getState().sorting;
|
|
129
128
|
const rs = aa.map(it => {
|
|
130
129
|
return {
|
|
@@ -144,7 +143,6 @@ const Grid = props => {
|
|
|
144
143
|
_react.default.useEffect(() => {
|
|
145
144
|
if (filterChange) {
|
|
146
145
|
const operatorState = table.getState().operator;
|
|
147
|
-
console.log('operatorState', operatorState);
|
|
148
146
|
const merged = columnFilters.map(filter => {
|
|
149
147
|
const match = operatorState.find(op => op.id === filter.id);
|
|
150
148
|
const col = table.getVisibleFlatColumns().find(it => it.id === filter.id)?.columnDef.meta;
|
|
@@ -156,8 +154,6 @@ const Grid = props => {
|
|
|
156
154
|
operator: match ? match.operator : undefined
|
|
157
155
|
};
|
|
158
156
|
});
|
|
159
|
-
console.log('operatorState', operatorState);
|
|
160
|
-
console.log('merged', merged);
|
|
161
157
|
if (onFilter) {
|
|
162
158
|
onFilter?.((0, _utils.convertFilters)(merged));
|
|
163
159
|
} else {
|
|
@@ -28,7 +28,7 @@ const TableContainer = props => {
|
|
|
28
28
|
table,
|
|
29
29
|
id,
|
|
30
30
|
prefix,
|
|
31
|
-
|
|
31
|
+
commandClick,
|
|
32
32
|
editAble,
|
|
33
33
|
rowKey,
|
|
34
34
|
format,
|
|
@@ -114,41 +114,28 @@ const TableContainer = props => {
|
|
|
114
114
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
115
115
|
};
|
|
116
116
|
}, []);
|
|
117
|
+
const triggerCommandClick = args => {
|
|
118
|
+
// const { id: idCommand, rowId, rowData, index } = args
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// if (!tableContainerRef.current) {
|
|
121
|
-
// return
|
|
122
|
-
// }
|
|
123
|
-
|
|
124
|
-
// if (columnSizingInfo.isResizingColumn === false) {
|
|
125
|
-
|
|
126
|
-
// const aa = updateColumnWidthsRecursive(propsColumns, columnSizing)
|
|
127
|
-
|
|
128
|
-
// setColumns(aa)
|
|
129
|
-
|
|
130
|
-
// }
|
|
131
|
-
|
|
132
|
-
// }, [columnSizingInfo])
|
|
133
|
-
|
|
134
|
-
// const triggerCommandClick = (args: Omit<CommandClick<RecordType>, 'rows'>) => {
|
|
135
|
-
|
|
136
|
-
// // const { id: idCommand, rowId, rowData, index } = args
|
|
137
|
-
|
|
138
|
-
// // const tmpData = [...dataSource]
|
|
139
|
-
|
|
140
|
-
// if (commandClick) {
|
|
141
|
-
// commandClick({
|
|
142
|
-
// ...args,
|
|
143
|
-
// rows: originData
|
|
144
|
-
// })
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
// }
|
|
120
|
+
// const tmpData = [...dataSource]
|
|
148
121
|
|
|
122
|
+
if (commandClick) {
|
|
123
|
+
commandClick({
|
|
124
|
+
...args,
|
|
125
|
+
rows: originData
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
149
129
|
const handleOnGroup = value => {
|
|
150
130
|
triggerGroupColumns?.(value);
|
|
151
131
|
};
|
|
132
|
+
const handleCollapseAllGroup = () => {
|
|
133
|
+
setExpanded({});
|
|
134
|
+
};
|
|
135
|
+
const handleExpandAllGroup = () => {
|
|
136
|
+
const allKeys = (0, _utils.findAllChildrenKeys2)(dataSource, rowKey, 'children');
|
|
137
|
+
setExpanded((0, _utils.convertToObjTrue)(allKeys));
|
|
138
|
+
};
|
|
152
139
|
const groupToolbar = () => {
|
|
153
140
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
154
141
|
style: {
|
|
@@ -166,7 +153,15 @@ const TableContainer = props => {
|
|
|
166
153
|
columns: propsColumns ? (0, _utils2.flatColumns2)(propsColumns) : [],
|
|
167
154
|
columnsGrouped: groupColumns,
|
|
168
155
|
onSubmit: handleOnGroup
|
|
169
|
-
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null))
|
|
156
|
+
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !(0, _utils.isObjEmpty)(expanded) ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Collapse2, {
|
|
157
|
+
fontSize: 16,
|
|
158
|
+
color: '#555555',
|
|
159
|
+
onClick: handleCollapseAllGroup
|
|
160
|
+
}) : /*#__PURE__*/_react.default.createElement(_becoxyIcons.Expand2, {
|
|
161
|
+
fontSize: 16,
|
|
162
|
+
color: '#555555',
|
|
163
|
+
onClick: handleExpandAllGroup
|
|
164
|
+
})));
|
|
170
165
|
};
|
|
171
166
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
172
167
|
ref: containerRef,
|
|
@@ -242,7 +237,6 @@ const TableContainer = props => {
|
|
|
242
237
|
setExpanded,
|
|
243
238
|
dataSource,
|
|
244
239
|
originData,
|
|
245
|
-
// triggerFilter,
|
|
246
240
|
wrapSettings,
|
|
247
241
|
recordDoubleClick,
|
|
248
242
|
selectionSettings,
|
|
@@ -253,8 +247,6 @@ const TableContainer = props => {
|
|
|
253
247
|
setFilterChange,
|
|
254
248
|
windowSize,
|
|
255
249
|
isDataTree,
|
|
256
|
-
// focusedCell,
|
|
257
|
-
// setFocusedCell,
|
|
258
250
|
rowClassName,
|
|
259
251
|
onRowStyles,
|
|
260
252
|
onRowFooterStyles,
|
|
@@ -262,12 +254,6 @@ const TableContainer = props => {
|
|
|
262
254
|
table,
|
|
263
255
|
pagination,
|
|
264
256
|
groupSetting
|
|
265
|
-
// visible,
|
|
266
|
-
// setVisible,
|
|
267
|
-
// selectedKeys,
|
|
268
|
-
// setSelectedKeys,
|
|
269
|
-
// currentFilter,
|
|
270
|
-
// setCurrentFilter
|
|
271
257
|
}
|
|
272
258
|
}, /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
|
|
273
259
|
tableContainerRef: tableContainerRef,
|
|
@@ -277,7 +263,8 @@ const TableContainer = props => {
|
|
|
277
263
|
minHeight: minHeight,
|
|
278
264
|
dataSource: dataSource,
|
|
279
265
|
table: table,
|
|
280
|
-
columns: columns
|
|
266
|
+
columns: columns,
|
|
267
|
+
commandClick: triggerCommandClick
|
|
281
268
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
282
269
|
ref: bottomToolbarRef
|
|
283
270
|
}, pagination && !infiniteScroll && /*#__PURE__*/_react.default.createElement(_pagination.default
|
|
@@ -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;
|
|
@@ -29,7 +29,8 @@ const TableWrapper = props => {
|
|
|
29
29
|
table,
|
|
30
30
|
// columns,
|
|
31
31
|
height,
|
|
32
|
-
id
|
|
32
|
+
id,
|
|
33
|
+
commandClick
|
|
33
34
|
} = props;
|
|
34
35
|
const {
|
|
35
36
|
prefix
|
|
@@ -89,7 +90,8 @@ const TableWrapper = props => {
|
|
|
89
90
|
return /*#__PURE__*/_react.default.createElement(_TableBodyRow.default, (0, _extends2.default)({
|
|
90
91
|
tableId: id,
|
|
91
92
|
row: row,
|
|
92
|
-
table: table
|
|
93
|
+
table: table,
|
|
94
|
+
commandClick: commandClick
|
|
93
95
|
}, props));
|
|
94
96
|
}
|
|
95
97
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IFormat } from "./type";
|
|
3
|
-
type Props = {
|
|
4
|
-
columns: any[];
|
|
5
|
-
dataSourceFilter?: any[];
|
|
6
|
-
onFilter?: (query: any, col?: any[]) => void;
|
|
7
|
-
mode?: 'sidebar' | 'dropdown';
|
|
8
|
-
defaultFilter?: any[];
|
|
9
|
-
leftFilterWidth?: number;
|
|
10
|
-
format?: IFormat;
|
|
11
|
-
t?: any;
|
|
12
|
-
};
|
|
13
|
-
declare const AdvanceFilter: (props: Props) => React.JSX.Element;
|
|
14
|
-
export default AdvanceFilter;
|