@zat-design/sisyphus-react 3.3.1 → 3.3.2
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 +32 -9
- package/es/ProDownload/utils.js +2 -0
- package/es/ProEditTable/components/RenderField/index.js +7 -6
- package/es/ProEditTable/index.js +19 -1
- package/es/ProEditTable/style/index.less +5 -0
- package/es/ProEnum/hooks/useEnumRequest.js +13 -1
- package/es/ProForm/components/combination/Group/index.js +3 -4
- package/es/ProForm/components/combination/Group/style/index.less +38 -21
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -2
- package/es/ProForm/components/combination/Group/utils.js +0 -13
- package/es/ProForm/components/combination/ProModalSelect/index.js +2 -2
- package/es/ProForm/components/render/Render.js +15 -9
- package/es/ProForm/components/render/RenderFields.js +2 -1
- package/es/ProForm/style/index.less +5 -4
- package/es/ProForm/utils/contrastOriginal.d.ts +0 -1
- package/es/ProForm/utils/contrastOriginal.js +0 -1
- package/es/ProForm/utils/useChanged.d.ts +7 -14
- package/es/ProForm/utils/useChanged.js +13 -20
- package/es/ProForm/utils/useListChanged.d.ts +16 -0
- package/es/ProForm/utils/useListChanged.js +81 -0
- package/es/ProForm/utils/useShouldUpdate.js +17 -3
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +13 -5
- package/es/ProLayout/components/Layout/Menu/index.js +13 -10
- package/es/ProLayout/propTypes.d.ts +2 -0
- package/es/ProTable/style/index.less +1 -0
- package/es/ProTooltip/index.js +5 -3
- package/es/ProTreeModal/components/Trigger.d.ts +1 -0
- package/es/ProTreeModal/components/Trigger.js +17 -8
- package/es/ProTreeModal/index.js +12 -2
- package/es/ProUpload/components/DragRender.js +1 -2
- package/es/ProUpload/components/ImageRender.js +17 -7
- package/es/locale/en_US.d.ts +2 -0
- package/es/locale/en_US.js +3 -1
- package/es/locale/zh_CN.d.ts +3 -0
- package/es/locale/zh_CN.js +4 -1
- package/lib/ProEditTable/components/RenderField/index.js +9 -6
- package/lib/ProEditTable/index.js +18 -0
- package/lib/ProEditTable/style/index.less +5 -0
- package/lib/ProEnum/hooks/useEnumRequest.js +13 -1
- package/lib/ProForm/components/base/RangePicker/index.js +1 -1
- package/lib/ProForm/components/combination/Group/index.js +2 -3
- package/lib/ProForm/components/combination/Group/style/index.less +38 -21
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -2
- package/lib/ProForm/components/combination/Group/utils.js +1 -14
- package/lib/ProForm/components/combination/ProModalSelect/index.js +1 -1
- package/lib/ProForm/components/old/InputRange/index.js +0 -1
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/render/Render.js +16 -9
- package/lib/ProForm/components/render/RenderFields.js +2 -1
- package/lib/ProForm/style/index.less +5 -4
- package/lib/ProForm/utils/contrastOriginal.d.ts +0 -1
- package/lib/ProForm/utils/contrastOriginal.js +0 -1
- package/lib/ProForm/utils/useChanged.d.ts +7 -14
- package/lib/ProForm/utils/useChanged.js +13 -20
- package/lib/ProForm/utils/useListChanged.d.ts +16 -0
- package/lib/ProForm/utils/useListChanged.js +86 -0
- package/lib/ProForm/utils/useShouldUpdate.js +17 -3
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +13 -5
- package/lib/ProLayout/components/Layout/Menu/index.js +13 -10
- package/lib/ProLayout/propTypes.d.ts +2 -0
- package/lib/ProTable/components/TableResizable/index.js +8 -0
- package/lib/ProTable/style/index.less +1 -0
- package/lib/ProTabs/index.js +1 -0
- package/lib/ProThemeTools/index.js +1 -0
- package/lib/ProTooltip/index.js +4 -2
- package/lib/ProTree/components/Tree.js +7 -0
- package/lib/ProTree/index.js +0 -1
- package/lib/ProTreeModal/components/Tree.js +1 -0
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -0
- package/lib/ProTreeModal/components/Trigger.js +16 -7
- package/lib/ProTreeModal/index.js +12 -2
- package/lib/ProUpload/components/DragRender.js +1 -2
- package/lib/ProUpload/components/ImageRender.js +16 -6
- package/lib/ProUpload/index.js +7 -0
- package/lib/ProViewer/index.js +1 -0
- package/lib/locale/en_US.d.ts +2 -0
- package/lib/locale/en_US.js +3 -1
- package/lib/locale/zh_CN.d.ts +3 -0
- package/lib/locale/zh_CN.js +4 -1
- package/lib/old/ProCertValidity/index.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -1634,6 +1634,7 @@
|
|
|
1634
1634
|
}
|
|
1635
1635
|
.pro-table .ant-table-body .ant-table-tbody .ant-table-row:nth-child(odd).new-cell td {
|
|
1636
1636
|
background: #d2fff4 !important;
|
|
1637
|
+
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
|
1637
1638
|
}
|
|
1638
1639
|
.pro-table .ant-table-body .ant-table-cell .varied-cell {
|
|
1639
1640
|
margin-left: -8px;
|
|
@@ -2248,16 +2249,25 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2248
2249
|
display: none;
|
|
2249
2250
|
}
|
|
2250
2251
|
.pro-group .ant-space-compact {
|
|
2251
|
-
-webkit-box-align: center;
|
|
2252
|
-
-webkit-align-items: center;
|
|
2253
|
-
-ms-flex-align: center;
|
|
2254
|
-
align-items: center;
|
|
2255
2252
|
-webkit-box-flex: 1;
|
|
2256
2253
|
-webkit-flex: auto;
|
|
2257
2254
|
-ms-flex: auto;
|
|
2258
2255
|
flex: auto;
|
|
2256
|
+
-webkit-box-align: center;
|
|
2257
|
+
-webkit-align-items: center;
|
|
2258
|
+
-ms-flex-align: center;
|
|
2259
|
+
align-items: center;
|
|
2259
2260
|
width: 100%;
|
|
2260
2261
|
}
|
|
2262
|
+
.pro-group .ant-space-compact > .ant-input-number:first-child {
|
|
2263
|
+
border-end-end-radius: 0;
|
|
2264
|
+
border-start-end-radius: 0;
|
|
2265
|
+
}
|
|
2266
|
+
.pro-group .ant-space-compact > .ant-input-number:last-child {
|
|
2267
|
+
border-start-start-radius: 0;
|
|
2268
|
+
border-end-start-radius: 0;
|
|
2269
|
+
margin-left: -1px;
|
|
2270
|
+
}
|
|
2261
2271
|
.pro-group .ant-space-compact .ant-form-item {
|
|
2262
2272
|
margin-bottom: 0 !important;
|
|
2263
2273
|
}
|
|
@@ -2269,6 +2279,13 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2269
2279
|
border-start-start-radius: 0;
|
|
2270
2280
|
border-end-start-radius: 0;
|
|
2271
2281
|
}
|
|
2282
|
+
.pro-group .ant-space-compact .pro-modal-select {
|
|
2283
|
+
margin-left: -1px;
|
|
2284
|
+
}
|
|
2285
|
+
.pro-group .ant-space-compact .pro-modal-select .ant-input {
|
|
2286
|
+
border-start-start-radius: 0;
|
|
2287
|
+
border-end-start-radius: 0;
|
|
2288
|
+
}
|
|
2272
2289
|
.pro-group .ant-space-compact .ant-input-affix-wrapper,
|
|
2273
2290
|
.pro-group .ant-space-compact .ant-select {
|
|
2274
2291
|
border-start-end-radius: 0;
|
|
@@ -2276,8 +2293,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2276
2293
|
border-start-start-radius: 0;
|
|
2277
2294
|
border-end-start-radius: 0;
|
|
2278
2295
|
}
|
|
2279
|
-
.pro-group .ant-space-compact .ant-input-affix-wrapper:nth-child(n+2),
|
|
2280
|
-
.pro-group .ant-space-compact .ant-select:nth-child(n+2) {
|
|
2296
|
+
.pro-group .ant-space-compact .ant-input-affix-wrapper:nth-child(n + 2),
|
|
2297
|
+
.pro-group .ant-space-compact .ant-select:nth-child(n + 2) {
|
|
2281
2298
|
-webkit-margin-start: -1px;
|
|
2282
2299
|
margin-inline-start: -1px;
|
|
2283
2300
|
}
|
|
@@ -2306,8 +2323,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2306
2323
|
border-end-end-radius: var(--zaui-border-radius, 4px);
|
|
2307
2324
|
}
|
|
2308
2325
|
.pro-group .ant-space-compact .ant-input-affix-wrapper-status-error ~ .group-separator {
|
|
2309
|
-
border-color: var(--ant-error-color);
|
|
2310
2326
|
color: var(--ant-error-color);
|
|
2327
|
+
border-color: var(--ant-error-color);
|
|
2311
2328
|
}
|
|
2312
2329
|
.pro-container.pro-container-diy .pro-container-content {
|
|
2313
2330
|
display: -webkit-box;
|
|
@@ -2561,9 +2578,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2561
2578
|
.pro-form .ant-form-item.pro-form-item-changed .ant-picker .ant-select-selection-placeholder {
|
|
2562
2579
|
z-index: 9;
|
|
2563
2580
|
}
|
|
2564
|
-
.pro-form .ant-form-item.pro-form-item-changed .ant-form-item-control-input-content >
|
|
2565
|
-
background: var(--zaui-contract-bg, #fffaa1);
|
|
2581
|
+
.pro-form .ant-form-item.pro-form-item-changed .ant-form-item-control-input-content > .pro-form-view-container {
|
|
2566
2582
|
padding: 4px 8px;
|
|
2583
|
+
background: var(--zaui-contract-bg, #fffaa1);
|
|
2567
2584
|
border-radius: 4px;
|
|
2568
2585
|
}
|
|
2569
2586
|
.pro-form .ant-form-item .ant-row {
|
|
@@ -4183,6 +4200,12 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4183
4200
|
.pro-edit-table .ant-table-pagination .ant-pagination-options .ant-select.ant-select-in-form-item {
|
|
4184
4201
|
width: auto;
|
|
4185
4202
|
}
|
|
4203
|
+
.pro-edit-table .is-new-row td,
|
|
4204
|
+
.pro-edit-table .is-new-row.ant-table-row:hover td,
|
|
4205
|
+
.pro-edit-table .is-new-row .ant-table-cell-row-hover,
|
|
4206
|
+
.pro-edit-table .is-new-row.ant-table-row:hover .ant-table-cell-row-hover {
|
|
4207
|
+
background: var(--ant-primary-2) !important;
|
|
4208
|
+
}
|
|
4186
4209
|
.pro-edit-table-header {
|
|
4187
4210
|
margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1));
|
|
4188
4211
|
}
|
package/es/ProDownload/utils.js
CHANGED
|
@@ -4,6 +4,8 @@ import _message from "antd/es/message";
|
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
6
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
|
+
/* eslint-disable no-empty */
|
|
8
|
+
/* eslint-disable prefer-promise-reject-errors */
|
|
7
9
|
import { isFunction, get } from 'lodash';
|
|
8
10
|
import locale from '../locale';
|
|
9
11
|
var stringify = function stringify(data) {
|
|
@@ -25,7 +25,7 @@ import * as componentMap from '../../../ProForm/components';
|
|
|
25
25
|
import Container from '../../../ProForm/components/Container';
|
|
26
26
|
import transformNames from '../../../ProForm/utils/transformNames';
|
|
27
27
|
import { FieldProvider } from '../../../ProForm/utils/useFieldProps';
|
|
28
|
-
import {
|
|
28
|
+
import { useListChanged } from '../../../ProForm/utils/useListChanged';
|
|
29
29
|
import useRules from '../../../ProForm/utils/useRules';
|
|
30
30
|
import { isSelect } from '../../../ProForm/utils';
|
|
31
31
|
import locale from '../../../locale';
|
|
@@ -129,7 +129,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
129
129
|
names: names,
|
|
130
130
|
label: label,
|
|
131
131
|
labelRequired: labelRequired,
|
|
132
|
-
required: _required,
|
|
132
|
+
required: !isView && _required,
|
|
133
133
|
rules: isEditing ? _rules : [],
|
|
134
134
|
isSelect: isSelect({
|
|
135
135
|
dataSource: (_fieldProps4 = _fieldProps) === null || _fieldProps4 === void 0 ? void 0 : _fieldProps4.dataSource,
|
|
@@ -452,19 +452,20 @@ var RenderField = function RenderField(_ref) {
|
|
|
452
452
|
};
|
|
453
453
|
}();
|
|
454
454
|
// 判断当前字段是否变更
|
|
455
|
-
var
|
|
455
|
+
var _useListChanged = useListChanged({
|
|
456
456
|
name: cellName,
|
|
457
457
|
names: names,
|
|
458
458
|
namesStr: [].concat(_toConsumableArray(baseName), [index, dataIndex]),
|
|
459
|
+
rowKeyPath: [].concat(_toConsumableArray(baseName), [index, 'rowKey']),
|
|
459
460
|
originalName: originalName,
|
|
460
461
|
originalNames: originalNames,
|
|
461
462
|
originalValues: originalValues,
|
|
462
463
|
form: form,
|
|
463
464
|
equalWith: equalWith
|
|
464
465
|
}),
|
|
465
|
-
|
|
466
|
-
changed =
|
|
467
|
-
originalValue =
|
|
466
|
+
_useListChanged2 = _slicedToArray(_useListChanged, 2),
|
|
467
|
+
changed = _useListChanged2[0],
|
|
468
|
+
originalValue = _useListChanged2[1];
|
|
468
469
|
var componentProps = _objectSpread(_objectSpread(_objectSpread({
|
|
469
470
|
form: form,
|
|
470
471
|
name: cellName,
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
13
13
|
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", "rowKey"];
|
|
14
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
16
|
-
import { isArray } from 'lodash';
|
|
16
|
+
import { get, isArray } from 'lodash';
|
|
17
17
|
import { useDebounceEffect, useSetState } from 'ahooks';
|
|
18
18
|
import classnames from 'classnames';
|
|
19
19
|
import { transformColumns } from './utils';
|
|
@@ -106,6 +106,15 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
106
106
|
}
|
|
107
107
|
return key;
|
|
108
108
|
};
|
|
109
|
+
var IsNew = function IsNew(preArr, record) {
|
|
110
|
+
var _preArr$find;
|
|
111
|
+
if (!(preArr === null || preArr === void 0 ? void 0 : preArr.length)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return !(preArr === null || preArr === void 0 ? void 0 : (_preArr$find = preArr.find) === null || _preArr$find === void 0 ? void 0 : _preArr$find.call(preArr, function (item) {
|
|
115
|
+
return getRowKey(item) === getRowKey(record);
|
|
116
|
+
}));
|
|
117
|
+
};
|
|
109
118
|
var config = {
|
|
110
119
|
form: form,
|
|
111
120
|
mode: mode,
|
|
@@ -142,6 +151,10 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
142
151
|
var _rowClassName = function _rowClassName(record) {
|
|
143
152
|
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
|
144
153
|
var className = isEdit ? 'is-editing' : '';
|
|
154
|
+
var originalArr = get(originalValues, name);
|
|
155
|
+
if (!isEdit && IsNew(originalArr, record)) {
|
|
156
|
+
return "is-new-row ".concat(className);
|
|
157
|
+
}
|
|
145
158
|
return className;
|
|
146
159
|
};
|
|
147
160
|
// 复选框
|
|
@@ -246,11 +259,16 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
246
259
|
var _value$;
|
|
247
260
|
// 初始化默认生成row-key
|
|
248
261
|
if ((value === null || value === void 0 ? void 0 : value.length) && !(value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.rowKey)) {
|
|
262
|
+
var _originalArr$forEach;
|
|
249
263
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
250
264
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
251
265
|
rowKey: getRowKey(item)
|
|
252
266
|
});
|
|
253
267
|
});
|
|
268
|
+
var originalArr = get(originalValues, name);
|
|
269
|
+
originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
|
|
270
|
+
item.rowKey = getRowKey(item);
|
|
271
|
+
});
|
|
254
272
|
onChange(nextValues);
|
|
255
273
|
if (virtualKey) {
|
|
256
274
|
form.setFieldValue(virtualRowName, nextValues);
|
|
@@ -72,6 +72,18 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
72
72
|
case 9:
|
|
73
73
|
res.data = response;
|
|
74
74
|
case 10:
|
|
75
|
+
if (!(_typeof(response) !== 'object' || response === null)) {
|
|
76
|
+
_context.next = 12;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
throw Error('response enum data must be object');
|
|
80
|
+
case 12:
|
|
81
|
+
if (!(Object.keys(response).length === 0)) {
|
|
82
|
+
_context.next = 14;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
throw Error('Please return valid enumeration data');
|
|
86
|
+
case 14:
|
|
75
87
|
// 只返回fieldNames对象的key
|
|
76
88
|
if (clear) {
|
|
77
89
|
// 忽略清洗的 codes
|
|
@@ -106,7 +118,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
106
118
|
}, 10000);
|
|
107
119
|
}
|
|
108
120
|
return _context.abrupt("return", res);
|
|
109
|
-
case
|
|
121
|
+
case 21:
|
|
110
122
|
case "end":
|
|
111
123
|
return _context.stop();
|
|
112
124
|
}
|
|
@@ -9,7 +9,7 @@ import { useMemo } from 'react';
|
|
|
9
9
|
import { omit } from 'lodash';
|
|
10
10
|
import classnames from 'classnames';
|
|
11
11
|
import RenderFields from '../../render/RenderFields';
|
|
12
|
-
import { insertSeparator
|
|
12
|
+
import { insertSeparator } from './utils';
|
|
13
13
|
import ProForm from '../../../../ProForm';
|
|
14
14
|
var Group = function Group(props) {
|
|
15
15
|
var columns = props.children,
|
|
@@ -27,7 +27,6 @@ var Group = function Group(props) {
|
|
|
27
27
|
if (!Array.isArray(names)) {
|
|
28
28
|
console.error('Warning: Composite form components whose type is Group must be configured with names');
|
|
29
29
|
}
|
|
30
|
-
var _parentNames = parseName(id);
|
|
31
30
|
var data = useMemo(function () {
|
|
32
31
|
var fieldList = [];
|
|
33
32
|
var result = columns.map(function (item) {
|
|
@@ -35,7 +34,7 @@ var Group = function Group(props) {
|
|
|
35
34
|
disabled: Boolean(props === null || props === void 0 ? void 0 : props.disabled)
|
|
36
35
|
}, item), {}, {
|
|
37
36
|
noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
|
|
38
|
-
parentNames:
|
|
37
|
+
parentNames: id
|
|
39
38
|
});
|
|
40
39
|
});
|
|
41
40
|
var node = _jsx(_Button, {
|
|
@@ -46,7 +45,7 @@ var Group = function Group(props) {
|
|
|
46
45
|
columns: insertSeparator(result, space, node, otherProps),
|
|
47
46
|
fieldList: fieldList
|
|
48
47
|
};
|
|
49
|
-
}, [name, columns, space, props]);
|
|
48
|
+
}, [name, columns, space, props, names]);
|
|
50
49
|
var _className = classnames(_defineProperty({
|
|
51
50
|
'pro-group': true,
|
|
52
51
|
'pro-group-diy-width': columns.some(function (item) {
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
4
|
.border-radius(@start-end: 0, @end-end: 0, @start-start: 0, @end-start: 0) {
|
|
5
|
-
border-start-end-radius
|
|
6
|
-
border-end-end-radius
|
|
5
|
+
border-start-end-radius: @start-end;
|
|
6
|
+
border-end-end-radius: @end-end;
|
|
7
7
|
border-start-start-radius: @start-start;
|
|
8
|
-
border-end-start-radius
|
|
8
|
+
border-end-start-radius: @end-start;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.start-radius() {
|
|
12
12
|
border-start-start-radius: var(--zaui-border-radius, 4px);
|
|
13
|
-
border-end-start-radius
|
|
13
|
+
border-end-start-radius: var(--zaui-border-radius, 4px);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.end-radius() {
|
|
17
17
|
border-start-end-radius: var(--zaui-border-radius, 4px);
|
|
18
|
-
border-end-end-radius
|
|
18
|
+
border-end-end-radius: var(--zaui-border-radius, 4px);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.pro-group {
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.@{ant-prefix}-form-item {
|
|
42
|
-
|
|
43
42
|
margin-bottom: 0 !important;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -49,19 +48,38 @@
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
.@{ant-prefix}-space-compact {
|
|
51
|
+
flex: auto;
|
|
52
52
|
align-items: center;
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
&>.@{ant-prefix}-input-number{
|
|
56
|
+
&:first-child{
|
|
57
|
+
border-end-end-radius: 0;
|
|
58
|
+
border-start-end-radius: 0;
|
|
59
|
+
}
|
|
60
|
+
&:last-child{
|
|
61
|
+
border-start-start-radius: 0;
|
|
62
|
+
border-end-start-radius: 0;
|
|
63
|
+
margin-left: -1px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
55
66
|
|
|
56
67
|
.@{ant-prefix}-form-item {
|
|
57
68
|
margin-bottom: 0 !important;
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
.group-separator {
|
|
61
|
-
margin-inline-end
|
|
62
|
-
margin-inline-start
|
|
72
|
+
margin-inline-end: -2px;
|
|
73
|
+
margin-inline-start: -1px;
|
|
63
74
|
border-start-start-radius: 0;
|
|
64
|
-
border-end-start-radius
|
|
75
|
+
border-end-start-radius: 0;
|
|
76
|
+
}
|
|
77
|
+
.pro-modal-select {
|
|
78
|
+
margin-left: -1px;
|
|
79
|
+
.@{ant-prefix}-input{
|
|
80
|
+
border-start-start-radius: 0;
|
|
81
|
+
border-end-start-radius: 0;
|
|
82
|
+
}
|
|
65
83
|
}
|
|
66
84
|
|
|
67
85
|
// 定制内敛合并样式
|
|
@@ -69,16 +87,16 @@
|
|
|
69
87
|
.@{ant-prefix}-select {
|
|
70
88
|
.border-radius(0, 0, 0, 0);
|
|
71
89
|
|
|
72
|
-
&:nth-child(n+2) {
|
|
73
|
-
margin-inline-start: -1px
|
|
90
|
+
&:nth-child(n + 2) {
|
|
91
|
+
margin-inline-start: -1px;
|
|
74
92
|
}
|
|
75
93
|
|
|
76
94
|
&:first-child {
|
|
77
|
-
.start-radius()
|
|
95
|
+
.start-radius();
|
|
78
96
|
}
|
|
79
97
|
|
|
80
98
|
&:last-child {
|
|
81
|
-
.end-radius()
|
|
99
|
+
.end-radius();
|
|
82
100
|
}
|
|
83
101
|
}
|
|
84
102
|
|
|
@@ -89,22 +107,21 @@
|
|
|
89
107
|
|
|
90
108
|
&:first-child {
|
|
91
109
|
.@{ant-prefix}-select-selector {
|
|
92
|
-
.start-radius()
|
|
110
|
+
.start-radius();
|
|
93
111
|
}
|
|
94
112
|
}
|
|
95
113
|
|
|
96
114
|
&:last-child {
|
|
97
115
|
.@{ant-prefix}-select-selector {
|
|
98
|
-
.end-radius()
|
|
116
|
+
.end-radius();
|
|
99
117
|
}
|
|
100
118
|
}
|
|
101
|
-
|
|
102
119
|
}
|
|
103
120
|
|
|
104
121
|
// 报错样式定制
|
|
105
|
-
.@{ant-prefix}-input-affix-wrapper-status-error
|
|
122
|
+
.@{ant-prefix}-input-affix-wrapper-status-error ~ .group-separator {
|
|
123
|
+
color: var(--ant-error-color);
|
|
106
124
|
border-color: var(--ant-error-color);
|
|
107
|
-
color : var(--ant-error-color);
|
|
108
125
|
}
|
|
109
126
|
}
|
|
110
|
-
}
|
|
127
|
+
}
|
|
@@ -33,17 +33,4 @@ export var insertSeparator = function insertSeparator(columns, space, separatorN
|
|
|
33
33
|
}
|
|
34
34
|
return result;
|
|
35
35
|
}, []);
|
|
36
|
-
};
|
|
37
|
-
/** 解析name */
|
|
38
|
-
export var parseName = function parseName(name) {
|
|
39
|
-
var result = [];
|
|
40
|
-
var parts = name.split('_');
|
|
41
|
-
parts.forEach(function (part) {
|
|
42
|
-
if (!Number.isNaN(Number(part))) {
|
|
43
|
-
result.push(Number(part));
|
|
44
|
-
} else {
|
|
45
|
-
result.push(part);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return result;
|
|
49
36
|
};
|
|
@@ -18,7 +18,7 @@ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames",
|
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
19
|
import { CloseOutlined, SearchOutlined } from '@ant-design/icons';
|
|
20
20
|
import { useMount, useSetState } from 'ahooks';
|
|
21
|
-
import { cloneDeep, isArray, isEqual, isFunction } from 'lodash';
|
|
21
|
+
import { cloneDeep, isArray, isEqual, isFunction, omit } from 'lodash';
|
|
22
22
|
import { ReactSVG } from 'react-svg';
|
|
23
23
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
24
24
|
import { ProForm, ProDrawerForm, ProTable, useProConfig } from '../../../../index';
|
|
@@ -652,7 +652,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
652
652
|
disabled: disabled,
|
|
653
653
|
addonAfter: forceAddonAfterRender(),
|
|
654
654
|
autoComplete: "off"
|
|
655
|
-
}, restInputProps)), _jsx(_Input, {
|
|
655
|
+
}, omit(restInputProps, ['otherProps']))), _jsx(_Input, {
|
|
656
656
|
type: "hidden",
|
|
657
657
|
value: value
|
|
658
658
|
})]
|
|
@@ -33,7 +33,7 @@ import tipSvg from '../../../assets/tip.svg';
|
|
|
33
33
|
import useRules from '../../utils/useRules';
|
|
34
34
|
// 这个组件只管渲染, 参数的整理在外部处理
|
|
35
35
|
var Render = function Render(props) {
|
|
36
|
-
var _classNames, _otherProps$names2;
|
|
36
|
+
var _ref2, _classNames, _otherProps$names2;
|
|
37
37
|
var component = props.component,
|
|
38
38
|
originComponent = props.originComponent,
|
|
39
39
|
_props$formItemProps = props.formItemProps,
|
|
@@ -163,8 +163,8 @@ var Render = function Render(props) {
|
|
|
163
163
|
}
|
|
164
164
|
/** 移除多余参数,防止透传给formItem报错 */
|
|
165
165
|
var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'switchValue', 'precision', 'clearNotShow']);
|
|
166
|
-
//
|
|
167
|
-
var lastDisabled = componentProps.disabledStrictly ?
|
|
166
|
+
// 优先取组件上的disabled, 最后取formDisabled(全局
|
|
167
|
+
var lastDisabled = componentProps.disabledStrictly ? (_ref2 = _disabled !== null && _disabled !== void 0 ? _disabled : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref2 !== void 0 ? _ref2 : formDisabled : false;
|
|
168
168
|
/**
|
|
169
169
|
* 最新fieldProps: 更新后的组件Props
|
|
170
170
|
*/
|
|
@@ -192,8 +192,8 @@ var Render = function Render(props) {
|
|
|
192
192
|
var functionArgs = function functionArgs(args) {
|
|
193
193
|
var _otherFormItemProps$n;
|
|
194
194
|
var _args = _toConsumableArray(args);
|
|
195
|
-
var
|
|
196
|
-
valueType =
|
|
195
|
+
var _ref3 = otherProps || {},
|
|
196
|
+
valueType = _ref3.valueType;
|
|
197
197
|
_args[1] = form.getFieldsValue();
|
|
198
198
|
_args[2] = {
|
|
199
199
|
form: form
|
|
@@ -251,9 +251,10 @@ var Render = function Render(props) {
|
|
|
251
251
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat(_toConsumableArray(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat(_toConsumableArray(_args))));
|
|
252
252
|
return false;
|
|
253
253
|
}
|
|
254
|
-
// Group默认校验,
|
|
254
|
+
// Group默认校验, 延时与重新setFieldValue,为了解决校验值未同步最新的问题,
|
|
255
255
|
if (formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames) {
|
|
256
256
|
setTimeout(function () {
|
|
257
|
+
form.setFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames, form.getFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames));
|
|
257
258
|
form.validateFields([formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames]);
|
|
258
259
|
}, 60);
|
|
259
260
|
}
|
|
@@ -268,7 +269,7 @@ var Render = function Render(props) {
|
|
|
268
269
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
|
269
270
|
*/
|
|
270
271
|
var handleBlur = /*#__PURE__*/function () {
|
|
271
|
-
var
|
|
272
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
272
273
|
var _len2,
|
|
273
274
|
args,
|
|
274
275
|
_key2,
|
|
@@ -295,7 +296,7 @@ var Render = function Render(props) {
|
|
|
295
296
|
}, _callee);
|
|
296
297
|
}));
|
|
297
298
|
return function handleBlur() {
|
|
298
|
-
return
|
|
299
|
+
return _ref4.apply(this, arguments);
|
|
299
300
|
};
|
|
300
301
|
}();
|
|
301
302
|
var renderItem = function renderItem() {
|
|
@@ -403,7 +404,12 @@ var Render = function Render(props) {
|
|
|
403
404
|
shouldUpdate: _otherFormItemProps.shouldUpdate,
|
|
404
405
|
noStyle: true,
|
|
405
406
|
children: function children() {
|
|
406
|
-
return
|
|
407
|
+
return _jsx(_Form.Item, _objectSpread(_objectSpread({}, omit(_otherFormItemProps, filterFormItemKey)), {}, {
|
|
408
|
+
// @ts-ignore
|
|
409
|
+
_internalItemRender: internalItemRender,
|
|
410
|
+
className: _className,
|
|
411
|
+
children: child
|
|
412
|
+
}));
|
|
407
413
|
}
|
|
408
414
|
});
|
|
409
415
|
}
|
|
@@ -44,6 +44,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
var comList = columns.flatMap(function (column, index) {
|
|
47
|
+
var _ref, _formItemProps$disabl;
|
|
47
48
|
if (!!expand && !openState) {
|
|
48
49
|
// expand为Number时 过滤掉大于expand 且 非fixed的column
|
|
49
50
|
if (typeof expand === 'number') {
|
|
@@ -122,7 +123,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
122
123
|
placeholder = formItemChildProps.placeholder,
|
|
123
124
|
dataSource = formItemChildProps.dataSource;
|
|
124
125
|
var formLabel = _formItemProps.label;
|
|
125
|
-
var comDisabled =
|
|
126
|
+
var comDisabled = (_ref = (_formItemProps$disabl = _formItemProps === null || _formItemProps === void 0 ? void 0 : _formItemProps.disabled) !== null && _formItemProps$disabl !== void 0 ? _formItemProps$disabl : fieldProps.disabled) !== null && _ref !== void 0 ? _ref : disabled;
|
|
126
127
|
var _disabled = comDisabled === undefined ? formDisabled : comDisabled;
|
|
127
128
|
// 当前组件是不是一个选择组件
|
|
128
129
|
var _isSelect = isSelect({
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
visibility: unset;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.@{ant-prefix}-input-affix-wrapper:hover
|
|
59
|
+
.@{ant-prefix}-input-affix-wrapper:hover
|
|
60
|
+
span.@{ant-prefix}-input-clear-icon[class~='ant-input-clear-icon-hidden'] {
|
|
60
61
|
display: unset;
|
|
61
62
|
visibility: hidden;
|
|
62
63
|
}
|
|
@@ -140,9 +141,9 @@
|
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
.@{ant-prefix}-form-item-control-input-content >
|
|
144
|
-
background: @zaui-contract-bg;
|
|
144
|
+
.@{ant-prefix}-form-item-control-input-content > .pro-form-view-container {
|
|
145
145
|
padding: 4px 8px;
|
|
146
|
+
background: @zaui-contract-bg;
|
|
146
147
|
border-radius: 4px;
|
|
147
148
|
}
|
|
148
149
|
}
|
|
@@ -306,7 +307,7 @@
|
|
|
306
307
|
|
|
307
308
|
div.pro-form-custom-footer {
|
|
308
309
|
width: unset !important;
|
|
309
|
-
height:32px;
|
|
310
|
+
height: 32px;
|
|
310
311
|
margin-bottom: calc(var(--zaui-height-size-md, 16px) * var(--zaui-size, 1));
|
|
311
312
|
|
|
312
313
|
&.pro-form-custom-footer-hidden {
|
|
@@ -2,7 +2,6 @@ import { isEqual, isFunction } from 'lodash';
|
|
|
2
2
|
var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
|
|
3
3
|
export var contrastOriginal = function contrastOriginal(params) {
|
|
4
4
|
var originalValue = params.originalValue,
|
|
5
|
-
originalValues = params.originalValues,
|
|
6
5
|
value = params.value,
|
|
7
6
|
equalWith = params.equalWith;
|
|
8
7
|
// 支持传入自定义比较事件
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
names?: NamePath[];
|
|
6
|
-
namesStr?: NamePath;
|
|
7
|
-
originalName?: NamePath;
|
|
8
|
-
originalNames?: NamePath[];
|
|
9
|
-
originalNameStr?: NamePath;
|
|
1
|
+
export declare const useChanged: ({ name, names, namesStr, originalValues, form, equalWith }: {
|
|
2
|
+
name: any;
|
|
3
|
+
names: any;
|
|
4
|
+
namesStr: any;
|
|
10
5
|
originalValues: any;
|
|
11
|
-
form:
|
|
12
|
-
equalWith
|
|
13
|
-
}
|
|
14
|
-
export declare const useChanged: (params: Params) => any[];
|
|
15
|
-
export {};
|
|
6
|
+
form: any;
|
|
7
|
+
equalWith: any;
|
|
8
|
+
}) => any[];
|
|
@@ -2,30 +2,23 @@ import "antd/es/form/style";
|
|
|
2
2
|
import _Form from "antd/es/form";
|
|
3
3
|
import { get } from 'lodash';
|
|
4
4
|
import { contrastOriginal } from './contrastOriginal';
|
|
5
|
-
export var useChanged = function useChanged(
|
|
6
|
-
var name =
|
|
7
|
-
names =
|
|
8
|
-
namesStr =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
equalWith = params.equalWith;
|
|
16
|
-
var _form = form;
|
|
17
|
-
var originalValue = (originalNames === null || originalNames === void 0 ? void 0 : originalNames.length) ? originalNames.map(function (originalName) {
|
|
18
|
-
return get(originalValues, originalName);
|
|
19
|
-
}) : get(originalValues, originalName);
|
|
5
|
+
export var useChanged = function useChanged(_ref) {
|
|
6
|
+
var name = _ref.name,
|
|
7
|
+
names = _ref.names,
|
|
8
|
+
namesStr = _ref.namesStr,
|
|
9
|
+
originalValues = _ref.originalValues,
|
|
10
|
+
form = _ref.form,
|
|
11
|
+
equalWith = _ref.equalWith;
|
|
12
|
+
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
13
|
+
return get(originalValues, name);
|
|
14
|
+
}) : get(originalValues, name);
|
|
20
15
|
var notWatch = !originalValues || originalValue === undefined;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var value = _Form.useWatch(namesStr || name, _form);
|
|
16
|
+
if (notWatch) form = [];
|
|
17
|
+
var value = _Form.useWatch(namesStr || name, form);
|
|
24
18
|
if (notWatch) return [false];
|
|
25
19
|
var changed = contrastOriginal({
|
|
26
|
-
value: value,
|
|
27
20
|
originalValue: originalValue,
|
|
28
|
-
|
|
21
|
+
value: value,
|
|
29
22
|
form: form,
|
|
30
23
|
equalWith: equalWith
|
|
31
24
|
});
|