es-grid-template 1.8.72 → 1.8.73
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/type.d.ts +1 -3
- package/es/group-component/hook/utils.d.ts +8 -8
- package/es/group-component/table/Grid.js +2 -1
- package/es/table-component/InternalTable.js +5 -3
- package/es/table-component/TableContainer.d.ts +1 -0
- package/es/table-component/TableContainer.js +4 -2
- package/es/table-component/TableContainerEdit.d.ts +1 -0
- package/es/table-component/TableContainerEdit.js +4 -2
- package/es/table-component/body/TableBodyCellEdit.js +9 -6
- package/es/table-component/header/TableHeadCell2.js +39 -3
- package/es/table-component/style.js +1 -1
- package/es/table-component/table/Grid.d.ts +1 -0
- package/es/table-component/table/Grid.js +7 -3
- package/es/table-component/useContext.d.ts +1 -0
- package/es/table-component/useContext.js +2 -1
- package/lib/grid-component/type.d.ts +1 -3
- package/lib/group-component/table/Grid.js +2 -1
- package/lib/table-component/InternalTable.js +5 -3
- package/lib/table-component/TableContainer.d.ts +1 -0
- package/lib/table-component/TableContainer.js +4 -2
- package/lib/table-component/TableContainerEdit.d.ts +1 -0
- package/lib/table-component/TableContainerEdit.js +4 -2
- package/lib/table-component/body/TableBodyCellEdit.js +9 -6
- package/lib/table-component/header/TableHeadCell2.js +38 -2
- package/lib/table-component/style.js +1 -1
- package/lib/table-component/table/Grid.d.ts +1 -0
- package/lib/table-component/table/Grid.js +7 -3
- package/lib/table-component/useContext.d.ts +1 -0
- package/lib/table-component/useContext.js +2 -1
- package/package.json +1 -1
|
@@ -290,14 +290,12 @@ export type ExpandableConfig<RecordType> = {
|
|
|
290
290
|
onExpand?: (expanded: boolean, record: RecordType) => void;
|
|
291
291
|
onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void;
|
|
292
292
|
defaultExpandAllRows?: boolean;
|
|
293
|
-
indentSize?: number;
|
|
294
293
|
expandIconColumnIndex?: number;
|
|
294
|
+
showExpandAll?: boolean;
|
|
295
295
|
showExpandColumn?: boolean;
|
|
296
296
|
expandedRowClassName?: string | RowClassName<RecordType>;
|
|
297
297
|
childrenColumnName?: string;
|
|
298
298
|
rowExpandable?: (record: RecordType) => boolean;
|
|
299
|
-
columnWidth?: number | string;
|
|
300
|
-
fixed?: FixedType;
|
|
301
299
|
};
|
|
302
300
|
export type RenderExpandIcon<RecordType> = (props: RenderExpandIconProps<RecordType>) => React.ReactNode;
|
|
303
301
|
export interface RenderExpandIconProps<RecordType> {
|
|
@@ -165,7 +165,7 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
165
165
|
type?: IColumnType;
|
|
166
166
|
haveSum?: boolean;
|
|
167
167
|
isSummary?: boolean;
|
|
168
|
-
summaryTemplate?: (data: number, key: string) => import("react").
|
|
168
|
+
summaryTemplate?: (data: number, key: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode;
|
|
169
169
|
format?: IFormat | ((rowData: any) => IFormat);
|
|
170
170
|
allowFiltering?: boolean;
|
|
171
171
|
sorter?: boolean;
|
|
@@ -180,18 +180,18 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
180
180
|
headerText?: string;
|
|
181
181
|
hidden?: boolean;
|
|
182
182
|
visible?: boolean;
|
|
183
|
-
headerTooltip?: string | boolean | (() => import("react").
|
|
183
|
+
headerTooltip?: string | boolean | (() => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
|
|
184
184
|
columnGroupText?: string;
|
|
185
185
|
align?: import("./../../grid-component/type").ITextAlign;
|
|
186
186
|
textAlign?: import("./../../grid-component/type").ITextAlign;
|
|
187
187
|
headerTextAlign?: import("./../../grid-component/type").ITextAlign;
|
|
188
|
-
template?: import("react").
|
|
188
|
+
template?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
|
|
189
189
|
showTooltip?: boolean;
|
|
190
190
|
tooltipDescription?: string | ((args: {
|
|
191
191
|
value: any;
|
|
192
192
|
record: RecordType;
|
|
193
|
-
}) => import("react").
|
|
194
|
-
headerTemplate?: import("react").
|
|
193
|
+
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
|
|
194
|
+
headerTemplate?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode | ((column: ColumnTable<RecordType>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
|
|
195
195
|
commandItems?: import("./../../grid-component/type").CommandItem[];
|
|
196
196
|
children?: ColumnTable<RecordType>[];
|
|
197
197
|
editType?: EditType | ((rowData?: RecordType) => EditType);
|
|
@@ -211,9 +211,9 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
211
211
|
ellipsis?: boolean;
|
|
212
212
|
allowResizing?: boolean;
|
|
213
213
|
allowSelection?: boolean | ((rowData: RecordType) => boolean);
|
|
214
|
-
onCellStyles?: Omit<CSSProperties, "
|
|
215
|
-
onCellHeaderStyles?: Omit<CSSProperties, "
|
|
216
|
-
onCellFooterStyles?: Omit<CSSProperties, "
|
|
214
|
+
onCellStyles?: Omit<CSSProperties, "display" | "left" | "minWidth" | "position" | "right" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "display" | "left" | "minWidth" | "position" | "right" | "width">);
|
|
215
|
+
onCellHeaderStyles?: Omit<CSSProperties, "display" | "left" | "minWidth" | "position" | "right" | "width"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "display" | "left" | "minWidth" | "position" | "right" | "width">);
|
|
216
|
+
onCellFooterStyles?: Omit<CSSProperties, "display" | "left" | "minWidth" | "position" | "right" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "display" | "left" | "minWidth" | "position" | "right" | "width">);
|
|
217
217
|
sumGroup?: boolean;
|
|
218
218
|
onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
|
|
219
219
|
}[];
|
|
@@ -310,7 +310,8 @@ const Grid = props => {
|
|
|
310
310
|
},
|
|
311
311
|
className: classNames(`${prefix}-grid ${tableClassNames}`, {
|
|
312
312
|
[`${prefix}-grid-light`]: !theme || theme.theme === 'light',
|
|
313
|
-
[`${prefix}-grid-dark`]: theme?.theme === 'dark'
|
|
313
|
+
[`${prefix}-grid-dark`]: theme?.theme === 'dark',
|
|
314
|
+
[`${prefix}-grid-editable`]: editAble
|
|
314
315
|
}),
|
|
315
316
|
style: {
|
|
316
317
|
minHeight: minHeight ?? undefined,
|
|
@@ -69,6 +69,7 @@ const InternalTable = props => {
|
|
|
69
69
|
const [sorterStates, setSorterStates] = React.useState([]);
|
|
70
70
|
const [isFullScreen, setIsFullScreen] = React.useState(false);
|
|
71
71
|
const [columns, setColumns] = React.useState([]);
|
|
72
|
+
const [isExpandClick, setIsExpandClick] = React.useState(false);
|
|
72
73
|
React.useEffect(() => {
|
|
73
74
|
// setColumns(propsColumns as any)
|
|
74
75
|
|
|
@@ -106,7 +107,7 @@ const InternalTable = props => {
|
|
|
106
107
|
value: undefined
|
|
107
108
|
});
|
|
108
109
|
React.useEffect(() => {
|
|
109
|
-
if (onExpandClick) {
|
|
110
|
+
if (onExpandClick || isExpandClick) {
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
113
|
if (defaultExpandAllRows) {
|
|
@@ -117,7 +118,7 @@ const InternalTable = props => {
|
|
|
117
118
|
setExpanded(convertToObjTrue(defaultExpandedRowKeys ?? []));
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
}, [defaultExpandAllRows, convertData, defaultExpandedRowKeys, onExpandClick]);
|
|
121
|
+
}, [defaultExpandAllRows, convertData, defaultExpandedRowKeys, onExpandClick, isExpandClick]);
|
|
121
122
|
|
|
122
123
|
// ========================= Keys =========================
|
|
123
124
|
|
|
@@ -186,7 +187,8 @@ const InternalTable = props => {
|
|
|
186
187
|
mergedSelectedKeys: mergedSelectedKeys,
|
|
187
188
|
expandable: expandable,
|
|
188
189
|
onExpandClick: onExpandClick,
|
|
189
|
-
setColumns: setColumns
|
|
190
|
+
setColumns: setColumns,
|
|
191
|
+
setIsExpandClick: setIsExpandClick
|
|
190
192
|
})));
|
|
191
193
|
};
|
|
192
194
|
export default InternalTable;
|
|
@@ -41,6 +41,7 @@ type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
|
|
|
41
41
|
isDataTree: boolean;
|
|
42
42
|
setColumnSizing: Dispatch<SetStateAction<any>>;
|
|
43
43
|
setColumns: Dispatch<SetStateAction<any>>;
|
|
44
|
+
setIsExpandClick: Dispatch<SetStateAction<boolean>>;
|
|
44
45
|
columnSizingInfo: ColumnSizingInfoState;
|
|
45
46
|
columnSizing: ColumnSizingState;
|
|
46
47
|
};
|
|
@@ -70,7 +70,8 @@ const TableContainer = props => {
|
|
|
70
70
|
onRowHeaderStyles,
|
|
71
71
|
title,
|
|
72
72
|
dataSourceFilter,
|
|
73
|
-
onExpandClick
|
|
73
|
+
onExpandClick,
|
|
74
|
+
setIsExpandClick
|
|
74
75
|
} = props;
|
|
75
76
|
const tableContainerRef = React.useRef(null);
|
|
76
77
|
const containerRef = React.useRef(null);
|
|
@@ -274,7 +275,8 @@ const TableContainer = props => {
|
|
|
274
275
|
table,
|
|
275
276
|
pagination,
|
|
276
277
|
dataSourceFilter,
|
|
277
|
-
onExpandClick
|
|
278
|
+
onExpandClick,
|
|
279
|
+
setIsExpandClick
|
|
278
280
|
}
|
|
279
281
|
}, /*#__PURE__*/React.createElement(TableWrapper, {
|
|
280
282
|
contextMenuItems: contextMenuItems,
|
|
@@ -42,6 +42,7 @@ type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
|
|
|
42
42
|
setColumns: Dispatch<SetStateAction<any>>;
|
|
43
43
|
columnSizingInfo: ColumnSizingInfoState;
|
|
44
44
|
columnSizing: ColumnSizingState;
|
|
45
|
+
setIsExpandClick: Dispatch<SetStateAction<boolean>>;
|
|
45
46
|
};
|
|
46
47
|
declare const TableContainerEdit: <RecordType extends object>(props: TableContainerProps<RecordType>) => React.JSX.Element;
|
|
47
48
|
export default TableContainerEdit;
|
|
@@ -126,7 +126,8 @@ const TableContainerEdit = props => {
|
|
|
126
126
|
columnSizingInfo,
|
|
127
127
|
rowClassName,
|
|
128
128
|
onRowStyles,
|
|
129
|
-
dataSourceFilter
|
|
129
|
+
dataSourceFilter,
|
|
130
|
+
setIsExpandClick
|
|
130
131
|
} = props;
|
|
131
132
|
const containerRef = React.useRef(null);
|
|
132
133
|
const bottomToolbarRef = React.useRef(null);
|
|
@@ -1903,7 +1904,8 @@ const TableContainerEdit = props => {
|
|
|
1903
1904
|
rowClassName,
|
|
1904
1905
|
rowEditable,
|
|
1905
1906
|
onRowStyles,
|
|
1906
|
-
dataSourceFilter
|
|
1907
|
+
dataSourceFilter,
|
|
1908
|
+
setIsExpandClick
|
|
1907
1909
|
}
|
|
1908
1910
|
}, /*#__PURE__*/React.createElement(TableWrapper, {
|
|
1909
1911
|
contextMenuItems: contextMenuItems,
|
|
@@ -80,12 +80,11 @@ const renderSelection = args => {
|
|
|
80
80
|
expandIconColumnIndex,
|
|
81
81
|
isDataTree,
|
|
82
82
|
expanded,
|
|
83
|
-
setExpanded
|
|
84
|
-
} = args;
|
|
85
|
-
const {
|
|
83
|
+
setExpanded,
|
|
86
84
|
selectionSettings,
|
|
87
85
|
setIsSelectionChange,
|
|
88
|
-
isSelectionChange
|
|
86
|
+
isSelectionChange,
|
|
87
|
+
setIsExpandClick
|
|
89
88
|
} = args;
|
|
90
89
|
return /*#__PURE__*/React.createElement("div", {
|
|
91
90
|
style: {
|
|
@@ -100,6 +99,7 @@ const renderSelection = args => {
|
|
|
100
99
|
}, /*#__PURE__*/React.createElement("div", null, cell.row.getCanExpand() ? /*#__PURE__*/React.createElement("button", {
|
|
101
100
|
// onClick: row.getToggleExpandedHandler(),
|
|
102
101
|
onClick: e => {
|
|
102
|
+
setIsExpandClick(true);
|
|
103
103
|
e.stopPropagation();
|
|
104
104
|
e.preventDefault();
|
|
105
105
|
const keys = Object.keys(expanded);
|
|
@@ -231,7 +231,8 @@ const TableBodyCellEdit = props => {
|
|
|
231
231
|
setIsSelectionChange,
|
|
232
232
|
selectionSettings,
|
|
233
233
|
pagination,
|
|
234
|
-
handleAddMulti
|
|
234
|
+
handleAddMulti,
|
|
235
|
+
setIsExpandClick
|
|
235
236
|
} = React.useContext(TableContext);
|
|
236
237
|
const expandIconColumnIndex = expandable?.expandIconColumnIndex;
|
|
237
238
|
const record = cell.row.original;
|
|
@@ -1014,7 +1015,8 @@ const TableBodyCellEdit = props => {
|
|
|
1014
1015
|
isDataTree,
|
|
1015
1016
|
setExpanded,
|
|
1016
1017
|
expandIconColumnIndex,
|
|
1017
|
-
isSelectionChange
|
|
1018
|
+
isSelectionChange,
|
|
1019
|
+
setIsExpandClick
|
|
1018
1020
|
}));
|
|
1019
1021
|
}
|
|
1020
1022
|
const handleChange = () => {
|
|
@@ -1240,6 +1242,7 @@ const TableBodyCellEdit = props => {
|
|
|
1240
1242
|
onClick: e => {
|
|
1241
1243
|
e.stopPropagation();
|
|
1242
1244
|
e.preventDefault();
|
|
1245
|
+
setIsExpandClick(true);
|
|
1243
1246
|
const keys = Object.keys(expanded);
|
|
1244
1247
|
// @ts-ignore
|
|
1245
1248
|
const tmp = {
|
|
@@ -4,7 +4,7 @@ import { Button, Space } from 'antd';
|
|
|
4
4
|
import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { Checkbox, Dropdown, Select } from 'rc-master-ui';
|
|
7
|
-
import { excludeItems, extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter, removeDuplicatesByKey } from "../hook/utils";
|
|
7
|
+
import { convertToObjTrue, excludeItems, extendsObject, findAllChildrenKeys2, getCommonPinningStyles, getDefaultOperator, getTypeFilter, isObjEmpty, removeDuplicatesByKey } from "../hook/utils";
|
|
8
8
|
import { TableContext } from "../useContext";
|
|
9
9
|
import { renderFilter } from "./renderFilter";
|
|
10
10
|
import ReactDOMServer from 'react-dom/server';
|
|
@@ -31,8 +31,18 @@ const TableHeadCell2 = props => {
|
|
|
31
31
|
id,
|
|
32
32
|
locale,
|
|
33
33
|
format,
|
|
34
|
-
dataSourceFilter
|
|
34
|
+
dataSourceFilter,
|
|
35
|
+
isDataTree,
|
|
36
|
+
expanded,
|
|
37
|
+
setExpanded,
|
|
38
|
+
expandable,
|
|
39
|
+
dataSource,
|
|
40
|
+
rowKey
|
|
35
41
|
} = useContext(TableContext);
|
|
42
|
+
const expandIconColumnIndex = expandable?.expandIconColumnIndex ?? 0;
|
|
43
|
+
const {
|
|
44
|
+
showExpandAll
|
|
45
|
+
} = expandable || {};
|
|
36
46
|
const isPinned = column.getIsPinned();
|
|
37
47
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
38
48
|
const isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right');
|
|
@@ -196,6 +206,13 @@ const TableHeadCell2 = props => {
|
|
|
196
206
|
// return dropdownContent;
|
|
197
207
|
}
|
|
198
208
|
});
|
|
209
|
+
const handleCollapseAllGroup = () => {
|
|
210
|
+
setExpanded({});
|
|
211
|
+
};
|
|
212
|
+
const handleExpandAllGroup = () => {
|
|
213
|
+
const allKeys = findAllChildrenKeys2(dataSource, rowKey, 'children');
|
|
214
|
+
setExpanded(convertToObjTrue(allKeys));
|
|
215
|
+
};
|
|
199
216
|
return /*#__PURE__*/React.createElement("div", {
|
|
200
217
|
// ref={setNodeRef}
|
|
201
218
|
className: classNames(`${prefix}-grid-cell`, {
|
|
@@ -223,7 +240,26 @@ const TableHeadCell2 = props => {
|
|
|
223
240
|
[`${prefix}-grid-filter-column`]: column.id !== 'selection_column',
|
|
224
241
|
[`${prefix}-grid-selection-column`]: column.id === 'selection_column'
|
|
225
242
|
})
|
|
226
|
-
}, column.
|
|
243
|
+
}, column.getIndex() === expandIconColumnIndex && isDataTree && showExpandAll && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
244
|
+
// onClick: row.getToggleExpandedHandler(),
|
|
245
|
+
onClick: e => {
|
|
246
|
+
e.stopPropagation();
|
|
247
|
+
e.preventDefault();
|
|
248
|
+
if (!isObjEmpty(expanded)) {
|
|
249
|
+
handleCollapseAllGroup();
|
|
250
|
+
} else {
|
|
251
|
+
handleExpandAllGroup();
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
style: {
|
|
255
|
+
cursor: "pointer"
|
|
256
|
+
},
|
|
257
|
+
className: "ui-rc-table-row-expand"
|
|
258
|
+
}, !isObjEmpty(expanded) ? /*#__PURE__*/React.createElement("span", {
|
|
259
|
+
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-expanded"
|
|
260
|
+
}) : /*#__PURE__*/React.createElement("span", {
|
|
261
|
+
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
|
|
262
|
+
}))), column.id === 'selection_column' && selectionSettings && selectionSettings.hideSelectAll !== true && selectionSettings.type !== 'single' && selectionSettings.mode !== 'radio' && /*#__PURE__*/React.createElement(Checkbox, {
|
|
227
263
|
checked: table.getIsAllRowsSelected(),
|
|
228
264
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
229
265
|
onChange: e => {
|
|
@@ -45,4 +45,4 @@ const colorDark = "#e6e4f3e6 ";
|
|
|
45
45
|
export const GridStyle = styled.div.withConfig({
|
|
46
46
|
displayName: "GridStyle",
|
|
47
47
|
componentId: "es-grid-template__sc-hdqm5k-0"
|
|
48
|
-
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:\"\";pointer-events:none;}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
48
|
+
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:\"\";pointer-events:none;}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -20,6 +20,7 @@ type Props<T> = Omit<TableProps<T>, 'columns'> & {
|
|
|
20
20
|
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
|
21
21
|
triggerFilter: Dispatch<SetStateAction<any>>;
|
|
22
22
|
triggerSorter: Dispatch<SetStateAction<Sorter[]>>;
|
|
23
|
+
setIsExpandClick: Dispatch<SetStateAction<boolean>>;
|
|
23
24
|
onContextMenu?: (data: T) => (event: any) => void;
|
|
24
25
|
triggerChangeColumns?: (args: any, keys: any, type: string) => void;
|
|
25
26
|
windowSize: any;
|
|
@@ -56,6 +56,7 @@ const Grid = props => {
|
|
|
56
56
|
windowSize,
|
|
57
57
|
fullScreenTitle,
|
|
58
58
|
className: tableClassNames,
|
|
59
|
+
setIsExpandClick,
|
|
59
60
|
...rest
|
|
60
61
|
} = props;
|
|
61
62
|
const [columnResizeMode] = React.useState('onChange');
|
|
@@ -264,7 +265,8 @@ const Grid = props => {
|
|
|
264
265
|
},
|
|
265
266
|
className: classNames(`${prefix}-grid ${tableClassNames}`, {
|
|
266
267
|
[`${prefix}-grid-light`]: !theme || theme.theme === 'light',
|
|
267
|
-
[`${prefix}-grid-dark`]: theme?.theme === 'dark'
|
|
268
|
+
[`${prefix}-grid-dark`]: theme?.theme === 'dark',
|
|
269
|
+
[`${prefix}-grid-editable`]: editAble
|
|
268
270
|
}),
|
|
269
271
|
style: {
|
|
270
272
|
minHeight: minHeight ?? undefined,
|
|
@@ -306,7 +308,8 @@ const Grid = props => {
|
|
|
306
308
|
columnSizing: columnSizing,
|
|
307
309
|
columnSizingInfo: columnSizingInfo,
|
|
308
310
|
isFullScreen: isFullScreen,
|
|
309
|
-
setIsFullScreen: setIsFullScreen
|
|
311
|
+
setIsFullScreen: setIsFullScreen,
|
|
312
|
+
setIsExpandClick: setIsExpandClick
|
|
310
313
|
})))), /*#__PURE__*/React.createElement(Modal, {
|
|
311
314
|
open: isFullScreen,
|
|
312
315
|
footer: null,
|
|
@@ -384,7 +387,8 @@ const Grid = props => {
|
|
|
384
387
|
columnSizing: columnSizing,
|
|
385
388
|
columnSizingInfo: columnSizingInfo,
|
|
386
389
|
isFullScreen: isFullScreen,
|
|
387
|
-
setIsFullScreen: setIsFullScreen
|
|
390
|
+
setIsFullScreen: setIsFullScreen,
|
|
391
|
+
setIsExpandClick: setIsExpandClick
|
|
388
392
|
})))))));
|
|
389
393
|
};
|
|
390
394
|
export default Grid;
|
|
@@ -290,14 +290,12 @@ export type ExpandableConfig<RecordType> = {
|
|
|
290
290
|
onExpand?: (expanded: boolean, record: RecordType) => void;
|
|
291
291
|
onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void;
|
|
292
292
|
defaultExpandAllRows?: boolean;
|
|
293
|
-
indentSize?: number;
|
|
294
293
|
expandIconColumnIndex?: number;
|
|
294
|
+
showExpandAll?: boolean;
|
|
295
295
|
showExpandColumn?: boolean;
|
|
296
296
|
expandedRowClassName?: string | RowClassName<RecordType>;
|
|
297
297
|
childrenColumnName?: string;
|
|
298
298
|
rowExpandable?: (record: RecordType) => boolean;
|
|
299
|
-
columnWidth?: number | string;
|
|
300
|
-
fixed?: FixedType;
|
|
301
299
|
};
|
|
302
300
|
export type RenderExpandIcon<RecordType> = (props: RenderExpandIconProps<RecordType>) => React.ReactNode;
|
|
303
301
|
export interface RenderExpandIconProps<RecordType> {
|
|
@@ -315,7 +315,8 @@ const Grid = props => {
|
|
|
315
315
|
},
|
|
316
316
|
className: (0, _classnames.default)(`${prefix}-grid ${tableClassNames}`, {
|
|
317
317
|
[`${prefix}-grid-light`]: !theme || theme.theme === 'light',
|
|
318
|
-
[`${prefix}-grid-dark`]: theme?.theme === 'dark'
|
|
318
|
+
[`${prefix}-grid-dark`]: theme?.theme === 'dark',
|
|
319
|
+
[`${prefix}-grid-editable`]: editAble
|
|
319
320
|
}),
|
|
320
321
|
style: {
|
|
321
322
|
minHeight: minHeight ?? undefined,
|
|
@@ -78,6 +78,7 @@ const InternalTable = props => {
|
|
|
78
78
|
const [sorterStates, setSorterStates] = _react.default.useState([]);
|
|
79
79
|
const [isFullScreen, setIsFullScreen] = _react.default.useState(false);
|
|
80
80
|
const [columns, setColumns] = _react.default.useState([]);
|
|
81
|
+
const [isExpandClick, setIsExpandClick] = _react.default.useState(false);
|
|
81
82
|
_react.default.useEffect(() => {
|
|
82
83
|
// setColumns(propsColumns as any)
|
|
83
84
|
|
|
@@ -115,7 +116,7 @@ const InternalTable = props => {
|
|
|
115
116
|
value: undefined
|
|
116
117
|
});
|
|
117
118
|
_react.default.useEffect(() => {
|
|
118
|
-
if (onExpandClick) {
|
|
119
|
+
if (onExpandClick || isExpandClick) {
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
if (defaultExpandAllRows) {
|
|
@@ -126,7 +127,7 @@ const InternalTable = props => {
|
|
|
126
127
|
setExpanded((0, _utils.convertToObjTrue)(defaultExpandedRowKeys ?? []));
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
|
-
}, [defaultExpandAllRows, convertData, defaultExpandedRowKeys, onExpandClick]);
|
|
130
|
+
}, [defaultExpandAllRows, convertData, defaultExpandedRowKeys, onExpandClick, isExpandClick]);
|
|
130
131
|
|
|
131
132
|
// ========================= Keys =========================
|
|
132
133
|
|
|
@@ -195,7 +196,8 @@ const InternalTable = props => {
|
|
|
195
196
|
mergedSelectedKeys: mergedSelectedKeys,
|
|
196
197
|
expandable: expandable,
|
|
197
198
|
onExpandClick: onExpandClick,
|
|
198
|
-
setColumns: setColumns
|
|
199
|
+
setColumns: setColumns,
|
|
200
|
+
setIsExpandClick: setIsExpandClick
|
|
199
201
|
})));
|
|
200
202
|
};
|
|
201
203
|
var _default = exports.default = InternalTable;
|
|
@@ -41,6 +41,7 @@ type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
|
|
|
41
41
|
isDataTree: boolean;
|
|
42
42
|
setColumnSizing: Dispatch<SetStateAction<any>>;
|
|
43
43
|
setColumns: Dispatch<SetStateAction<any>>;
|
|
44
|
+
setIsExpandClick: Dispatch<SetStateAction<boolean>>;
|
|
44
45
|
columnSizingInfo: ColumnSizingInfoState;
|
|
45
46
|
columnSizing: ColumnSizingState;
|
|
46
47
|
};
|
|
@@ -77,7 +77,8 @@ const TableContainer = props => {
|
|
|
77
77
|
onRowHeaderStyles,
|
|
78
78
|
title,
|
|
79
79
|
dataSourceFilter,
|
|
80
|
-
onExpandClick
|
|
80
|
+
onExpandClick,
|
|
81
|
+
setIsExpandClick
|
|
81
82
|
} = props;
|
|
82
83
|
const tableContainerRef = _react.default.useRef(null);
|
|
83
84
|
const containerRef = _react.default.useRef(null);
|
|
@@ -281,7 +282,8 @@ const TableContainer = props => {
|
|
|
281
282
|
table,
|
|
282
283
|
pagination,
|
|
283
284
|
dataSourceFilter,
|
|
284
|
-
onExpandClick
|
|
285
|
+
onExpandClick,
|
|
286
|
+
setIsExpandClick
|
|
285
287
|
}
|
|
286
288
|
}, /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
|
|
287
289
|
contextMenuItems: contextMenuItems,
|
|
@@ -42,6 +42,7 @@ type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
|
|
|
42
42
|
setColumns: Dispatch<SetStateAction<any>>;
|
|
43
43
|
columnSizingInfo: ColumnSizingInfoState;
|
|
44
44
|
columnSizing: ColumnSizingState;
|
|
45
|
+
setIsExpandClick: Dispatch<SetStateAction<boolean>>;
|
|
45
46
|
};
|
|
46
47
|
declare const TableContainerEdit: <RecordType extends object>(props: TableContainerProps<RecordType>) => React.JSX.Element;
|
|
47
48
|
export default TableContainerEdit;
|
|
@@ -133,7 +133,8 @@ const TableContainerEdit = props => {
|
|
|
133
133
|
columnSizingInfo,
|
|
134
134
|
rowClassName,
|
|
135
135
|
onRowStyles,
|
|
136
|
-
dataSourceFilter
|
|
136
|
+
dataSourceFilter,
|
|
137
|
+
setIsExpandClick
|
|
137
138
|
} = props;
|
|
138
139
|
const containerRef = _react.default.useRef(null);
|
|
139
140
|
const bottomToolbarRef = _react.default.useRef(null);
|
|
@@ -1910,7 +1911,8 @@ const TableContainerEdit = props => {
|
|
|
1910
1911
|
rowClassName,
|
|
1911
1912
|
rowEditable,
|
|
1912
1913
|
onRowStyles,
|
|
1913
|
-
dataSourceFilter
|
|
1914
|
+
dataSourceFilter,
|
|
1915
|
+
setIsExpandClick
|
|
1914
1916
|
}
|
|
1915
1917
|
}, /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
|
|
1916
1918
|
contextMenuItems: contextMenuItems,
|
|
@@ -87,12 +87,11 @@ const renderSelection = args => {
|
|
|
87
87
|
expandIconColumnIndex,
|
|
88
88
|
isDataTree,
|
|
89
89
|
expanded,
|
|
90
|
-
setExpanded
|
|
91
|
-
} = args;
|
|
92
|
-
const {
|
|
90
|
+
setExpanded,
|
|
93
91
|
selectionSettings,
|
|
94
92
|
setIsSelectionChange,
|
|
95
|
-
isSelectionChange
|
|
93
|
+
isSelectionChange,
|
|
94
|
+
setIsExpandClick
|
|
96
95
|
} = args;
|
|
97
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
98
97
|
style: {
|
|
@@ -107,6 +106,7 @@ const renderSelection = args => {
|
|
|
107
106
|
}, /*#__PURE__*/_react.default.createElement("div", null, cell.row.getCanExpand() ? /*#__PURE__*/_react.default.createElement("button", {
|
|
108
107
|
// onClick: row.getToggleExpandedHandler(),
|
|
109
108
|
onClick: e => {
|
|
109
|
+
setIsExpandClick(true);
|
|
110
110
|
e.stopPropagation();
|
|
111
111
|
e.preventDefault();
|
|
112
112
|
const keys = Object.keys(expanded);
|
|
@@ -238,7 +238,8 @@ const TableBodyCellEdit = props => {
|
|
|
238
238
|
setIsSelectionChange,
|
|
239
239
|
selectionSettings,
|
|
240
240
|
pagination,
|
|
241
|
-
handleAddMulti
|
|
241
|
+
handleAddMulti,
|
|
242
|
+
setIsExpandClick
|
|
242
243
|
} = _react.default.useContext(_useContext.TableContext);
|
|
243
244
|
const expandIconColumnIndex = expandable?.expandIconColumnIndex;
|
|
244
245
|
const record = cell.row.original;
|
|
@@ -1021,7 +1022,8 @@ const TableBodyCellEdit = props => {
|
|
|
1021
1022
|
isDataTree,
|
|
1022
1023
|
setExpanded,
|
|
1023
1024
|
expandIconColumnIndex,
|
|
1024
|
-
isSelectionChange
|
|
1025
|
+
isSelectionChange,
|
|
1026
|
+
setIsExpandClick
|
|
1025
1027
|
}));
|
|
1026
1028
|
}
|
|
1027
1029
|
const handleChange = () => {
|
|
@@ -1247,6 +1249,7 @@ const TableBodyCellEdit = props => {
|
|
|
1247
1249
|
onClick: e => {
|
|
1248
1250
|
e.stopPropagation();
|
|
1249
1251
|
e.preventDefault();
|
|
1252
|
+
setIsExpandClick(true);
|
|
1250
1253
|
const keys = Object.keys(expanded);
|
|
1251
1254
|
// @ts-ignore
|
|
1252
1255
|
const tmp = {
|
|
@@ -40,8 +40,18 @@ const TableHeadCell2 = props => {
|
|
|
40
40
|
id,
|
|
41
41
|
locale,
|
|
42
42
|
format,
|
|
43
|
-
dataSourceFilter
|
|
43
|
+
dataSourceFilter,
|
|
44
|
+
isDataTree,
|
|
45
|
+
expanded,
|
|
46
|
+
setExpanded,
|
|
47
|
+
expandable,
|
|
48
|
+
dataSource,
|
|
49
|
+
rowKey
|
|
44
50
|
} = (0, _react.useContext)(_useContext.TableContext);
|
|
51
|
+
const expandIconColumnIndex = expandable?.expandIconColumnIndex ?? 0;
|
|
52
|
+
const {
|
|
53
|
+
showExpandAll
|
|
54
|
+
} = expandable || {};
|
|
45
55
|
const isPinned = column.getIsPinned();
|
|
46
56
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
47
57
|
const isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right');
|
|
@@ -205,6 +215,13 @@ const TableHeadCell2 = props => {
|
|
|
205
215
|
// return dropdownContent;
|
|
206
216
|
}
|
|
207
217
|
});
|
|
218
|
+
const handleCollapseAllGroup = () => {
|
|
219
|
+
setExpanded({});
|
|
220
|
+
};
|
|
221
|
+
const handleExpandAllGroup = () => {
|
|
222
|
+
const allKeys = (0, _utils.findAllChildrenKeys2)(dataSource, rowKey, 'children');
|
|
223
|
+
setExpanded((0, _utils.convertToObjTrue)(allKeys));
|
|
224
|
+
};
|
|
208
225
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
209
226
|
// ref={setNodeRef}
|
|
210
227
|
className: (0, _classnames.default)(`${prefix}-grid-cell`, {
|
|
@@ -232,7 +249,26 @@ const TableHeadCell2 = props => {
|
|
|
232
249
|
[`${prefix}-grid-filter-column`]: column.id !== 'selection_column',
|
|
233
250
|
[`${prefix}-grid-selection-column`]: column.id === 'selection_column'
|
|
234
251
|
})
|
|
235
|
-
}, column.
|
|
252
|
+
}, column.getIndex() === expandIconColumnIndex && isDataTree && showExpandAll && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
|
|
253
|
+
// onClick: row.getToggleExpandedHandler(),
|
|
254
|
+
onClick: e => {
|
|
255
|
+
e.stopPropagation();
|
|
256
|
+
e.preventDefault();
|
|
257
|
+
if (!(0, _utils.isObjEmpty)(expanded)) {
|
|
258
|
+
handleCollapseAllGroup();
|
|
259
|
+
} else {
|
|
260
|
+
handleExpandAllGroup();
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
style: {
|
|
264
|
+
cursor: "pointer"
|
|
265
|
+
},
|
|
266
|
+
className: "ui-rc-table-row-expand"
|
|
267
|
+
}, !(0, _utils.isObjEmpty)(expanded) ? /*#__PURE__*/_react.default.createElement("span", {
|
|
268
|
+
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-expanded"
|
|
269
|
+
}) : /*#__PURE__*/_react.default.createElement("span", {
|
|
270
|
+
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
|
|
271
|
+
}))), column.id === 'selection_column' && selectionSettings && selectionSettings.hideSelectAll !== true && selectionSettings.type !== 'single' && selectionSettings.mode !== 'radio' && /*#__PURE__*/_react.default.createElement(_rcMasterUi.Checkbox, {
|
|
236
272
|
checked: table.getIsAllRowsSelected(),
|
|
237
273
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
238
274
|
onChange: e => {
|
|
@@ -52,4 +52,4 @@ const colorDark = "#e6e4f3e6 ";
|
|
|
52
52
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
53
53
|
displayName: "GridStyle",
|
|
54
54
|
componentId: "es-grid-template__sc-hdqm5k-0"
|
|
55
|
-
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:\"\";pointer-events:none;}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
55
|
+
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:\"\";pointer-events:none;}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -20,6 +20,7 @@ type Props<T> = Omit<TableProps<T>, 'columns'> & {
|
|
|
20
20
|
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
|
21
21
|
triggerFilter: Dispatch<SetStateAction<any>>;
|
|
22
22
|
triggerSorter: Dispatch<SetStateAction<Sorter[]>>;
|
|
23
|
+
setIsExpandClick: Dispatch<SetStateAction<boolean>>;
|
|
23
24
|
onContextMenu?: (data: T) => (event: any) => void;
|
|
24
25
|
triggerChangeColumns?: (args: any, keys: any, type: string) => void;
|
|
25
26
|
windowSize: any;
|
|
@@ -61,6 +61,7 @@ const Grid = props => {
|
|
|
61
61
|
windowSize,
|
|
62
62
|
fullScreenTitle,
|
|
63
63
|
className: tableClassNames,
|
|
64
|
+
setIsExpandClick,
|
|
64
65
|
...rest
|
|
65
66
|
} = props;
|
|
66
67
|
const [columnResizeMode] = _react.default.useState('onChange');
|
|
@@ -269,7 +270,8 @@ const Grid = props => {
|
|
|
269
270
|
},
|
|
270
271
|
className: (0, _classnames.default)(`${prefix}-grid ${tableClassNames}`, {
|
|
271
272
|
[`${prefix}-grid-light`]: !theme || theme.theme === 'light',
|
|
272
|
-
[`${prefix}-grid-dark`]: theme?.theme === 'dark'
|
|
273
|
+
[`${prefix}-grid-dark`]: theme?.theme === 'dark',
|
|
274
|
+
[`${prefix}-grid-editable`]: editAble
|
|
273
275
|
}),
|
|
274
276
|
style: {
|
|
275
277
|
minHeight: minHeight ?? undefined,
|
|
@@ -311,7 +313,8 @@ const Grid = props => {
|
|
|
311
313
|
columnSizing: columnSizing,
|
|
312
314
|
columnSizingInfo: columnSizingInfo,
|
|
313
315
|
isFullScreen: isFullScreen,
|
|
314
|
-
setIsFullScreen: setIsFullScreen
|
|
316
|
+
setIsFullScreen: setIsFullScreen,
|
|
317
|
+
setIsExpandClick: setIsExpandClick
|
|
315
318
|
})))), /*#__PURE__*/_react.default.createElement(_antd.Modal, {
|
|
316
319
|
open: isFullScreen,
|
|
317
320
|
footer: null,
|
|
@@ -389,7 +392,8 @@ const Grid = props => {
|
|
|
389
392
|
columnSizing: columnSizing,
|
|
390
393
|
columnSizingInfo: columnSizingInfo,
|
|
391
394
|
isFullScreen: isFullScreen,
|
|
392
|
-
setIsFullScreen: setIsFullScreen
|
|
395
|
+
setIsFullScreen: setIsFullScreen,
|
|
396
|
+
setIsExpandClick: setIsExpandClick
|
|
393
397
|
})))))));
|
|
394
398
|
};
|
|
395
399
|
var _default = exports.default = Grid;
|