@zat-design/sisyphus-react 3.2.1 → 3.2.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 (149) hide show
  1. package/dist/index.esm.css +66 -35
  2. package/es/ProDownload/utils.js +0 -2
  3. package/es/ProDrawerForm/style/index.less +59 -59
  4. package/es/ProEditTable/components/RenderField/index.js +66 -21
  5. package/es/ProEditTable/index.js +11 -4
  6. package/es/ProEditTable/propsType.d.ts +11 -1
  7. package/es/ProForm/components/base/Checkbox/index.d.ts +1 -0
  8. package/es/ProForm/components/base/Checkbox/index.js +5 -3
  9. package/es/ProForm/components/base/DatePicker/index.js +3 -2
  10. package/es/ProForm/components/base/Input/index.js +4 -2
  11. package/es/ProForm/components/base/Input/propsType.d.ts +1 -0
  12. package/es/ProForm/components/base/InputNumber/index.d.ts +1 -0
  13. package/es/ProForm/components/base/InputNumber/index.js +5 -3
  14. package/es/ProForm/components/base/ProCascader/index.js +6 -6
  15. package/es/ProForm/components/base/Radio/index.d.ts +1 -0
  16. package/es/ProForm/components/base/Radio/index.js +4 -2
  17. package/es/ProForm/components/base/RangePicker/index.d.ts +1 -0
  18. package/es/ProForm/components/base/RangePicker/index.js +5 -3
  19. package/es/ProForm/components/base/Select/index.d.ts +1 -0
  20. package/es/ProForm/components/base/Select/index.js +4 -2
  21. package/es/ProForm/components/base/Switch/index.d.ts +1 -0
  22. package/es/ProForm/components/base/Switch/index.js +4 -2
  23. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
  24. package/es/ProForm/components/base/SwitchCheckbox/index.js +4 -2
  25. package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
  26. package/es/ProForm/components/base/TextArea/index.js +4 -3
  27. package/es/ProForm/components/base/TimePicker/index.d.ts +1 -0
  28. package/es/ProForm/components/base/TimePicker/index.js +4 -2
  29. package/es/ProForm/components/combination/Container/index.js +7 -5
  30. package/es/ProForm/components/combination/FormList/index.js +6 -5
  31. package/es/ProForm/components/combination/FormList/style/index.less +15 -22
  32. package/es/ProForm/components/combination/Group/index.js +6 -3
  33. package/es/ProForm/components/combination/ProAddressBar/index.js +29 -30
  34. package/es/ProForm/components/combination/ProCombination/index.js +11 -11
  35. package/es/ProForm/components/combination/ProModalSelect/index.js +4 -5
  36. package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
  37. package/es/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
  38. package/es/ProForm/components/combination/ProNumberRange/index.js +7 -7
  39. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
  40. package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -2
  41. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
  42. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -2
  43. package/es/ProForm/components/render/Render.js +54 -20
  44. package/es/ProForm/components/render/RenderFields.d.ts +1 -0
  45. package/es/ProForm/components/render/RenderFields.js +13 -12
  46. package/es/ProForm/index.js +5 -2
  47. package/es/ProForm/propsType.d.ts +1 -0
  48. package/es/ProForm/style/index.less +49 -42
  49. package/es/ProForm/utils/contrastOriginal.d.ts +10 -1
  50. package/es/ProForm/utils/contrastOriginal.js +15 -18
  51. package/es/ProForm/utils/useChanged.d.ts +15 -1
  52. package/es/ProForm/utils/useChanged.js +27 -8
  53. package/es/ProLayout/components/ProFooter/style/index.less +8 -7
  54. package/es/ProLayout/components/ProHeader/index.js +1 -0
  55. package/es/ProLayout/components/ProHeader/style/index.less +7 -0
  56. package/es/ProSelect/index.js +6 -3
  57. package/es/ProStep/components/Item/index.js +1 -4
  58. package/es/ProTable/components/RenderColumn/index.js +1 -1
  59. package/es/ProTable/style/index.less +6 -0
  60. package/es/ProTabs/style/index.less +16 -17
  61. package/es/ProThemeTools/component/PrdTools/index.js +21 -20
  62. package/es/ProThemeTools/index.js +2 -1
  63. package/es/ProTree/components/Tree.js +43 -42
  64. package/es/ProTree/style/index.less +0 -6
  65. package/es/ProTreeModal/index.js +14 -3
  66. package/es/ProTreeSelect/index.js +3 -2
  67. package/es/locale/en_US.d.ts +15 -1
  68. package/es/locale/en_US.js +17 -3
  69. package/es/locale/zh_CN.d.ts +15 -1
  70. package/es/locale/zh_CN.js +15 -1
  71. package/es/style/theme/antd.less +129 -117
  72. package/lib/ProDrawerForm/style/index.less +59 -59
  73. package/lib/ProEditTable/components/RenderField/index.js +61 -22
  74. package/lib/ProEditTable/index.js +12 -4
  75. package/lib/ProEditTable/propsType.d.ts +11 -1
  76. package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -0
  77. package/lib/ProForm/components/base/Checkbox/index.js +5 -3
  78. package/lib/ProForm/components/base/DatePicker/index.js +3 -2
  79. package/lib/ProForm/components/base/Input/index.js +4 -2
  80. package/lib/ProForm/components/base/Input/propsType.d.ts +1 -0
  81. package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -0
  82. package/lib/ProForm/components/base/InputNumber/index.js +5 -3
  83. package/lib/ProForm/components/base/ProCascader/index.js +6 -6
  84. package/lib/ProForm/components/base/Radio/index.d.ts +1 -0
  85. package/lib/ProForm/components/base/Radio/index.js +4 -2
  86. package/lib/ProForm/components/base/RangePicker/index.d.ts +1 -0
  87. package/lib/ProForm/components/base/RangePicker/index.js +6 -4
  88. package/lib/ProForm/components/base/Select/index.d.ts +1 -0
  89. package/lib/ProForm/components/base/Select/index.js +4 -2
  90. package/lib/ProForm/components/base/Switch/index.d.ts +1 -0
  91. package/lib/ProForm/components/base/Switch/index.js +4 -2
  92. package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
  93. package/lib/ProForm/components/base/SwitchCheckbox/index.js +4 -2
  94. package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
  95. package/lib/ProForm/components/base/TextArea/index.js +4 -3
  96. package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -0
  97. package/lib/ProForm/components/base/TimePicker/index.js +4 -2
  98. package/lib/ProForm/components/combination/Container/index.js +7 -5
  99. package/lib/ProForm/components/combination/FormList/index.js +6 -5
  100. package/lib/ProForm/components/combination/FormList/style/index.less +15 -22
  101. package/lib/ProForm/components/combination/Group/index.js +6 -3
  102. package/lib/ProForm/components/combination/ProAddressBar/index.js +29 -30
  103. package/lib/ProForm/components/combination/ProCombination/index.js +11 -11
  104. package/lib/ProForm/components/combination/ProModalSelect/index.js +4 -5
  105. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
  106. package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
  107. package/lib/ProForm/components/combination/ProNumberRange/index.js +7 -7
  108. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
  109. package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -2
  110. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
  111. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -2
  112. package/lib/ProForm/components/old/InputRange/index.js +1 -0
  113. package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
  114. package/lib/ProForm/components/render/Render.js +53 -22
  115. package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
  116. package/lib/ProForm/components/render/RenderFields.js +13 -12
  117. package/lib/ProForm/index.js +5 -2
  118. package/lib/ProForm/propsType.d.ts +1 -0
  119. package/lib/ProForm/style/index.less +49 -42
  120. package/lib/ProForm/utils/contrastOriginal.d.ts +10 -1
  121. package/lib/ProForm/utils/contrastOriginal.js +14 -17
  122. package/lib/ProForm/utils/useChanged.d.ts +15 -1
  123. package/lib/ProForm/utils/useChanged.js +27 -8
  124. package/lib/ProLayout/components/ProFooter/style/index.less +8 -7
  125. package/lib/ProLayout/components/ProHeader/index.js +1 -0
  126. package/lib/ProLayout/components/ProHeader/style/index.less +7 -0
  127. package/lib/ProSelect/index.js +6 -3
  128. package/lib/ProStep/components/Item/index.js +1 -4
  129. package/lib/ProTable/components/RenderColumn/index.js +1 -1
  130. package/lib/ProTable/components/TableResizable/index.js +0 -8
  131. package/lib/ProTable/style/index.less +6 -0
  132. package/lib/ProTabs/index.js +0 -1
  133. package/lib/ProTabs/style/index.less +16 -17
  134. package/lib/ProThemeTools/component/PrdTools/index.js +21 -20
  135. package/lib/ProThemeTools/index.js +2 -2
  136. package/lib/ProTree/components/Tree.js +42 -48
  137. package/lib/ProTree/index.js +1 -0
  138. package/lib/ProTree/style/index.less +0 -6
  139. package/lib/ProTreeModal/components/Tree.js +0 -1
  140. package/lib/ProTreeModal/index.js +14 -3
  141. package/lib/ProTreeSelect/index.js +3 -2
  142. package/lib/ProUpload/index.js +0 -7
  143. package/lib/locale/en_US.d.ts +15 -1
  144. package/lib/locale/en_US.js +17 -3
  145. package/lib/locale/zh_CN.d.ts +15 -1
  146. package/lib/locale/zh_CN.js +15 -1
  147. package/lib/old/ProCertValidity/index.js +1 -1
  148. package/lib/style/theme/antd.less +129 -117
  149. package/package.json +1 -1
@@ -1,15 +1,22 @@
1
+ import "antd/es/tooltip/style";
2
+ import _Tooltip from "antd/es/tooltip";
1
3
  import "antd/es/form/style";
2
4
  import _Form from "antd/es/form";
5
+ import "antd/es/space/style";
6
+ import _Space from "antd/es/space";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
9
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
4
10
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
11
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
12
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
7
13
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
8
- var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules"];
9
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
14
+ var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className"];
15
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
16
  /* eslint-disable prefer-destructuring */
11
17
  /* eslint-disable prefer-const */
12
18
  import React, { useCallback, useEffect } from 'react';
19
+ import classNames from 'classnames';
13
20
  import { cloneDeep, isEqual, debounce, omit, isFunction, isString } from 'lodash';
14
21
  import valueTypeMap from '../../../ProForm/utils/valueType';
15
22
  import transformMap from '../../utils/transform';
@@ -18,11 +25,12 @@ import * as componentMap from '../../../ProForm/components';
18
25
  import Container from '../../../ProForm/components/Container';
19
26
  import transformNames from '../../../ProForm/utils/transformNames';
20
27
  import { FieldProvider } from '../../../ProForm/utils/useFieldProps';
28
+ import { useChanged } from '../../../ProForm/utils/useChanged';
21
29
  import useRules from '../../../ProForm/utils/useRules';
22
30
  import { isSelect } from '../../../ProForm/utils';
23
31
  import locale from '../../../locale';
24
32
  var RenderField = function RenderField(_ref) {
25
- var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4;
33
+ var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4, _classNames;
26
34
  var value = _ref.text,
27
35
  record = _ref.record,
28
36
  index = _ref.index,
@@ -47,6 +55,8 @@ var RenderField = function RenderField(_ref) {
47
55
  required = _column$required === void 0 ? false : _column$required,
48
56
  _column$rules = column.rules,
49
57
  rules = _column$rules === void 0 ? [] : _column$rules,
58
+ equalWith = column.equalWith,
59
+ className = column.className,
50
60
  resetProps = _objectWithoutProperties(column, _excluded);
51
61
  // editRender弃用使用component同ProForm
52
62
  var _editRender = component || editRender;
@@ -61,7 +71,9 @@ var RenderField = function RenderField(_ref) {
61
71
  setState = config.setState,
62
72
  name = config.name,
63
73
  virtualKey = config.virtualKey,
64
- viewEmpty = config.viewEmpty;
74
+ viewEmpty = config.viewEmpty,
75
+ originalValues = config.originalValues,
76
+ originalTip = config.originalTip;
65
77
  var _fieldProps = fieldProps || formItemProps || {};
66
78
  var _rules = rules || [];
67
79
  var _required = required;
@@ -175,13 +187,23 @@ var RenderField = function RenderField(_ref) {
175
187
  return [].concat(_toConsumableArray(baseName), [index, key]);
176
188
  });
177
189
  }
190
+ var originalName = cellName;
191
+ var originalNames = names;
192
+ if (virtualKey) {
193
+ var _cellName$slice, _names2, _names2$map;
194
+ originalName = [].concat(_toConsumableArray(name), _toConsumableArray(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, 1)));
195
+ originalNames = (_names2 = names) === null || _names2 === void 0 ? void 0 : (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
196
+ var _item$slice;
197
+ return [].concat(_toConsumableArray(name), _toConsumableArray(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, 1)));
198
+ });
199
+ }
178
200
  /**
179
201
  * 配置names时,基于formItem的normalize与getValueProps进行值类型转换
180
202
  * @returns {}
181
203
  */
182
204
  var namesTransform = function namesTransform() {
183
- var _names2;
184
- if (!((_names2 = names) === null || _names2 === void 0 ? void 0 : _names2.length)) {
205
+ var _names3;
206
+ if (!((_names3 = names) === null || _names3 === void 0 ? void 0 : _names3.length)) {
185
207
  return {};
186
208
  }
187
209
  var namesStr = [baseName, index, dataIndex];
@@ -341,14 +363,6 @@ var RenderField = function RenderField(_ref) {
341
363
  d: Date.now()
342
364
  }
343
365
  });
344
- // if (virtualKey) {
345
- // // 单行编辑时需要 强制更新视图
346
- // setState({
347
- // forceUpdate: {
348
- // d: Date.now(),
349
- // },
350
- // });
351
- // }
352
366
  case 30:
353
367
  case "end":
354
368
  return _context.stop();
@@ -437,6 +451,20 @@ var RenderField = function RenderField(_ref) {
437
451
  return _ref3.apply(this, arguments);
438
452
  };
439
453
  }();
454
+ // 判断当前字段是否变更
455
+ var _useChanged = useChanged({
456
+ name: cellName,
457
+ names: names,
458
+ namesStr: [].concat(_toConsumableArray(baseName), [index, dataIndex]),
459
+ originalName: originalName,
460
+ originalNames: originalNames,
461
+ originalValues: originalValues,
462
+ form: form,
463
+ equalWith: equalWith
464
+ }),
465
+ _useChanged2 = _slicedToArray(_useChanged, 2),
466
+ changed = _useChanged2[0],
467
+ originalValue = _useChanged2[1];
440
468
  var componentProps = _objectSpread(_objectSpread(_objectSpread({
441
469
  form: form,
442
470
  name: cellName,
@@ -477,15 +505,32 @@ var RenderField = function RenderField(_ref) {
477
505
  if (!isEditing) {
478
506
  delete _formItemProps.rules;
479
507
  }
508
+ var _className = classNames((_classNames = {}, _defineProperty(_classNames, className, className), _defineProperty(_classNames, 'pro-form-item-changed', changed), _classNames));
509
+ var originalTitle = _jsxs(_Space, {
510
+ children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(TargetComponent) ? /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread(_objectSpread({}, omit(componentProps, ['onFieldChange'])), {}, {
511
+ isView: true,
512
+ value: originalValue,
513
+ checked: type === 'Switch' ? originalValue : undefined
514
+ })) : _jsx(TargetComponent, _objectSpread(_objectSpread({}, omit(componentProps, ['onFieldChange'])), {}, {
515
+ isView: true,
516
+ value: originalValue,
517
+ checked: type === 'Switch' ? originalValue : undefined
518
+ }))]
519
+ });
520
+ var FormItem = _jsx(_Form.Item, _objectSpread(_objectSpread({
521
+ validateFirst: true
522
+ }, omit(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
523
+ className: _className,
524
+ name: cellName,
525
+ children: /*#__PURE__*/React.isValidElement(TargetComponent) ? /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange']))) : _jsx(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange'])))
526
+ }));
480
527
  return _jsx(FieldProvider, {
481
528
  value: componentProps === null || componentProps === void 0 ? void 0 : componentProps.otherProps,
482
- children: _jsx(_Form.Item, _objectSpread(_objectSpread({
483
- validateFirst: true,
484
- noStyle: !isEditing
485
- }, omit(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
486
- name: cellName,
487
- children: /*#__PURE__*/React.isValidElement(TargetComponent) ? /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange']))) : _jsx(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange'])))
488
- }))
529
+ children: !originalTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : _jsx(_Tooltip, {
530
+ title: originalTitle,
531
+ open: changed ? undefined : false,
532
+ children: FormItem
533
+ })
489
534
  });
490
535
  };
491
536
  export default RenderField;
@@ -10,7 +10,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
10
10
  import "antd/es/form/style";
11
11
  import _Form from "antd/es/form";
12
12
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
- var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination"];
13
+ var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip"];
14
14
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
16
16
  import { isArray } from 'lodash';
@@ -20,7 +20,7 @@ import { transformColumns } from './utils';
20
20
  import { getRandom, getNamePath } from './utils/tools';
21
21
  import { DndWrapper, Row, Validator, Summary, RenderToolbar } from './components';
22
22
  import Empty from '../assets/empty.png';
23
- import locale from '../locale';
23
+ import locale, { formatMessage } from '../locale';
24
24
  var ProEditTable = function ProEditTable(_ref, ref) {
25
25
  var _resetProps$id, _resetProps$id$split, _value$2;
26
26
  var value = _ref.value,
@@ -48,6 +48,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
48
48
  max = _ref.max,
49
49
  headerRender = _ref.headerRender,
50
50
  pagination = _ref.pagination,
51
+ originalValues = _ref.originalValues,
52
+ originalTip = _ref.originalTip,
51
53
  resetProps = _objectWithoutProperties(_ref, _excluded);
52
54
  // 上下文form
53
55
  var contentForm = _Form.useFormInstance();
@@ -134,7 +136,9 @@ var ProEditTable = function ProEditTable(_ref, ref) {
134
136
  tableRef: tableRef,
135
137
  max: max,
136
138
  tableLength: value === null || value === void 0 ? void 0 : value.length,
137
- page: page
139
+ page: page,
140
+ originalValues: originalValues,
141
+ originalTip: originalTip
138
142
  };
139
143
  // 判断是否禁止添加、批量删除
140
144
  var isForbiddenBtn = useCallback(function (type) {
@@ -290,8 +294,11 @@ var ProEditTable = function ProEditTable(_ref, ref) {
290
294
  showQuickJumper: true,
291
295
  total: value.length,
292
296
  showTotal: function showTotal(total) {
297
+ var _locale$ProEditTable;
293
298
  if (!total) return;
294
- return "\u5171".concat(total, "\u6761");
299
+ return formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProEditTable = locale.ProEditTable) === null || _locale$ProEditTable === void 0 ? void 0 : _locale$ProEditTable.total, {
300
+ total: total
301
+ });
295
302
  },
296
303
  onChange: handlePageChange
297
304
  }, pagination) : false,
@@ -121,9 +121,19 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
121
121
  * @default -
122
122
  */
123
123
  form?: FormInstance;
124
+ /**
125
+ * @description 原始数据源,设置后可以对比更新后的数值
126
+ * @default -
127
+ */
128
+ originalValues?: any;
129
+ /**
130
+ * @description 原始数据源,是否tooltip显示
131
+ * @default -
132
+ */
133
+ originalTip?: boolean;
124
134
  /**
125
135
  * @description 可编辑表格的类型,单行、多行、单元格编辑
126
- * @default multiple
136
+ * @default false
127
137
  */
128
138
  mode?: 'single' | 'multiple' | 'cell';
129
139
  /**
@@ -8,6 +8,7 @@ export interface Props extends Omit<CheckboxGroupProps, 'options'> {
8
8
  value: string;
9
9
  };
10
10
  otherProps?: ProFormOtherProps;
11
+ isView?: boolean;
11
12
  }
12
13
  declare const Checkbox: React.FC<Props>;
13
14
  export default Checkbox;
@@ -7,15 +7,17 @@ import { createElement as _createElement } from "react";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import Container from '../../Container';
9
9
  import { useProConfig } from '../../../../ProConfigProvider';
10
+ import ProForm from '../../../index';
10
11
  var Checkbox = function Checkbox(props) {
11
12
  var dataSource = props.dataSource,
12
13
  otherProps = props.otherProps,
13
14
  fieldNames = props.fieldNames,
14
15
  rest = _objectWithoutProperties(props, _excluded);
15
- var _ref = otherProps || {},
16
- isView = _ref.isView,
17
- viewEmpty = _ref.viewEmpty;
18
16
  var initialConfig = useProConfig('Checkbox') || {};
17
+ var _ref = ProForm.useFieldProps() || {},
18
+ isViewCon = _ref.isView,
19
+ viewEmpty = _ref.viewEmpty;
20
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
19
21
  var _fieldNames = fieldNames || initialConfig.fieldNames || {
20
22
  label: 'label',
21
23
  value: 'value'
@@ -17,14 +17,15 @@ var DatePicker = function DatePicker(props) {
17
17
  format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
18
18
  rest = _objectWithoutProperties(props, _excluded);
19
19
  var _ref = ProForm.useFieldProps() || {},
20
- isView = _ref.isView,
20
+ isViewCon = _ref.isView,
21
21
  viewEmpty = _ref.viewEmpty,
22
22
  valueType = _ref.valueType;
23
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
23
24
  var initialConfig = useProConfig('DatePicker');
24
25
  var _className = classNames(_defineProperty({
25
26
  'full-form-item': true
26
27
  }, className, !!className));
27
- if (isView || (props === null || props === void 0 ? void 0 : props.isView)) {
28
+ if (isView) {
28
29
  var value = rest.value;
29
30
  var viewChildren = null;
30
31
  if (!value) {
@@ -8,6 +8,7 @@ import { omit } from 'lodash';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
9
  import Container from '../../Container';
10
10
  import locale from '../../../../locale';
11
+ import ProForm from '../../../index';
11
12
  // 参数优先级
12
13
  // 组件内默认值 < config默认值 < props
13
14
  var Input = function Input(props) {
@@ -17,9 +18,10 @@ var Input = function Input(props) {
17
18
  fieldName = props.fieldName,
18
19
  otherProps = props.otherProps,
19
20
  rest = _objectWithoutProperties(props, _excluded);
20
- var _ref = otherProps || {},
21
- isView = _ref.isView,
21
+ var _ref = ProForm.useFieldProps() || {},
22
+ isViewCon = _ref.isView,
22
23
  viewEmpty = _ref.viewEmpty;
24
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
23
25
  var initialConfig = useProConfig('Input');
24
26
  if (isView) {
25
27
  return _jsx(Container, {
@@ -11,4 +11,5 @@ export interface ProFieldProps<T = any> {
11
11
  }
12
12
  export interface IProps extends InputProps, ProFieldProps {
13
13
  otherProps?: ProFormOtherProps;
14
+ isView?: boolean;
14
15
  }
@@ -5,6 +5,7 @@ export interface Props extends Omit<InputNumberProps, 'onBlur'> {
5
5
  otherProps?: ProFormOtherProps;
6
6
  range?: string;
7
7
  onBlur?: (value?: number, record?: any, object?: any) => void;
8
+ isView?: boolean;
8
9
  }
9
10
  declare const InputNumber: React.FC<Props>;
10
11
  export default InputNumber;
@@ -17,6 +17,7 @@ import { useProConfig } from '../../../../ProConfigProvider';
17
17
  import Container from '../../Container';
18
18
  import { getDecimalDigits } from '../../../utils/index';
19
19
  import locale from '../../../../locale';
20
+ import ProForm from '../../../../ProForm';
20
21
  var calc = tools.calc;
21
22
  var rangeReg = /^[([](-?\d+(\.\d+)?)?,\s*(-?\d+(\.\d+)?)?[)\]]$/;
22
23
  /**
@@ -42,12 +43,13 @@ var InputNumber = function InputNumber(props) {
42
43
  max = props.max,
43
44
  onBlur = props.onBlur,
44
45
  rest = _objectWithoutProperties(props, _excluded);
45
- var _ref2 = otherProps || {},
46
- isView = _ref2.isView,
46
+ var _ref2 = ProForm.useFieldProps() || {},
47
+ isViewCon = _ref2.isView,
47
48
  viewEmpty = _ref2.viewEmpty,
48
- viewType = _ref2.viewType,
49
49
  valueType = _ref2.valueType,
50
+ viewType = _ref2.viewType,
50
51
  label = _ref2.label;
52
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
51
53
  var valueProps = {};
52
54
  if (valueType) {
53
55
  switch (valueType) {
@@ -4,10 +4,11 @@ import _Cascader from "antd/es/cascader";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
7
- var _excluded = ["useRequest", "isView", "otherProps", "dataSource", "options"];
7
+ var _excluded = ["useRequest", "otherProps", "dataSource", "options"];
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { useRequest } from 'ahooks';
10
10
  import Container from '../../Container';
11
+ import ProForm from '../../../../ProForm';
11
12
  var defaultFieldNames = {
12
13
  value: 'value',
13
14
  label: 'label',
@@ -41,19 +42,18 @@ var findTreeTarget = function findTreeTarget(dataSource, value, fieldNames) {
41
42
  var ProCascader = function ProCascader(props) {
42
43
  var _restProps$fieldNames;
43
44
  var requestProps = props.useRequest,
44
- isView = props.isView,
45
45
  otherProps = props.otherProps,
46
46
  dataSource = props.dataSource,
47
47
  options = props.options,
48
48
  restProps = _objectWithoutProperties(props, _excluded);
49
- var _ref2 = otherProps || {},
50
- formIsView = _ref2.isView;
49
+ var _ref2 = ProForm.useFieldProps() || {},
50
+ isViewCon = _ref2.isView;
51
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
51
52
  var _useRequest = useRequest(requestProps === null || requestProps === void 0 ? void 0 : requestProps.service, requestProps === null || requestProps === void 0 ? void 0 : requestProps.options),
52
53
  data = _useRequest.data;
53
- var _isView = isView || formIsView;
54
54
  var _dataSource = data || dataSource || options;
55
55
  var _fieldNames = (_restProps$fieldNames = restProps.fieldNames) !== null && _restProps$fieldNames !== void 0 ? _restProps$fieldNames : defaultFieldNames;
56
- if (_isView) {
56
+ if (isView) {
57
57
  var valueTarget = findTreeTarget(_dataSource, restProps.value, _fieldNames);
58
58
  var valueName = _fieldNames.value,
59
59
  label = _fieldNames.label;
@@ -9,6 +9,7 @@ export interface Props extends Omit<RadioProps, 'options' | 'onChange'> {
9
9
  value: string;
10
10
  };
11
11
  otherProps?: ProFormOtherProps;
12
+ isView?: boolean;
12
13
  }
13
14
  declare const Radio: React.FC<Props>;
14
15
  export default Radio;
@@ -6,6 +6,7 @@ var _excluded = ["dataSource", "fieldNames", "onChange", "value", "otherProps"];
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { useProConfig } from '../../../../ProConfigProvider';
8
8
  import Container from '../../Container';
9
+ import ProForm from '../../../../ProForm';
9
10
  var Radio = function Radio(props) {
10
11
  var dataSource = props.dataSource,
11
12
  fieldNames = props.fieldNames,
@@ -13,9 +14,10 @@ var Radio = function Radio(props) {
13
14
  value = props.value,
14
15
  otherProps = props.otherProps,
15
16
  rest = _objectWithoutProperties(props, _excluded);
16
- var _ref = otherProps || {},
17
- isView = _ref.isView,
17
+ var _ref = ProForm.useFieldProps() || {},
18
+ isViewCon = _ref.isView,
18
19
  viewEmpty = _ref.viewEmpty;
20
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
19
21
  var initialConfig = useProConfig('Radio') || {};
20
22
  var _fieldNames = fieldNames || initialConfig.fieldNames || {
21
23
  label: 'label',
@@ -5,6 +5,7 @@ export type Props = {
5
5
  otherProps?: ProFormOtherProps;
6
6
  separator?: any;
7
7
  showTime?: any;
8
+ isView?: boolean;
8
9
  } & Omit<RangePickerProps, 'separator'>;
9
10
  declare const RangePicker: React.FC<Props>;
10
11
  export default RangePicker;
@@ -9,6 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { isFunction, isString, omit } from 'lodash';
10
10
  import moment from 'moment';
11
11
  import { useProConfig } from '../../../../ProConfigProvider';
12
+ import ProForm from '../../../../ProForm';
12
13
  import Container from '../../Container';
13
14
  var AntRangePicker = _DatePicker.RangePicker;
14
15
  var RangePicker = function RangePicker(props) {
@@ -18,11 +19,12 @@ var RangePicker = function RangePicker(props) {
18
19
  _props$separator = props.separator,
19
20
  separator = _props$separator === void 0 ? '~' : _props$separator,
20
21
  rest = _objectWithoutProperties(props, _excluded);
21
- var _ref = otherProps || {},
22
- isView = _ref.isView,
22
+ var initialConfig = useProConfig('AntRangePicker');
23
+ var _ref = ProForm.useFieldProps() || {},
24
+ isViewCon = _ref.isView,
23
25
  viewEmpty = _ref.viewEmpty,
24
26
  valueType = _ref.valueType;
25
- var initialConfig = useProConfig('AntRangePicker');
27
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
26
28
  if (isView) {
27
29
  var _props$value = props.value,
28
30
  value = _props$value === void 0 ? [] : _props$value;
@@ -5,6 +5,7 @@ export interface Props extends SelectProps {
5
5
  dataSource?: any[];
6
6
  scrollFollowParent?: boolean;
7
7
  otherProps?: ProFormOtherProps;
8
+ isView?: boolean;
8
9
  }
9
10
  declare const Select: React.FC<Props>;
10
11
  export default Select;
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import Container from '../../Container';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
9
  import locale from '../../../../locale';
10
+ import ProForm from '../../../index';
10
11
  var Select = function Select(props) {
11
12
  var _props$dataSource = props.dataSource,
12
13
  dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
@@ -15,9 +16,10 @@ var Select = function Select(props) {
15
16
  _props$scrollFollowPa = props.scrollFollowParent,
16
17
  scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa,
17
18
  rest = _objectWithoutProperties(props, _excluded);
18
- var _ref = otherProps || {},
19
- isView = _ref.isView,
19
+ var _ref = ProForm.useFieldProps() || {},
20
+ isViewCon = _ref.isView,
20
21
  viewEmpty = _ref.viewEmpty;
22
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
21
23
  var initialConfig = useProConfig('Select') || {};
22
24
  var _fieldNames = fieldNames || initialConfig.fieldNames || {
23
25
  label: 'label',
@@ -4,6 +4,7 @@ import { ProFormOtherProps } from '../../../propsType';
4
4
  export interface Props extends Omit<SwitchProps, 'value'> {
5
5
  value: any;
6
6
  otherProps?: ProFormOtherProps;
7
+ isView?: boolean;
7
8
  }
8
9
  declare const Switch: React.FC<Props>;
9
10
  export default Switch;
@@ -8,14 +8,16 @@ import { isNull, isUndefined } from 'lodash';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
9
  import Container from '../../Container';
10
10
  import locale from '../../../../locale';
11
+ import ProForm from '../../../../ProForm';
11
12
  var Switch = function Switch(props) {
12
13
  var disabled = props.disabled,
13
14
  otherProps = props.otherProps,
14
15
  res = _objectWithoutProperties(props, _excluded);
15
- var _ref = otherProps || {},
16
- isView = _ref.isView,
16
+ var _ref = ProForm.useFieldProps() || {},
17
+ isViewCon = _ref.isView,
17
18
  viewEmpty = _ref.viewEmpty,
18
19
  valueType = _ref.valueType;
20
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
19
21
  var config = useProConfig('Switch');
20
22
  if (isView) {
21
23
  if (isUndefined(res === null || res === void 0 ? void 0 : res.checked) || isNull(res === null || res === void 0 ? void 0 : res.checked) || valueType === 'switch' && isUndefined(res.value)) {
@@ -4,6 +4,7 @@ import { ProFormOtherProps } from '../../../propsType';
4
4
  export interface Props extends CheckboxProps {
5
5
  label?: string;
6
6
  otherProps?: ProFormOtherProps;
7
+ isView?: boolean;
7
8
  }
8
9
  declare const SwitchCheckbox: React.FC<Props>;
9
10
  export default SwitchCheckbox;
@@ -7,16 +7,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { isNull, isUndefined } from 'lodash';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
9
  import locale from '../../../../locale';
10
+ import ProForm from '../../../../ProForm';
10
11
  var SwitchCheckbox = function SwitchCheckbox(props) {
11
12
  var onChange = props.onChange,
12
13
  disabled = props.disabled,
13
14
  value = props.value,
14
15
  otherProps = props.otherProps,
15
16
  restProps = _objectWithoutProperties(props, _excluded);
16
- var _ref = otherProps || {},
17
- isView = _ref.isView,
17
+ var _ref = ProForm.useFieldProps() || {},
18
+ isViewCon = _ref.isView,
18
19
  viewEmpty = _ref.viewEmpty,
19
20
  valueType = _ref.valueType;
21
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
20
22
  var initialConfig = useProConfig('SwitchCheckbox');
21
23
  var changeVal = function changeVal(e) {
22
24
  onChange(e.target.checked);
@@ -4,6 +4,7 @@ import { ProFormOtherProps } from '../../../propsType';
4
4
  import './index.less';
5
5
  export interface Props extends TextAreaProps {
6
6
  otherProps?: ProFormOtherProps;
7
+ isView?: boolean;
7
8
  }
8
9
  declare const TextAreaDef: React.FC<Props>;
9
10
  export default TextAreaDef;
@@ -8,6 +8,7 @@ import { omit } from 'lodash';
8
8
  import classnames from 'classnames';
9
9
  import { useProConfig } from '../../../../ProConfigProvider';
10
10
  import locale from '../../../../locale';
11
+ import ProForm from '../../../../ProForm';
11
12
  import './index.less';
12
13
  var TextArea = _Input.TextArea;
13
14
  var TextAreaDef = function TextAreaDef(props) {
@@ -15,10 +16,10 @@ var TextAreaDef = function TextAreaDef(props) {
15
16
  otherProps = props.otherProps,
16
17
  className = props.className,
17
18
  rest = _objectWithoutProperties(props, _excluded);
18
- var _ref = otherProps || {},
19
+ var _ref = ProForm.useFieldProps() || {},
19
20
  label = _ref.label,
20
- isView = _ref.isView,
21
- viewEmpty = _ref.viewEmpty;
21
+ isViewCon = _ref.isView;
22
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
22
23
  var initialConfig = useProConfig('TextArea');
23
24
  var disabled = (initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.disabled) || rest.disabled;
24
25
  if (isView) {
@@ -8,6 +8,7 @@ export interface Props {
8
8
  onChange?: (value: string) => void;
9
9
  value?: string;
10
10
  otherProps?: ProFormOtherProps;
11
+ isView?: boolean;
11
12
  }
12
13
  declare const TimePicker: React.FC<Props & TimePickerProps>;
13
14
  export default TimePicker;
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import moment from 'moment';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
9
  import Container from '../../Container';
10
+ import ProForm from '../../../../ProForm';
10
11
  import './style/index.less';
11
12
  var TimePicker = function TimePicker(props) {
12
13
  var _props$format = props.format,
@@ -15,11 +16,12 @@ var TimePicker = function TimePicker(props) {
15
16
  value = props.value,
16
17
  otherProps = props.otherProps,
17
18
  rest = _objectWithoutProperties(props, _excluded);
18
- var _ref = otherProps || {},
19
- isView = _ref.isView,
19
+ var _ref = ProForm.useFieldProps() || {},
20
+ isViewCon = _ref.isView,
20
21
  viewEmpty = _ref.viewEmpty,
21
22
  _ref$valueType = _ref.valueType,
22
23
  valueType = _ref$valueType === void 0 ? 'dateTime' : _ref$valueType;
24
+ var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
23
25
  var initialConfig = useProConfig('AntTimePicker');
24
26
  var handleChange = function handleChange(value) {
25
27
  if (valueType === 'dateTime') {
@@ -6,16 +6,18 @@ import { omit } from 'lodash';
6
6
  import classnames from 'classnames';
7
7
  import RenderFields from '../../render/RenderFields';
8
8
  import ProCollapse from '../../../../ProLayout/components/ProCollapse';
9
+ import ProForm from '../../../../ProForm';
9
10
  var Container = function Container(props) {
10
11
  var children = props.children,
11
12
  otherProps = props.otherProps,
12
13
  className = props.className,
13
14
  container = props.container;
14
- var type = otherProps.type,
15
- form = otherProps.form,
16
- show = otherProps.show,
17
- required = otherProps.required,
18
- disabled = otherProps.disabled;
15
+ var _ref = ProForm.useFieldProps() || {},
16
+ type = _ref.type,
17
+ form = _ref.form,
18
+ show = _ref.show,
19
+ required = _ref.required,
20
+ disabled = _ref.disabled;
19
21
  var _className = classnames(_defineProperty({
20
22
  'pro-container': true,
21
23
  'pro-container-diy': type === 'Container'