react-table-edit 0.7.3 → 0.7.5
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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +86 -50
- package/dist/index.mjs +83 -47
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -65,6 +65,7 @@ type ISettingFormElement = {
|
|
|
65
65
|
footerTemplate?: any;
|
|
66
66
|
onChangeField?: any;
|
|
67
67
|
openOnFocus?: boolean;
|
|
68
|
+
isClearable?: boolean;
|
|
68
69
|
};
|
|
69
70
|
type ISettingSelectElement = {
|
|
70
71
|
isClearable?: boolean;
|
|
@@ -110,6 +111,7 @@ type IColumnTable = {
|
|
|
110
111
|
commandItems?: ICommandItem[];
|
|
111
112
|
editTypeCondition?: any;
|
|
112
113
|
onPaste?: any;
|
|
114
|
+
onPasteValidate?: any;
|
|
113
115
|
placeholder?: string;
|
|
114
116
|
numericSettings?: ISettingNumericElement;
|
|
115
117
|
selectSettings?: ISettingSelectElement;
|
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ type ISettingFormElement = {
|
|
|
65
65
|
footerTemplate?: any;
|
|
66
66
|
onChangeField?: any;
|
|
67
67
|
openOnFocus?: boolean;
|
|
68
|
+
isClearable?: boolean;
|
|
68
69
|
};
|
|
69
70
|
type ISettingSelectElement = {
|
|
70
71
|
isClearable?: boolean;
|
|
@@ -110,6 +111,7 @@ type IColumnTable = {
|
|
|
110
111
|
commandItems?: ICommandItem[];
|
|
111
112
|
editTypeCondition?: any;
|
|
112
113
|
onPaste?: any;
|
|
114
|
+
onPasteValidate?: any;
|
|
113
115
|
placeholder?: string;
|
|
114
116
|
numericSettings?: ISettingNumericElement;
|
|
115
117
|
selectSettings?: ISettingSelectElement;
|
package/dist/index.js
CHANGED
|
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var Table_Edit_exports = {};
|
|
32
|
+
__export(Table_Edit_exports, {
|
|
33
33
|
SelectTable: () => SelectTable,
|
|
34
34
|
TabsMenuComponent: () => TabsMenuComponent,
|
|
35
|
-
default: () =>
|
|
35
|
+
default: () => Table_Edit_default,
|
|
36
36
|
formartNumberic: () => formartNumberic,
|
|
37
37
|
generateUUID: () => generateUUID,
|
|
38
38
|
isNullOrUndefined: () => isNullOrUndefined,
|
|
@@ -49,7 +49,7 @@ __export(Table_edit_exports, {
|
|
|
49
49
|
roundNumber: () => roundNumber,
|
|
50
50
|
useOnClickOutside: () => useOnClickOutside
|
|
51
51
|
});
|
|
52
|
-
module.exports = __toCommonJS(
|
|
52
|
+
module.exports = __toCommonJS(Table_Edit_exports);
|
|
53
53
|
|
|
54
54
|
// test-app/src/component/table/index.tsx
|
|
55
55
|
var import_react16 = require("react");
|
|
@@ -749,6 +749,7 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
|
|
|
749
749
|
minWidth,
|
|
750
750
|
onPaste,
|
|
751
751
|
openOnFocus,
|
|
752
|
+
isClearable,
|
|
752
753
|
labelSize = "label-small"
|
|
753
754
|
} = props;
|
|
754
755
|
const { innerWidth } = window;
|
|
@@ -1026,21 +1027,46 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
|
|
|
1026
1027
|
),
|
|
1027
1028
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "d-flex justify-content-between p-50", style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }, children: [
|
|
1028
1029
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : "" }),
|
|
1029
|
-
!onChangeField ? /* @__PURE__ */ (0, import_jsx_runtime7.
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1030
|
+
!onChangeField ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "d-flex justify-content-end", children: [
|
|
1031
|
+
isClearable && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1032
|
+
import_reactstrap6.Button,
|
|
1033
|
+
{
|
|
1034
|
+
ref: buttonRef,
|
|
1035
|
+
className: "btn me-50 py-25 px-50",
|
|
1036
|
+
outline: true,
|
|
1037
|
+
onClick: () => {
|
|
1038
|
+
itemsField.forEach((e) => {
|
|
1039
|
+
if (e.type === "numeric") {
|
|
1040
|
+
setValue(e.name, 0);
|
|
1041
|
+
} else {
|
|
1042
|
+
setValue(e.name, "");
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
},
|
|
1046
|
+
onKeyDown: (e) => {
|
|
1047
|
+
if (e.code === "Tab") {
|
|
1048
|
+
closeMenu();
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
children: t("Clear")
|
|
1052
|
+
}
|
|
1053
|
+
),
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1055
|
+
import_reactstrap6.Button,
|
|
1056
|
+
{
|
|
1057
|
+
ref: buttonRef,
|
|
1058
|
+
color: "primary",
|
|
1059
|
+
className: "btn btn-primary py-25 px-50",
|
|
1060
|
+
onClick: handleSubmit(handleOnSubmit),
|
|
1061
|
+
onKeyDown: (e) => {
|
|
1062
|
+
if (e.code === "Tab") {
|
|
1063
|
+
closeMenu();
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
children: t("Save")
|
|
1067
|
+
}
|
|
1068
|
+
)
|
|
1069
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {})
|
|
1044
1070
|
] })
|
|
1045
1071
|
] }) })
|
|
1046
1072
|
}
|
|
@@ -3073,17 +3099,13 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3073
3099
|
}
|
|
3074
3100
|
};
|
|
3075
3101
|
const getColumn = (col, index) => {
|
|
3076
|
-
const column = contentColumns[col + index];
|
|
3102
|
+
const column = contentColumns.filter((e) => e.visible !== false)[col + index];
|
|
3077
3103
|
if (column) {
|
|
3078
|
-
|
|
3079
|
-
return { ...column };
|
|
3080
|
-
} else {
|
|
3081
|
-
return getColumn(col, index + 1);
|
|
3082
|
-
}
|
|
3104
|
+
return { ...column };
|
|
3083
3105
|
}
|
|
3084
3106
|
return void 0;
|
|
3085
3107
|
};
|
|
3086
|
-
const pasteDataFromExcel = async (
|
|
3108
|
+
const pasteDataFromExcel = async (currenRowIndex, col, e) => {
|
|
3087
3109
|
const clipboard = (e.clipboardData || window.Clipboard).getData("text");
|
|
3088
3110
|
const rowsClipboard = clipboard.trimEnd().split("\n");
|
|
3089
3111
|
setIndexFocus(void 0);
|
|
@@ -3092,27 +3114,25 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3092
3114
|
for (let index = 0; index < rowsClipboard[0].trimEnd().split(" ").length; index++) {
|
|
3093
3115
|
const stringData = [];
|
|
3094
3116
|
rowsClipboard.forEach((element) => {
|
|
3095
|
-
if (element.trimEnd().split(" ")[index]) {
|
|
3117
|
+
if (element.trimEnd().split(" ")[index] && !stringData.includes(element.trimEnd().split(" ")[index].toString().trim())) {
|
|
3096
3118
|
stringData.push(element.trimEnd().split(" ")[index].toString().trim());
|
|
3097
3119
|
}
|
|
3098
3120
|
});
|
|
3099
3121
|
const column = getColumn(col, index);
|
|
3100
3122
|
if (column) {
|
|
3101
|
-
if ((!column.disabledCondition || !column.disabledCondition(
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
column.resultValidate = rs;
|
|
3106
|
-
}
|
|
3123
|
+
if ((!column.disabledCondition || !column.disabledCondition(dataSource[currenRowIndex + 0])) && column.editEnable && column.onPasteValidate) {
|
|
3124
|
+
const rs = await column.onPasteValidate(stringData.join(","), 0, dataSource[currenRowIndex + 0]);
|
|
3125
|
+
if (rs) {
|
|
3126
|
+
column.resultValidate = rs;
|
|
3107
3127
|
}
|
|
3108
3128
|
}
|
|
3129
|
+
columnsDataChange.push(column);
|
|
3109
3130
|
}
|
|
3110
|
-
columnsDataChange.push(column);
|
|
3111
3131
|
}
|
|
3112
3132
|
for (let indexRow = 0; indexRow < rowsClipboard.length; indexRow++) {
|
|
3113
3133
|
const item = rowsClipboard[indexRow];
|
|
3114
3134
|
const colsClipboard = item.trimEnd().split(" ");
|
|
3115
|
-
let dataRow = dataSource[
|
|
3135
|
+
let dataRow = dataSource[currenRowIndex + indexRow];
|
|
3116
3136
|
if (!dataRow) {
|
|
3117
3137
|
dataRow = { ...defaultValue };
|
|
3118
3138
|
dataSource.push(dataRow);
|
|
@@ -3121,49 +3141,65 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3121
3141
|
const stringData = colsClipboard[index].toString().trim();
|
|
3122
3142
|
const column = columnsDataChange[index];
|
|
3123
3143
|
if (column) {
|
|
3124
|
-
if ((!column.disabledCondition || !column.disabledCondition(
|
|
3125
|
-
if (column.
|
|
3144
|
+
if ((!column.disabledCondition || !column.disabledCondition(dataSource[currenRowIndex + indexRow])) && column.editEnable || column.onPaste) {
|
|
3145
|
+
if (column.onPasteValidate && column.resultValidate) {
|
|
3126
3146
|
const rs = column.resultValidate.find((item2) => item2[column.selectSettings?.fieldValue] === stringData);
|
|
3127
3147
|
if (rs) {
|
|
3128
|
-
|
|
3148
|
+
if (column.onPaste) {
|
|
3149
|
+
dataRow[column.field] = column.onPaste(dataRow, stringData);
|
|
3150
|
+
} else {
|
|
3151
|
+
dataRow[column.field] = stringData;
|
|
3152
|
+
}
|
|
3129
3153
|
if (column.callback) {
|
|
3130
|
-
column.callback(rs,
|
|
3154
|
+
column.callback(rs, currenRowIndex + indexRow);
|
|
3131
3155
|
}
|
|
3132
3156
|
} else {
|
|
3133
|
-
notificationError(t("PasteExcelNotExist", { index:
|
|
3157
|
+
notificationError(t("PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3134
3158
|
}
|
|
3135
3159
|
} else {
|
|
3136
3160
|
if (column.editType === "date") {
|
|
3137
3161
|
const date = new Date(stringData);
|
|
3138
3162
|
if (!isNaN(date.getTime())) {
|
|
3139
|
-
|
|
3163
|
+
if (column.onPaste) {
|
|
3164
|
+
dataRow[column.field] = column.onPaste(dataRow, date);
|
|
3165
|
+
} else {
|
|
3166
|
+
dataRow[column.field] = date;
|
|
3167
|
+
}
|
|
3140
3168
|
if (column.callback) {
|
|
3141
|
-
column.callback(date,
|
|
3169
|
+
column.callback(date, currenRowIndex + indexRow);
|
|
3142
3170
|
}
|
|
3143
3171
|
} else {
|
|
3144
|
-
notificationError(t("PasteExcelIncorrectFormat", { index:
|
|
3172
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3145
3173
|
}
|
|
3146
3174
|
} else if (column.editType === "numeric") {
|
|
3147
3175
|
const number = Number(stringData);
|
|
3148
3176
|
if (!isNaN(number)) {
|
|
3149
|
-
|
|
3177
|
+
if (column.onPaste) {
|
|
3178
|
+
dataRow[column.field] = column.onPaste(dataRow, number);
|
|
3179
|
+
} else {
|
|
3180
|
+
dataRow[column.field] = number;
|
|
3181
|
+
}
|
|
3150
3182
|
if (column.callback) {
|
|
3151
|
-
column.callback(number,
|
|
3183
|
+
column.callback(number, currenRowIndex + indexRow);
|
|
3152
3184
|
}
|
|
3153
3185
|
} else {
|
|
3154
|
-
notificationError(t("PasteExcelIncorrectFormat", { index:
|
|
3186
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3155
3187
|
}
|
|
3156
3188
|
} else {
|
|
3157
|
-
|
|
3189
|
+
if (column.onPaste) {
|
|
3190
|
+
column.onPaste(dataRow, stringData);
|
|
3191
|
+
} else {
|
|
3192
|
+
dataRow[column.field] = stringData;
|
|
3193
|
+
}
|
|
3158
3194
|
if (column.callback) {
|
|
3159
|
-
column.callback(stringData,
|
|
3195
|
+
column.callback(stringData, currenRowIndex + indexRow);
|
|
3160
3196
|
}
|
|
3161
3197
|
}
|
|
3162
3198
|
}
|
|
3163
3199
|
}
|
|
3164
3200
|
}
|
|
3165
3201
|
}
|
|
3166
|
-
rowChange(dataRow,
|
|
3202
|
+
rowChange(dataRow, currenRowIndex + indexRow, "");
|
|
3167
3203
|
}
|
|
3168
3204
|
}
|
|
3169
3205
|
changeDataSource(dataSource);
|
|
@@ -3759,7 +3795,7 @@ var TabsMenuComponent = ({
|
|
|
3759
3795
|
};
|
|
3760
3796
|
|
|
3761
3797
|
// index.ts
|
|
3762
|
-
var
|
|
3798
|
+
var Table_Edit_default = table_default;
|
|
3763
3799
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3764
3800
|
0 && (module.exports = {
|
|
3765
3801
|
SelectTable,
|
package/dist/index.mjs
CHANGED
|
@@ -706,6 +706,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
706
706
|
minWidth,
|
|
707
707
|
onPaste,
|
|
708
708
|
openOnFocus,
|
|
709
|
+
isClearable,
|
|
709
710
|
labelSize = "label-small"
|
|
710
711
|
} = props;
|
|
711
712
|
const { innerWidth } = window;
|
|
@@ -983,21 +984,46 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
983
984
|
),
|
|
984
985
|
/* @__PURE__ */ jsxs7("div", { className: "d-flex justify-content-between p-50", style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }, children: [
|
|
985
986
|
/* @__PURE__ */ jsx7("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : "" }),
|
|
986
|
-
!onChangeField ? /* @__PURE__ */
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
987
|
+
!onChangeField ? /* @__PURE__ */ jsxs7("div", { className: "d-flex justify-content-end", children: [
|
|
988
|
+
isClearable && /* @__PURE__ */ jsx7(
|
|
989
|
+
Button,
|
|
990
|
+
{
|
|
991
|
+
ref: buttonRef,
|
|
992
|
+
className: "btn me-50 py-25 px-50",
|
|
993
|
+
outline: true,
|
|
994
|
+
onClick: () => {
|
|
995
|
+
itemsField.forEach((e) => {
|
|
996
|
+
if (e.type === "numeric") {
|
|
997
|
+
setValue(e.name, 0);
|
|
998
|
+
} else {
|
|
999
|
+
setValue(e.name, "");
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
},
|
|
1003
|
+
onKeyDown: (e) => {
|
|
1004
|
+
if (e.code === "Tab") {
|
|
1005
|
+
closeMenu();
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
children: t("Clear")
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
1011
|
+
/* @__PURE__ */ jsx7(
|
|
1012
|
+
Button,
|
|
1013
|
+
{
|
|
1014
|
+
ref: buttonRef,
|
|
1015
|
+
color: "primary",
|
|
1016
|
+
className: "btn btn-primary py-25 px-50",
|
|
1017
|
+
onClick: handleSubmit(handleOnSubmit),
|
|
1018
|
+
onKeyDown: (e) => {
|
|
1019
|
+
if (e.code === "Tab") {
|
|
1020
|
+
closeMenu();
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
children: t("Save")
|
|
1024
|
+
}
|
|
1025
|
+
)
|
|
1026
|
+
] }) : /* @__PURE__ */ jsx7(Fragment7, {})
|
|
1001
1027
|
] })
|
|
1002
1028
|
] }) })
|
|
1003
1029
|
}
|
|
@@ -3039,17 +3065,13 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
3039
3065
|
}
|
|
3040
3066
|
};
|
|
3041
3067
|
const getColumn = (col, index) => {
|
|
3042
|
-
const column = contentColumns[col + index];
|
|
3068
|
+
const column = contentColumns.filter((e) => e.visible !== false)[col + index];
|
|
3043
3069
|
if (column) {
|
|
3044
|
-
|
|
3045
|
-
return { ...column };
|
|
3046
|
-
} else {
|
|
3047
|
-
return getColumn(col, index + 1);
|
|
3048
|
-
}
|
|
3070
|
+
return { ...column };
|
|
3049
3071
|
}
|
|
3050
3072
|
return void 0;
|
|
3051
3073
|
};
|
|
3052
|
-
const pasteDataFromExcel = async (
|
|
3074
|
+
const pasteDataFromExcel = async (currenRowIndex, col, e) => {
|
|
3053
3075
|
const clipboard = (e.clipboardData || window.Clipboard).getData("text");
|
|
3054
3076
|
const rowsClipboard = clipboard.trimEnd().split("\n");
|
|
3055
3077
|
setIndexFocus(void 0);
|
|
@@ -3058,27 +3080,25 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
3058
3080
|
for (let index = 0; index < rowsClipboard[0].trimEnd().split(" ").length; index++) {
|
|
3059
3081
|
const stringData = [];
|
|
3060
3082
|
rowsClipboard.forEach((element) => {
|
|
3061
|
-
if (element.trimEnd().split(" ")[index]) {
|
|
3083
|
+
if (element.trimEnd().split(" ")[index] && !stringData.includes(element.trimEnd().split(" ")[index].toString().trim())) {
|
|
3062
3084
|
stringData.push(element.trimEnd().split(" ")[index].toString().trim());
|
|
3063
3085
|
}
|
|
3064
3086
|
});
|
|
3065
3087
|
const column = getColumn(col, index);
|
|
3066
3088
|
if (column) {
|
|
3067
|
-
if ((!column.disabledCondition || !column.disabledCondition(
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
column.resultValidate = rs;
|
|
3072
|
-
}
|
|
3089
|
+
if ((!column.disabledCondition || !column.disabledCondition(dataSource[currenRowIndex + 0])) && column.editEnable && column.onPasteValidate) {
|
|
3090
|
+
const rs = await column.onPasteValidate(stringData.join(","), 0, dataSource[currenRowIndex + 0]);
|
|
3091
|
+
if (rs) {
|
|
3092
|
+
column.resultValidate = rs;
|
|
3073
3093
|
}
|
|
3074
3094
|
}
|
|
3095
|
+
columnsDataChange.push(column);
|
|
3075
3096
|
}
|
|
3076
|
-
columnsDataChange.push(column);
|
|
3077
3097
|
}
|
|
3078
3098
|
for (let indexRow = 0; indexRow < rowsClipboard.length; indexRow++) {
|
|
3079
3099
|
const item = rowsClipboard[indexRow];
|
|
3080
3100
|
const colsClipboard = item.trimEnd().split(" ");
|
|
3081
|
-
let dataRow = dataSource[
|
|
3101
|
+
let dataRow = dataSource[currenRowIndex + indexRow];
|
|
3082
3102
|
if (!dataRow) {
|
|
3083
3103
|
dataRow = { ...defaultValue };
|
|
3084
3104
|
dataSource.push(dataRow);
|
|
@@ -3087,49 +3107,65 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
3087
3107
|
const stringData = colsClipboard[index].toString().trim();
|
|
3088
3108
|
const column = columnsDataChange[index];
|
|
3089
3109
|
if (column) {
|
|
3090
|
-
if ((!column.disabledCondition || !column.disabledCondition(
|
|
3091
|
-
if (column.
|
|
3110
|
+
if ((!column.disabledCondition || !column.disabledCondition(dataSource[currenRowIndex + indexRow])) && column.editEnable || column.onPaste) {
|
|
3111
|
+
if (column.onPasteValidate && column.resultValidate) {
|
|
3092
3112
|
const rs = column.resultValidate.find((item2) => item2[column.selectSettings?.fieldValue] === stringData);
|
|
3093
3113
|
if (rs) {
|
|
3094
|
-
|
|
3114
|
+
if (column.onPaste) {
|
|
3115
|
+
dataRow[column.field] = column.onPaste(dataRow, stringData);
|
|
3116
|
+
} else {
|
|
3117
|
+
dataRow[column.field] = stringData;
|
|
3118
|
+
}
|
|
3095
3119
|
if (column.callback) {
|
|
3096
|
-
column.callback(rs,
|
|
3120
|
+
column.callback(rs, currenRowIndex + indexRow);
|
|
3097
3121
|
}
|
|
3098
3122
|
} else {
|
|
3099
|
-
notificationError(t("PasteExcelNotExist", { index:
|
|
3123
|
+
notificationError(t("PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3100
3124
|
}
|
|
3101
3125
|
} else {
|
|
3102
3126
|
if (column.editType === "date") {
|
|
3103
3127
|
const date = new Date(stringData);
|
|
3104
3128
|
if (!isNaN(date.getTime())) {
|
|
3105
|
-
|
|
3129
|
+
if (column.onPaste) {
|
|
3130
|
+
dataRow[column.field] = column.onPaste(dataRow, date);
|
|
3131
|
+
} else {
|
|
3132
|
+
dataRow[column.field] = date;
|
|
3133
|
+
}
|
|
3106
3134
|
if (column.callback) {
|
|
3107
|
-
column.callback(date,
|
|
3135
|
+
column.callback(date, currenRowIndex + indexRow);
|
|
3108
3136
|
}
|
|
3109
3137
|
} else {
|
|
3110
|
-
notificationError(t("PasteExcelIncorrectFormat", { index:
|
|
3138
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3111
3139
|
}
|
|
3112
3140
|
} else if (column.editType === "numeric") {
|
|
3113
3141
|
const number = Number(stringData);
|
|
3114
3142
|
if (!isNaN(number)) {
|
|
3115
|
-
|
|
3143
|
+
if (column.onPaste) {
|
|
3144
|
+
dataRow[column.field] = column.onPaste(dataRow, number);
|
|
3145
|
+
} else {
|
|
3146
|
+
dataRow[column.field] = number;
|
|
3147
|
+
}
|
|
3116
3148
|
if (column.callback) {
|
|
3117
|
-
column.callback(number,
|
|
3149
|
+
column.callback(number, currenRowIndex + indexRow);
|
|
3118
3150
|
}
|
|
3119
3151
|
} else {
|
|
3120
|
-
notificationError(t("PasteExcelIncorrectFormat", { index:
|
|
3152
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3121
3153
|
}
|
|
3122
3154
|
} else {
|
|
3123
|
-
|
|
3155
|
+
if (column.onPaste) {
|
|
3156
|
+
column.onPaste(dataRow, stringData);
|
|
3157
|
+
} else {
|
|
3158
|
+
dataRow[column.field] = stringData;
|
|
3159
|
+
}
|
|
3124
3160
|
if (column.callback) {
|
|
3125
|
-
column.callback(stringData,
|
|
3161
|
+
column.callback(stringData, currenRowIndex + indexRow);
|
|
3126
3162
|
}
|
|
3127
3163
|
}
|
|
3128
3164
|
}
|
|
3129
3165
|
}
|
|
3130
3166
|
}
|
|
3131
3167
|
}
|
|
3132
|
-
rowChange(dataRow,
|
|
3168
|
+
rowChange(dataRow, currenRowIndex + indexRow, "");
|
|
3133
3169
|
}
|
|
3134
3170
|
}
|
|
3135
3171
|
changeDataSource(dataSource);
|
|
@@ -3725,11 +3761,11 @@ var TabsMenuComponent = ({
|
|
|
3725
3761
|
};
|
|
3726
3762
|
|
|
3727
3763
|
// index.ts
|
|
3728
|
-
var
|
|
3764
|
+
var Table_Edit_default = table_default;
|
|
3729
3765
|
export {
|
|
3730
3766
|
SelectTable,
|
|
3731
3767
|
TabsMenuComponent,
|
|
3732
|
-
|
|
3768
|
+
Table_Edit_default as default,
|
|
3733
3769
|
formartNumberic,
|
|
3734
3770
|
generateUUID,
|
|
3735
3771
|
isNullOrUndefined,
|