react-table-edit 0.0.9 → 0.1.0
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.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2227,12 +2227,12 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2227
2227
|
changeDataSource(dataSource);
|
|
2228
2228
|
};
|
|
2229
2229
|
const changeDataSource = (data, haveNew = false) => {
|
|
2230
|
-
if (!addDisable && setDataSource) {
|
|
2230
|
+
if (!editDisable && !addDisable && setDataSource) {
|
|
2231
2231
|
if (haveNew) {
|
|
2232
|
-
data.push(defaultValue ? { ...defaultValue,
|
|
2232
|
+
data.push(defaultValue ? { ...defaultValue, "fieldKey": generateUUID() } : {});
|
|
2233
2233
|
}
|
|
2234
|
-
setDataSource([...data]);
|
|
2235
2234
|
}
|
|
2235
|
+
setDataSource([...data]);
|
|
2236
2236
|
};
|
|
2237
2237
|
(0, import_react12.useEffect)(() => {
|
|
2238
2238
|
if (setSelectedItem) {
|
package/dist/index.mjs
CHANGED
|
@@ -2200,12 +2200,12 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2200
2200
|
changeDataSource(dataSource);
|
|
2201
2201
|
};
|
|
2202
2202
|
const changeDataSource = (data, haveNew = false) => {
|
|
2203
|
-
if (!addDisable && setDataSource) {
|
|
2203
|
+
if (!editDisable && !addDisable && setDataSource) {
|
|
2204
2204
|
if (haveNew) {
|
|
2205
|
-
data.push(defaultValue ? { ...defaultValue,
|
|
2205
|
+
data.push(defaultValue ? { ...defaultValue, "fieldKey": generateUUID() } : {});
|
|
2206
2206
|
}
|
|
2207
|
-
setDataSource([...data]);
|
|
2208
2207
|
}
|
|
2208
|
+
setDataSource([...data]);
|
|
2209
2209
|
};
|
|
2210
2210
|
useEffect5(() => {
|
|
2211
2211
|
if (setSelectedItem) {
|