@zat-design/sisyphus-react 4.0.0-beta.6 → 4.0.0-beta.8
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 +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProAction/index.js +3 -6
- package/es/ProConfigProvider/index.js +2 -3
- package/es/ProDownload/index.js +2 -3
- package/es/ProDownload/utils.js +3 -4
- package/es/ProDrawerForm/components/ProDrawer/index.js +5 -10
- package/es/ProDrawerForm/components/ProModal/index.js +5 -10
- package/es/ProEditLabel/components/RenderProForm.js +2 -3
- package/es/ProEditLabel/index.js +6 -13
- package/es/ProEditTable/components/ActionButton/index.js +5 -8
- package/es/ProEditTable/components/RcTable/BaseTable.js +3 -6
- package/es/ProEditTable/components/RcTable/DraggableTable.js +2 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +5 -8
- package/es/ProEditTable/components/RenderField/index.js +48 -14
- package/es/ProEditTable/components/RenderToolbar/index.js +2 -3
- package/es/ProEditTable/components/Summary/index.js +5 -8
- package/es/ProEditTable/components/Validator/index.js +3 -6
- package/es/ProEditTable/index.js +16 -19
- package/es/ProEditTable/propsType.d.ts +6 -0
- package/es/ProEditTable/utils/config.js +4 -5
- package/es/ProEditTable/utils/index.js +3 -6
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +15 -0
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +132 -0
- package/es/ProEnum/index.js +10 -17
- package/es/ProForm/components/Container.js +2 -3
- package/es/ProForm/components/FormFooter/index.js +4 -7
- package/es/ProForm/components/base/Checkbox/index.js +3 -4
- package/es/ProForm/components/base/DatePicker/index.js +2 -3
- package/es/ProForm/components/base/Input/index.js +2 -3
- package/es/ProForm/components/base/InputNumber/index.js +3 -6
- package/es/ProForm/components/base/Radio/index.js +3 -4
- package/es/ProForm/components/base/RangePicker/index.js +3 -3
- package/es/ProForm/components/base/Select/index.js +2 -3
- package/es/ProForm/components/base/Switch/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/es/ProForm/components/base/TextArea/index.js +2 -3
- package/es/ProForm/components/base/TimePicker/index.js +2 -3
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +8 -13
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +3 -6
- package/es/ProForm/components/combination/FormList/components/Empty.js +2 -3
- package/es/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +5 -8
- package/es/ProForm/components/combination/FormList/index.js +2 -3
- package/es/ProForm/components/combination/Group/index.js +3 -4
- package/es/ProForm/components/combination/Group/utils.js +3 -4
- package/es/ProForm/components/combination/ProCascader/index.js +5 -10
- package/es/ProForm/components/combination/ProModalSelect/index.js +9 -22
- package/es/ProForm/components/combination/ProNumberRange/index.js +12 -19
- package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -9
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -9
- package/es/ProForm/components/render/ChangedWrapper.js +5 -8
- package/es/ProForm/components/render/ConfirmWrapper.js +3 -4
- package/es/ProForm/components/render/Render.js +12 -19
- package/es/ProForm/components/render/RenderFields.js +2 -1
- package/es/ProForm/index.js +9 -16
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/utils/useForm.js +2 -3
- package/es/ProForm/utils/useShouldUpdate.js +1 -2
- package/es/ProIcon/index.js +6 -11
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +3 -6
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -3
- package/es/ProLayout/components/ProCollapse/index.js +5 -10
- package/es/ProLayout/components/ProFooter/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/es/ProLayout/components/ProHeader/index.js +16 -25
- package/es/ProLayout/index.js +2 -3
- package/es/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/es/ProSelect/index.js +7 -14
- package/es/ProStep/components/Anchor/index.js +2 -3
- package/es/ProTable/components/FormatColumn/index.js +9 -10
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +2 -3
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +2 -3
- package/es/ProTable/components/RenderColumn/index.js +10 -15
- package/es/ProTable/components/RenderSummary/index.js +4 -5
- package/es/ProTable/components/RenderTableHeader/index.js +3 -4
- package/es/ProTable/components/RenderTabs/index.js +3 -6
- package/es/ProTable/components/TooltipTitle/index.js +2 -3
- package/es/ProTable/hooks/useAntdTable.js +3 -6
- package/es/ProTabs/components/Card/index.js +5 -10
- package/es/ProTabs/index.js +2 -3
- package/es/ProTabs/style/index.less +5 -1
- package/es/ProThemeTools/component/ProTools/index.js +12 -19
- package/es/ProThemeTools/index.js +2 -3
- package/es/ProTooltip/index.js +4 -5
- package/es/ProTree/components/AdaptiveTooltip.js +2 -3
- package/es/ProTree/components/List.js +3 -4
- package/es/ProTree/components/ProTree.js +5 -12
- package/es/ProTree/components/ProTreeSelect/index.js +9 -16
- package/es/ProTree/components/Tree.js +3 -6
- package/es/ProTreeModal/components/Cascader.js +3 -4
- package/es/ProTreeModal/components/List.js +9 -14
- package/es/ProTreeModal/components/SortableItem.js +2 -3
- package/es/ProTreeModal/components/Tree.js +3 -4
- package/es/ProTreeModal/components/Trigger.js +6 -11
- package/es/ProTreeModal/index.js +9 -16
- package/es/ProUpload/components/ButtonRender.js +3 -6
- package/es/ProUpload/components/DragRender.js +2 -3
- package/es/ProUpload/components/FileItem.js +10 -15
- package/es/ProUpload/components/ImageRender.js +8 -17
- package/es/ProUpload/index.js +3 -4
- package/es/ProViewer/index.js +4 -9
- package/es/ProViewer/propsType.js +3 -0
- package/es/ProWaterMark/index.js +2 -3
- package/es/utils/index.js +13 -1
- package/lib/ProAction/index.js +3 -6
- package/lib/ProConfigProvider/index.js +2 -3
- package/lib/ProDownload/index.js +2 -3
- package/lib/ProDownload/utils.js +3 -4
- package/lib/ProDrawerForm/components/ProDrawer/index.js +5 -10
- package/lib/ProDrawerForm/components/ProModal/index.js +5 -10
- package/lib/ProEditLabel/components/RenderProForm.js +2 -3
- package/lib/ProEditLabel/index.js +6 -13
- package/lib/ProEditTable/components/ActionButton/index.js +5 -8
- package/lib/ProEditTable/components/RcTable/BaseTable.js +3 -6
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +2 -3
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +5 -8
- package/lib/ProEditTable/components/RenderField/index.js +48 -14
- package/lib/ProEditTable/components/RenderToolbar/index.js +2 -3
- package/lib/ProEditTable/components/Summary/index.js +5 -9
- package/lib/ProEditTable/components/Validator/index.js +3 -7
- package/lib/ProEditTable/index.js +16 -19
- package/lib/ProEditTable/propsType.d.ts +6 -0
- package/lib/ProEditTable/utils/config.js +4 -5
- package/lib/ProEditTable/utils/index.js +3 -6
- package/lib/ProEditTable/utils/useShouldUpdateForTable.d.ts +15 -0
- package/lib/ProEditTable/utils/useShouldUpdateForTable.js +139 -0
- package/lib/ProEnum/index.js +10 -17
- package/lib/ProForm/components/Container.js +2 -3
- package/lib/ProForm/components/FormFooter/index.js +4 -7
- package/lib/ProForm/components/base/Checkbox/index.js +3 -4
- package/lib/ProForm/components/base/DatePicker/index.js +2 -3
- package/lib/ProForm/components/base/Input/index.js +2 -3
- package/lib/ProForm/components/base/InputNumber/index.js +3 -6
- package/lib/ProForm/components/base/Radio/index.js +3 -4
- package/lib/ProForm/components/base/RangePicker/index.js +2 -3
- package/lib/ProForm/components/base/Select/index.js +2 -3
- package/lib/ProForm/components/base/Switch/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/lib/ProForm/components/base/TextArea/index.js +2 -3
- package/lib/ProForm/components/base/TimePicker/index.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +8 -13
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +4 -7
- package/lib/ProForm/components/combination/FormList/components/Empty.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +4 -7
- package/lib/ProForm/components/combination/FormList/index.js +2 -3
- package/lib/ProForm/components/combination/Group/index.js +3 -4
- package/lib/ProForm/components/combination/Group/utils.js +3 -4
- package/lib/ProForm/components/combination/ProCascader/index.js +5 -10
- package/lib/ProForm/components/combination/ProModalSelect/index.js +9 -22
- package/lib/ProForm/components/combination/ProNumberRange/index.js +12 -19
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -9
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -9
- package/lib/ProForm/components/render/ChangedWrapper.js +5 -8
- package/lib/ProForm/components/render/ConfirmWrapper.js +3 -4
- package/lib/ProForm/components/render/Render.js +12 -19
- package/lib/ProForm/components/render/RenderFields.js +2 -1
- package/lib/ProForm/index.js +9 -16
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/utils/useForm.js +2 -3
- package/lib/ProForm/utils/useShouldUpdate.js +1 -2
- package/lib/ProIcon/index.js +6 -11
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +3 -6
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -3
- package/lib/ProLayout/components/ProCollapse/index.js +5 -10
- package/lib/ProLayout/components/ProFooter/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/index.js +15 -24
- package/lib/ProLayout/index.js +2 -3
- package/lib/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/lib/ProSelect/index.js +7 -14
- package/lib/ProStep/components/Anchor/index.js +2 -3
- package/lib/ProTable/components/FormatColumn/index.js +9 -10
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +2 -3
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +2 -3
- package/lib/ProTable/components/RenderColumn/index.js +10 -15
- package/lib/ProTable/components/RenderSummary/index.js +4 -6
- package/lib/ProTable/components/RenderTableHeader/index.js +3 -5
- package/lib/ProTable/components/RenderTabs/index.js +3 -6
- package/lib/ProTable/components/TooltipTitle/index.js +2 -3
- package/lib/ProTable/hooks/useAntdTable.js +3 -6
- package/lib/ProTabs/components/Card/index.js +5 -11
- package/lib/ProTabs/index.js +2 -3
- package/lib/ProTabs/style/index.less +5 -1
- package/lib/ProThemeTools/component/ProTools/index.js +12 -19
- package/lib/ProThemeTools/index.js +2 -3
- package/lib/ProTooltip/index.js +4 -5
- package/lib/ProTree/components/AdaptiveTooltip.js +2 -4
- package/lib/ProTree/components/List.js +3 -4
- package/lib/ProTree/components/ProTree.js +5 -12
- package/lib/ProTree/components/ProTreeSelect/index.js +9 -16
- package/lib/ProTree/components/Tree.js +3 -6
- package/lib/ProTreeModal/components/Cascader.js +3 -4
- package/lib/ProTreeModal/components/List.js +9 -14
- package/lib/ProTreeModal/components/SortableItem.js +2 -3
- package/lib/ProTreeModal/components/Tree.js +3 -4
- package/lib/ProTreeModal/components/Trigger.js +6 -11
- package/lib/ProTreeModal/index.js +9 -16
- package/lib/ProUpload/components/ButtonRender.js +3 -6
- package/lib/ProUpload/components/DragRender.js +2 -3
- package/lib/ProUpload/components/FileItem.js +10 -15
- package/lib/ProUpload/components/ImageRender.js +8 -17
- package/lib/ProUpload/index.js +3 -4
- package/lib/ProViewer/index.js +4 -9
- package/lib/ProViewer/propsType.js +3 -1
- package/lib/ProWaterMark/index.js +2 -3
- package/lib/utils/index.js +13 -1
- package/package.json +1 -2
package/es/ProEditTable/index.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import "antd/es/affix/style";
|
|
2
|
-
import _Affix from "antd/es/affix";
|
|
3
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
5
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
7
|
-
import "antd/es/config-provider/style";
|
|
8
|
-
import _ConfigProvider from "antd/es/config-provider";
|
|
9
|
-
import "antd/es/form/style";
|
|
10
|
-
import _Form from "antd/es/form";
|
|
11
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
6
|
var _excluded = ["value", "onChange", "onDrag", "onDragEnd", "className", "columns", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
|
13
7
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
14
8
|
import { get, isArray, isBoolean, isFunction, set } from 'lodash';
|
|
15
9
|
import { useLocalStorageState, useSetState } from 'ahooks';
|
|
10
|
+
import { ConfigProvider, Form, Affix } from 'antd';
|
|
16
11
|
import classnames from 'classnames';
|
|
17
12
|
import { transformColumns } from "./utils";
|
|
18
13
|
import { getRandom, getNamePath, handleScrollToError, onPageCheck } from "./utils/tools";
|
|
@@ -25,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
25
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
22
|
var ProEditTable = (_ref, ref) => {
|
|
28
|
-
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _resetProps$otherProp;
|
|
23
|
+
var _resetProps$id, _resetProps$id$split, _ref2, _formFieldProps$shoul, _themeConfig$data2, _resetProps$otherProp;
|
|
29
24
|
var _ref$value = _ref.value,
|
|
30
25
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
31
26
|
onChange = _ref.onChange,
|
|
@@ -73,11 +68,12 @@ var ProEditTable = (_ref, ref) => {
|
|
|
73
68
|
diffConfig = _ref.diffConfig,
|
|
74
69
|
resetProps = _objectWithoutProperties(_ref, _excluded);
|
|
75
70
|
// 上下文form
|
|
76
|
-
var contentForm =
|
|
71
|
+
var contentForm = Form.useFormInstance();
|
|
77
72
|
var formFieldProps = ProForm.useFieldProps() || {};
|
|
78
73
|
var affixRef = useRef(null);
|
|
79
74
|
var form = contentForm || (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.form) || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.form);
|
|
80
75
|
var name = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.name) || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.name) || (resetProps === null || resetProps === void 0 || (_resetProps$id = resetProps.id) === null || _resetProps$id === void 0 || (_resetProps$id$split = _resetProps$id.split) === null || _resetProps$id$split === void 0 ? void 0 : _resetProps$id$split.call(_resetProps$id, '_'));
|
|
76
|
+
var shouldUpdateDebounce = (_ref2 = (_formFieldProps$shoul = formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.shouldUpdateDebounce) !== null && _formFieldProps$shoul !== void 0 ? _formFieldProps$shoul : resetProps === null || resetProps === void 0 ? void 0 : resetProps.shouldUpdateDebounce) !== null && _ref2 !== void 0 ? _ref2 : 200;
|
|
81
77
|
var _formFieldProps$isVie = formFieldProps.isView,
|
|
82
78
|
isView = _formFieldProps$isVie === void 0 ? false : _formFieldProps$isVie,
|
|
83
79
|
_formFieldProps$viewE = formFieldProps.viewEmpty,
|
|
@@ -93,15 +89,15 @@ var ProEditTable = (_ref, ref) => {
|
|
|
93
89
|
// const valueChangeRef = useRef<number>(0);
|
|
94
90
|
// valueChangeRef.current = 0;
|
|
95
91
|
|
|
96
|
-
var _React$useContext = React.useContext(
|
|
92
|
+
var _React$useContext = React.useContext(ConfigProvider.ConfigContext),
|
|
97
93
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
98
94
|
var prefixCls = getPrefixCls();
|
|
99
95
|
var _useLocalStorageState = useLocalStorageState('themeConfig'),
|
|
100
96
|
_useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
|
|
101
97
|
themeConfig = _useLocalStorageState2[0];
|
|
102
98
|
var requiredAlign = useMemo(() => {
|
|
103
|
-
var
|
|
104
|
-
return (
|
|
99
|
+
var _ref3, _themeConfig$data$zau, _themeConfig$data;
|
|
100
|
+
return (_ref3 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 || (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref3 !== void 0 ? _ref3 : 'left';
|
|
105
101
|
}, [themeConfig === null || themeConfig === void 0 || (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign, configRequiredAlign]);
|
|
106
102
|
var _useSetState = useSetState({
|
|
107
103
|
cellNamePath: [],
|
|
@@ -143,8 +139,8 @@ var ProEditTable = (_ref, ref) => {
|
|
|
143
139
|
var getRowKey = useCallback(record => {
|
|
144
140
|
var key = record.rowKey || getRandom();
|
|
145
141
|
if (rowKey) {
|
|
146
|
-
var
|
|
147
|
-
key = (
|
|
142
|
+
var _ref4;
|
|
143
|
+
key = (_ref4 = isFunction(rowKey) ? rowKey(record) : record[rowKey]) !== null && _ref4 !== void 0 ? _ref4 : key;
|
|
148
144
|
}
|
|
149
145
|
return key;
|
|
150
146
|
}, [rowKey]);
|
|
@@ -179,7 +175,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
179
175
|
|
|
180
176
|
// 分页变更
|
|
181
177
|
var handlePageChange = useCallback( /*#__PURE__*/function () {
|
|
182
|
-
var
|
|
178
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(current, pageSize) {
|
|
183
179
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
184
180
|
while (1) switch (_context.prev = _context.next) {
|
|
185
181
|
case 0:
|
|
@@ -225,7 +221,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
225
221
|
}, _callee, null, [[0, 10]]);
|
|
226
222
|
}));
|
|
227
223
|
return function (_x, _x2) {
|
|
228
|
-
return
|
|
224
|
+
return _ref5.apply(this, arguments);
|
|
229
225
|
};
|
|
230
226
|
}(), [pagination, page.pageSize, form, name]);
|
|
231
227
|
var config = _objectSpread({
|
|
@@ -262,6 +258,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
262
258
|
rowDisabled,
|
|
263
259
|
actionDirection,
|
|
264
260
|
diffConfig: _objectSpread(_objectSpread({}, resetProps === null || resetProps === void 0 || (_resetProps$otherProp = resetProps.otherProps) === null || _resetProps$otherProp === void 0 ? void 0 : _resetProps$otherProp.diffConfig), diffConfig),
|
|
261
|
+
shouldUpdateDebounce,
|
|
265
262
|
getIsNew,
|
|
266
263
|
handlePageChange
|
|
267
264
|
}, resetProps);
|
|
@@ -322,7 +319,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
322
319
|
|
|
323
320
|
// 空列表状态
|
|
324
321
|
var emptyDom = useMemo(() => () => {
|
|
325
|
-
var _filter,
|
|
322
|
+
var _filter, _ref6;
|
|
326
323
|
return /*#__PURE__*/_jsxs("div", {
|
|
327
324
|
className: "com-empty",
|
|
328
325
|
children: [/*#__PURE__*/_jsx("img", {
|
|
@@ -333,7 +330,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
333
330
|
className: "content",
|
|
334
331
|
children: disabled || isForbiddenBtn('add') ? locale.ProEditTable.noData : /*#__PURE__*/_jsxs(_Fragment, {
|
|
335
332
|
children: [locale.ProEditTable.noData, "\uFF0C", /*#__PURE__*/_jsx(RenderToolbar, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
|
|
336
|
-
toolbarProps: toolbarProps === null || toolbarProps === void 0 || (_filter = (
|
|
333
|
+
toolbarProps: toolbarProps === null || toolbarProps === void 0 || (_filter = (_ref6 = toolbarProps).filter) === null || _filter === void 0 ? void 0 : _filter.call(_ref6, item => item.type === 'add' || (item === null || item === void 0 ? void 0 : item.persistence)),
|
|
337
334
|
dataSource: []
|
|
338
335
|
})))]
|
|
339
336
|
})
|
|
@@ -409,7 +406,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
409
406
|
}) : summary;
|
|
410
407
|
var TableComponent = draggable ? DraggableTable : BaseTable;
|
|
411
408
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
412
|
-
children: [/*#__PURE__*/_jsx(
|
|
409
|
+
children: [/*#__PURE__*/_jsx(ConfigProvider, {
|
|
413
410
|
renderEmpty: value !== null && value !== void 0 && value.length ? undefined : emptyDom,
|
|
414
411
|
children: /*#__PURE__*/_jsx(TableComponent, _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
415
412
|
draggableProps: {
|
|
@@ -441,7 +438,7 @@ var ProEditTable = (_ref, ref) => {
|
|
|
441
438
|
handlePageChange
|
|
442
439
|
}
|
|
443
440
|
}))
|
|
444
|
-
}), !isView && value !== null && value !== void 0 && value.length ? toolbarSticky ? /*#__PURE__*/_jsx(
|
|
441
|
+
}), !isView && value !== null && value !== void 0 && value.length ? toolbarSticky ? /*#__PURE__*/_jsx(Affix, _objectSpread(_objectSpread({
|
|
445
442
|
ref: affixRef
|
|
446
443
|
}, _toolbarSticky), {}, {
|
|
447
444
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -402,6 +402,12 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
|
|
|
402
402
|
/** 是否跟随父元素滚动 */
|
|
403
403
|
scrollFollowParent?: boolean;
|
|
404
404
|
};
|
|
405
|
+
/**
|
|
406
|
+
* 动态属性更新防抖时间(毫秒)
|
|
407
|
+
* 用于优化表格编辑时的性能,对 fieldProps、desensitization, required、rules、isEditable, valueType 等属性进行防抖处理, 当设置为 0 时禁用防抖,所有属性立即响应
|
|
408
|
+
* @default 200
|
|
409
|
+
*/
|
|
410
|
+
shouldUpdateDebounce?: number;
|
|
405
411
|
}
|
|
406
412
|
/**
|
|
407
413
|
* 基础操作按钮类型(基于接口)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
import "antd/es/message/style";
|
|
5
|
-
import _message from "antd/es/message";
|
|
6
4
|
import { PlusOutlined } from '@ant-design/icons';
|
|
7
5
|
import { tools } from '@zat-design/utils';
|
|
6
|
+
import { message } from 'antd';
|
|
8
7
|
import { set } from 'lodash';
|
|
9
8
|
import { onDelete, getRandom } from "./tools";
|
|
10
9
|
import locale from "../../locale";
|
|
@@ -46,7 +45,7 @@ export var actions = {
|
|
|
46
45
|
onlyOneLineMsg = _ref.onlyOneLineMsg;
|
|
47
46
|
// 单行编辑时,需要先保存,才能进行下面的编辑
|
|
48
47
|
if (virtualKey && editingKeys.length >= 1) {
|
|
49
|
-
|
|
48
|
+
message.warning(onlyOneLineMsg);
|
|
50
49
|
return false;
|
|
51
50
|
}
|
|
52
51
|
var nextEditingKeys = [...editingKeys];
|
|
@@ -143,7 +142,7 @@ export var actions = {
|
|
|
143
142
|
onlyOneLineMsg = _ref4.onlyOneLineMsg;
|
|
144
143
|
// 单行编辑时,需要先保存,才能进行下面的编辑
|
|
145
144
|
if (virtualKey && editingKeys.length >= 1) {
|
|
146
|
-
|
|
145
|
+
message.warning(onlyOneLineMsg);
|
|
147
146
|
return false;
|
|
148
147
|
}
|
|
149
148
|
// 删除当前行数据
|
|
@@ -174,7 +173,7 @@ export var actions = {
|
|
|
174
173
|
_context4.next = 5;
|
|
175
174
|
break;
|
|
176
175
|
}
|
|
177
|
-
|
|
176
|
+
message.warning(onlyOneLineMsg);
|
|
178
177
|
return _context4.abrupt("return", false);
|
|
179
178
|
case 5:
|
|
180
179
|
rowKey = getRandom(); // 添加新增对象数据
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "antd/es/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/es/tooltip";
|
|
3
|
-
import "antd/es/space/style";
|
|
4
|
-
import _Space from "antd/es/space";
|
|
5
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
6
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
@@ -10,6 +6,7 @@ var _excluded = ["type", "label", "show", "needConfirm", "onHandle", "onClick"],
|
|
|
10
6
|
_excluded2 = ["title", "icon"];
|
|
11
7
|
import React from 'react';
|
|
12
8
|
import { cloneDeepWith, isArray, isBoolean, isEqual, isFunction } from 'lodash';
|
|
9
|
+
import { Tooltip, Space } from 'antd';
|
|
13
10
|
import classnames from 'classnames';
|
|
14
11
|
import { ReactSVG } from 'react-svg';
|
|
15
12
|
import { tools } from '@zat-design/utils';
|
|
@@ -165,7 +162,7 @@ var getActionColumn = config => {
|
|
|
165
162
|
if (_disabled) {
|
|
166
163
|
return '';
|
|
167
164
|
}
|
|
168
|
-
return /*#__PURE__*/_jsx(
|
|
165
|
+
return /*#__PURE__*/_jsx(Space, {
|
|
169
166
|
size: "small",
|
|
170
167
|
direction: actionDirection,
|
|
171
168
|
children: actionBtns.map(btnConfig => {
|
|
@@ -237,7 +234,7 @@ export var transformColumns = function transformColumns() {
|
|
|
237
234
|
resetProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
238
235
|
item.title = /*#__PURE__*/_jsxs("span", {
|
|
239
236
|
className: "pro-edit-table-title pro-edit-table-tooltip",
|
|
240
|
-
children: [before, columnTitle, /*#__PURE__*/_jsx(
|
|
237
|
+
children: [before, columnTitle, /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
241
238
|
title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
|
|
242
239
|
}, resetProps), {}, {
|
|
243
240
|
children: icon ? ( /*#__PURE__*/React.cloneElement(icon, {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface UseShouldUpdateForTableProps {
|
|
2
|
+
rowParams: any[];
|
|
3
|
+
column: any;
|
|
4
|
+
shouldUpdateDebounce: number;
|
|
5
|
+
}
|
|
6
|
+
interface Result {
|
|
7
|
+
isEditable: any;
|
|
8
|
+
required: any;
|
|
9
|
+
rules: any;
|
|
10
|
+
fieldProps: any;
|
|
11
|
+
desensitization: any;
|
|
12
|
+
valueType: any;
|
|
13
|
+
}
|
|
14
|
+
declare const useShouldUpdateForTable: (props: UseShouldUpdateForTableProps) => Result;
|
|
15
|
+
export default useShouldUpdateForTable;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { isFunction, isEqualWith, debounce } from 'lodash';
|
|
4
|
+
import { customEqualForFunction } from "../../utils";
|
|
5
|
+
var useShouldUpdateForTable = props => {
|
|
6
|
+
var _isEditableRef$curren, _requiredRef$current, _rulesRef$current, _fieldPropsRef$curren, _desensitizationRef$c, _valueTypeRef$current;
|
|
7
|
+
var rowParams = props.rowParams,
|
|
8
|
+
column = props.column,
|
|
9
|
+
shouldUpdateDebounce = props.shouldUpdateDebounce;
|
|
10
|
+
|
|
11
|
+
// refs 存储当前值
|
|
12
|
+
var isEditableRef = useRef();
|
|
13
|
+
var requiredRef = useRef();
|
|
14
|
+
var rulesRef = useRef();
|
|
15
|
+
var fieldPropsRef = useRef();
|
|
16
|
+
var desensitizationRef = useRef();
|
|
17
|
+
var valueTypeRef = useRef();
|
|
18
|
+
var _useState = useState({}),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
reRender = _useState2[1];
|
|
21
|
+
var debouncedUpdateRef = useRef(null);
|
|
22
|
+
var pendingParamsRef = useRef(null);
|
|
23
|
+
|
|
24
|
+
// 统一处理所有动态属性的更新
|
|
25
|
+
var processUpdate = params => {
|
|
26
|
+
var hasChange = false;
|
|
27
|
+
|
|
28
|
+
// isEditable 处理
|
|
29
|
+
if (isFunction(column.isEditable)) {
|
|
30
|
+
var newIsEditable = column.isEditable(...params);
|
|
31
|
+
if (isEditableRef.current !== newIsEditable) {
|
|
32
|
+
isEditableRef.current = newIsEditable;
|
|
33
|
+
hasChange = true;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
isEditableRef.current = column.isEditable;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// required 处理
|
|
40
|
+
if (isFunction(column.required)) {
|
|
41
|
+
var newRequired = column.required(...params);
|
|
42
|
+
if (requiredRef.current !== newRequired) {
|
|
43
|
+
requiredRef.current = newRequired;
|
|
44
|
+
hasChange = true;
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
requiredRef.current = column.required;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// rules 处理
|
|
51
|
+
if (isFunction(column.rules)) {
|
|
52
|
+
var newRules = column.rules(...params);
|
|
53
|
+
if (!isEqualWith(rulesRef.current, newRules, customEqualForFunction)) {
|
|
54
|
+
rulesRef.current = newRules;
|
|
55
|
+
hasChange = true;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
rulesRef.current = column.rules;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// fieldProps 处理
|
|
62
|
+
if (isFunction(column.fieldProps)) {
|
|
63
|
+
var newFieldProps = column.fieldProps(...params);
|
|
64
|
+
if (!isEqualWith(fieldPropsRef.current, newFieldProps, customEqualForFunction)) {
|
|
65
|
+
fieldPropsRef.current = newFieldProps;
|
|
66
|
+
hasChange = true;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
fieldPropsRef.current = column.fieldProps;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// desensitization 处理
|
|
73
|
+
if (isFunction(column.desensitization)) {
|
|
74
|
+
var newDesensitization = column.desensitization(...params);
|
|
75
|
+
if (!isEqualWith(desensitizationRef.current, newDesensitization)) {
|
|
76
|
+
desensitizationRef.current = newDesensitization;
|
|
77
|
+
hasChange = true;
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
desensitizationRef.current = column.desensitization;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// valueType 处理
|
|
84
|
+
if (isFunction(column.valueType)) {
|
|
85
|
+
var newValueType = column.valueType(...params);
|
|
86
|
+
if (valueTypeRef.current !== newValueType) {
|
|
87
|
+
valueTypeRef.current = newValueType;
|
|
88
|
+
hasChange = true;
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
valueTypeRef.current = column.valueType;
|
|
92
|
+
}
|
|
93
|
+
if (hasChange) {
|
|
94
|
+
reRender({});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// 创建防抖函数(统一处理所有动态属性)
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (shouldUpdateDebounce > 0 && (isFunction(column.isEditable) || isFunction(column.required) || isFunction(column.rules) || isFunction(column.fieldProps) || isFunction(column.desensitization) || isFunction(column.valueType))) {
|
|
101
|
+
debouncedUpdateRef.current = debounce(() => {
|
|
102
|
+
if (pendingParamsRef.current) {
|
|
103
|
+
processUpdate(pendingParamsRef.current);
|
|
104
|
+
pendingParamsRef.current = null;
|
|
105
|
+
}
|
|
106
|
+
}, shouldUpdateDebounce);
|
|
107
|
+
}
|
|
108
|
+
return () => {
|
|
109
|
+
var _debouncedUpdateRef$c;
|
|
110
|
+
(_debouncedUpdateRef$c = debouncedUpdateRef.current) === null || _debouncedUpdateRef$c === void 0 || _debouncedUpdateRef$c.cancel();
|
|
111
|
+
};
|
|
112
|
+
}, [shouldUpdateDebounce, column]);
|
|
113
|
+
|
|
114
|
+
// 统一的属性处理逻辑
|
|
115
|
+
if (shouldUpdateDebounce > 0 && debouncedUpdateRef.current) {
|
|
116
|
+
// 使用防抖延迟更新
|
|
117
|
+
pendingParamsRef.current = rowParams;
|
|
118
|
+
debouncedUpdateRef.current();
|
|
119
|
+
} else {
|
|
120
|
+
// 立即更新(shouldUpdateDebounce = 0 或无防抖函数)
|
|
121
|
+
processUpdate(rowParams);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
isEditable: (_isEditableRef$curren = isEditableRef.current) !== null && _isEditableRef$curren !== void 0 ? _isEditableRef$curren : column.isEditable,
|
|
125
|
+
required: (_requiredRef$current = requiredRef.current) !== null && _requiredRef$current !== void 0 ? _requiredRef$current : column.required,
|
|
126
|
+
rules: (_rulesRef$current = rulesRef.current) !== null && _rulesRef$current !== void 0 ? _rulesRef$current : column.rules,
|
|
127
|
+
fieldProps: (_fieldPropsRef$curren = fieldPropsRef.current) !== null && _fieldPropsRef$curren !== void 0 ? _fieldPropsRef$curren : column.fieldProps,
|
|
128
|
+
desensitization: (_desensitizationRef$c = desensitizationRef.current) !== null && _desensitizationRef$c !== void 0 ? _desensitizationRef$c : column.desensitization,
|
|
129
|
+
valueType: (_valueTypeRef$current = valueTypeRef.current) !== null && _valueTypeRef$current !== void 0 ? _valueTypeRef$current : column.valueType
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export default useShouldUpdateForTable;
|
package/es/ProEnum/index.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import "antd/es/space/style";
|
|
2
|
-
import _Space from "antd/es/space";
|
|
3
|
-
import "antd/es/checkbox/style";
|
|
4
|
-
import _Checkbox from "antd/es/checkbox";
|
|
5
|
-
import "antd/es/radio/style";
|
|
6
|
-
import _Radio from "antd/es/radio";
|
|
7
|
-
import "antd/es/message/style";
|
|
8
|
-
import _message from "antd/es/message";
|
|
9
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
10
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
11
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
4
|
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
|
13
5
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
|
14
6
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
|
7
|
+
import { message, Radio, Checkbox, Space } from 'antd';
|
|
15
8
|
import React, { useState, useEffect, useMemo } from 'react';
|
|
16
9
|
import { cloneDeep, isFunction, isString, isArray, omit, isNumber } from 'lodash';
|
|
17
10
|
import ProSelect from "../ProSelect";
|
|
@@ -97,7 +90,7 @@ var ProEnum = props => {
|
|
|
97
90
|
var responseData = transformResponse(res);
|
|
98
91
|
if (typeof responseData !== 'object') {
|
|
99
92
|
var _locale$ProEnum;
|
|
100
|
-
return
|
|
93
|
+
return message.error((_locale$ProEnum = locale.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorMessage);
|
|
101
94
|
}
|
|
102
95
|
setData(responseData);
|
|
103
96
|
} else {
|
|
@@ -108,7 +101,7 @@ var ProEnum = props => {
|
|
|
108
101
|
if (status === 200) {
|
|
109
102
|
if (typeof data !== 'object') {
|
|
110
103
|
var _locale$ProEnum2;
|
|
111
|
-
return
|
|
104
|
+
return message.error((_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
|
112
105
|
}
|
|
113
106
|
if (Array.isArray(data)) {
|
|
114
107
|
setData([...data]);
|
|
@@ -117,7 +110,7 @@ var ProEnum = props => {
|
|
|
117
110
|
setData(data[code]);
|
|
118
111
|
}
|
|
119
112
|
} else {
|
|
120
|
-
|
|
113
|
+
message.error(msg);
|
|
121
114
|
}
|
|
122
115
|
}
|
|
123
116
|
}
|
|
@@ -184,22 +177,22 @@ var ProEnum = props => {
|
|
|
184
177
|
onChange: onChange
|
|
185
178
|
}));
|
|
186
179
|
case 'Radio':
|
|
187
|
-
return /*#__PURE__*/_jsx(
|
|
180
|
+
return /*#__PURE__*/_jsx(Radio.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
|
188
181
|
options: list,
|
|
189
182
|
value: value,
|
|
190
183
|
onChange: onChange,
|
|
191
|
-
children: list.map(item => /*#__PURE__*/_jsx(
|
|
184
|
+
children: list.map(item => /*#__PURE__*/_jsx(Radio, {
|
|
192
185
|
value: item[fieldValue],
|
|
193
186
|
disabled: !!item.disabled,
|
|
194
187
|
children: item[label]
|
|
195
188
|
}, item[fieldValue]))
|
|
196
189
|
}));
|
|
197
190
|
case 'Checkbox':
|
|
198
|
-
return /*#__PURE__*/_jsx(
|
|
191
|
+
return /*#__PURE__*/_jsx(Checkbox.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
|
199
192
|
options: list,
|
|
200
193
|
value: value,
|
|
201
194
|
onChange: onChange,
|
|
202
|
-
children: list.map(item => /*#__PURE__*/_jsx(
|
|
195
|
+
children: list.map(item => /*#__PURE__*/_jsx(Checkbox, {
|
|
203
196
|
value: item[fieldValue],
|
|
204
197
|
disabled: !!item.disabled,
|
|
205
198
|
children: item[label]
|
|
@@ -228,7 +221,7 @@ var ProEnum = props => {
|
|
|
228
221
|
};
|
|
229
222
|
if (!code && !dataSource && !useRequest) {
|
|
230
223
|
var _locale$ProEnum4;
|
|
231
|
-
|
|
224
|
+
message.error(`${otherProps === null || otherProps === void 0 ? void 0 : otherProps.label}-${otherProps === null || otherProps === void 0 ? void 0 : otherProps.name}-${locale === null || locale === void 0 || (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType}`);
|
|
232
225
|
}
|
|
233
226
|
var transToLabel = value => {
|
|
234
227
|
var list = dataList && dataList.length ? dataList : enumLists;
|
|
@@ -261,7 +254,7 @@ var ProEnum = props => {
|
|
|
261
254
|
record.forEach(item => {
|
|
262
255
|
arr.push(props.optionRender(item));
|
|
263
256
|
});
|
|
264
|
-
return /*#__PURE__*/_jsx(
|
|
257
|
+
return /*#__PURE__*/_jsx(Space, {
|
|
265
258
|
direction: "vertical",
|
|
266
259
|
size: 4,
|
|
267
260
|
children: arr.map(item => /*#__PURE__*/_jsx(React.Fragment, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import "antd/es/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/es/tooltip";
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { Tooltip } from 'antd';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { isEmptyArray } from "../utils";
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,7 +16,7 @@ var Container = props => {
|
|
|
17
16
|
'pro-form-view-container_nowrap': nowrap !== null && nowrap !== void 0 ? nowrap : tooltip
|
|
18
17
|
});
|
|
19
18
|
if (tooltip && !nullValue) {
|
|
20
|
-
return /*#__PURE__*/_jsx(
|
|
19
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
21
20
|
placement: "topLeft",
|
|
22
21
|
title: children,
|
|
23
22
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import "antd/es/space/style";
|
|
2
|
-
import _Space from "antd/es/space";
|
|
3
|
-
import "antd/es/button/style";
|
|
4
|
-
import _Button from "antd/es/button";
|
|
5
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { Space, Button } from 'antd';
|
|
6
3
|
import React, { useEffect, useMemo } from 'react';
|
|
7
4
|
import { useProConfig } from "../../../ProConfigProvider";
|
|
8
5
|
import locale from "../../../locale";
|
|
@@ -70,8 +67,8 @@ var FormFooter = props => {
|
|
|
70
67
|
}
|
|
71
68
|
onCancel();
|
|
72
69
|
};
|
|
73
|
-
return /*#__PURE__*/_jsxs(
|
|
74
|
-
children: [/*#__PURE__*/_jsx(
|
|
70
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
71
|
+
children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
75
72
|
type: "primary",
|
|
76
73
|
htmlType: onOk ? 'button' : 'submit',
|
|
77
74
|
onClick: nextOnOk,
|
|
@@ -79,7 +76,7 @@ var FormFooter = props => {
|
|
|
79
76
|
loading: confirmLoading
|
|
80
77
|
}, okButtonProps), {}, {
|
|
81
78
|
children: okChildren || okText || `${locale.ProForm.search}`
|
|
82
|
-
})), /*#__PURE__*/_jsx(
|
|
79
|
+
})), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
83
80
|
onClick: nextOnCancel
|
|
84
81
|
}, cancelButtonProps), {}, {
|
|
85
82
|
children: cancelChildren || cancelText || `${locale.ProForm.reset}`
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import "antd/es/checkbox/style";
|
|
3
|
-
import _Checkbox from "antd/es/checkbox";
|
|
4
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
3
|
var _excluded = ["dataSource", "otherProps", "fieldNames"];
|
|
6
4
|
import React from 'react';
|
|
5
|
+
import { Checkbox as AntCheckbox } from 'antd';
|
|
7
6
|
import Container from "../../Container";
|
|
8
7
|
import { useProConfig } from "../../../../ProConfigProvider";
|
|
9
8
|
import ProForm from "../../../index";
|
|
@@ -59,13 +58,13 @@ var Checkbox = props => {
|
|
|
59
58
|
};
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
|
-
return /*#__PURE__*/_jsx(
|
|
61
|
+
return /*#__PURE__*/_jsx(AntCheckbox.Group, _objectSpread(_objectSpread({
|
|
63
62
|
style: {
|
|
64
63
|
width: '100%'
|
|
65
64
|
}
|
|
66
65
|
}, rest), {}, {
|
|
67
66
|
children: !!dataSource.length && dataSource.map(item => {
|
|
68
|
-
return /*#__PURE__*/_createElement(
|
|
67
|
+
return /*#__PURE__*/_createElement(AntCheckbox, _objectSpread(_objectSpread({}, item), {}, {
|
|
69
68
|
key: item[_fieldNames.value],
|
|
70
69
|
value: item[_fieldNames.value]
|
|
71
70
|
}), item[_fieldNames.label]);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "antd/es/date-picker/style";
|
|
2
|
-
import _DatePicker from "antd/es/date-picker";
|
|
3
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
3
|
var _excluded = ["className", "format"];
|
|
4
|
+
import { DatePicker as AntDatePicker } from 'antd';
|
|
6
5
|
import { isFunction, isString, isObject, omit } from 'lodash';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import dayjs from 'dayjs';
|
|
@@ -63,7 +62,7 @@ var DatePicker = props => {
|
|
|
63
62
|
if (isString(restProps.value)) {
|
|
64
63
|
restProps.value = dayjs(restProps.value);
|
|
65
64
|
}
|
|
66
|
-
return /*#__PURE__*/_jsx(
|
|
65
|
+
return /*#__PURE__*/_jsx(AntDatePicker, _objectSpread(_objectSpread(_objectSpread({}, initialConfig), {}, {
|
|
67
66
|
format: nextFormat
|
|
68
67
|
}, omit(restProps, ['otherProps'])), {}, {
|
|
69
68
|
className: nextClassName
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import "antd/es/input/style";
|
|
3
|
-
import _Input from "antd/es/input";
|
|
4
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
3
|
var _excluded = ["label", "form", "placeholder", "fieldName", "otherProps", "desensitization"];
|
|
6
4
|
import React from 'react';
|
|
5
|
+
import { Input as AntInput } from 'antd';
|
|
7
6
|
import { isFunction, omit } from 'lodash';
|
|
8
7
|
import { useProConfig } from "../../../../ProConfigProvider";
|
|
9
8
|
import Container from "../../Container";
|
|
@@ -47,7 +46,7 @@ var Input = function Input(props) {
|
|
|
47
46
|
children: rest.value
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
|
-
var ComInput = /*#__PURE__*/_jsx(
|
|
49
|
+
var ComInput = /*#__PURE__*/_jsx(AntInput, _objectSpread(_objectSpread({
|
|
51
50
|
autoComplete: "off",
|
|
52
51
|
placeholder: placeholder || `${locale.ProForm.inputPlaceholder}`
|
|
53
52
|
}, omit(initialConfig, ['trim', 'upperCase'])), rest));
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import "antd/es/input-number/style";
|
|
3
|
-
import _InputNumber from "antd/es/input-number";
|
|
4
|
-
import "antd/es/space/style";
|
|
5
|
-
import _Space from "antd/es/space";
|
|
6
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
7
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
4
|
var _excluded = ["placeholder", "className", "otherProps", "range", "min", "max", "onBlur", "onFocus"];
|
|
9
5
|
import React, { useMemo, useRef } from 'react';
|
|
6
|
+
import { InputNumber as AntInputNumber, Space } from 'antd';
|
|
10
7
|
import classNames from 'classnames';
|
|
11
8
|
import Big from 'big.js';
|
|
12
9
|
import { tools } from '@zat-design/utils';
|
|
@@ -231,7 +228,7 @@ var InputNumber = props => {
|
|
|
231
228
|
case 'thousandthCNY':
|
|
232
229
|
return /*#__PURE__*/_jsx(Container, {
|
|
233
230
|
viewEmpty: viewEmpty,
|
|
234
|
-
children: /*#__PURE__*/_jsxs(
|
|
231
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
235
232
|
size: 4,
|
|
236
233
|
children: [_value || _value === 0 ? 'CNY' : '', tools.formatAmount(_value, precision)]
|
|
237
234
|
})
|
|
@@ -289,7 +286,7 @@ var InputNumber = props => {
|
|
|
289
286
|
activateRef.current = true;
|
|
290
287
|
onFocus === null || onFocus === void 0 || onFocus(e);
|
|
291
288
|
};
|
|
292
|
-
return /*#__PURE__*/_jsx(
|
|
289
|
+
return /*#__PURE__*/_jsx(AntInputNumber, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
293
290
|
autoComplete: "off",
|
|
294
291
|
placeholder: placeholder || `${locale.ProForm.inputPlaceholder}${label !== null && label !== void 0 ? label : ''}`,
|
|
295
292
|
className: _className
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import "antd/es/radio/style";
|
|
3
|
-
import _Radio from "antd/es/radio";
|
|
4
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
3
|
var _excluded = ["dataSource", "fieldNames", "onChange", "value", "otherProps"];
|
|
4
|
+
import { Radio as AntRadio } from 'antd';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
import { useProConfig } from "../../../../ProConfigProvider";
|
|
8
7
|
import Container from "../../Container";
|
|
@@ -51,13 +50,13 @@ var Radio = props => {
|
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
return /*#__PURE__*/_jsx(
|
|
53
|
+
return /*#__PURE__*/_jsx(AntRadio.Group, _objectSpread(_objectSpread({}, rest), {}, {
|
|
55
54
|
value: value,
|
|
56
55
|
onChange: e => {
|
|
57
56
|
_onChange(e, e.target.value);
|
|
58
57
|
},
|
|
59
58
|
children: !!(dataSource !== null && dataSource !== void 0 && dataSource.length) && dataSource.map(radioItem => {
|
|
60
|
-
return /*#__PURE__*/_jsx(
|
|
59
|
+
return /*#__PURE__*/_jsx(AntRadio, {
|
|
61
60
|
value: radioItem[_fieldNames.value],
|
|
62
61
|
children: radioItem[_fieldNames.label]
|
|
63
62
|
}, radioItem[_fieldNames.value]);
|