@zat-design/sisyphus-react 3.3.1 → 3.3.2-beta.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.
Files changed (85) hide show
  1. package/dist/index.esm.css +35 -9
  2. package/es/ProDownload/utils.js +2 -0
  3. package/es/ProEditTable/components/RenderField/index.js +7 -6
  4. package/es/ProEditTable/index.js +19 -1
  5. package/es/ProEditTable/style/index.less +5 -0
  6. package/es/ProEnum/hooks/useEnumRequest.js +13 -1
  7. package/es/ProForm/components/combination/Group/index.js +3 -4
  8. package/es/ProForm/components/combination/Group/style/index.less +38 -21
  9. package/es/ProForm/components/combination/Group/utils.d.ts +0 -2
  10. package/es/ProForm/components/combination/Group/utils.js +0 -13
  11. package/es/ProForm/components/combination/ProModalSelect/index.js +2 -2
  12. package/es/ProForm/components/render/Render.js +15 -9
  13. package/es/ProForm/components/render/RenderFields.js +2 -1
  14. package/es/ProForm/style/index.less +5 -4
  15. package/es/ProForm/utils/contrastOriginal.d.ts +0 -1
  16. package/es/ProForm/utils/contrastOriginal.js +0 -1
  17. package/es/ProForm/utils/useChanged.d.ts +7 -14
  18. package/es/ProForm/utils/useChanged.js +13 -20
  19. package/es/ProForm/utils/useListChanged.d.ts +16 -0
  20. package/es/ProForm/utils/useListChanged.js +81 -0
  21. package/es/ProForm/utils/useShouldUpdate.js +17 -3
  22. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +13 -5
  23. package/es/ProLayout/components/Layout/Menu/index.js +13 -10
  24. package/es/ProLayout/components/ProCollapse/index.js +1 -0
  25. package/es/ProLayout/components/ProCollapse/style/index.less +49 -39
  26. package/es/ProLayout/propTypes.d.ts +2 -0
  27. package/es/ProTable/style/index.less +1 -0
  28. package/es/ProTooltip/index.js +5 -3
  29. package/es/ProTreeModal/components/Trigger.d.ts +1 -0
  30. package/es/ProTreeModal/components/Trigger.js +17 -8
  31. package/es/ProTreeModal/index.js +12 -2
  32. package/es/ProUpload/components/DragRender.js +1 -2
  33. package/es/ProUpload/components/ImageRender.js +17 -7
  34. package/es/locale/en_US.d.ts +2 -0
  35. package/es/locale/en_US.js +3 -1
  36. package/es/locale/zh_CN.d.ts +3 -0
  37. package/es/locale/zh_CN.js +4 -1
  38. package/lib/ProEditTable/components/RenderField/index.js +9 -6
  39. package/lib/ProEditTable/index.js +18 -0
  40. package/lib/ProEditTable/style/index.less +5 -0
  41. package/lib/ProEnum/hooks/useEnumRequest.js +13 -1
  42. package/lib/ProForm/components/base/RangePicker/index.js +1 -1
  43. package/lib/ProForm/components/combination/Group/index.js +2 -3
  44. package/lib/ProForm/components/combination/Group/style/index.less +38 -21
  45. package/lib/ProForm/components/combination/Group/utils.d.ts +0 -2
  46. package/lib/ProForm/components/combination/Group/utils.js +1 -14
  47. package/lib/ProForm/components/combination/ProModalSelect/index.js +1 -1
  48. package/lib/ProForm/components/old/InputRange/index.js +0 -1
  49. package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
  50. package/lib/ProForm/components/render/Render.js +16 -9
  51. package/lib/ProForm/components/render/RenderFields.js +2 -1
  52. package/lib/ProForm/style/index.less +5 -4
  53. package/lib/ProForm/utils/contrastOriginal.d.ts +0 -1
  54. package/lib/ProForm/utils/contrastOriginal.js +0 -1
  55. package/lib/ProForm/utils/useChanged.d.ts +7 -14
  56. package/lib/ProForm/utils/useChanged.js +13 -20
  57. package/lib/ProForm/utils/useListChanged.d.ts +16 -0
  58. package/lib/ProForm/utils/useListChanged.js +86 -0
  59. package/lib/ProForm/utils/useShouldUpdate.js +17 -3
  60. package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +13 -5
  61. package/lib/ProLayout/components/Layout/Menu/index.js +13 -10
  62. package/lib/ProLayout/components/ProCollapse/index.js +1 -0
  63. package/lib/ProLayout/components/ProCollapse/style/index.less +49 -39
  64. package/lib/ProLayout/propTypes.d.ts +2 -0
  65. package/lib/ProTable/components/TableResizable/index.js +8 -0
  66. package/lib/ProTable/style/index.less +1 -0
  67. package/lib/ProTabs/index.js +1 -0
  68. package/lib/ProThemeTools/index.js +1 -0
  69. package/lib/ProTooltip/index.js +4 -2
  70. package/lib/ProTree/components/Tree.js +7 -0
  71. package/lib/ProTree/index.js +0 -1
  72. package/lib/ProTreeModal/components/Tree.js +1 -0
  73. package/lib/ProTreeModal/components/Trigger.d.ts +1 -0
  74. package/lib/ProTreeModal/components/Trigger.js +16 -7
  75. package/lib/ProTreeModal/index.js +12 -2
  76. package/lib/ProUpload/components/DragRender.js +1 -2
  77. package/lib/ProUpload/components/ImageRender.js +16 -6
  78. package/lib/ProUpload/index.js +7 -0
  79. package/lib/ProViewer/index.js +1 -0
  80. package/lib/locale/en_US.d.ts +2 -0
  81. package/lib/locale/en_US.js +3 -1
  82. package/lib/locale/zh_CN.d.ts +3 -0
  83. package/lib/locale/zh_CN.js +4 -1
  84. package/lib/old/ProCertValidity/index.js +1 -1
  85. package/package.json +1 -1
@@ -127,10 +127,12 @@ declare const _default: {
127
127
  selectMax: string;
128
128
  noCheck: string;
129
129
  checkAll: string;
130
+ checkAll1: string;
130
131
  check: string;
131
132
  clearAll: string;
132
133
  checkNumber: string;
133
134
  noFinal: string;
135
+ specifyMode: string[];
134
136
  };
135
137
  ProTimeLimit: {
136
138
  foreverText: string;
@@ -127,10 +127,12 @@ export default {
127
127
  selectMax: 'Select at most {max} items',
128
128
  noCheck: 'None selected yet',
129
129
  checkAll: 'Select all',
130
+ checkAll1: 'Select all {all}',
130
131
  check: 'selected',
131
132
  clearAll: 'Clear all',
132
133
  checkNumber: '{num} items selected',
133
- noFinal: 'Oops, the content you are looking for is not found.'
134
+ noFinal: 'Oops, the content you are looking for is not found.',
135
+ specifyMode: ['all', 'specify']
134
136
  },
135
137
  ProTimeLimit: {
136
138
  foreverText: 'long term'
@@ -127,9 +127,12 @@ declare const _default: {
127
127
  selectMax: string;
128
128
  noCheck: string;
129
129
  checkAll: string;
130
+ checkAll1: string;
130
131
  check: string;
131
132
  clearAll: string;
132
133
  checkNumber: string;
134
+ noFinal: string;
135
+ specifyMode: string[];
133
136
  };
134
137
  ProTimeLimit: {
135
138
  foreverText: string;
@@ -127,9 +127,12 @@ export default {
127
127
  selectMax: '最多选择{max}个',
128
128
  noCheck: '暂无已选',
129
129
  checkAll: '全选',
130
+ checkAll1: '全部{all}',
130
131
  check: '已选',
131
132
  clearAll: '清空全部',
132
- checkNumber: '已选择{num}项'
133
+ checkNumber: '已选择{num}项',
134
+ noFinal: '哎呀,你要找的内容没有找到。',
135
+ specifyMode: ['全部', '指定']
133
136
  },
134
137
  ProTimeLimit: {
135
138
  foreverText: '长期'
@@ -25,11 +25,13 @@ var componentMap = _interopRequireWildcard(require("../../../ProForm/components"
25
25
  var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
26
26
  var _transformNames = _interopRequireDefault(require("../../../ProForm/utils/transformNames"));
27
27
  var _useFieldProps = require("../../../ProForm/utils/useFieldProps");
28
- var _useChanged3 = require("../../../ProForm/utils/useChanged");
28
+ var _useListChanged3 = require("../../../ProForm/utils/useListChanged");
29
29
  var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"));
30
30
  var _utils = require("../../../ProForm/utils");
31
31
  var _locale = _interopRequireDefault(require("../../../locale"));
32
32
  var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className"];
33
+ /* eslint-disable prefer-destructuring */
34
+ /* eslint-disable prefer-const */
33
35
  var RenderField = function RenderField(_ref) {
34
36
  var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4, _classNames;
35
37
  var value = _ref.text,
@@ -130,7 +132,7 @@ var RenderField = function RenderField(_ref) {
130
132
  names: names,
131
133
  label: label,
132
134
  labelRequired: labelRequired,
133
- required: _required,
135
+ required: !isView && _required,
134
136
  rules: isEditing ? _rules : [],
135
137
  isSelect: (0, _utils.isSelect)({
136
138
  dataSource: (_fieldProps4 = _fieldProps) === null || _fieldProps4 === void 0 ? void 0 : _fieldProps4.dataSource,
@@ -453,19 +455,20 @@ var RenderField = function RenderField(_ref) {
453
455
  };
454
456
  }();
455
457
  // 判断当前字段是否变更
456
- var _useChanged = (0, _useChanged3.useChanged)({
458
+ var _useListChanged = (0, _useListChanged3.useListChanged)({
457
459
  name: cellName,
458
460
  names: names,
459
461
  namesStr: [].concat((0, _toConsumableArray2.default)(baseName), [index, dataIndex]),
462
+ rowKeyPath: [].concat((0, _toConsumableArray2.default)(baseName), [index, 'rowKey']),
460
463
  originalName: originalName,
461
464
  originalNames: originalNames,
462
465
  originalValues: originalValues,
463
466
  form: form,
464
467
  equalWith: equalWith
465
468
  }),
466
- _useChanged2 = (0, _slicedToArray2.default)(_useChanged, 2),
467
- changed = _useChanged2[0],
468
- originalValue = _useChanged2[1];
469
+ _useListChanged2 = (0, _slicedToArray2.default)(_useListChanged, 2),
470
+ changed = _useListChanged2[0],
471
+ originalValue = _useListChanged2[1];
469
472
  var componentProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
470
473
  form: form,
471
474
  name: cellName,
@@ -109,6 +109,15 @@ var ProEditTable = function ProEditTable(_ref, ref) {
109
109
  }
110
110
  return key;
111
111
  };
112
+ var IsNew = function IsNew(preArr, record) {
113
+ var _preArr$find;
114
+ if (!(preArr === null || preArr === void 0 ? void 0 : preArr.length)) {
115
+ return false;
116
+ }
117
+ 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) {
118
+ return getRowKey(item) === getRowKey(record);
119
+ }));
120
+ };
112
121
  var config = {
113
122
  form: form,
114
123
  mode: mode,
@@ -145,6 +154,10 @@ var ProEditTable = function ProEditTable(_ref, ref) {
145
154
  var _rowClassName = function _rowClassName(record) {
146
155
  var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
147
156
  var className = isEdit ? 'is-editing' : '';
157
+ var originalArr = (0, _lodash.get)(originalValues, name);
158
+ if (!isEdit && IsNew(originalArr, record)) {
159
+ return "is-new-row ".concat(className);
160
+ }
148
161
  return className;
149
162
  };
150
163
  // 复选框
@@ -249,11 +262,16 @@ var ProEditTable = function ProEditTable(_ref, ref) {
249
262
  var _value$;
250
263
  // 初始化默认生成row-key
251
264
  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)) {
265
+ var _originalArr$forEach;
252
266
  var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
253
267
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
254
268
  rowKey: getRowKey(item)
255
269
  });
256
270
  });
271
+ var originalArr = (0, _lodash.get)(originalValues, name);
272
+ originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
273
+ item.rowKey = getRowKey(item);
274
+ });
257
275
  onChange(nextValues);
258
276
  if (virtualKey) {
259
277
  form.setFieldValue(virtualRowName, nextValues);
@@ -296,6 +296,11 @@
296
296
  }
297
297
  }
298
298
 
299
+ .is-new-row, .is-new-row.@{ant-prefix}-table-row:hover {
300
+ td, .@{ant-prefix}-table-cell-row-hover {
301
+ background: var(--ant-primary-2) !important;
302
+ }
303
+ }
299
304
  }
300
305
 
301
306
  .pro-edit-table-header {
@@ -79,6 +79,18 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
79
79
  case 9:
80
80
  res.data = response;
81
81
  case 10:
82
+ if (!((0, _typeof2.default)(response) !== 'object' || response === null)) {
83
+ _context.next = 12;
84
+ break;
85
+ }
86
+ throw Error('response enum data must be object');
87
+ case 12:
88
+ if (!(Object.keys(response).length === 0)) {
89
+ _context.next = 14;
90
+ break;
91
+ }
92
+ throw Error('Please return valid enumeration data');
93
+ case 14:
82
94
  // 只返回fieldNames对象的key
83
95
  if (clear) {
84
96
  // 忽略清洗的 codes
@@ -113,7 +125,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
113
125
  }, 10000);
114
126
  }
115
127
  return _context.abrupt("return", res);
116
- case 17:
128
+ case 21:
117
129
  case "end":
118
130
  return _context.stop();
119
131
  }
@@ -14,7 +14,7 @@ var _moment = _interopRequireDefault(require("moment"));
14
14
  var _ProConfigProvider = require("../../../../ProConfigProvider");
15
15
  var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
16
16
  var _Container = _interopRequireDefault(require("../../Container"));
17
- var _excluded = ["format", "otherProps", "separator"];
17
+ var _excluded = ["format", "otherProps", "separator"]; // @ts-check
18
18
  var AntRangePicker = _antd.DatePicker.RangePicker;
19
19
  var RangePicker = function RangePicker(props) {
20
20
  var _props$format = props.format,
@@ -31,7 +31,6 @@ var Group = function Group(props) {
31
31
  if (!Array.isArray(names)) {
32
32
  console.error('Warning: Composite form components whose type is Group must be configured with names');
33
33
  }
34
- var _parentNames = (0, _utils.parseName)(id);
35
34
  var data = (0, _react.useMemo)(function () {
36
35
  var fieldList = [];
37
36
  var result = columns.map(function (item) {
@@ -39,7 +38,7 @@ var Group = function Group(props) {
39
38
  disabled: Boolean(props === null || props === void 0 ? void 0 : props.disabled)
40
39
  }, item), {}, {
41
40
  noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
42
- parentNames: _parentNames
41
+ parentNames: id
43
42
  });
44
43
  });
45
44
  var node = (0, _jsxRuntime.jsx)(_antd.Button, {
@@ -50,7 +49,7 @@ var Group = function Group(props) {
50
49
  columns: (0, _utils.insertSeparator)(result, space, node, otherProps),
51
50
  fieldList: fieldList
52
51
  };
53
- }, [name, columns, space, props]);
52
+ }, [name, columns, space, props, names]);
54
53
  var _className = (0, _classnames2.default)((0, _defineProperty2.default)({
55
54
  'pro-group': true,
56
55
  '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 : @start-end;
6
- border-end-end-radius : @end-end;
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 : @end-start;
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 : var(--zaui-border-radius, 4px);
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 : var(--zaui-border-radius, 4px);
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
- flex : auto;
54
- width : 100%;
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 : -2px;
62
- margin-inline-start : -1px;
72
+ margin-inline-end: -2px;
73
+ margin-inline-start: -1px;
63
74
  border-start-start-radius: 0;
64
- border-end-start-radius : 0;
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~.group-separator {
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
+ }
@@ -6,5 +6,3 @@ import { SpaceType } from './propsType';
6
6
  * @returns
7
7
  */
8
8
  export declare const insertSeparator: (columns: any, space?: SpaceType, separatorNode?: ReactNode, otherProps?: any) => any;
9
- /** 解析name */
10
- export declare const parseName: (name: string) => any[];
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.parseName = exports.insertSeparator = void 0;
7
+ exports.insertSeparator = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  /**
10
10
  * 插入间隔符
@@ -40,17 +40,4 @@ var insertSeparator = exports.insertSeparator = function insertSeparator(columns
40
40
  }
41
41
  return result;
42
42
  }, []);
43
- };
44
- /** 解析name */
45
- var parseName = exports.parseName = function parseName(name) {
46
- var result = [];
47
- var parts = name.split('_');
48
- parts.forEach(function (part) {
49
- if (!Number.isNaN(Number(part))) {
50
- result.push(Number(part));
51
- } else {
52
- result.push(part);
53
- }
54
- });
55
- return result;
56
43
  };
@@ -653,7 +653,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
653
653
  disabled: disabled,
654
654
  addonAfter: forceAddonAfterRender(),
655
655
  autoComplete: "off"
656
- }, restInputProps)), (0, _jsxRuntime.jsx)(_antd.Input, {
656
+ }, (0, _lodash.omit)(restInputProps, ['otherProps']))), (0, _jsxRuntime.jsx)(_antd.Input, {
657
657
  type: "hidden",
658
658
  value: value
659
659
  })]
@@ -13,7 +13,6 @@ var _antd = require("antd");
13
13
  var _classnames = _interopRequireDefault(require("classnames"));
14
14
  /* eslint-disable @typescript-eslint/no-shadow */
15
15
  /* eslint-disable no-param-reassign */
16
-
17
16
  var positiveInteger = {
18
17
  formatter: function formatter(value) {
19
18
  return value.replace(/[^0-9]/g, '');
@@ -11,7 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  var _antd = require("antd");
12
12
  var _moment = _interopRequireDefault(require("moment"));
13
13
  var _react = require("react");
14
- var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"];
14
+ var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"]; // @ts-nocheck
15
15
  var RangePicker = _antd.DatePicker.RangePicker;
16
16
  var defaultFormatDate = 'YYYY-MM-DD';
17
17
  var defaultPopupContainer = function defaultPopupContainer(triggerNode) {
@@ -28,9 +28,10 @@ var _useChanged3 = require("../../utils/useChanged");
28
28
  var _tip = _interopRequireDefault(require("../../../assets/tip.svg"));
29
29
  var _useRules = _interopRequireDefault(require("../../utils/useRules"));
30
30
  var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className", "rules", "required", "labelRequired", "tooltip"];
31
+ /* eslint-disable prefer-destructuring */
31
32
  // 这个组件只管渲染, 参数的整理在外部处理
32
33
  var Render = function Render(props) {
33
- var _classNames, _otherProps$names2;
34
+ var _ref2, _classNames, _otherProps$names2;
34
35
  var component = props.component,
35
36
  originComponent = props.originComponent,
36
37
  _props$formItemProps = props.formItemProps,
@@ -160,8 +161,8 @@ var Render = function Render(props) {
160
161
  }
161
162
  /** 移除多余参数,防止透传给formItem报错 */
162
163
  var _otherFormItemProps = (0, _lodash.omit)(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'switchValue', 'precision', 'clearNotShow']);
163
- // 优先取formDisabled(全局),其次取disabled函数返回值,最后取fieldProps函数返回的disabled
164
- var lastDisabled = componentProps.disabledStrictly ? formDisabled || _disabled || (_fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) : false;
164
+ // 优先取组件上的disabled, 最后取formDisabled(全局
165
+ 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;
165
166
  /**
166
167
  * 最新fieldProps: 更新后的组件Props
167
168
  */
@@ -189,8 +190,8 @@ var Render = function Render(props) {
189
190
  var functionArgs = function functionArgs(args) {
190
191
  var _otherFormItemProps$n;
191
192
  var _args = (0, _toConsumableArray2.default)(args);
192
- var _ref2 = otherProps || {},
193
- valueType = _ref2.valueType;
193
+ var _ref3 = otherProps || {},
194
+ valueType = _ref3.valueType;
194
195
  _args[1] = form.getFieldsValue();
195
196
  _args[2] = {
196
197
  form: form
@@ -248,9 +249,10 @@ var Render = function Render(props) {
248
249
  ((_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((0, _toConsumableArray2.default)(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat((0, _toConsumableArray2.default)(_args))));
249
250
  return false;
250
251
  }
251
- // Group默认校验, 延时校验解决值未同步最新的问题
252
+ // Group默认校验, 延时与重新setFieldValue,为了解决校验值未同步最新的问题,
252
253
  if (formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames) {
253
254
  setTimeout(function () {
255
+ form.setFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames, form.getFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames));
254
256
  form.validateFields([formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames]);
255
257
  }, 60);
256
258
  }
@@ -265,7 +267,7 @@ var Render = function Render(props) {
265
267
  * onBlur参数重置 (value, record, { form, index, namePath, option }) => void
266
268
  */
267
269
  var handleBlur = /*#__PURE__*/function () {
268
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
270
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
269
271
  var _len2,
270
272
  args,
271
273
  _key2,
@@ -292,7 +294,7 @@ var Render = function Render(props) {
292
294
  }, _callee);
293
295
  }));
294
296
  return function handleBlur() {
295
- return _ref3.apply(this, arguments);
297
+ return _ref4.apply(this, arguments);
296
298
  };
297
299
  }();
298
300
  var renderItem = function renderItem() {
@@ -400,7 +402,12 @@ var Render = function Render(props) {
400
402
  shouldUpdate: _otherFormItemProps.shouldUpdate,
401
403
  noStyle: true,
402
404
  children: function children() {
403
- return orgFormItem;
405
+ return (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(_otherFormItemProps, filterFormItemKey)), {}, {
406
+ // @ts-ignore
407
+ _internalItemRender: internalItemRender,
408
+ className: _className,
409
+ children: child
410
+ }));
404
411
  }
405
412
  });
406
413
  }
@@ -52,6 +52,7 @@ var RenderFields = function RenderFields(props) {
52
52
  });
53
53
  }
54
54
  var comList = columns.flatMap(function (column, index) {
55
+ var _ref, _formItemProps$disabl;
55
56
  if (!!expand && !openState) {
56
57
  // expand为Number时 过滤掉大于expand 且 非fixed的column
57
58
  if (typeof expand === 'number') {
@@ -130,7 +131,7 @@ var RenderFields = function RenderFields(props) {
130
131
  placeholder = formItemChildProps.placeholder,
131
132
  dataSource = formItemChildProps.dataSource;
132
133
  var formLabel = _formItemProps.label;
133
- var comDisabled = formItemChildProps.disabled || fieldProps.disabled || disabled;
134
+ 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;
134
135
  var _disabled = comDisabled === undefined ? formDisabled : comDisabled;
135
136
  // 当前组件是不是一个选择组件
136
137
  var _isSelect = (0, _utils.isSelect)({
@@ -56,7 +56,8 @@
56
56
  visibility: unset;
57
57
  }
58
58
 
59
- .@{ant-prefix}-input-affix-wrapper:hover span.@{ant-prefix}-input-clear-icon[class~='ant-input-clear-icon-hidden'] {
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 > span {
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 {
@@ -1,6 +1,5 @@
1
1
  import { FormInstance } from 'antd';
2
2
  interface Params {
3
- originalValues: any;
4
3
  originalValue: any;
5
4
  value: any;
6
5
  form: FormInstance;
@@ -8,7 +8,6 @@ var _lodash = require("lodash");
8
8
  var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
9
9
  var contrastOriginal = exports.contrastOriginal = function contrastOriginal(params) {
10
10
  var originalValue = params.originalValue,
11
- originalValues = params.originalValues,
12
11
  value = params.value,
13
12
  equalWith = params.equalWith;
14
13
  // 支持传入自定义比较事件
@@ -1,15 +1,8 @@
1
- import { FormInstance } from 'antd';
2
- import { NamePath } from 'antd/lib/form/interface';
3
- interface Params {
4
- name?: NamePath;
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: FormInstance;
12
- equalWith?: (originalValue: any, currentValue: any) => boolean;
13
- }
14
- export declare const useChanged: (params: Params) => any[];
15
- export {};
6
+ form: any;
7
+ equalWith: any;
8
+ }) => any[];
@@ -7,30 +7,23 @@ exports.useChanged = void 0;
7
7
  var _antd = require("antd");
8
8
  var _lodash = require("lodash");
9
9
  var _contrastOriginal = require("./contrastOriginal");
10
- var useChanged = exports.useChanged = function useChanged(params) {
11
- var name = params.name,
12
- names = params.names,
13
- namesStr = params.namesStr,
14
- _params$originalName = params.originalName,
15
- originalName = _params$originalName === void 0 ? name : _params$originalName,
16
- _params$originalNames = params.originalNames,
17
- originalNames = _params$originalNames === void 0 ? names : _params$originalNames,
18
- originalValues = params.originalValues,
19
- form = params.form,
20
- equalWith = params.equalWith;
21
- var _form = form;
22
- var originalValue = (originalNames === null || originalNames === void 0 ? void 0 : originalNames.length) ? originalNames.map(function (originalName) {
23
- return (0, _lodash.get)(originalValues, originalName);
24
- }) : (0, _lodash.get)(originalValues, originalName);
10
+ var useChanged = exports.useChanged = function useChanged(_ref) {
11
+ var name = _ref.name,
12
+ names = _ref.names,
13
+ namesStr = _ref.namesStr,
14
+ originalValues = _ref.originalValues,
15
+ form = _ref.form,
16
+ equalWith = _ref.equalWith;
17
+ var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
18
+ return (0, _lodash.get)(originalValues, name);
19
+ }) : (0, _lodash.get)(originalValues, name);
25
20
  var notWatch = !originalValues || originalValue === undefined;
26
- // @ts-ignore
27
- if (notWatch) _form = [];
28
- var value = _antd.Form.useWatch(namesStr || name, _form);
21
+ if (notWatch) form = [];
22
+ var value = _antd.Form.useWatch(namesStr || name, form);
29
23
  if (notWatch) return [false];
30
24
  var changed = (0, _contrastOriginal.contrastOriginal)({
31
- value: value,
32
25
  originalValue: originalValue,
33
- originalValues: originalValues,
26
+ value: value,
34
27
  form: form,
35
28
  equalWith: equalWith
36
29
  });
@@ -0,0 +1,16 @@
1
+ import { FormInstance } from 'antd';
2
+ import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
3
+ interface Params {
4
+ name?: NamePath;
5
+ names?: NamePath[];
6
+ namesStr?: NamePath;
7
+ originalName?: NamePath;
8
+ originalNames?: NamePath[];
9
+ originalNameStr?: NamePath;
10
+ originalValues: any;
11
+ form: FormInstance;
12
+ rowKeyPath?: InternalNamePath;
13
+ equalWith?: (originalValue: any, currentValue: any) => boolean;
14
+ }
15
+ export declare const useListChanged: (params: Params) => any[];
16
+ export {};