es-grid-template 1.6.0 → 1.6.2

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.
Files changed (27) hide show
  1. package/es/grid-component/EditForm/EditForm.d.ts +27 -0
  2. package/es/grid-component/EditForm/EditForm.js +394 -0
  3. package/es/grid-component/EditForm/index.d.ts +1 -0
  4. package/es/grid-component/EditForm/index.js +1 -0
  5. package/es/grid-component/EditableCell.js +46 -43
  6. package/es/grid-component/InternalTable.js +11 -4
  7. package/es/grid-component/control/InputControl/InputControl.d.ts +27 -0
  8. package/es/grid-component/control/InputControl/InputControl.js +121 -0
  9. package/es/grid-component/control/InputControl/index.d.ts +1 -0
  10. package/es/grid-component/control/InputControl/index.js +1 -0
  11. package/es/grid-component/table/GridEdit.js +6 -6
  12. package/es/grid-component/type.d.ts +28 -0
  13. package/es/grid-component/useContext.d.ts +0 -1
  14. package/lib/grid-component/EditForm/EditForm.d.ts +27 -0
  15. package/lib/grid-component/EditForm/EditForm.js +404 -0
  16. package/lib/grid-component/EditForm/index.d.ts +1 -0
  17. package/lib/grid-component/EditForm/index.js +16 -0
  18. package/lib/grid-component/EditableCell.js +46 -43
  19. package/lib/grid-component/InternalTable.js +8 -3
  20. package/lib/grid-component/control/InputControl/InputControl.d.ts +27 -0
  21. package/lib/grid-component/control/InputControl/InputControl.js +131 -0
  22. package/lib/grid-component/control/InputControl/index.d.ts +1 -0
  23. package/lib/grid-component/control/InputControl/index.js +16 -0
  24. package/lib/grid-component/table/GridEdit.js +6 -5
  25. package/lib/grid-component/type.d.ts +28 -0
  26. package/lib/grid-component/useContext.d.ts +0 -1
  27. package/package.json +3 -2
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ type Props = {
3
+ id?: string;
4
+ externalClick?: any;
5
+ menuPortalTarget?: any;
6
+ value: any;
7
+ onChange: (props: any) => void;
8
+ filterKey?: string;
9
+ customRender?: any;
10
+ filterHeaderKey?: string;
11
+ placeholder?: string;
12
+ invalid?: any;
13
+ menuHeight?: number;
14
+ menuWidth?: number;
15
+ classNamePrefix?: string;
16
+ cellFocus?: boolean;
17
+ t?: any;
18
+ column: any;
19
+ fieldKey?: any;
20
+ rowData: any;
21
+ indexRow: any;
22
+ template?: any;
23
+ onKeyDown?: (event: any) => void;
24
+ };
25
+ export declare const SelectStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
26
+ export declare const EditForm: (props: Props) => React.JSX.Element;
27
+ export {};
@@ -0,0 +1,394 @@
1
+ import React, { Fragment, useRef } from "react";
2
+ import styled from "styled-components";
3
+ import { useForm } from "react-hook-form";
4
+ import { yupResolver } from "@hookform/resolvers/yup";
5
+ import { Col, Row } from "rc-master-ui/es/grid";
6
+ import InputControl from "../control/InputControl/InputControl";
7
+ import { isNullOrUndefined, isObjEmpty } from "../hooks";
8
+ import { Input } from "rc-master-ui";
9
+ import { Dropdown } from "antd";
10
+ import Divider from "rc-master-ui/es/divider";
11
+ import Button from "rc-master-ui/es/button";
12
+ export const SelectStyle = styled.div.withConfig({
13
+ displayName: "SelectStyle",
14
+ componentId: "es-grid-template__sc-7ba05m-0"
15
+ })(["width:100%;&.be-select{.input-group-merge{flex-wrap:nowrap;}}"]);
16
+ export const EditForm = props => {
17
+ const {
18
+ id,
19
+ // menuPortalTarget,
20
+ value,
21
+ fieldKey,
22
+ placeholder,
23
+ // invalid,
24
+ menuHeight,
25
+ menuWidth,
26
+ // classNamePrefix,
27
+ onChange,
28
+ rowData,
29
+ // onKeyDown,
30
+ t,
31
+ cellFocus,
32
+ column
33
+ } = props;
34
+ const formRef = useRef();
35
+ const divRef = useRef(null);
36
+ const inputRef = useRef(null);
37
+ const defaultValue = !isNullOrUndefined(value) ? column?.editFromSettings?.formatLabel ? column?.editFromSettings?.formatLabel(value) : value[fieldKey] : '';
38
+ const {
39
+ control,
40
+ handleSubmit,
41
+ getValues,
42
+ reset,
43
+ setValue,
44
+ setError,
45
+ formState: {
46
+ errors
47
+ }
48
+ } = useForm({
49
+ mode: 'onChange',
50
+ defaultValues: column.editFromSettings?.defaultValues,
51
+ resolver: column.editFromSettings?.schema ? yupResolver(column.editFromSettings?.schema) : undefined
52
+ });
53
+ const handleToggle = () => {
54
+ divRef?.current?.click(); // Giả lập click vào nút để mở dropdown
55
+ };
56
+ React.useEffect(() => {
57
+ if (cellFocus) {
58
+ handleToggle();
59
+ }
60
+ }, [cellFocus]);
61
+ const handleOnSubmit = val => {
62
+ handleToggle();
63
+ onChange(val);
64
+ };
65
+
66
+ // const handleOnKeyDown = (e: any) => {
67
+ //
68
+ // if (dropdownOpen) {
69
+ // e.preventDefault()
70
+ //
71
+ // if (e.code === 'Tab') {
72
+ // e.stopPropagation()
73
+ // const formElement = document.getElementById('edit-form')
74
+ //
75
+ // if (formElement) {
76
+ //
77
+ // formElement.getElementsByTagName('input')[0]?.focus()
78
+ //
79
+ // }
80
+ //
81
+ // }
82
+ //
83
+ // if (e.code === "Escape") {
84
+ // e.preventDefault()
85
+ // e.stopPropagation()
86
+ // return e
87
+ // }
88
+ //
89
+ // const formElement = document.getElementById('edit-form')
90
+ //
91
+ // if (formElement) {
92
+ //
93
+ // formElement.getElementsByTagName('input')[0]?.focus()
94
+ //
95
+ // }
96
+ // return e.code
97
+ //
98
+ //
99
+ // } else {
100
+ // if (e.code === 'ArrowDown') {
101
+ // e.preventDefault()
102
+ //
103
+ // setTimeout(() => {
104
+ // const formElement = document.getElementById('edit-form')
105
+ // if (formElement) {
106
+ // formElement.getElementsByTagName('input')[0]?.focus()
107
+ //
108
+ // }
109
+ //
110
+ // }, 100)
111
+ //
112
+ //
113
+ // }
114
+ // }
115
+ //
116
+ // if (onKeyDown) {
117
+ // onKeyDown(e)
118
+ // }
119
+ //
120
+ //
121
+ // }
122
+ //
123
+
124
+ const handleOnFocus = e => {
125
+ e.target.setSelectionRange(0, e.target.innerText.length - 1);
126
+ };
127
+ const formItemKeyDown = (e, index, length) => {
128
+ if (e.code === 'Tab' || e.code === 'ArrowDown') {
129
+ const itemElement = document.getElementById(`edit-form-${index + 1}`);
130
+ if (itemElement && index < length) {
131
+ if (itemElement.className.includes('be-select')) {
132
+ itemElement.getElementsByTagName('input')[0]?.focus();
133
+ } else {
134
+ itemElement.focus();
135
+ }
136
+ }
137
+ e.preventDefault();
138
+ }
139
+ if (e.code === 'ArrowUp') {
140
+ const itemElement = document.getElementById(`edit-form-${index - 1}`);
141
+ if (itemElement && index !== 0) {
142
+ if (itemElement.className.includes('be-select')) {
143
+ itemElement.getElementsByTagName('input')[0]?.focus();
144
+ } else {
145
+ itemElement.focus();
146
+ }
147
+ }
148
+ e.preventDefault();
149
+ }
150
+ if (e.code === 'Enter') {
151
+ if (isObjEmpty(errors)) {
152
+ const rs = getValues();
153
+ if (column.editFromSettings?.schema) {
154
+ column.editFromSettings?.schema.validate(rs, {
155
+ abortEarly: false
156
+ }).then(() => {
157
+ handleToggle();
158
+ onChange(rs);
159
+ if (column.editFromSettings && column?.editFromSettings?.formClose) {
160
+ column?.editFromSettings?.formClose({
161
+ value,
162
+ setValue,
163
+ getValues,
164
+ reset
165
+ });
166
+ }
167
+ if (inputRef) {
168
+ inputRef.current.focus();
169
+ }
170
+ }).catch(err => {
171
+ e.preventDefault();
172
+ e.stopPropagation();
173
+ err.inner.forEach(error => {
174
+ setError(error.path ? error.path : '', {
175
+ type: "manual",
176
+ message: error.message
177
+ });
178
+ });
179
+ });
180
+ }
181
+ } else {
182
+ e.preventDefault();
183
+ e.stopPropagation();
184
+ }
185
+ }
186
+ };
187
+
188
+ // const checkErrors = () => {
189
+ //
190
+ //
191
+ // if (isObjEmpty(errors)) {
192
+ // const rs = getValues()
193
+ // if (column.editFromSettings?.schema) {
194
+ // column.editFromSettings?.schema.validate(rs, { abortEarly: false })
195
+ // .then(() => {
196
+ // handleToggle()
197
+ // onChange(rs)
198
+ //
199
+ // if (column.editFromSettings && column?.editFromSettings?.formClose) {
200
+ // column?.editFromSettings?.formClose({value, setValue, getValues, reset})
201
+ // }
202
+ // if (inputRef) {
203
+ // inputRef.current.focus()
204
+ // }
205
+ // })
206
+ // .catch((err: ValidationError) => {
207
+ //
208
+ // err.inner.forEach((error: ValidationError) => {
209
+ //
210
+ // setError(error.path ? error.path : '', {
211
+ // type: "manual",
212
+ // message: error.message
213
+ // })
214
+ // })
215
+ // })
216
+ // }
217
+ //
218
+ //
219
+ // } else {
220
+ //
221
+ // }
222
+ // }
223
+
224
+ const handleFormKeydown = e => {
225
+ // if (dropdownOpen) {
226
+
227
+ if (e.code === 'Tab' || e.code === 'ArrowUp' || e.code === 'ArrowDown') {
228
+ e.preventDefault();
229
+ e.stopPropagation();
230
+ // if (formElement && indexRowForm <= totalRowFrom) {
231
+ // setIndexRowForm((prevState) => prevState + 1)
232
+ // formElement.getElementsByTagName('input')[indexRowForm + 1]?.focus()
233
+ // }
234
+ }
235
+
236
+ // if (e.code === 'Enter') {
237
+ // const rs = getValues()
238
+ //
239
+ //
240
+ // onChange(rs)
241
+ //
242
+ // if (column.editFromSettings && column?.editFromSettings?.formClose) {
243
+ // column?.editFromSettings?.formClose({value, setValue, getValues, reset})
244
+ // }
245
+ // if (inputRef) {
246
+ // inputRef.current.focus()
247
+ // }
248
+ //
249
+ // e.preventDefault()
250
+ // e.stopPropagation()
251
+ // }
252
+
253
+ if (e.code === "Escape") {
254
+ handleToggle();
255
+ if (inputRef) {
256
+ inputRef.current.focus();
257
+ }
258
+ e.preventDefault();
259
+ e.stopPropagation();
260
+ }
261
+ return e.code;
262
+ // }
263
+ };
264
+ const renderForm = rows => {
265
+ return /*#__PURE__*/React.createElement(Row, {
266
+ gutter: [0, 10]
267
+ }, rows.map((item, index) => {
268
+ return /*#__PURE__*/React.createElement(Col, {
269
+ key: `${index}`,
270
+ xl: column.editFromSettings?.layout?.xl ? column.editFromSettings?.layout?.xl : 24,
271
+ lg: column.editFromSettings?.layout?.lg ? column.editFromSettings?.layout?.lg : 24,
272
+ md: column.editFromSettings?.layout?.md ? column.editFromSettings?.layout?.md : 24,
273
+ sm: column.editFromSettings?.layout?.sm ? column.editFromSettings?.layout?.sm : 24,
274
+ xs: column.editFromSettings?.layout?.xs ? column.editFromSettings?.layout?.xs : 24,
275
+ className: 'mb-1'
276
+ }, /*#__PURE__*/React.createElement(InputControl, {
277
+ id: `edit-form-${index}`,
278
+ t: t,
279
+ control: control
280
+ // name={`specificationCode${index + 1}`}
281
+ ,
282
+ name: item.name,
283
+ label: item.label ? item.label : '',
284
+ labelSize: "label-medium",
285
+ errors: errors[item.name],
286
+ onKeyDown: e => formItemKeyDown(e, index, column.editFromSettings?.items ? column.editFromSettings?.items.length : 0)
287
+ }));
288
+ }));
289
+ };
290
+ const contentStyle = {
291
+ padding: 6,
292
+ width: menuWidth,
293
+ backgroundColor: '#fff',
294
+ borderRadius: '6px',
295
+ boxShadow: '0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)'
296
+ };
297
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(SelectStyle, {
298
+ ref: formRef,
299
+ id: id ? id : ''
300
+ }, /*#__PURE__*/React.createElement(Dropdown, {
301
+ menu: {
302
+ items: []
303
+ },
304
+ autoFocus: true,
305
+ onOpenChange: open => {
306
+ if (open) {
307
+ setTimeout(() => {
308
+ const formElement = document.getElementById('edit-form-0');
309
+ if (formElement) {
310
+ formElement.focus();
311
+ }
312
+ }, 10);
313
+ if (column.editFromSettings && column?.editFromSettings?.formOpen) {
314
+ column?.editFromSettings?.formOpen({
315
+ value,
316
+ setValue,
317
+ getValues,
318
+ reset,
319
+ rowData
320
+ });
321
+ }
322
+ } else {
323
+ if (column.editFromSettings && column?.editFromSettings?.formClose) {
324
+ column?.editFromSettings?.formClose({
325
+ value,
326
+ setValue,
327
+ getValues,
328
+ reset,
329
+ rowData
330
+ });
331
+ }
332
+ }
333
+ },
334
+ trigger: ['click'],
335
+ destroyPopupOnHide: true,
336
+ rootClassName: 'be-popup-container',
337
+ dropdownRender: () => /*#__PURE__*/React.createElement("div", {
338
+ style: contentStyle,
339
+ onKeyDown: e => handleFormKeydown(e),
340
+ onClick: e => {
341
+ e.preventDefault();
342
+ e.stopPropagation();
343
+ }
344
+ }, /*#__PURE__*/React.createElement("form", {
345
+ className: "todo-modal",
346
+ onSubmit: handleSubmit(handleOnSubmit)
347
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
348
+ className: 'p-1',
349
+ style: {
350
+ maxHeight: menuHeight ? menuHeight : 300,
351
+ overflow: "auto"
352
+ }
353
+ }, column.editFromSettings?.items ? renderForm(column.editFromSettings?.items) : ''), /*#__PURE__*/React.createElement(Divider, {
354
+ style: {
355
+ margin: 0
356
+ }
357
+ }), /*#__PURE__*/React.createElement("div", {
358
+ className: "d-flex justify-content-end p-1"
359
+ // style={{ boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }}
360
+ }, /*#__PURE__*/React.createElement(Button, {
361
+ variant: "solid",
362
+ className: ""
363
+ // onSubmit={handleSubmit(handleOnSubmit)}
364
+ ,
365
+ onClick: handleSubmit(handleOnSubmit),
366
+ color: "primary",
367
+ style: {}
368
+ }, /*#__PURE__*/React.createElement("div", {
369
+ className: "d-flex "
370
+ }, t ? t('Save') : 'Save'))))))
371
+ }, /*#__PURE__*/React.createElement("div", {
372
+ ref: divRef,
373
+ style: {
374
+ height: '100%'
375
+ }
376
+ }, /*#__PURE__*/React.createElement(Input, {
377
+ style: {
378
+ borderRadius: 0,
379
+ height: '100%'
380
+ },
381
+ ref: inputRef,
382
+ defaultValue: defaultValue,
383
+ value: defaultValue,
384
+ placeholder: placeholder,
385
+ className: 'be-select__input'
386
+ // onChange={handleOnChange}
387
+ ,
388
+ onFocus: handleOnFocus
389
+ // onClick={handleOnClick}
390
+ // onKeyDown={handleOnKeyDown}
391
+ ,
392
+ readOnly: true
393
+ })))));
394
+ };
@@ -0,0 +1 @@
1
+ export * from './EditForm';
@@ -0,0 +1 @@
1
+ export * from "./EditForm";
@@ -22,6 +22,7 @@ import { Checkbox, Select, TreeSelect } from "rc-master-ui";
22
22
  import { AsyncSelect } from "./async-select";
23
23
  import { AsyncTableSelect } from "./async-table-select";
24
24
  import { cyan, green, red, blue } from '@ant-design/colors';
25
+ import { EditForm } from "./EditForm";
25
26
 
26
27
  // import moment from "moment";
27
28
 
@@ -148,16 +149,7 @@ const EditableCell = props => {
148
149
  placeholder: t ? t(column.placeholder ?? 'Select') : column.placeholder ?? 'Select',
149
150
  disabled: isDisable(column, record) ?? false,
150
151
  maxDate: maxDate,
151
- minDate: minDate
152
-
153
- // onOpenChange={(open) => {
154
- // console.log(open)
155
- // if (open) {
156
- // handleSubmit(onSubmit)
157
- // }
158
- // }}
159
- ,
160
-
152
+ minDate: minDate,
161
153
  onChange: (newDate, dateString) => {
162
154
  const newDateValue = dateString ? moment(convertDayjsToDate(dateString, dateFormat)).format() : null;
163
155
  onChange(newDateValue);
@@ -196,7 +188,6 @@ const EditableCell = props => {
196
188
  minDate: minDate,
197
189
  onChange: (newDate, dateString) => {
198
190
  const newDateValue = dateString ? moment(convertDayjsToDate(dateString, dateFormat)).format() : null;
199
- // console.log('newDateValue', newDateValue)
200
191
  onChange(newDateValue);
201
192
  setTimeout(() => {
202
193
  // @ts-ignore
@@ -746,36 +737,51 @@ const EditableCell = props => {
746
737
  },
747
738
  disabled: isDisable(column, record) ?? false
748
739
  }));
740
+ case 'form':
741
+ const valueForm = value;
742
+ return /*#__PURE__*/React.createElement(EditForm, {
743
+ rowData: record,
744
+ column: column,
745
+ t: t,
746
+ id: `col${indexCol}-record${indexRow}`,
747
+ value: valueForm
748
+ // fieldKey={'name'}
749
+ ,
750
+ fieldKey: column.editFromSettings?.fieldKey
751
+ // recordData={record}
752
+ ,
753
+ indexRow: indexRow,
754
+ cellFocus: column.field === cellEditing?.column.field,
755
+ onChange: val => {
756
+ const formState = getValues();
749
757
 
750
- // case 'form':
751
- //
752
- // const valueForm = record[column.dataIndex]
753
- //
754
- // return (
755
- // <EditForm
756
- // column={col}
757
- // t={t}
758
- // id={`col${indexCol}-record${indexRow}`}
759
- // value={valueForm}
760
- // fieldKey={'name'}
761
- // recordData={record}
762
- // indexRow={indexRow}
763
- // cellFocus={cellFocus}
764
- // onChange={(val: any) => {
765
- // // record[column.dataIndex] = val
766
- // const newrecordData = {
767
- // ...record,
768
- // [column.dataIndex]: val
769
- // }
770
- // handleCellChange(val, val, newrecordData, col, indexRow, indexCol)
771
- // }}
772
- // menuPortalTarget={tableContainerRef}
773
- // classNamePrefix={column.classElement ?? 'select'}
774
- // placeholder={t ? t(column.placeholder ? column.placeholder : '') : (column.placeholder ? column.placeholder : '')}
775
- // menuWidth={column.editFromSettings?.menuWidth}
776
- // menuHeight={column.editFromSettings?.menuHeight}
777
- // />
778
- // )
758
+ // @ts-ignore
759
+ const prevState = record[dataIndex];
760
+ const newState = val;
761
+ handleCellChange?.({
762
+ key: getRowKey?.(record, index),
763
+ field: column.field ?? column.dataIndex,
764
+ record: {
765
+ ...formState,
766
+ [column.field ?? '']: val
767
+ },
768
+ prevState,
769
+ newState,
770
+ option: val,
771
+ indexCol,
772
+ indexRow,
773
+ type: 'blur'
774
+ });
775
+ }
776
+ // cellEditing={cellEditing}
777
+
778
+ // menuPortalTarget={tableContainerRef}
779
+ // classNamePrefix={column.classElement ?? 'select'}
780
+ ,
781
+ placeholder: t ? t(column.placeholder ? column.placeholder : '') : column.placeholder ? column.placeholder : '',
782
+ menuWidth: column.editFromSettings?.menuWidth,
783
+ menuHeight: column.editFromSettings?.menuHeight
784
+ });
779
785
 
780
786
  // case 'file':
781
787
  // const valueFile = record[column.dataIndex]
@@ -960,9 +966,6 @@ const EditableCell = props => {
960
966
  // @ts-ignore
961
967
  const prevState = record[dataIndex];
962
968
  const newState = value;
963
- //
964
- // console.log('newState', newState)
965
- // console.log('prevState', prevState)
966
969
  const key = getRowKey?.(record, index);
967
970
  // @ts-ignore
968
971
  if (newState !== prevState) {
@@ -3,7 +3,9 @@ import React, { createContext, Fragment, useCallback, useContext, useState } fro
3
3
  // import {Resizable} from "react-resizable";
4
4
  import 'react-resizable/css/styles.css';
5
5
  import customParseFormat from 'dayjs/plugin/customParseFormat';
6
- import { addRowIdArray, booleanOperator, convertFilters, convertFlatColumn, filterDataByColumns4, findItemByKey, findItemPath, getAllRowKey, getFormat, getTypeFilter, groupArrayByColumns, numberOperator, removeColumns, removeInvisibleColumns, stringOperator, translateOption, updateArrayByKey, updateColumnsByGroup, updateData } from "./hooks";
6
+ import { addRowIdArray, booleanOperator, convertFilters, convertFlatColumn, filterDataByColumns4, findItemByKey, findItemPath, flattenArray, getAllRowKey, getFormat, getTypeFilter, groupArrayByColumns, numberOperator, removeColumns, removeInvisibleColumns, stringOperator, translateOption, unFlattenData, updateArrayByKey, updateColumnsByGroup,
7
+ // updateData,
8
+ updateOrInsert } from "./hooks";
7
9
  import dayjs from "dayjs";
8
10
  import 'dayjs/locale/es';
9
11
  import 'dayjs/locale/vi';
@@ -326,7 +328,9 @@ const InternalTable = props => {
326
328
  setSearchValue
327
329
  }) => {
328
330
  const type = getTypeFilter(column);
329
- const operatorOptions = type === ('Checkbox' || 'Dropdown' || 'DropTree' || 'CheckboxDropdown') ? booleanOperator : !type || type === 'Text' ? stringOperator : numberOperator;
331
+ // const operatorOptions = type === ('Checkbox' || 'Dropdown' || 'DropTree' || 'CheckboxDropdown') ? booleanOperator : (!type || type === 'Text' ? stringOperator : numberOperator)
332
+
333
+ const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? booleanOperator : !type || type === 'Text' ? stringOperator : numberOperator;
330
334
  return /*#__PURE__*/React.createElement("div", {
331
335
  style: {
332
336
  padding: 8,
@@ -825,8 +829,11 @@ const InternalTable = props => {
825
829
  };
826
830
  const triggerPaste = (pastedRows, pastedColumnsArray, newData, copyRows) => {
827
831
  const handlePasteCallback = callbackData => {
828
- const newDataUpdate = updateData(mergedData, callbackData, rowKey);
829
- triggerChangeData(newDataUpdate);
832
+ // const newDataUpdate = updateData(mergedData, callbackData, rowKey as any)
833
+
834
+ const rsFilterData = updateOrInsert(flattenArray([...mergedData]), callbackData);
835
+ const rs = unFlattenData(rsFilterData);
836
+ triggerChangeData(rs);
830
837
 
831
838
  // onCellPaste?.dataChange?.(newDataUpdate)
832
839
  };
@@ -0,0 +1,27 @@
1
+ import type { HTMLInputTypeAttribute } from "react";
2
+ import React from "react";
3
+ interface IFFormInput {
4
+ id?: any;
5
+ control: any;
6
+ name: string;
7
+ type?: HTMLInputTypeAttribute;
8
+ label: string;
9
+ labelSize?: string;
10
+ required?: boolean;
11
+ errors?: any;
12
+ height?: number | string;
13
+ disabled?: boolean;
14
+ row?: number;
15
+ isLabel?: boolean;
16
+ inLine?: boolean;
17
+ autoFocus?: boolean;
18
+ placeholder?: string;
19
+ classes?: string;
20
+ callback?: any;
21
+ readOnly?: boolean;
22
+ isView?: boolean;
23
+ t?: any;
24
+ onKeyDown?: (event: any) => void;
25
+ }
26
+ declare const InputControl: (props: IFFormInput) => React.JSX.Element;
27
+ export default InputControl;