@zat-design/sisyphus-react 3.9.7 → 3.9.8-beta.10
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.esm.css +6 -5
- package/dist/less.esm.css +6 -5
- package/es/ProAction/index.js +5 -5
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +51 -11
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +28 -19
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +17 -15
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/index.js +1 -1
- package/es/ProEditTable/propsType.d.ts +5 -3
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +8 -9
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -1
- package/es/ProEditTable/utils/diffOriginal.js +21 -22
- package/es/ProEditTable/utils/index.js +37 -33
- package/es/ProEditTable/utils/tools.js +4 -4
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/Group/index.js +7 -2
- package/es/ProForm/components/combination/Group/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +6 -1
- package/es/ProForm/components/combination/Group/utils.js +28 -6
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +25 -13
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +8 -4
- package/es/ProForm/components/render/propsType.d.ts +3 -1
- package/es/ProForm/index.js +6 -3
- package/es/ProForm/propsType.d.ts +3 -0
- package/es/ProForm/utils/diffOriginal.js +9 -2
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.js +25 -5
- package/es/ProForm/utils/valueType.d.ts +8 -0
- package/es/ProForm/utils/valueType.js +98 -33
- package/es/ProIcon/utils/index.js +3 -4
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/style/index.less +0 -8
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +13 -12
- package/es/ProTable/components/FormatColumn/index.js +34 -5
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/es/ProTable/components/RenderColumn/index.js +10 -2
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +7 -6
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +8 -5
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +7 -0
- package/es/ProTable/utils/index.d.ts +4 -0
- package/es/ProTable/utils/index.js +15 -0
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +2 -1
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +22 -22
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +4 -4
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +11 -12
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/utils.js +14 -16
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/lib/ProAction/index.js +5 -5
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.js +51 -11
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +27 -18
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +17 -15
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +1 -1
- package/lib/ProEditTable/propsType.d.ts +5 -3
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +8 -9
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -1
- package/lib/ProEditTable/utils/diffOriginal.js +21 -22
- package/lib/ProEditTable/utils/index.js +37 -33
- package/lib/ProEditTable/utils/tools.js +4 -4
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/Group/index.js +7 -2
- package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +6 -1
- package/lib/ProForm/components/combination/Group/utils.js +28 -6
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +25 -13
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +8 -4
- package/lib/ProForm/components/render/propsType.d.ts +3 -1
- package/lib/ProForm/index.js +6 -3
- package/lib/ProForm/propsType.d.ts +3 -0
- package/lib/ProForm/utils/diffOriginal.js +9 -2
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.js +25 -5
- package/lib/ProForm/utils/valueType.d.ts +8 -0
- package/lib/ProForm/utils/valueType.js +99 -34
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -8
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +1 -1
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +12 -11
- package/lib/ProTable/components/FormatColumn/index.js +34 -5
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/lib/ProTable/components/RenderColumn/index.js +10 -2
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +6 -5
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +8 -5
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +7 -0
- package/lib/ProTable/utils/index.d.ts +4 -0
- package/lib/ProTable/utils/index.js +17 -1
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +2 -1
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +22 -22
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +4 -4
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/utils.js +13 -13
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
package/lib/ProDownload/index.js
CHANGED
@@ -44,7 +44,7 @@ var ProDownload = function ProDownload(props) {
|
|
44
44
|
onErrorConfig = _ref.onError;
|
45
45
|
defaultProps.headers = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), defaultProps.headers);
|
46
46
|
var handDownload = /*#__PURE__*/function () {
|
47
|
-
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
47
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
48
48
|
var _params;
|
49
49
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
50
50
|
while (1) switch (_context.prev = _context.next) {
|
@@ -138,7 +138,7 @@ var ProDownload = function ProDownload(props) {
|
|
138
138
|
return (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
139
139
|
className: cls,
|
140
140
|
onClick: function () {
|
141
|
-
var _onClick = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
141
|
+
var _onClick = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
142
142
|
var res;
|
143
143
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
144
144
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -153,7 +153,7 @@ var ProDownload = function ProDownload(props) {
|
|
153
153
|
_context3.next = 13;
|
154
154
|
break;
|
155
155
|
}
|
156
|
-
if (!(beforeDownload instanceof /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
156
|
+
if (!(beforeDownload instanceof /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
157
157
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
158
158
|
while (1) switch (_context2.prev = _context2.next) {
|
159
159
|
case 0:
|
package/lib/ProDownload/utils.js
CHANGED
@@ -79,7 +79,7 @@ function getFilenameFromContentDisposition(contentDisposition) {
|
|
79
79
|
}
|
80
80
|
// 发起请求获取下载文件
|
81
81
|
var DownloadRequest = exports.DownloadRequest = /*#__PURE__*/function () {
|
82
|
-
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref2) {
|
82
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref2) {
|
83
83
|
var url, _ref2$method, method, params, headers, transformResponse, fileName, onFinish, onError, config, res, fileBlob, data, contentFileName;
|
84
84
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
85
85
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -106,8 +106,8 @@ var DownloadRequest = exports.DownloadRequest = /*#__PURE__*/function () {
|
|
106
106
|
config.headers = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config.headers), headers);
|
107
107
|
}
|
108
108
|
_context2.next = 7;
|
109
|
-
return fetch(url, config).then(/*#__PURE__*/function () {
|
110
|
-
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(response) {
|
109
|
+
return fetch(url, config).then( /*#__PURE__*/function () {
|
110
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(response) {
|
111
111
|
var _data, errorMsg;
|
112
112
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
113
113
|
while (1) switch (_context.prev = _context.next) {
|
@@ -50,7 +50,7 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
50
50
|
loading = _useState2[0],
|
51
51
|
toggleLoading = _useState2[1];
|
52
52
|
var noRenderFooter = isView || footer === false || footer === null;
|
53
|
-
var onConfirm = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
53
|
+
var onConfirm = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
54
54
|
var _locale$ProDrawerForm, _locale$ProDrawerForm2, _locale$ProDrawerForm3, _locale$ProDrawerForm4;
|
55
55
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
56
56
|
while (1) switch (_context.prev = _context.next) {
|
@@ -78,7 +78,7 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
78
78
|
}
|
79
79
|
}, _callee);
|
80
80
|
})), [onCancel, modalRef.current]);
|
81
|
-
var handleFinish = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
81
|
+
var handleFinish = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
82
82
|
var values, _error$errorFields, _error$errorFields$;
|
83
83
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
84
84
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -170,7 +170,7 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
170
170
|
if (noRenderFooter) {
|
171
171
|
return null;
|
172
172
|
}
|
173
|
-
if (/*#__PURE__*/_react.default.isValidElement(footer)) {
|
173
|
+
if ( /*#__PURE__*/_react.default.isValidElement(footer)) {
|
174
174
|
return (0, _jsxRuntime.jsx)("div", {
|
175
175
|
className: "pro-drawer-footer",
|
176
176
|
children: footer
|
@@ -180,7 +180,7 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
180
180
|
return (0, _jsxRuntime.jsx)("div", {
|
181
181
|
className: "pro-drawer-footer",
|
182
182
|
children: footer.map(function (item) {
|
183
|
-
if (/*#__PURE__*/_react.default.isValidElement(item)) {
|
183
|
+
if ( /*#__PURE__*/_react.default.isValidElement(item)) {
|
184
184
|
return item;
|
185
185
|
}
|
186
186
|
return false;
|
@@ -56,7 +56,7 @@ var ProModal = function ProModal(_ref) {
|
|
56
56
|
'pro-modal-no-footer': noRenderFooter,
|
57
57
|
'pro-modal-footer-shadow': height >= 450
|
58
58
|
}]);
|
59
|
-
var handleFinish = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
59
|
+
var handleFinish = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
60
60
|
var values, _error$errorFields, _error$errorFields$;
|
61
61
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
62
62
|
while (1) switch (_context.prev = _context.next) {
|
@@ -150,7 +150,7 @@ var ProModal = function ProModal(_ref) {
|
|
150
150
|
if (noRenderFooter) {
|
151
151
|
return null;
|
152
152
|
}
|
153
|
-
if (/*#__PURE__*/_react.default.isValidElement(footer)) {
|
153
|
+
if ( /*#__PURE__*/_react.default.isValidElement(footer)) {
|
154
154
|
return (0, _jsxRuntime.jsx)("div", {
|
155
155
|
className: "pro-drawer-footer",
|
156
156
|
children: footer
|
@@ -160,7 +160,7 @@ var ProModal = function ProModal(_ref) {
|
|
160
160
|
return (0, _jsxRuntime.jsx)("div", {
|
161
161
|
className: "pro-drawer-footer",
|
162
162
|
children: footer.map(function (item) {
|
163
|
-
if (/*#__PURE__*/_react.default.isValidElement(item)) {
|
163
|
+
if ( /*#__PURE__*/_react.default.isValidElement(item)) {
|
164
164
|
return item;
|
165
165
|
}
|
166
166
|
return false;
|
@@ -135,7 +135,7 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
135
135
|
* pop确认回调
|
136
136
|
*/
|
137
137
|
var onConfirmHandle = /*#__PURE__*/function () {
|
138
|
-
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
138
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
139
139
|
var res, value;
|
140
140
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
141
141
|
while (1) switch (_context.prev = _context.next) {
|
@@ -222,7 +222,7 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
222
222
|
})
|
223
223
|
});
|
224
224
|
if (disabled) {
|
225
|
-
if (/*#__PURE__*/_react.default.isValidElement(children)) {
|
225
|
+
if ( /*#__PURE__*/_react.default.isValidElement(children)) {
|
226
226
|
return children;
|
227
227
|
}
|
228
228
|
if (props.value && !popupProps) {
|
@@ -254,7 +254,7 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
254
254
|
if (mode === 'popup') {
|
255
255
|
// 查看时内容渲染
|
256
256
|
var labelRender = function labelRender() {
|
257
|
-
if (/*#__PURE__*/_react.default.isValidElement(children)) {
|
257
|
+
if ( /*#__PURE__*/_react.default.isValidElement(children)) {
|
258
258
|
return children;
|
259
259
|
}
|
260
260
|
return TextNode;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const ActionButton: ({ record, index, config, btnConfig }: any) =>
|
1
|
+
declare const ActionButton: ({ record, index, config, btnConfig }: any) => JSX.Element;
|
2
2
|
export default ActionButton;
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
11
12
|
var _antd = require("antd");
|
@@ -26,13 +27,18 @@ var ActionButton = function ActionButton(_ref) {
|
|
26
27
|
deletePoConfirmMsg = config.deletePoConfirmMsg,
|
27
28
|
mulDeletePoConfirmMsg = config.mulDeletePoConfirmMsg,
|
28
29
|
max = config.max,
|
30
|
+
name = config.name,
|
29
31
|
tableLength = config.tableLength;
|
32
|
+
var rowNamePath = [].concat((0, _toConsumableArray2.default)(name), [index]);
|
30
33
|
// 操作按钮权限控制
|
31
34
|
var getShow = function getShow(show) {
|
32
35
|
if (typeof show === 'function') {
|
33
36
|
return show(record, {
|
34
37
|
index: index,
|
35
|
-
form: form
|
38
|
+
form: form,
|
39
|
+
name: name,
|
40
|
+
namePath: rowNamePath,
|
41
|
+
tableLength: tableLength
|
36
42
|
});
|
37
43
|
}
|
38
44
|
return show;
|
@@ -42,7 +48,10 @@ var ActionButton = function ActionButton(_ref) {
|
|
42
48
|
if (typeof disabled === 'function') {
|
43
49
|
return disabled(record, {
|
44
50
|
index: index,
|
45
|
-
form: form
|
51
|
+
form: form,
|
52
|
+
name: name,
|
53
|
+
namePath: rowNamePath,
|
54
|
+
tableLength: tableLength
|
46
55
|
});
|
47
56
|
}
|
48
57
|
// 新增超过最大行,禁止操作按钮
|
@@ -64,14 +73,27 @@ var ActionButton = function ActionButton(_ref) {
|
|
64
73
|
// 其他操作按钮Props
|
65
74
|
var actionBtnProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, btnConfig.buttonProps), {}, {
|
66
75
|
onClick: function onClick() {
|
67
|
-
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record,
|
76
|
+
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record, {
|
77
|
+
index: index,
|
78
|
+
form: form,
|
79
|
+
name: name,
|
80
|
+
namePath: rowNamePath,
|
81
|
+
tableLength: tableLength
|
82
|
+
});
|
68
83
|
},
|
69
84
|
disabled: getDisabled((_btnConfig$buttonProp3 = btnConfig.buttonProps) === null || _btnConfig$buttonProp3 === void 0 ? void 0 : _btnConfig$buttonProp3.disabled)
|
70
85
|
});
|
71
86
|
// 当传入函数时,先转成reactNode
|
72
87
|
if ((0, _lodash.isFunction)(btnConfig.label)) {
|
73
|
-
|
74
|
-
|
88
|
+
var addIndex = tableLength ? tableLength - 1 : 0;
|
89
|
+
var namePath = [].concat((0, _toConsumableArray2.default)(name), [addIndex]);
|
90
|
+
var addRecord = form.getFieldValue(namePath) || {};
|
91
|
+
btnConfig.label = btnConfig.label(addRecord, {
|
92
|
+
form: form,
|
93
|
+
namePath: namePath,
|
94
|
+
name: name,
|
95
|
+
tableLength: tableLength,
|
96
|
+
index: addIndex
|
75
97
|
});
|
76
98
|
}
|
77
99
|
var isDisabled = !selectedRowKeys.length && btnConfig.type === 'mulDelete' || editingKeys.length || (delBtnProps === null || delBtnProps === void 0 ? void 0 : delBtnProps.disabled);
|
@@ -81,12 +103,18 @@ var ActionButton = function ActionButton(_ref) {
|
|
81
103
|
placement: "topRight",
|
82
104
|
title: deleteMsgMap[btnConfig.type],
|
83
105
|
onConfirm: function onConfirm() {
|
84
|
-
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record,
|
106
|
+
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record, {
|
107
|
+
index: index,
|
108
|
+
form: form,
|
109
|
+
name: name,
|
110
|
+
namePath: rowNamePath,
|
111
|
+
tableLength: tableLength
|
112
|
+
});
|
85
113
|
},
|
86
114
|
disabled: isDisabled,
|
87
115
|
okText: _locale.default.ProEditTable.confirm,
|
88
116
|
cancelText: _locale.default.ProEditTable.cancel,
|
89
|
-
children: /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? (/*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
117
|
+
children: /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? ( /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
90
118
|
record: record,
|
91
119
|
index: index,
|
92
120
|
disabled: isDisabled
|
@@ -96,24 +124,36 @@ var ActionButton = function ActionButton(_ref) {
|
|
96
124
|
children: btnConfig.label
|
97
125
|
}))
|
98
126
|
}) : (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
99
|
-
children: /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? (/*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
127
|
+
children: /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? ( /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
100
128
|
record: record,
|
101
129
|
index: index,
|
102
130
|
disabled: isDisabled,
|
103
131
|
onClick: function onClick() {
|
104
|
-
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record,
|
132
|
+
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record, {
|
133
|
+
index: index,
|
134
|
+
form: form,
|
135
|
+
name: name,
|
136
|
+
namePath: rowNamePath,
|
137
|
+
tableLength: tableLength
|
138
|
+
});
|
105
139
|
}
|
106
140
|
}))) : (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
107
141
|
disabled: isDisabled,
|
108
142
|
type: "link",
|
109
143
|
onClick: function onClick() {
|
110
|
-
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record,
|
144
|
+
btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.onEvent(record, {
|
145
|
+
index: index,
|
146
|
+
form: form,
|
147
|
+
name: name,
|
148
|
+
namePath: rowNamePath,
|
149
|
+
tableLength: tableLength
|
150
|
+
});
|
111
151
|
},
|
112
152
|
children: btnConfig.label
|
113
153
|
}))
|
114
154
|
})
|
115
155
|
}) : (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
116
|
-
children: /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? (/*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(actionBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
156
|
+
children: /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? ( /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(actionBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
117
157
|
record: record,
|
118
158
|
index: index
|
119
159
|
}))) : (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const RenderField: ({ text: value, record, index, column, config }: any) =>
|
1
|
+
declare const RenderField: ({ text: value, record, index, column, config }: any) => JSX.Element;
|
2
2
|
export default RenderField;
|
@@ -30,7 +30,7 @@ var _utils = require("../../../ProForm/utils");
|
|
30
30
|
var _ConfirmWrapper = _interopRequireDefault(require("../../../ProForm/components/render/ConfirmWrapper"));
|
31
31
|
var _getDefaultProps = require("../../utils/getDefaultProps");
|
32
32
|
var _ListChangedWrapper = _interopRequireDefault(require("./ListChangedWrapper"));
|
33
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "onDiff", "className", "trim", "confirm", "dependencies"];
|
33
|
+
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "onDiff", "className", "trim", "confirm", "dependencies", "desensitization"];
|
34
34
|
/* eslint-disable prefer-destructuring */
|
35
35
|
/* eslint-disable prefer-const */
|
36
36
|
var RenderField = function RenderField(_ref) {
|
@@ -64,6 +64,7 @@ var RenderField = function RenderField(_ref) {
|
|
64
64
|
trim = column.trim,
|
65
65
|
confirm = column.confirm,
|
66
66
|
dependencies = column.dependencies,
|
67
|
+
desensitization = column.desensitization,
|
67
68
|
resetProps = (0, _objectWithoutProperties2.default)(column, _excluded);
|
68
69
|
// editRender弃用使用component同ProForm
|
69
70
|
var _editRender = component || editRender;
|
@@ -89,6 +90,7 @@ var RenderField = function RenderField(_ref) {
|
|
89
90
|
var _required = required;
|
90
91
|
var _valueType = valueType;
|
91
92
|
var _disabled = false;
|
93
|
+
var _desensitization = desensitization || [];
|
92
94
|
var isCell = mode === 'cell';
|
93
95
|
if (isCell) {
|
94
96
|
record['is-view'] = !(0, _lodash.isEqual)(cellNamePath, cellName);
|
@@ -125,6 +127,9 @@ var RenderField = function RenderField(_ref) {
|
|
125
127
|
if ((0, _lodash.isFunction)(valueType)) {
|
126
128
|
_valueType = valueType.apply(void 0, rowParams);
|
127
129
|
}
|
130
|
+
if ((0, _lodash.isFunction)(desensitization)) {
|
131
|
+
_desensitization = desensitization.apply(void 0, rowParams);
|
132
|
+
}
|
128
133
|
// 获取最终的disabled
|
129
134
|
_disabled = (0, _tools.getDisabled)({
|
130
135
|
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
@@ -136,9 +141,9 @@ var RenderField = function RenderField(_ref) {
|
|
136
141
|
});
|
137
142
|
if (typeof isEditable === 'function') {
|
138
143
|
isEditable = isEditable.apply(void 0, rowParams);
|
139
|
-
setTimeout(
|
140
|
-
|
141
|
-
}, 100);
|
144
|
+
// setTimeout(() => {
|
145
|
+
// !isEditable && form.validateFields([cellName]);
|
146
|
+
// }, 100);
|
142
147
|
}
|
143
148
|
// 是否只读文本
|
144
149
|
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !isEditing || (0, _tools.getDisabled)({
|
@@ -196,21 +201,23 @@ var RenderField = function RenderField(_ref) {
|
|
196
201
|
* 配置valueType时,基于formItem的normalize与getValueProps进行值类型转换
|
197
202
|
* @returns {}
|
198
203
|
*/
|
199
|
-
var valueTypeTransform =
|
200
|
-
var _fieldProps3;
|
201
|
-
// 不存在valueType返回空
|
202
|
-
if (!_valueType) {
|
203
|
-
return {};
|
204
|
-
}
|
204
|
+
var valueTypeTransform = function valueTypeTransform() {
|
205
|
+
var _fieldProps3, _desensitization2;
|
205
206
|
// SwitchCheckbox默认YN, 兼容已有组件
|
206
207
|
if (type === 'SwitchCheckbox') {
|
207
208
|
_valueType = 'switch';
|
208
209
|
}
|
209
210
|
var params = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
210
|
-
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode
|
211
|
+
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode,
|
212
|
+
desensitization: _desensitization
|
211
213
|
});
|
214
|
+
var isDesensit = sessionStorage.getItem(otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey);
|
215
|
+
// 仅查看模式下进行数据脱敏
|
216
|
+
if (((_desensitization2 = _desensitization) === null || _desensitization2 === void 0 ? void 0 : _desensitization2.length) && _disabled && isDesensit === 'ON') {
|
217
|
+
_valueType = 'desensitization';
|
218
|
+
}
|
212
219
|
return (0, _lodash.isFunction)(_valueType2.default[_valueType]) ? _valueType2.default[_valueType](params) : {};
|
213
|
-
}
|
220
|
+
};
|
214
221
|
if ((_names = names) === null || _names === void 0 ? void 0 : _names.length) {
|
215
222
|
// 支持names配置,临时生成对应的formItem,用来存储单个对应的值
|
216
223
|
names = names.map(function (key) {
|
@@ -254,7 +261,7 @@ var RenderField = function RenderField(_ref) {
|
|
254
261
|
if (typeof _editRender === 'function') {
|
255
262
|
TargetComponent = _editRender.apply(void 0, rowParams);
|
256
263
|
}
|
257
|
-
if (/*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
264
|
+
if ( /*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
258
265
|
TargetComponent = _editRender;
|
259
266
|
}
|
260
267
|
}
|
@@ -270,7 +277,7 @@ var RenderField = function RenderField(_ref) {
|
|
270
277
|
children: View
|
271
278
|
});
|
272
279
|
}
|
273
|
-
if (/*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
280
|
+
if ( /*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
274
281
|
TargetComponent = viewRender;
|
275
282
|
}
|
276
283
|
}
|
@@ -313,7 +320,7 @@ var RenderField = function RenderField(_ref) {
|
|
313
320
|
}, 100);
|
314
321
|
};
|
315
322
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
316
|
-
var _onChange = (0, _lodash.debounce)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
323
|
+
var _onChange = (0, _lodash.debounce)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
317
324
|
var _len2,
|
318
325
|
args,
|
319
326
|
_key2,
|
@@ -427,7 +434,7 @@ var RenderField = function RenderField(_ref) {
|
|
427
434
|
}, _callee);
|
428
435
|
})), 300);
|
429
436
|
var _onblur = /*#__PURE__*/function () {
|
430
|
-
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
437
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
431
438
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
432
439
|
var _len3,
|
433
440
|
args,
|
@@ -524,6 +531,7 @@ var RenderField = function RenderField(_ref) {
|
|
524
531
|
onBlur: _onblur,
|
525
532
|
index: index,
|
526
533
|
confirm: confirm,
|
534
|
+
desensitization: _desensitization,
|
527
535
|
otherProps: {
|
528
536
|
form: form,
|
529
537
|
names: names,
|
@@ -532,7 +540,8 @@ var RenderField = function RenderField(_ref) {
|
|
532
540
|
listName: cellName,
|
533
541
|
viewEmpty: viewEmpty,
|
534
542
|
valueType: _valueType,
|
535
|
-
isView: isView
|
543
|
+
isView: isView,
|
544
|
+
desensitizationKey: otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey
|
536
545
|
}
|
537
546
|
});
|
538
547
|
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
|
@@ -563,7 +572,7 @@ var RenderField = function RenderField(_ref) {
|
|
563
572
|
var getFieldItem = function getFieldItem() {
|
564
573
|
var _componentProps;
|
565
574
|
var FormItem = null;
|
566
|
-
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? (/*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
575
|
+
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? ( /*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
567
576
|
if (originalValues && !getIsNew(record)) {
|
568
577
|
FieldComponent = (0, _jsxRuntime.jsx)(_ListChangedWrapper.default, {
|
569
578
|
name: cellName,
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const RenderToolbar: (config: any) =>
|
1
|
+
declare const RenderToolbar: (config: any) => JSX.Element;
|
2
2
|
export default RenderToolbar;
|
@@ -25,10 +25,8 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
25
25
|
virtualKey = config.virtualKey,
|
26
26
|
form = config.form,
|
27
27
|
disabled = config.disabled,
|
28
|
-
selectedRows = config.selectedRows,
|
29
28
|
tableLength = config.tableLength;
|
30
29
|
var virtualName = (0, _tools.getNamePath)(name, virtualKey);
|
31
|
-
var dataSource = form.getFieldValue(name);
|
32
30
|
// toolbarProps配置为false 默认不插入
|
33
31
|
if (toolbarProps === false || disabled) {
|
34
32
|
return null;
|
@@ -82,29 +80,33 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
82
80
|
toolbar.show = show !== null && show !== void 0 ? show : true;
|
83
81
|
toolbar.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
84
82
|
toolbar.onEvent = /*#__PURE__*/function () {
|
85
|
-
var
|
86
|
-
var onEvent, result;
|
83
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, _ref) {
|
84
|
+
var index, form, name, namePath, tableLength, onEvent, result;
|
87
85
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
88
86
|
while (1) switch (_context.prev = _context.next) {
|
89
87
|
case 0:
|
88
|
+
index = _ref.index, form = _ref.form, name = _ref.name, namePath = _ref.namePath, tableLength = _ref.tableLength;
|
90
89
|
onEvent = onClick || onHandle;
|
91
90
|
if (onEvent) {
|
92
|
-
_context.next =
|
91
|
+
_context.next = 6;
|
93
92
|
break;
|
94
93
|
}
|
95
94
|
result = true;
|
96
|
-
_context.next =
|
95
|
+
_context.next = 9;
|
97
96
|
break;
|
98
|
-
case
|
99
|
-
_context.next =
|
100
|
-
return onEvent === null || onEvent === void 0 ? void 0 : onEvent(
|
97
|
+
case 6:
|
98
|
+
_context.next = 8;
|
99
|
+
return onEvent === null || onEvent === void 0 ? void 0 : onEvent(record, {
|
100
|
+
index: index,
|
101
101
|
form: form,
|
102
|
-
|
102
|
+
name: name,
|
103
|
+
namePath: namePath,
|
104
|
+
tableLength: tableLength
|
103
105
|
});
|
104
|
-
case 7:
|
105
|
-
result = _context.sent;
|
106
106
|
case 8:
|
107
|
-
|
107
|
+
result = _context.sent;
|
108
|
+
case 9:
|
109
|
+
if (result !== false && type !== 'custom') {
|
108
110
|
_config.actions[type]((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
109
111
|
index: index,
|
110
112
|
record: record,
|
@@ -113,14 +115,14 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
113
115
|
virtualName: virtualName
|
114
116
|
}));
|
115
117
|
}
|
116
|
-
case
|
118
|
+
case 10:
|
117
119
|
case "end":
|
118
120
|
return _context.stop();
|
119
121
|
}
|
120
122
|
}, _callee);
|
121
123
|
}));
|
122
124
|
return function (_x, _x2) {
|
123
|
-
return
|
125
|
+
return _ref2.apply(this, arguments);
|
124
126
|
};
|
125
127
|
}();
|
126
128
|
toolbar.buttonProps = buttonProps;
|
@@ -8,5 +8,5 @@ interface SummaryProps<T = any> {
|
|
8
8
|
};
|
9
9
|
rowSelection: any;
|
10
10
|
}
|
11
|
-
declare const Summary: ({ data, summary, rowSelection, }: SummaryProps) =>
|
11
|
+
declare const Summary: ({ data, summary, rowSelection, }: SummaryProps) => JSX.Element;
|
12
12
|
export default Summary;
|
@@ -300,7 +300,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
300
300
|
}, [value, config.name]);
|
301
301
|
var _columns = (0, _react.useMemo)(function () {
|
302
302
|
return (0, _utils.transformColumns)(columns, config);
|
303
|
-
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
303
|
+
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath, value === null || value === void 0 ? void 0 : value.length]);
|
304
304
|
var initDataSource = function initDataSource() {
|
305
305
|
var _value$every, _value$some;
|
306
306
|
var isAllHasKey = value === null || value === void 0 ? void 0 : (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, function (item) {
|
@@ -11,9 +11,11 @@ import { ProFormValueType, ColumnPropsMap } from '../ProForm/components/render/p
|
|
11
11
|
import { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
|
12
12
|
export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDelete' | 'custom';
|
13
13
|
export type ShowFunction<T> = (record?: T, options?: {
|
14
|
-
index
|
15
|
-
form
|
16
|
-
|
14
|
+
index: number;
|
15
|
+
form: FormInstance;
|
16
|
+
name: NamePath;
|
17
|
+
namePath: NamePath;
|
18
|
+
tableLength: number;
|
17
19
|
}) => Promise<any> | boolean | void;
|
18
20
|
export interface OptionsProps {
|
19
21
|
index: number;
|
@@ -9,7 +9,7 @@ export declare const defaultBtnNameMap: {
|
|
9
9
|
custom: any;
|
10
10
|
};
|
11
11
|
export declare const iconMap: {
|
12
|
-
add:
|
12
|
+
add: JSX.Element;
|
13
13
|
};
|
14
14
|
export declare const defaultSingleActionKeys: string[];
|
15
15
|
export declare const defaultMultipleActionKeys: string[];
|
@@ -69,7 +69,7 @@ var actions = exports.actions = {
|
|
69
69
|
});
|
70
70
|
},
|
71
71
|
save: function () {
|
72
|
-
var _save = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
72
|
+
var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
73
73
|
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
74
74
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
75
75
|
while (1) switch (_context.prev = _context.next) {
|
@@ -172,7 +172,7 @@ var actions = exports.actions = {
|
|
172
172
|
}
|
173
173
|
},
|
174
174
|
add: function () {
|
175
|
-
var _add = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
|
175
|
+
var _add = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
|
176
176
|
var _tableRef$current$que, _tableRef$current$que2;
|
177
177
|
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, _ref5$prefixCls, prefixCls, nextData, rowKey, addData, nextEditingKeys;
|
178
178
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
@@ -242,15 +242,14 @@ var actions = exports.actions = {
|
|
242
242
|
virtualKey: virtualKey,
|
243
243
|
selectedRowKeys: selectedRowKeys
|
244
244
|
});
|
245
|
+
var nextData = {
|
246
|
+
selectedRowKeys: [],
|
247
|
+
selectedRows: []
|
248
|
+
};
|
245
249
|
// 删除的选择数据包含单行编辑行时,清空可编辑key
|
246
250
|
if (virtualKey && selectedRowKeys.includes(editingKeys === null || editingKeys === void 0 ? void 0 : editingKeys[0])) {
|
247
|
-
|
248
|
-
editingKeys: []
|
249
|
-
});
|
251
|
+
nextData.editingKeys = [];
|
250
252
|
}
|
251
|
-
setState(
|
252
|
-
selectedRowKeys: [],
|
253
|
-
selectedRows: []
|
254
|
-
});
|
253
|
+
setState(nextData);
|
255
254
|
}
|
256
255
|
};
|
@@ -4,7 +4,7 @@ export interface DiffOriginalParams {
|
|
4
4
|
originalValue: any;
|
5
5
|
value: any;
|
6
6
|
form: FormInstance;
|
7
|
-
equalWith?: ({ originValue, originRecord, value, record, index }: {
|
7
|
+
equalWith?: ({ originValue, originRecord, value, record, index, }: {
|
8
8
|
originValue: any;
|
9
9
|
originRecord: any;
|
10
10
|
value: any;
|