es-grid-template 1.8.71 → 1.8.72
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.js +2 -1
- package/es/group-component/ColumnsChoose.d.ts +13 -0
- package/es/group-component/ColumnsChoose.js +211 -0
- package/es/group-component/ColumnsGroup/ColumnsGroup.d.ts +12 -0
- package/es/group-component/ColumnsGroup/ColumnsGroup.js +230 -0
- package/es/group-component/ColumnsGroup/index.d.ts +1 -0
- package/es/group-component/ColumnsGroup/index.js +1 -0
- package/es/group-component/ContextMenu.d.ts +19 -0
- package/es/group-component/ContextMenu.js +74 -0
- package/es/group-component/InternalTable.d.ts +8 -0
- package/es/group-component/InternalTable.js +224 -0
- package/es/group-component/TableContainer.d.ts +49 -0
- package/es/group-component/TableContainer.js +375 -0
- package/es/group-component/TableContainerEdit.d.ts +48 -0
- package/es/group-component/TableContainerEdit.js +2068 -0
- package/es/group-component/body/EditableCell.d.ts +16 -0
- package/es/group-component/body/EditableCell.js +1066 -0
- package/es/group-component/body/TableBody.d.ts +14 -0
- package/es/group-component/body/TableBody.js +82 -0
- package/es/group-component/body/TableBodyCell.d.ts +12 -0
- package/es/group-component/body/TableBodyCell.js +587 -0
- package/es/group-component/body/TableBodyCellEdit.d.ts +17 -0
- package/es/group-component/body/TableBodyCellEdit.js +1398 -0
- package/es/group-component/body/TableBodyCellEmpty.d.ts +12 -0
- package/es/group-component/body/TableBodyCellEmpty.js +149 -0
- package/es/group-component/body/TableBodyRow.d.ts +21 -0
- package/es/group-component/body/TableBodyRow.js +199 -0
- package/es/group-component/body/TableBodyRowGroupCell.d.ts +12 -0
- package/es/group-component/body/TableBodyRowGroupCell.js +567 -0
- package/es/group-component/components/ControlCheckbox.d.ts +13 -0
- package/es/group-component/components/ControlCheckbox.js +84 -0
- package/es/group-component/components/EditForm/EditForm.d.ts +27 -0
- package/es/group-component/components/EditForm/EditForm.js +394 -0
- package/es/group-component/components/EditForm/index.d.ts +1 -0
- package/es/group-component/components/EditForm/index.js +1 -0
- package/es/group-component/components/InputControl/InputControl.d.ts +27 -0
- package/es/group-component/components/InputControl/InputControl.js +118 -0
- package/es/group-component/components/InputControl/index.d.ts +1 -0
- package/es/group-component/components/InputControl/index.js +1 -0
- package/es/group-component/components/async-select/index.d.ts +11 -0
- package/es/group-component/components/async-select/index.js +38 -0
- package/es/group-component/components/async-table-select/index.d.ts +11 -0
- package/es/group-component/components/async-table-select/index.js +40 -0
- package/es/group-component/components/checkbox-control/index.d.ts +13 -0
- package/es/group-component/components/checkbox-control/index.js +40 -0
- package/es/group-component/components/checkbox-filter/CheckboxFilter.d.ts +18 -0
- package/es/group-component/components/checkbox-filter/CheckboxFilter.js +258 -0
- package/es/group-component/components/checkbox-filter/FilterSearch.d.ts +12 -0
- package/es/group-component/components/checkbox-filter/FilterSearch.js +36 -0
- package/es/group-component/components/command/Command.d.ts +10 -0
- package/es/group-component/components/command/Command.js +35 -0
- package/es/group-component/components/number/index.d.ts +12 -0
- package/es/group-component/components/number/index.js +42 -0
- package/es/group-component/components/number-range/index.d.ts +13 -0
- package/es/group-component/components/number-range/index.js +79 -0
- package/es/group-component/features/operator.d.ts +24 -0
- package/es/group-component/features/operator.js +62 -0
- package/es/group-component/footer/TableFooter.d.ts +7 -0
- package/es/group-component/footer/TableFooter.js +34 -0
- package/es/group-component/footer/TableFooterCell.d.ts +7 -0
- package/es/group-component/footer/TableFooterCell.js +66 -0
- package/es/group-component/footer/TableFooterRow.d.ts +8 -0
- package/es/group-component/footer/TableFooterRow.js +30 -0
- package/es/group-component/header/TableHead.d.ts +15 -0
- package/es/group-component/header/TableHead.js +98 -0
- package/es/group-component/header/TableHeadCell.d.ts +15 -0
- package/es/group-component/header/TableHeadCell.js +310 -0
- package/es/group-component/header/TableHeadCell2.d.ts +17 -0
- package/es/group-component/header/TableHeadCell2.js +321 -0
- package/es/group-component/header/TableHeadGroupCell.d.ts +17 -0
- package/es/group-component/header/TableHeadGroupCell.js +94 -0
- package/es/group-component/header/TableHeadRow.d.ts +15 -0
- package/es/group-component/header/TableHeadRow.js +52 -0
- package/es/group-component/header/renderFilter.d.ts +20 -0
- package/es/group-component/header/renderFilter.js +291 -0
- package/es/group-component/hook/convert.d.ts +1 -0
- package/es/group-component/hook/convert.js +28 -0
- package/es/group-component/hook/useColumns.d.ts +28 -0
- package/es/group-component/hook/useColumns.js +306 -0
- package/es/group-component/hook/useFilterOperator.d.ts +7 -0
- package/es/group-component/hook/useFilterOperator.js +33 -0
- package/es/group-component/hook/utils.d.ts +220 -0
- package/es/group-component/hook/utils.js +2340 -0
- package/es/group-component/index.d.ts +2 -0
- package/es/group-component/index.js +2 -0
- package/es/group-component/style.d.ts +22 -0
- package/es/group-component/style.js +48 -0
- package/es/group-component/style.scss +1438 -0
- package/es/group-component/table/Grid.d.ts +33 -0
- package/es/group-component/table/Grid.js +438 -0
- package/es/group-component/table/TableWrapper.d.ts +33 -0
- package/es/group-component/table/TableWrapper.js +250 -0
- package/es/group-component/useContext.d.ts +100 -0
- package/es/group-component/useContext.js +21 -0
- package/es/table-component/InternalTable.js +6 -1
- package/es/table-component/TableContainer.js +4 -2
- package/es/table-component/body/TableBodyCell.js +49 -40
- package/es/table-component/body/TableBodyRow.js +4 -1
- package/es/table-component/hook/utils.d.ts +1 -0
- package/es/table-component/hook/utils.js +15 -7
- package/es/table-component/style.js +1 -1
- package/es/table-component/table/Grid.js +3 -0
- package/es/table-component/useContext.d.ts +5 -0
- package/es/table-virtuoso/InternalTable.js +2 -2
- package/es/table-virtuoso/body/TableBodyCell.js +2 -7
- package/es/table-virtuoso/body/TableBodyCellRowGroup.d.ts +14 -0
- package/es/table-virtuoso/body/TableBodyCellRowGroup.js +196 -0
- package/es/table-virtuoso/body/TableBodyRow.d.ts +1 -1
- package/es/table-virtuoso/body/TableBodyRow.js +43 -1
- package/es/table-virtuoso/hook/utils.d.ts +1 -0
- package/es/table-virtuoso/hook/utils.js +29 -0
- package/es/table-virtuoso/style.js +3 -1
- package/es/table-virtuoso/table/Grid.js +2 -2
- package/es/table-virtuoso/table/TableWrapper.d.ts +7 -1
- package/es/table-virtuoso/table/TableWrapper.js +24 -5
- package/es/table-virtuoso/useContext.d.ts +6 -3
- package/es/table-virtuoso/useContext.js +18 -0
- package/lib/grid-component/TempTable.js +2 -1
- package/lib/group-component/ColumnsChoose.d.ts +13 -0
- package/lib/group-component/ColumnsChoose.js +221 -0
- package/lib/group-component/ColumnsGroup/ColumnsGroup.d.ts +12 -0
- package/lib/group-component/ColumnsGroup/ColumnsGroup.js +241 -0
- package/lib/group-component/ColumnsGroup/index.d.ts +1 -0
- package/lib/group-component/ColumnsGroup/index.js +16 -0
- package/lib/group-component/ContextMenu.d.ts +19 -0
- package/lib/group-component/ContextMenu.js +83 -0
- package/lib/group-component/InternalTable.d.ts +8 -0
- package/lib/group-component/InternalTable.js +233 -0
- package/lib/group-component/TableContainer.d.ts +49 -0
- package/lib/group-component/TableContainer.js +382 -0
- package/lib/group-component/TableContainerEdit.d.ts +48 -0
- package/lib/group-component/TableContainerEdit.js +2075 -0
- package/lib/group-component/body/EditableCell.d.ts +16 -0
- package/lib/group-component/body/EditableCell.js +1075 -0
- package/lib/group-component/body/TableBody.d.ts +14 -0
- package/lib/group-component/body/TableBody.js +91 -0
- package/lib/group-component/body/TableBodyCell.d.ts +12 -0
- package/lib/group-component/body/TableBodyCell.js +595 -0
- package/lib/group-component/body/TableBodyCellEdit.d.ts +17 -0
- package/lib/group-component/body/TableBodyCellEdit.js +1405 -0
- package/lib/group-component/body/TableBodyCellEmpty.d.ts +12 -0
- package/lib/group-component/body/TableBodyCellEmpty.js +156 -0
- package/lib/group-component/body/TableBodyRow.d.ts +21 -0
- package/lib/group-component/body/TableBodyRow.js +206 -0
- package/lib/group-component/body/TableBodyRowGroupCell.d.ts +12 -0
- package/lib/group-component/body/TableBodyRowGroupCell.js +575 -0
- package/lib/group-component/components/ControlCheckbox.d.ts +13 -0
- package/lib/group-component/components/ControlCheckbox.js +92 -0
- package/lib/group-component/components/EditForm/EditForm.d.ts +27 -0
- package/lib/group-component/components/EditForm/EditForm.js +404 -0
- package/lib/group-component/components/EditForm/index.d.ts +1 -0
- package/lib/group-component/components/EditForm/index.js +16 -0
- package/lib/group-component/components/InputControl/InputControl.d.ts +27 -0
- package/lib/group-component/components/InputControl/InputControl.js +127 -0
- package/lib/group-component/components/InputControl/index.d.ts +1 -0
- package/lib/group-component/components/InputControl/index.js +16 -0
- package/lib/group-component/components/async-select/index.d.ts +11 -0
- package/lib/group-component/components/async-select/index.js +47 -0
- package/lib/group-component/components/async-table-select/index.d.ts +11 -0
- package/lib/group-component/components/async-table-select/index.js +49 -0
- package/lib/group-component/components/checkbox-control/index.d.ts +13 -0
- package/lib/group-component/components/checkbox-control/index.js +48 -0
- package/lib/group-component/components/checkbox-filter/CheckboxFilter.d.ts +18 -0
- package/lib/group-component/components/checkbox-filter/CheckboxFilter.js +267 -0
- package/lib/group-component/components/checkbox-filter/FilterSearch.d.ts +12 -0
- package/lib/group-component/components/checkbox-filter/FilterSearch.js +44 -0
- package/lib/group-component/components/command/Command.d.ts +10 -0
- package/lib/group-component/components/command/Command.js +44 -0
- package/lib/group-component/components/number/index.d.ts +12 -0
- package/lib/group-component/components/number/index.js +50 -0
- package/lib/group-component/components/number-range/index.d.ts +13 -0
- package/lib/group-component/components/number-range/index.js +87 -0
- package/lib/group-component/features/operator.d.ts +24 -0
- package/lib/group-component/features/operator.js +67 -0
- package/lib/group-component/footer/TableFooter.d.ts +7 -0
- package/lib/group-component/footer/TableFooter.js +44 -0
- package/lib/group-component/footer/TableFooterCell.d.ts +7 -0
- package/lib/group-component/footer/TableFooterCell.js +75 -0
- package/lib/group-component/footer/TableFooterRow.d.ts +8 -0
- package/lib/group-component/footer/TableFooterRow.js +37 -0
- package/lib/group-component/header/TableHead.d.ts +15 -0
- package/lib/group-component/header/TableHead.js +107 -0
- package/lib/group-component/header/TableHeadCell.d.ts +15 -0
- package/lib/group-component/header/TableHeadCell.js +319 -0
- package/lib/group-component/header/TableHeadCell2.d.ts +17 -0
- package/lib/group-component/header/TableHeadCell2.js +330 -0
- package/lib/group-component/header/TableHeadGroupCell.d.ts +17 -0
- package/lib/group-component/header/TableHeadGroupCell.js +103 -0
- package/lib/group-component/header/TableHeadRow.d.ts +15 -0
- package/lib/group-component/header/TableHeadRow.js +59 -0
- package/lib/group-component/header/renderFilter.d.ts +20 -0
- package/lib/group-component/header/renderFilter.js +301 -0
- package/lib/group-component/hook/convert.d.ts +1 -0
- package/lib/group-component/hook/convert.js +34 -0
- package/lib/group-component/hook/useColumns.d.ts +28 -0
- package/lib/group-component/hook/useColumns.js +318 -0
- package/lib/group-component/hook/useFilterOperator.d.ts +7 -0
- package/lib/group-component/hook/useFilterOperator.js +40 -0
- package/lib/group-component/hook/utils.d.ts +220 -0
- package/lib/group-component/hook/utils.js +2468 -0
- package/lib/group-component/index.d.ts +2 -0
- package/lib/group-component/index.js +9 -0
- package/lib/group-component/style.d.ts +22 -0
- package/lib/group-component/style.js +55 -0
- package/lib/group-component/style.scss +1438 -0
- package/lib/group-component/table/Grid.d.ts +33 -0
- package/lib/group-component/table/Grid.js +443 -0
- package/lib/group-component/table/TableWrapper.d.ts +33 -0
- package/lib/group-component/table/TableWrapper.js +259 -0
- package/lib/group-component/useContext.d.ts +100 -0
- package/lib/group-component/useContext.js +27 -0
- package/lib/table-component/InternalTable.js +6 -1
- package/lib/table-component/TableContainer.js +4 -2
- package/lib/table-component/body/TableBodyCell.js +49 -40
- package/lib/table-component/body/TableBodyRow.js +4 -1
- package/lib/table-component/hook/utils.d.ts +1 -0
- package/lib/table-component/hook/utils.js +16 -7
- package/lib/table-component/style.js +1 -1
- package/lib/table-component/table/Grid.js +3 -0
- package/lib/table-component/useContext.d.ts +5 -0
- package/lib/table-virtuoso/InternalTable.js +2 -2
- package/lib/table-virtuoso/body/TableBodyCell.js +2 -7
- package/lib/table-virtuoso/body/TableBodyCellRowGroup.d.ts +14 -0
- package/lib/table-virtuoso/body/TableBodyCellRowGroup.js +203 -0
- package/lib/table-virtuoso/body/TableBodyRow.d.ts +1 -1
- package/lib/table-virtuoso/body/TableBodyRow.js +43 -1
- package/lib/table-virtuoso/hook/utils.d.ts +1 -0
- package/lib/table-virtuoso/hook/utils.js +32 -1
- package/lib/table-virtuoso/style.js +3 -1
- package/lib/table-virtuoso/table/Grid.js +2 -2
- package/lib/table-virtuoso/table/TableWrapper.d.ts +7 -1
- package/lib/table-virtuoso/table/TableWrapper.js +24 -5
- package/lib/table-virtuoso/useContext.d.ts +6 -3
- package/lib/table-virtuoso/useContext.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.convertToTanStackColumns = convertToTanStackColumns;
|
|
8
|
+
exports.toggleRowSelection = exports.renderValueCell = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _ControlCheckbox = _interopRequireDefault(require("../components/ControlCheckbox"));
|
|
11
|
+
var _utils = require("./utils");
|
|
12
|
+
var _reactNumericComponent = require("react-numeric-component");
|
|
13
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
const renderValueCell = (column, value, record, rowIndex, colIndex, format, editAble) => {
|
|
18
|
+
switch (column?.type) {
|
|
19
|
+
case 'number':
|
|
20
|
+
const colFormat = typeof column.format === 'function' ? column.format(record) : column.format;
|
|
21
|
+
const cellFormat = (0, _utils.getFormat)(colFormat, format);
|
|
22
|
+
const thousandSeparator = cellFormat?.thousandSeparator;
|
|
23
|
+
const decimalSeparator = cellFormat?.decimalSeparator;
|
|
24
|
+
const dec = cellFormat?.decimalScale;
|
|
25
|
+
|
|
26
|
+
// const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? parseFloat(Number(value).toFixed(dec)).toString() : value.toString()) : '0'
|
|
27
|
+
|
|
28
|
+
const tmpval = typeof value === 'string' ? Number(value) : value;
|
|
29
|
+
const numericFormatProps = {
|
|
30
|
+
thousandSeparator: (0, _utils.checkThousandSeparator)(thousandSeparator, decimalSeparator),
|
|
31
|
+
decimalSeparator: (0, _utils.checkDecimalSeparator)(thousandSeparator, decimalSeparator),
|
|
32
|
+
allowNegative: cellFormat?.allowNegative ?? true,
|
|
33
|
+
prefix: cellFormat?.prefix,
|
|
34
|
+
suffix: cellFormat?.suffix,
|
|
35
|
+
decimalScale: dec,
|
|
36
|
+
fixedDecimalScale: cellFormat?.fixedDecimalScale ?? false
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// if ( typeof value === "string") {
|
|
40
|
+
// const ttt = removeNumericFormat(value, undefined, numericFormatProps )
|
|
41
|
+
//
|
|
42
|
+
// }
|
|
43
|
+
|
|
44
|
+
const contentNumber = !(0, _utils.isEmpty)(value) ? dec || dec === 0 ? parseFloat(tmpval.toFixed(dec)).toString() : tmpval.toString() : '0';
|
|
45
|
+
// const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? tmpval.toString() : tmpval.toString()) : '0'
|
|
46
|
+
|
|
47
|
+
return !(0, _utils.isEmpty)(contentNumber) ? (0, _reactNumericComponent.numericFormatter)(contentNumber, numericFormatProps) : '';
|
|
48
|
+
case 'date':
|
|
49
|
+
return value ? (0, _dayjs.default)(value).format(format?.dateFormat ?? 'DD/MM/YYYY') : '';
|
|
50
|
+
case 'time':
|
|
51
|
+
return value ? value : '';
|
|
52
|
+
case 'year':
|
|
53
|
+
const year = value ? (0, _moment.default)(value).format('yyyy') : '';
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, year);
|
|
55
|
+
case 'datetime':
|
|
56
|
+
return value ? (0, _moment.default)(value).format(format?.datetimeFormat ?? 'DD/MM/YYYY HH:mm') : '';
|
|
57
|
+
case 'boolean':
|
|
58
|
+
return value ? 'true' : 'false';
|
|
59
|
+
case 'color':
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: 'w-100 h-100',
|
|
62
|
+
style: {
|
|
63
|
+
backgroundColor: (0, _utils.isColor)(value) ? value : '#fff',
|
|
64
|
+
border: '1px solid #f0f0f0',
|
|
65
|
+
height: '100%',
|
|
66
|
+
minHeight: 20
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
case 'checkbox':
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_ControlCheckbox.default, {
|
|
71
|
+
column: column,
|
|
72
|
+
record: record,
|
|
73
|
+
rowIndex: rowIndex,
|
|
74
|
+
colIndex: colIndex,
|
|
75
|
+
checked: !!value,
|
|
76
|
+
checkValue: value,
|
|
77
|
+
editAble: editAble
|
|
78
|
+
});
|
|
79
|
+
case 'file':
|
|
80
|
+
const nameFile = typeof value === 'object' && !Array.isArray(value) ? value.name : Array.isArray(value) ? value.map(it => typeof it === 'object' ? it.name : it).filter(Boolean).join(", ") : '';
|
|
81
|
+
return value ? nameFile : '';
|
|
82
|
+
default:
|
|
83
|
+
if (Array.isArray(value)) {
|
|
84
|
+
return value.join(', ');
|
|
85
|
+
}
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.renderValueCell = renderValueCell;
|
|
90
|
+
function convertToTanStackColumns({
|
|
91
|
+
t,
|
|
92
|
+
columns,
|
|
93
|
+
// expanded,
|
|
94
|
+
// setExpanded,
|
|
95
|
+
// expandable,
|
|
96
|
+
format,
|
|
97
|
+
editAble
|
|
98
|
+
}) {
|
|
99
|
+
// const expandIconColumnIndex = expandable?.expandIconColumnIndex ?? 0
|
|
100
|
+
|
|
101
|
+
return (0, _utils.sortByType)(columns).map(col => {
|
|
102
|
+
const {
|
|
103
|
+
headerText,
|
|
104
|
+
headerTemplate,
|
|
105
|
+
field,
|
|
106
|
+
width,
|
|
107
|
+
allowResizing,
|
|
108
|
+
minWidth,
|
|
109
|
+
template,
|
|
110
|
+
allowSortering,
|
|
111
|
+
allowFiltering
|
|
112
|
+
} = col;
|
|
113
|
+
const {
|
|
114
|
+
children,
|
|
115
|
+
...restProps
|
|
116
|
+
} = col;
|
|
117
|
+
const newCol = {
|
|
118
|
+
header: () => {
|
|
119
|
+
if (headerTemplate) {
|
|
120
|
+
if (typeof headerTemplate === 'function') {
|
|
121
|
+
return headerTemplate(col);
|
|
122
|
+
} else {
|
|
123
|
+
return headerTemplate;
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
return t ? t(headerText) : headerText;
|
|
127
|
+
// return field
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
cell: props => {
|
|
131
|
+
const {
|
|
132
|
+
getValue,
|
|
133
|
+
cell
|
|
134
|
+
} = props;
|
|
135
|
+
const cellValue = props.renderValue() ?? null;
|
|
136
|
+
const record = cell.row.original;
|
|
137
|
+
const colIndex = cell.column.getIndex();
|
|
138
|
+
const rowIndex = cell.row.index;
|
|
139
|
+
if (template) {
|
|
140
|
+
if (typeof template === 'function') {
|
|
141
|
+
return template({
|
|
142
|
+
field: field ?? '',
|
|
143
|
+
index: cell.row.index,
|
|
144
|
+
rowData: cell.row.original,
|
|
145
|
+
value: getValue()
|
|
146
|
+
});
|
|
147
|
+
} else {
|
|
148
|
+
return template;
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, renderValueCell(col, cellValue, record, rowIndex, colIndex, format, editAble));
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
enableResizing: allowResizing !== false,
|
|
155
|
+
// enableHiding: false,
|
|
156
|
+
// enableResizing: true,
|
|
157
|
+
id: field,
|
|
158
|
+
size: width,
|
|
159
|
+
accessorKey: field,
|
|
160
|
+
sortDescFirst: false,
|
|
161
|
+
minSize: minWidth,
|
|
162
|
+
// maxSize: maxWidth,
|
|
163
|
+
enableSorting: allowSortering !== false,
|
|
164
|
+
// enableSorting: false,
|
|
165
|
+
// enableColumnFilter: allowFiltering !== false && !nonActionColumn.includes(field)
|
|
166
|
+
enableColumnFilter: allowFiltering !== false
|
|
167
|
+
};
|
|
168
|
+
if (children) {
|
|
169
|
+
newCol.size = undefined;
|
|
170
|
+
// @ts-ignore
|
|
171
|
+
newCol.columns = convertToTanStackColumns({
|
|
172
|
+
columns: children,
|
|
173
|
+
editAble,
|
|
174
|
+
format,
|
|
175
|
+
t
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const meta = {
|
|
179
|
+
...restProps
|
|
180
|
+
};
|
|
181
|
+
if (Object.keys(meta).length > 0) {
|
|
182
|
+
newCol.meta = meta;
|
|
183
|
+
}
|
|
184
|
+
return newCol;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
const toggleRowSelection = props => {
|
|
188
|
+
const {
|
|
189
|
+
selectionSettings,
|
|
190
|
+
cell,
|
|
191
|
+
isSelectionChange,
|
|
192
|
+
e,
|
|
193
|
+
setIsSelectionChange
|
|
194
|
+
} = props;
|
|
195
|
+
const {
|
|
196
|
+
row
|
|
197
|
+
} = cell;
|
|
198
|
+
const {
|
|
199
|
+
rowsData
|
|
200
|
+
} = isSelectionChange ?? {};
|
|
201
|
+
const prevSelected = rowsData && rowsData.length > 0 ? [...rowsData] : [];
|
|
202
|
+
if (selectionSettings?.checkStrictly || selectionSettings?.type === 'single') {
|
|
203
|
+
row.getToggleSelectedHandler()(e);
|
|
204
|
+
if (row.getIsSelected()) {
|
|
205
|
+
// đã chọn
|
|
206
|
+
|
|
207
|
+
// xóa row ra list selected
|
|
208
|
+
const newRowsSelected = prevSelected.filter(it => it.id !== row.id);
|
|
209
|
+
setIsSelectionChange({
|
|
210
|
+
isChange: true,
|
|
211
|
+
type: 'rowSelected',
|
|
212
|
+
rowData: row.original,
|
|
213
|
+
rowsData: newRowsSelected ?? []
|
|
214
|
+
});
|
|
215
|
+
} else {
|
|
216
|
+
// chưa selected
|
|
217
|
+
|
|
218
|
+
const checkedRows = [...prevSelected, row];
|
|
219
|
+
setIsSelectionChange({
|
|
220
|
+
isChange: true,
|
|
221
|
+
type: 'rowSelected',
|
|
222
|
+
rowData: row.original,
|
|
223
|
+
rowsData: selectionSettings?.type === 'single' ? [row] : checkedRows
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (row.subRows && row.subRows.length > 0) {
|
|
229
|
+
// click vào row cha
|
|
230
|
+
|
|
231
|
+
const allChild = (0, _utils.getAllChildren)(row);
|
|
232
|
+
(0, _utils.toggleRowAndChildren)(row, !row.getIsSelected());
|
|
233
|
+
if (row.getIsSelected()) {
|
|
234
|
+
// đã chọn
|
|
235
|
+
|
|
236
|
+
// const aaa = isSelectionChange?.rowsData.filter((it) => it.id !== row.id)
|
|
237
|
+
|
|
238
|
+
const newRowsSelected = (0, _utils.excludeItems)(prevSelected, [...allChild, row]);
|
|
239
|
+
setIsSelectionChange({
|
|
240
|
+
isChange: true,
|
|
241
|
+
type: 'rowSelected',
|
|
242
|
+
rowData: row.original,
|
|
243
|
+
rowsData: newRowsSelected ?? []
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
// chưa selected
|
|
247
|
+
|
|
248
|
+
let checkedRows = [];
|
|
249
|
+
if (row.subRows && row.subRows.length > 0) {
|
|
250
|
+
checkedRows = [...prevSelected, row, ...allChild];
|
|
251
|
+
} else {
|
|
252
|
+
checkedRows = [...prevSelected, row];
|
|
253
|
+
}
|
|
254
|
+
setIsSelectionChange({
|
|
255
|
+
isChange: true,
|
|
256
|
+
type: 'rowSelected',
|
|
257
|
+
rowData: row.original,
|
|
258
|
+
rowsData: checkedRows
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
// click vào row không có cha
|
|
263
|
+
|
|
264
|
+
row.getToggleSelectedHandler()(e);
|
|
265
|
+
if (row.getIsSelected()) {
|
|
266
|
+
// đã chọn
|
|
267
|
+
|
|
268
|
+
const rowParent = row.getParentRow();
|
|
269
|
+
// const rowParent1 = row.getParentRows()
|
|
270
|
+
|
|
271
|
+
let newCheckedRows = [];
|
|
272
|
+
if (rowParent) {}
|
|
273
|
+
if (rowParent && (0, _utils.countUnselectedChildren)(row) === 1) {
|
|
274
|
+
newCheckedRows = prevSelected.filter(it => it.id !== row.id && it.id !== rowParent.id);
|
|
275
|
+
} else {
|
|
276
|
+
// xóa row ra list selected
|
|
277
|
+
// const newRowsSelected = prevSelected.filter((it) => it.id !== row.id)
|
|
278
|
+
newCheckedRows = prevSelected.filter(it => it.id !== row.id);
|
|
279
|
+
}
|
|
280
|
+
setIsSelectionChange({
|
|
281
|
+
isChange: true,
|
|
282
|
+
type: 'rowSelected',
|
|
283
|
+
rowData: row.original,
|
|
284
|
+
rowsData: newCheckedRows ?? []
|
|
285
|
+
});
|
|
286
|
+
} else {
|
|
287
|
+
// chưa selected
|
|
288
|
+
|
|
289
|
+
let checkedRows = [];
|
|
290
|
+
const rowParent = row.getParentRow();
|
|
291
|
+
|
|
292
|
+
// nếu có cha và cha chưa được chọn và tất cả con đã chọn => thêm row cha vào
|
|
293
|
+
if (rowParent && !rowParent.getIsSelected() && (0, _utils.countUnselectedChildren)(row) === 1) {
|
|
294
|
+
rowParent.toggleSelected(!rowParent.getIsSelected());
|
|
295
|
+
checkedRows = [...prevSelected, row, rowParent];
|
|
296
|
+
} else {
|
|
297
|
+
// chỉ thêm vào row hiện tại
|
|
298
|
+
|
|
299
|
+
const isInclude = prevSelected.findIndex(it => it.id === cell.row.id);
|
|
300
|
+
if (isInclude > -1) {
|
|
301
|
+
// cập nhật data row hiện tại
|
|
302
|
+
|
|
303
|
+
prevSelected[isInclude] = row;
|
|
304
|
+
checkedRows = [...prevSelected];
|
|
305
|
+
} else {
|
|
306
|
+
checkedRows = [...prevSelected, row];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
setIsSelectionChange({
|
|
310
|
+
isChange: true,
|
|
311
|
+
type: 'rowSelected',
|
|
312
|
+
rowData: row.original,
|
|
313
|
+
rowsData: checkedRows
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
exports.toggleRowSelection = toggleRowSelection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Table } from '@tanstack/react-table';
|
|
2
|
+
import type { FilterOperator } from '../../grid-component/type';
|
|
3
|
+
export declare function useFilterOperator(table: Table<any>): {
|
|
4
|
+
setFilterOperator: (columnId: string, operator: FilterOperator) => void;
|
|
5
|
+
getFilterOperator: (columnId: string) => FilterOperator;
|
|
6
|
+
};
|
|
7
|
+
export declare function customStringFilterFn(row: any, columnId: any, filterValue: any): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.customStringFilterFn = customStringFilterFn;
|
|
7
|
+
exports.useFilterOperator = useFilterOperator;
|
|
8
|
+
function useFilterOperator(table) {
|
|
9
|
+
const setFilterOperator = (columnId, operator) => {
|
|
10
|
+
const filters = table.getState().columnFilters;
|
|
11
|
+
const next = filters.map(f => f.id === columnId ? {
|
|
12
|
+
...f,
|
|
13
|
+
operator
|
|
14
|
+
} : f);
|
|
15
|
+
table.setColumnFilters(next);
|
|
16
|
+
};
|
|
17
|
+
const getFilterOperator = columnId => {
|
|
18
|
+
const filters = table.getState().columnFilters;
|
|
19
|
+
return filters.find(f => f.id === columnId)?.operator ?? 'contains';
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
setFilterOperator,
|
|
23
|
+
getFilterOperator
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function customStringFilterFn(row, columnId, filterValue) {
|
|
27
|
+
const filters = row.table.getState().columnFilters;
|
|
28
|
+
const operator = filters.find(f => f.id === columnId)?.operator ?? 'contains';
|
|
29
|
+
const cellValue = String(row.getValue(columnId) ?? '');
|
|
30
|
+
switch (operator) {
|
|
31
|
+
case 'equal':
|
|
32
|
+
return cellValue === filterValue;
|
|
33
|
+
case 'startsWith':
|
|
34
|
+
return cellValue.toLowerCase().startsWith(filterValue.toLowerCase());
|
|
35
|
+
case 'endsWith':
|
|
36
|
+
return cellValue.toLowerCase().endsWith(filterValue.toLowerCase());
|
|
37
|
+
default:
|
|
38
|
+
return cellValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { Row, Table } from "@tanstack/react-table";
|
|
2
|
+
import { type Column } from "@tanstack/react-table";
|
|
3
|
+
import type { VirtualItem } from "@tanstack/react-virtual";
|
|
4
|
+
import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../../grid-component/type";
|
|
5
|
+
import type { Key } from "react";
|
|
6
|
+
import { type CSSProperties } from "react";
|
|
7
|
+
import dayjs from "dayjs";
|
|
8
|
+
import type { IPositionCell } from "../useContext";
|
|
9
|
+
import type { ColumnDef } from "@tanstack/react-table";
|
|
10
|
+
import type { TreeDataNode } from "antd";
|
|
11
|
+
export declare const newGuid: () => any;
|
|
12
|
+
export declare const convertDayjsToDate: (dateString: string, format?: string) => Date;
|
|
13
|
+
export declare const convertDateToDayjs: (date: Date | undefined, format?: string) => dayjs.Dayjs;
|
|
14
|
+
export declare const getCommonPinningStyles: (column: Column<any>) => CSSProperties;
|
|
15
|
+
export declare const getCommonPinningStyles2: (header: any) => CSSProperties;
|
|
16
|
+
export declare const sumSize: (items: any) => number;
|
|
17
|
+
export declare const appendIfNotExists: (a: VirtualItem[], b: VirtualItem[]) => VirtualItem[];
|
|
18
|
+
export declare const getNewItemsOnly: (a: VirtualItem[], b: VirtualItem[]) => VirtualItem[];
|
|
19
|
+
export declare const extendsObject: <T extends AnyObject = AnyObject>(...list: T[]) => AnyObject;
|
|
20
|
+
export declare const isEmpty: (d: any) => boolean;
|
|
21
|
+
export declare const getFormat: (colFormat?: IFormat, format?: IFormat) => {
|
|
22
|
+
thousandSeparator: string;
|
|
23
|
+
decimalSeparator: string;
|
|
24
|
+
decimalScale: number;
|
|
25
|
+
allowNegative: boolean;
|
|
26
|
+
prefix: string;
|
|
27
|
+
suffix: string;
|
|
28
|
+
fixedDecimalScale: boolean;
|
|
29
|
+
dateFormat: string;
|
|
30
|
+
datetimeFormat: string;
|
|
31
|
+
timeFormat: string;
|
|
32
|
+
weekFormat: string;
|
|
33
|
+
monthFormat: string;
|
|
34
|
+
yearFormat: string;
|
|
35
|
+
};
|
|
36
|
+
export declare function convertFormat(formatStr: string): string;
|
|
37
|
+
export declare const getDatepickerFormat: (type: EditType | TypeFilter | IColumnType, format?: IFormat) => string;
|
|
38
|
+
export declare const getDateRangeFormat: (type: EditType | TypeFilter | IColumnType, format?: IFormat) => string;
|
|
39
|
+
export declare const getTypeFilter: (col: any) => TypeFilter;
|
|
40
|
+
export declare const addRowIdArray: (inputArray: any[]) => any[];
|
|
41
|
+
export declare function groupArrayByColumns(arr: any[], columns: string[] | undefined): any;
|
|
42
|
+
export declare const flatColumns2: <RecordType>(columns: ColumnsTable<RecordType>) => ColumnsTable<RecordType>;
|
|
43
|
+
export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
44
|
+
export declare const checkDecimalSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
45
|
+
export declare const getFixedFields: <T>(columns: ColumnsTable<T>, type: 'left' | 'right') => string[];
|
|
46
|
+
export declare function areStringArraysEqual(a: string[], b: string[]): boolean;
|
|
47
|
+
export declare const getDefaultOperator: (col: ColumnTable) => FilterOperator;
|
|
48
|
+
export declare function isEqualSet(setA: any, setB: any): boolean;
|
|
49
|
+
export declare const getLastSelectCell: (selectCells: any) => {
|
|
50
|
+
row: number;
|
|
51
|
+
col: number;
|
|
52
|
+
};
|
|
53
|
+
export declare function getCellsByPosition(cellSet: any, position?: string): any[];
|
|
54
|
+
export declare const onAddBgSelectedCell: (selectedCells: any, id?: string, isFocusCellIndex?: boolean) => void;
|
|
55
|
+
export declare const onRemoveBgSelectedCell: (selectedCells: any, id?: string, rowsSelected?: any) => void;
|
|
56
|
+
export declare function getColIdsBetween(table: Table<any>, a: string, b: string): string[];
|
|
57
|
+
export declare function getRowIdsBetween(table: Table<any>, a: string, b: string): string[];
|
|
58
|
+
export declare const updateArrayByKey: (arr: any[], element: any, key: string) => any[];
|
|
59
|
+
export declare const unFlattenData: <RecordType extends AnyObject = AnyObject>(data: RecordType[]) => RecordType[];
|
|
60
|
+
export declare const flattenArray: <RecordType extends AnyObject = AnyObject>(arr: any[]) => RecordType[];
|
|
61
|
+
export declare function updateOrInsert(dataArray: any[], dataFilter: any[]): any[];
|
|
62
|
+
export declare const findItemByKey: (array: any, key: string | number, value: any) => any;
|
|
63
|
+
export declare const isFormattedNumber: (str: string) => boolean;
|
|
64
|
+
export declare const detectSeparators: (str: string) => {
|
|
65
|
+
thousandSeparator: string;
|
|
66
|
+
decimalSeparator: string;
|
|
67
|
+
};
|
|
68
|
+
export declare function isDateString(str: any): boolean;
|
|
69
|
+
export declare function compareDates(date1: any, date2: any): boolean;
|
|
70
|
+
export declare function compareDate(itemValue: any, value: any): boolean;
|
|
71
|
+
export declare const removeVietnameseTones: (str: any) => any;
|
|
72
|
+
export declare const shouldInclude: (item: any, queries: any[]) => any;
|
|
73
|
+
export declare function sortData(data: any[], sorter: Sorter[]): any[];
|
|
74
|
+
export declare function filterDataByColumns(data: any[], queries: any[], sorter: Sorter[], keysFilter: string[] | undefined): any[];
|
|
75
|
+
export declare const getAllRowKey: (data: any[]) => any[];
|
|
76
|
+
export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean);
|
|
77
|
+
export declare const checkFieldKey: (key: string | undefined) => string;
|
|
78
|
+
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
79
|
+
export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
80
|
+
export declare const isNullOrUndefined: (d: any) => boolean;
|
|
81
|
+
export declare const isObjEmpty: (obj: any) => boolean;
|
|
82
|
+
export declare const isDisable: <T>(column: ColumnTable<T>, rowData?: any) => boolean;
|
|
83
|
+
export declare const customWeekStartEndFormat: (value: any, weekFormat: string) => string;
|
|
84
|
+
export declare const parseBooleanToValue: (value: boolean, type: 'boolean' | 'number') => number | boolean;
|
|
85
|
+
export declare const isNameColor: (strColor: string) => boolean;
|
|
86
|
+
export declare const isColor: (value: string) => boolean;
|
|
87
|
+
export declare const genPresets: (presets?: import("@ant-design/colors").PalettesProps) => import("antd/es/color-picker/interface").PresetsItem[];
|
|
88
|
+
export declare const getEditType: <T>(column: ColumnTable<T>, rowData?: any) => EditType;
|
|
89
|
+
export declare const getDefaultValue: (defaultValue: any) => AnyObject;
|
|
90
|
+
export declare const flattenData: <RecordType extends AnyObject = AnyObject>(childrenColumnName: string, data?: RecordType[]) => RecordType[];
|
|
91
|
+
export declare const getSelectedCellMatrix: (table: Table<any>, startCell: IPositionCell | undefined, endCell: IPositionCell | undefined) => RangeState;
|
|
92
|
+
export declare function addRowsDownWithCtrl(arr: any, n: number): {
|
|
93
|
+
combined: any;
|
|
94
|
+
addedRows: any[];
|
|
95
|
+
} | {
|
|
96
|
+
combined: any[];
|
|
97
|
+
addedRows: any[];
|
|
98
|
+
};
|
|
99
|
+
export declare function addRowsDown(arr: any, n: number): {
|
|
100
|
+
combined: any;
|
|
101
|
+
addedRows: any[];
|
|
102
|
+
} | {
|
|
103
|
+
combined: any[];
|
|
104
|
+
addedRows: any[];
|
|
105
|
+
};
|
|
106
|
+
export declare function addRowsUpWithCtrl(array: any, n: number): {
|
|
107
|
+
combined: any;
|
|
108
|
+
addedRows: any[];
|
|
109
|
+
} | {
|
|
110
|
+
combined: any[];
|
|
111
|
+
addedRows: any[];
|
|
112
|
+
};
|
|
113
|
+
export declare function addRowsUp(array: any, n: number): {
|
|
114
|
+
combined: any;
|
|
115
|
+
addedRows: any[];
|
|
116
|
+
} | {
|
|
117
|
+
combined: any[];
|
|
118
|
+
addedRows: any[];
|
|
119
|
+
};
|
|
120
|
+
export declare const convertFilters: (filters: any[]) => any[];
|
|
121
|
+
export declare function getInvisibleColumns(columns: ColumnTable[]): Record<string, boolean>;
|
|
122
|
+
export declare const getAllVisibleKeys: (columns: any[]) => any[];
|
|
123
|
+
export declare const getAllVisibleKeys1: (columns: ColumnTable[]) => any[];
|
|
124
|
+
export declare function getHiddenParentKeys(columns: any[], parentKeys?: string[]): string[];
|
|
125
|
+
export declare function getHiddenParentKeys1(columns: ColumnTable[], parentKeys?: string[]): string[];
|
|
126
|
+
export declare const getVisibleColumnKeys: (columns: any[]) => string[];
|
|
127
|
+
export declare const getVisibleColumnKeys1: (columns: any[]) => string[];
|
|
128
|
+
export declare function isObjEqual(obj1: any, obj2: any): boolean;
|
|
129
|
+
export declare const sortByType: <T>(arr: ColumnTable<T>[]) => ColumnTable<T>[];
|
|
130
|
+
export declare function convertColumnsToTreeData<T>(columns: ColumnDef<T, any>[], groupColumns?: string[]): TreeDataNode[];
|
|
131
|
+
export declare const updateColumns1: (columns: ColumnTable[], includes: string[]) => ColumnTable[];
|
|
132
|
+
export declare const convertToObj: (arr: any) => {
|
|
133
|
+
[k: string]: any;
|
|
134
|
+
};
|
|
135
|
+
export declare const convertToObjTrue: (arr: any) => {
|
|
136
|
+
[k: string]: any;
|
|
137
|
+
};
|
|
138
|
+
export declare const getDiffent2Array: (a: any[], b: any[]) => any[];
|
|
139
|
+
export declare function findFirst(items: Column<any>[]): Column<any, unknown>;
|
|
140
|
+
export declare function isTreeArray(arr: any[]): boolean;
|
|
141
|
+
export declare function updateColumnWidthsRecursive(columns: any[], sizing: Record<string, number>): any[];
|
|
142
|
+
export declare function updateWidthsByOther(source: any[], target: any[]): any[];
|
|
143
|
+
export declare function findAllChildrenKeys2<RecordType>(data: readonly RecordType[], rowKey: any, childrenColumnName: string): Key[];
|
|
144
|
+
export declare function parseExcelText(text: string): string[][];
|
|
145
|
+
export declare function parseExcelClipboard(e: React.ClipboardEvent): string[][];
|
|
146
|
+
export declare function parseExcelClipboardText(text: string): string[][];
|
|
147
|
+
export declare function parseClipboardEvent(e: ClipboardEvent | React.ClipboardEvent): string[][];
|
|
148
|
+
export declare function arraysEqualIgnoreOrderFast(a: any[], b: any[]): boolean;
|
|
149
|
+
export declare function filterByIds(a: any[], b: any[]): any[];
|
|
150
|
+
export declare function excludeItems(arrayA: any[], arrayB: any[]): any[];
|
|
151
|
+
export declare function getAllChildren(row: any): any;
|
|
152
|
+
export declare function toggleRowAndChildren(row: Row<any>, isSelected?: boolean): void;
|
|
153
|
+
export declare function countUnselectedChildren(row: Row<any>): number;
|
|
154
|
+
export declare function removeDuplicatesByKey(arr: any[], key?: string): any[];
|
|
155
|
+
export declare const getTableHeight: (height?: number, minHeight?: number) => number;
|
|
156
|
+
export declare const convertFlatColumn1: (array: ColumnsTable) => ColumnsTable[];
|
|
157
|
+
export declare const updateColumnsByGroup: (columns: any[], columnsGroup: string[]) => any[];
|
|
158
|
+
export declare const removeColumns: <RecordType>(columns: ColumnTable<RecordType>[], groupColumns: string[]) => ColumnsTable<RecordType>;
|
|
159
|
+
export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordType>[], fixedFields: string[]) => {
|
|
160
|
+
fixed: string;
|
|
161
|
+
field: string;
|
|
162
|
+
width?: number;
|
|
163
|
+
maxWidth?: number;
|
|
164
|
+
minWidth?: number;
|
|
165
|
+
type?: IColumnType;
|
|
166
|
+
haveSum?: boolean;
|
|
167
|
+
isSummary?: boolean;
|
|
168
|
+
summaryTemplate?: (data: number, key: string) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
169
|
+
format?: IFormat | ((rowData: any) => IFormat);
|
|
170
|
+
allowFiltering?: boolean;
|
|
171
|
+
sorter?: boolean;
|
|
172
|
+
allowSortering?: boolean;
|
|
173
|
+
operator?: FilterOperator;
|
|
174
|
+
hideOperator?: boolean;
|
|
175
|
+
placeholder?: string;
|
|
176
|
+
showInColumnChoose?: boolean;
|
|
177
|
+
typeFilter?: TypeFilter;
|
|
178
|
+
source?: any[];
|
|
179
|
+
showFilterSearch?: boolean;
|
|
180
|
+
headerText?: string;
|
|
181
|
+
hidden?: boolean;
|
|
182
|
+
visible?: boolean;
|
|
183
|
+
headerTooltip?: string | boolean | (() => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
184
|
+
columnGroupText?: string;
|
|
185
|
+
align?: import("./../../grid-component/type").ITextAlign;
|
|
186
|
+
textAlign?: import("./../../grid-component/type").ITextAlign;
|
|
187
|
+
headerTextAlign?: import("./../../grid-component/type").ITextAlign;
|
|
188
|
+
template?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
189
|
+
showTooltip?: boolean;
|
|
190
|
+
tooltipDescription?: string | ((args: {
|
|
191
|
+
value: any;
|
|
192
|
+
record: RecordType;
|
|
193
|
+
}) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
194
|
+
headerTemplate?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((column: ColumnTable<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
195
|
+
commandItems?: import("./../../grid-component/type").CommandItem[];
|
|
196
|
+
children?: ColumnTable<RecordType>[];
|
|
197
|
+
editType?: EditType | ((rowData?: RecordType) => EditType);
|
|
198
|
+
disable?: boolean | ((rowData: any) => boolean);
|
|
199
|
+
editEnable?: boolean | ((rowData: any) => boolean);
|
|
200
|
+
isClearable?: boolean;
|
|
201
|
+
maxDate?: any;
|
|
202
|
+
minDate?: any;
|
|
203
|
+
maxTime?: any;
|
|
204
|
+
minTime?: any;
|
|
205
|
+
max?: number;
|
|
206
|
+
min?: number;
|
|
207
|
+
editSelectSettings?: import("./../../grid-component/type").IEditSelectSettings;
|
|
208
|
+
editFromSettings?: import("./../../grid-component/type").IEditFromSettings;
|
|
209
|
+
fixedType?: import("./../../grid-component/type").FixedType;
|
|
210
|
+
headerTextWrap?: boolean;
|
|
211
|
+
ellipsis?: boolean;
|
|
212
|
+
allowResizing?: boolean;
|
|
213
|
+
allowSelection?: boolean | ((rowData: RecordType) => boolean);
|
|
214
|
+
onCellStyles?: Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width">);
|
|
215
|
+
onCellHeaderStyles?: Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width">);
|
|
216
|
+
onCellFooterStyles?: Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width">);
|
|
217
|
+
sumGroup?: boolean;
|
|
218
|
+
onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
|
|
219
|
+
}[];
|
|
220
|
+
export declare function sortColumnsByField<T extends ColumnTable>(columns: T[], priorityFields: string[]): T[];
|