@zat-design/sisyphus-react 3.9.3 → 3.9.4-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  2. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  3. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  4. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  5. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  6. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  7. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  8. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  9. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  11. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  12. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  13. package/coverage/lcov-report/src/.umi/index.html +116 -0
  14. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  16. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  18. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  24. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  29. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  37. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  39. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  40. package/dist/index.esm.css +42 -1
  41. package/dist/less.esm.css +38 -0
  42. package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
  43. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +20 -11
  44. package/es/ProEditTable/components/RenderField/index.js +42 -32
  45. package/es/ProEditTable/propsType.d.ts +1 -0
  46. package/es/ProEditTable/style/index.less +41 -0
  47. package/es/ProEditTable/utils/diffOriginal.d.ts +21 -0
  48. package/es/ProEditTable/utils/diffOriginal.js +62 -0
  49. package/es/ProEnum/index.js +1 -1
  50. package/es/ProForm/components/combination/Group/utils.js +1 -1
  51. package/es/ProForm/components/combination/ProCascader/index.js +11 -5
  52. package/es/ProForm/components/render/ChangedWrapper.js +14 -10
  53. package/es/ProForm/style/index.less +8 -0
  54. package/es/ProForm/utils/useShouldUpdate.js +10 -2
  55. package/es/ProStep/components/Item/index.js +13 -4
  56. package/es/ProTable/components/FormatColumn/index.js +16 -5
  57. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -32
  58. package/es/ProTable/index.js +22 -15
  59. package/es/ProTable/propsType.d.ts +3 -2
  60. package/es/style/theme/antd.less +4 -1
  61. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
  62. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +20 -11
  63. package/lib/ProEditTable/components/RenderField/index.js +42 -32
  64. package/lib/ProEditTable/propsType.d.ts +1 -0
  65. package/lib/ProEditTable/style/index.less +41 -0
  66. package/lib/ProEditTable/utils/diffOriginal.d.ts +21 -0
  67. package/lib/ProEditTable/utils/diffOriginal.js +68 -0
  68. package/lib/ProEnum/index.js +1 -1
  69. package/lib/ProForm/components/combination/Group/utils.js +1 -1
  70. package/lib/ProForm/components/combination/ProCascader/index.js +10 -4
  71. package/lib/ProForm/components/render/ChangedWrapper.js +14 -10
  72. package/lib/ProForm/style/index.less +8 -0
  73. package/lib/ProForm/utils/useShouldUpdate.js +10 -2
  74. package/lib/ProStep/components/Item/index.js +13 -4
  75. package/lib/ProTable/components/FormatColumn/index.js +16 -5
  76. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -32
  77. package/lib/ProTable/index.js +22 -15
  78. package/lib/ProTable/propsType.d.ts +3 -2
  79. package/lib/style/theme/antd.less +4 -1
  80. package/package.json +1 -1
  81. package/.vscode/extensions.json +0 -5
@@ -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", "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 */
@@ -52,11 +52,11 @@ var RenderField = function RenderField(_ref) {
52
52
  required = _column$required === void 0 ? false : _column$required,
53
53
  _column$rules = column.rules,
54
54
  rules = _column$rules === void 0 ? [] : _column$rules,
55
- equalWith = column.equalWith,
56
55
  onDiff = column.onDiff,
57
56
  className = column.className,
58
57
  trim = column.trim,
59
58
  confirm = column.confirm,
59
+ dependencies = column.dependencies,
60
60
  resetProps = _objectWithoutProperties(column, _excluded);
61
61
  // editRender弃用使用component同ProForm
62
62
  var _editRender = component || editRender;
@@ -312,6 +312,8 @@ var RenderField = function RenderField(_ref) {
312
312
  _key2,
313
313
  _args,
314
314
  rowPath,
315
+ _dependencies$map,
316
+ validateFieldKeys,
315
317
  row,
316
318
  orgRow,
317
319
  _TargetComponent,
@@ -323,77 +325,85 @@ var RenderField = function RenderField(_ref) {
323
325
  _Object$keys,
324
326
  _Object$keys$map,
325
327
  diff,
326
- validateFieldKeys,
328
+ _validateFieldKeys,
327
329
  _args2 = arguments;
328
330
  return _regeneratorRuntime().wrap(function _callee$(_context) {
329
331
  while (1) switch (_context.prev = _context.next) {
330
332
  case 0:
331
- if (!(!onFieldChange && !onChange)) {
332
- _context.next = 2;
333
- break;
334
- }
335
- return _context.abrupt("return", null);
336
- case 2:
337
333
  for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
338
334
  args[_key2] = _args2[_key2];
339
335
  }
340
336
  _args = [].concat(args);
341
337
  rowPath = [].concat(_toConsumableArray(namePath), [index]);
342
- row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
338
+ if (!(!onFieldChange && !onChange)) {
339
+ _context.next = 6;
340
+ break;
341
+ }
342
+ if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
343
+ 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) {
344
+ return [].concat(_toConsumableArray(rowPath), [key]);
345
+ });
346
+ setTimeout(function () {
347
+ form.validateFields(validateFieldKeys);
348
+ }, 100);
349
+ }
350
+ return _context.abrupt("return", null);
351
+ case 6:
352
+ row = form.getFieldValue(rowPath, true);
343
353
  orgRow = cloneDeep(row);
344
354
  if (!onFieldChange) {
345
- _context.next = 20;
355
+ _context.next = 21;
346
356
  break;
347
357
  }
348
358
  _args = formatArgs(args);
349
359
  _args[1] = row;
350
360
  _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
361
  if (!_context.t0) {
352
- _context.next = 14;
362
+ _context.next = 15;
353
363
  break;
354
364
  }
355
- _context.next = 14;
365
+ _context.next = 15;
356
366
  return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, _toConsumableArray(_args));
357
- case 14:
367
+ case 15:
358
368
  _context.t1 = onFieldChange;
359
369
  if (!_context.t1) {
360
- _context.next = 18;
370
+ _context.next = 19;
361
371
  break;
362
372
  }
363
- _context.next = 18;
373
+ _context.next = 19;
364
374
  return onFieldChange.apply(void 0, _toConsumableArray(_args));
365
- case 18:
366
- _context.next = 29;
375
+ case 19:
376
+ _context.next = 30;
367
377
  break;
368
- case 20:
378
+ case 21:
369
379
  _args = _args.concat([row, index, form]);
370
380
  _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
381
  if (!_context.t2) {
372
- _context.next = 25;
382
+ _context.next = 26;
373
383
  break;
374
384
  }
375
- _context.next = 25;
385
+ _context.next = 26;
376
386
  return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, _toConsumableArray(_args));
377
- case 25:
387
+ case 26:
378
388
  _context.t3 = onChange;
379
389
  if (!_context.t3) {
380
- _context.next = 29;
390
+ _context.next = 30;
381
391
  break;
382
392
  }
383
- _context.next = 29;
393
+ _context.next = 30;
384
394
  return onChange.apply(void 0, _toConsumableArray(_args));
385
- case 29:
395
+ case 30:
386
396
  // 判断属性是否变动
387
397
  form.setFieldValue(rowPath, row);
388
398
  if (validateTrigger && validateTrigger.includes('onChange')) {
389
399
  if (!isEqual(orgRow, row)) {
390
400
  diff = difference(row, orgRow) || {};
391
- 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) {
401
+ _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
402
  return [].concat(_toConsumableArray(rowPath), [key]);
393
- });
394
- if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
403
+ }).concat(dependencies || []);
404
+ if (_validateFieldKeys === null || _validateFieldKeys === void 0 ? void 0 : _validateFieldKeys.length) {
395
405
  setTimeout(function () {
396
- form.validateFields(validateFieldKeys);
406
+ form.validateFields(_validateFieldKeys);
397
407
  }, 100);
398
408
  }
399
409
  }
@@ -403,7 +413,7 @@ var RenderField = function RenderField(_ref) {
403
413
  d: Date.now()
404
414
  }
405
415
  });
406
- case 32:
416
+ case 33:
407
417
  case "end":
408
418
  return _context.stop();
409
419
  }
@@ -464,7 +474,7 @@ var RenderField = function RenderField(_ref) {
464
474
  diff = difference(row, orgRow) || {};
465
475
  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
476
  return [].concat(_toConsumableArray(rowPath), [key]);
467
- });
477
+ }).concat(dependencies || []);
468
478
  if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
469
479
  debounceValidate(validateFieldKeys);
470
480
  }
@@ -557,7 +567,7 @@ var RenderField = function RenderField(_ref) {
557
567
  originalNames: originalNames,
558
568
  originalValues: originalValues,
559
569
  form: form,
560
- equalWith: onDiff || equalWith,
570
+ equalWith: onDiff,
561
571
  type: type,
562
572
  onChange: _onChange,
563
573
  valuePropName: _formItemProps.valuePropName,
@@ -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{
@@ -0,0 +1,21 @@
1
+ import { FormInstance } from 'antd';
2
+ export type DiffType = 'same' | 'add' | 'changed';
3
+ export interface DiffOriginalParams {
4
+ originalValue: any;
5
+ value: any;
6
+ form: FormInstance;
7
+ equalWith?: ({ originValue, originRecord, value, record, index }: {
8
+ originValue: any;
9
+ originRecord: any;
10
+ value: any;
11
+ record: any;
12
+ index: number;
13
+ }) => DiffType | undefined;
14
+ /** 原始行数据 */
15
+ originRecord: any;
16
+ /** 当前行数据 */
17
+ record: any;
18
+ /** 当前行索引 */
19
+ index: number;
20
+ }
21
+ export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
@@ -0,0 +1,62 @@
1
+ import { isEqual, isFunction, isObject } from 'lodash';
2
+ import { validate } from '@zat-design/utils';
3
+ var isEmpty = validate.isEmpty;
4
+ // 过滤对象中undefined字段
5
+ // 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
6
+ var filterObject = function filterObject(data) {
7
+ if (!isObject(data) || Array.isArray(data) || data === null) return data;
8
+ var resData = {};
9
+ Object.keys(data).forEach(function (key) {
10
+ if (!isEmpty(data[key])) {
11
+ resData[key] = data[key];
12
+ }
13
+ });
14
+ // 空对象视为null 比较时 null undefined {} [] '' 视为相等
15
+ if (!Object.keys(resData).length) return null;
16
+ return resData;
17
+ };
18
+ export var diffOriginal = function diffOriginal(params) {
19
+ var originalValue = params.originalValue,
20
+ value = params.value,
21
+ equalWith = params.equalWith,
22
+ originRecord = params.originRecord,
23
+ record = params.record,
24
+ index = params.index;
25
+ // 支持传入自定义比较事件
26
+ if (isFunction(equalWith)) {
27
+ var diffRes = equalWith({
28
+ originValue: originalValue,
29
+ originRecord: originRecord,
30
+ value: value,
31
+ record: record,
32
+ index: index
33
+ });
34
+ // 如果返回undefined走内置比较逻辑
35
+ if (diffRes !== undefined) {
36
+ if (typeof diffRes === 'boolean') {
37
+ return diffRes ? 'same' : 'changed';
38
+ }
39
+ return diffRes;
40
+ }
41
+ }
42
+ var _value = filterObject(value);
43
+ var _originalValue = filterObject(originalValue);
44
+ // 如果原始值为空 且当前有值的话 认为变更类型是新增
45
+ if (isEmpty(_originalValue) && !isEmpty(_value)) {
46
+ return 'add';
47
+ }
48
+ if (Array.isArray(_originalValue)) {
49
+ var isSame = _originalValue.every(function (valueItem, index) {
50
+ // 如果两个值有一个不是空值, 则进行深比较
51
+ if (!isEmpty(value === null || value === void 0 ? void 0 : value[index]) || !isEmpty(valueItem)) {
52
+ return isEqual(value === null || value === void 0 ? void 0 : value[index], valueItem);
53
+ }
54
+ return true;
55
+ });
56
+ return isSame ? 'same' : 'changed';
57
+ }
58
+ if (!isEmpty(_originalValue) || !isEmpty(_value)) {
59
+ return isEqual(_value, _originalValue) ? 'same' : 'changed';
60
+ }
61
+ return 'same';
62
+ };
@@ -230,7 +230,7 @@ var ProEnum = function ProEnum(props) {
230
230
  };
231
231
  if (!code && !dataSource && !useRequest) {
232
232
  var _locale$ProEnum4;
233
- _message.error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
233
+ _message.error("".concat(otherProps === null || otherProps === void 0 ? void 0 : otherProps.label, "-").concat(otherProps === null || otherProps === void 0 ? void 0 : otherProps.name, "-").concat(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType));
234
234
  }
235
235
  var transToLabel = function transToLabel(value) {
236
236
  var list = dataList && dataList.length ? dataList : enumLists;
@@ -329,7 +329,7 @@ export var useTransformColumns = function useTransformColumns(params) {
329
329
  }, reactiveProps), {}, {
330
330
  disabled: getLastDisabled(),
331
331
  getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
332
- fieldProps: _objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
332
+ fieldProps: _objectSpread(_objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), reactiveProps === null || reactiveProps === void 0 ? void 0 : reactiveProps.fieldProps), {}, {
333
333
  onChange: handleChange,
334
334
  onBlur: handleBlur,
335
335
  value: value === null || value === void 0 ? void 0 : value[index]
@@ -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: 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 && disabled && detail ? _jsx(_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: 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: 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) return viewRenderFun(valueProps === null || valueProps === void 0 ? void 0 : valueProps.value);
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
- register === null || register === void 0 ? void 0 : register(_objectSpread(_objectSpread({}, restProps), {}, {
18
- title: title,
19
- id: id
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,
@@ -123,11 +123,13 @@ export var formatColumn = function formatColumn(_ref2) {
123
123
  var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : null;
124
124
  var originalResult = getOriginalValue(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
125
125
  var originalValue = originalResult.originalValue;
126
+ var _originalValue = originalValue;
126
127
  var isChanged = originalResult.isChanged,
127
128
  isAddCell = originalResult.isAddCell;
128
129
  var isInNewRowFlag = isInNewRow(record);
129
130
  var _isAddCell = isAddCell;
130
131
  otherProps.isChanged = isChanged;
132
+ var nextValue = value;
131
133
  // 存在比对
132
134
  if (isFunction(otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewRender) && (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalDataSource)) {
133
135
  var _originalObj$record$r;
@@ -139,25 +141,34 @@ export var formatColumn = function formatColumn(_ref2) {
139
141
  index: index
140
142
  });
141
143
  // viewRender 返回值为 false 时,不显示对比
142
- if (isBoolean(diffResult)) {
144
+ if (isBoolean(diffResult) && !diffResult) {
143
145
  otherProps.isChanged = false;
144
146
  }
145
- originalValue = diffResult;
147
+ _originalValue = diffResult;
148
+ nextValue = otherProps.viewRender({
149
+ originalValue: value,
150
+ originalRecord: record !== null && record !== void 0 ? record : {},
151
+ value: value,
152
+ record: record,
153
+ index: index
154
+ });
146
155
  }
147
156
  // 存在自定义onDiff比对
148
157
  if (isFunction(onDiff)) {
149
158
  var _originalObj$record$r2;
150
159
  var _diffResult = onDiff({
151
- originalValue: originalValue,
160
+ originalValue: _originalValue,
152
161
  originalRecord: (_originalObj$record$r2 = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r2 !== void 0 ? _originalObj$record$r2 : {},
153
- value: value,
162
+ value: nextValue,
154
163
  record: record,
155
164
  index: index
156
165
  });
157
166
  if (_diffResult === 'changed') {
167
+ _isAddCell = false;
158
168
  otherProps.isChanged = true;
159
169
  }
160
170
  if (_diffResult === 'same') {
171
+ _isAddCell = false;
161
172
  otherProps.isChanged = false;
162
173
  }
163
174
  if (_diffResult === 'add') {
@@ -167,7 +178,7 @@ export var formatColumn = function formatColumn(_ref2) {
167
178
  }
168
179
  return _jsx(RenderColumn, _objectSpread(_objectSpread({}, otherProps), {}, {
169
180
  valueType: valueType,
170
- originalValue: isEmpty(originalValue) ? null : originalValue,
181
+ originalValue: isEmpty(_originalValue) ? null : _originalValue,
171
182
  ellipsis: ellipsis,
172
183
  width: width,
173
184
  value: _value,