es-grid-template 1.8.64 → 1.8.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid-component/TempTable.d.ts +2 -2
- package/es/grid-component/TempTable.js +5 -5
- 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 +1 -8
- package/es/grid-component/hooks/utils.js +176 -144
- package/es/grid-component/index.d.ts +1 -1
- package/es/grid-component/index.js +0 -4
- package/es/grid-component/styles.scss +1394 -1394
- package/es/grid-component/type.d.ts +0 -407
- package/es/grid-component/type.js +490 -1
- package/es/table-component/type.d.ts +10 -0
- package/es/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.js +4 -3
- package/es/{grid-component → table-virtuoso}/InternalTable.d.ts +2 -3
- package/es/table-virtuoso/InternalTable.js +391 -0
- package/es/table-virtuoso/body/TableBodyCell.d.ts +14 -0
- package/es/table-virtuoso/body/TableBodyCell.js +457 -0
- package/es/table-virtuoso/body/TableBodyRow.d.ts +13 -0
- package/es/table-virtuoso/body/TableBodyRow.js +112 -0
- package/es/table-virtuoso/footer/TableFooterCell.d.ts +7 -0
- package/es/table-virtuoso/footer/TableFooterCell.js +54 -0
- package/es/table-virtuoso/header/TableHeadCell.d.ts +14 -0
- package/es/table-virtuoso/header/TableHeadCell.js +265 -0
- package/es/table-virtuoso/header/renderFilter.d.ts +20 -0
- package/es/table-virtuoso/header/renderFilter.js +289 -0
- package/es/table-virtuoso/hook/constant.d.ts +73 -0
- package/es/table-virtuoso/hook/constant.js +240 -0
- package/es/table-virtuoso/hook/convert.d.ts +1 -0
- package/es/table-virtuoso/hook/convert.js +28 -0
- package/es/table-virtuoso/hook/useColumns.d.ts +28 -0
- package/es/table-virtuoso/hook/useColumns.js +302 -0
- package/es/table-virtuoso/hook/useFilterOperator.d.ts +7 -0
- package/es/table-virtuoso/hook/useFilterOperator.js +33 -0
- package/es/table-virtuoso/hook/utils.d.ts +159 -0
- package/es/table-virtuoso/hook/utils.js +2263 -0
- package/es/table-virtuoso/index.d.ts +2 -0
- package/es/table-virtuoso/index.js +2 -0
- package/es/table-virtuoso/style.d.ts +22 -0
- package/es/table-virtuoso/style.js +12 -0
- package/es/table-virtuoso/style.scss +1441 -0
- package/es/table-virtuoso/table/Grid.d.ts +37 -0
- package/es/table-virtuoso/table/Grid.js +298 -0
- package/es/table-virtuoso/table/TableContainer.d.ts +49 -0
- package/es/table-virtuoso/table/TableContainer.js +292 -0
- package/es/table-virtuoso/table/TableWrapper.d.ts +22 -0
- package/es/table-virtuoso/table/TableWrapper.js +161 -0
- package/es/table-virtuoso/type.d.ts +0 -0
- package/es/table-virtuoso/type.js +785 -0
- package/es/table-virtuoso/useContext.d.ts +97 -0
- package/es/table-virtuoso/useContext.js +21 -0
- package/lib/grid-component/TempTable.d.ts +2 -2
- package/lib/grid-component/TempTable.js +5 -7
- 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 +1 -8
- package/lib/grid-component/hooks/utils.js +179 -152
- package/lib/grid-component/index.d.ts +1 -1
- package/lib/grid-component/index.js +0 -3
- package/lib/grid-component/styles.scss +1394 -1394
- package/lib/grid-component/type.d.ts +0 -407
- package/lib/grid-component/type.js +490 -4
- package/lib/table-component/type.d.ts +10 -0
- package/lib/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.js +4 -3
- package/lib/{grid-component → table-virtuoso}/InternalTable.d.ts +2 -3
- package/lib/table-virtuoso/InternalTable.js +400 -0
- package/lib/table-virtuoso/body/TableBodyCell.d.ts +14 -0
- package/lib/table-virtuoso/body/TableBodyCell.js +464 -0
- package/lib/table-virtuoso/body/TableBodyRow.d.ts +13 -0
- package/lib/table-virtuoso/body/TableBodyRow.js +119 -0
- package/lib/table-virtuoso/footer/TableFooterCell.d.ts +7 -0
- package/lib/table-virtuoso/footer/TableFooterCell.js +63 -0
- package/lib/table-virtuoso/header/TableHeadCell.d.ts +14 -0
- package/lib/table-virtuoso/header/TableHeadCell.js +274 -0
- package/lib/table-virtuoso/header/renderFilter.d.ts +20 -0
- package/lib/table-virtuoso/header/renderFilter.js +299 -0
- package/lib/table-virtuoso/hook/constant.d.ts +73 -0
- package/lib/table-virtuoso/hook/constant.js +247 -0
- package/lib/table-virtuoso/hook/convert.d.ts +1 -0
- package/lib/table-virtuoso/hook/convert.js +34 -0
- package/lib/table-virtuoso/hook/useColumns.d.ts +28 -0
- package/lib/table-virtuoso/hook/useColumns.js +315 -0
- package/lib/table-virtuoso/hook/useFilterOperator.d.ts +7 -0
- package/lib/table-virtuoso/hook/useFilterOperator.js +40 -0
- package/lib/table-virtuoso/hook/utils.d.ts +159 -0
- package/lib/table-virtuoso/hook/utils.js +2389 -0
- package/lib/table-virtuoso/index.d.ts +2 -0
- package/lib/table-virtuoso/index.js +9 -0
- package/lib/table-virtuoso/style.d.ts +22 -0
- package/lib/table-virtuoso/style.js +19 -0
- package/lib/table-virtuoso/style.scss +1441 -0
- package/lib/table-virtuoso/table/Grid.d.ts +37 -0
- package/lib/table-virtuoso/table/Grid.js +307 -0
- package/lib/table-virtuoso/table/TableContainer.d.ts +49 -0
- package/lib/table-virtuoso/table/TableContainer.js +300 -0
- package/lib/table-virtuoso/table/TableWrapper.d.ts +22 -0
- package/lib/table-virtuoso/table/TableWrapper.js +166 -0
- package/lib/table-virtuoso/type.d.ts +0 -0
- package/lib/table-virtuoso/type.js +786 -0
- package/lib/table-virtuoso/useContext.d.ts +97 -0
- package/lib/table-virtuoso/useContext.js +27 -0
- package/package.json +2 -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/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/ConvertColumnTable.d.ts +0 -7
- package/es/grid-component/ConvertColumnTable.js +0 -144
- 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/InternalTable.js +0 -1170
- 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/table/Grid.d.ts +0 -23
- package/es/grid-component/table/Grid.js +0 -49
- package/es/grid-component/table/GridEdit.d.ts +0 -23
- package/es/grid-component/table/GridEdit.js +0 -2726
- package/es/grid-component/table/Group.d.ts +0 -21
- package/es/grid-component/table/Group.js +0 -195
- package/es/grid-component/table/InfiniteTable.d.ts +0 -23
- package/es/grid-component/table/InfiniteTable.js +0 -101
- package/es/grid-component/useContext.d.ts +0 -34
- package/es/grid-component/useContext.js +0 -8
- 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/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/ConvertColumnTable.d.ts +0 -7
- package/lib/grid-component/ConvertColumnTable.js +0 -153
- 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/InternalTable.js +0 -1178
- 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/table/Grid.d.ts +0 -23
- package/lib/grid-component/table/Grid.js +0 -58
- package/lib/grid-component/table/GridEdit.d.ts +0 -23
- package/lib/grid-component/table/GridEdit.js +0 -2723
- package/lib/grid-component/table/Group.d.ts +0 -21
- package/lib/grid-component/table/Group.js +0 -204
- package/lib/grid-component/table/InfiniteTable.d.ts +0 -23
- package/lib/grid-component/table/InfiniteTable.js +0 -109
- package/lib/grid-component/useContext.d.ts +0 -34
- package/lib/grid-component/useContext.js +0 -13
- /package/es/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.d.ts +0 -0
- /package/es/{grid-component → table-virtuoso}/ColumnsGroup/index.d.ts +0 -0
- /package/es/{grid-component → table-virtuoso}/ColumnsGroup/index.js +0 -0
- /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.d.ts +0 -0
- /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/index.d.ts +0 -0
- /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/index.js +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _rcMasterUi = require("rc-master-ui");
|
|
10
|
-
var _useContext = require("../../useContext");
|
|
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
|
-
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
|
-
const ControlCheckbox = props => {
|
|
14
|
-
const {
|
|
15
|
-
column,
|
|
16
|
-
record,
|
|
17
|
-
rowIndex,
|
|
18
|
-
colIndex,
|
|
19
|
-
checkValue,
|
|
20
|
-
editAble,
|
|
21
|
-
checked
|
|
22
|
-
} = props;
|
|
23
|
-
const {
|
|
24
|
-
handleCellChange,
|
|
25
|
-
getRowKey
|
|
26
|
-
} = (0, _react.useContext)(_useContext.TableContext);
|
|
27
|
-
|
|
28
|
-
// const isEdit = getEditType(column, record)
|
|
29
|
-
|
|
30
|
-
const isEdit = _react.default.useMemo(() => {
|
|
31
|
-
return (0, _utils.isEditable)(column, record);
|
|
32
|
-
}, [column, record]);
|
|
33
|
-
|
|
34
|
-
// const [isHover, setIsHover] = useState(false)
|
|
35
|
-
|
|
36
|
-
const inputNode = value => {
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(_rcMasterUi.Checkbox, {
|
|
38
|
-
checked: Boolean(value),
|
|
39
|
-
defaultChecked: Boolean(checked)
|
|
40
|
-
// style={{ textAlign: column.align ?? 'left' }}
|
|
41
|
-
,
|
|
42
|
-
onChange: val => {
|
|
43
|
-
const newVal = typeof checkValue === "number" ? (0, _utils.parseBooleanToValue)(val.target.checked, typeof value) : val.target.checked;
|
|
44
|
-
|
|
45
|
-
// onChange(newVal)
|
|
46
|
-
|
|
47
|
-
const key = getRowKey?.(record, rowIndex);
|
|
48
|
-
// const formState = getValues()
|
|
49
|
-
|
|
50
|
-
handleCellChange?.({
|
|
51
|
-
key: key,
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
record: {
|
|
54
|
-
...record,
|
|
55
|
-
[column.field]: newVal
|
|
56
|
-
},
|
|
57
|
-
option: value,
|
|
58
|
-
prevState: value,
|
|
59
|
-
newState: newVal,
|
|
60
|
-
field: column.field ?? column.dataIndex,
|
|
61
|
-
indexCol: colIndex,
|
|
62
|
-
indexRow: rowIndex,
|
|
63
|
-
type: 'blur'
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
disabled: (0, _utils.isDisable)(column, record) ?? false
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
// onMouseEnter={() => {
|
|
71
|
-
// setIsHover(true)
|
|
72
|
-
// }}
|
|
73
|
-
//
|
|
74
|
-
// onMouseLeave={() => {
|
|
75
|
-
// setIsHover(false)
|
|
76
|
-
// }}
|
|
77
|
-
style: {
|
|
78
|
-
display: 'flex',
|
|
79
|
-
alignItems: 'center',
|
|
80
|
-
justifyContent: column.align ?? 'center',
|
|
81
|
-
paddingInline: 5,
|
|
82
|
-
height: '100%',
|
|
83
|
-
width: '100%'
|
|
84
|
-
}
|
|
85
|
-
}, editAble && isEdit !== false ? inputNode(checkValue) : /*#__PURE__*/_react.default.createElement(_rcMasterUi.Checkbox, {
|
|
86
|
-
checked: checked,
|
|
87
|
-
onChange: e => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
},
|
|
90
|
-
style: {
|
|
91
|
-
textAlign: column.align ?? 'left'
|
|
92
|
-
}
|
|
93
|
-
}));
|
|
94
|
-
};
|
|
95
|
-
var _default = exports.default = ControlCheckbox;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { ColumnTable } from "../../type";
|
|
3
|
-
import type { IWrapSettings } from "../../type";
|
|
4
|
-
type Props = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
-
t?: any;
|
|
6
|
-
id?: string;
|
|
7
|
-
content?: string;
|
|
8
|
-
wrapSettings?: IWrapSettings;
|
|
9
|
-
column?: ColumnTable;
|
|
10
|
-
template?: React.ReactElement | React.ReactNode | (() => React.ReactElement | React.ReactNode);
|
|
11
|
-
tooltip?: string | number | React.ReactElement | React.ReactNode | (() => React.ReactElement | React.ReactNode);
|
|
12
|
-
};
|
|
13
|
-
declare const HeaderContent: (props: Props) => React.JSX.Element;
|
|
14
|
-
export default HeaderContent;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _utils = require("../utils");
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
const HeaderStyle = _styledComponents.default.div.withConfig({
|
|
16
|
-
displayName: "HeaderStyle",
|
|
17
|
-
componentId: "es-grid-template__sc-ibhq66-0"
|
|
18
|
-
})([""]);
|
|
19
|
-
const HeaderContent = props => {
|
|
20
|
-
const {
|
|
21
|
-
t,
|
|
22
|
-
id,
|
|
23
|
-
wrapSettings,
|
|
24
|
-
column,
|
|
25
|
-
onCopy,
|
|
26
|
-
...rest
|
|
27
|
-
} = props;
|
|
28
|
-
const {
|
|
29
|
-
headerTooltip,
|
|
30
|
-
headerText,
|
|
31
|
-
columnGroupText,
|
|
32
|
-
headerTemplate,
|
|
33
|
-
headerTextWrap,
|
|
34
|
-
ellipsis
|
|
35
|
-
} = props.column ?? {};
|
|
36
|
-
const text = _react.default.useMemo(() => {
|
|
37
|
-
return columnGroupText ?? headerText;
|
|
38
|
-
}, [columnGroupText, headerText]);
|
|
39
|
-
const tooltip = _react.default.useMemo(() => {
|
|
40
|
-
return t ? t?.(headerTooltip ?? columnGroupText ?? headerText) : headerTooltip ?? columnGroupText ?? headerText;
|
|
41
|
-
}, [columnGroupText, headerText, headerTooltip, t]);
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(HeaderStyle, (0, _extends2.default)({}, rest, {
|
|
43
|
-
className: (0, _classnames.default)('', {
|
|
44
|
-
'ui-rc-table-cell-ellipsis': ellipsis !== false && headerTextWrap !== true,
|
|
45
|
-
'header-text-wrap': headerTextWrap ?? (wrapSettings?.wrapMode === 'Header' || wrapSettings?.wrapMode === 'Both')
|
|
46
|
-
}),
|
|
47
|
-
"data-tooltip-id": `${id}-tooltip-header`,
|
|
48
|
-
"data-tooltip-content": tooltip,
|
|
49
|
-
"data-tooltip-offset": 16,
|
|
50
|
-
onCopy: onCopy
|
|
51
|
-
}), headerTemplate ? (0, _utils.getTemplate)(headerTemplate, column) : t ? t(text) : text));
|
|
52
|
-
};
|
|
53
|
-
var _default = exports.default = HeaderContent;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
-
type Props = {
|
|
3
|
-
t?: any;
|
|
4
|
-
content?: any;
|
|
5
|
-
value?: any;
|
|
6
|
-
record?: any;
|
|
7
|
-
rowIndex?: any;
|
|
8
|
-
template?: React.ReactElement | React.ReactNode | (() => React.ReactElement | React.ReactNode);
|
|
9
|
-
tooltip?: ReactNode | ReactElement | ((value: any, record: any, index: number) => ReactNode | ReactElement);
|
|
10
|
-
showTooltip?: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare const TooltipContent: (props: Props) => React.JSX.Element;
|
|
13
|
-
export default TooltipContent;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _react2 = require("@floating-ui/react");
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
var _useIsOverflow = require("../useIsOverflow");
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
// import {getTemplate} from "../utils";
|
|
17
|
-
|
|
18
|
-
const TooltipStyle = _styledComponents.default.div.withConfig({
|
|
19
|
-
displayName: "TooltipStyle",
|
|
20
|
-
componentId: "es-grid-template__sc-7yfbzv-0"
|
|
21
|
-
})(["width:max-content;background-color:#444;color:white;font-size:90%;padding:4px 8px;border-radius:4px;opacity:0.9;z-index:9999;max-width:450px;"]);
|
|
22
|
-
const TooltipContent = props => {
|
|
23
|
-
const {
|
|
24
|
-
content,
|
|
25
|
-
tooltip,
|
|
26
|
-
value,
|
|
27
|
-
record,
|
|
28
|
-
rowIndex,
|
|
29
|
-
showTooltip
|
|
30
|
-
} = props;
|
|
31
|
-
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
32
|
-
const {
|
|
33
|
-
refs,
|
|
34
|
-
floatingStyles,
|
|
35
|
-
context
|
|
36
|
-
} = (0, _react2.useFloating)({
|
|
37
|
-
open: isOpen,
|
|
38
|
-
onOpenChange: setIsOpen,
|
|
39
|
-
placement: "top",
|
|
40
|
-
whileElementsMounted: _react2.autoUpdate,
|
|
41
|
-
middleware: [(0, _react2.offset)(5), (0, _react2.flip)({
|
|
42
|
-
fallbackAxisSideDirection: "start"
|
|
43
|
-
}), (0, _react2.shift)()]
|
|
44
|
-
});
|
|
45
|
-
const isOverflow = (0, _useIsOverflow.useIsOverflow)(refs.reference);
|
|
46
|
-
const hover = (0, _react2.useHover)(context, {
|
|
47
|
-
move: false
|
|
48
|
-
});
|
|
49
|
-
const focus = (0, _react2.useFocus)(context);
|
|
50
|
-
const dismiss = (0, _react2.useDismiss)(context);
|
|
51
|
-
const role = (0, _react2.useRole)(context, {
|
|
52
|
-
role: "tooltip"
|
|
53
|
-
});
|
|
54
|
-
const {
|
|
55
|
-
getReferenceProps,
|
|
56
|
-
getFloatingProps
|
|
57
|
-
} = (0, _react2.useInteractions)([hover, focus, dismiss, role]);
|
|
58
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
59
|
-
ref: refs.setReference
|
|
60
|
-
}, getReferenceProps(), {
|
|
61
|
-
style: {
|
|
62
|
-
flex: 1,
|
|
63
|
-
overflow: 'hidden',
|
|
64
|
-
textOverflow: 'ellipsis',
|
|
65
|
-
wordBreak: 'keep-all'
|
|
66
|
-
},
|
|
67
|
-
className: (0, _classnames.default)('', {})
|
|
68
|
-
}), content()), isOpen && showTooltip !== false && isOverflow &&
|
|
69
|
-
/*#__PURE__*/
|
|
70
|
-
// {true && (
|
|
71
|
-
_react.default.createElement(_react2.FloatingPortal, {
|
|
72
|
-
root: document.body
|
|
73
|
-
}, /*#__PURE__*/_react.default.createElement(TooltipStyle, (0, _extends2.default)({
|
|
74
|
-
className: "Tooltip",
|
|
75
|
-
ref: refs.setFloating,
|
|
76
|
-
style: {
|
|
77
|
-
...floatingStyles
|
|
78
|
-
}
|
|
79
|
-
}, getFloatingProps()), tooltip && typeof tooltip === 'function' ? tooltip(value, record, rowIndex) : tooltip ?? content())));
|
|
80
|
-
};
|
|
81
|
-
var _default = exports.default = TooltipContent;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AnyObject, IGroupSetting } from "../type";
|
|
2
|
-
export declare const SELECTION_COLUMN: {};
|
|
3
|
-
interface UseColumnsConfig<RecordType> {
|
|
4
|
-
t?: any;
|
|
5
|
-
dataSource: RecordType[];
|
|
6
|
-
buddhistLocale?: any;
|
|
7
|
-
dataSourceFilter?: any;
|
|
8
|
-
locale?: any;
|
|
9
|
-
format?: any;
|
|
10
|
-
handleResize?: any;
|
|
11
|
-
sortMultiple?: boolean;
|
|
12
|
-
groupAble?: boolean;
|
|
13
|
-
groupSetting?: IGroupSetting;
|
|
14
|
-
groupColumns?: string[];
|
|
15
|
-
rowKey?: any;
|
|
16
|
-
onMouseHover?: any;
|
|
17
|
-
}
|
|
18
|
-
declare const useColumns: <RecordType extends AnyObject = AnyObject>(config: UseColumnsConfig<RecordType>) => readonly [any];
|
|
19
|
-
export default useColumns;
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.SELECTION_COLUMN = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var React = _react;
|
|
10
|
-
var _antd = require("antd");
|
|
11
|
-
var _rcMasterUi = require("rc-master-ui");
|
|
12
|
-
var _utils = require("./utils");
|
|
13
|
-
var _constant = require("./constant");
|
|
14
|
-
var _columns = require("./columns");
|
|
15
|
-
var _icons = require("@ant-design/icons");
|
|
16
|
-
var _becoxyIcons = require("becoxy-icons");
|
|
17
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
|
-
var _HeaderContent = _interopRequireDefault(require("./content/HeaderContent"));
|
|
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
|
-
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 type {Key} from 'react';
|
|
22
|
-
|
|
23
|
-
// import Command from "../Command";
|
|
24
|
-
|
|
25
|
-
const ASCEND = 'ascend';
|
|
26
|
-
const DESCEND = 'descend';
|
|
27
|
-
const SELECTION_COLUMN = exports.SELECTION_COLUMN = {};
|
|
28
|
-
|
|
29
|
-
// const EMPTY_LIST: React.Key[] = [];
|
|
30
|
-
|
|
31
|
-
const useColumns = config => {
|
|
32
|
-
// const {
|
|
33
|
-
// preserveSelectedRowKeys,
|
|
34
|
-
// selectedRowKeys,
|
|
35
|
-
// defaultSelectedRowKeys,
|
|
36
|
-
// onSelectMultiple,
|
|
37
|
-
// columnWidth: selectionColWidth,
|
|
38
|
-
// type: selectionType,
|
|
39
|
-
// selections,
|
|
40
|
-
// fixed,
|
|
41
|
-
// } = rowSelection || {};
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
t,
|
|
45
|
-
dataSourceFilter,
|
|
46
|
-
buddhistLocale,
|
|
47
|
-
locale,
|
|
48
|
-
sortMultiple,
|
|
49
|
-
format,
|
|
50
|
-
handleResize,
|
|
51
|
-
// onMouseHover,
|
|
52
|
-
groupAble,
|
|
53
|
-
groupColumns,
|
|
54
|
-
groupSetting,
|
|
55
|
-
dataSource,
|
|
56
|
-
rowKey
|
|
57
|
-
} = config;
|
|
58
|
-
|
|
59
|
-
// const mergedColumns = React.useMemo(
|
|
60
|
-
// () => getMergedColumns<RecordType>(rawMergedColumns || []),
|
|
61
|
-
// [rawMergedColumns],
|
|
62
|
-
// );
|
|
63
|
-
//
|
|
64
|
-
// const [filterStates, setFilterStates] = React.useState<FilterState<RecordType>[]>(() =>
|
|
65
|
-
// collectFilterStates(mergedColumns, true),
|
|
66
|
-
// );
|
|
67
|
-
|
|
68
|
-
// ====================== Selections ======================
|
|
69
|
-
|
|
70
|
-
// const handleSearch = (
|
|
71
|
-
// selectedKeys: string[],
|
|
72
|
-
// confirm: any,
|
|
73
|
-
// ) => {
|
|
74
|
-
//
|
|
75
|
-
// confirm()
|
|
76
|
-
//
|
|
77
|
-
// }
|
|
78
|
-
|
|
79
|
-
const getColumnSearchProps = (0, _react.useCallback)(column => ({
|
|
80
|
-
filterDropdown: ({
|
|
81
|
-
setSelectedKeys,
|
|
82
|
-
selectedKeys,
|
|
83
|
-
confirm,
|
|
84
|
-
// close,
|
|
85
|
-
setOperatorKey,
|
|
86
|
-
operatorKey,
|
|
87
|
-
visible,
|
|
88
|
-
searchValue,
|
|
89
|
-
setSearchValue
|
|
90
|
-
}) => {
|
|
91
|
-
const type = (0, _utils.getTypeFilter)(column);
|
|
92
|
-
// const operatorOptions = !type || type === 'Text' ? stringOperator : numberOperator
|
|
93
|
-
// const operatorOptions = type === 'Checkbox' || type === 'Dropdown' || type === 'DropTree' || ty
|
|
94
|
-
// const operatorOptions = type === ('Checkbox' || 'Dropdown' || 'DropTree' || 'CheckboxDropdown') ? booleanOperator : (!type || type === 'Text' ? stringOperator : numberOperator)
|
|
95
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _constant.booleanOperator : !type || type === 'Text' ? _constant.stringOperator : _constant.numberOperator;
|
|
96
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
style: {
|
|
98
|
-
padding: 8,
|
|
99
|
-
minWidth: 275
|
|
100
|
-
},
|
|
101
|
-
onKeyDown: e => e.stopPropagation()
|
|
102
|
-
}, column?.showOperator !== false && column?.typeFilter !== 'DateRange' && column?.typeFilter !== 'NumberRange' && /*#__PURE__*/React.createElement("div", {
|
|
103
|
-
className: 'mb-1'
|
|
104
|
-
}, /*#__PURE__*/React.createElement(_rcMasterUi.Select, {
|
|
105
|
-
options: (0, _constant.translateOption)(operatorOptions, t),
|
|
106
|
-
style: {
|
|
107
|
-
width: '100%',
|
|
108
|
-
marginBottom: 8
|
|
109
|
-
},
|
|
110
|
-
value: operatorKey,
|
|
111
|
-
onChange: val => {
|
|
112
|
-
setOperatorKey(val);
|
|
113
|
-
}
|
|
114
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
style: {
|
|
116
|
-
marginBottom: 8
|
|
117
|
-
}
|
|
118
|
-
}, (0, _columns.renderFilter)(column, selectedKeys, setSelectedKeys, confirm, visible, searchValue, setSearchValue, dataSourceFilter, buddhistLocale, locale, t)), /*#__PURE__*/React.createElement(_antd.Space, {
|
|
119
|
-
style: {
|
|
120
|
-
justifyContent: 'end',
|
|
121
|
-
width: '100%'
|
|
122
|
-
}
|
|
123
|
-
}, /*#__PURE__*/React.createElement(_antd.Button, {
|
|
124
|
-
type: "primary",
|
|
125
|
-
onClick: () => {
|
|
126
|
-
// confirm({closeDropdown: false})
|
|
127
|
-
confirm();
|
|
128
|
-
// handleSearch(selectedKeys as string[], confirm)
|
|
129
|
-
},
|
|
130
|
-
icon: /*#__PURE__*/React.createElement(_icons.SearchOutlined, null),
|
|
131
|
-
size: "small",
|
|
132
|
-
style: {
|
|
133
|
-
width: 90
|
|
134
|
-
}
|
|
135
|
-
}, t ? t('Filter') : 'Filter'), /*#__PURE__*/React.createElement(_antd.Button, {
|
|
136
|
-
type: "link",
|
|
137
|
-
size: "small",
|
|
138
|
-
onClick: () => {
|
|
139
|
-
// setSearchValue('')
|
|
140
|
-
setSelectedKeys([]);
|
|
141
|
-
confirm();
|
|
142
|
-
// handleSearch()
|
|
143
|
-
// close()
|
|
144
|
-
}
|
|
145
|
-
}, t ? t("Clear") : 'Clear')));
|
|
146
|
-
},
|
|
147
|
-
filterIcon: filtered => /*#__PURE__*/React.createElement(_becoxyIcons.FilterFill, {
|
|
148
|
-
fontSize: 12
|
|
149
|
-
// onClick={() => {
|
|
150
|
-
// onFilterClick?.(column, onFilterCallback)
|
|
151
|
-
// }}
|
|
152
|
-
,
|
|
153
|
-
style: {
|
|
154
|
-
color: filtered ? '#E3165B' : '#283046'
|
|
155
|
-
}
|
|
156
|
-
}),
|
|
157
|
-
filterDropdownProps: {
|
|
158
|
-
onOpenChange(open) {
|
|
159
|
-
if (open) {
|
|
160
|
-
// setTimeout(() => searchInput.current?.select(), 100)
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}), [buddhistLocale, dataSourceFilter, locale, t]);
|
|
165
|
-
|
|
166
|
-
// ======================= Columns ========================
|
|
167
|
-
const transformColumns = (0, _react.useCallback)(columns => {
|
|
168
|
-
// >>>>>>>>>>> Support selection
|
|
169
|
-
const cloneColumns = [...columns];
|
|
170
|
-
const firstNonGroupColumn = (0, _columns.flatColumns2)(cloneColumns).find(col => col.field && col.field !== '#' && !groupColumns?.includes(col.field) && col.hidden !== true);
|
|
171
|
-
const nonGroupColumns = (0, _columns.flatColumns2)(cloneColumns).filter(col => col.field && col.field !== '#' && !groupColumns?.includes(col.field) && col.hidden !== true);
|
|
172
|
-
|
|
173
|
-
// ===================== Render =====================
|
|
174
|
-
|
|
175
|
-
const convertColumns = cols => {
|
|
176
|
-
return cols.map(col => {
|
|
177
|
-
const colIndex = (0, _columns.flatColumns2)(cols).findIndex(it => it.field === col.field);
|
|
178
|
-
if (col === SELECTION_COLUMN) {
|
|
179
|
-
return SELECTION_COLUMN;
|
|
180
|
-
}
|
|
181
|
-
const transformedColumn = {
|
|
182
|
-
...col,
|
|
183
|
-
dataIndex: col.field ?? col.dataIndex,
|
|
184
|
-
key: col.field ?? col.dataIndex ?? col.key,
|
|
185
|
-
// title: t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title,
|
|
186
|
-
// title: () => (<span>aaa</span>),
|
|
187
|
-
title: () => /*#__PURE__*/React.createElement(_HeaderContent.default, {
|
|
188
|
-
column: {
|
|
189
|
-
...col
|
|
190
|
-
},
|
|
191
|
-
t: t
|
|
192
|
-
}),
|
|
193
|
-
// title: () => (<span>{t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title}</span>),
|
|
194
|
-
ellipsis: col.ellipsis !== false,
|
|
195
|
-
align: col.textAlign ?? col.align,
|
|
196
|
-
fixed: col.fixedType ?? col.fixed,
|
|
197
|
-
isSummary: col.isSummary ?? col.haveSum,
|
|
198
|
-
hidden: col.hidden ?? col.visible === false
|
|
199
|
-
// hidden: true
|
|
200
|
-
};
|
|
201
|
-
if (transformedColumn.children && transformedColumn.children?.length) {
|
|
202
|
-
return {
|
|
203
|
-
...transformedColumn,
|
|
204
|
-
children: convertColumns(transformedColumn.children)
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
if (transformedColumn.field === '#') {
|
|
208
|
-
return {
|
|
209
|
-
...transformedColumn,
|
|
210
|
-
onCell: () => ({
|
|
211
|
-
className: 'cell-number'
|
|
212
|
-
}),
|
|
213
|
-
render: (val, record) => {
|
|
214
|
-
return (0, _utils.findItemPath)(dataSource, record, rowKey);
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
if (transformedColumn.field === 'command') {
|
|
219
|
-
return {
|
|
220
|
-
...transformedColumn,
|
|
221
|
-
onCell: () => ({
|
|
222
|
-
className: 'cell-number',
|
|
223
|
-
style: {
|
|
224
|
-
padding: '2px 8px'
|
|
225
|
-
}
|
|
226
|
-
})
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
return {
|
|
230
|
-
...transformedColumn,
|
|
231
|
-
...(transformedColumn.allowFiltering === false ? {} : {
|
|
232
|
-
...getColumnSearchProps(col)
|
|
233
|
-
}),
|
|
234
|
-
sorter: col.sorter === false ? undefined : {
|
|
235
|
-
compare: a => a,
|
|
236
|
-
multiple: sortMultiple ? colIndex : undefined
|
|
237
|
-
},
|
|
238
|
-
sortIcon: args => {
|
|
239
|
-
const {
|
|
240
|
-
sortOrder
|
|
241
|
-
} = args;
|
|
242
|
-
return /*#__PURE__*/React.createElement(_react.Fragment, null, !sortOrder && /*#__PURE__*/React.createElement(_becoxyIcons.ArrowUp, {
|
|
243
|
-
fontSize: 15,
|
|
244
|
-
style: {
|
|
245
|
-
display: 'flex',
|
|
246
|
-
opacity: 0,
|
|
247
|
-
marginLeft: 4
|
|
248
|
-
},
|
|
249
|
-
className: (0, _classnames.default)(`ui-rc-table-column-sorter-up`, {
|
|
250
|
-
active: true
|
|
251
|
-
})
|
|
252
|
-
}), sortOrder === ASCEND && /*#__PURE__*/React.createElement("span", {
|
|
253
|
-
className: (0, _classnames.default)(`ui-rc-table-column-sorter-up`, {
|
|
254
|
-
active: sortOrder === ASCEND
|
|
255
|
-
}),
|
|
256
|
-
style: {
|
|
257
|
-
display: 'flex',
|
|
258
|
-
marginLeft: 4
|
|
259
|
-
}
|
|
260
|
-
}, /*#__PURE__*/React.createElement(_becoxyIcons.ArrowUp, {
|
|
261
|
-
fontSize: 15,
|
|
262
|
-
color: '#000'
|
|
263
|
-
})), sortOrder === DESCEND && /*#__PURE__*/React.createElement("span", {
|
|
264
|
-
className: (0, _classnames.default)(`ui-rc-table-column-sorter-up`, {
|
|
265
|
-
active: sortOrder === DESCEND
|
|
266
|
-
}),
|
|
267
|
-
style: {
|
|
268
|
-
display: 'flex',
|
|
269
|
-
marginLeft: 4
|
|
270
|
-
}
|
|
271
|
-
}, /*#__PURE__*/React.createElement(_becoxyIcons.ArrowDown, {
|
|
272
|
-
fontSize: 15,
|
|
273
|
-
color: '#000'
|
|
274
|
-
})));
|
|
275
|
-
},
|
|
276
|
-
onHeaderCell: () => ({
|
|
277
|
-
id: `${col.field}`,
|
|
278
|
-
width: col.width,
|
|
279
|
-
onResize: handleResize?.(col),
|
|
280
|
-
className: col.headerTextAlign === 'center' ? 'head-align-center' : col.headerTextAlign === 'right' ? 'head-align-right' : ''
|
|
281
|
-
}),
|
|
282
|
-
onCell: (data, index) => {
|
|
283
|
-
return {
|
|
284
|
-
id: `${col.field}`,
|
|
285
|
-
colSpan: groupColumns && data.children && col.field === firstNonGroupColumn?.field ? 2 : groupColumns && data.children && nonGroupColumns[1].field === col.field ? 0 : 1,
|
|
286
|
-
zIndex: data.children && col.field === firstNonGroupColumn?.field ? 11 : undefined,
|
|
287
|
-
...transformedColumn?.onCell?.(data, index),
|
|
288
|
-
className: (0, _classnames.default)(transformedColumn?.onCell?.(data, index).className ?? '', {
|
|
289
|
-
'cell-group': groupColumns && data.children,
|
|
290
|
-
'cell-group-fixed': groupColumns && data.children && col.field === firstNonGroupColumn?.field
|
|
291
|
-
})
|
|
292
|
-
// onMouseEnter: () => {
|
|
293
|
-
// onMouseHover(data, col as any)
|
|
294
|
-
// },
|
|
295
|
-
};
|
|
296
|
-
},
|
|
297
|
-
render: (value, record, rowIndex) => {
|
|
298
|
-
const colFormat = typeof col.format === 'function' ? col.format(record) : col.format;
|
|
299
|
-
const cellFormat = (0, _utils.getFormat)(colFormat, format);
|
|
300
|
-
if (groupSetting && groupSetting.hiddenColumnGroup === false) {
|
|
301
|
-
if (record.children) {
|
|
302
|
-
return (0, _columns.renderContent)(col, value, record, rowIndex, colIndex, false, cellFormat);
|
|
303
|
-
}
|
|
304
|
-
if (groupColumns?.includes(col.field)) {
|
|
305
|
-
return '';
|
|
306
|
-
}
|
|
307
|
-
return (0, _columns.renderContent)(col, value, record, rowIndex, colIndex, false, cellFormat);
|
|
308
|
-
}
|
|
309
|
-
if (col.field === firstNonGroupColumn?.field && record.children) {
|
|
310
|
-
const currentGroupColumn = (0, _columns.flatColumns2)(cols).find(it => it.field === record.field);
|
|
311
|
-
if (currentGroupColumn?.template) {
|
|
312
|
-
return (0, _columns.renderContent)(currentGroupColumn, record[record.field], record, rowIndex, colIndex, false, cellFormat);
|
|
313
|
-
}
|
|
314
|
-
return /*#__PURE__*/React.createElement("span", null, currentGroupColumn?.headerText, ": ", (0, _columns.renderContent)(currentGroupColumn, record[record.field], record, rowIndex, colIndex, false, cellFormat));
|
|
315
|
-
}
|
|
316
|
-
return (0, _columns.renderContent)(col, value, record, rowIndex, colIndex, false, cellFormat);
|
|
317
|
-
},
|
|
318
|
-
hidden: groupSetting && groupSetting.hiddenColumnGroup === false ? transformedColumn.hidden : groupAble && groupColumns && groupColumns.includes(col.field) ? true : transformedColumn.hidden
|
|
319
|
-
};
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
return convertColumns(cloneColumns);
|
|
323
|
-
}, [groupColumns, getColumnSearchProps, sortMultiple, groupSetting, groupAble, t, dataSource, rowKey, handleResize, format]
|
|
324
|
-
// format, getColumnSearchProps, sortMultiple, groupSetting, groupAble, t, groupColumns, , handleResize, , t, cellHover
|
|
325
|
-
);
|
|
326
|
-
return [transformColumns];
|
|
327
|
-
};
|
|
328
|
-
var _default = exports.default = useColumns;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IFormat } from "../type";
|
|
3
|
-
type Props = {
|
|
4
|
-
t?: any;
|
|
5
|
-
format?: IFormat;
|
|
6
|
-
value: number | string | undefined;
|
|
7
|
-
onChange?: (values: any[]) => void;
|
|
8
|
-
};
|
|
9
|
-
declare const NumberInput: (props: Props) => React.JSX.Element;
|
|
10
|
-
export default NumberInput;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNumericComponent = require("react-numeric-component");
|
|
9
|
-
var _rcMasterUi = require("rc-master-ui");
|
|
10
|
-
var _hooks = require("../hooks");
|
|
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
|
-
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
|
-
const NumberInput = props => {
|
|
14
|
-
const {
|
|
15
|
-
t,
|
|
16
|
-
value,
|
|
17
|
-
format,
|
|
18
|
-
onChange
|
|
19
|
-
} = props;
|
|
20
|
-
const values = _react.default.useMemo(() => [value], [value]);
|
|
21
|
-
|
|
22
|
-
// const [values, setValues] = React.useState<any[]>(() =>
|
|
23
|
-
// mergedValues,
|
|
24
|
-
// );
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNumericComponent.NumericFormat, {
|
|
27
|
-
value: values[0] ?? ''
|
|
28
|
-
// value={min}
|
|
29
|
-
,
|
|
30
|
-
thousandSeparator: (0, _hooks.checkThousandSeparator)(format?.thousandSeparator, format?.decimalSeparator),
|
|
31
|
-
decimalSeparator: (0, _hooks.checkDecimalSeparator)(format?.thousandSeparator, format?.decimalSeparator),
|
|
32
|
-
allowNegative: true,
|
|
33
|
-
customInput: _rcMasterUi.Input,
|
|
34
|
-
className: 'rounded-0 input-element',
|
|
35
|
-
onValueChange: vals => {
|
|
36
|
-
// onChangeValueFilter(type, values.floatValue, 'min')
|
|
37
|
-
|
|
38
|
-
// setValues([vals.floatValue, values[1]])
|
|
39
|
-
onChange?.([vals.floatValue]);
|
|
40
|
-
}
|
|
41
|
-
// placeholder={t ? t('Min') : 'Min'}
|
|
42
|
-
,
|
|
43
|
-
placeholder: t ? t('Enter') : 'Enter',
|
|
44
|
-
autoFocus: true
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
var _default = exports.default = NumberInput;
|