es-grid-template 1.9.62 → 1.9.64
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/ali-table/Grid.js +6 -3
- package/es/ali-table/InternalTable.js +500 -49
- package/es/ali-table/base-table/calculations.js +1 -1
- package/es/ali-table/base-table/cell/EditCell.js +14 -6
- package/es/ali-table/base-table/renderFilter.js +1 -1
- package/es/ali-table/base-table/styles.js +1 -1
- package/es/ali-table/interfaces.d.ts +2 -2
- package/es/ali-table/pipeline/features/columnCustom.d.ts +5 -2
- package/es/ali-table/pipeline/features/columnCustom.js +172 -102
- package/es/ali-table/utils/constants.d.ts +1 -0
- package/es/ali-table/utils/constants.js +1 -0
- package/es/ali-table/utils/convertColumnsChoose.d.ts +2 -2
- package/es/ali-table/utils/convertColumnsChoose.js +1 -2
- package/es/ali-table/utils/utility.d.ts +16 -1
- package/es/ali-table/utils/utility.js +442 -2
- package/es/grid-component/type.d.ts +2 -2
- package/es/table-component/TableContainerEdit.js +148 -98
- package/es/table-component/body/EditableCell.js +9 -5
- package/es/table-component/body/TableBodyCellEdit.js +14 -8
- package/es/table-component/header/renderFilter.js +1 -1
- package/es/table-component/hook/utils.d.ts +1 -1
- package/es/table-component/hook/utils.js +2 -6
- package/es/table-component/useContext.d.ts +1 -1
- package/lib/ali-table/Grid.js +6 -3
- package/lib/ali-table/InternalTable.js +491 -45
- package/lib/ali-table/base-table/calculations.js +1 -1
- package/lib/ali-table/base-table/cell/EditCell.js +14 -6
- package/lib/ali-table/base-table/renderFilter.js +1 -1
- package/lib/ali-table/base-table/styles.js +1 -1
- package/lib/ali-table/interfaces.d.ts +2 -2
- package/lib/ali-table/pipeline/features/columnCustom.d.ts +5 -2
- package/lib/ali-table/pipeline/features/columnCustom.js +166 -100
- package/lib/ali-table/utils/constants.d.ts +1 -0
- package/lib/ali-table/utils/constants.js +2 -1
- package/lib/ali-table/utils/convertColumnsChoose.d.ts +2 -2
- package/lib/ali-table/utils/convertColumnsChoose.js +1 -2
- package/lib/ali-table/utils/utility.d.ts +16 -1
- package/lib/ali-table/utils/utility.js +454 -2
- package/lib/grid-component/type.d.ts +2 -2
- package/lib/table-component/TableContainerEdit.js +148 -98
- package/lib/table-component/body/EditableCell.js +9 -5
- package/lib/table-component/body/TableBodyCellEdit.js +11 -7
- package/lib/table-component/header/renderFilter.js +1 -1
- package/lib/table-component/hook/utils.d.ts +1 -1
- package/lib/table-component/hook/utils.js +2 -6
- package/lib/table-component/useContext.d.ts +1 -1
- package/package.json +1 -1
|
@@ -476,7 +476,9 @@ const EditCell = props => {
|
|
|
476
476
|
align: colSelect.textAlign
|
|
477
477
|
};
|
|
478
478
|
});
|
|
479
|
-
|
|
479
|
+
|
|
480
|
+
// let valueSelectTable = formValues[dataIndex]
|
|
481
|
+
let valueSelectTable = formValues[dataIndex] !== null ? formValues[dataIndex] : undefined;
|
|
480
482
|
if (fieldValue) {
|
|
481
483
|
// @ts-ignore
|
|
482
484
|
valueSelectTable = record[fieldValue] ?? formValues[dataIndex];
|
|
@@ -625,14 +627,16 @@ const EditCell = props => {
|
|
|
625
627
|
"data-tooltip-id": `${tableId}-tooltip-error`
|
|
626
628
|
});
|
|
627
629
|
case 'select':
|
|
628
|
-
let valueSelect = formValues[dataIndex];
|
|
630
|
+
let valueSelect = formValues[dataIndex] !== null ? formValues[dataIndex] : undefined;
|
|
631
|
+
// let valueSelect = !isNullOrUndefined(formValues[dataIndex]) ? formValues[dataIndex] : undefined
|
|
632
|
+
|
|
629
633
|
if (fieldValue) {
|
|
630
634
|
// @ts-ignore
|
|
631
635
|
valueSelect = record[fieldValue] ?? formValues[dataIndex];
|
|
632
636
|
}
|
|
633
637
|
return /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
634
638
|
options: options,
|
|
635
|
-
value: valueSelect ??
|
|
639
|
+
value: valueSelect ?? undefined,
|
|
636
640
|
onChange: (val, option) => {
|
|
637
641
|
onChange(val ?? '');
|
|
638
642
|
const formState = getValues();
|
|
@@ -768,7 +772,8 @@ const EditCell = props => {
|
|
|
768
772
|
"data-tooltip-id": `${tableId}-tooltip-error`
|
|
769
773
|
});
|
|
770
774
|
case 'asyncSelect':
|
|
771
|
-
let valueAsyncSelect = formValues[dataIndex]
|
|
775
|
+
// let valueAsyncSelect = formValues[dataIndex]
|
|
776
|
+
let valueAsyncSelect = formValues[dataIndex] !== null ? formValues[dataIndex] : undefined;
|
|
772
777
|
if (fieldValue) {
|
|
773
778
|
// @ts-ignore
|
|
774
779
|
valueAsyncSelect = record[fieldValue] ?? formValues[dataIndex];
|
|
@@ -776,7 +781,7 @@ const EditCell = props => {
|
|
|
776
781
|
return /*#__PURE__*/_react.default.createElement(_asyncSelect.AsyncSelect, {
|
|
777
782
|
options: options,
|
|
778
783
|
defaultOptions: options,
|
|
779
|
-
value: valueAsyncSelect
|
|
784
|
+
value: valueAsyncSelect,
|
|
780
785
|
onChange: (val, option) => {
|
|
781
786
|
onChange(val ?? '');
|
|
782
787
|
const formState = getValues();
|
|
@@ -1244,7 +1249,10 @@ const EditCell = props => {
|
|
|
1244
1249
|
}
|
|
1245
1250
|
};
|
|
1246
1251
|
return /*#__PURE__*/_react.default.createElement("form", {
|
|
1247
|
-
onSubmit: handleSubmit(onSubmit)
|
|
1252
|
+
onSubmit: handleSubmit(onSubmit),
|
|
1253
|
+
style: {
|
|
1254
|
+
height: '100%'
|
|
1255
|
+
}
|
|
1248
1256
|
}, /*#__PURE__*/_react.default.createElement(_reactHookForm.Controller, {
|
|
1249
1257
|
name: dataIndex,
|
|
1250
1258
|
control: control,
|
|
@@ -301,7 +301,7 @@ const renderFilter = args => {
|
|
|
301
301
|
,
|
|
302
302
|
onBlur: e => {
|
|
303
303
|
if (selectedKeys[0] === e.target.value) {} else {
|
|
304
|
-
setSelectedKeys(e.target.value ? [e.target.value] : []);
|
|
304
|
+
setSelectedKeys(e.target.value ? [e.target.value.trim()] : []);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
|
|
@@ -68,7 +68,7 @@ const outerBorderStyleMixin = (0, _styledComponents.css)(["border-top:var(--cell
|
|
|
68
68
|
const StyleTableContainer = exports.StyleTableContainer = _styledComponents.default.div.withConfig({
|
|
69
69
|
displayName: "StyleTableContainer",
|
|
70
70
|
componentId: "es-grid-template__sc-ipj1ht-0"
|
|
71
|
-
})(["--row-height:34px;--color:#333;--bgcolor:white;--body-hover-bgcolor:#f5f5f5;--body-hover-color:#333;--hover-bgcolor:var(--body-hover-bgcolor,#f5f5f5);--hover-color:var(--body-hover-color);--highlight-bgcolor:#eee;--header-row-height:34px;--header-color:#000000de;--header-bgcolor:#ffffff;--header-hover-bgcolor:#ddd;--header-highlight-bgcolor:#e4e8ed;--cell-padding:7px 8px;--font-size:13px;--line-height:1.28571;--lock-shadow:rgba(152,152,152,0.5) 0 0 6px 2px;--border-color:#dfe3e8;--border-color-select:#eb4619;--cell-border:1px solid var(--border-color);--cell-border-select:1px solid var(--border-color-select);--cell-border-horizontal:var(--cell-border);--cell-border-vertical:var(--cell-border);--header-cell-border:1px solid var(--border-color);--header-cell-border-horizontal:var(--header-cell-border);--header-cell-border-vertical:var(--header-cell-border);--footer-bgcolor:#fafafa;&.", "{--bgcolor:#343e59;--footer-bgcolor:#2e3342;--header-bgcolor:#343e59;--hover-bgcolor:#232b43;--header-hover-bgcolor:#606164;--highlight-bgcolor:#eff2f5;--header-highlight-bgcolor:#191a1b;--hover-color:#dadde1;--color:#dadde1;--header-color:#dadde1;--lock-shadow:rgb(37 37 37 / 0.5) 0 0 6px 2px;--border-color:#4f5266;background-color:var(--bgcolor);}&.use-outer-border{", ";}&.", "{.", "{border-left:0;border-right:0;td,th{border-right:0;}td.first,th.first{border-left:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}tr{td{&.lock-left,&.lock-right{border-bottom-width:0;box-shadow:0 -1px 0 0 var(--border-color),0 0px 0 0 var(--border-color),0px 0 0 0 var(--border-color);}}}&.has-footer tfoot tr.last td{}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{&.use-outer-border{border-bottom:var(--header-cell-border);}.", "{border-top:0;td,th{border-bottom:0;border-top:0;}td.lock-left{box-shadow:none;}td.first,th.first{}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{.", "{border:0;td,th{border-right:0;border-bottom:0;}td.lock-left{box-shadow:none;}td,th{border:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{border-top:0;border:0;}}}.", "{padding:8px;}&.ui-rc-grid .ui-rc-pagination{background-color:var(--bgcolor);color:var(--color);padding:10px;background-color:var(--bgcolor);.ui-rc-pagination-prev{.anticon.anticon-left{color:var(--color);}}.ui-rc-pagination-disabled{.anticon.anticon-left{color:#7d7a7a;}}.ui-rc-pagination-next{.anticon.anticon-right{color:var(--color);}&.ui-rc-pagination-disabled{.anticon.anticon-right{color:#7d7a7a;}}}}&.auto-height{.ui-rc-grid-bottom{border-top:0;}}.ui-rc-grid-bottom{border-top:var(--cell-border-horizontal);}&.", "{&.ui-rc-grid{.ui-rc-toolbar-bottom{background-color:var(--footer-bgcolor);color:#ffffff;}}.ui-rc-grid-top-toolbar{border-color:var(--border-color);color:#ffffff;}.ui-rc-toolbar{.ui-rc-toolbar-selection-item{background-color:var(--footer-bgcolor);color:#ffffff;}}}"], Classes.tableThemeDark, outerBorderStyleMixin, Classes.gridHorizontal, Classes.tableWrapper, Classes.tableTop, Classes.gridVertical, Classes.tableWrapper, Classes.tableTop, Classes.gridNone, Classes.tableWrapper, Classes.tableTop, Classes.tableTop, Classes.tableThemeDark);
|
|
71
|
+
})(["--row-height:34px;--color:#333;--bgcolor:white;--body-hover-bgcolor:#f5f5f5;--body-hover-color:#333;--hover-bgcolor:var(--body-hover-bgcolor,#f5f5f5);--hover-color:var(--body-hover-color);--highlight-bgcolor:#eee;--header-row-height:34px;--header-color:#000000de;--header-bgcolor:#ffffff;--header-hover-bgcolor:#ddd;--header-highlight-bgcolor:#e4e8ed;--cell-padding:7px 8px;--font-size:13px;--line-height:1.28571;--lock-shadow:rgba(152,152,152,0.5) 0 0 6px 2px;--border-color:#dfe3e8;--border-color-select:#eb4619;--cell-border:1px solid var(--border-color);--cell-border-select:1px solid var(--border-color-select);--cell-border-horizontal:var(--cell-border);--cell-border-vertical:var(--cell-border);--header-cell-border:1px solid var(--border-color);--header-cell-border-horizontal:var(--header-cell-border);--header-cell-border-vertical:var(--header-cell-border);--footer-bgcolor:#fafafa;&.", "{--bgcolor:#343e59;--footer-bgcolor:#2e3342;--header-bgcolor:#343e59;--hover-bgcolor:#232b43;--header-hover-bgcolor:#606164;--highlight-bgcolor:#eff2f5;--header-highlight-bgcolor:#191a1b;--hover-color:#dadde1;--color:#dadde1;--header-color:#dadde1;--lock-shadow:rgb(37 37 37 / 0.5) 0 0 6px 2px;--border-color:#4f5266;background-color:var(--bgcolor);}&.use-outer-border{", ";}&.", "{.", "{border-left:0;border-right:0;td,th{border-right:0;}td.first,th.first{border-left:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}tr{td{&.lock-left,&.lock-right{border-bottom-width:0;box-shadow:0 -1px 0 0 var(--border-color),0 0px 0 0 var(--border-color),0px 0 0 0 var(--border-color);}}}&.has-footer tfoot tr.last td{}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{&.use-outer-border{border-bottom:var(--header-cell-border);}.", "{border-top:0;td,th{border-bottom:0;border-top:0;}td.lock-left{box-shadow:none;}td.first,th.first{}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{.", "{border:0;td,th{border-right:0;border-bottom:0;}td.lock-left{box-shadow:none;}td,th{border:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{border-top:0;border:0;}}}.", "{padding:8px;}&.ui-rc-grid .ui-rc-pagination{background-color:var(--bgcolor);color:var(--color);padding:10px;background-color:var(--bgcolor);.ui-rc-pagination-prev{.anticon.anticon-left{color:var(--color);}}.ui-rc-pagination-disabled{.anticon.anticon-left{color:#7d7a7a;}}.ui-rc-pagination-next{.anticon.anticon-right{color:var(--color);}&.ui-rc-pagination-disabled{.anticon.anticon-right{color:#7d7a7a;}}}}&.auto-height{.ui-rc-grid-bottom{border-top:0;}}.ui-rc-grid-bottom{border-top:var(--cell-border-horizontal);}.ui-rc-toolbar-bottom{.be-toolbar-item{.ui-rc-btn{font-size:12px;line-height:1.5}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}&.", "{&.ui-rc-grid{.ui-rc-toolbar-bottom{background-color:var(--footer-bgcolor);color:#ffffff;}}.ui-rc-grid-top-toolbar{border-color:var(--border-color);color:#ffffff;}.ui-rc-toolbar{.ui-rc-toolbar-selection-item{background-color:var(--footer-bgcolor);color:#ffffff;}}}"], Classes.tableThemeDark, outerBorderStyleMixin, Classes.gridHorizontal, Classes.tableWrapper, Classes.tableTop, Classes.gridVertical, Classes.tableWrapper, Classes.tableTop, Classes.gridNone, Classes.tableWrapper, Classes.tableTop, Classes.tableTop, Classes.tableThemeDark);
|
|
72
72
|
const StyledArtTableWrapper = exports.StyledArtTableWrapper = _styledComponents.default.div.withConfig({
|
|
73
73
|
displayName: "StyledArtTableWrapper",
|
|
74
74
|
componentId: "es-grid-template__sc-ipj1ht-1"
|
|
@@ -25,8 +25,7 @@ export interface ArtColumnStaticPart<RecordType = any> {
|
|
|
25
25
|
/** Column width; required if the column is locked */
|
|
26
26
|
width?: number;
|
|
27
27
|
fixed?: 'left' | 'right';
|
|
28
|
-
|
|
29
|
-
hidden?: boolean;
|
|
28
|
+
visible?: boolean;
|
|
30
29
|
/** Whether the column is locked (fixed) */
|
|
31
30
|
lock?: boolean;
|
|
32
31
|
/** Props for the header cell */
|
|
@@ -68,6 +67,7 @@ export interface ArtColumnStaticPart<RecordType = any> {
|
|
|
68
67
|
headerEditEnable?: boolean;
|
|
69
68
|
/** Kiểu editor khi edit cell */
|
|
70
69
|
headerEditType?: EditType;
|
|
70
|
+
editSelectSettings?: any;
|
|
71
71
|
}
|
|
72
72
|
export interface ArtColumnDynamicPart<RecordType = any> {
|
|
73
73
|
/** Custom data retrieval method */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TablePipeline } from '../pipeline';
|
|
2
2
|
import type { ColumnResizeMode } from '../../base-table/table';
|
|
3
3
|
import type { ArtColumn, SortOrder } from '../../interfaces';
|
|
4
|
-
import type { FilterItem, IFormat, IWrapSettings, Sorter, SourceFilter } from '../../../grid-component/type';
|
|
4
|
+
import type { FilterItem, ICellClick, IFormat, IWrapSettings, Sorter, SourceFilter } from '../../../grid-component/type';
|
|
5
5
|
type FilterState = {
|
|
6
6
|
field: any;
|
|
7
7
|
key: any;
|
|
@@ -14,6 +14,7 @@ export interface ColumnFeatureOptions {
|
|
|
14
14
|
columns: any[];
|
|
15
15
|
isDataTree?: boolean;
|
|
16
16
|
dataSource: any[];
|
|
17
|
+
rowIndexMap: any;
|
|
17
18
|
/** Uncontrolled usage: default column widths array */
|
|
18
19
|
defaultSizes?: number[];
|
|
19
20
|
columnResizeMode?: ColumnResizeMode;
|
|
@@ -63,7 +64,7 @@ export interface ColumnFeatureOptions {
|
|
|
63
64
|
getValues?: any;
|
|
64
65
|
control?: any;
|
|
65
66
|
errors?: any;
|
|
66
|
-
|
|
67
|
+
triggerChangeData?: any;
|
|
67
68
|
tableRef: any;
|
|
68
69
|
triggerPaste?: (pastedRows: any[], pastedColumnsArray: string[], newData: any[], copyRows: any[]) => void;
|
|
69
70
|
handleSubmit: any;
|
|
@@ -72,6 +73,8 @@ export interface ColumnFeatureOptions {
|
|
|
72
73
|
handleHeaderCellChange?: any;
|
|
73
74
|
dataErrors?: any[];
|
|
74
75
|
headerData?: any;
|
|
76
|
+
headerEditAble?: boolean;
|
|
77
|
+
onCellClick?: (args: ICellClick, callback?: any) => void;
|
|
75
78
|
}
|
|
76
79
|
export declare function columnCustom(opts: ColumnFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
77
80
|
export {};
|
|
@@ -20,6 +20,7 @@ var _EditCell = _interopRequireDefault(require("../../base-table/cell/EditCell")
|
|
|
20
20
|
var _HeaderEditCell = _interopRequireDefault(require("../../base-table/cell/HeaderEditCell"));
|
|
21
21
|
var _constants = require("../../utils/constants");
|
|
22
22
|
var _utils3 = require("../../base-table/utils");
|
|
23
|
+
var _utility = require("../../utils/utility");
|
|
23
24
|
// import { getMaxDepth } from '../../utils/utility';
|
|
24
25
|
|
|
25
26
|
function clamp(min, x, max) {
|
|
@@ -56,7 +57,7 @@ function columnCustom(opts) {
|
|
|
56
57
|
control,
|
|
57
58
|
getValues,
|
|
58
59
|
errors,
|
|
59
|
-
|
|
60
|
+
triggerChangeData,
|
|
60
61
|
tableRef,
|
|
61
62
|
triggerPaste,
|
|
62
63
|
handleSubmit,
|
|
@@ -64,7 +65,10 @@ function columnCustom(opts) {
|
|
|
64
65
|
handleCellChange,
|
|
65
66
|
handleHeaderCellChange,
|
|
66
67
|
dataErrors,
|
|
67
|
-
headerData
|
|
68
|
+
headerData,
|
|
69
|
+
headerEditAble,
|
|
70
|
+
rowIndexMap,
|
|
71
|
+
onCellClick
|
|
68
72
|
// originData
|
|
69
73
|
|
|
70
74
|
// currentPage = 1,
|
|
@@ -75,6 +79,7 @@ function columnCustom(opts) {
|
|
|
75
79
|
mode = 'multiple',
|
|
76
80
|
onSorter
|
|
77
81
|
} = opts;
|
|
82
|
+
const rowKey = 'rowId';
|
|
78
83
|
return function columnResizeFeature(pipeline) {
|
|
79
84
|
// State table
|
|
80
85
|
|
|
@@ -95,7 +100,6 @@ function columnCustom(opts) {
|
|
|
95
100
|
const originCols = pipeline.getColumns();
|
|
96
101
|
const rowIds = (0, _utils2.getKeys)(allRows, 'rowId');
|
|
97
102
|
const colIds = (0, _utils2.getKeys)(leafColumns, 'field');
|
|
98
|
-
const rowIndexMap = (0, _utils2.getRowIndexMap)(allRows);
|
|
99
103
|
|
|
100
104
|
// const deppthCols = getMaxDepth(originCols)
|
|
101
105
|
|
|
@@ -107,6 +111,7 @@ function columnCustom(opts) {
|
|
|
107
111
|
|
|
108
112
|
const focusedCell = pipeline.getStateAtKey(_constants.stateKeyFocusedCell) ?? {};
|
|
109
113
|
const isEditing = pipeline.getStateAtKey(_constants.stateKeyIsEditing) ?? false;
|
|
114
|
+
const editCellSettings = pipeline.getStateAtKey(_constants.stateKeyEditCellSettings);
|
|
110
115
|
const isSelecting = pipeline.getStateAtKey(_constants.stateKeyIsSelecting) ?? false;
|
|
111
116
|
const isPasting = pipeline.getStateAtKey(_constants.stateKeyIsPasting) ?? false;
|
|
112
117
|
const startCell = pipeline.getStateAtKey(_constants.stateKeyStartCell) ?? undefined;
|
|
@@ -125,7 +130,10 @@ function columnCustom(opts) {
|
|
|
125
130
|
endColIndex,
|
|
126
131
|
endRowIndex
|
|
127
132
|
} = rangeState ?? {};
|
|
128
|
-
const
|
|
133
|
+
const rowPasteIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startPasteCell?.rowId ?? '', endPasteCell?.rowId ?? '');
|
|
134
|
+
const colPasteds = (0, _utils2.getColIdsBetween1)(leafColumns, startPasteCell?.colId ?? '', endPasteCell?.colId ?? '');
|
|
135
|
+
const rowSelectIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startCell?.rowId ?? '', endCell?.rowId ?? '');
|
|
136
|
+
const colSelectIds = (0, _utils2.getColIdsBetween1)(leafColumns, startCell?.colId ?? '', endCell?.colId ?? '');
|
|
129
137
|
leafColumns.forEach((col, colIndex) => {
|
|
130
138
|
if (sizes[colIndex] == null) {
|
|
131
139
|
if (typeof col.width === 'number') {
|
|
@@ -329,11 +337,7 @@ function columnCustom(opts) {
|
|
|
329
337
|
}
|
|
330
338
|
};
|
|
331
339
|
const triggerDragPaste = (pasteState, ctrlKey) => {
|
|
332
|
-
const tmpCols =
|
|
333
|
-
const rowPasteIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startPasteCell?.rowId ?? '', endPasteCell?.rowId ?? '');
|
|
334
|
-
const colPasteds = (0, _utils2.getColIdsBetween1)(leafColumns, startPasteCell?.colId ?? '', endPasteCell?.colId ?? '');
|
|
335
|
-
const rowSelectIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startCell?.rowId ?? '', endCell?.rowId ?? '');
|
|
336
|
-
const colSelectIds = (0, _utils2.getColIdsBetween1)(leafColumns, startCell?.colId ?? '', endCell?.colId ?? '');
|
|
340
|
+
const tmpCols = leafColumns;
|
|
337
341
|
const dataSelected = []; // data được copy
|
|
338
342
|
|
|
339
343
|
rowSelectIds.forEach(rowId => {
|
|
@@ -341,8 +345,6 @@ function columnCustom(opts) {
|
|
|
341
345
|
if (!row) return;
|
|
342
346
|
const rowData = [];
|
|
343
347
|
colSelectIds.forEach(colId => {
|
|
344
|
-
// const cellll = row.getVisibleCells().find(c => c.column.id === colId);
|
|
345
|
-
|
|
346
348
|
const value = row[colId];
|
|
347
349
|
rowData.push(value !== undefined ? value : '');
|
|
348
350
|
});
|
|
@@ -385,7 +387,7 @@ function columnCustom(opts) {
|
|
|
385
387
|
}
|
|
386
388
|
|
|
387
389
|
// Cập nhật data mới
|
|
388
|
-
const newData = (0, _utils2.flattenArray)(
|
|
390
|
+
const newData = (0, _utils2.flattenArray)(allRows);
|
|
389
391
|
const pastedRows = [];
|
|
390
392
|
if (pasteState.type === 'down' || pasteState.type === 'up') {
|
|
391
393
|
newRange.addedRows.forEach((rowValues, rowIndex1) => {
|
|
@@ -451,20 +453,18 @@ function columnCustom(opts) {
|
|
|
451
453
|
pastedRows.push(newData[targetRow]);
|
|
452
454
|
});
|
|
453
455
|
}
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
+
|
|
457
|
+
// const rsFilterData = updateOrInsert(flattenArray(dataSource), newData)
|
|
458
|
+
const rsFilterData = (0, _utility.updateOrInsert)(dataSource, newData);
|
|
459
|
+
const rs = (0, _utility.unFlattenData)(rsFilterData);
|
|
456
460
|
triggerPaste?.(pastedRows, colPasteds, rs, copyRows);
|
|
457
461
|
pipeline.setStateAtKey(_constants.stateKeyEndCell, endPasteCell);
|
|
458
462
|
pipeline.setStateAtKey(_constants.stateKeyEndPasteCell, undefined);
|
|
459
463
|
pipeline.setStateAtKey(_constants.stateKeyStartPasteCell, undefined);
|
|
460
464
|
};
|
|
461
465
|
const triggerPointPaste = (pasteState, cellStart, cellEnd, ctrlKey) => {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
const rowPasteIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, cellStart?.rowId ?? '', cellEnd?.rowId ?? '');
|
|
465
|
-
const colPasteds = (0, _utils2.getColIdsBetween1)(leafColumns, cellStart?.colId ?? '', cellEnd?.colId ?? '');
|
|
466
|
-
const rowSelectIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startCell?.rowId ?? '', endCell?.rowId ?? '');
|
|
467
|
-
const colSelectIds = (0, _utils2.getColIdsBetween1)(leafColumns, startCell?.colId ?? '', endCell?.colId ?? '');
|
|
466
|
+
const rowsPasteId = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, cellStart?.rowId ?? '', cellEnd?.rowId ?? '');
|
|
467
|
+
const colsPastedId = (0, _utils2.getColIdsBetween1)(leafColumns, cellStart?.colId ?? '', cellEnd?.colId ?? '');
|
|
468
468
|
const dataSelected = [];
|
|
469
469
|
rowSelectIds.forEach(rowId => {
|
|
470
470
|
const row = allRows.find(r => r.rowId === rowId);
|
|
@@ -479,21 +479,13 @@ function columnCustom(opts) {
|
|
|
479
479
|
const copyRows = (0, _utils2.flattenData)('children', dataSource).filter(it => rowSelectIds.includes(it[rowKey]));
|
|
480
480
|
|
|
481
481
|
// kéo xuóng
|
|
482
|
-
|
|
483
|
-
const newRange = ctrlKey ? (0, _utils2.addRowsDownWithCtrl)(dataSelected, rowPasteIds.length) : (0, _utils2.addRowsDown)(dataSelected, rowPasteIds.length);
|
|
482
|
+
const newRange = ctrlKey ? (0, _utils2.addRowsDownWithCtrl)(dataSelected, rowsPasteId.length) : (0, _utils2.addRowsDown)(dataSelected, rowsPasteId.length);
|
|
484
483
|
|
|
485
484
|
// Cập nhật data mới
|
|
486
|
-
const newData = (0, _utils2.flattenArray)(
|
|
485
|
+
const newData = (0, _utils2.flattenArray)(dataSource);
|
|
487
486
|
const pastedRows = [];
|
|
488
487
|
newRange.addedRows.forEach((rowValues, rowIndex1) => {
|
|
489
|
-
const targetRow = pasteState
|
|
490
|
-
|
|
491
|
-
// Nếu vượt quá số dòng hiện có, thêm dòng mới
|
|
492
|
-
// if (targetRow >= newData.length) {
|
|
493
|
-
|
|
494
|
-
// newData.push({ id: undefined, rowId: newGuid() })
|
|
495
|
-
// }
|
|
496
|
-
|
|
488
|
+
const targetRow = pasteState?.startRowIndex + rowIndex1;
|
|
497
489
|
rowValues.forEach((cellValue, colIndex1) => {
|
|
498
490
|
const targetCol = startColIndex + colIndex1;
|
|
499
491
|
if (targetCol >= leafColumns.length) {
|
|
@@ -510,9 +502,9 @@ function columnCustom(opts) {
|
|
|
510
502
|
// Lưu dòng được paste
|
|
511
503
|
pastedRows.push(newData[targetRow]);
|
|
512
504
|
});
|
|
513
|
-
const rsFilterData = (0,
|
|
514
|
-
const rs = (0,
|
|
515
|
-
triggerPaste?.(pastedRows,
|
|
505
|
+
const rsFilterData = (0, _utility.updateOrInsert)(dataSource, newData);
|
|
506
|
+
const rs = (0, _utility.unFlattenData)(rsFilterData);
|
|
507
|
+
triggerPaste?.(pastedRows, colsPastedId, rs, copyRows);
|
|
516
508
|
};
|
|
517
509
|
const handleMouseDown = (rowId, colId) => {
|
|
518
510
|
pipeline.setStateAtKey(_constants.stateKeyIsSelecting, true);
|
|
@@ -642,6 +634,11 @@ function columnCustom(opts) {
|
|
|
642
634
|
// }
|
|
643
635
|
}
|
|
644
636
|
};
|
|
637
|
+
|
|
638
|
+
// const handleDeleteContent = () => {
|
|
639
|
+
|
|
640
|
+
// }
|
|
641
|
+
|
|
645
642
|
const handleKeyDown = (e, rowId, colId, rowIndex, column, record, editType) => {
|
|
646
643
|
if (e.key === 'Tab') {
|
|
647
644
|
const nextCol = (0, _utils2.getNextColumn)(allCols, focusedCell.colId);
|
|
@@ -775,8 +772,54 @@ function columnCustom(opts) {
|
|
|
775
772
|
}
|
|
776
773
|
return;
|
|
777
774
|
}
|
|
778
|
-
if (e.key === 'Delete') {
|
|
779
|
-
handleDeleteContent?.()
|
|
775
|
+
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
776
|
+
// handleDeleteContent?.()
|
|
777
|
+
|
|
778
|
+
if (startCell && endCell) {
|
|
779
|
+
const tmpData = (0, _utils2.flattenArray)([...dataSource]);
|
|
780
|
+
const rs = tmpData.map((row, index) => {
|
|
781
|
+
if (!rangeState?.rowRange.includes(row.rowId)) {
|
|
782
|
+
return row;
|
|
783
|
+
}
|
|
784
|
+
const updatedRow = {
|
|
785
|
+
...row
|
|
786
|
+
};
|
|
787
|
+
for (const field of rangeState.colRange) {
|
|
788
|
+
const col = leafColumns.find(it => it.field === field);
|
|
789
|
+
const columnIndex = leafColumns.findIndex(it => it.field === field);
|
|
790
|
+
if ((0, _hooks.isEditable)(col, row)) {
|
|
791
|
+
let newValue = '';
|
|
792
|
+
if (col.type === 'number') {
|
|
793
|
+
newValue = 0;
|
|
794
|
+
}
|
|
795
|
+
if (col.type === 'boolean' || col.type === 'checkbox') {
|
|
796
|
+
newValue = false;
|
|
797
|
+
}
|
|
798
|
+
const cellEditType = (0, _utils2.getEditType)(col, row);
|
|
799
|
+
if (col.type === 'date' || col.type === 'datetime' || col.type === 'time' || col.type === 'month' || col.type === 'week' || col.type === 'year' || col.type === 'quarter' || cellEditType === 'asyncSelect' || cellEditType === 'select' || cellEditType === 'treeSelect' || cellEditType === 'selectTable') {
|
|
800
|
+
newValue = undefined;
|
|
801
|
+
}
|
|
802
|
+
updatedRow[col.field] = newValue;
|
|
803
|
+
handleCellChange({
|
|
804
|
+
key: row[rowKey],
|
|
805
|
+
field: col.field,
|
|
806
|
+
record: updatedRow,
|
|
807
|
+
prevState: row[col.field],
|
|
808
|
+
newState: newValue,
|
|
809
|
+
option: '',
|
|
810
|
+
indexCol: columnIndex,
|
|
811
|
+
indexRow: index,
|
|
812
|
+
type: e.key
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
return updatedRow;
|
|
817
|
+
});
|
|
818
|
+
const newData = (0, _utility.unFlattenData)(rs);
|
|
819
|
+
triggerChangeData?.([...newData], {
|
|
820
|
+
type: 'DELETE_CONTENT'
|
|
821
|
+
});
|
|
822
|
+
}
|
|
780
823
|
return;
|
|
781
824
|
}
|
|
782
825
|
if (e.key === 'Enter') {
|
|
@@ -1001,20 +1044,13 @@ function columnCustom(opts) {
|
|
|
1001
1044
|
rowId: rowEnd.id,
|
|
1002
1045
|
colId: column.field
|
|
1003
1046
|
};
|
|
1004
|
-
const
|
|
1005
|
-
const pasteStartRow = allRows[
|
|
1047
|
+
const currentRowIndex = rowIndexMap.get(record.rowId);
|
|
1048
|
+
const pasteStartRow = allRows[currentRowIndex + 1];
|
|
1006
1049
|
const cellStart = {
|
|
1007
1050
|
rowId: pasteStartRow.id,
|
|
1008
1051
|
colId: endCell?.colId ?? ''
|
|
1009
1052
|
};
|
|
1010
|
-
|
|
1011
|
-
// const selectState = getSelectedCellMatrix(table, startCell, cellEnd)
|
|
1012
|
-
|
|
1013
1053
|
const selectPasteState = (0, _utils2.getSelectedCellMatrix1)(allRows, leafColumns, cellStart, cellEnd);
|
|
1014
|
-
|
|
1015
|
-
// setRangeState?.(selectState)
|
|
1016
|
-
// setEndCell?.(cellEnd)
|
|
1017
|
-
|
|
1018
1054
|
pipeline.setStateAtKey(_constants.stateKeyEndCell, cellEnd);
|
|
1019
1055
|
triggerPointPaste(selectPasteState, cellStart, cellEnd, e.ctrlKey);
|
|
1020
1056
|
};
|
|
@@ -1272,7 +1308,7 @@ function columnCustom(opts) {
|
|
|
1272
1308
|
[`${prefix}-grid-cell-text-center`]: (col?.headerTextAlign ?? col?.textAlign) === 'center',
|
|
1273
1309
|
[`${prefix}-grid-cell-text-right`]: (col?.headerTextAlign ?? col.textAlign) === 'right'
|
|
1274
1310
|
})
|
|
1275
|
-
}, col.headerEditEnable && cellHeaderEditing ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_HeaderEditCell.default, {
|
|
1311
|
+
}, headerEditAble && col.headerEditEnable && cellHeaderEditing ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_HeaderEditCell.default, {
|
|
1276
1312
|
column: col,
|
|
1277
1313
|
editType: headerEditType ?? 'text',
|
|
1278
1314
|
record: headerRecord,
|
|
@@ -1296,7 +1332,7 @@ function columnCustom(opts) {
|
|
|
1296
1332
|
startCell: startCell,
|
|
1297
1333
|
handleSubmit: handleSubmit,
|
|
1298
1334
|
onSubmit: onSubmit
|
|
1299
|
-
})) : col.headerEditEnable ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, headerValue) : col.headerTemplate ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, prevTitle))), !col.headerEditEnable && (!_hooks.nonActionColumn.includes(col.field) && !col?.children || col?.children && col?.children.length < 1) && /*#__PURE__*/_react.default.createElement("span", {
|
|
1335
|
+
})) : headerEditAble && col.headerEditEnable ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, headerValue) : col.headerTemplate ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, prevTitle))), !col.headerEditEnable && (!_hooks.nonActionColumn.includes(col.field) && !col?.children || col?.children && col?.children.length < 1) && /*#__PURE__*/_react.default.createElement("span", {
|
|
1300
1336
|
className: "ui-rc-header-trigger d-flex gap-50"
|
|
1301
1337
|
}, canSort && /*#__PURE__*/_react.default.createElement("div", {
|
|
1302
1338
|
style: {
|
|
@@ -1379,84 +1415,89 @@ function columnCustom(opts) {
|
|
|
1379
1415
|
onDoubleClick: e => {
|
|
1380
1416
|
// prevCellProps?.onDoubleClick?.(e)
|
|
1381
1417
|
|
|
1382
|
-
if (
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1418
|
+
if (headerEditAble) {
|
|
1419
|
+
if (!col.headerEditEnable) {
|
|
1420
|
+
e.stopPropagation();
|
|
1421
|
+
e.preventDefault();
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
if (headerRowId === focusedCell.rowId && col.field === focusedCell.colId && col.headerEditEnable) {
|
|
1425
|
+
handleEdit(e, headerRecord, col, headerEditType ?? 'text', false, true);
|
|
1426
|
+
}
|
|
1389
1427
|
}
|
|
1390
1428
|
},
|
|
1391
1429
|
onKeyDown: e => {
|
|
1392
1430
|
// prevCellProps?.onKeyDown?.(e)
|
|
1393
1431
|
// chưa editing
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
e.preventDefault();
|
|
1399
|
-
e.stopPropagation();
|
|
1432
|
+
|
|
1433
|
+
if (headerEditAble) {
|
|
1434
|
+
if (!isEditing) {
|
|
1435
|
+
handleHeaderKeyDown(e, headerRowId, col.field, headerRowIndex, col, headerRecord, headerEditType ?? 'text');
|
|
1400
1436
|
} else {
|
|
1401
|
-
if (e.key === 'Enter') {
|
|
1437
|
+
if (e.shiftKey && e.key === 'Enter') {
|
|
1402
1438
|
e.preventDefault();
|
|
1403
1439
|
e.stopPropagation();
|
|
1440
|
+
} else {
|
|
1441
|
+
if (e.key === 'Enter') {
|
|
1442
|
+
e.preventDefault();
|
|
1443
|
+
e.stopPropagation();
|
|
1404
1444
|
|
|
1405
|
-
|
|
1406
|
-
|
|
1445
|
+
// const currentRowIndex = allRows.findIndex(r => r.rowId === headerRowId);
|
|
1446
|
+
// const nextRow = allRows[currentRowIndex + 1];
|
|
1407
1447
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1448
|
+
// if (nextRow) {
|
|
1449
|
+
// const nextCellPosition = { rowId: nextRow.rowId, colId: col.field }
|
|
1410
1450
|
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1451
|
+
// pipeline.setStateAtKey(stateKeyFocusedCell, nextCellPosition)
|
|
1452
|
+
// pipeline.setStateAtKey(stateKeyStartCell, nextCellPosition)
|
|
1453
|
+
// pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
|
|
1414
1454
|
|
|
1415
|
-
|
|
1416
|
-
|
|
1455
|
+
handleHeaderChange(headerRecord, col, startIndex);
|
|
1456
|
+
pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
|
|
1417
1457
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1458
|
+
// }
|
|
1459
|
+
}
|
|
1460
|
+
if (e.key === 'Tab') {
|
|
1461
|
+
e.preventDefault();
|
|
1422
1462
|
|
|
1423
|
-
|
|
1463
|
+
// const nextCol = getNextColumn(allCols, col.field)
|
|
1424
1464
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1465
|
+
if (nextHeaderCol?.column?.field && !nextHeaderCol?.isWrapped) {
|
|
1466
|
+
const nextCellPosition = {
|
|
1467
|
+
rowId: headerRowId,
|
|
1468
|
+
colId: nextHeaderCol.column.field
|
|
1469
|
+
};
|
|
1470
|
+
pipeline.setStateAtKey(_constants.stateKeyFocusedCell, nextCellPosition);
|
|
1471
|
+
pipeline.setStateAtKey(_constants.stateKeyStartCell, nextCellPosition);
|
|
1472
|
+
pipeline.setStateAtKey(_constants.stateKeyEndCell, nextCellPosition);
|
|
1433
1473
|
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1474
|
+
// columnVirtualizer.scrollToIndex(nextCol.getIndex(), { align: 'center' })
|
|
1475
|
+
} else {
|
|
1476
|
+
// Nếu là cột cuối cùng, có thể nhảy xuống dòng tiếp theo
|
|
1437
1477
|
|
|
1438
|
-
|
|
1439
|
-
|
|
1478
|
+
// const currentRowIndex = allRows.findIndex(r => r.rowId === headerRowId);
|
|
1479
|
+
// const nextRow = allRows[currentRowIndex + 1];
|
|
1440
1480
|
|
|
1441
|
-
|
|
1481
|
+
// const firstCol = nextCol.column
|
|
1442
1482
|
|
|
1443
|
-
|
|
1483
|
+
// if (nextRow) {
|
|
1444
1484
|
|
|
1445
|
-
|
|
1485
|
+
// const nextCellPosition = { rowId: nextRow.rowId, colId: firstCol.field }
|
|
1446
1486
|
|
|
1447
|
-
|
|
1487
|
+
// pipeline.setStateAtKey(stateKeyFocusedCell, nextCellPosition)
|
|
1448
1488
|
|
|
1449
|
-
|
|
1450
|
-
|
|
1489
|
+
// pipeline.setStateAtKey(stateKeyStartCell, nextCellPosition)
|
|
1490
|
+
// pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
|
|
1451
1491
|
|
|
1452
|
-
|
|
1492
|
+
// // columnVirtualizer.scrollToIndex(nextRowCol.getIndex())
|
|
1453
1493
|
|
|
1454
|
-
|
|
1494
|
+
// // rowVirtualizer.scrollToIndex(nextRow.index, { align: 'auto' })
|
|
1455
1495
|
|
|
1456
|
-
|
|
1496
|
+
// }
|
|
1497
|
+
}
|
|
1498
|
+
handleHeaderChange(headerRecord, col, startIndex);
|
|
1499
|
+
pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
|
|
1457
1500
|
}
|
|
1458
|
-
handleHeaderChange(headerRecord, col, startIndex);
|
|
1459
|
-
pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
|
|
1460
1501
|
}
|
|
1461
1502
|
}
|
|
1462
1503
|
}
|
|
@@ -1613,6 +1654,28 @@ function columnCustom(opts) {
|
|
|
1613
1654
|
return;
|
|
1614
1655
|
}
|
|
1615
1656
|
if (record.rowId === focusedCell.rowId && col.field === focusedCell.colId && canEdit) {
|
|
1657
|
+
if (onCellClick) {
|
|
1658
|
+
const cellClickCallback = newOptions => {
|
|
1659
|
+
if (newOptions) {
|
|
1660
|
+
pipeline.setStateAtKey(_constants.stateKeyEditCellSettings, {
|
|
1661
|
+
rowId: record.rowId,
|
|
1662
|
+
colId: col.field,
|
|
1663
|
+
editSelectSettings: {
|
|
1664
|
+
...col.editSelectSettings,
|
|
1665
|
+
options: newOptions
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
};
|
|
1670
|
+
onCellClick({
|
|
1671
|
+
index: rowIndex,
|
|
1672
|
+
rowId: record.rowId,
|
|
1673
|
+
cellValue: value,
|
|
1674
|
+
type: "Editing",
|
|
1675
|
+
field: col.field,
|
|
1676
|
+
rowData: record
|
|
1677
|
+
}, cellClickCallback);
|
|
1678
|
+
}
|
|
1616
1679
|
handleEdit(e, record, col, editType ?? 'text', false);
|
|
1617
1680
|
}
|
|
1618
1681
|
},
|
|
@@ -1691,7 +1754,10 @@ function columnCustom(opts) {
|
|
|
1691
1754
|
},
|
|
1692
1755
|
// children: ''
|
|
1693
1756
|
children: canEdit && cellEditing ? /*#__PURE__*/_react.default.createElement(_EditCell.default, {
|
|
1694
|
-
column: col
|
|
1757
|
+
column: editCellSettings?.rowId === record.rowId && editCellSettings?.colId === col.field ? {
|
|
1758
|
+
...col,
|
|
1759
|
+
editSelectSettings: editCellSettings.editSelectSettings
|
|
1760
|
+
} : col,
|
|
1695
1761
|
editType: editType ?? 'text',
|
|
1696
1762
|
record: record,
|
|
1697
1763
|
tableId: id,
|
|
@@ -10,6 +10,7 @@ export declare const stateKeyIsEditing = "isEditing";
|
|
|
10
10
|
export declare const stateKeyStartPasteCell = "startPasteCell";
|
|
11
11
|
export declare const stateKeyEndPasteCell = "endPasteCell";
|
|
12
12
|
export declare const stateKeyIsSelecting = "isSelecting";
|
|
13
|
+
export declare const stateKeyEditCellSettings = "editCellSettings";
|
|
13
14
|
export declare const stateKeyIsPasting = "isPasting";
|
|
14
15
|
export declare const stateKeyEndCell = "endCell";
|
|
15
16
|
export declare const stateKeyStartCell = "startCell";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.stateKeyVisible = exports.stateKeyTypePaste = exports.stateKeyTooltip = exports.stateKeyStartPasteCell = exports.stateKeyStartCell = exports.stateKeySorter = exports.stateKeyResize = exports.stateKeyPagination = exports.stateKeyIsSelecting = exports.stateKeyIsPasting = exports.stateKeyIsEditing = exports.stateKeyFocusedCell = exports.stateKeyFilter = exports.stateKeyEndPasteCell = exports.stateKeyEndCell = exports.stateKeyColumnFilter = void 0;
|
|
6
|
+
exports.stateKeyVisible = exports.stateKeyTypePaste = exports.stateKeyTooltip = exports.stateKeyStartPasteCell = exports.stateKeyStartCell = exports.stateKeySorter = exports.stateKeyResize = exports.stateKeyPagination = exports.stateKeyIsSelecting = exports.stateKeyIsPasting = exports.stateKeyIsEditing = exports.stateKeyFocusedCell = exports.stateKeyFilter = exports.stateKeyEndPasteCell = exports.stateKeyEndCell = exports.stateKeyEditCellSettings = exports.stateKeyColumnFilter = void 0;
|
|
7
7
|
const stateKeyResize = exports.stateKeyResize = 'columnResize';
|
|
8
8
|
const stateKeyFilter = exports.stateKeyFilter = 'columnsFilter';
|
|
9
9
|
const stateKeySorter = exports.stateKeySorter = 'columnsSorter';
|
|
@@ -21,6 +21,7 @@ const stateKeyIsEditing = exports.stateKeyIsEditing = 'isEditing';
|
|
|
21
21
|
const stateKeyStartPasteCell = exports.stateKeyStartPasteCell = 'startPasteCell';
|
|
22
22
|
const stateKeyEndPasteCell = exports.stateKeyEndPasteCell = 'endPasteCell';
|
|
23
23
|
const stateKeyIsSelecting = exports.stateKeyIsSelecting = 'isSelecting';
|
|
24
|
+
const stateKeyEditCellSettings = exports.stateKeyEditCellSettings = 'editCellSettings';
|
|
24
25
|
const stateKeyIsPasting = exports.stateKeyIsPasting = 'isPasting';
|
|
25
26
|
const stateKeyEndCell = exports.stateKeyEndCell = 'endCell';
|
|
26
27
|
const stateKeyStartCell = exports.stateKeyStartCell = 'startCell';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TreeDataNode } from "rc-master-ui";
|
|
2
|
-
import { ColumnTable } from "../../grid-component";
|
|
1
|
+
import type { TreeDataNode } from "rc-master-ui";
|
|
2
|
+
import type { ColumnTable } from "../../grid-component";
|
|
3
3
|
export declare function convertColumnsToTreeData(columns: ColumnTable[], groupColumns?: string[], t?: any): TreeDataNode[];
|
|
4
4
|
export declare function filterColumnsByField(columns: ColumnTable[], fieldList: string[]): ColumnTable[];
|
|
5
5
|
export declare function filterVisibleColumns(columns: ColumnTable[]): ColumnTable[];
|