@zat-design/sisyphus-react 3.2.1 → 3.2.2-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/README.md +7 -0
- package/dist/index.esm.css +106 -39
- package/es/ProAction/index.less +3 -0
- package/es/ProDownload/index.js +9 -6
- package/es/ProDownload/style/index.less +5 -2
- package/es/ProDrawerForm/style/index.less +76 -73
- package/es/ProEditLabel/style/index.less +12 -9
- package/es/ProEditTable/components/RenderField/index.js +66 -21
- package/es/ProEditTable/index.js +18 -7
- package/es/ProEditTable/propsType.d.ts +11 -1
- package/es/ProEditTable/style/index.less +50 -42
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +3 -3
- package/es/ProEnum/style/index.less +3 -0
- package/es/ProForm/components/base/Checkbox/index.d.ts +1 -0
- package/es/ProForm/components/base/Checkbox/index.js +5 -3
- package/es/ProForm/components/base/DatePicker/index.js +3 -5
- package/es/ProForm/components/base/Input/index.js +4 -2
- package/es/ProForm/components/base/Input/propsType.d.ts +1 -0
- package/es/ProForm/components/base/InputNumber/index.d.ts +1 -0
- package/es/ProForm/components/base/InputNumber/index.js +5 -3
- package/es/ProForm/components/base/ProCascader/index.js +6 -6
- package/es/ProForm/components/base/Radio/index.d.ts +1 -0
- package/es/ProForm/components/base/Radio/index.js +4 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +1 -0
- package/es/ProForm/components/base/RangePicker/index.js +5 -3
- package/es/ProForm/components/base/Select/index.d.ts +1 -0
- package/es/ProForm/components/base/Select/index.js +4 -2
- package/es/ProForm/components/base/Switch/index.d.ts +1 -0
- package/es/ProForm/components/base/Switch/index.js +4 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
- package/es/ProForm/components/base/SwitchCheckbox/index.js +4 -2
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/es/ProForm/components/base/TextArea/index.js +4 -3
- package/es/ProForm/components/base/TextArea/index.less +4 -3
- package/es/ProForm/components/base/TimePicker/index.d.ts +1 -0
- package/es/ProForm/components/base/TimePicker/index.js +4 -2
- package/es/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/es/ProForm/components/combination/Container/index.js +7 -5
- package/es/ProForm/components/combination/Container/style/index.less +3 -3
- package/es/ProForm/components/combination/FormList/index.js +6 -5
- package/es/ProForm/components/combination/FormList/style/index.less +17 -24
- package/es/ProForm/components/combination/Group/index.js +6 -3
- package/es/ProForm/components/combination/Group/style/index.less +15 -15
- package/es/ProForm/components/combination/ProAddressBar/index.js +29 -30
- package/es/ProForm/components/combination/ProAddressBar/style/index.less +3 -3
- package/es/ProForm/components/combination/ProCombination/index.js +11 -11
- package/es/ProForm/components/combination/ProCombination/style/index.less +2 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +4 -5
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +30 -12
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +7 -7
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +10 -10
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -2
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +6 -6
- package/es/ProForm/components/render/Render.js +54 -20
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +13 -12
- package/es/ProForm/index.js +5 -2
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +89 -80
- package/es/ProForm/utils/contrastOriginal.d.ts +10 -1
- package/es/ProForm/utils/contrastOriginal.js +15 -18
- package/es/ProForm/utils/useChanged.d.ts +15 -1
- package/es/ProForm/utils/useChanged.js +27 -8
- package/es/ProIcon/style/index.less +4 -1
- package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +7 -7
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +28 -28
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +11 -11
- package/es/ProLayout/components/ProCollapse/style/index.less +24 -24
- package/es/ProLayout/components/ProFooter/style/index.less +8 -7
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +1 -1
- package/es/ProLayout/components/ProHeader/index.js +1 -0
- package/es/ProLayout/components/ProHeader/style/index.less +17 -11
- package/es/ProLayout/style/index.less +10 -7
- package/es/ProSelect/index.js +6 -3
- package/es/ProSelect/index.less +3 -0
- package/es/ProStep/components/Item/index.js +1 -4
- package/es/ProStep/style/index.less +3 -0
- package/es/ProTable/components/RenderColumn/index.js +1 -1
- package/es/ProTable/index.js +3 -3
- package/es/ProTable/style/index.less +72 -52
- package/es/ProTabs/style/index.less +26 -24
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +28 -26
- package/es/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.js +9 -3
- package/es/ProThemeTools/propsType.d.ts +4 -0
- package/es/ProThemeTools/style/index.less +6 -3
- package/es/ProThemeTools/utils/index.d.ts +1 -1
- package/es/ProThemeTools/utils/index.js +2 -1
- package/es/ProTooltip/style/index.less +3 -0
- package/es/ProTree/components/CloseIcon.js +2 -4
- package/es/ProTree/components/Tree.js +43 -42
- package/es/ProTree/style/index.less +29 -32
- package/es/ProTreeModal/components/CloseIcon.js +2 -4
- package/es/ProTreeModal/components/Trigger.d.ts +3 -0
- package/es/ProTreeModal/components/Trigger.js +79 -19
- package/es/ProTreeModal/index.js +38 -6
- package/es/ProTreeModal/propsType.d.ts +5 -2
- package/es/ProTreeModal/style/index.less +11 -8
- package/es/ProTreeSelect/index.js +3 -2
- package/es/ProTreeSelect/style/index.less +25 -22
- package/es/ProUpload/components/DragRender.js +7 -4
- package/es/ProUpload/index.js +11 -7
- package/es/ProUpload/style/index.less +7 -4
- package/es/ProViewer/index.js +3 -1
- package/es/ProViewer/style/index.less +6 -3
- package/es/locale/en_US.d.ts +18 -1
- package/es/locale/en_US.js +20 -3
- package/es/locale/zh_CN.d.ts +18 -1
- package/es/locale/zh_CN.js +19 -2
- package/es/style/core/compatible.less +6 -6
- package/es/style/theme/antd.less +277 -253
- package/lib/ProAction/index.less +3 -0
- package/lib/ProDownload/index.js +9 -6
- package/lib/ProDownload/style/index.less +5 -2
- package/lib/ProDrawerForm/style/index.less +76 -73
- package/lib/ProEditLabel/style/index.less +12 -9
- package/lib/ProEditTable/components/RenderField/index.js +61 -20
- package/lib/ProEditTable/index.js +17 -5
- package/lib/ProEditTable/propsType.d.ts +11 -1
- package/lib/ProEditTable/style/index.less +50 -42
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +3 -3
- package/lib/ProEnum/style/index.less +3 -0
- package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -0
- package/lib/ProForm/components/base/Checkbox/index.js +5 -3
- package/lib/ProForm/components/base/DatePicker/index.js +3 -5
- package/lib/ProForm/components/base/Input/index.js +4 -2
- package/lib/ProForm/components/base/Input/propsType.d.ts +1 -0
- package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -0
- package/lib/ProForm/components/base/InputNumber/index.js +5 -3
- package/lib/ProForm/components/base/ProCascader/index.js +6 -6
- package/lib/ProForm/components/base/Radio/index.d.ts +1 -0
- package/lib/ProForm/components/base/Radio/index.js +4 -2
- package/lib/ProForm/components/base/RangePicker/index.d.ts +1 -0
- package/lib/ProForm/components/base/RangePicker/index.js +5 -3
- package/lib/ProForm/components/base/Select/index.d.ts +1 -0
- package/lib/ProForm/components/base/Select/index.js +4 -2
- package/lib/ProForm/components/base/Switch/index.d.ts +1 -0
- package/lib/ProForm/components/base/Switch/index.js +4 -2
- package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +4 -2
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/lib/ProForm/components/base/TextArea/index.js +4 -3
- package/lib/ProForm/components/base/TextArea/index.less +4 -3
- package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -0
- package/lib/ProForm/components/base/TimePicker/index.js +4 -2
- package/lib/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/lib/ProForm/components/combination/Container/index.js +7 -5
- package/lib/ProForm/components/combination/Container/style/index.less +3 -3
- package/lib/ProForm/components/combination/FormList/index.js +6 -5
- package/lib/ProForm/components/combination/FormList/style/index.less +17 -24
- package/lib/ProForm/components/combination/Group/index.js +6 -3
- package/lib/ProForm/components/combination/Group/style/index.less +15 -15
- package/lib/ProForm/components/combination/ProAddressBar/index.js +29 -30
- package/lib/ProForm/components/combination/ProAddressBar/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProCombination/index.js +11 -11
- package/lib/ProForm/components/combination/ProCombination/style/index.less +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +4 -5
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +30 -12
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProNumberRange/index.js +7 -7
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +10 -10
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -2
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +6 -6
- package/lib/ProForm/components/render/Render.js +53 -21
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +13 -12
- package/lib/ProForm/index.js +5 -2
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +89 -80
- package/lib/ProForm/utils/contrastOriginal.d.ts +10 -1
- package/lib/ProForm/utils/contrastOriginal.js +14 -17
- package/lib/ProForm/utils/useChanged.d.ts +15 -1
- package/lib/ProForm/utils/useChanged.js +27 -8
- package/lib/ProIcon/style/index.less +4 -1
- package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +7 -7
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +28 -28
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +11 -11
- package/lib/ProLayout/components/ProCollapse/style/index.less +24 -24
- package/lib/ProLayout/components/ProFooter/style/index.less +8 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +1 -1
- package/lib/ProLayout/components/ProHeader/index.js +1 -0
- package/lib/ProLayout/components/ProHeader/style/index.less +17 -11
- package/lib/ProLayout/style/index.less +10 -7
- package/lib/ProSelect/index.js +6 -3
- package/lib/ProSelect/index.less +3 -0
- package/lib/ProStep/components/Item/index.js +1 -4
- package/lib/ProStep/style/index.less +3 -0
- package/lib/ProTable/components/RenderColumn/index.js +1 -1
- package/lib/ProTable/index.js +3 -3
- package/lib/ProTable/style/index.less +72 -52
- package/lib/ProTabs/style/index.less +26 -24
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +28 -26
- package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.js +9 -3
- package/lib/ProThemeTools/propsType.d.ts +4 -0
- package/lib/ProThemeTools/style/index.less +6 -3
- package/lib/ProThemeTools/utils/index.d.ts +1 -1
- package/lib/ProThemeTools/utils/index.js +2 -1
- package/lib/ProTooltip/style/index.less +3 -0
- package/lib/ProTree/components/CloseIcon.js +2 -4
- package/lib/ProTree/components/Tree.js +42 -41
- package/lib/ProTree/style/index.less +29 -32
- package/lib/ProTreeModal/components/CloseIcon.js +2 -4
- package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
- package/lib/ProTreeModal/components/Trigger.js +74 -18
- package/lib/ProTreeModal/index.js +38 -6
- package/lib/ProTreeModal/propsType.d.ts +5 -2
- package/lib/ProTreeModal/style/index.less +11 -8
- package/lib/ProTreeSelect/index.js +3 -2
- package/lib/ProTreeSelect/style/index.less +25 -22
- package/lib/ProUpload/components/DragRender.js +7 -4
- package/lib/ProUpload/index.js +11 -7
- package/lib/ProUpload/style/index.less +7 -4
- package/lib/ProViewer/index.js +4 -3
- package/lib/ProViewer/style/index.less +6 -3
- package/lib/locale/en_US.d.ts +18 -1
- package/lib/locale/en_US.js +20 -3
- package/lib/locale/zh_CN.d.ts +18 -1
- package/lib/locale/zh_CN.js +19 -2
- package/lib/style/core/compatible.less +6 -6
- package/lib/style/theme/antd.less +277 -253
- package/package.json +1 -1
package/lib/ProAction/index.less
CHANGED
package/lib/ProDownload/index.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
9
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -17,7 +17,8 @@ var _antd = require("antd");
|
|
|
17
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
18
|
var _lodash = _interopRequireWildcard(require("lodash"));
|
|
19
19
|
var _utils = require("./utils");
|
|
20
|
-
var
|
|
20
|
+
var _ProConfigProvider = require("../ProConfigProvider");
|
|
21
|
+
var _excluded = ["source", "action", "url", "method", "params", "fileName", "children", "onFinish", "beforeDownload", "className", "transformResponse"];
|
|
21
22
|
var ProDownload = function ProDownload(props) {
|
|
22
23
|
var source = props.source,
|
|
23
24
|
action = props.action,
|
|
@@ -25,7 +26,6 @@ var ProDownload = function ProDownload(props) {
|
|
|
25
26
|
method = props.method,
|
|
26
27
|
params = props.params,
|
|
27
28
|
fileName = props.fileName,
|
|
28
|
-
headers = props.headers,
|
|
29
29
|
children = props.children,
|
|
30
30
|
onFinish = props.onFinish,
|
|
31
31
|
beforeDownload = props.beforeDownload,
|
|
@@ -38,8 +38,11 @@ var ProDownload = function ProDownload(props) {
|
|
|
38
38
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
39
39
|
loading = _useSetState2[0].loading,
|
|
40
40
|
setState = _useSetState2[1];
|
|
41
|
+
var _ref = (0, _ProConfigProvider.useProConfig)('ProDownload') || {},
|
|
42
|
+
headers = _ref.headers;
|
|
43
|
+
defaultProps.headers = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), defaultProps.headers);
|
|
41
44
|
var handDownload = /*#__PURE__*/function () {
|
|
42
|
-
var
|
|
45
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
43
46
|
var _params;
|
|
44
47
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
45
48
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -94,7 +97,7 @@ var ProDownload = function ProDownload(props) {
|
|
|
94
97
|
return (0, _utils.DownloadRequest)({
|
|
95
98
|
url: url || action,
|
|
96
99
|
method: method,
|
|
97
|
-
headers: headers,
|
|
100
|
+
headers: defaultProps.headers,
|
|
98
101
|
params: _params,
|
|
99
102
|
transformResponse: transformResponse,
|
|
100
103
|
fileName: fileName,
|
|
@@ -123,7 +126,7 @@ var ProDownload = function ProDownload(props) {
|
|
|
123
126
|
}, _callee, null, [[14, 19, 23, 26]]);
|
|
124
127
|
}));
|
|
125
128
|
return function handDownload() {
|
|
126
|
-
return
|
|
129
|
+
return _ref2.apply(this, arguments);
|
|
127
130
|
};
|
|
128
131
|
}();
|
|
129
132
|
var cls = (0, _classnames.default)(className, {
|
|
@@ -1,82 +1,86 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-drawer {
|
|
2
5
|
.pro-drawer-close {
|
|
3
|
-
position
|
|
4
|
-
top
|
|
5
|
-
left
|
|
6
|
-
display
|
|
7
|
-
align-items
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 6px;
|
|
8
|
+
left: -34px;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
8
11
|
justify-content: center;
|
|
9
|
-
width
|
|
10
|
-
height
|
|
11
|
-
color
|
|
12
|
-
cursor
|
|
12
|
+
width: 32px;
|
|
13
|
+
height: 38px;
|
|
14
|
+
color: var(--zaui-global-bg, #fff);
|
|
15
|
+
cursor: pointer;
|
|
13
16
|
|
|
14
17
|
.close-icon {
|
|
15
|
-
position
|
|
16
|
-
left
|
|
17
|
-
z-index
|
|
18
|
+
position: relative;
|
|
19
|
+
left: 2px;
|
|
20
|
+
z-index: 1;
|
|
18
21
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
19
22
|
transform: translateZ(100px);
|
|
20
|
-
fill
|
|
23
|
+
fill: var(--zaui-aide-text, #909090);
|
|
21
24
|
|
|
22
25
|
&:hover {
|
|
23
|
-
fill: var(--zaui-brand-active, #
|
|
26
|
+
fill: var(--zaui-brand-active, #005ad9);
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
>div {
|
|
29
|
+
> div {
|
|
27
30
|
height: 20px;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
.pro-drawer-close::after {
|
|
33
|
-
position
|
|
34
|
-
top
|
|
35
|
-
right
|
|
36
|
-
bottom
|
|
37
|
-
left
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
bottom: 0;
|
|
40
|
+
left: 0;
|
|
38
41
|
background-color: var(--zaui-global-bg, #fff);
|
|
39
|
-
border-radius
|
|
40
|
-
transform
|
|
41
|
-
content
|
|
42
|
+
border-radius: 4px 0px 0px 4px;
|
|
43
|
+
transform: perspective(0.15em) rotateY(-2deg);
|
|
44
|
+
content: '';
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
.pro-drawer-title {
|
|
45
|
-
position
|
|
46
|
-
top
|
|
47
|
-
left
|
|
48
|
-
width
|
|
49
|
-
height
|
|
50
|
-
padding
|
|
51
|
-
color
|
|
52
|
-
font-weight
|
|
53
|
-
font-size
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 64px;
|
|
53
|
+
padding: var(--zaui-space-size-md, 16px) var(--zaui-space-size-lg, 32px);
|
|
54
|
+
color: var(--zaui-text, #343434);
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
font-size: var(--zaui-font-size-xxl, 20px);
|
|
54
57
|
background-color: var(--zaui-global-bg, #fff);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
.pro-drawer-scrolling {
|
|
58
|
-
z-index
|
|
61
|
+
z-index: 1;
|
|
59
62
|
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
.pro-drawer-content {
|
|
63
|
-
flex
|
|
64
|
-
width
|
|
65
|
-
padding
|
|
66
|
+
flex: 1;
|
|
67
|
+
width: 100%;
|
|
68
|
+
padding: var(--zaui-space-size-md, 16px) var(--zaui-space-size-lg, 32px);
|
|
66
69
|
padding-top: 0;
|
|
67
|
-
overflow-x
|
|
68
|
-
overflow-y
|
|
70
|
+
overflow-x: hidden;
|
|
71
|
+
overflow-y: auto;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
.pro-drawer-footer {
|
|
72
|
-
position
|
|
73
|
-
bottom
|
|
74
|
-
left
|
|
75
|
-
z-index
|
|
76
|
-
width
|
|
77
|
-
padding
|
|
75
|
+
position: absolute;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
z-index: 101;
|
|
79
|
+
width: 100%;
|
|
80
|
+
padding: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1))
|
|
81
|
+
var(--zaui-space-size-lg, 32px);
|
|
78
82
|
background-color: var(--zaui-global-bg, #fff);
|
|
79
|
-
box-shadow
|
|
83
|
+
box-shadow: 8px 2px 8px 0 var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
80
84
|
|
|
81
85
|
button {
|
|
82
86
|
margin-right: var(--zaui-space-size-sm, 8px);
|
|
@@ -87,24 +91,24 @@
|
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
|
|
91
|
-
height
|
|
92
|
-
padding
|
|
94
|
+
.@{ant-prefix}-drawer-body {
|
|
95
|
+
height: 100vh;
|
|
96
|
+
padding: 0;
|
|
93
97
|
overflow-y: hidden;
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
|
|
100
|
+
.@{ant-prefix}-drawer-content {
|
|
97
101
|
position: static;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
|
-
|
|
104
|
+
.@{ant-prefix}-drawer-close {
|
|
101
105
|
display: none;
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
.pro-modal {
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
.@{ant-prefix}-modal-close {
|
|
111
|
+
.@{ant-prefix}-modal-close-x {
|
|
108
112
|
.close-icon {
|
|
109
113
|
fill: var(--zaui-aide-text, #909090);
|
|
110
114
|
|
|
@@ -115,40 +119,39 @@
|
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
padding
|
|
122
|
+
.@{ant-prefix}-modal-header {
|
|
123
|
+
padding: var(--zaui-space-size-md, 16px);
|
|
120
124
|
border-bottom: none;
|
|
121
125
|
|
|
122
|
-
|
|
126
|
+
.@{ant-prefix}-modal-title {
|
|
123
127
|
font-weight: 600;
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
|
|
127
|
-
|
|
128
|
-
padding
|
|
131
|
+
.@{ant-prefix}-modal-footer {
|
|
132
|
+
padding: var(--zaui-space-size-md, 16px);
|
|
129
133
|
border-top: none;
|
|
130
134
|
|
|
131
135
|
.pro-modal-footer {
|
|
132
|
-
display
|
|
136
|
+
display: flex;
|
|
133
137
|
justify-content: space-between;
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
max-height
|
|
140
|
-
padding
|
|
141
|
+
.@{ant-prefix}-modal-content {
|
|
142
|
+
.@{ant-prefix}-modal-body {
|
|
143
|
+
max-height: 450px;
|
|
144
|
+
padding: 0 var(--zaui-space-size-md, 16px);
|
|
141
145
|
padding-top: 0;
|
|
142
|
-
overflow
|
|
146
|
+
overflow: auto;
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
|
-
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
.pro-modal-no-footer {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
padding-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1))
|
|
152
|
+
.@{ant-prefix}-modal-content {
|
|
153
|
+
.@{ant-prefix}-modal-body {
|
|
154
|
+
padding-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
}
|
|
@@ -156,17 +159,17 @@
|
|
|
156
159
|
.pro-modal-scrolling {
|
|
157
160
|
z-index: 1;
|
|
158
161
|
|
|
159
|
-
|
|
162
|
+
.@{ant-prefix}-modal-header {
|
|
163
|
+
position: relative;
|
|
164
|
+
z-index: 1;
|
|
160
165
|
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
161
|
-
position : relative;
|
|
162
|
-
z-index : 1;
|
|
163
166
|
}
|
|
164
167
|
}
|
|
165
168
|
|
|
166
169
|
.pro-modal-footer-shadow {
|
|
167
|
-
|
|
168
|
-
position
|
|
169
|
-
z-index
|
|
170
|
+
.@{ant-prefix}-modal-footer {
|
|
171
|
+
position: relative;
|
|
172
|
+
z-index: 1;
|
|
170
173
|
box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
171
174
|
}
|
|
172
175
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-edit-label {
|
|
2
5
|
display: inline-block;
|
|
3
6
|
|
|
4
7
|
.pro-form-view {
|
|
5
|
-
|
|
8
|
+
.@{ant-prefix}-row {
|
|
6
9
|
display: block;
|
|
7
10
|
}
|
|
8
11
|
}
|
|
@@ -54,8 +57,8 @@
|
|
|
54
57
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
.@{ant-prefix}-popover {
|
|
61
|
+
.@{ant-prefix}-btn-sm {
|
|
59
62
|
font-size : var(--zaui-font-size-sm, 12px);
|
|
60
63
|
min-width : 56px;
|
|
61
64
|
line-height: 1;
|
|
@@ -70,15 +73,15 @@
|
|
|
70
73
|
.pro-edit-label-popconfirm {
|
|
71
74
|
z-index: 1001 !important;
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
.@{ant-prefix}-popover-message {
|
|
74
77
|
display: block;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
.@{ant-prefix}-popover-message-title {
|
|
78
81
|
padding-left: 0;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
.@{ant-prefix}-popover-content {
|
|
82
85
|
width : 360px;
|
|
83
86
|
max-width: 400px;
|
|
84
87
|
}
|
|
@@ -109,13 +112,13 @@
|
|
|
109
112
|
width: 100%;
|
|
110
113
|
|
|
111
114
|
&.pro-form-no-label {
|
|
112
|
-
|
|
115
|
+
.@{ant-prefix}-form-item-label {
|
|
113
116
|
display: none;
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
|
|
121
|
+
.@{ant-prefix}-col-10 {
|
|
119
122
|
flex : 0 0 var(--zaui-form-label-width, 130px);
|
|
120
123
|
text-align : var(--zaui-form-align, left);
|
|
121
124
|
white-space : pre-wrap;
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
|
|
133
|
+
.@{ant-prefix}-select {
|
|
131
134
|
width: 100%;
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
11
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
13
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -14,6 +16,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
14
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
18
|
var _antd = require("antd");
|
|
19
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
20
|
var _lodash = require("lodash");
|
|
18
21
|
var _valueType = _interopRequireDefault(require("../../../ProForm/utils/valueType"));
|
|
19
22
|
var _transform = _interopRequireDefault(require("../../utils/transform"));
|
|
@@ -22,14 +25,15 @@ var componentMap = _interopRequireWildcard(require("../../../ProForm/components"
|
|
|
22
25
|
var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
|
|
23
26
|
var _transformNames = _interopRequireDefault(require("../../../ProForm/utils/transformNames"));
|
|
24
27
|
var _useFieldProps = require("../../../ProForm/utils/useFieldProps");
|
|
28
|
+
var _useChanged3 = require("../../../ProForm/utils/useChanged");
|
|
25
29
|
var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"));
|
|
26
30
|
var _utils = require("../../../ProForm/utils");
|
|
27
31
|
var _locale = _interopRequireDefault(require("../../../locale"));
|
|
28
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules"];
|
|
32
|
+
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className"];
|
|
29
33
|
/* eslint-disable prefer-destructuring */
|
|
30
34
|
/* eslint-disable prefer-const */
|
|
31
35
|
var RenderField = function RenderField(_ref) {
|
|
32
|
-
var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4;
|
|
36
|
+
var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4, _classNames;
|
|
33
37
|
var value = _ref.text,
|
|
34
38
|
record = _ref.record,
|
|
35
39
|
index = _ref.index,
|
|
@@ -54,6 +58,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
54
58
|
required = _column$required === void 0 ? false : _column$required,
|
|
55
59
|
_column$rules = column.rules,
|
|
56
60
|
rules = _column$rules === void 0 ? [] : _column$rules,
|
|
61
|
+
equalWith = column.equalWith,
|
|
62
|
+
className = column.className,
|
|
57
63
|
resetProps = (0, _objectWithoutProperties2.default)(column, _excluded);
|
|
58
64
|
// editRender弃用使用component同ProForm
|
|
59
65
|
var _editRender = component || editRender;
|
|
@@ -68,7 +74,9 @@ var RenderField = function RenderField(_ref) {
|
|
|
68
74
|
setState = config.setState,
|
|
69
75
|
name = config.name,
|
|
70
76
|
virtualKey = config.virtualKey,
|
|
71
|
-
viewEmpty = config.viewEmpty
|
|
77
|
+
viewEmpty = config.viewEmpty,
|
|
78
|
+
originalValues = config.originalValues,
|
|
79
|
+
originalTip = config.originalTip;
|
|
72
80
|
var _fieldProps = fieldProps || formItemProps || {};
|
|
73
81
|
var _rules = rules || [];
|
|
74
82
|
var _required = required;
|
|
@@ -182,13 +190,23 @@ var RenderField = function RenderField(_ref) {
|
|
|
182
190
|
return [].concat((0, _toConsumableArray2.default)(baseName), [index, key]);
|
|
183
191
|
});
|
|
184
192
|
}
|
|
193
|
+
var originalName = cellName;
|
|
194
|
+
var originalNames = names;
|
|
195
|
+
if (virtualKey) {
|
|
196
|
+
var _cellName$slice, _names2, _names2$map;
|
|
197
|
+
originalName = [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, 1)));
|
|
198
|
+
originalNames = (_names2 = names) === null || _names2 === void 0 ? void 0 : (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
|
|
199
|
+
var _item$slice;
|
|
200
|
+
return [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, 1)));
|
|
201
|
+
});
|
|
202
|
+
}
|
|
185
203
|
/**
|
|
186
204
|
* 配置names时,基于formItem的normalize与getValueProps进行值类型转换
|
|
187
205
|
* @returns {}
|
|
188
206
|
*/
|
|
189
207
|
var namesTransform = function namesTransform() {
|
|
190
|
-
var
|
|
191
|
-
if (!((
|
|
208
|
+
var _names3;
|
|
209
|
+
if (!((_names3 = names) === null || _names3 === void 0 ? void 0 : _names3.length)) {
|
|
192
210
|
return {};
|
|
193
211
|
}
|
|
194
212
|
var namesStr = [baseName, index, dataIndex];
|
|
@@ -348,14 +366,6 @@ var RenderField = function RenderField(_ref) {
|
|
|
348
366
|
d: Date.now()
|
|
349
367
|
}
|
|
350
368
|
});
|
|
351
|
-
// if (virtualKey) {
|
|
352
|
-
// // 单行编辑时需要 强制更新视图
|
|
353
|
-
// setState({
|
|
354
|
-
// forceUpdate: {
|
|
355
|
-
// d: Date.now(),
|
|
356
|
-
// },
|
|
357
|
-
// });
|
|
358
|
-
// }
|
|
359
369
|
case 30:
|
|
360
370
|
case "end":
|
|
361
371
|
return _context.stop();
|
|
@@ -444,6 +454,20 @@ var RenderField = function RenderField(_ref) {
|
|
|
444
454
|
return _ref3.apply(this, arguments);
|
|
445
455
|
};
|
|
446
456
|
}();
|
|
457
|
+
// 判断当前字段是否变更
|
|
458
|
+
var _useChanged = (0, _useChanged3.useChanged)({
|
|
459
|
+
name: cellName,
|
|
460
|
+
names: names,
|
|
461
|
+
namesStr: [].concat((0, _toConsumableArray2.default)(baseName), [index, dataIndex]),
|
|
462
|
+
originalName: originalName,
|
|
463
|
+
originalNames: originalNames,
|
|
464
|
+
originalValues: originalValues,
|
|
465
|
+
form: form,
|
|
466
|
+
equalWith: equalWith
|
|
467
|
+
}),
|
|
468
|
+
_useChanged2 = (0, _slicedToArray2.default)(_useChanged, 2),
|
|
469
|
+
changed = _useChanged2[0],
|
|
470
|
+
originalValue = _useChanged2[1];
|
|
447
471
|
var componentProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
448
472
|
form: form,
|
|
449
473
|
name: cellName,
|
|
@@ -484,15 +508,32 @@ var RenderField = function RenderField(_ref) {
|
|
|
484
508
|
if (!isEditing) {
|
|
485
509
|
delete _formItemProps.rules;
|
|
486
510
|
}
|
|
511
|
+
var _className = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, 'pro-form-item-changed', changed), _classNames));
|
|
512
|
+
var originalTitle = (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
513
|
+
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])), {}, {
|
|
514
|
+
isView: true,
|
|
515
|
+
value: originalValue,
|
|
516
|
+
checked: type === 'Switch' ? originalValue : undefined
|
|
517
|
+
})) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])), {}, {
|
|
518
|
+
isView: true,
|
|
519
|
+
value: originalValue,
|
|
520
|
+
checked: type === 'Switch' ? originalValue : undefined
|
|
521
|
+
}))]
|
|
522
|
+
});
|
|
523
|
+
var FormItem = (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
524
|
+
validateFirst: true
|
|
525
|
+
}, (0, _lodash.omit)(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
|
|
526
|
+
className: _className,
|
|
527
|
+
name: cellName,
|
|
528
|
+
children: /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange']))) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])))
|
|
529
|
+
}));
|
|
487
530
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
488
531
|
value: componentProps === null || componentProps === void 0 ? void 0 : componentProps.otherProps,
|
|
489
|
-
children:
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
children: /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange']))) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])))
|
|
495
|
-
}))
|
|
532
|
+
children: !originalTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
533
|
+
title: originalTitle,
|
|
534
|
+
open: changed ? undefined : false,
|
|
535
|
+
children: FormItem
|
|
536
|
+
})
|
|
496
537
|
});
|
|
497
538
|
};
|
|
498
539
|
var _default = exports.default = RenderField;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -12,7 +13,7 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
12
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _react = require("react");
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
16
17
|
var _lodash = require("lodash");
|
|
17
18
|
var _ahooks = require("ahooks");
|
|
18
19
|
var _antd = require("antd");
|
|
@@ -21,8 +22,8 @@ var _utils = require("./utils");
|
|
|
21
22
|
var _tools = require("./utils/tools");
|
|
22
23
|
var _components = require("./components");
|
|
23
24
|
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
|
24
|
-
var _locale =
|
|
25
|
-
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination"];
|
|
25
|
+
var _locale = _interopRequireWildcard(require("../locale"));
|
|
26
|
+
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip"];
|
|
26
27
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
27
28
|
var _resetProps$id, _resetProps$id$split, _value$2;
|
|
28
29
|
var value = _ref.value,
|
|
@@ -50,6 +51,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
50
51
|
max = _ref.max,
|
|
51
52
|
headerRender = _ref.headerRender,
|
|
52
53
|
pagination = _ref.pagination,
|
|
54
|
+
originalValues = _ref.originalValues,
|
|
55
|
+
originalTip = _ref.originalTip,
|
|
53
56
|
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
54
57
|
// 上下文form
|
|
55
58
|
var contentForm = _antd.Form.useFormInstance();
|
|
@@ -60,6 +63,9 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
60
63
|
_otherProps$viewEmpty = otherProps.viewEmpty,
|
|
61
64
|
viewEmpty = _otherProps$viewEmpty === void 0 ? '-' : _otherProps$viewEmpty;
|
|
62
65
|
var tableRef = (0, _react.useRef)(null);
|
|
66
|
+
var _React$useContext = _react.default.useContext(_antd.ConfigProvider.ConfigContext),
|
|
67
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
68
|
+
var prefixCls = getPrefixCls();
|
|
63
69
|
disabled = (otherProps === null || otherProps === void 0 ? void 0 : otherProps.disabled) || disabled;
|
|
64
70
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
65
71
|
_columns: columns,
|
|
@@ -136,7 +142,10 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
136
142
|
tableRef: tableRef,
|
|
137
143
|
max: max,
|
|
138
144
|
tableLength: value === null || value === void 0 ? void 0 : value.length,
|
|
139
|
-
page: page
|
|
145
|
+
page: page,
|
|
146
|
+
originalValues: originalValues,
|
|
147
|
+
originalTip: originalTip,
|
|
148
|
+
prefixCls: prefixCls
|
|
140
149
|
};
|
|
141
150
|
// 判断是否禁止添加、批量删除
|
|
142
151
|
var isForbiddenBtn = (0, _react.useCallback)(function (type) {
|
|
@@ -292,8 +301,11 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
292
301
|
showQuickJumper: true,
|
|
293
302
|
total: value.length,
|
|
294
303
|
showTotal: function showTotal(total) {
|
|
304
|
+
var _locale$ProEditTable;
|
|
295
305
|
if (!total) return;
|
|
296
|
-
return
|
|
306
|
+
return (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEditTable = _locale.default.ProEditTable) === null || _locale$ProEditTable === void 0 ? void 0 : _locale$ProEditTable.total, {
|
|
307
|
+
total: total
|
|
308
|
+
});
|
|
297
309
|
},
|
|
298
310
|
onChange: handlePageChange
|
|
299
311
|
}, pagination) : false,
|
|
@@ -121,9 +121,19 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
|
|
|
121
121
|
* @default -
|
|
122
122
|
*/
|
|
123
123
|
form?: FormInstance;
|
|
124
|
+
/**
|
|
125
|
+
* @description 原始数据源,设置后可以对比更新后的数值
|
|
126
|
+
* @default -
|
|
127
|
+
*/
|
|
128
|
+
originalValues?: any;
|
|
129
|
+
/**
|
|
130
|
+
* @description 原始数据源,是否tooltip显示
|
|
131
|
+
* @default -
|
|
132
|
+
*/
|
|
133
|
+
originalTip?: boolean;
|
|
124
134
|
/**
|
|
125
135
|
* @description 可编辑表格的类型,单行、多行、单元格编辑
|
|
126
|
-
* @default
|
|
136
|
+
* @default false
|
|
127
137
|
*/
|
|
128
138
|
mode?: 'single' | 'multiple' | 'cell';
|
|
129
139
|
/**
|