@zat-design/sisyphus-react 3.9.3 → 3.9.4-beta.1
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 +42 -1
- package/dist/less.esm.css +38 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -1
- package/es/ProEditTable/components/RenderField/index.js +41 -30
- package/es/ProEditTable/propsType.d.ts +1 -0
- package/es/ProEditTable/style/index.less +41 -0
- package/es/ProForm/components/combination/ProCascader/index.js +11 -5
- package/es/ProForm/components/render/ChangedWrapper.js +14 -10
- package/es/ProForm/style/index.less +8 -0
- package/es/ProForm/utils/useShouldUpdate.js +10 -2
- package/es/ProStep/components/Item/index.js +13 -4
- package/es/style/theme/antd.less +4 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -1
- package/lib/ProEditTable/components/RenderField/index.js +41 -30
- package/lib/ProEditTable/propsType.d.ts +1 -0
- package/lib/ProEditTable/style/index.less +41 -0
- package/lib/ProForm/components/combination/ProCascader/index.js +10 -4
- package/lib/ProForm/components/render/ChangedWrapper.js +14 -10
- package/lib/ProForm/style/index.less +8 -0
- package/lib/ProForm/utils/useShouldUpdate.js +10 -2
- package/lib/ProStep/components/Item/index.js +13 -4
- package/lib/style/theme/antd.less +4 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
package/dist/index.esm.css
CHANGED
@@ -3110,6 +3110,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3110
3110
|
.pro-form .pro-form-item-changed .ant-select.ant-select-disabled .ant-select-selector {
|
3111
3111
|
background: var(--zaui-contract-bg, #fffaa1) !important;
|
3112
3112
|
}
|
3113
|
+
.pro-form .pro-form-item-changed .ant-picker-clear {
|
3114
|
+
background: var(--zaui-contract-bg, #fffaa1);
|
3115
|
+
}
|
3113
3116
|
.pro-form .pro-form-item-changed span.ant-input-affix-wrapper,
|
3114
3117
|
.pro-form .pro-form-item-changed .ant-select .ant-select-selector,
|
3115
3118
|
.pro-form .pro-form-item-changed .ant-picker,
|
@@ -3165,6 +3168,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3165
3168
|
.pro-form .pro-form-item-add .ant-select.ant-select-disabled .ant-select-selector {
|
3166
3169
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
3167
3170
|
}
|
3171
|
+
.pro-form .pro-form-item-add .ant-picker-clear {
|
3172
|
+
background: var(--zaui-contract-bg-add, #d2fff4);
|
3173
|
+
}
|
3168
3174
|
.pro-form .pro-form-item-add span.ant-input-affix-wrapper,
|
3169
3175
|
.pro-form .pro-form-item-add .ant-select .ant-select-selector,
|
3170
3176
|
.pro-form .pro-form-item-add .ant-picker,
|
@@ -4672,6 +4678,38 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
4672
4678
|
.pro-edit-table .ant-table.ant-table-scroll-horizontal table .ant-table-tbody .is-new-row.ant-table-row:hover .ant-table-cell-row-hover {
|
4673
4679
|
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
4674
4680
|
}
|
4681
|
+
.pro-edit-table * {
|
4682
|
+
scrollbar-face-color: #d2d3d7;
|
4683
|
+
scrollbar-highlight-color: #979797;
|
4684
|
+
scrollbar-3dlight-color: #979797;
|
4685
|
+
}
|
4686
|
+
.pro-edit-table * ::-webkit-scrollbar-thumb {
|
4687
|
+
background-color: #979797;
|
4688
|
+
background-clip: padding-box;
|
4689
|
+
border-color: transparent;
|
4690
|
+
border-style: dashed;
|
4691
|
+
border-width: 4px;
|
4692
|
+
border-radius: 10px;
|
4693
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
4694
|
+
}
|
4695
|
+
.pro-edit-table * ::-webkit-scrollbar-track {
|
4696
|
+
background: transparent;
|
4697
|
+
}
|
4698
|
+
.pro-edit-table * ::-webkit-scrollbar-thumb {
|
4699
|
+
background-color: #d2d3d7;
|
4700
|
+
background-clip: padding-box;
|
4701
|
+
border-color: transparent;
|
4702
|
+
border-style: dashed;
|
4703
|
+
border-width: 4px;
|
4704
|
+
border-radius: 10px;
|
4705
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
4706
|
+
}
|
4707
|
+
.pro-edit-table * ::-webkit-scrollbar-thumb {
|
4708
|
+
background-color: #979797;
|
4709
|
+
}
|
4710
|
+
.pro-edit-table * ::-webkit-scrollbar-track {
|
4711
|
+
background: transparent;
|
4712
|
+
}
|
4675
4713
|
.pro-edit-table-footer {
|
4676
4714
|
margin-top: 12px;
|
4677
4715
|
}
|
@@ -6043,5 +6081,8 @@ input[type='button'] {
|
|
6043
6081
|
--antd-arrow-background-color: linear-gradient(to right bottom, rgba(255, 255, 255, 0.95), #ffffff);
|
6044
6082
|
}
|
6045
6083
|
.ant-picker.ant-picker-disabled {
|
6046
|
-
background: var(--zaui-disabled-bg);
|
6084
|
+
background: var(--zaui-disabled-bg) !important;
|
6085
|
+
}
|
6086
|
+
.ant-input-affix-wrapper-disabled {
|
6087
|
+
background: var(--zaui-disabled-bg) !important;
|
6047
6088
|
}
|
package/dist/less.esm.css
CHANGED
@@ -3110,6 +3110,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3110
3110
|
.pro-form .pro-form-item-changed .ant-select.ant-select-disabled .ant-select-selector {
|
3111
3111
|
background: var(--zaui-contract-bg, #fffaa1) !important;
|
3112
3112
|
}
|
3113
|
+
.pro-form .pro-form-item-changed .ant-picker-clear {
|
3114
|
+
background: var(--zaui-contract-bg, #fffaa1);
|
3115
|
+
}
|
3113
3116
|
.pro-form .pro-form-item-changed span.ant-input-affix-wrapper,
|
3114
3117
|
.pro-form .pro-form-item-changed .ant-select .ant-select-selector,
|
3115
3118
|
.pro-form .pro-form-item-changed .ant-picker,
|
@@ -3165,6 +3168,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3165
3168
|
.pro-form .pro-form-item-add .ant-select.ant-select-disabled .ant-select-selector {
|
3166
3169
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
3167
3170
|
}
|
3171
|
+
.pro-form .pro-form-item-add .ant-picker-clear {
|
3172
|
+
background: var(--zaui-contract-bg-add, #d2fff4);
|
3173
|
+
}
|
3168
3174
|
.pro-form .pro-form-item-add span.ant-input-affix-wrapper,
|
3169
3175
|
.pro-form .pro-form-item-add .ant-select .ant-select-selector,
|
3170
3176
|
.pro-form .pro-form-item-add .ant-picker,
|
@@ -4672,6 +4678,38 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
4672
4678
|
.pro-edit-table .ant-table.ant-table-scroll-horizontal table .ant-table-tbody .is-new-row.ant-table-row:hover .ant-table-cell-row-hover {
|
4673
4679
|
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
4674
4680
|
}
|
4681
|
+
.pro-edit-table * {
|
4682
|
+
scrollbar-face-color: #d2d3d7;
|
4683
|
+
scrollbar-highlight-color: #979797;
|
4684
|
+
scrollbar-3dlight-color: #979797;
|
4685
|
+
}
|
4686
|
+
.pro-edit-table * ::-webkit-scrollbar-thumb {
|
4687
|
+
background-color: #979797;
|
4688
|
+
background-clip: padding-box;
|
4689
|
+
border-color: transparent;
|
4690
|
+
border-style: dashed;
|
4691
|
+
border-width: 4px;
|
4692
|
+
border-radius: 10px;
|
4693
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
4694
|
+
}
|
4695
|
+
.pro-edit-table * ::-webkit-scrollbar-track {
|
4696
|
+
background: transparent;
|
4697
|
+
}
|
4698
|
+
.pro-edit-table * ::-webkit-scrollbar-thumb {
|
4699
|
+
background-color: #d2d3d7;
|
4700
|
+
background-clip: padding-box;
|
4701
|
+
border-color: transparent;
|
4702
|
+
border-style: dashed;
|
4703
|
+
border-width: 4px;
|
4704
|
+
border-radius: 10px;
|
4705
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
4706
|
+
}
|
4707
|
+
.pro-edit-table * ::-webkit-scrollbar-thumb {
|
4708
|
+
background-color: #979797;
|
4709
|
+
}
|
4710
|
+
.pro-edit-table * ::-webkit-scrollbar-track {
|
4711
|
+
background: transparent;
|
4712
|
+
}
|
4675
4713
|
.pro-edit-table-footer {
|
4676
4714
|
margin-top: 12px;
|
4677
4715
|
}
|
@@ -120,9 +120,15 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
120
120
|
if (!isWatch || noChange) return 'same';
|
121
121
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
122
122
|
: props[valuePropName];
|
123
|
+
// fix:修复 DatePicker时,originalValue与最新值一致时,显示为 changed的问题
|
124
|
+
var _originalValue = normalize && ['DatePicker'].includes(props.type) ? normalize(originalValue, undefined, undefined, true) : originalValue;
|
125
|
+
// fix:修复 InputNumber 时,originalValue与最新值一致都为'0'时,显示为 changed的问题
|
126
|
+
if (['InputNumber'].includes(props.type) && normalize && _value === Number(originalValue)) {
|
127
|
+
return 'same';
|
128
|
+
}
|
123
129
|
return diffOriginal({
|
124
130
|
value: _value,
|
125
|
-
originalValue:
|
131
|
+
originalValue: _originalValue,
|
126
132
|
form: form,
|
127
133
|
equalWith: equalWith
|
128
134
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
@@ -6,7 +6,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
7
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
9
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "onDiff", "className", "trim", "confirm"];
|
9
|
+
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "onDiff", "className", "trim", "confirm", "dependencies"];
|
10
10
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
11
11
|
/* eslint-disable prefer-destructuring */
|
12
12
|
/* eslint-disable prefer-const */
|
@@ -57,6 +57,7 @@ var RenderField = function RenderField(_ref) {
|
|
57
57
|
className = column.className,
|
58
58
|
trim = column.trim,
|
59
59
|
confirm = column.confirm,
|
60
|
+
dependencies = column.dependencies,
|
60
61
|
resetProps = _objectWithoutProperties(column, _excluded);
|
61
62
|
// editRender弃用使用component同ProForm
|
62
63
|
var _editRender = component || editRender;
|
@@ -312,6 +313,8 @@ var RenderField = function RenderField(_ref) {
|
|
312
313
|
_key2,
|
313
314
|
_args,
|
314
315
|
rowPath,
|
316
|
+
_dependencies$map,
|
317
|
+
validateFieldKeys,
|
315
318
|
row,
|
316
319
|
orgRow,
|
317
320
|
_TargetComponent,
|
@@ -323,77 +326,85 @@ var RenderField = function RenderField(_ref) {
|
|
323
326
|
_Object$keys,
|
324
327
|
_Object$keys$map,
|
325
328
|
diff,
|
326
|
-
|
329
|
+
_validateFieldKeys,
|
327
330
|
_args2 = arguments;
|
328
331
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
329
332
|
while (1) switch (_context.prev = _context.next) {
|
330
333
|
case 0:
|
331
|
-
if (!(!onFieldChange && !onChange)) {
|
332
|
-
_context.next = 2;
|
333
|
-
break;
|
334
|
-
}
|
335
|
-
return _context.abrupt("return", null);
|
336
|
-
case 2:
|
337
334
|
for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
338
335
|
args[_key2] = _args2[_key2];
|
339
336
|
}
|
340
337
|
_args = [].concat(args);
|
341
338
|
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
342
|
-
|
339
|
+
if (!(!onFieldChange && !onChange)) {
|
340
|
+
_context.next = 6;
|
341
|
+
break;
|
342
|
+
}
|
343
|
+
if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
|
344
|
+
validateFieldKeys = dependencies === null || dependencies === void 0 ? void 0 : (_dependencies$map = dependencies.map) === null || _dependencies$map === void 0 ? void 0 : _dependencies$map.call(dependencies, function (key) {
|
345
|
+
return [].concat(_toConsumableArray(rowPath), [key]);
|
346
|
+
});
|
347
|
+
setTimeout(function () {
|
348
|
+
form.validateFields(validateFieldKeys);
|
349
|
+
}, 100);
|
350
|
+
}
|
351
|
+
return _context.abrupt("return", null);
|
352
|
+
case 6:
|
353
|
+
row = form.getFieldValue(rowPath, true);
|
343
354
|
orgRow = cloneDeep(row);
|
344
355
|
if (!onFieldChange) {
|
345
|
-
_context.next =
|
356
|
+
_context.next = 21;
|
346
357
|
break;
|
347
358
|
}
|
348
359
|
_args = formatArgs(args);
|
349
360
|
_args[1] = row;
|
350
361
|
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
|
351
362
|
if (!_context.t0) {
|
352
|
-
_context.next =
|
363
|
+
_context.next = 15;
|
353
364
|
break;
|
354
365
|
}
|
355
|
-
_context.next =
|
366
|
+
_context.next = 15;
|
356
367
|
return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, _toConsumableArray(_args));
|
357
|
-
case
|
368
|
+
case 15:
|
358
369
|
_context.t1 = onFieldChange;
|
359
370
|
if (!_context.t1) {
|
360
|
-
_context.next =
|
371
|
+
_context.next = 19;
|
361
372
|
break;
|
362
373
|
}
|
363
|
-
_context.next =
|
374
|
+
_context.next = 19;
|
364
375
|
return onFieldChange.apply(void 0, _toConsumableArray(_args));
|
365
|
-
case
|
366
|
-
_context.next =
|
376
|
+
case 19:
|
377
|
+
_context.next = 30;
|
367
378
|
break;
|
368
|
-
case
|
379
|
+
case 21:
|
369
380
|
_args = _args.concat([row, index, form]);
|
370
381
|
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
|
371
382
|
if (!_context.t2) {
|
372
|
-
_context.next =
|
383
|
+
_context.next = 26;
|
373
384
|
break;
|
374
385
|
}
|
375
|
-
_context.next =
|
386
|
+
_context.next = 26;
|
376
387
|
return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, _toConsumableArray(_args));
|
377
|
-
case
|
388
|
+
case 26:
|
378
389
|
_context.t3 = onChange;
|
379
390
|
if (!_context.t3) {
|
380
|
-
_context.next =
|
391
|
+
_context.next = 30;
|
381
392
|
break;
|
382
393
|
}
|
383
|
-
_context.next =
|
394
|
+
_context.next = 30;
|
384
395
|
return onChange.apply(void 0, _toConsumableArray(_args));
|
385
|
-
case
|
396
|
+
case 30:
|
386
397
|
// 判断属性是否变动
|
387
398
|
form.setFieldValue(rowPath, row);
|
388
399
|
if (validateTrigger && validateTrigger.includes('onChange')) {
|
389
400
|
if (!isEqual(orgRow, row)) {
|
390
401
|
diff = difference(row, orgRow) || {};
|
391
|
-
|
402
|
+
_validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
392
403
|
return [].concat(_toConsumableArray(rowPath), [key]);
|
393
|
-
});
|
394
|
-
if (
|
404
|
+
}).concat(dependencies || []);
|
405
|
+
if (_validateFieldKeys === null || _validateFieldKeys === void 0 ? void 0 : _validateFieldKeys.length) {
|
395
406
|
setTimeout(function () {
|
396
|
-
form.validateFields(
|
407
|
+
form.validateFields(_validateFieldKeys);
|
397
408
|
}, 100);
|
398
409
|
}
|
399
410
|
}
|
@@ -403,7 +414,7 @@ var RenderField = function RenderField(_ref) {
|
|
403
414
|
d: Date.now()
|
404
415
|
}
|
405
416
|
});
|
406
|
-
case
|
417
|
+
case 33:
|
407
418
|
case "end":
|
408
419
|
return _context.stop();
|
409
420
|
}
|
@@ -464,7 +475,7 @@ var RenderField = function RenderField(_ref) {
|
|
464
475
|
diff = difference(row, orgRow) || {};
|
465
476
|
validateFieldKeys = (_Object$keys2 = Object.keys(diff)) === null || _Object$keys2 === void 0 ? void 0 : (_Object$keys2$map = _Object$keys2.map) === null || _Object$keys2$map === void 0 ? void 0 : _Object$keys2$map.call(_Object$keys2, function (key) {
|
466
477
|
return [].concat(_toConsumableArray(rowPath), [key]);
|
467
|
-
});
|
478
|
+
}).concat(dependencies || []);
|
468
479
|
if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
|
469
480
|
debounceValidate(validateFieldKeys);
|
470
481
|
}
|
@@ -106,6 +106,7 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
|
|
106
106
|
hiddenNames?: NamePath[] | NamePath[][];
|
107
107
|
rules?: ProRule[] | RulesFn<T>;
|
108
108
|
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
109
|
+
dependencies?: NamePath[];
|
109
110
|
onDiff?: DiffOriginalParams['equalWith'];
|
110
111
|
[key: string]: any;
|
111
112
|
}
|
@@ -305,6 +305,47 @@
|
|
305
305
|
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
306
306
|
}
|
307
307
|
}
|
308
|
+
|
309
|
+
* {
|
310
|
+
// ie浏览器
|
311
|
+
scrollbar-face-color: #d2d3d7;
|
312
|
+
scrollbar-highlight-color: #979797;
|
313
|
+
scrollbar-3dlight-color: #979797;
|
314
|
+
|
315
|
+
// 悬浮轨道
|
316
|
+
::-webkit-scrollbar-thumb {
|
317
|
+
background-color: #979797;
|
318
|
+
background-clip: padding-box;
|
319
|
+
border-color: transparent;
|
320
|
+
border-style: dashed;
|
321
|
+
border-width: 4px;
|
322
|
+
border-radius: 10px;
|
323
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
324
|
+
}
|
325
|
+
|
326
|
+
::-webkit-scrollbar-track {
|
327
|
+
background: transparent;
|
328
|
+
}
|
329
|
+
|
330
|
+
::-webkit-scrollbar-thumb {
|
331
|
+
background-color: #d2d3d7;
|
332
|
+
background-clip: padding-box;
|
333
|
+
border-color: transparent;
|
334
|
+
border-style: dashed;
|
335
|
+
border-width: 4px;
|
336
|
+
border-radius: 10px;
|
337
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
338
|
+
}
|
339
|
+
|
340
|
+
::-webkit-scrollbar-thumb {
|
341
|
+
background-color: #979797;
|
342
|
+
}
|
343
|
+
|
344
|
+
::-webkit-scrollbar-track {
|
345
|
+
background: transparent;
|
346
|
+
}
|
347
|
+
}
|
348
|
+
|
308
349
|
}
|
309
350
|
|
310
351
|
.pro-edit-table-footer{
|
@@ -16,7 +16,7 @@ import _Typography from "antd/es/typography";
|
|
16
16
|
var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder", "scrollFollowParent"];
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
18
18
|
import { useEffect, useState, memo, useMemo } from 'react';
|
19
|
-
import { omit, find as _find } from 'lodash';
|
19
|
+
import { omit, find as _find, isBoolean } from 'lodash';
|
20
20
|
import { transformDataName } from './utils/index';
|
21
21
|
import { useProConfig } from '../../../../ProConfigProvider';
|
22
22
|
import useEnum from '../../../../ProEnum/hooks/useEnum';
|
@@ -111,6 +111,12 @@ var ProCascader = function ProCascader(props) {
|
|
111
111
|
var result = transformDataName(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
112
112
|
return result;
|
113
113
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
114
|
+
var lastDisabled = useMemo(function () {
|
115
|
+
if (isBoolean(disabled) || disabled === undefined) {
|
116
|
+
return [disabled, disabled];
|
117
|
+
}
|
118
|
+
return disabled;
|
119
|
+
}, [disabled]);
|
114
120
|
var _useRequest = _objectSpread({}, useRequest),
|
115
121
|
service = _useRequest.service,
|
116
122
|
_useRequest$defaultPa = _useRequest.defaultParams,
|
@@ -268,7 +274,7 @@ var ProCascader = function ProCascader(props) {
|
|
268
274
|
placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar = locale.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
|
269
275
|
value: addressValue,
|
270
276
|
options: service ? serviceData : realDataSource,
|
271
|
-
disabled:
|
277
|
+
disabled: lastDisabled[0],
|
272
278
|
displayRender: displayRender,
|
273
279
|
showSearch: {
|
274
280
|
filter: handlefilter,
|
@@ -278,19 +284,19 @@ var ProCascader = function ProCascader(props) {
|
|
278
284
|
getPopupContainer: function getPopupContainer(trigger) {
|
279
285
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
280
286
|
}
|
281
|
-
}, omit(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip &&
|
287
|
+
}, omit(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip && lastDisabled[1] && detail ? _jsx(_Tooltip, {
|
282
288
|
title: detail,
|
283
289
|
children: _jsx("span", {
|
284
290
|
className: "pro-address-detail",
|
285
291
|
children: _jsx(_Input, {
|
286
|
-
disabled:
|
292
|
+
disabled: lastDisabled[1],
|
287
293
|
value: detail
|
288
294
|
})
|
289
295
|
})
|
290
296
|
}) : _jsx(_Input, {
|
291
297
|
allowClear: true,
|
292
298
|
autoComplete: "off",
|
293
|
-
disabled:
|
299
|
+
disabled: lastDisabled[1],
|
294
300
|
value: detail,
|
295
301
|
maxLength: detailMaxLength,
|
296
302
|
placeholder: detailPlaceholder || (locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar2 = locale.ProAddressBar) === null || _locale$ProAddressBar2 === void 0 ? void 0 : _locale$ProAddressBar2.detailPlaceholder),
|
@@ -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 _typeof from "@babel/runtime/helpers/esm/typeof";
|
5
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
6
7
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
@@ -47,9 +48,15 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
47
48
|
if (!isWatch || noChange) return 'same';
|
48
49
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
49
50
|
: props[valuePropName];
|
51
|
+
// fix:修复 DatePicker时,originalValue与最新值一致时,显示为 changed的问题
|
52
|
+
var _originalValue = normalize && ['DatePicker'].includes(props.type) ? normalize(originalValue, undefined, undefined, true) : originalValue;
|
53
|
+
// fix:修复 InputNumber 时,originalValue与最新值一致都为'0'时,显示为 changed的问题
|
54
|
+
if (['InputNumber'].includes(props.type) && normalize && _value === Number(originalValue)) {
|
55
|
+
return 'same';
|
56
|
+
}
|
50
57
|
return diffOriginal({
|
51
|
-
originalValue: originalValue,
|
52
58
|
value: _value,
|
59
|
+
originalValue: _originalValue,
|
53
60
|
form: form,
|
54
61
|
equalWith: equalWith
|
55
62
|
// name: namesStr || name,
|
@@ -57,23 +64,20 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
57
64
|
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
58
65
|
var isAdd = diffType === 'add';
|
59
66
|
var isChanged = diffType === 'changed';
|
60
|
-
var viewRenderFun = useMemo(function () {
|
61
|
-
return function (orgValue) {
|
62
|
-
return viewRender(orgValue, originalValues, {
|
63
|
-
form: form
|
64
|
-
});
|
65
|
-
};
|
66
|
-
}, [form]);
|
67
67
|
var tipContent = useMemo(function () {
|
68
68
|
if (!isWatch || noChange) return undefined;
|
69
69
|
var valueProps = getValueProps && !names ? getValueProps(originalValue) : {
|
70
70
|
value: originalValue
|
71
71
|
};
|
72
|
-
if (viewRender)
|
72
|
+
if (viewRender) {
|
73
|
+
return viewRender(valueProps === null || valueProps === void 0 ? void 0 : valueProps.value, originalValues, {
|
74
|
+
form: form
|
75
|
+
});
|
76
|
+
}
|
73
77
|
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
|
74
78
|
isView: true
|
75
79
|
}, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
|
76
|
-
}, [originalValue, children]);
|
80
|
+
}, [_typeof(viewRender), originalValue, children]);
|
77
81
|
if (!isWatch || noChange) {
|
78
82
|
// 嵌套子组件
|
79
83
|
var isNestedField = ['ProEditTable'].includes(type);
|
@@ -341,6 +341,10 @@
|
|
341
341
|
background: @zaui-contract-bg !important;
|
342
342
|
}
|
343
343
|
|
344
|
+
.ant-picker-clear {
|
345
|
+
background: @zaui-contract-bg;
|
346
|
+
}
|
347
|
+
|
344
348
|
span.@{ant-prefix}-input-affix-wrapper,
|
345
349
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
346
350
|
.@{ant-prefix}-picker,
|
@@ -419,6 +423,10 @@
|
|
419
423
|
background: @zaui-contract-bg-add !important;
|
420
424
|
}
|
421
425
|
|
426
|
+
.ant-picker-clear {
|
427
|
+
background: @zaui-contract-bg-add;
|
428
|
+
}
|
429
|
+
|
422
430
|
span.@{ant-prefix}-input-affix-wrapper,
|
423
431
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
424
432
|
.@{ant-prefix}-picker,
|
@@ -2,6 +2,14 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import { useRef, useState } from 'react';
|
3
3
|
import { isFunction, isEqualWith, get } from 'lodash';
|
4
4
|
import { customEqualForFun } from './index';
|
5
|
+
/** FormList中被删除的行也会再触发一次响应式函数 排除这种场景 */
|
6
|
+
var isDeleteLine = function isDeleteLine(form, namePath) {
|
7
|
+
if (namePath) {
|
8
|
+
var line = form.getFieldValue(namePath);
|
9
|
+
return line === undefined;
|
10
|
+
}
|
11
|
+
return false;
|
12
|
+
};
|
5
13
|
// 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
|
6
14
|
var useShouldUpdate = function useShouldUpdate(props) {
|
7
15
|
var show = props.show,
|
@@ -64,7 +72,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
64
72
|
}
|
65
73
|
if (isFunction(disabled)) {
|
66
74
|
// RangePicker返回数组时,特殊处理
|
67
|
-
if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
|
75
|
+
if (['Group', 'RangePicker', 'ProCascader'].includes(type) && Array.isArray(disabled(values, {
|
68
76
|
form: form,
|
69
77
|
index: index,
|
70
78
|
namePath: namePath
|
@@ -169,7 +177,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
169
177
|
namePath: namePath
|
170
178
|
}) : fieldProps;
|
171
179
|
// 清值防抖 多次刷新时以最后一次为准
|
172
|
-
if (clearNotShow !== false && (name || names)) {
|
180
|
+
if (clearNotShow !== false && (name || names) && !isDeleteLine(form, namePath)) {
|
173
181
|
// 当show为其他变为false的时候记录一次需要清值
|
174
182
|
if (_show !== showRef.current && _show === false) {
|
175
183
|
needClear.current = true;
|
@@ -2,6 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["id", "title", "collapse", "children"];
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
import { useEffect } from 'react';
|
5
6
|
import { useStep } from '../../index';
|
6
7
|
import ProCollapse from '../../../ProLayout/components/ProCollapse';
|
7
8
|
export default (function (_ref) {
|
@@ -14,10 +15,18 @@ export default (function (_ref) {
|
|
14
15
|
var _useStep = useStep(),
|
15
16
|
register = _useStep.register,
|
16
17
|
collapse = _useStep.collapse;
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
useEffect(function () {
|
19
|
+
// 子组件更新父组件 延迟状态更新,避免重渲染
|
20
|
+
var timeoutId = setTimeout(function () {
|
21
|
+
register === null || register === void 0 ? void 0 : register(_objectSpread(_objectSpread({}, restProps), {}, {
|
22
|
+
title: title,
|
23
|
+
id: id
|
24
|
+
}));
|
25
|
+
}, 0);
|
26
|
+
return function () {
|
27
|
+
return clearTimeout(timeoutId);
|
28
|
+
};
|
29
|
+
}, [register]);
|
21
30
|
return _jsx("div", {
|
22
31
|
className: "pro-step-item",
|
23
32
|
id: id,
|
package/es/style/theme/antd.less
CHANGED
@@ -753,6 +753,9 @@
|
|
753
753
|
}
|
754
754
|
|
755
755
|
.@{ant-prefix}-picker.@{ant-prefix}-picker-disabled {
|
756
|
-
background: var(--zaui-disabled-bg);
|
756
|
+
background: var(--zaui-disabled-bg) !important;
|
757
757
|
}
|
758
758
|
|
759
|
+
.@{ant-prefix}-input-affix-wrapper-disabled {
|
760
|
+
background: var(--zaui-disabled-bg) !important;
|
761
|
+
}
|
@@ -125,9 +125,15 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
125
125
|
if (!isWatch || noChange) return 'same';
|
126
126
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
127
127
|
: props[valuePropName];
|
128
|
+
// fix:修复 DatePicker时,originalValue与最新值一致时,显示为 changed的问题
|
129
|
+
var _originalValue = normalize && ['DatePicker'].includes(props.type) ? normalize(originalValue, undefined, undefined, true) : originalValue;
|
130
|
+
// fix:修复 InputNumber 时,originalValue与最新值一致都为'0'时,显示为 changed的问题
|
131
|
+
if (['InputNumber'].includes(props.type) && normalize && _value === Number(originalValue)) {
|
132
|
+
return 'same';
|
133
|
+
}
|
128
134
|
return (0, _diffOriginal.diffOriginal)({
|
129
135
|
value: _value,
|
130
|
-
originalValue:
|
136
|
+
originalValue: _originalValue,
|
131
137
|
form: form,
|
132
138
|
equalWith: equalWith
|
133
139
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
@@ -30,7 +30,7 @@ var _utils = require("../../../ProForm/utils");
|
|
30
30
|
var _ConfirmWrapper = _interopRequireDefault(require("../../../ProForm/components/render/ConfirmWrapper"));
|
31
31
|
var _getDefaultProps = require("../../utils/getDefaultProps");
|
32
32
|
var _ListChangedWrapper = _interopRequireDefault(require("./ListChangedWrapper"));
|
33
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "onDiff", "className", "trim", "confirm"];
|
33
|
+
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "onDiff", "className", "trim", "confirm", "dependencies"];
|
34
34
|
/* eslint-disable prefer-destructuring */
|
35
35
|
/* eslint-disable prefer-const */
|
36
36
|
var RenderField = function RenderField(_ref) {
|
@@ -64,6 +64,7 @@ var RenderField = function RenderField(_ref) {
|
|
64
64
|
className = column.className,
|
65
65
|
trim = column.trim,
|
66
66
|
confirm = column.confirm,
|
67
|
+
dependencies = column.dependencies,
|
67
68
|
resetProps = (0, _objectWithoutProperties2.default)(column, _excluded);
|
68
69
|
// editRender弃用使用component同ProForm
|
69
70
|
var _editRender = component || editRender;
|
@@ -319,6 +320,8 @@ var RenderField = function RenderField(_ref) {
|
|
319
320
|
_key2,
|
320
321
|
_args,
|
321
322
|
rowPath,
|
323
|
+
_dependencies$map,
|
324
|
+
validateFieldKeys,
|
322
325
|
row,
|
323
326
|
orgRow,
|
324
327
|
_TargetComponent,
|
@@ -330,77 +333,85 @@ var RenderField = function RenderField(_ref) {
|
|
330
333
|
_Object$keys,
|
331
334
|
_Object$keys$map,
|
332
335
|
diff,
|
333
|
-
|
336
|
+
_validateFieldKeys,
|
334
337
|
_args2 = arguments;
|
335
338
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
336
339
|
while (1) switch (_context.prev = _context.next) {
|
337
340
|
case 0:
|
338
|
-
if (!(!onFieldChange && !onChange)) {
|
339
|
-
_context.next = 2;
|
340
|
-
break;
|
341
|
-
}
|
342
|
-
return _context.abrupt("return", null);
|
343
|
-
case 2:
|
344
341
|
for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
345
342
|
args[_key2] = _args2[_key2];
|
346
343
|
}
|
347
344
|
_args = [].concat(args);
|
348
345
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
349
|
-
|
346
|
+
if (!(!onFieldChange && !onChange)) {
|
347
|
+
_context.next = 6;
|
348
|
+
break;
|
349
|
+
}
|
350
|
+
if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
|
351
|
+
validateFieldKeys = dependencies === null || dependencies === void 0 ? void 0 : (_dependencies$map = dependencies.map) === null || _dependencies$map === void 0 ? void 0 : _dependencies$map.call(dependencies, function (key) {
|
352
|
+
return [].concat((0, _toConsumableArray2.default)(rowPath), [key]);
|
353
|
+
});
|
354
|
+
setTimeout(function () {
|
355
|
+
form.validateFields(validateFieldKeys);
|
356
|
+
}, 100);
|
357
|
+
}
|
358
|
+
return _context.abrupt("return", null);
|
359
|
+
case 6:
|
360
|
+
row = form.getFieldValue(rowPath, true);
|
350
361
|
orgRow = (0, _lodash.cloneDeep)(row);
|
351
362
|
if (!onFieldChange) {
|
352
|
-
_context.next =
|
363
|
+
_context.next = 21;
|
353
364
|
break;
|
354
365
|
}
|
355
366
|
_args = formatArgs(args);
|
356
367
|
_args[1] = row;
|
357
368
|
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
|
358
369
|
if (!_context.t0) {
|
359
|
-
_context.next =
|
370
|
+
_context.next = 15;
|
360
371
|
break;
|
361
372
|
}
|
362
|
-
_context.next =
|
373
|
+
_context.next = 15;
|
363
374
|
return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, (0, _toConsumableArray2.default)(_args));
|
364
|
-
case
|
375
|
+
case 15:
|
365
376
|
_context.t1 = onFieldChange;
|
366
377
|
if (!_context.t1) {
|
367
|
-
_context.next =
|
378
|
+
_context.next = 19;
|
368
379
|
break;
|
369
380
|
}
|
370
|
-
_context.next =
|
381
|
+
_context.next = 19;
|
371
382
|
return onFieldChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
372
|
-
case
|
373
|
-
_context.next =
|
383
|
+
case 19:
|
384
|
+
_context.next = 30;
|
374
385
|
break;
|
375
|
-
case
|
386
|
+
case 21:
|
376
387
|
_args = _args.concat([row, index, form]);
|
377
388
|
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
|
378
389
|
if (!_context.t2) {
|
379
|
-
_context.next =
|
390
|
+
_context.next = 26;
|
380
391
|
break;
|
381
392
|
}
|
382
|
-
_context.next =
|
393
|
+
_context.next = 26;
|
383
394
|
return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, (0, _toConsumableArray2.default)(_args));
|
384
|
-
case
|
395
|
+
case 26:
|
385
396
|
_context.t3 = onChange;
|
386
397
|
if (!_context.t3) {
|
387
|
-
_context.next =
|
398
|
+
_context.next = 30;
|
388
399
|
break;
|
389
400
|
}
|
390
|
-
_context.next =
|
401
|
+
_context.next = 30;
|
391
402
|
return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
392
|
-
case
|
403
|
+
case 30:
|
393
404
|
// 判断属性是否变动
|
394
405
|
form.setFieldValue(rowPath, row);
|
395
406
|
if (validateTrigger && validateTrigger.includes('onChange')) {
|
396
407
|
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
397
408
|
diff = (0, _tools.difference)(row, orgRow) || {};
|
398
|
-
|
409
|
+
_validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
399
410
|
return [].concat((0, _toConsumableArray2.default)(rowPath), [key]);
|
400
|
-
});
|
401
|
-
if (
|
411
|
+
}).concat(dependencies || []);
|
412
|
+
if (_validateFieldKeys === null || _validateFieldKeys === void 0 ? void 0 : _validateFieldKeys.length) {
|
402
413
|
setTimeout(function () {
|
403
|
-
form.validateFields(
|
414
|
+
form.validateFields(_validateFieldKeys);
|
404
415
|
}, 100);
|
405
416
|
}
|
406
417
|
}
|
@@ -410,7 +421,7 @@ var RenderField = function RenderField(_ref) {
|
|
410
421
|
d: Date.now()
|
411
422
|
}
|
412
423
|
});
|
413
|
-
case
|
424
|
+
case 33:
|
414
425
|
case "end":
|
415
426
|
return _context.stop();
|
416
427
|
}
|
@@ -471,7 +482,7 @@ var RenderField = function RenderField(_ref) {
|
|
471
482
|
diff = (0, _tools.difference)(row, orgRow) || {};
|
472
483
|
validateFieldKeys = (_Object$keys2 = Object.keys(diff)) === null || _Object$keys2 === void 0 ? void 0 : (_Object$keys2$map = _Object$keys2.map) === null || _Object$keys2$map === void 0 ? void 0 : _Object$keys2$map.call(_Object$keys2, function (key) {
|
473
484
|
return [].concat((0, _toConsumableArray2.default)(rowPath), [key]);
|
474
|
-
});
|
485
|
+
}).concat(dependencies || []);
|
475
486
|
if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
|
476
487
|
debounceValidate(validateFieldKeys);
|
477
488
|
}
|
@@ -106,6 +106,7 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
|
|
106
106
|
hiddenNames?: NamePath[] | NamePath[][];
|
107
107
|
rules?: ProRule[] | RulesFn<T>;
|
108
108
|
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
109
|
+
dependencies?: NamePath[];
|
109
110
|
onDiff?: DiffOriginalParams['equalWith'];
|
110
111
|
[key: string]: any;
|
111
112
|
}
|
@@ -305,6 +305,47 @@
|
|
305
305
|
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
306
306
|
}
|
307
307
|
}
|
308
|
+
|
309
|
+
* {
|
310
|
+
// ie浏览器
|
311
|
+
scrollbar-face-color: #d2d3d7;
|
312
|
+
scrollbar-highlight-color: #979797;
|
313
|
+
scrollbar-3dlight-color: #979797;
|
314
|
+
|
315
|
+
// 悬浮轨道
|
316
|
+
::-webkit-scrollbar-thumb {
|
317
|
+
background-color: #979797;
|
318
|
+
background-clip: padding-box;
|
319
|
+
border-color: transparent;
|
320
|
+
border-style: dashed;
|
321
|
+
border-width: 4px;
|
322
|
+
border-radius: 10px;
|
323
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
324
|
+
}
|
325
|
+
|
326
|
+
::-webkit-scrollbar-track {
|
327
|
+
background: transparent;
|
328
|
+
}
|
329
|
+
|
330
|
+
::-webkit-scrollbar-thumb {
|
331
|
+
background-color: #d2d3d7;
|
332
|
+
background-clip: padding-box;
|
333
|
+
border-color: transparent;
|
334
|
+
border-style: dashed;
|
335
|
+
border-width: 4px;
|
336
|
+
border-radius: 10px;
|
337
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
338
|
+
}
|
339
|
+
|
340
|
+
::-webkit-scrollbar-thumb {
|
341
|
+
background-color: #979797;
|
342
|
+
}
|
343
|
+
|
344
|
+
::-webkit-scrollbar-track {
|
345
|
+
background: transparent;
|
346
|
+
}
|
347
|
+
}
|
348
|
+
|
308
349
|
}
|
309
350
|
|
310
351
|
.pro-edit-table-footer{
|
@@ -111,6 +111,12 @@ var ProCascader = function ProCascader(props) {
|
|
111
111
|
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
112
112
|
return result;
|
113
113
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
114
|
+
var lastDisabled = (0, _react.useMemo)(function () {
|
115
|
+
if ((0, _lodash.isBoolean)(disabled) || disabled === undefined) {
|
116
|
+
return [disabled, disabled];
|
117
|
+
}
|
118
|
+
return disabled;
|
119
|
+
}, [disabled]);
|
114
120
|
var _useRequest = (0, _objectSpread3.default)({}, useRequest),
|
115
121
|
service = _useRequest.service,
|
116
122
|
_useRequest$defaultPa = _useRequest.defaultParams,
|
@@ -268,7 +274,7 @@ var ProCascader = function ProCascader(props) {
|
|
268
274
|
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar = _locale.default.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
|
269
275
|
value: addressValue,
|
270
276
|
options: service ? serviceData : realDataSource,
|
271
|
-
disabled:
|
277
|
+
disabled: lastDisabled[0],
|
272
278
|
displayRender: displayRender,
|
273
279
|
showSearch: {
|
274
280
|
filter: handlefilter,
|
@@ -278,19 +284,19 @@ var ProCascader = function ProCascader(props) {
|
|
278
284
|
getPopupContainer: function getPopupContainer(trigger) {
|
279
285
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
280
286
|
}
|
281
|
-
}, (0, _lodash.omit)(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip &&
|
287
|
+
}, (0, _lodash.omit)(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip && lastDisabled[1] && detail ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
282
288
|
title: detail,
|
283
289
|
children: (0, _jsxRuntime.jsx)("span", {
|
284
290
|
className: "pro-address-detail",
|
285
291
|
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
286
|
-
disabled:
|
292
|
+
disabled: lastDisabled[1],
|
287
293
|
value: detail
|
288
294
|
})
|
289
295
|
})
|
290
296
|
}) : (0, _jsxRuntime.jsx)(_antd.Input, {
|
291
297
|
allowClear: true,
|
292
298
|
autoComplete: "off",
|
293
|
-
disabled:
|
299
|
+
disabled: lastDisabled[1],
|
294
300
|
value: detail,
|
295
301
|
maxLength: detailMaxLength,
|
296
302
|
placeholder: detailPlaceholder || (_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar2 = _locale.default.ProAddressBar) === null || _locale$ProAddressBar2 === void 0 ? void 0 : _locale$ProAddressBar2.detailPlaceholder),
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.default = void 0;
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
11
|
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
@@ -52,9 +53,15 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
52
53
|
if (!isWatch || noChange) return 'same';
|
53
54
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
54
55
|
: props[valuePropName];
|
56
|
+
// fix:修复 DatePicker时,originalValue与最新值一致时,显示为 changed的问题
|
57
|
+
var _originalValue = normalize && ['DatePicker'].includes(props.type) ? normalize(originalValue, undefined, undefined, true) : originalValue;
|
58
|
+
// fix:修复 InputNumber 时,originalValue与最新值一致都为'0'时,显示为 changed的问题
|
59
|
+
if (['InputNumber'].includes(props.type) && normalize && _value === Number(originalValue)) {
|
60
|
+
return 'same';
|
61
|
+
}
|
55
62
|
return (0, _diffOriginal.diffOriginal)({
|
56
|
-
originalValue: originalValue,
|
57
63
|
value: _value,
|
64
|
+
originalValue: _originalValue,
|
58
65
|
form: form,
|
59
66
|
equalWith: equalWith
|
60
67
|
// name: namesStr || name,
|
@@ -62,23 +69,20 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
62
69
|
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
63
70
|
var isAdd = diffType === 'add';
|
64
71
|
var isChanged = diffType === 'changed';
|
65
|
-
var viewRenderFun = (0, _react.useMemo)(function () {
|
66
|
-
return function (orgValue) {
|
67
|
-
return viewRender(orgValue, originalValues, {
|
68
|
-
form: form
|
69
|
-
});
|
70
|
-
};
|
71
|
-
}, [form]);
|
72
72
|
var tipContent = (0, _react.useMemo)(function () {
|
73
73
|
if (!isWatch || noChange) return undefined;
|
74
74
|
var valueProps = getValueProps && !names ? getValueProps(originalValue) : {
|
75
75
|
value: originalValue
|
76
76
|
};
|
77
|
-
if (viewRender)
|
77
|
+
if (viewRender) {
|
78
|
+
return viewRender(valueProps === null || valueProps === void 0 ? void 0 : valueProps.value, originalValues, {
|
79
|
+
form: form
|
80
|
+
});
|
81
|
+
}
|
78
82
|
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
|
79
83
|
isView: true
|
80
84
|
}, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
|
81
|
-
}, [originalValue, children]);
|
85
|
+
}, [(0, _typeof2.default)(viewRender), originalValue, children]);
|
82
86
|
if (!isWatch || noChange) {
|
83
87
|
// 嵌套子组件
|
84
88
|
var isNestedField = ['ProEditTable'].includes(type);
|
@@ -341,6 +341,10 @@
|
|
341
341
|
background: @zaui-contract-bg !important;
|
342
342
|
}
|
343
343
|
|
344
|
+
.ant-picker-clear {
|
345
|
+
background: @zaui-contract-bg;
|
346
|
+
}
|
347
|
+
|
344
348
|
span.@{ant-prefix}-input-affix-wrapper,
|
345
349
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
346
350
|
.@{ant-prefix}-picker,
|
@@ -419,6 +423,10 @@
|
|
419
423
|
background: @zaui-contract-bg-add !important;
|
420
424
|
}
|
421
425
|
|
426
|
+
.ant-picker-clear {
|
427
|
+
background: @zaui-contract-bg-add;
|
428
|
+
}
|
429
|
+
|
422
430
|
span.@{ant-prefix}-input-affix-wrapper,
|
423
431
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
424
432
|
.@{ant-prefix}-picker,
|
@@ -9,6 +9,14 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
9
9
|
var _react = require("react");
|
10
10
|
var _lodash = require("lodash");
|
11
11
|
var _index = require("./index");
|
12
|
+
/** FormList中被删除的行也会再触发一次响应式函数 排除这种场景 */
|
13
|
+
var isDeleteLine = function isDeleteLine(form, namePath) {
|
14
|
+
if (namePath) {
|
15
|
+
var line = form.getFieldValue(namePath);
|
16
|
+
return line === undefined;
|
17
|
+
}
|
18
|
+
return false;
|
19
|
+
};
|
12
20
|
// 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
|
13
21
|
var useShouldUpdate = function useShouldUpdate(props) {
|
14
22
|
var show = props.show,
|
@@ -71,7 +79,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
71
79
|
}
|
72
80
|
if ((0, _lodash.isFunction)(disabled)) {
|
73
81
|
// RangePicker返回数组时,特殊处理
|
74
|
-
if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
|
82
|
+
if (['Group', 'RangePicker', 'ProCascader'].includes(type) && Array.isArray(disabled(values, {
|
75
83
|
form: form,
|
76
84
|
index: index,
|
77
85
|
namePath: namePath
|
@@ -176,7 +184,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
176
184
|
namePath: namePath
|
177
185
|
}) : fieldProps;
|
178
186
|
// 清值防抖 多次刷新时以最后一次为准
|
179
|
-
if (clearNotShow !== false && (name || names)) {
|
187
|
+
if (clearNotShow !== false && (name || names) && !isDeleteLine(form, namePath)) {
|
180
188
|
// 当show为其他变为false的时候记录一次需要清值
|
181
189
|
if (_show !== showRef.current && _show === false) {
|
182
190
|
needClear.current = true;
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
11
|
+
var _react = require("react");
|
11
12
|
var _index = require("../../index");
|
12
13
|
var _ProCollapse = _interopRequireDefault(require("../../../ProLayout/components/ProCollapse"));
|
13
14
|
var _excluded = ["id", "title", "collapse", "children"];
|
@@ -21,10 +22,18 @@ var _default = exports.default = function _default(_ref) {
|
|
21
22
|
var _useStep = (0, _index.useStep)(),
|
22
23
|
register = _useStep.register,
|
23
24
|
collapse = _useStep.collapse;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
(0, _react.useEffect)(function () {
|
26
|
+
// 子组件更新父组件 延迟状态更新,避免重渲染
|
27
|
+
var timeoutId = setTimeout(function () {
|
28
|
+
register === null || register === void 0 ? void 0 : register((0, _objectSpread2.default)((0, _objectSpread2.default)({}, restProps), {}, {
|
29
|
+
title: title,
|
30
|
+
id: id
|
31
|
+
}));
|
32
|
+
}, 0);
|
33
|
+
return function () {
|
34
|
+
return clearTimeout(timeoutId);
|
35
|
+
};
|
36
|
+
}, [register]);
|
28
37
|
return (0, _jsxRuntime.jsx)("div", {
|
29
38
|
className: "pro-step-item",
|
30
39
|
id: id,
|
@@ -753,6 +753,9 @@
|
|
753
753
|
}
|
754
754
|
|
755
755
|
.@{ant-prefix}-picker.@{ant-prefix}-picker-disabled {
|
756
|
-
background: var(--zaui-disabled-bg);
|
756
|
+
background: var(--zaui-disabled-bg) !important;
|
757
757
|
}
|
758
758
|
|
759
|
+
.@{ant-prefix}-input-affix-wrapper-disabled {
|
760
|
+
background: var(--zaui-disabled-bg) !important;
|
761
|
+
}
|
package/package.json
CHANGED