@zat-design/sisyphus-react 3.7.3-beta.9 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +21 -4
- package/dist/less.esm.css +21 -4
- package/es/ProEditTable/components/RenderField/index.js +1 -1
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/style/index.less +7 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +50 -45
- package/es/ProForm/components/combination/ProNumberRange/index.js +11 -4
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +1 -0
- package/es/ProForm/components/render/ChangedWrapper.js +26 -10
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +1 -1
- package/es/ProForm/utils/transformValue.js +17 -11
- package/es/ProSelect/index.js +3 -4
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- package/es/ProTable/index.js +30 -13
- package/es/ProTable/propsType.d.ts +14 -1
- package/es/ProTable/style/index.less +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/AdaptiveTooltip.js +55 -0
- package/es/ProTree/components/List.js +15 -3
- package/es/ProTree/components/ProTreeSelect/index.js +25 -5
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.js +17 -8
- package/es/ProTree/style/index.less +14 -0
- package/es/ProTreeModal/components/Tree.js +15 -17
- package/es/ProTreeModal/index.js +62 -7
- package/es/ProTreeModal/utils.d.ts +1 -0
- package/es/ProTreeModal/utils.js +21 -1
- package/es/style/theme/index.less +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +1 -1
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProEnum/style/index.less +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +49 -44
- package/lib/ProForm/components/combination/ProNumberRange/index.js +11 -4
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +1 -0
- package/lib/ProForm/components/render/ChangedWrapper.js +27 -11
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +1 -1
- package/lib/ProForm/utils/transformValue.js +17 -11
- package/lib/ProSelect/index.js +3 -4
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- package/lib/ProTable/index.js +30 -13
- package/lib/ProTable/propsType.d.ts +14 -1
- package/lib/ProTable/style/index.less +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
- package/lib/ProTree/components/List.js +15 -3
- package/lib/ProTree/components/ProTreeSelect/index.js +25 -5
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.js +19 -7
- package/lib/ProTree/style/index.less +14 -0
- package/lib/ProTreeModal/components/Tree.js +15 -17
- package/lib/ProTreeModal/index.js +61 -6
- package/lib/ProTreeModal/utils.d.ts +1 -0
- package/lib/ProTreeModal/utils.js +20 -0
- package/lib/style/theme/index.less +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -1909,7 +1909,7 @@
|
|
|
1909
1909
|
.pro-table .ant-table-body .ant-table-cell .varied-cell {
|
|
1910
1910
|
margin-left: -8px;
|
|
1911
1911
|
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
1912
|
-
background: var(--zaui-contract-bg, #fffaa1);
|
|
1912
|
+
background: var(--zaui-contract-bg, #fffaa1) !important;
|
|
1913
1913
|
border-radius: var(--zaui-border-radius, 8px);
|
|
1914
1914
|
}
|
|
1915
1915
|
.pro-table .ant-table-body .varied-cell.empty-cell {
|
|
@@ -2365,8 +2365,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2365
2365
|
}
|
|
2366
2366
|
.pro-number-range .range-left,
|
|
2367
2367
|
.pro-number-range .range-right {
|
|
2368
|
-
width: calc(50% -
|
|
2368
|
+
width: calc(50% - 16px);
|
|
2369
2369
|
text-align: center;
|
|
2370
|
+
-webkit-transition: none;
|
|
2371
|
+
transition: none;
|
|
2372
|
+
}
|
|
2373
|
+
.pro-number-range .range-left .range-left,
|
|
2374
|
+
.pro-number-range .range-right .range-left {
|
|
2375
|
+
width: calc(100% + 2px) !important;
|
|
2370
2376
|
}
|
|
2371
2377
|
.pro-number-range .range-left .ant-input-number {
|
|
2372
2378
|
border-right: none;
|
|
@@ -2978,7 +2984,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2978
2984
|
}
|
|
2979
2985
|
.pro-form .site-input-group-wrapper .site-input-left,
|
|
2980
2986
|
.pro-form .site-input-group-wrapper .site-input-right {
|
|
2981
|
-
width: calc(50% -
|
|
2987
|
+
width: calc(50% - 16px);
|
|
2982
2988
|
}
|
|
2983
2989
|
.pro-form .site-input-group-wrapper .site-input-left .ant-input-number {
|
|
2984
2990
|
border-right: none;
|
|
@@ -3856,6 +3862,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3856
3862
|
.pro-transfer-right .checked-item.disabled .anticon {
|
|
3857
3863
|
pointer-events: none;
|
|
3858
3864
|
}
|
|
3865
|
+
.pro-tree-wrap-ellipse {
|
|
3866
|
+
display: block;
|
|
3867
|
+
width: 100%;
|
|
3868
|
+
overflow: hidden;
|
|
3869
|
+
white-space: nowrap;
|
|
3870
|
+
text-overflow: ellipsis;
|
|
3871
|
+
word-break: keep-all;
|
|
3872
|
+
}
|
|
3859
3873
|
.pro-tree {
|
|
3860
3874
|
height: 100%;
|
|
3861
3875
|
}
|
|
@@ -4222,6 +4236,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4222
4236
|
.pro-tree-select-drop-down-container.ant-select-dropdown .ant-select-tree-node-content-wrapper .check-mark-icon {
|
|
4223
4237
|
display: none;
|
|
4224
4238
|
}
|
|
4239
|
+
.ant-select-tree-node-content-wrapper:has(.pro-tree-wrap-ellipse) {
|
|
4240
|
+
overflow: hidden;
|
|
4241
|
+
}
|
|
4225
4242
|
.pro-drawer .pro-drawer-close {
|
|
4226
4243
|
position: absolute;
|
|
4227
4244
|
top: 6px;
|
|
@@ -5315,7 +5332,7 @@ input[type='button'] {
|
|
|
5315
5332
|
--zaui-brand: #006aff;
|
|
5316
5333
|
--zaui-brand-hover: #3387ff;
|
|
5317
5334
|
--zaui-brand-active: #005ad9;
|
|
5318
|
-
--zaui-brand-disabled:
|
|
5335
|
+
--zaui-brand-disabled: color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
5319
5336
|
--zaui-text: #343434;
|
|
5320
5337
|
--zaui-text-weak: #616161;
|
|
5321
5338
|
--zaui-aide-text: #909090;
|
package/dist/less.esm.css
CHANGED
|
@@ -1909,7 +1909,7 @@
|
|
|
1909
1909
|
.pro-table .ant-table-body .ant-table-cell .varied-cell {
|
|
1910
1910
|
margin-left: -8px;
|
|
1911
1911
|
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
1912
|
-
background: var(--zaui-contract-bg, #fffaa1);
|
|
1912
|
+
background: var(--zaui-contract-bg, #fffaa1) !important;
|
|
1913
1913
|
border-radius: var(--zaui-border-radius, 8px);
|
|
1914
1914
|
}
|
|
1915
1915
|
.pro-table .ant-table-body .varied-cell.empty-cell {
|
|
@@ -2365,8 +2365,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2365
2365
|
}
|
|
2366
2366
|
.pro-number-range .range-left,
|
|
2367
2367
|
.pro-number-range .range-right {
|
|
2368
|
-
width: calc(50% -
|
|
2368
|
+
width: calc(50% - 16px);
|
|
2369
2369
|
text-align: center;
|
|
2370
|
+
-webkit-transition: none;
|
|
2371
|
+
transition: none;
|
|
2372
|
+
}
|
|
2373
|
+
.pro-number-range .range-left .range-left,
|
|
2374
|
+
.pro-number-range .range-right .range-left {
|
|
2375
|
+
width: calc(100% + 2px) !important;
|
|
2370
2376
|
}
|
|
2371
2377
|
.pro-number-range .range-left .ant-input-number {
|
|
2372
2378
|
border-right: none;
|
|
@@ -2978,7 +2984,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2978
2984
|
}
|
|
2979
2985
|
.pro-form .site-input-group-wrapper .site-input-left,
|
|
2980
2986
|
.pro-form .site-input-group-wrapper .site-input-right {
|
|
2981
|
-
width: calc(50% -
|
|
2987
|
+
width: calc(50% - 16px);
|
|
2982
2988
|
}
|
|
2983
2989
|
.pro-form .site-input-group-wrapper .site-input-left .ant-input-number {
|
|
2984
2990
|
border-right: none;
|
|
@@ -3856,6 +3862,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3856
3862
|
.pro-transfer-right .checked-item.disabled .anticon {
|
|
3857
3863
|
pointer-events: none;
|
|
3858
3864
|
}
|
|
3865
|
+
.pro-tree-wrap-ellipse {
|
|
3866
|
+
display: block;
|
|
3867
|
+
width: 100%;
|
|
3868
|
+
overflow: hidden;
|
|
3869
|
+
white-space: nowrap;
|
|
3870
|
+
text-overflow: ellipsis;
|
|
3871
|
+
word-break: keep-all;
|
|
3872
|
+
}
|
|
3859
3873
|
.pro-tree {
|
|
3860
3874
|
height: 100%;
|
|
3861
3875
|
}
|
|
@@ -4222,6 +4236,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4222
4236
|
.pro-tree-select-drop-down-container.ant-select-dropdown .ant-select-tree-node-content-wrapper .check-mark-icon {
|
|
4223
4237
|
display: none;
|
|
4224
4238
|
}
|
|
4239
|
+
.ant-select-tree-node-content-wrapper:has(.pro-tree-wrap-ellipse) {
|
|
4240
|
+
overflow: hidden;
|
|
4241
|
+
}
|
|
4225
4242
|
.pro-drawer .pro-drawer-close {
|
|
4226
4243
|
position: absolute;
|
|
4227
4244
|
top: 6px;
|
|
@@ -5315,7 +5332,7 @@ input[type='button'] {
|
|
|
5315
5332
|
--zaui-brand: #006aff;
|
|
5316
5333
|
--zaui-brand-hover: #3387ff;
|
|
5317
5334
|
--zaui-brand-active: #005ad9;
|
|
5318
|
-
--zaui-brand-disabled:
|
|
5335
|
+
--zaui-brand-disabled: color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
5319
5336
|
--zaui-text: #343434;
|
|
5320
5337
|
--zaui-text-weak: #616161;
|
|
5321
5338
|
--zaui-aide-text: #909090;
|
|
@@ -510,7 +510,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
510
510
|
form: form,
|
|
511
511
|
names: names,
|
|
512
512
|
namePath: [].concat(_toConsumableArray(namePath), [index]),
|
|
513
|
-
name:
|
|
513
|
+
name: originalName,
|
|
514
514
|
listName: cellName,
|
|
515
515
|
viewEmpty: viewEmpty,
|
|
516
516
|
valueType: _valueType,
|
|
@@ -43,7 +43,10 @@ var Group = function Group(props) {
|
|
|
43
43
|
}
|
|
44
44
|
return _jsx("div", {
|
|
45
45
|
id: id,
|
|
46
|
-
className: classNames(
|
|
46
|
+
className: classNames({
|
|
47
|
+
'pro-enum-group-root': true,
|
|
48
|
+
'pro-enum-group-root-disabled': disabled
|
|
49
|
+
}),
|
|
47
50
|
children: dataSource.map(function (item, index) {
|
|
48
51
|
return _jsx("div", {
|
|
49
52
|
onClick: function onClick() {
|
|
@@ -51,7 +54,12 @@ var Group = function Group(props) {
|
|
|
51
54
|
handleClick(item[fieldValue], index);
|
|
52
55
|
}
|
|
53
56
|
},
|
|
54
|
-
className: classNames(
|
|
57
|
+
className: classNames({
|
|
58
|
+
'pro-enum-group-item': true,
|
|
59
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
|
60
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
|
61
|
+
'pro-enum-group-item-disabled': item.disabled
|
|
62
|
+
}),
|
|
55
63
|
children: item[fieldLabel]
|
|
56
64
|
}, item[fieldValue]);
|
|
57
65
|
})
|
package/es/ProEnum/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
43
43
|
enumProps = _objectWithoutProperties(props, _excluded);
|
|
44
44
|
var _ref = otherProps || {},
|
|
45
45
|
viewEmpty = _ref.viewEmpty;
|
|
46
|
-
var _isView = isView || otherProps.isView;
|
|
46
|
+
var _isView = isView || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
|
|
47
47
|
var _ref2 = useProConfig('ProEnum') || {},
|
|
48
48
|
fieldNames = _ref2.fieldNames,
|
|
49
49
|
_ref2$clear = _ref2.clear,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@root-entry-name: 'default';
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
|
+
@zaui-disabled-bg: var(--zaui-disabled-bg);
|
|
5
|
+
|
|
4
6
|
.pro-enum {
|
|
5
7
|
&-tag-root {
|
|
6
8
|
display: flex;
|
|
@@ -96,10 +98,14 @@
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
&-group-root-disabled {
|
|
99
|
-
color:
|
|
101
|
+
color: var(--zaui-aide-text);
|
|
100
102
|
|
|
101
103
|
.pro-enum-group-item {
|
|
102
104
|
background: var(--zaui-disabled-bg);
|
|
105
|
+
&.pro-enum-group-item-selected {
|
|
106
|
+
background: var(--zaui-brand-disabled);
|
|
107
|
+
border-color: var(--zaui-brand-disabled);
|
|
108
|
+
}
|
|
103
109
|
}
|
|
104
110
|
}
|
|
105
111
|
}
|
|
@@ -27,7 +27,7 @@ import { SearchOutlined } from '@ant-design/icons';
|
|
|
27
27
|
import { useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
|
28
28
|
import { debounce, isArray, isEqual, isFunction, omit } from 'lodash';
|
|
29
29
|
import { ReactSVG } from 'react-svg';
|
|
30
|
-
import React, { forwardRef,
|
|
30
|
+
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
31
31
|
import { ProForm, ProDrawerForm, ProTable, useProConfig, ProSelect } from '../../../../index';
|
|
32
32
|
import Container from '../../Container';
|
|
33
33
|
import viewSvg from '../../../../assets/view.svg';
|
|
@@ -137,10 +137,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
137
137
|
}, _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
138
138
|
manual: true,
|
|
139
139
|
onSuccess: function onSuccess(res) {
|
|
140
|
-
var _res$data;
|
|
140
|
+
var _res$data, _ref5;
|
|
141
141
|
var list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
|
|
142
142
|
setState({
|
|
143
|
-
options: transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list
|
|
143
|
+
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
})),
|
|
@@ -166,9 +166,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
166
166
|
};
|
|
167
167
|
var handleFormat = onFormat || defaultOptionRender;
|
|
168
168
|
if (showCodeName) {
|
|
169
|
-
handleFormat = function handleFormat(
|
|
170
|
-
var value =
|
|
171
|
-
label =
|
|
169
|
+
handleFormat = function handleFormat(_ref6) {
|
|
170
|
+
var value = _ref6.value,
|
|
171
|
+
label = _ref6.label;
|
|
172
172
|
return "".concat(value, "-").concat(label);
|
|
173
173
|
};
|
|
174
174
|
}
|
|
@@ -237,7 +237,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
237
237
|
onChange(val, option);
|
|
238
238
|
};
|
|
239
239
|
var handleClick = /*#__PURE__*/function () {
|
|
240
|
-
var
|
|
240
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
241
241
|
var _yield$beforeOpen, res;
|
|
242
242
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
243
243
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -280,7 +280,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
280
280
|
}, _callee);
|
|
281
281
|
}));
|
|
282
282
|
return function handleClick() {
|
|
283
|
-
return
|
|
283
|
+
return _ref7.apply(this, arguments);
|
|
284
284
|
};
|
|
285
285
|
}();
|
|
286
286
|
var handleClose = function handleClose() {
|
|
@@ -299,7 +299,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
301
|
var handleFinish = /*#__PURE__*/function () {
|
|
302
|
-
var
|
|
302
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
303
303
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
304
304
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
305
305
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -360,11 +360,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
360
360
|
}, _callee2, null, [[0, 18]]);
|
|
361
361
|
}));
|
|
362
362
|
return function handleFinish() {
|
|
363
|
-
return
|
|
363
|
+
return _ref8.apply(this, arguments);
|
|
364
364
|
};
|
|
365
365
|
}();
|
|
366
366
|
var handleSearch = /*#__PURE__*/function () {
|
|
367
|
-
var
|
|
367
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
368
368
|
var values;
|
|
369
369
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
370
370
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -383,7 +383,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
383
383
|
}, _callee3);
|
|
384
384
|
}));
|
|
385
385
|
return function handleSearch() {
|
|
386
|
-
return
|
|
386
|
+
return _ref9.apply(this, arguments);
|
|
387
387
|
};
|
|
388
388
|
}();
|
|
389
389
|
var _rowSelection = _objectSpread({
|
|
@@ -437,7 +437,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
437
437
|
};
|
|
438
438
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
439
439
|
var getInitValues = /*#__PURE__*/function () {
|
|
440
|
-
var
|
|
440
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
441
441
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
|
442
442
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
443
443
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -495,12 +495,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
495
495
|
}, _callee4);
|
|
496
496
|
}));
|
|
497
497
|
return function getInitValues() {
|
|
498
|
-
return
|
|
498
|
+
return _ref10.apply(this, arguments);
|
|
499
499
|
};
|
|
500
500
|
}();
|
|
501
501
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
502
502
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
503
|
-
var
|
|
503
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
504
504
|
var _useRequest$options4, _useRequest$options5;
|
|
505
505
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
|
506
506
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -548,7 +548,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
548
548
|
}, _callee5);
|
|
549
549
|
}));
|
|
550
550
|
return function getDefaultOneValues() {
|
|
551
|
-
return
|
|
551
|
+
return _ref11.apply(this, arguments);
|
|
552
552
|
};
|
|
553
553
|
}();
|
|
554
554
|
useImperativeHandle(ref, function () {
|
|
@@ -579,7 +579,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
});
|
|
582
|
-
|
|
582
|
+
useDeepCompareEffect(function () {
|
|
583
583
|
if (onOff && !visible) {
|
|
584
584
|
var _useRequest$options6;
|
|
585
585
|
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
|
@@ -615,34 +615,39 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
615
615
|
setState(nextState);
|
|
616
616
|
}
|
|
617
617
|
}, [onOff, visible, value]);
|
|
618
|
-
|
|
619
|
-
if (value && !visible && isInit) {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
pageSize: 50,
|
|
632
|
-
queryBean: _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
633
|
-
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
634
|
-
var nextParams = transformParams ? transformParams(params) : params;
|
|
635
|
-
run(nextParams);
|
|
636
|
-
setState({
|
|
637
|
-
isInit: false
|
|
638
|
-
});
|
|
639
|
-
}, 300);
|
|
640
|
-
} else {
|
|
641
|
-
getInitValues();
|
|
618
|
+
useDeepCompareEffect(function () {
|
|
619
|
+
if (value && !visible && isInit && !readOnly) {
|
|
620
|
+
getInitValues();
|
|
621
|
+
}
|
|
622
|
+
}, [value, visible, isInit]);
|
|
623
|
+
useDeepCompareEffect(function () {
|
|
624
|
+
if (value && !visible && readOnly) {
|
|
625
|
+
var _options$some;
|
|
626
|
+
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
|
627
|
+
return item[valueKey] === value;
|
|
628
|
+
});
|
|
629
|
+
if (isHasValue) {
|
|
630
|
+
return;
|
|
642
631
|
}
|
|
632
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
633
|
+
setTimeout(function () {
|
|
634
|
+
var _useRequest$options7, _useRequest$options8;
|
|
635
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
636
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
637
|
+
var _contentForm$getField2;
|
|
638
|
+
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
|
639
|
+
}
|
|
640
|
+
var params = withPagination ? {
|
|
641
|
+
pageNum: 1,
|
|
642
|
+
pageSize: 50,
|
|
643
|
+
queryBean: _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
644
|
+
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
645
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
646
|
+
run(nextParams);
|
|
647
|
+
}, 300);
|
|
643
648
|
}
|
|
644
|
-
}, [value,
|
|
645
|
-
|
|
649
|
+
}, [value, options, visible, useRequest]);
|
|
650
|
+
useDeepCompareEffect(function () {
|
|
646
651
|
if (!value) {
|
|
647
652
|
if (defaultOne) {
|
|
648
653
|
getDefaultOneValues();
|
|
@@ -742,7 +747,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
742
747
|
children: customRender
|
|
743
748
|
});
|
|
744
749
|
}
|
|
745
|
-
|
|
750
|
+
useDeepCompareEffect(function () {
|
|
746
751
|
if (isTooltip && value) {
|
|
747
752
|
var dom = document.getElementById(uuid);
|
|
748
753
|
dom.addEventListener('mouseover', function (e) {
|
|
@@ -779,7 +784,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
779
784
|
}, [value, isTooltip]);
|
|
780
785
|
useDeepCompareEffect(function () {
|
|
781
786
|
setState({
|
|
782
|
-
options: tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource
|
|
787
|
+
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
|
783
788
|
});
|
|
784
789
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
|
785
790
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|
|
@@ -13,11 +13,9 @@ import { tools } from '@zat-design/utils';
|
|
|
13
13
|
import Container from '../../Container';
|
|
14
14
|
import locale from '../../../../locale';
|
|
15
15
|
import ProForm from '../../../../ProForm';
|
|
16
|
-
var formatAmount = tools.formatAmount
|
|
17
|
-
formatPercent = tools.formatPercent,
|
|
18
|
-
formatPerMill = tools.formatPerMill;
|
|
16
|
+
var formatAmount = tools.formatAmount;
|
|
19
17
|
var ProNumberRange = function ProNumberRange(props) {
|
|
20
|
-
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
18
|
+
var _document$querySelect, _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
21
19
|
var _props$value = props.value,
|
|
22
20
|
value = _props$value === void 0 ? [] : _props$value,
|
|
23
21
|
_props$onChange = props.onChange,
|
|
@@ -42,6 +40,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
42
40
|
viewEmpty = _ref.viewEmpty,
|
|
43
41
|
valueType = _ref.valueType;
|
|
44
42
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
43
|
+
var addonAfterDomWidth = (_document$querySelect = document.querySelector('.ant-input-number-group-addon')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientWidth;
|
|
45
44
|
var _useSetState = useSetState({
|
|
46
45
|
range: value || []
|
|
47
46
|
}),
|
|
@@ -87,6 +86,8 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
87
86
|
};
|
|
88
87
|
var cls = classnames({
|
|
89
88
|
'pro-number-range': true,
|
|
89
|
+
'pro-number-range-after': addonAfter,
|
|
90
|
+
'pro-number-range-before': addonBefore,
|
|
90
91
|
className: className
|
|
91
92
|
});
|
|
92
93
|
// 查看模式
|
|
@@ -190,6 +191,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
190
191
|
},
|
|
191
192
|
addonBefore: addonBefore
|
|
192
193
|
}, valueProps), {}, {
|
|
194
|
+
style: addonAfter ? {
|
|
195
|
+
width: "calc(50% - ".concat(16 + addonAfterDomWidth / 2, "px)")
|
|
196
|
+
} : null,
|
|
193
197
|
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
194
198
|
max: (_ref2 = (_ref3 = (_value$ = value === null || value === void 0 ? void 0 : value[1]) !== null && _value$ !== void 0 ? _value$ : range[1]) !== null && _ref3 !== void 0 ? _ref3 : max) !== null && _ref2 !== void 0 ? _ref2 : (_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max
|
|
195
199
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), _jsx(_Input, {
|
|
@@ -210,6 +214,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
210
214
|
},
|
|
211
215
|
addonAfter: addonAfter
|
|
212
216
|
}, valueProps), {}, {
|
|
217
|
+
style: addonAfter ? {
|
|
218
|
+
width: "calc(50% - ".concat(16 - addonAfterDomWidth / 2, "px)")
|
|
219
|
+
} : null,
|
|
213
220
|
min: (_ref4 = (_ref5 = (_value$2 = value === null || value === void 0 ? void 0 : value[0]) !== null && _value$2 !== void 0 ? _value$2 : range[0]) !== null && _ref5 !== void 0 ? _ref5 : min) !== null && _ref4 !== void 0 ? _ref4 : (_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.min,
|
|
214
221
|
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
215
222
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[1]))]
|
|
@@ -2,6 +2,7 @@ import "antd/es/space/style";
|
|
|
2
2
|
import _Space from "antd/es/space";
|
|
3
3
|
import "antd/es/tooltip/style";
|
|
4
4
|
import _Tooltip from "antd/es/tooltip";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
8
|
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
|
|
@@ -13,7 +14,7 @@ import { diffOriginal } from '../../utils/diffOriginal';
|
|
|
13
14
|
import { useProConfig } from '../../../ProConfigProvider';
|
|
14
15
|
import { isEmpty } from '../../../utils';
|
|
15
16
|
var ChangedWrapper = function ChangedWrapper(props) {
|
|
16
|
-
var _diffConfig$toolTip;
|
|
17
|
+
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
17
18
|
var name = props.name,
|
|
18
19
|
names = props.names,
|
|
19
20
|
namesStr = props.namesStr,
|
|
@@ -31,7 +32,6 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
31
32
|
changeTipColor = diffConfig.changeTipColor,
|
|
32
33
|
addTipColor = diffConfig.addTipColor;
|
|
33
34
|
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
34
|
-
// 不渲染tooltip
|
|
35
35
|
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
36
36
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
37
37
|
return get(originalValues, name);
|
|
@@ -51,14 +51,16 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
51
51
|
var isChanged = diffType === 'changed';
|
|
52
52
|
var tipContent = useMemo(function () {
|
|
53
53
|
if (!isWatch || noChange) return undefined;
|
|
54
|
-
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, {
|
|
55
|
-
isView: true
|
|
56
|
-
|
|
57
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
58
|
-
})) : undefined;
|
|
54
|
+
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
|
|
55
|
+
isView: true
|
|
56
|
+
}, valuePropName, originalValue))) : undefined;
|
|
59
57
|
}, [originalValue, children]);
|
|
60
58
|
if (!isWatch || noChange) {
|
|
61
|
-
|
|
59
|
+
// 嵌套子组件
|
|
60
|
+
var isNestedField = ['ProEditTable'].includes(type);
|
|
61
|
+
return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({
|
|
62
|
+
originalValues: isNestedField ? originalValues : undefined
|
|
63
|
+
}, children.props), rest));
|
|
62
64
|
}
|
|
63
65
|
var tipOpenCalc = function tipOpenCalc() {
|
|
64
66
|
if (!toolTip) return false;
|
|
@@ -73,19 +75,33 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
73
75
|
'pro-form-item-changed': isChanged,
|
|
74
76
|
'pro-form-item-add': isAdd
|
|
75
77
|
});
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
|
76
80
|
return _jsx(_Tooltip, {
|
|
77
81
|
open: tipOpenCalc(),
|
|
82
|
+
mouseEnterDelay: 1,
|
|
78
83
|
getPopupContainer: function getPopupContainer(target) {
|
|
79
84
|
return target.parentElement;
|
|
80
85
|
},
|
|
81
86
|
title: _jsxs(_Space, {
|
|
82
|
-
|
|
87
|
+
direction: "vertical",
|
|
88
|
+
children: [_jsxs(_Space, {
|
|
89
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
90
|
+
}), _showEllipse && _jsxs(_Space, {
|
|
91
|
+
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
92
|
+
isView: true
|
|
93
|
+
})) : undefined]
|
|
94
|
+
})]
|
|
83
95
|
}),
|
|
84
96
|
placement: "topLeft",
|
|
85
97
|
children: _jsx("div", {
|
|
86
98
|
className: diffClassName,
|
|
87
99
|
style: style,
|
|
88
|
-
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest)
|
|
100
|
+
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
101
|
+
otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
102
|
+
isDiffChange: isChanged
|
|
103
|
+
})
|
|
104
|
+
})) : undefined
|
|
89
105
|
})
|
|
90
106
|
});
|
|
91
107
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["value"];
|
|
4
2
|
import { set } from 'lodash';
|
|
5
3
|
import { diffField } from '../utils';
|
|
4
|
+
import { isEmpty } from '../../utils';
|
|
6
5
|
export var transformValue = function transformValue(names, form, fieldName, _normalize, _getValueProps) {
|
|
7
6
|
return {
|
|
8
7
|
normalize: function normalize(value) {
|
|
@@ -22,23 +21,30 @@ export var transformValue = function transformValue(names, form, fieldName, _nor
|
|
|
22
21
|
return _value;
|
|
23
22
|
},
|
|
24
23
|
getValueProps: function getValueProps(value) {
|
|
24
|
+
var _curValue;
|
|
25
25
|
var _value = [];
|
|
26
26
|
names.forEach(function (name, index) {
|
|
27
27
|
var value = form.getFieldValue(name);
|
|
28
28
|
_value[index] = value;
|
|
29
29
|
});
|
|
30
30
|
// 支持外部传入转换函数
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
|
|
32
|
+
value: _value
|
|
33
|
+
};
|
|
34
|
+
// 如果数组中值都为空, 则值置为空
|
|
35
|
+
var curValue = res === null || res === void 0 ? void 0 : res.value;
|
|
36
36
|
// @ts-ignore
|
|
37
|
-
|
|
37
|
+
if ((_curValue = curValue) === null || _curValue === void 0 ? void 0 : _curValue.every(function (item) {
|
|
38
|
+
return isEmpty(item);
|
|
39
|
+
})) {
|
|
40
|
+
curValue = undefined;
|
|
41
|
+
}
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
set(form.getFieldsValue(true), fieldName, curValue);
|
|
38
44
|
// 如果表单里的值和组合得到的值不全等 更新表单里的值、
|
|
39
|
-
return _objectSpread({
|
|
40
|
-
value:
|
|
41
|
-
}
|
|
45
|
+
return _objectSpread(_objectSpread({}, res), {}, {
|
|
46
|
+
value: curValue
|
|
47
|
+
});
|
|
42
48
|
},
|
|
43
49
|
shouldUpdate: function shouldUpdate(prevValues, curValues) {
|
|
44
50
|
return diffField(prevValues, curValues, names);
|