@zat-design/sisyphus-react 3.9.8-beta.7 → 3.9.8-beta.9
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.
@@ -2,6 +2,7 @@ import "antd/es/button/style";
|
|
2
2
|
import _Button from "antd/es/button";
|
3
3
|
import "antd/es/popconfirm/style";
|
4
4
|
import _Popconfirm from "antd/es/popconfirm";
|
5
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
5
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
6
7
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
7
8
|
import React from 'react';
|
@@ -66,8 +67,15 @@ var ActionButton = function ActionButton(_ref) {
|
|
66
67
|
});
|
67
68
|
// 当传入函数时,先转成reactNode
|
68
69
|
if (isFunction(btnConfig.label)) {
|
69
|
-
|
70
|
-
|
70
|
+
var addIndex = tableLength ? tableLength - 1 : 0;
|
71
|
+
var namePath = [].concat(_toConsumableArray(config.name), [addIndex]);
|
72
|
+
var addRecord = form.getFieldValue(namePath) || {};
|
73
|
+
btnConfig.label = btnConfig.label(addRecord, {
|
74
|
+
form: form,
|
75
|
+
namePath: namePath,
|
76
|
+
name: config.name,
|
77
|
+
index: addIndex,
|
78
|
+
tableLength: tableLength
|
71
79
|
});
|
72
80
|
}
|
73
81
|
var isDisabled = !selectedRowKeys.length && btnConfig.type === 'mulDelete' || editingKeys.length || (delBtnProps === null || delBtnProps === void 0 ? void 0 : delBtnProps.disabled);
|
@@ -134,9 +134,9 @@ var RenderField = function RenderField(_ref) {
|
|
134
134
|
});
|
135
135
|
if (typeof isEditable === 'function') {
|
136
136
|
isEditable = isEditable.apply(void 0, rowParams);
|
137
|
-
setTimeout(
|
138
|
-
|
139
|
-
}, 100);
|
137
|
+
// setTimeout(() => {
|
138
|
+
// !isEditable && form.validateFields([cellName]);
|
139
|
+
// }, 100);
|
140
140
|
}
|
141
141
|
// 是否只读文本
|
142
142
|
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !isEditing || getDisabled({
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
8
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
@@ -70,8 +71,15 @@ var ActionButton = function ActionButton(_ref) {
|
|
70
71
|
});
|
71
72
|
// 当传入函数时,先转成reactNode
|
72
73
|
if ((0, _lodash.isFunction)(btnConfig.label)) {
|
73
|
-
|
74
|
-
|
74
|
+
var addIndex = tableLength ? tableLength - 1 : 0;
|
75
|
+
var namePath = [].concat((0, _toConsumableArray2.default)(config.name), [addIndex]);
|
76
|
+
var addRecord = form.getFieldValue(namePath) || {};
|
77
|
+
btnConfig.label = btnConfig.label(addRecord, {
|
78
|
+
form: form,
|
79
|
+
namePath: namePath,
|
80
|
+
name: config.name,
|
81
|
+
index: addIndex,
|
82
|
+
tableLength: tableLength
|
75
83
|
});
|
76
84
|
}
|
77
85
|
var isDisabled = !selectedRowKeys.length && btnConfig.type === 'mulDelete' || editingKeys.length || (delBtnProps === null || delBtnProps === void 0 ? void 0 : delBtnProps.disabled);
|
@@ -141,9 +141,9 @@ var RenderField = function RenderField(_ref) {
|
|
141
141
|
});
|
142
142
|
if (typeof isEditable === 'function') {
|
143
143
|
isEditable = isEditable.apply(void 0, rowParams);
|
144
|
-
setTimeout(
|
145
|
-
|
146
|
-
}, 100);
|
144
|
+
// setTimeout(() => {
|
145
|
+
// !isEditable && form.validateFields([cellName]);
|
146
|
+
// }, 100);
|
147
147
|
}
|
148
148
|
// 是否只读文本
|
149
149
|
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !isEditing || (0, _tools.getDisabled)({
|