es-grid-template 1.7.22 → 1.7.24
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/GridStyle.js +1 -1
- package/es/grid-component/InternalTable.js +5 -1
- package/es/grid-component/TableGrid.js +2 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +3 -1
- package/es/table-component/ColumnsChoose.d.ts +10 -0
- package/es/table-component/ColumnsChoose.js +557 -0
- package/es/table-component/ContextMenu.d.ts +20 -0
- package/es/table-component/ContextMenu.js +75 -0
- package/es/table-component/InternalTable.d.ts +9 -0
- package/es/table-component/InternalTable.js +295 -0
- package/es/table-component/TableContainer.d.ts +22 -0
- package/es/table-component/TableContainer.js +130 -0
- package/es/table-component/TableContainerEdit.d.ts +28 -0
- package/es/table-component/TableContainerEdit.js +1211 -0
- package/es/table-component/body/EditableCell.d.ts +16 -0
- package/es/table-component/body/EditableCell.js +1036 -0
- package/es/table-component/body/TableBody.d.ts +19 -0
- package/es/table-component/body/TableBody.js +64 -0
- package/es/table-component/body/TableBodyCell.d.ts +10 -0
- package/es/table-component/body/TableBodyCell.js +139 -0
- package/es/table-component/body/TableBodyCellEdit.d.ts +15 -0
- package/es/table-component/body/TableBodyCellEdit.js +814 -0
- package/es/table-component/body/TableBodyRow.d.ts +21 -0
- package/es/table-component/body/TableBodyRow.js +146 -0
- package/es/table-component/components/ControlCheckbox.d.ts +13 -0
- package/es/table-component/components/ControlCheckbox.js +87 -0
- package/es/table-component/components/EditForm/EditForm.d.ts +27 -0
- package/es/table-component/components/EditForm/EditForm.js +395 -0
- package/es/table-component/components/EditForm/index.d.ts +1 -0
- package/es/table-component/components/EditForm/index.js +1 -0
- package/es/table-component/components/InputControl/InputControl.d.ts +27 -0
- package/es/table-component/components/InputControl/InputControl.js +121 -0
- package/es/table-component/components/InputControl/index.d.ts +1 -0
- package/es/table-component/components/InputControl/index.js +1 -0
- package/es/table-component/components/async-select/index.d.ts +11 -0
- package/es/table-component/components/async-select/index.js +41 -0
- package/es/table-component/components/async-table-select/index.d.ts +11 -0
- package/es/table-component/components/async-table-select/index.js +43 -0
- package/es/table-component/components/checkbox-control/index.d.ts +13 -0
- package/es/table-component/components/checkbox-control/index.js +40 -0
- package/es/table-component/components/checkbox-filter/CheckboxFilter.d.ts +18 -0
- package/es/table-component/components/checkbox-filter/CheckboxFilter.js +240 -0
- package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +12 -0
- package/es/table-component/components/checkbox-filter/FilterSearch.js +36 -0
- package/es/table-component/components/command/Command.d.ts +9 -0
- package/es/table-component/components/command/Command.js +28 -0
- package/es/table-component/components/number/index.d.ts +10 -0
- package/es/table-component/components/number/index.js +42 -0
- package/es/table-component/components/number-range/index.d.ts +11 -0
- package/es/table-component/components/number-range/index.js +66 -0
- package/es/table-component/features/operator.d.ts +24 -0
- package/es/table-component/features/operator.js +62 -0
- package/es/table-component/footer/TableFooter.d.ts +13 -0
- package/es/table-component/footer/TableFooter.js +33 -0
- package/es/table-component/footer/TableFooterCell.d.ts +10 -0
- package/es/table-component/footer/TableFooterCell.js +24 -0
- package/es/table-component/footer/TableFooterRow.d.ts +14 -0
- package/es/table-component/footer/TableFooterRow.js +71 -0
- package/es/table-component/header/TableHead.d.ts +14 -0
- package/es/table-component/header/TableHead.js +60 -0
- package/es/table-component/header/TableHeadCell.d.ts +14 -0
- package/es/table-component/header/TableHeadCell.js +324 -0
- package/es/table-component/header/TableHeadRow.d.ts +16 -0
- package/es/table-component/header/TableHeadRow.js +86 -0
- package/es/table-component/header/renderFilter.d.ts +20 -0
- package/es/table-component/header/renderFilter.js +281 -0
- package/es/table-component/hook/constant.d.ts +73 -0
- package/es/table-component/hook/constant.js +240 -0
- package/es/table-component/hook/useColumns.d.ts +11 -0
- package/es/table-component/hook/useColumns.js +209 -0
- package/es/table-component/hook/useFilterOperator.d.ts +7 -0
- package/es/table-component/hook/useFilterOperator.js +33 -0
- package/es/table-component/hook/utils.d.ts +121 -0
- package/es/table-component/hook/utils.js +1727 -0
- package/es/table-component/index.d.ts +5 -0
- package/es/table-component/index.js +2 -0
- package/es/table-component/style.scss +1083 -0
- package/es/table-component/table/Grid.d.ts +23 -0
- package/es/table-component/table/Grid.js +310 -0
- package/es/table-component/table/GridEdit.d.ts +23 -0
- package/es/table-component/table/GridEdit.js +282 -0
- package/es/table-component/type.d.ts +482 -0
- package/es/table-component/type.js +1 -0
- package/es/table-component/useContext.d.ts +119 -0
- package/es/table-component/useContext.js +61 -0
- package/lib/grid-component/GridStyle.js +1 -1
- package/lib/grid-component/InternalTable.js +5 -1
- package/lib/grid-component/TableGrid.js +2 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -1
- package/lib/table-component/ColumnsChoose.d.ts +10 -0
- package/lib/table-component/ColumnsChoose.js +568 -0
- package/lib/table-component/ContextMenu.d.ts +20 -0
- package/lib/table-component/ContextMenu.js +85 -0
- package/lib/table-component/InternalTable.d.ts +9 -0
- package/lib/table-component/InternalTable.js +299 -0
- package/lib/table-component/TableContainer.d.ts +22 -0
- package/lib/table-component/TableContainer.js +137 -0
- package/lib/table-component/TableContainerEdit.d.ts +28 -0
- package/lib/table-component/TableContainerEdit.js +1220 -0
- package/lib/table-component/body/EditableCell.d.ts +16 -0
- package/lib/table-component/body/EditableCell.js +1038 -0
- package/lib/table-component/body/TableBody.d.ts +19 -0
- package/lib/table-component/body/TableBody.js +72 -0
- package/lib/table-component/body/TableBodyCell.d.ts +10 -0
- package/lib/table-component/body/TableBodyCell.js +148 -0
- package/lib/table-component/body/TableBodyCellEdit.d.ts +15 -0
- package/lib/table-component/body/TableBodyCellEdit.js +821 -0
- package/lib/table-component/body/TableBodyRow.d.ts +21 -0
- package/lib/table-component/body/TableBodyRow.js +153 -0
- package/lib/table-component/components/ControlCheckbox.d.ts +13 -0
- package/lib/table-component/components/ControlCheckbox.js +95 -0
- package/lib/table-component/components/EditForm/EditForm.d.ts +27 -0
- package/lib/table-component/components/EditForm/EditForm.js +406 -0
- package/lib/table-component/components/EditForm/index.d.ts +1 -0
- package/lib/table-component/components/EditForm/index.js +16 -0
- package/lib/table-component/components/InputControl/InputControl.d.ts +27 -0
- package/lib/table-component/components/InputControl/InputControl.js +131 -0
- package/lib/table-component/components/InputControl/index.d.ts +1 -0
- package/lib/table-component/components/InputControl/index.js +16 -0
- package/lib/table-component/components/async-select/index.d.ts +11 -0
- package/lib/table-component/components/async-select/index.js +49 -0
- package/lib/table-component/components/async-table-select/index.d.ts +11 -0
- package/lib/table-component/components/async-table-select/index.js +51 -0
- package/lib/table-component/components/checkbox-control/index.d.ts +13 -0
- package/lib/table-component/components/checkbox-control/index.js +48 -0
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.d.ts +18 -0
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +249 -0
- package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +12 -0
- package/lib/table-component/components/checkbox-filter/FilterSearch.js +44 -0
- package/lib/table-component/components/command/Command.d.ts +9 -0
- package/lib/table-component/components/command/Command.js +37 -0
- package/lib/table-component/components/number/index.d.ts +10 -0
- package/lib/table-component/components/number/index.js +50 -0
- package/lib/table-component/components/number-range/index.d.ts +11 -0
- package/lib/table-component/components/number-range/index.js +74 -0
- package/lib/table-component/features/operator.d.ts +24 -0
- package/lib/table-component/features/operator.js +67 -0
- package/lib/table-component/footer/TableFooter.d.ts +13 -0
- package/lib/table-component/footer/TableFooter.js +42 -0
- package/lib/table-component/footer/TableFooterCell.d.ts +10 -0
- package/lib/table-component/footer/TableFooterCell.js +32 -0
- package/lib/table-component/footer/TableFooterRow.d.ts +14 -0
- package/lib/table-component/footer/TableFooterRow.js +79 -0
- package/lib/table-component/header/TableHead.d.ts +14 -0
- package/lib/table-component/header/TableHead.js +69 -0
- package/lib/table-component/header/TableHeadCell.d.ts +14 -0
- package/lib/table-component/header/TableHeadCell.js +333 -0
- package/lib/table-component/header/TableHeadRow.d.ts +16 -0
- package/lib/table-component/header/TableHeadRow.js +94 -0
- package/lib/table-component/header/renderFilter.d.ts +20 -0
- package/lib/table-component/header/renderFilter.js +291 -0
- package/lib/table-component/hook/constant.d.ts +73 -0
- package/lib/table-component/hook/constant.js +247 -0
- package/lib/table-component/hook/useColumns.d.ts +11 -0
- package/lib/table-component/hook/useColumns.js +220 -0
- package/lib/table-component/hook/useFilterOperator.d.ts +7 -0
- package/lib/table-component/hook/useFilterOperator.js +40 -0
- package/lib/table-component/hook/utils.d.ts +121 -0
- package/lib/table-component/hook/utils.js +1817 -0
- package/lib/table-component/index.d.ts +5 -0
- package/lib/table-component/index.js +9 -0
- package/lib/table-component/style.scss +1083 -0
- package/lib/table-component/table/Grid.d.ts +23 -0
- package/lib/table-component/table/Grid.js +313 -0
- package/lib/table-component/table/GridEdit.d.ts +23 -0
- package/lib/table-component/table/GridEdit.js +284 -0
- package/lib/table-component/type.d.ts +482 -0
- package/lib/table-component/type.js +5 -0
- package/lib/table-component/useContext.d.ts +119 -0
- package/lib/table-component/useContext.js +67 -0
- package/package.json +3 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
|
|
2
|
+
import type { Column, Row, Table } from "@tanstack/react-table";
|
|
3
|
+
import type { CommandClick } from "../type";
|
|
4
|
+
import React from "react";
|
|
5
|
+
interface TableBodyRowProps<T> {
|
|
6
|
+
tableId: string;
|
|
7
|
+
table: Table<T>;
|
|
8
|
+
columnVirtualizer: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
|
|
9
|
+
row: Row<T>;
|
|
10
|
+
rowVirtualizer: Virtualizer<HTMLDivElement, HTMLTableRowElement>;
|
|
11
|
+
virtualPaddingLeft: number | undefined;
|
|
12
|
+
virtualPaddingRight: number | undefined;
|
|
13
|
+
virtualRow: VirtualItem;
|
|
14
|
+
fixedLeftColumns: Column<T, unknown>[];
|
|
15
|
+
fixedRightColumns: Column<T, unknown>[];
|
|
16
|
+
commandClick?: (args: CommandClick) => void;
|
|
17
|
+
editAble?: boolean;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
declare const TableBodyRow: <RecordType extends object>({ tableId, table, columnVirtualizer, row, rowVirtualizer, virtualPaddingLeft, virtualPaddingRight, virtualRow, fixedLeftColumns, fixedRightColumns, commandClick, editAble, isEditing, contextMenuItems, ...rest }: TableBodyRowProps<RecordType>) => React.JSX.Element;
|
|
21
|
+
export default TableBodyRow;
|
|
@@ -0,0 +1,153 @@
|
|
|
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 _TableBodyCell = _interopRequireDefault(require("./TableBodyCell"));
|
|
10
|
+
var _TableBodyCellEdit = _interopRequireDefault(require("./TableBodyCellEdit"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _useContext = require("../useContext");
|
|
13
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
const TableBodyRow = ({
|
|
15
|
+
tableId,
|
|
16
|
+
table,
|
|
17
|
+
columnVirtualizer,
|
|
18
|
+
row,
|
|
19
|
+
rowVirtualizer,
|
|
20
|
+
virtualPaddingLeft,
|
|
21
|
+
virtualPaddingRight,
|
|
22
|
+
virtualRow,
|
|
23
|
+
fixedLeftColumns,
|
|
24
|
+
fixedRightColumns,
|
|
25
|
+
commandClick,
|
|
26
|
+
editAble,
|
|
27
|
+
isEditing,
|
|
28
|
+
contextMenuItems,
|
|
29
|
+
...rest
|
|
30
|
+
}) => {
|
|
31
|
+
const {
|
|
32
|
+
prefix,
|
|
33
|
+
recordDoubleClick,
|
|
34
|
+
onContextMenu
|
|
35
|
+
} = _react.default.useContext(_useContext.TableContext);
|
|
36
|
+
const visibleCells = row.getVisibleCells();
|
|
37
|
+
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
38
|
+
|
|
39
|
+
// table.options.set
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
42
|
+
"data-index": virtualRow.index //needed for dynamic row height measurement
|
|
43
|
+
,
|
|
44
|
+
ref: node => rowVirtualizer.measureElement(node) //measure dynamic row height
|
|
45
|
+
,
|
|
46
|
+
key: row.id
|
|
47
|
+
|
|
48
|
+
// className={} ui-rc-table-row-selected
|
|
49
|
+
,
|
|
50
|
+
className: (0, _classnames.default)(`${prefix}-grid-row`, {
|
|
51
|
+
[`${prefix}-grid-row-selected`]: row.getIsSelected()
|
|
52
|
+
}),
|
|
53
|
+
style: {
|
|
54
|
+
// display: 'flex',
|
|
55
|
+
// position: 'absolute',
|
|
56
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
57
|
+
//this should always be a `style` as it changes on scroll
|
|
58
|
+
// width: '100%',
|
|
59
|
+
// height: isEditing ? '36px' : undefined,
|
|
60
|
+
height: isEditing ? virtualRow.size : undefined,
|
|
61
|
+
minHeight: isEditing ? undefined : virtualRow.size
|
|
62
|
+
},
|
|
63
|
+
onDoubleClick: e => {
|
|
64
|
+
recordDoubleClick?.({
|
|
65
|
+
e,
|
|
66
|
+
rowData: row.original,
|
|
67
|
+
rowIndex: row.index
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
onContextMenu: e => {
|
|
71
|
+
if (contextMenuItems && contextMenuItems.length) {
|
|
72
|
+
onContextMenu?.(row.original)(e);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// onContextMenu={onContextMenu(row.original)}
|
|
77
|
+
}, fixedLeftColumns.length > 0 ? fixedLeftColumns.map(column => {
|
|
78
|
+
const cell = row.getVisibleCells().find(c => c.column.id === column.id);
|
|
79
|
+
if (editAble) {
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCellEdit.default, (0, _extends2.default)({}, rest, {
|
|
81
|
+
table: table,
|
|
82
|
+
tableId: tableId,
|
|
83
|
+
key: cell.id,
|
|
84
|
+
cell: cell,
|
|
85
|
+
commandClick: commandClick,
|
|
86
|
+
isEditing: isEditing,
|
|
87
|
+
rowVirtualizer: rowVirtualizer,
|
|
88
|
+
columnVirtualizer: columnVirtualizer
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, {
|
|
92
|
+
key: column.id,
|
|
93
|
+
table: table,
|
|
94
|
+
cell: row.getVisibleCells().find(c => c.column.id === column.id),
|
|
95
|
+
commandClick: commandClick
|
|
96
|
+
});
|
|
97
|
+
}) : null, virtualPaddingLeft ? /*#__PURE__*/_react.default.createElement("td", {
|
|
98
|
+
className: "",
|
|
99
|
+
style: {
|
|
100
|
+
display: "flex",
|
|
101
|
+
width: virtualPaddingLeft
|
|
102
|
+
}
|
|
103
|
+
}) : null, virtualColumns.map(vc => {
|
|
104
|
+
const cell = visibleCells[vc.index];
|
|
105
|
+
const isFixed = table.getState().columnPinning.left?.includes(cell.column.id) || table.getState().columnPinning.right?.includes(cell.column.id);
|
|
106
|
+
if (cell && !isFixed) {
|
|
107
|
+
if (editAble) {
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCellEdit.default, (0, _extends2.default)({}, rest, {
|
|
109
|
+
table: table,
|
|
110
|
+
key: cell.id,
|
|
111
|
+
tableId: tableId,
|
|
112
|
+
cell: cell,
|
|
113
|
+
commandClick: commandClick,
|
|
114
|
+
isEditing: isEditing,
|
|
115
|
+
rowVirtualizer: rowVirtualizer,
|
|
116
|
+
columnVirtualizer: columnVirtualizer
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, {
|
|
120
|
+
table: table,
|
|
121
|
+
key: cell.id,
|
|
122
|
+
cell: cell,
|
|
123
|
+
commandClick: commandClick
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}), fixedRightColumns.length > 0 ? fixedRightColumns.map(column => {
|
|
127
|
+
if (editAble) {
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCellEdit.default, (0, _extends2.default)({}, rest, {
|
|
129
|
+
table: table,
|
|
130
|
+
key: column.id,
|
|
131
|
+
tableId: tableId,
|
|
132
|
+
cell: row.getVisibleCells().find(c => c.column.id === column.id),
|
|
133
|
+
commandClick: commandClick,
|
|
134
|
+
isEditing: isEditing,
|
|
135
|
+
rowVirtualizer: rowVirtualizer,
|
|
136
|
+
columnVirtualizer: columnVirtualizer
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, {
|
|
140
|
+
key: column.id,
|
|
141
|
+
table: table,
|
|
142
|
+
cell: row.getVisibleCells().find(c => c.column.id === column.id),
|
|
143
|
+
commandClick: commandClick
|
|
144
|
+
});
|
|
145
|
+
}) : null, virtualPaddingRight ? /*#__PURE__*/_react.default.createElement("td", {
|
|
146
|
+
className: "",
|
|
147
|
+
style: {
|
|
148
|
+
display: "flex",
|
|
149
|
+
width: virtualPaddingRight
|
|
150
|
+
}
|
|
151
|
+
}) : null);
|
|
152
|
+
};
|
|
153
|
+
var _default = exports.default = TableBodyRow;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ColumnTable } from "../type";
|
|
3
|
+
type Props = {
|
|
4
|
+
column: ColumnTable;
|
|
5
|
+
record?: any;
|
|
6
|
+
rowIndex: number;
|
|
7
|
+
colIndex: number;
|
|
8
|
+
checkValue: any;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
editAble?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const ControlCheckbox: (props: Props) => React.JSX.Element;
|
|
13
|
+
export default ControlCheckbox;
|
|
@@ -0,0 +1,95 @@
|
|
|
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 _rcMasterUi = require("rc-master-ui");
|
|
9
|
+
var _useContext = require("../useContext");
|
|
10
|
+
var _utils = require("../hook/utils");
|
|
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
|
+
rowKey
|
|
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 = record[rowKey];
|
|
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,
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
id?: string;
|
|
4
|
+
externalClick?: any;
|
|
5
|
+
menuPortalTarget?: any;
|
|
6
|
+
value: any;
|
|
7
|
+
onChange: (props: any) => void;
|
|
8
|
+
filterKey?: string;
|
|
9
|
+
customRender?: any;
|
|
10
|
+
filterHeaderKey?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
invalid?: any;
|
|
13
|
+
menuHeight?: number;
|
|
14
|
+
menuWidth?: number;
|
|
15
|
+
classNamePrefix?: string;
|
|
16
|
+
cellFocus?: boolean;
|
|
17
|
+
t?: any;
|
|
18
|
+
column: any;
|
|
19
|
+
fieldKey?: any;
|
|
20
|
+
rowData: any;
|
|
21
|
+
indexRow: any;
|
|
22
|
+
template?: any;
|
|
23
|
+
onKeyDown?: (event: any) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const SelectStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
|
+
export declare const EditForm: (props: Props) => React.JSX.Element;
|
|
27
|
+
export {};
|