@zat-design/sisyphus-react 3.8.2 → 3.8.3

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 (42) hide show
  1. package/dist/index.esm.css +16 -8
  2. package/dist/less.esm.css +16 -8
  3. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -6
  4. package/es/ProEditTable/components/RenderField/index.js +1 -0
  5. package/es/ProEnum/hooks/useEnumRequest.js +1 -1
  6. package/es/ProEnum/index.js +2 -2
  7. package/es/ProForm/components/base/InputNumber/index.js +1 -1
  8. package/es/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
  9. package/es/ProForm/components/combination/Group/component/ComRender.js +4 -2
  10. package/es/ProForm/components/combination/Group/index.js +6 -3
  11. package/es/ProForm/components/render/ChangedWrapper.js +8 -2
  12. package/es/ProForm/components/render/Render.js +3 -2
  13. package/es/ProForm/components/render/propsType.d.ts +4 -0
  14. package/es/ProForm/style/index.less +15 -2
  15. package/es/ProForm/utils/useShouldUpdate.js +21 -6
  16. package/es/ProTable/components/FormatColumn/index.d.ts +3 -1
  17. package/es/ProTable/components/FormatColumn/index.js +92 -17
  18. package/es/ProTable/components/RenderColumn/index.d.ts +1 -0
  19. package/es/ProTable/components/RenderColumn/index.js +22 -7
  20. package/es/ProTable/index.js +20 -5
  21. package/es/ProTable/style/index.less +8 -6
  22. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +10 -9
  23. package/lib/ProEditTable/components/RenderField/index.js +1 -0
  24. package/lib/ProEnum/hooks/useEnumRequest.js +1 -1
  25. package/lib/ProEnum/index.js +2 -2
  26. package/lib/ProForm/components/base/InputNumber/index.js +1 -1
  27. package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
  28. package/lib/ProForm/components/combination/Group/component/ComRender.js +4 -2
  29. package/lib/ProForm/components/combination/Group/index.js +6 -3
  30. package/lib/ProForm/components/render/ChangedWrapper.js +8 -2
  31. package/lib/ProForm/components/render/Render.js +3 -2
  32. package/lib/ProForm/components/render/propsType.d.ts +4 -0
  33. package/lib/ProForm/style/index.less +15 -2
  34. package/lib/ProForm/utils/useShouldUpdate.js +19 -4
  35. package/lib/ProTable/components/FormatColumn/index.d.ts +3 -1
  36. package/lib/ProTable/components/FormatColumn/index.js +91 -16
  37. package/lib/ProTable/components/RenderColumn/index.d.ts +1 -0
  38. package/lib/ProTable/components/RenderColumn/index.js +22 -7
  39. package/lib/ProTable/index.js +20 -5
  40. package/lib/ProTable/style/index.less +8 -6
  41. package/package.json +4 -3
  42. package/.vscode/extensions.json +0 -5
@@ -1899,20 +1899,22 @@
1899
1899
  .pro-table .ant-table-tbody .ant-table-cell-fix-right {
1900
1900
  background: unset !important;
1901
1901
  }
1902
- .pro-table .ant-table-body .ant-table-tbody .ant-table-row:nth-child(odd).new-cell {
1903
- background: #d2fff4 !important;
1902
+ .pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell {
1903
+ background: var(--zaui-contract-bg-add, #d2fff4) !important;
1904
+ background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
1904
1905
  }
1905
- .pro-table .ant-table-body .ant-table-tbody .ant-table-row:nth-child(odd).new-cell td {
1906
- background: #d2fff4 !important;
1906
+ .pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell td.ant-table-cell {
1907
+ background: var(--zaui-contract-bg-add, #d2fff4) !important;
1908
+ background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
1907
1909
  border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
1908
1910
  }
1909
- .pro-table .ant-table-body .ant-table-cell .varied-cell {
1911
+ .pro-table tbody.ant-table-tbody .ant-table-cell .varied-cell {
1910
1912
  margin-left: -8px;
1911
1913
  padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
1912
1914
  background: var(--zaui-contract-bg, #fffaa1) !important;
1913
1915
  border-radius: var(--zaui-border-radius, 8px);
1914
1916
  }
1915
- .pro-table .ant-table-body .varied-cell.empty-cell {
1917
+ .pro-table tbody.ant-table-tbody .varied-cell.empty-cell {
1916
1918
  width: 24.5px;
1917
1919
  }
1918
1920
  .pro-table .copyable-table-cell .ant-typography {
@@ -3073,7 +3075,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3073
3075
  padding: 5px 0;
3074
3076
  }
3075
3077
  .pro-form .pro-form-item-changed .ant-input-textarea > textarea {
3076
- background: var(--zaui-contract-bg, #fffaa1);
3078
+ background: var(--zaui-contract-bg, #fffaa1) !important;
3077
3079
  }
3078
3080
  .pro-form .pro-form-item-changed .pro-form-view-container {
3079
3081
  padding: 4px 8px;
@@ -3130,13 +3132,19 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3130
3132
  padding: 5px 0;
3131
3133
  }
3132
3134
  .pro-form .pro-form-item-add .ant-input-textarea > textarea {
3133
- background: var(--zaui-contract-bg-add, #d2fff4);
3135
+ background: var(--zaui-contract-bg-add, #d2fff4) !important;
3134
3136
  }
3135
3137
  .pro-form .pro-form-item-add .pro-form-view-container {
3136
3138
  padding: 4px 8px;
3137
3139
  background: var(--zaui-contract-bg-add, #d2fff4);
3138
3140
  border-radius: 4px;
3139
3141
  }
3142
+ .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
3143
+ white-space: nowrap;
3144
+ }
3145
+ .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
3146
+ white-space: nowrap;
3147
+ }
3140
3148
  .pro-upload .pro-upload-dragger .pro-upload-handle-box {
3141
3149
  padding: var(--zaui-space-size-sm, 8px);
3142
3150
  background: #f8f9fa;
package/dist/less.esm.css CHANGED
@@ -1899,20 +1899,22 @@
1899
1899
  .pro-table .ant-table-tbody .ant-table-cell-fix-right {
1900
1900
  background: unset !important;
1901
1901
  }
1902
- .pro-table .ant-table-body .ant-table-tbody .ant-table-row:nth-child(odd).new-cell {
1903
- background: #d2fff4 !important;
1902
+ .pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell {
1903
+ background: var(--zaui-contract-bg-add, #d2fff4) !important;
1904
+ background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
1904
1905
  }
1905
- .pro-table .ant-table-body .ant-table-tbody .ant-table-row:nth-child(odd).new-cell td {
1906
- background: #d2fff4 !important;
1906
+ .pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell td.ant-table-cell {
1907
+ background: var(--zaui-contract-bg-add, #d2fff4) !important;
1908
+ background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
1907
1909
  border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
1908
1910
  }
1909
- .pro-table .ant-table-body .ant-table-cell .varied-cell {
1911
+ .pro-table tbody.ant-table-tbody .ant-table-cell .varied-cell {
1910
1912
  margin-left: -8px;
1911
1913
  padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
1912
1914
  background: var(--zaui-contract-bg, #fffaa1) !important;
1913
1915
  border-radius: var(--zaui-border-radius, 8px);
1914
1916
  }
1915
- .pro-table .ant-table-body .varied-cell.empty-cell {
1917
+ .pro-table tbody.ant-table-tbody .varied-cell.empty-cell {
1916
1918
  width: 24.5px;
1917
1919
  }
1918
1920
  .pro-table .copyable-table-cell .ant-typography {
@@ -3073,7 +3075,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3073
3075
  padding: 5px 0;
3074
3076
  }
3075
3077
  .pro-form .pro-form-item-changed .ant-input-textarea > textarea {
3076
- background: var(--zaui-contract-bg, #fffaa1);
3078
+ background: var(--zaui-contract-bg, #fffaa1) !important;
3077
3079
  }
3078
3080
  .pro-form .pro-form-item-changed .pro-form-view-container {
3079
3081
  padding: 4px 8px;
@@ -3130,13 +3132,19 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3130
3132
  padding: 5px 0;
3131
3133
  }
3132
3134
  .pro-form .pro-form-item-add .ant-input-textarea > textarea {
3133
- background: var(--zaui-contract-bg-add, #d2fff4);
3135
+ background: var(--zaui-contract-bg-add, #d2fff4) !important;
3134
3136
  }
3135
3137
  .pro-form .pro-form-item-add .pro-form-view-container {
3136
3138
  padding: 4px 8px;
3137
3139
  background: var(--zaui-contract-bg-add, #d2fff4);
3138
3140
  border-radius: 4px;
3139
3141
  }
3142
+ .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
3143
+ white-space: nowrap;
3144
+ }
3145
+ .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
3146
+ white-space: nowrap;
3147
+ }
3140
3148
  .pro-upload .pro-upload-dragger .pro-upload-handle-box {
3141
3149
  padding: var(--zaui-space-size-sm, 8px);
3142
3150
  background: #f8f9fa;
@@ -1,10 +1,11 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import "antd/es/space/style";
2
3
  import _Space from "antd/es/space";
3
4
  import "antd/es/tooltip/style";
4
5
  import _Tooltip from "antd/es/tooltip";
5
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
7
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
7
- var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "valuePropName"];
8
+ var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName"];
8
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  import React, { useMemo } from 'react';
10
11
  import classNames from 'classnames';
@@ -65,6 +66,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
65
66
  }) : get(originalValues, originalName);
66
67
  };
67
68
  var ListChangedWrapper = function ListChangedWrapper(props) {
69
+ var _getValueProps;
68
70
  var name = props.name,
69
71
  names = props.names,
70
72
  namesStr = props.namesStr,
@@ -79,6 +81,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
79
81
  children = props.children,
80
82
  type = props.type,
81
83
  normalize = props.normalize,
84
+ getValueProps = props.getValueProps,
82
85
  _props$valuePropName = props.valuePropName,
83
86
  valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
84
87
  rest = _objectWithoutProperties(props, _excluded);
@@ -124,12 +127,10 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
124
127
  return target.parentElement;
125
128
  },
126
129
  title: _jsxs(_Space, {
127
- children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children), {}, {
130
+ children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children), {}, _defineProperty(_defineProperty({
128
131
  // @ts-ignore
129
- isView: true,
130
- value: originalValue,
131
- checked: type === 'Switch' ? originalValue : undefined
132
- })) : undefined]
132
+ isView: true
133
+ }, valuePropName, getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : props[valuePropName]), "checked", type === 'Switch' ? originalValue : undefined))) : undefined]
133
134
  }),
134
135
  children: _jsx("div", {
135
136
  className: diffClassName,
@@ -559,6 +559,7 @@ var RenderField = function RenderField(_ref) {
559
559
  onChange: _onChange,
560
560
  valuePropName: _formItemProps.valuePropName,
561
561
  normalize: _formItemProps.normalize,
562
+ getValueProps: _formItemProps.getValueProps,
562
563
  children: FieldComponent
563
564
  });
564
565
  }
@@ -42,7 +42,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
42
42
  }
43
43
  var logDebug = function logDebug(msg) {
44
44
  if (props.debugger) {
45
- console.info('proEnum:', msg);
45
+ console.warn('proEnum:', msg);
46
46
  }
47
47
  };
48
48
  var enumRes = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
@@ -53,8 +53,8 @@ var ProEnum = function ProEnum(props) {
53
53
  showCodeName = _ref2.showCodeName,
54
54
  resProps = _objectWithoutProperties(_ref2, _excluded2);
55
55
  enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
56
- var label = '';
57
- var fieldValue = '';
56
+ var label = 'label';
57
+ var fieldValue = 'value';
58
58
  var _useState = useState(dataSource || []),
59
59
  _useState2 = _slicedToArray(_useState, 2),
60
60
  dataList = _useState2[0],
@@ -82,7 +82,7 @@ var InputNumber = function InputNumber(props) {
82
82
  var _parser = function parser(value, precision) {
83
83
  if (value === '') return value;
84
84
  var num = Number(value.replace(/[\s,]+/g, ''));
85
- return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : value : num.toFixed(precision);
85
+ return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : Number(value) : Number(num.toFixed(precision));
86
86
  };
87
87
  if (valueType) {
88
88
  switch (valueType) {
@@ -14,6 +14,7 @@ interface Props {
14
14
  name?: NamePath;
15
15
  valueType: string;
16
16
  valuePropName?: string;
17
+ isView?: boolean;
17
18
  getValueProps?: (value: any) => Record<string, unknown>;
18
19
  }
19
20
  /** 渲染组件 */
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType"];
4
+ var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import React from 'react';
7
7
  import ConfirmWrapper from '../../../../components/render/ConfirmWrapper';
@@ -41,6 +41,7 @@ var ComRender = function ComRender(props) {
41
41
  _props$valuePropName = props.valuePropName,
42
42
  valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
43
43
  valueType = props.valueType,
44
+ isView = props.isView,
44
45
  rest = _objectWithoutProperties(props, _excluded);
45
46
  var TypeComponent = componentMap[type];
46
47
  var mergedGetValueProps = getValueProps || function (val) {
@@ -53,7 +54,8 @@ var ComRender = function ComRender(props) {
53
54
  return _jsx(FieldProvider, {
54
55
  value: _objectSpread(_objectSpread({}, contextProps), {}, {
55
56
  valueType: valueType,
56
- type: type
57
+ type: type,
58
+ isView: isView
57
59
  }),
58
60
  children: Com
59
61
  });
@@ -27,7 +27,8 @@ var Group = function Group(props) {
27
27
  onChange = props.onChange,
28
28
  otherProps = props.otherProps,
29
29
  disabled = props.disabled,
30
- id = props.id;
30
+ id = props.id,
31
+ isView = props.isView;
31
32
  var contextProps = ProForm.useFieldProps() || {};
32
33
  var names = contextProps.names,
33
34
  name = contextProps.name,
@@ -70,7 +71,8 @@ var Group = function Group(props) {
70
71
  children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? _jsx(_Space.Compact, {
71
72
  children: columns.map(function (column, index) {
72
73
  return _jsx(ComRender, _objectSpread(_objectSpread({
73
- contextProps: contextProps
74
+ contextProps: contextProps,
75
+ isView: isView
74
76
  }, column), {}, {
75
77
  otherProps: otherProps
76
78
  }), column.name);
@@ -80,7 +82,8 @@ var Group = function Group(props) {
80
82
  }, omit(space, ['separator', 'compact'])), {}, {
81
83
  children: columns.map(function (column, index) {
82
84
  return _jsx(ComRender, _objectSpread(_objectSpread({
83
- contextProps: contextProps
85
+ contextProps: contextProps,
86
+ isView: isView
84
87
  }, column), {}, {
85
88
  otherProps: otherProps
86
89
  }), column.name);
@@ -5,7 +5,7 @@ import _Tooltip from "antd/es/tooltip";
5
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
7
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
8
- var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
8
+ var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps"];
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  import classNames from 'classnames';
11
11
  import { get } from 'lodash';
@@ -26,6 +26,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
26
26
  _props$valuePropName = props.valuePropName,
27
27
  valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
28
28
  normalize = props.normalize,
29
+ getValueProps = props.getValueProps,
29
30
  rest = _objectWithoutProperties(props, _excluded);
30
31
  var _useProConfig = useProConfig('ProForm'),
31
32
  isDiffAll = _useProConfig.isDiffAll;
@@ -53,9 +54,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
53
54
  var isChanged = diffType === 'changed';
54
55
  var tipContent = useMemo(function () {
55
56
  if (!isWatch || noChange) return undefined;
57
+ var valueProps = getValueProps ? getValueProps(originalValue) : originalValue;
56
58
  return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
57
59
  isView: true
58
- }, valuePropName, originalValue))) : undefined;
60
+ }, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
59
61
  }, [originalValue, children]);
60
62
  if (!isWatch || noChange) {
61
63
  // 嵌套子组件
@@ -87,9 +89,13 @@ var ChangedWrapper = function ChangedWrapper(props) {
87
89
  },
88
90
  title: _jsxs(_Space, {
89
91
  direction: "vertical",
92
+ className: "changed-tooltip",
90
93
  children: [_jsxs(_Space, {
94
+ align: "start",
95
+ className: "original-value-container",
91
96
  children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
92
97
  }), _showEllipse && _jsxs(_Space, {
98
+ className: "current-value-container",
93
99
  children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
94
100
  isView: true
95
101
  })) : undefined]
@@ -155,7 +155,7 @@ var Render = function Render(props) {
155
155
  };
156
156
  }
157
157
  /** 移除多余参数,防止透传给formItem报错 */
158
- var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow']);
158
+ var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow', 'dependNames']);
159
159
  /**
160
160
  * globalControl 全局控制优先
161
161
  * globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
@@ -426,7 +426,7 @@ var Render = function Render(props) {
426
426
  span: 24 // 默认占一行
427
427
  });
428
428
  }
429
- if (diffConfig) {
429
+ if (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues) {
430
430
  child = _jsx(ChangedWrapper, {
431
431
  name: formItemProps.name,
432
432
  names: otherProps.names,
@@ -438,6 +438,7 @@ var Render = function Render(props) {
438
438
  onChange: handleChange,
439
439
  valuePropName: _otherFormItemProps.valuePropName,
440
440
  normalize: _otherFormItemProps.normalize,
441
+ getValueProps: _otherFormItemProps.getValueProps,
441
442
  children: child
442
443
  });
443
444
  }
@@ -182,6 +182,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
182
182
  }) => React.ReactElement<any, any> | string | undefined | null;
183
183
  viewType?: ViewType;
184
184
  colProps?: ColProps;
185
+ /** 依赖刷新字段列表 */
186
+ dependNames?: NamePath[];
185
187
  /**
186
188
  * @description 表单item的props属性
187
189
  * @deprecated 将于下个版本 4.0.0 被弃用
@@ -190,6 +192,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
190
192
  formItemProps?: FormItemProps<Values> & {
191
193
  index?: number;
192
194
  namePath?: NamePath;
195
+ /** 依赖刷新字段列表 */
196
+ dependNames?: NamePath[];
193
197
  };
194
198
  /**
195
199
  * @description 表单props属性
@@ -387,7 +387,7 @@
387
387
 
388
388
  // textArea
389
389
  .@{ant-prefix}-input-textarea > textarea {
390
- background: @zaui-contract-bg;
390
+ background: @zaui-contract-bg !important;
391
391
  }
392
392
 
393
393
  .pro-form-view-container {
@@ -461,7 +461,7 @@
461
461
 
462
462
  // textArea
463
463
  .@{ant-prefix}-input-textarea > textarea {
464
- background: @zaui-contract-bg-add;
464
+ background: @zaui-contract-bg-add !important;
465
465
  }
466
466
 
467
467
 
@@ -472,3 +472,16 @@
472
472
  }
473
473
  }
474
474
  }
475
+
476
+ .changed-tooltip {
477
+ .original-value-container {
478
+ .ant-space-item:nth-child(1) {
479
+ white-space: nowrap;
480
+ }
481
+ }
482
+ .current-value-container {
483
+ .ant-space-item:nth-child(1) {
484
+ white-space: nowrap;
485
+ }
486
+ }
487
+ }
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import { useRef, useState } from 'react';
3
- import { isFunction, isEqualWith } from 'lodash';
4
- import { customEqualForFun, equalDependencies } from './index';
3
+ import { isFunction, isEqualWith, get } from 'lodash';
4
+ import { customEqualForFun } from './index';
5
5
  // 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
6
6
  var useShouldUpdate = function useShouldUpdate(props) {
7
7
  var show = props.show,
@@ -20,7 +20,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
20
20
  index = formItemProps.index,
21
21
  namePath = formItemProps.namePath,
22
22
  names = formItemProps.names,
23
- dependencies = formItemProps.dependencies;
23
+ dependNames = formItemProps.dependNames;
24
24
  var timerRef = useRef();
25
25
  var needClear = useRef(); // 是否需要执行清值操作
26
26
  var showRef = useRef();
@@ -29,13 +29,14 @@ var useShouldUpdate = function useShouldUpdate(props) {
29
29
  var rulesRef = useRef();
30
30
  var fieldPropsRef = useRef();
31
31
  var originComponentRef = useRef();
32
+ var dependNamesRef = useRef();
32
33
  var newComponent = originComponent || component; // 解决component默认赋值污染问题,需要使用originComponent
33
34
  var _useState = useState({}),
34
35
  _useState2 = _slicedToArray(_useState, 2),
35
36
  reRender = _useState2[1];
36
37
  var values = {};
37
38
  // 不是动态函数直接返回
38
- if (!isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent)) {
39
+ if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent)) {
39
40
  return {
40
41
  shouldUpdate: _shouldUpdate,
41
42
  show: show,
@@ -119,9 +120,22 @@ var useShouldUpdate = function useShouldUpdate(props) {
119
120
  } else {
120
121
  fieldPropsRef.current = fieldProps;
121
122
  }
123
+ if (dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) {
124
+ dependNamesRef.current = dependNames.map(function (name) {
125
+ return get(values, name);
126
+ });
127
+ }
122
128
  return {
123
129
  shouldUpdate: function shouldUpdate(prevValues, currentValues) {
124
130
  // @ts-ignore formList场景取当前行数据,不取shouldUpdate变更后值
131
+ if (dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) {
132
+ var curDependNamesValue = dependNames.map(function (name) {
133
+ return get(currentValues, name);
134
+ });
135
+ var dependNamesChanged = !isEqualWith(dependNamesRef.current, curDependNamesValue, customEqualForFun);
136
+ dependNamesRef.current = curDependNamesValue;
137
+ if (!dependNamesChanged) return false;
138
+ }
125
139
  var _currentValues;
126
140
  if (namePath) {
127
141
  // formList场景values取当前行数据
@@ -182,11 +196,12 @@ var useShouldUpdate = function useShouldUpdate(props) {
182
196
  }
183
197
  var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFun);
184
198
  var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun);
185
- if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes ||
199
+ if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes
186
200
  // 值变更,需要同步更新函数式的fieldProps
187
201
  // (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
188
202
  // !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
189
- equalDependencies(dependencies, prevValues, _currentValues)) {
203
+ // equalDependencies(dependencies, prevValues, _currentValues)
204
+ ) {
190
205
  showRef.current = _show;
191
206
  disabledRef.current = _disabled;
192
207
  requiredRef.current = _required;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
2
  import { ProTableColumn } from '../../propsType';
3
- export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, }: {
3
+ export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, scroll, onUpdateMinWidth, }: {
4
4
  column: ProTableColumn;
5
5
  originalObj: any;
6
6
  dataSourceObj: any;
7
7
  rowKey: any;
8
8
  diffToolTip?: boolean;
9
9
  wrapToolTipProps?: any;
10
+ scroll?: any;
11
+ onUpdateMinWidth?: any;
10
12
  }) => void;
11
13
  /**
12
14
  * 查找最近的父级className