es-grid-template 1.7.38 → 1.7.39
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/CHANGELOG.md +6 -0
- package/LICENSE +21 -21
- package/README.md +1 -1
- package/es/grid-component/hooks/constant.js +6 -6
- package/es/grid-component/hooks/useColumns.d.ts +1 -3
- package/es/grid-component/hooks/utils.d.ts +1 -1
- package/es/grid-component/styles.scss +1437 -1437
- package/es/table-component/ContextMenu.d.ts +3 -2
- package/es/table-component/ContextMenu.js +2 -2
- package/es/table-component/InternalTable.d.ts +6 -6
- package/es/table-component/InternalTable.js +25 -134
- package/es/table-component/TableContainer.d.ts +5 -5
- package/es/table-component/TableContainer.js +32 -31
- package/es/table-component/TableContainerEdit.d.ts +1 -1
- package/es/table-component/TableContainerEdit.js +247 -228
- package/es/table-component/body/EditableCell.js +146 -147
- package/es/table-component/body/TableBody.d.ts +1 -1
- package/es/table-component/body/TableBody.js +5 -5
- package/es/table-component/body/TableBodyCell.js +18 -37
- package/es/table-component/body/TableBodyCellEdit.d.ts +4 -4
- package/es/table-component/body/TableBodyCellEdit.js +64 -63
- package/es/table-component/body/TableBodyRow.js +1 -0
- package/es/table-component/footer/TableFooterCell.d.ts +3 -3
- package/es/table-component/footer/TableFooterCell.js +6 -8
- package/es/table-component/header/TableHead.d.ts +5 -5
- package/es/table-component/header/TableHead.js +2 -2
- package/es/table-component/hook/constant.js +6 -6
- package/es/table-component/hook/useFilterOperator.d.ts +1 -1
- package/es/table-component/hook/utils.d.ts +3 -2
- package/es/table-component/hook/utils.js +159 -202
- package/es/table-component/style.scss +1197 -1197
- package/es/table-component/table/TableWrapper.d.ts +4 -4
- package/es/table-component/table/TableWrapper.js +20 -23
- package/es/table-component/type.d.ts +40 -40
- package/es/table-component/useContext.d.ts +3 -4
- package/es/table-component/useContext.js +4 -4
- package/lib/grid-component/hooks/constant.js +6 -6
- package/lib/grid-component/hooks/useColumns.d.ts +1 -3
- package/lib/grid-component/hooks/utils.d.ts +1 -1
- package/lib/grid-component/styles.scss +1437 -1437
- package/lib/table-component/ContextMenu.d.ts +3 -2
- package/lib/table-component/InternalTable.d.ts +6 -6
- package/lib/table-component/InternalTable.js +18 -125
- package/lib/table-component/TableContainer.d.ts +5 -5
- package/lib/table-component/TableContainer.js +26 -24
- package/lib/table-component/TableContainerEdit.d.ts +1 -1
- package/lib/table-component/TableContainerEdit.js +246 -227
- package/lib/table-component/body/EditableCell.js +145 -146
- package/lib/table-component/body/TableBody.d.ts +1 -1
- package/lib/table-component/body/TableBody.js +5 -5
- package/lib/table-component/body/TableBodyCell.js +17 -36
- package/lib/table-component/body/TableBodyCellEdit.d.ts +4 -4
- package/lib/table-component/body/TableBodyCellEdit.js +60 -59
- package/lib/table-component/body/TableBodyRow.js +1 -0
- package/lib/table-component/footer/TableFooterCell.d.ts +3 -3
- package/lib/table-component/footer/TableFooterCell.js +5 -7
- package/lib/table-component/header/TableHead.d.ts +5 -5
- package/lib/table-component/header/TableHead.js +1 -1
- package/lib/table-component/hook/constant.js +6 -6
- package/lib/table-component/hook/useFilterOperator.d.ts +1 -1
- package/lib/table-component/hook/utils.d.ts +3 -2
- package/lib/table-component/hook/utils.js +159 -201
- package/lib/table-component/style.scss +1197 -1197
- package/lib/table-component/table/TableWrapper.d.ts +4 -4
- package/lib/table-component/table/TableWrapper.js +20 -23
- package/lib/table-component/type.d.ts +40 -40
- package/lib/table-component/useContext.d.ts +3 -4
- package/lib/table-component/useContext.js +3 -3
- package/package.json +116 -116
|
@@ -43,7 +43,7 @@ const filterTreeNode = (input, treeNode) => {
|
|
|
43
43
|
title,
|
|
44
44
|
value
|
|
45
45
|
} = treeNode;
|
|
46
|
-
if (typeof title === "string" || typeof title ===
|
|
46
|
+
if (typeof title === "string" || typeof title === 'number') {
|
|
47
47
|
return title.toString().toLowerCase().includes(input.toLowerCase()) || value.toLowerCase().includes(input.toLowerCase());
|
|
48
48
|
}
|
|
49
49
|
return value.toLowerCase().includes(input.toLowerCase());
|
|
@@ -78,7 +78,7 @@ const EditableCell = props => {
|
|
|
78
78
|
const dateTimePickerRef = _react.default.useRef(null);
|
|
79
79
|
// const timePickerRef = React.useRef(null);
|
|
80
80
|
|
|
81
|
-
const colFormat = typeof column?.format ===
|
|
81
|
+
const colFormat = typeof column?.format === 'function' ? column?.format(record) : column?.format;
|
|
82
82
|
const cellFormat = (0, _utils.getFormat)(colFormat, format);
|
|
83
83
|
const inputNode = (value, onChange) => {
|
|
84
84
|
const dateFormat = (0, _utils.getDatepickerFormat)(editType, cellFormat);
|
|
@@ -104,32 +104,33 @@ const EditableCell = props => {
|
|
|
104
104
|
|
|
105
105
|
// @ts-ignore
|
|
106
106
|
const key = record[rowKey];
|
|
107
|
-
const field = column.field ??
|
|
107
|
+
const field = column.field ?? '';
|
|
108
108
|
|
|
109
109
|
// const message = errors && column.field && errors[column.field] ? errors[column.field].message : ''
|
|
110
110
|
const message = isInvalid?.message;
|
|
111
111
|
const keySelect = (0, _utils.checkFieldKey)(column?.editSelectSettings?.fieldKey);
|
|
112
|
-
const selectOptions = typeof propsOptions ===
|
|
112
|
+
const selectOptions = typeof propsOptions === 'function' ? propsOptions(record, column.field) : propsOptions;
|
|
113
113
|
const options = validateOption ? validateOption(record, column.field) : selectOptions ?? [];
|
|
114
114
|
const optionsTree = validateOption ? (0, _utils.convertArrayWithIndent)(validateOption(record, column.field)) : selectOptions ? (0, _utils.convertArrayWithIndent)(selectOptions) : [];
|
|
115
115
|
|
|
116
116
|
// const currt = flatColumns2()
|
|
117
117
|
|
|
118
118
|
switch (editType) {
|
|
119
|
-
case
|
|
119
|
+
case 'date':
|
|
120
120
|
return /*#__PURE__*/_react.default.createElement(_antd.DatePicker, {
|
|
121
121
|
ref: datePickerRef,
|
|
122
122
|
format: {
|
|
123
123
|
format: dateFormat,
|
|
124
|
-
type:
|
|
124
|
+
type: 'mask'
|
|
125
125
|
},
|
|
126
126
|
autoFocus: column.field === startCell?.colId,
|
|
127
127
|
defaultOpen: column.field === startCell?.colId
|
|
128
|
+
|
|
128
129
|
// locale={buddhistLocale}
|
|
129
130
|
,
|
|
130
131
|
style: {
|
|
131
|
-
width:
|
|
132
|
-
height:
|
|
132
|
+
width: '100%',
|
|
133
|
+
height: '100%'
|
|
133
134
|
}
|
|
134
135
|
// value={date}
|
|
135
136
|
,
|
|
@@ -153,11 +154,11 @@ const EditableCell = props => {
|
|
|
153
154
|
option: newState,
|
|
154
155
|
indexCol,
|
|
155
156
|
indexRow,
|
|
156
|
-
type:
|
|
157
|
+
type: 'blur'
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
160
|
},
|
|
160
|
-
placeholder: t ? t(column.placeholder ??
|
|
161
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
161
162
|
disabled: (0, _utils.isDisable)(column, record) ?? false,
|
|
162
163
|
maxDate: maxDate,
|
|
163
164
|
minDate: minDate,
|
|
@@ -169,31 +170,31 @@ const EditableCell = props => {
|
|
|
169
170
|
datePickerRef.current?.focus();
|
|
170
171
|
}, 0);
|
|
171
172
|
},
|
|
172
|
-
popupClassName:
|
|
173
|
-
status: isInvalid ?
|
|
173
|
+
popupClassName: 'be-popup-container',
|
|
174
|
+
status: isInvalid ? 'error' : undefined,
|
|
174
175
|
"data-tooltip-content": message,
|
|
175
176
|
"data-tooltip-id": `${id}-tooltip-error`
|
|
176
177
|
});
|
|
177
|
-
case
|
|
178
|
+
case 'datetime':
|
|
178
179
|
return /*#__PURE__*/_react.default.createElement(_antd.DatePicker
|
|
179
180
|
// id={`col${indexCol}-record${indexRow}`}
|
|
180
181
|
, {
|
|
181
182
|
ref: dateTimePickerRef,
|
|
182
183
|
format: {
|
|
183
184
|
format: dateFormat,
|
|
184
|
-
type:
|
|
185
|
+
type: 'mask'
|
|
185
186
|
}
|
|
186
187
|
// locale={buddhistLocale}
|
|
187
188
|
,
|
|
188
189
|
style: {
|
|
189
|
-
width:
|
|
190
|
-
height:
|
|
190
|
+
width: '100%',
|
|
191
|
+
height: '100%'
|
|
191
192
|
},
|
|
192
193
|
showTime: true
|
|
193
194
|
// value={date}
|
|
194
195
|
,
|
|
195
196
|
defaultValue: date,
|
|
196
|
-
placeholder: t ? t(column.placeholder ??
|
|
197
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
197
198
|
disabled: (0, _utils.isDisable)(column, record) ?? false,
|
|
198
199
|
maxDate: maxDate,
|
|
199
200
|
minDate: minDate,
|
|
@@ -221,20 +222,20 @@ const EditableCell = props => {
|
|
|
221
222
|
option: newState,
|
|
222
223
|
indexCol,
|
|
223
224
|
indexRow,
|
|
224
|
-
type:
|
|
225
|
+
type: 'blur'
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
228
|
},
|
|
228
|
-
popupClassName:
|
|
229
|
-
status: isInvalid ?
|
|
229
|
+
popupClassName: 'be-popup-container',
|
|
230
|
+
status: isInvalid ? 'error' : undefined,
|
|
230
231
|
"data-tooltip-content": message,
|
|
231
232
|
"data-tooltip-id": `${id}-tooltip-error`,
|
|
232
233
|
autoFocus: column.field === startCell?.colId,
|
|
233
234
|
defaultOpen: column.field === startCell?.colId
|
|
234
235
|
});
|
|
235
|
-
case
|
|
236
|
-
case
|
|
237
|
-
case
|
|
236
|
+
case 'month':
|
|
237
|
+
case 'quarter':
|
|
238
|
+
case 'year':
|
|
238
239
|
const pickerFormat = (0, _utils.getDatepickerFormat)(editType, cellFormat);
|
|
239
240
|
const maxDateValue1 = !(0, _utils.isEmpty)(column.maxDate) ? (0, _dayjs.default)(column.maxDate, pickerFormat) : undefined;
|
|
240
241
|
const minDateValue1 = !(0, _utils.isEmpty)(column.minDate) ? (0, _dayjs.default)(column.minDate, pickerFormat) : undefined;
|
|
@@ -242,47 +243,47 @@ const EditableCell = props => {
|
|
|
242
243
|
id: `col${indexCol}-record${indexRow}`,
|
|
243
244
|
format: {
|
|
244
245
|
format: pickerFormat,
|
|
245
|
-
type:
|
|
246
|
+
type: 'mask'
|
|
246
247
|
},
|
|
247
248
|
style: {
|
|
248
|
-
width:
|
|
249
|
-
height:
|
|
249
|
+
width: '100%',
|
|
250
|
+
height: '100%'
|
|
250
251
|
},
|
|
251
252
|
picker: editType,
|
|
252
|
-
placeholder: t ? t(column.placeholder ??
|
|
253
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
253
254
|
disabled: (0, _utils.isDisable)(column, record) ?? false,
|
|
254
255
|
maxDate: maxDateValue1,
|
|
255
256
|
minDate: minDateValue1,
|
|
256
|
-
popupClassName:
|
|
257
|
-
status: isInvalid ?
|
|
257
|
+
popupClassName: 'be-popup-container',
|
|
258
|
+
status: isInvalid ? 'error' : undefined,
|
|
258
259
|
"data-tooltip-content": message,
|
|
259
260
|
"data-tooltip-id": `${id}-tooltip-error`,
|
|
260
261
|
autoFocus: column.field === startCell?.colId,
|
|
261
262
|
defaultOpen: column.field === startCell?.colId
|
|
262
263
|
});
|
|
263
|
-
case
|
|
264
|
+
case 'week':
|
|
264
265
|
const weekFormat = (0, _utils.getDatepickerFormat)(editType, cellFormat);
|
|
265
266
|
const maxWeekValue = !(0, _utils.isEmpty)(column.maxDate) ? (0, _dayjs.default)(column.maxDate, weekFormat) : undefined;
|
|
266
267
|
const minWeekValue = !(0, _utils.isEmpty)(column.minDate) ? (0, _dayjs.default)(column.minDate, weekFormat) : undefined;
|
|
267
268
|
return /*#__PURE__*/_react.default.createElement(_antd.DatePicker, {
|
|
268
269
|
format: val => (0, _utils.customWeekStartEndFormat)(val, weekFormat),
|
|
269
270
|
style: {
|
|
270
|
-
width:
|
|
271
|
-
height:
|
|
271
|
+
width: '100%',
|
|
272
|
+
height: '100%'
|
|
272
273
|
},
|
|
273
274
|
picker: editType,
|
|
274
|
-
placeholder: t ? t(column.placeholder ??
|
|
275
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
275
276
|
disabled: (0, _utils.isDisable)(column, record) ?? false,
|
|
276
277
|
maxDate: maxWeekValue,
|
|
277
278
|
minDate: minWeekValue,
|
|
278
|
-
popupClassName:
|
|
279
|
-
status: isInvalid ?
|
|
279
|
+
popupClassName: 'be-popup-container',
|
|
280
|
+
status: isInvalid ? 'error' : undefined,
|
|
280
281
|
"data-tooltip-content": message,
|
|
281
282
|
"data-tooltip-id": `${id}-tooltip-error`,
|
|
282
283
|
autoFocus: column.field === startCell?.colId,
|
|
283
284
|
defaultOpen: column.field === startCell?.colId
|
|
284
285
|
});
|
|
285
|
-
case
|
|
286
|
+
case 'time':
|
|
286
287
|
const timeFormat = (0, _utils.getDatepickerFormat)(editType, cellFormat);
|
|
287
288
|
const maxTimeValue = !(0, _utils.isEmpty)(column.maxTime) ? (0, _dayjs.default)(column.maxTime).format(timeFormat) : null;
|
|
288
289
|
const minTimeValue = !(0, _utils.isEmpty)(column.minTime) ? (0, _dayjs.default)(column.minTime).format(timeFormat) : null;
|
|
@@ -294,24 +295,24 @@ const EditableCell = props => {
|
|
|
294
295
|
return /*#__PURE__*/_react.default.createElement(_antd.TimePicker, {
|
|
295
296
|
format: {
|
|
296
297
|
format: timeFormat,
|
|
297
|
-
type:
|
|
298
|
+
type: 'mask'
|
|
298
299
|
},
|
|
299
|
-
placeholder: t ? t(column.placeholder ??
|
|
300
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
300
301
|
maxDate: maxTime,
|
|
301
302
|
minDate: minTime,
|
|
302
303
|
disabled: (0, _utils.isDisable)(column, record) ?? false,
|
|
303
304
|
style: {
|
|
304
|
-
width:
|
|
305
|
-
height:
|
|
305
|
+
width: '100%',
|
|
306
|
+
height: '100%'
|
|
306
307
|
},
|
|
307
|
-
popupClassName:
|
|
308
|
-
status: isInvalid ?
|
|
308
|
+
popupClassName: 'be-popup-container',
|
|
309
|
+
status: isInvalid ? 'error' : undefined,
|
|
309
310
|
"data-tooltip-content": message,
|
|
310
311
|
"data-tooltip-id": `${id}-tooltip-error`,
|
|
311
312
|
autoFocus: column.field === startCell?.colId,
|
|
312
313
|
defaultOpen: column.field === startCell?.colId
|
|
313
314
|
});
|
|
314
|
-
case
|
|
315
|
+
case 'selectTable':
|
|
315
316
|
const rr = selectColumns ?? [];
|
|
316
317
|
const columnsTable = rr.map(colSelect => {
|
|
317
318
|
return {
|
|
@@ -336,9 +337,9 @@ const EditableCell = props => {
|
|
|
336
337
|
// @ts-ignore
|
|
337
338
|
valueSelectTable = record[fieldValue] ?? value;
|
|
338
339
|
}
|
|
339
|
-
if (isMulti || selectMode ===
|
|
340
|
+
if (isMulti || selectMode === 'checkbox') {
|
|
340
341
|
// @ts-ignore
|
|
341
|
-
valueSelectTable = !(0, _utils.isNullOrUndefined)(record[dataIndex
|
|
342
|
+
valueSelectTable = !(0, _utils.isNullOrUndefined)(record[dataIndex]) && Array.isArray(record[dataIndex]) && record[dataIndex]?.length > 0 ? options.filter(val => record[dataIndex]?.includes(val[keySelect])) : undefined;
|
|
342
343
|
}
|
|
343
344
|
return /*#__PURE__*/_react.default.createElement(_asyncTableSelect.AsyncTableSelect
|
|
344
345
|
// id={`col${indexCol}-record${indexRow}`}
|
|
@@ -347,11 +348,10 @@ const EditableCell = props => {
|
|
|
347
348
|
options: options,
|
|
348
349
|
defaultOptions: options,
|
|
349
350
|
value: valueSelectTable,
|
|
350
|
-
rowData: record
|
|
351
|
-
|
|
352
|
-
,
|
|
351
|
+
rowData: record,
|
|
352
|
+
autoDestroy: true,
|
|
353
353
|
onChange: (val, option) => {
|
|
354
|
-
onChange(val ??
|
|
354
|
+
onChange(val ?? '');
|
|
355
355
|
const formState = getValues();
|
|
356
356
|
// const itemState = getValues(dataIndex)
|
|
357
357
|
// @ts-ignore
|
|
@@ -367,38 +367,39 @@ const EditableCell = props => {
|
|
|
367
367
|
option: option,
|
|
368
368
|
indexCol,
|
|
369
369
|
indexRow,
|
|
370
|
-
type:
|
|
370
|
+
type: 'blur'
|
|
371
371
|
});
|
|
372
372
|
},
|
|
373
373
|
showSearch: true,
|
|
374
|
-
mode: isMulti || selectMode ===
|
|
374
|
+
mode: isMulti || selectMode === 'checkbox' ? 'multiple' : undefined,
|
|
375
375
|
valueSelectAble: true,
|
|
376
376
|
selectMode: selectMode,
|
|
377
377
|
style: {
|
|
378
|
-
width:
|
|
379
|
-
height:
|
|
378
|
+
width: '100%',
|
|
379
|
+
height: '100%'
|
|
380
380
|
},
|
|
381
381
|
defaultOpen: column.field === startCell?.colId,
|
|
382
382
|
autoFocus: column.field === startCell?.colId
|
|
383
|
+
|
|
383
384
|
// defaultOpen={column.field === cellEditing?.column.field}
|
|
384
385
|
,
|
|
385
|
-
placeholder: t ? t(column.placeholder ??
|
|
386
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
386
387
|
allowClear: column.isClearable ?? false,
|
|
387
|
-
maxTagCount:
|
|
388
|
+
maxTagCount: 'responsive',
|
|
388
389
|
rowKey: keySelect,
|
|
389
390
|
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined,
|
|
390
391
|
optionFilterProp: "label",
|
|
391
|
-
popupClassName:
|
|
392
|
+
popupClassName: 'be-popup-container',
|
|
392
393
|
loadOptions: loadOptions,
|
|
393
|
-
status: isInvalid ?
|
|
394
|
+
status: isInvalid ? 'error' : undefined,
|
|
394
395
|
dropdownRender: menu => {
|
|
395
396
|
if (toolbarItems && toolbarItems.length > 0) {
|
|
396
397
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, menu, /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
397
398
|
style: {
|
|
398
|
-
margin:
|
|
399
|
+
margin: '8px 0'
|
|
399
400
|
}
|
|
400
401
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
401
|
-
className:
|
|
402
|
+
className: 'toolbar-control d-flex justify-content-end'
|
|
402
403
|
}));
|
|
403
404
|
} else {
|
|
404
405
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, " ", menu);
|
|
@@ -407,13 +408,12 @@ const EditableCell = props => {
|
|
|
407
408
|
filterOption: filterOption,
|
|
408
409
|
fieldNames: fieldNames ? fieldNames : {
|
|
409
410
|
value: keySelect,
|
|
410
|
-
label: inputKey ??
|
|
411
|
+
label: inputKey ?? 'label'
|
|
411
412
|
},
|
|
412
413
|
onBlur: event => {
|
|
413
|
-
console.log("aafffffff");
|
|
414
414
|
if (event.inputValue && column?.editSelectSettings?.searchTextAsValue && isMulti !== true) {
|
|
415
415
|
const val = event.inputValue;
|
|
416
|
-
onChange(val ??
|
|
416
|
+
onChange(val ?? '');
|
|
417
417
|
const formState = getValues();
|
|
418
418
|
// const itemState = getValues(dataIndex)
|
|
419
419
|
// @ts-ignore
|
|
@@ -431,20 +431,20 @@ const EditableCell = props => {
|
|
|
431
431
|
},
|
|
432
432
|
indexCol,
|
|
433
433
|
indexRow,
|
|
434
|
-
type:
|
|
434
|
+
type: 'blur'
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
438
|
"data-tooltip-content": message,
|
|
439
439
|
"data-tooltip-id": `${id}-tooltip-error`
|
|
440
440
|
});
|
|
441
|
-
case
|
|
441
|
+
case 'select':
|
|
442
442
|
let valueSelect = value;
|
|
443
443
|
if (fieldValue) {
|
|
444
444
|
// @ts-ignore
|
|
445
445
|
valueSelect = record[fieldValue] ?? value;
|
|
446
446
|
}
|
|
447
|
-
if (isMulti || selectMode ===
|
|
447
|
+
if (isMulti || selectMode === 'checkbox') {
|
|
448
448
|
// @ts-ignore
|
|
449
449
|
valueSelect = !(0, _utils.isNullOrUndefined)(record[dataIndex]) && Array.isArray(record[dataIndex]) && record[dataIndex]?.length > 0 ? options.filter(val => record[dataIndex]?.includes(val[keySelect])) : undefined;
|
|
450
450
|
}
|
|
@@ -452,7 +452,7 @@ const EditableCell = props => {
|
|
|
452
452
|
options: options,
|
|
453
453
|
value: valueSelect,
|
|
454
454
|
onChange: (val, option) => {
|
|
455
|
-
onChange(val ??
|
|
455
|
+
onChange(val ?? '');
|
|
456
456
|
const formState = getValues();
|
|
457
457
|
// const itemState = getValues(dataIndex)
|
|
458
458
|
// @ts-ignore
|
|
@@ -467,39 +467,39 @@ const EditableCell = props => {
|
|
|
467
467
|
option: option,
|
|
468
468
|
indexCol,
|
|
469
469
|
indexRow,
|
|
470
|
-
type:
|
|
470
|
+
type: 'blur'
|
|
471
471
|
});
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
,
|
|
472
|
+
},
|
|
473
|
+
autoDestroy: true,
|
|
475
474
|
showSearch: true,
|
|
476
|
-
mode: isMulti || selectMode ===
|
|
475
|
+
mode: isMulti || selectMode === 'checkbox' ? 'multiple' : undefined,
|
|
477
476
|
valueSelectAble: true,
|
|
478
477
|
defaultOpen: column.field === startCell?.colId,
|
|
479
478
|
autoFocus: column.field === startCell?.colId
|
|
479
|
+
|
|
480
480
|
// defaultOpen={column.field === cellEditing?.column.field}
|
|
481
481
|
,
|
|
482
482
|
|
|
483
483
|
style: {
|
|
484
|
-
width:
|
|
485
|
-
height:
|
|
484
|
+
width: '100%',
|
|
485
|
+
height: '100%'
|
|
486
486
|
},
|
|
487
|
-
placeholder: t ? t(column.placeholder ??
|
|
487
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
488
488
|
allowClear: column.isClearable ?? false,
|
|
489
|
-
maxTagCount:
|
|
489
|
+
maxTagCount: 'responsive',
|
|
490
490
|
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined,
|
|
491
491
|
optionFilterProp: "label",
|
|
492
|
-
popupClassName:
|
|
493
|
-
status: isInvalid ?
|
|
492
|
+
popupClassName: 'be-popup-container',
|
|
493
|
+
status: isInvalid ? 'error' : undefined,
|
|
494
494
|
filterOption: filterOption,
|
|
495
495
|
fieldNames: fieldNames ? fieldNames : {
|
|
496
496
|
value: keySelect,
|
|
497
|
-
label: inputKey ??
|
|
497
|
+
label: inputKey ?? 'label'
|
|
498
498
|
},
|
|
499
499
|
onBlur: event => {
|
|
500
500
|
if (event.inputValue && column?.editSelectSettings?.searchTextAsValue && isMulti !== true) {
|
|
501
501
|
const val = event.inputValue;
|
|
502
|
-
onChange(val ??
|
|
502
|
+
onChange(val ?? '');
|
|
503
503
|
const formState = getValues();
|
|
504
504
|
// const itemState = getValues(dataIndex)
|
|
505
505
|
// @ts-ignore
|
|
@@ -517,20 +517,20 @@ const EditableCell = props => {
|
|
|
517
517
|
},
|
|
518
518
|
indexCol,
|
|
519
519
|
indexRow,
|
|
520
|
-
type:
|
|
520
|
+
type: 'blur'
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
523
|
},
|
|
524
524
|
"data-tooltip-content": message,
|
|
525
525
|
"data-tooltip-id": `${id}-tooltip-error`
|
|
526
526
|
});
|
|
527
|
-
case
|
|
527
|
+
case 'asyncSelect':
|
|
528
528
|
let valueAsyncSelect = value;
|
|
529
529
|
if (fieldValue) {
|
|
530
530
|
// @ts-ignore
|
|
531
531
|
valueAsyncSelect = record[fieldValue] ?? value;
|
|
532
532
|
}
|
|
533
|
-
if (isMulti || selectMode ===
|
|
533
|
+
if (isMulti || selectMode === 'checkbox') {
|
|
534
534
|
// @ts-ignore
|
|
535
535
|
valueAsyncSelect = !(0, _utils.isNullOrUndefined)(record[dataIndex]) && Array.isArray(record[dataIndex]) && record[dataIndex]?.length > 0 ? options.filter(val => record[dataIndex]?.includes(val[keySelect])) : undefined;
|
|
536
536
|
}
|
|
@@ -539,7 +539,7 @@ const EditableCell = props => {
|
|
|
539
539
|
defaultOptions: options,
|
|
540
540
|
value: valueAsyncSelect,
|
|
541
541
|
onChange: (val, option) => {
|
|
542
|
-
onChange(val ??
|
|
542
|
+
onChange(val ?? '');
|
|
543
543
|
const formState = getValues();
|
|
544
544
|
// const itemState = getValues(dataIndex)
|
|
545
545
|
// @ts-ignore
|
|
@@ -554,30 +554,30 @@ const EditableCell = props => {
|
|
|
554
554
|
option: option,
|
|
555
555
|
indexCol,
|
|
556
556
|
indexRow,
|
|
557
|
-
type:
|
|
557
|
+
type: 'blur'
|
|
558
558
|
});
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
,
|
|
559
|
+
},
|
|
560
|
+
autoDestroy: true,
|
|
562
561
|
showSearch: true,
|
|
563
562
|
defaultOpen: column.field === startCell?.colId,
|
|
564
563
|
autoFocus: column.field === startCell?.colId
|
|
564
|
+
|
|
565
565
|
// defaultOpen={column.field === cellEditing?.column.field}
|
|
566
566
|
,
|
|
567
|
-
mode: isMulti || selectMode ===
|
|
567
|
+
mode: isMulti || selectMode === 'checkbox' ? 'multiple' : undefined,
|
|
568
568
|
valueSelectAble: true,
|
|
569
569
|
style: {
|
|
570
|
-
width:
|
|
571
|
-
height:
|
|
570
|
+
width: '100%',
|
|
571
|
+
height: '100%'
|
|
572
572
|
},
|
|
573
|
-
placeholder: t ? t(column.placeholder ??
|
|
573
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
574
574
|
allowClear: column.isClearable ?? false,
|
|
575
|
-
maxTagCount:
|
|
575
|
+
maxTagCount: 'responsive',
|
|
576
576
|
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined,
|
|
577
577
|
optionFilterProp: "label",
|
|
578
|
-
popupClassName:
|
|
578
|
+
popupClassName: 'be-popup-container',
|
|
579
579
|
loadOptions: loadOptions,
|
|
580
|
-
status: isInvalid ?
|
|
580
|
+
status: isInvalid ? 'error' : undefined
|
|
581
581
|
// dropdownRender={(menu) => {
|
|
582
582
|
// if (toolbarItems && toolbarItems.length > 0) {
|
|
583
583
|
// return (
|
|
@@ -619,12 +619,12 @@ const EditableCell = props => {
|
|
|
619
619
|
filterOption: filterOption,
|
|
620
620
|
fieldNames: fieldNames ? fieldNames : {
|
|
621
621
|
value: keySelect,
|
|
622
|
-
label: inputKey ??
|
|
622
|
+
label: inputKey ?? 'label'
|
|
623
623
|
},
|
|
624
624
|
onBlur: event => {
|
|
625
625
|
if (event.inputValue && column?.editSelectSettings?.searchTextAsValue && isMulti !== true) {
|
|
626
626
|
const val = event.inputValue;
|
|
627
|
-
onChange(val ??
|
|
627
|
+
onChange(val ?? '');
|
|
628
628
|
const formState = getValues();
|
|
629
629
|
// const itemState = getValues(dataIndex)
|
|
630
630
|
// @ts-ignore
|
|
@@ -642,14 +642,14 @@ const EditableCell = props => {
|
|
|
642
642
|
},
|
|
643
643
|
indexCol,
|
|
644
644
|
indexRow,
|
|
645
|
-
type:
|
|
645
|
+
type: 'blur'
|
|
646
646
|
});
|
|
647
647
|
}
|
|
648
648
|
},
|
|
649
649
|
"data-tooltip-content": message,
|
|
650
650
|
"data-tooltip-id": `${id}-tooltip-error`
|
|
651
651
|
});
|
|
652
|
-
case
|
|
652
|
+
case 'treeSelect':
|
|
653
653
|
// let valueTreeSelect
|
|
654
654
|
|
|
655
655
|
const newTreeData = (0, _utils.convertLabelToTitle)(optionsTree);
|
|
@@ -661,27 +661,28 @@ const EditableCell = props => {
|
|
|
661
661
|
// @ts-ignore
|
|
662
662
|
valueTreeSelect = record[fieldValue] ?? value;
|
|
663
663
|
}
|
|
664
|
-
if (isMulti || selectMode ===
|
|
664
|
+
if (isMulti || selectMode === 'checkbox') {
|
|
665
665
|
// @ts-ignore
|
|
666
666
|
valueTreeSelect = !(0, _utils.isNullOrUndefined)(record[dataIndex]) && Array.isArray(record[dataIndex]) && record[dataIndex]?.length > 0 ? options.filter(val => record[dataIndex]?.includes(val[keySelect])) : undefined;
|
|
667
667
|
}
|
|
668
668
|
return /*#__PURE__*/_react.default.createElement(_rcMasterUi.TreeSelect, {
|
|
669
669
|
id: `col${indexCol}-record${indexRow}`,
|
|
670
|
-
className:
|
|
670
|
+
className: 'be-tree-select',
|
|
671
671
|
style: {
|
|
672
|
-
width:
|
|
673
|
-
height:
|
|
672
|
+
width: '100%',
|
|
673
|
+
height: '100%'
|
|
674
674
|
},
|
|
675
675
|
value: valueTreeSelect,
|
|
676
676
|
dropdownStyle: {
|
|
677
677
|
maxHeight: 400,
|
|
678
|
-
overflow:
|
|
678
|
+
overflow: 'auto'
|
|
679
679
|
},
|
|
680
680
|
treeData: newTreeData,
|
|
681
|
-
placeholder: t ? t(column.placeholder ??
|
|
681
|
+
placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
|
|
682
682
|
treeDefaultExpandAll: true,
|
|
683
683
|
defaultOpen: column.field === startCell?.colId,
|
|
684
684
|
autoFocus: column.field === startCell?.colId
|
|
685
|
+
|
|
685
686
|
// defaultOpen={column.field === cellEditing?.column.field}
|
|
686
687
|
,
|
|
687
688
|
virtual: true,
|
|
@@ -693,14 +694,14 @@ const EditableCell = props => {
|
|
|
693
694
|
maxTagPlaceholder: 2,
|
|
694
695
|
treeTitleRender: column?.editSelectSettings?.formatOptionLabel,
|
|
695
696
|
showCheckedStrategy: SHOW_PARENT,
|
|
696
|
-
multiple: column?.editSelectSettings?.selectMode ===
|
|
697
|
+
multiple: column?.editSelectSettings?.selectMode === 'checkbox' || column?.editSelectSettings?.isMulti
|
|
697
698
|
// fieldNames={{label: inputKey ? inputKey : 'title', value: keySelect, children: 'children'}}
|
|
698
699
|
,
|
|
699
|
-
treeCheckable: column?.editSelectSettings?.selectMode ===
|
|
700
|
+
treeCheckable: column?.editSelectSettings?.selectMode === 'checkbox',
|
|
700
701
|
filterTreeNode: filterTreeNode,
|
|
701
702
|
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined,
|
|
702
703
|
onSelect: (val, option) => {
|
|
703
|
-
onChange(val ??
|
|
704
|
+
onChange(val ?? '');
|
|
704
705
|
const formState = getValues();
|
|
705
706
|
// const itemState = getValues(dataIndex)
|
|
706
707
|
// @ts-ignore
|
|
@@ -715,23 +716,23 @@ const EditableCell = props => {
|
|
|
715
716
|
option: option,
|
|
716
717
|
indexCol,
|
|
717
718
|
indexRow,
|
|
718
|
-
type:
|
|
719
|
+
type: 'blur'
|
|
719
720
|
});
|
|
720
721
|
},
|
|
721
|
-
popupClassName:
|
|
722
|
-
status: isInvalid ?
|
|
722
|
+
popupClassName: 'be-popup-container',
|
|
723
|
+
status: isInvalid ? 'error' : undefined,
|
|
723
724
|
"data-tooltip-content": message,
|
|
724
725
|
"data-tooltip-id": `${id}-tooltip-error`
|
|
725
726
|
});
|
|
726
|
-
case
|
|
727
|
+
case 'checkbox':
|
|
727
728
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
728
729
|
style: {
|
|
729
|
-
display:
|
|
730
|
-
alignItems:
|
|
731
|
-
justifyContent: column.align ??
|
|
730
|
+
display: 'flex',
|
|
731
|
+
alignItems: 'center',
|
|
732
|
+
justifyContent: column.align ?? 'center',
|
|
732
733
|
paddingInline: 5,
|
|
733
|
-
height:
|
|
734
|
-
width:
|
|
734
|
+
height: '100%',
|
|
735
|
+
width: '100%'
|
|
735
736
|
}
|
|
736
737
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Checkbox, {
|
|
737
738
|
checked: Boolean(value)
|
|
@@ -750,12 +751,12 @@ const EditableCell = props => {
|
|
|
750
751
|
field: column.field ?? column.field,
|
|
751
752
|
indexCol,
|
|
752
753
|
indexRow,
|
|
753
|
-
type:
|
|
754
|
+
type: 'blur'
|
|
754
755
|
});
|
|
755
756
|
},
|
|
756
757
|
disabled: (0, _utils.isDisable)(column, record) ?? false
|
|
757
758
|
}));
|
|
758
|
-
case
|
|
759
|
+
case 'form':
|
|
759
760
|
const valueForm = value;
|
|
760
761
|
return /*#__PURE__*/_react.default.createElement(_EditForm.EditForm, {
|
|
761
762
|
rowData: record,
|
|
@@ -765,6 +766,7 @@ const EditableCell = props => {
|
|
|
765
766
|
value: valueForm,
|
|
766
767
|
fieldKey: column.editFromSettings?.fieldKey,
|
|
767
768
|
indexRow: indexRow
|
|
769
|
+
|
|
768
770
|
// cellFocus={column.field === cellEditing?.column.field}
|
|
769
771
|
,
|
|
770
772
|
|
|
@@ -779,14 +781,14 @@ const EditableCell = props => {
|
|
|
779
781
|
field: column.field,
|
|
780
782
|
record: {
|
|
781
783
|
...formState,
|
|
782
|
-
[column.field ??
|
|
784
|
+
[column.field ?? '']: val
|
|
783
785
|
},
|
|
784
786
|
prevState,
|
|
785
787
|
newState,
|
|
786
788
|
option: val,
|
|
787
789
|
indexCol,
|
|
788
790
|
indexRow,
|
|
789
|
-
type:
|
|
791
|
+
type: 'blur'
|
|
790
792
|
});
|
|
791
793
|
}
|
|
792
794
|
// cellEditing={cellEditing}
|
|
@@ -794,7 +796,7 @@ const EditableCell = props => {
|
|
|
794
796
|
// menuPortalTarget={tableContainerRef}
|
|
795
797
|
// classNamePrefix={column.classElement ?? 'select'}
|
|
796
798
|
,
|
|
797
|
-
placeholder: t ? t(column.placeholder ? column.placeholder :
|
|
799
|
+
placeholder: t ? t(column.placeholder ? column.placeholder : '') : column.placeholder ? column.placeholder : '',
|
|
798
800
|
menuWidth: column.editFromSettings?.menuWidth,
|
|
799
801
|
menuHeight: column.editFromSettings?.menuHeight
|
|
800
802
|
});
|
|
@@ -826,8 +828,8 @@ const EditableCell = props => {
|
|
|
826
828
|
//
|
|
827
829
|
// )
|
|
828
830
|
|
|
829
|
-
case
|
|
830
|
-
const color = (0, _utils.isColor)(value) ? value :
|
|
831
|
+
case 'color':
|
|
832
|
+
const color = (0, _utils.isColor)(value) ? value : '#ffffff';
|
|
831
833
|
const presets = (0, _utils.genPresets)({
|
|
832
834
|
blue: _colors.blue,
|
|
833
835
|
red: _colors.red,
|
|
@@ -849,7 +851,7 @@ const EditableCell = props => {
|
|
|
849
851
|
newState: `#${valueColor.toHex()}`,
|
|
850
852
|
indexCol,
|
|
851
853
|
indexRow,
|
|
852
|
-
type:
|
|
854
|
+
type: 'blur'
|
|
853
855
|
});
|
|
854
856
|
},
|
|
855
857
|
presets: presets,
|
|
@@ -867,7 +869,7 @@ const EditableCell = props => {
|
|
|
867
869
|
}, /*#__PURE__*/_react.default.createElement(Presets, null)), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
868
870
|
type: "vertical",
|
|
869
871
|
style: {
|
|
870
|
-
height:
|
|
872
|
+
height: 'auto'
|
|
871
873
|
}
|
|
872
874
|
}), /*#__PURE__*/_react.default.createElement(_antd.Col, {
|
|
873
875
|
flex: "auto"
|
|
@@ -896,7 +898,7 @@ const EditableCell = props => {
|
|
|
896
898
|
// />
|
|
897
899
|
// )
|
|
898
900
|
|
|
899
|
-
case
|
|
901
|
+
case 'numeric':
|
|
900
902
|
const thousandSeparator = cellFormat?.thousandSeparator;
|
|
901
903
|
const decimalSeparator = cellFormat?.decimalSeparator;
|
|
902
904
|
|
|
@@ -922,13 +924,13 @@ const EditableCell = props => {
|
|
|
922
924
|
customInput: _antd.Input
|
|
923
925
|
// valueIsNumericString={true}
|
|
924
926
|
,
|
|
925
|
-
placeholder: t ? t(column.placeholder ??
|
|
926
|
-
autoComplete:
|
|
927
|
-
className: (0, _classnames.default)(
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
927
|
+
placeholder: t ? t(column.placeholder ?? 'Enter') : column.placeholder ?? 'Enter',
|
|
928
|
+
autoComplete: 'off',
|
|
929
|
+
className: (0, _classnames.default)('be-cell-editing rounded-0 input-element', {
|
|
930
|
+
'is-invalid': isInvalid,
|
|
931
|
+
'be-cell-edit-align-center': column.align === 'center',
|
|
932
|
+
'be-cell-edit-align-left': column.align === 'left',
|
|
933
|
+
'be-cell-edit-align-right': !column.align || column.align === 'right'
|
|
932
934
|
}),
|
|
933
935
|
autoFocus: column.field === startCell?.colId,
|
|
934
936
|
onValueChange: values => {
|
|
@@ -952,7 +954,7 @@ const EditableCell = props => {
|
|
|
952
954
|
newState,
|
|
953
955
|
indexCol,
|
|
954
956
|
indexRow,
|
|
955
|
-
type:
|
|
957
|
+
type: 'blur'
|
|
956
958
|
});
|
|
957
959
|
}
|
|
958
960
|
},
|
|
@@ -964,16 +966,13 @@ const EditableCell = props => {
|
|
|
964
966
|
id: `col${indexCol}-record${indexRow}`,
|
|
965
967
|
style: {
|
|
966
968
|
textAlign: column.align,
|
|
967
|
-
resize:
|
|
968
|
-
height:
|
|
969
|
-
}
|
|
970
|
-
// @ts-ignore
|
|
971
|
-
// value={!isNullOrUndefined(record[dataIndex]) ? record[dataIndex] : ''}
|
|
972
|
-
,
|
|
969
|
+
resize: 'none',
|
|
970
|
+
height: '100%'
|
|
971
|
+
},
|
|
973
972
|
disabled: (0, _utils.isDisable)(column, record) ?? false,
|
|
974
|
-
className: (0, _classnames.default)(
|
|
975
|
-
placeholder: t ? t(column.placeholder ??
|
|
976
|
-
value: !(0, _utils.isNullOrUndefined)(value) ? value :
|
|
973
|
+
className: (0, _classnames.default)('be-cell-editing rounded-0 input-element'),
|
|
974
|
+
placeholder: t ? t(column.placeholder ?? 'Enter') : column.placeholder ?? 'Enter',
|
|
975
|
+
value: !(0, _utils.isNullOrUndefined)(value) ? value : '',
|
|
977
976
|
onBlur: () => {
|
|
978
977
|
const formState = getValues();
|
|
979
978
|
// const itemState = getValues(dataIndex)
|
|
@@ -991,7 +990,7 @@ const EditableCell = props => {
|
|
|
991
990
|
field,
|
|
992
991
|
indexCol,
|
|
993
992
|
indexRow,
|
|
994
|
-
type:
|
|
993
|
+
type: 'blur'
|
|
995
994
|
});
|
|
996
995
|
}
|
|
997
996
|
},
|
|
@@ -1010,12 +1009,12 @@ const EditableCell = props => {
|
|
|
1010
1009
|
record: formState,
|
|
1011
1010
|
indexCol,
|
|
1012
1011
|
indexRow,
|
|
1013
|
-
type:
|
|
1012
|
+
type: 'enter'
|
|
1014
1013
|
});
|
|
1015
1014
|
// }
|
|
1016
1015
|
},
|
|
1017
1016
|
onChange: onChange,
|
|
1018
|
-
status: isInvalid ?
|
|
1017
|
+
status: isInvalid ? 'error' : undefined,
|
|
1019
1018
|
"data-tooltip-content": message,
|
|
1020
1019
|
"data-tooltip-id": `${id}-tooltip-error`,
|
|
1021
1020
|
autoSize: {
|