es-grid-template 1.8.66 → 1.8.68
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/hooks/constant.d.ts +1 -0
- package/es/grid-component/hooks/constant.js +2 -1
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/utils.d.ts +1 -1
- package/es/grid-component/index.d.ts +1 -1
- package/es/grid-component/type.d.ts +567 -0
- package/es/grid-component/type.js +1 -490
- package/es/table-component/ColumnsChoose.d.ts +1 -1
- package/es/table-component/ColumnsChoose.js +0 -2
- package/es/table-component/ContextMenu.d.ts +1 -2
- package/es/table-component/ContextMenu.js +0 -1
- package/es/table-component/InternalTable.d.ts +1 -2
- package/es/table-component/InternalTable.js +1 -32
- package/es/table-component/TableContainer.d.ts +1 -1
- package/es/table-component/TableContainer.js +4 -2
- package/es/table-component/TableContainerEdit.d.ts +1 -1
- package/es/table-component/TableContainerEdit.js +6 -129
- package/es/table-component/body/EditableCell.d.ts +1 -1
- package/es/table-component/body/EditableCell.js +1 -18
- package/es/table-component/body/TableBody.d.ts +1 -1
- package/es/table-component/body/TableBodyCell.d.ts +1 -1
- package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
- package/es/table-component/body/TableBodyCellEdit.js +2 -9
- package/es/table-component/body/TableBodyRow.d.ts +1 -1
- package/es/table-component/components/ControlCheckbox.d.ts +1 -1
- package/es/table-component/components/EditForm/EditForm.js +0 -1
- package/es/table-component/components/InputControl/InputControl.js +0 -3
- package/es/table-component/components/async-select/index.d.ts +1 -1
- package/es/table-component/components/async-select/index.js +0 -3
- package/es/table-component/components/async-table-select/index.d.ts +1 -1
- package/es/table-component/components/async-table-select/index.js +0 -4
- package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
- package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
- package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
- package/es/table-component/components/command/Command.d.ts +1 -1
- package/es/table-component/components/number/index.d.ts +3 -2
- package/es/table-component/components/number/index.js +0 -8
- package/es/table-component/components/number-range/index.d.ts +3 -2
- package/es/table-component/components/number-range/index.js +0 -3
- package/es/table-component/footer/TableFooterRow.js +1 -22
- package/es/table-component/header/TableHead.js +0 -20
- package/es/table-component/header/TableHeadCell.js +1 -15
- package/es/table-component/header/TableHeadCell2.js +5 -3
- package/es/table-component/header/TableHeadGroupCell.js +0 -23
- package/es/table-component/header/renderFilter.d.ts +1 -1
- package/es/table-component/hook/useColumns.d.ts +1 -1
- package/es/table-component/hook/useFilterOperator.d.ts +2 -2
- package/es/table-component/hook/utils.d.ts +1 -1
- package/es/table-component/hook/utils.js +0 -3
- package/es/table-component/index.d.ts +1 -1
- package/es/table-component/index.js +0 -3
- package/es/table-component/table/Grid.d.ts +1 -1
- package/es/table-component/table/Grid.js +0 -5
- package/es/table-component/table/TableWrapper.d.ts +1 -1
- package/es/table-component/useContext.d.ts +2 -1
- package/es/table-virtuoso/InternalTable.d.ts +1 -1
- package/es/table-virtuoso/InternalTable.js +2 -1
- package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
- package/es/table-virtuoso/body/TableBodyCell.js +1 -1
- package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
- package/es/table-virtuoso/body/TableBodyRow.js +3 -1
- package/es/table-virtuoso/header/TableHeadCell.js +1 -3
- package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
- package/es/table-virtuoso/header/renderFilter.js +0 -4
- package/es/table-virtuoso/hook/utils.d.ts +1 -1
- package/es/table-virtuoso/style.js +1 -1
- package/es/table-virtuoso/table/Grid.d.ts +1 -1
- package/es/table-virtuoso/table/Grid.js +0 -24
- package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
- package/es/table-virtuoso/table/TableContainer.js +0 -2
- package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
- package/es/table-virtuoso/table/TableWrapper.js +3 -19
- package/es/table-virtuoso/useContext.d.ts +1 -1
- 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/utils.d.ts +1 -1
- package/lib/grid-component/index.d.ts +1 -1
- package/lib/grid-component/type.d.ts +567 -0
- package/lib/grid-component/type.js +4 -490
- package/lib/table-component/ColumnsChoose.d.ts +1 -1
- package/lib/table-component/ColumnsChoose.js +0 -2
- package/lib/table-component/ContextMenu.d.ts +1 -2
- package/lib/table-component/ContextMenu.js +0 -2
- package/lib/table-component/InternalTable.d.ts +1 -2
- package/lib/table-component/InternalTable.js +1 -28
- package/lib/table-component/TableContainer.d.ts +1 -1
- package/lib/table-component/TableContainer.js +4 -2
- package/lib/table-component/TableContainerEdit.d.ts +1 -1
- package/lib/table-component/TableContainerEdit.js +5 -128
- package/lib/table-component/body/EditableCell.d.ts +1 -1
- package/lib/table-component/body/EditableCell.js +0 -10
- package/lib/table-component/body/TableBody.d.ts +1 -1
- package/lib/table-component/body/TableBodyCell.d.ts +1 -1
- package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
- package/lib/table-component/body/TableBodyCellEdit.js +5 -11
- package/lib/table-component/body/TableBodyRow.d.ts +1 -1
- package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
- package/lib/table-component/components/EditForm/EditForm.js +0 -2
- package/lib/table-component/components/InputControl/InputControl.js +0 -4
- package/lib/table-component/components/async-select/index.d.ts +1 -1
- package/lib/table-component/components/async-select/index.js +0 -2
- package/lib/table-component/components/async-table-select/index.d.ts +1 -1
- package/lib/table-component/components/async-table-select/index.js +0 -4
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
- package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
- package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
- package/lib/table-component/components/command/Command.d.ts +1 -1
- package/lib/table-component/components/number/index.d.ts +3 -2
- package/lib/table-component/components/number/index.js +0 -8
- package/lib/table-component/components/number-range/index.d.ts +3 -2
- package/lib/table-component/components/number-range/index.js +0 -3
- package/lib/table-component/footer/TableFooterRow.js +1 -23
- package/lib/table-component/header/TableHead.js +0 -21
- package/lib/table-component/header/TableHeadCell.js +4 -18
- package/lib/table-component/header/TableHeadCell2.js +8 -6
- package/lib/table-component/header/TableHeadGroupCell.js +0 -23
- package/lib/table-component/header/renderFilter.d.ts +1 -1
- package/lib/table-component/hook/useColumns.d.ts +1 -1
- package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
- package/lib/table-component/hook/utils.d.ts +1 -1
- package/lib/table-component/hook/utils.js +0 -4
- package/lib/table-component/index.d.ts +1 -1
- package/lib/table-component/index.js +0 -1
- package/lib/table-component/table/Grid.d.ts +1 -1
- package/lib/table-component/table/Grid.js +0 -4
- package/lib/table-component/table/TableWrapper.d.ts +1 -1
- package/lib/table-component/useContext.d.ts +2 -1
- package/lib/table-virtuoso/InternalTable.d.ts +1 -1
- package/lib/table-virtuoso/InternalTable.js +3 -1
- package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
- package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
- package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
- package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
- package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
- package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
- package/lib/table-virtuoso/header/renderFilter.js +0 -4
- package/lib/table-virtuoso/hook/utils.d.ts +1 -1
- package/lib/table-virtuoso/style.js +1 -1
- package/lib/table-virtuoso/table/Grid.d.ts +1 -1
- package/lib/table-virtuoso/table/Grid.js +0 -24
- package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
- package/lib/table-virtuoso/table/TableContainer.js +0 -2
- package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
- package/lib/table-virtuoso/table/TableWrapper.js +3 -19
- package/lib/table-virtuoso/useContext.d.ts +1 -1
- package/package.json +1 -1
- package/es/table-component/hook/constant.d.ts +0 -73
- package/es/table-component/hook/constant.js +0 -240
- package/es/table-component/type.d.ts +0 -567
- package/es/table-component/type.js +0 -1
- package/es/table-virtuoso/hook/constant.d.ts +0 -73
- package/es/table-virtuoso/hook/constant.js +0 -240
- package/es/table-virtuoso/hook/convert.d.ts +0 -1
- package/es/table-virtuoso/hook/convert.js +0 -28
- package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
- package/es/table-virtuoso/hook/useColumns.js +0 -302
- package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
- package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
- package/es/table-virtuoso/style.scss +0 -1441
- package/es/table-virtuoso/type.d.ts +0 -0
- package/es/table-virtuoso/type.js +0 -785
- package/lib/table-component/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
- package/lib/table-component/type.d.ts +0 -567
- package/lib/table-component/type.js +0 -5
- package/lib/table-virtuoso/hook/constant.d.ts +0 -73
- package/lib/table-virtuoso/hook/constant.js +0 -247
- package/lib/table-virtuoso/hook/convert.d.ts +0 -1
- package/lib/table-virtuoso/hook/convert.js +0 -34
- package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
- package/lib/table-virtuoso/hook/useColumns.js +0 -315
- package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
- package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
- package/lib/table-virtuoso/style.scss +0 -1441
- package/lib/table-virtuoso/type.d.ts +0 -0
- package/lib/table-virtuoso/type.js +0 -786
|
@@ -84,7 +84,7 @@ const TableContainerEdit = props => {
|
|
|
84
84
|
isSelectionChange,
|
|
85
85
|
setIsSelectionChange,
|
|
86
86
|
// onContextMenu,
|
|
87
|
-
contextMenuItems
|
|
87
|
+
contextMenuItems,
|
|
88
88
|
setSorterChange,
|
|
89
89
|
setFilterChange,
|
|
90
90
|
onCellPaste,
|
|
@@ -124,7 +124,6 @@ const TableContainerEdit = props => {
|
|
|
124
124
|
contextMenuOpen,
|
|
125
125
|
contextMenuClick,
|
|
126
126
|
contextMenuHidden,
|
|
127
|
-
showDefaultContext,
|
|
128
127
|
commandSettings,
|
|
129
128
|
isDataTree,
|
|
130
129
|
onCellClick,
|
|
@@ -133,7 +132,8 @@ const TableContainerEdit = props => {
|
|
|
133
132
|
columnSizing,
|
|
134
133
|
columnSizingInfo,
|
|
135
134
|
rowClassName,
|
|
136
|
-
onRowStyles
|
|
135
|
+
onRowStyles,
|
|
136
|
+
dataSourceFilter
|
|
137
137
|
} = props;
|
|
138
138
|
const containerRef = _react.default.useRef(null);
|
|
139
139
|
const bottomToolbarRef = _react.default.useRef(null);
|
|
@@ -148,123 +148,6 @@ const TableContainerEdit = props => {
|
|
|
148
148
|
|
|
149
149
|
// const columnSizingState = table.getState().columnSizing;
|
|
150
150
|
|
|
151
|
-
const defaultContext = _react.default.useMemo(() => {
|
|
152
|
-
return [{
|
|
153
|
-
key: 'INSERT_BEFORE',
|
|
154
|
-
// label: 'Thêm dòng bên trên',
|
|
155
|
-
// label: `${t ? t(locale?.add_rows_before ?? 'Add rows before') : 'Add rows before'}`,
|
|
156
|
-
label: locale?.add_rows_before ?? 'Add rows before',
|
|
157
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
|
|
158
|
-
fontSize: 14
|
|
159
|
-
}),
|
|
160
|
-
children: [{
|
|
161
|
-
parentKey: 'INSERT_BEFORE',
|
|
162
|
-
key: 'INSERT_BEFORE_1',
|
|
163
|
-
label: locale?.add_1 ?? 'Add 1 rows',
|
|
164
|
-
row: 1
|
|
165
|
-
}, {
|
|
166
|
-
parentKey: 'INSERT_BEFORE',
|
|
167
|
-
key: 'INSERT_BEFORE_10',
|
|
168
|
-
label: locale?.add_10 ?? 'Add 10 rows',
|
|
169
|
-
row: 10
|
|
170
|
-
}, {
|
|
171
|
-
parentKey: 'INSERT_BEFORE',
|
|
172
|
-
key: 'INSERT_BEFORE_50',
|
|
173
|
-
label: locale?.add_50 ?? 'Add 50 rows',
|
|
174
|
-
row: 50
|
|
175
|
-
}, {
|
|
176
|
-
parentKey: 'INSERT_BEFORE',
|
|
177
|
-
key: 'INSERT_BEFORE_100',
|
|
178
|
-
label: locale?.add_100 ?? 'Add 100 rows',
|
|
179
|
-
row: 100
|
|
180
|
-
}, {
|
|
181
|
-
parentKey: 'INSERT_BEFORE',
|
|
182
|
-
key: 'INSERT_BEFORE_ADV',
|
|
183
|
-
label: locale?.custom ?? 'Custom'
|
|
184
|
-
}]
|
|
185
|
-
}, {
|
|
186
|
-
key: 'INSERT_AFTER',
|
|
187
|
-
label: locale?.add_rows_after ?? 'Add rows after',
|
|
188
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
|
|
189
|
-
fontSize: 14
|
|
190
|
-
}),
|
|
191
|
-
children: [{
|
|
192
|
-
parentKey: 'INSERT_AFTER',
|
|
193
|
-
key: 'INSERT_AFTER_1',
|
|
194
|
-
label: locale?.add_1 ?? 'Add 1 rows',
|
|
195
|
-
row: 1
|
|
196
|
-
}, {
|
|
197
|
-
parentKey: 'INSERT_AFTER',
|
|
198
|
-
key: 'INSERT_AFTER_10',
|
|
199
|
-
label: locale?.add_10 ?? 'Add 10 rows',
|
|
200
|
-
row: 10
|
|
201
|
-
}, {
|
|
202
|
-
parentKey: 'INSERT_AFTER',
|
|
203
|
-
key: 'INSERT_AFTER_50',
|
|
204
|
-
label: locale?.add_50 ?? 'Add 50 rows',
|
|
205
|
-
row: 50
|
|
206
|
-
}, {
|
|
207
|
-
parentKey: 'INSERT_AFTER',
|
|
208
|
-
key: 'INSERT_AFTER_100',
|
|
209
|
-
label: locale?.add_100 ?? 'Add 100 rows',
|
|
210
|
-
row: 100
|
|
211
|
-
}, {
|
|
212
|
-
parentKey: 'INSERT_AFTER',
|
|
213
|
-
key: 'INSERT_AFTER_ADV',
|
|
214
|
-
label: locale?.custom ?? 'Custom'
|
|
215
|
-
}]
|
|
216
|
-
}, {
|
|
217
|
-
key: 'INSERT_CHILDREN',
|
|
218
|
-
// label: 'Insert item children',
|
|
219
|
-
label: locale?.add_children ?? 'Add children',
|
|
220
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
|
|
221
|
-
fontSize: 14
|
|
222
|
-
})
|
|
223
|
-
// children: [
|
|
224
|
-
// {
|
|
225
|
-
// parentKey: 'INSERT_AFTER',
|
|
226
|
-
// key: 'INSERT_AFTER_1',
|
|
227
|
-
// label: 'Thêm 1 dòng',
|
|
228
|
-
// row: 1
|
|
229
|
-
// },
|
|
230
|
-
// {
|
|
231
|
-
// parentKey: 'INSERT_AFTER',
|
|
232
|
-
// key: 'INSERT_AFTER_10',
|
|
233
|
-
// label: 'Thêm 10 dòng',
|
|
234
|
-
// row: 10
|
|
235
|
-
// },
|
|
236
|
-
// {
|
|
237
|
-
// parentKey: 'INSERT_AFTER',
|
|
238
|
-
// key: 'INSERT_AFTER_50',
|
|
239
|
-
// label: 'Thêm 50 dòng',
|
|
240
|
-
// row: 50
|
|
241
|
-
// },
|
|
242
|
-
// {
|
|
243
|
-
// parentKey: 'INSERT_AFTER',
|
|
244
|
-
// key: 'INSERT_AFTER_100',
|
|
245
|
-
// label: 'Thêm 100 dòng',
|
|
246
|
-
// row: 100
|
|
247
|
-
// },
|
|
248
|
-
// {
|
|
249
|
-
// parentKey: 'INSERT_AFTER',
|
|
250
|
-
// key: 'INSERT_AFTER_ADV',
|
|
251
|
-
// label: 'Tùy chỉnh'
|
|
252
|
-
// }
|
|
253
|
-
// ]
|
|
254
|
-
}, {
|
|
255
|
-
key: 'DELETE_CONTENT',
|
|
256
|
-
label: locale?.delete_content ?? 'Delete content',
|
|
257
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Trash2, {
|
|
258
|
-
fontSize: 14
|
|
259
|
-
})
|
|
260
|
-
}, {
|
|
261
|
-
key: 'DELETE_ROWS',
|
|
262
|
-
label: locale?.delete_rows ?? 'Delete rows',
|
|
263
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Trash2, {
|
|
264
|
-
fontSize: 14
|
|
265
|
-
})
|
|
266
|
-
}];
|
|
267
|
-
}, [locale]);
|
|
268
151
|
const itemsAdd = _react.default.useMemo(() => {
|
|
269
152
|
return [{
|
|
270
153
|
key: '10',
|
|
@@ -277,13 +160,6 @@ const TableContainerEdit = props => {
|
|
|
277
160
|
label: `100 ${t ? t('rows') : 'rows'}`
|
|
278
161
|
}];
|
|
279
162
|
}, [t]);
|
|
280
|
-
const contextMenuItems = _react.default.useMemo(() => {
|
|
281
|
-
const a = showDefaultContext !== false ? [...defaultContext] : [];
|
|
282
|
-
const b = propsContext && propsContext.length > 0 ? [...propsContext, {
|
|
283
|
-
type: 'divider'
|
|
284
|
-
}] : [];
|
|
285
|
-
return [...b, ...a];
|
|
286
|
-
}, [defaultContext, propsContext, showDefaultContext]);
|
|
287
163
|
const [dataErrors, setDataErrors] = _react.default.useState([]);
|
|
288
164
|
_react.default.useEffect(() => {
|
|
289
165
|
if (validate && dataSource && dataSource.length) {
|
|
@@ -2033,7 +1909,8 @@ const TableContainerEdit = props => {
|
|
|
2033
1909
|
pagination,
|
|
2034
1910
|
rowClassName,
|
|
2035
1911
|
rowEditable,
|
|
2036
|
-
onRowStyles
|
|
1912
|
+
onRowStyles,
|
|
1913
|
+
dataSourceFilter
|
|
2037
1914
|
}
|
|
2038
1915
|
}, /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
|
|
2039
1916
|
contextMenuItems: contextMenuItems,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { EditType } from "rc-master-ui";
|
|
3
|
-
import type { ColumnTable, IFormat } from "
|
|
3
|
+
import type { ColumnTable, IFormat } from "../../grid-component/type";
|
|
4
4
|
interface EditableCellProps<DataType> extends React.HTMLAttributes<HTMLElement> {
|
|
5
5
|
t?: any;
|
|
6
6
|
dataIndex: string;
|
|
@@ -22,16 +22,6 @@ var _EditForm = require("../components/EditForm");
|
|
|
22
22
|
var _useContext = require("../useContext");
|
|
23
23
|
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); }
|
|
24
24
|
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; }
|
|
25
|
-
// import type {ColumnTable, ColumnSelectTable, IFormat} from "./type"
|
|
26
|
-
|
|
27
|
-
// import moment from "moment";
|
|
28
|
-
// import dayjs from "dayjs";
|
|
29
|
-
// import {TreeSelect} from "antd";
|
|
30
|
-
|
|
31
|
-
// import {TableContext} from "./useContext"
|
|
32
|
-
|
|
33
|
-
// import moment from "moment";
|
|
34
|
-
|
|
35
25
|
const {
|
|
36
26
|
SHOW_PARENT
|
|
37
27
|
} = _rcMasterUi.TreeSelect;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Cell, Table } from "@tanstack/react-table";
|
|
2
|
-
import type { CommandClick } from "
|
|
2
|
+
import type { CommandClick } from "../../grid-component/type";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
|
|
5
5
|
interface TableBodyCellProps<T> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Cell, Table } from "@tanstack/react-table";
|
|
2
|
-
import type { CommandClick } from "
|
|
2
|
+
import type { CommandClick } from "../../grid-component/type";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
|
|
5
5
|
interface TableBodyCellProps<T> {
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
|
|
2
2
|
import { type Column, type Row, type Table } from "@tanstack/react-table";
|
|
3
|
-
import type { CommandClick } from "
|
|
3
|
+
import type { CommandClick } from "../../grid-component/type";
|
|
4
4
|
import React from "react";
|
|
5
5
|
interface TableBodyRowProps<T> {
|
|
6
6
|
tableId: string;
|
|
@@ -18,8 +18,6 @@ var _button = _interopRequireDefault(require("rc-master-ui/es/button"));
|
|
|
18
18
|
var _InputControl = _interopRequireDefault(require("../InputControl/InputControl"));
|
|
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 InputControl from "../control/InputControl/InputControl";
|
|
22
|
-
|
|
23
21
|
const SelectStyle = exports.SelectStyle = _styledComponents.default.div.withConfig({
|
|
24
22
|
displayName: "SelectStyle",
|
|
25
23
|
componentId: "es-grid-template__sc-18plqpt-0"
|
|
@@ -15,10 +15,6 @@ var _grid = require("rc-master-ui/es/grid");
|
|
|
15
15
|
var _utils = require("../../hook/utils");
|
|
16
16
|
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); }
|
|
17
17
|
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; }
|
|
18
|
-
// import {isNullOrUndefined} from "../../hooks";
|
|
19
|
-
|
|
20
|
-
// import {isNullOrUndefined} from "../../../hooks"
|
|
21
|
-
|
|
22
18
|
const {
|
|
23
19
|
Text
|
|
24
20
|
} = _antd.Typography;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseOptionType, DefaultOptionType } from "rc-select/lib/Select";
|
|
3
3
|
import type { SelectProps } from "rc-master-ui/es/select";
|
|
4
|
-
import type { LoadOptionsArgs } from '
|
|
4
|
+
import type { LoadOptionsArgs } from '../../../grid-component/type';
|
|
5
5
|
export interface DebounceSelectProps<OptionType extends BaseOptionType = DefaultOptionType> extends SelectProps {
|
|
6
6
|
loadOptions?: (search: string, callback: (newOptions: OptionType[]) => void, args?: LoadOptionsArgs) => void;
|
|
7
7
|
debounceTimeout?: number;
|
|
@@ -11,8 +11,6 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
|
11
11
|
var _rcMasterUi = require("rc-master-ui");
|
|
12
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
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
|
-
// import type {LoadOptionsArgs} from "../type";
|
|
15
|
-
|
|
16
14
|
function AsyncSelect({
|
|
17
15
|
loadOptions,
|
|
18
16
|
debounceTimeout = 500,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseOptionType, DefaultOptionType } from "rc-select/lib/Select";
|
|
3
3
|
import type { TableSelectProps } from "rc-master-ui";
|
|
4
|
-
import type { LoadOptionsArgs } from '
|
|
4
|
+
import type { LoadOptionsArgs } from '../../../grid-component/type';
|
|
5
5
|
export interface DebounceSelectProps<OptionType extends BaseOptionType = DefaultOptionType> extends TableSelectProps {
|
|
6
6
|
loadOptions?: (search: string, callback: (newOptions: OptionType[]) => void, args?: LoadOptionsArgs) => void;
|
|
7
7
|
debounceTimeout?: number;
|
|
@@ -11,10 +11,6 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
|
11
11
|
var _rcMasterUi = require("rc-master-ui");
|
|
12
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
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
|
-
// import type {TableSelectProps} from "rc-master-ui/es/table-select"
|
|
15
|
-
|
|
16
|
-
// import type {LoadOptionsArgs} from "../type";
|
|
17
|
-
|
|
18
14
|
function AsyncTableSelect({
|
|
19
15
|
loadOptions,
|
|
20
16
|
debounceTimeout = 500,
|
|
@@ -137,7 +137,7 @@ const CheckboxFilter = props => {
|
|
|
137
137
|
}) => (filters || []).map((filter, index) => {
|
|
138
138
|
const key = String(filter.value);
|
|
139
139
|
const item = {
|
|
140
|
-
title: filter.
|
|
140
|
+
title: filter.label,
|
|
141
141
|
key: filter.value !== undefined ? key : String(index)
|
|
142
142
|
};
|
|
143
143
|
if (filter.children) {
|
|
@@ -222,7 +222,11 @@ const CheckboxFilter = props => {
|
|
|
222
222
|
return filterSearch(searchValue, getFilterData(node));
|
|
223
223
|
}
|
|
224
224
|
return searchValueMatched(searchValue, node.title);
|
|
225
|
-
} : undefined
|
|
225
|
+
} : undefined,
|
|
226
|
+
rootStyle: {
|
|
227
|
+
background: 'none',
|
|
228
|
+
boxShadow: 'none'
|
|
229
|
+
}
|
|
226
230
|
})));
|
|
227
231
|
}
|
|
228
232
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_FilterSearch.default, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { FilterSearchType, TableLocale } from "antd/es/table/interface";
|
|
3
|
-
import type { AnyObject } from '
|
|
3
|
+
import type { AnyObject } from '../../../grid-component/type';
|
|
4
4
|
interface FilterSearchProps<RecordType = AnyObject> {
|
|
5
5
|
value: string;
|
|
6
6
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -10,7 +10,7 @@ var _SearchOutlined = _interopRequireDefault(require("@ant-design/icons/SearchOu
|
|
|
10
10
|
var _rcMasterUi = require("rc-master-ui");
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
-
// import type {AnyObject} from "
|
|
13
|
+
// import type {AnyObject} from "./../grid-component/type"
|
|
14
14
|
|
|
15
15
|
const FilterSearch = props => {
|
|
16
16
|
const {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { KeyboardEventHandler } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { IFormat } from "../../../grid-component/type";
|
|
3
4
|
type Props = {
|
|
4
5
|
t?: any;
|
|
5
6
|
format?: IFormat;
|
|
@@ -10,9 +10,6 @@ var _rcMasterUi = require("rc-master-ui");
|
|
|
10
10
|
var _utils = require("../../hook/utils");
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
-
// import type {IFormat} from "../type"
|
|
14
|
-
// import {checkDecimalSeparator, checkThousandSeparator} from "../hooks"
|
|
15
|
-
|
|
16
13
|
const NumberInput = props => {
|
|
17
14
|
const {
|
|
18
15
|
t,
|
|
@@ -22,11 +19,6 @@ const NumberInput = props => {
|
|
|
22
19
|
onPressEnter
|
|
23
20
|
} = props;
|
|
24
21
|
const values = _react.default.useMemo(() => [value], [value]);
|
|
25
|
-
|
|
26
|
-
// const [values, setValues] = React.useState<any[]>(() =>
|
|
27
|
-
// mergedValues,
|
|
28
|
-
// );
|
|
29
|
-
|
|
30
22
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNumericComponent.NumericFormat, {
|
|
31
23
|
value: values[0] ?? ''
|
|
32
24
|
// value={min}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { KeyboardEventHandler } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { IFormat } from "../../../grid-component/type";
|
|
3
4
|
type Props = {
|
|
4
5
|
t?: any;
|
|
5
6
|
format?: IFormat;
|
|
@@ -10,9 +10,6 @@ var _rcMasterUi = require("rc-master-ui");
|
|
|
10
10
|
var _utils = require("../../hook/utils");
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
-
// import type {IFormat} from "../type"
|
|
14
|
-
// import {checkDecimalSeparator, checkThousandSeparator} from "../hooks"
|
|
15
|
-
|
|
16
13
|
const NumberRange = props => {
|
|
17
14
|
const {
|
|
18
15
|
t,
|
|
@@ -8,34 +8,15 @@ exports.default = void 0;
|
|
|
8
8
|
var _TableFooterCell = _interopRequireDefault(require("./TableFooterCell"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _useContext = require("../useContext");
|
|
11
|
-
// import type { Virtualizer } from "@tanstack/react-virtual";
|
|
12
|
-
// import type { Person } from "../makeData";
|
|
13
|
-
|
|
14
|
-
// import type { Person } from "../../tanstack-table/makeData";
|
|
15
|
-
// import TableHeadCell from "./TableHeadCell";
|
|
16
|
-
|
|
17
11
|
const TableFooterRow = ({
|
|
18
12
|
table,
|
|
19
|
-
// columnVirtualizer,
|
|
20
13
|
headerGroup
|
|
21
|
-
// virtualPaddingLeft,
|
|
22
|
-
// virtualPaddingRight,
|
|
23
|
-
// fixedLeftColumns,
|
|
24
|
-
// fixedRightColumns,
|
|
25
|
-
// virtualColumns,
|
|
26
|
-
// columnVirtualizer
|
|
27
14
|
}) => {
|
|
28
|
-
// const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
29
|
-
|
|
30
|
-
// const a = table.getVisibleFlatColumns()
|
|
31
15
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
32
16
|
const {
|
|
33
17
|
onRowFooterStyles
|
|
34
18
|
} = _react.default.useContext(_useContext.TableContext);
|
|
35
19
|
const rowStyles = typeof onRowFooterStyles === 'function' ? onRowFooterStyles() : onRowFooterStyles;
|
|
36
|
-
|
|
37
|
-
// const
|
|
38
|
-
|
|
39
20
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
21
|
key: headerGroup.id,
|
|
41
22
|
style: {
|
|
@@ -48,11 +29,8 @@ const TableFooterRow = ({
|
|
|
48
29
|
className: "ui-rc-grid-footer-row"
|
|
49
30
|
}, visibleColumns.map(header => {
|
|
50
31
|
return /*#__PURE__*/_react.default.createElement(_TableFooterCell.default, {
|
|
51
|
-
key: header.id
|
|
52
|
-
// header={header as any}
|
|
53
|
-
,
|
|
32
|
+
key: header.id,
|
|
54
33
|
column: header
|
|
55
|
-
// columnVirtualizer={columnVirtualizer}
|
|
56
34
|
});
|
|
57
35
|
}));
|
|
58
36
|
};
|
|
@@ -11,27 +11,9 @@ var _TableHeadCell = _interopRequireDefault(require("./TableHeadCell2"));
|
|
|
11
11
|
var _TableHeadGroupCell = _interopRequireDefault(require("./TableHeadGroupCell"));
|
|
12
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
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
|
-
// import TableHeadRow from './TableHeadRow'
|
|
15
|
-
|
|
16
|
-
// import { getCommonPinningStyles } from '../hook/utils'
|
|
17
|
-
|
|
18
|
-
// const getVisibleChildCount = <T,>(column: Column<T>): number => {
|
|
19
|
-
// if (!column.columns?.length) return 0;
|
|
20
|
-
|
|
21
|
-
// return column.columns.reduce((count: number, col: Column<T>) => {
|
|
22
|
-
// const selfCount = col.getIsVisible() ? 1 : 0;
|
|
23
|
-
// const childrenCount = getVisibleChildCount(col);
|
|
24
|
-
// return count + selfCount + (childrenCount ? childrenCount - 1 : childrenCount);
|
|
25
|
-
// }, 0);
|
|
26
|
-
// }
|
|
27
|
-
|
|
28
14
|
const TableHead = ({
|
|
29
15
|
columnVirtualizer,
|
|
30
16
|
table
|
|
31
|
-
// virtualPaddingLeft,
|
|
32
|
-
// virtualPaddingRight,
|
|
33
|
-
// fixedLeftColumns,
|
|
34
|
-
// fixedRightColumns
|
|
35
17
|
}) => {
|
|
36
18
|
const {
|
|
37
19
|
prefix,
|
|
@@ -39,7 +21,6 @@ const TableHead = ({
|
|
|
39
21
|
} = (0, _react.useContext)(_useContext.TableContext);
|
|
40
22
|
const headerGroups = table.getFlatHeaders();
|
|
41
23
|
const leafColumns = table.getVisibleFlatColumns();
|
|
42
|
-
// const leafColumns11 = table.getIsAllColumnsVisible();
|
|
43
24
|
const headerDepth = table.getHeaderGroups().length;
|
|
44
25
|
const rowStyles = typeof onRowHeaderStyles === 'function' ? onRowHeaderStyles() : onRowHeaderStyles;
|
|
45
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -50,8 +31,6 @@ const TableHead = ({
|
|
|
50
31
|
position: 'sticky',
|
|
51
32
|
top: 0,
|
|
52
33
|
zIndex: 1,
|
|
53
|
-
// gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
|
|
54
|
-
// gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
|
|
55
34
|
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
|
|
56
35
|
}
|
|
57
36
|
}, leafColumns.map(column => {
|
|
@@ -11,32 +11,18 @@ 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,
|
|
33
24
|
getPopupContainer,
|
|
34
25
|
table
|
|
35
|
-
// t,
|
|
36
|
-
// columnVirtualizer,
|
|
37
|
-
// rowHeaderVirtualizer,
|
|
38
|
-
// colSpan,
|
|
39
|
-
// rowSpan
|
|
40
26
|
} = props;
|
|
41
27
|
const {
|
|
42
28
|
t,
|
|
@@ -149,7 +135,7 @@ const TableHeadCell = props => {
|
|
|
149
135
|
dropdownRender: () => {
|
|
150
136
|
const type = (0, _utils.getTypeFilter)(originalColumn);
|
|
151
137
|
const operatorValue = header.column.getFilterOperator() ?? (0, _utils.getDefaultOperator)(originalColumn);
|
|
152
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
138
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
153
139
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
154
140
|
// className='ui-rc-table-filter-dropdown'
|
|
155
141
|
|
|
@@ -163,7 +149,7 @@ const TableHeadCell = props => {
|
|
|
163
149
|
}, /*#__PURE__*/_react.default.createElement("div", null), column.meta?.showOperator !== false && column.meta?.typeFilter !== 'DateRange' && column.meta?.typeFilter !== 'NumberRange' && /*#__PURE__*/_react.default.createElement("div", {
|
|
164
150
|
className: 'mb-1'
|
|
165
151
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
166
|
-
options: (0,
|
|
152
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
167
153
|
style: {
|
|
168
154
|
width: '100%',
|
|
169
155
|
marginBottom: 8
|
|
@@ -271,7 +257,7 @@ const TableHeadCell = props => {
|
|
|
271
257
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
272
258
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
273
259
|
})
|
|
274
|
-
}, cellContent)), !
|
|
260
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(header.column.id) && header.subHeaders.length < 2 && /*#__PURE__*/_react.default.createElement("span", {
|
|
275
261
|
className: "ui-rc-header-trigger"
|
|
276
262
|
}, header.column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
277
263
|
style: {
|