@zat-design/sisyphus-react 3.8.0-beta.15 → 3.8.0-beta.16

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 (47) hide show
  1. package/dist/index.esm.css +8 -46
  2. package/dist/less.esm.css +8 -46
  3. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +8 -4
  4. package/es/ProEditTable/components/RenderField/index.js +4 -2
  5. package/es/ProForm/components/FormFooter/index.js +6 -4
  6. package/es/ProForm/components/combination/Group/utils.js +8 -1
  7. package/es/ProForm/components/combination/ProCascader/index.js +5 -2
  8. package/es/ProForm/components/combination/ProModalSelect/index.js +7 -1
  9. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  10. package/es/ProForm/components/combination/ProNumberRange/index.js +54 -43
  11. package/es/ProForm/components/combination/ProNumberRange/style/index.less +51 -52
  12. package/es/ProForm/components/render/ChangedWrapper.js +5 -3
  13. package/es/ProForm/components/render/Render.js +1 -0
  14. package/es/ProForm/components/render/propsType.d.ts +1 -1
  15. package/es/ProForm/style/index.less +1 -1
  16. package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
  17. package/es/ProForm/utils/useShouldUpdate.js +1 -1
  18. package/es/ProSelect/index.js +2 -3
  19. package/es/ProSelect/utils/index.js +5 -4
  20. package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
  21. package/es/ProTable/components/FormatColumn/index.js +12 -9
  22. package/es/ProTable/index.js +11 -1
  23. package/es/ProTable/propsType.d.ts +4 -0
  24. package/es/ProTree/components/ProTreeSelect/index.js +10 -0
  25. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +8 -4
  26. package/lib/ProEditTable/components/RenderField/index.js +4 -2
  27. package/lib/ProForm/components/FormFooter/index.js +5 -3
  28. package/lib/ProForm/components/combination/Group/utils.js +8 -1
  29. package/lib/ProForm/components/combination/ProCascader/index.js +5 -2
  30. package/lib/ProForm/components/combination/ProModalSelect/index.js +7 -1
  31. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  32. package/lib/ProForm/components/combination/ProNumberRange/index.js +48 -41
  33. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +51 -52
  34. package/lib/ProForm/components/render/ChangedWrapper.js +5 -3
  35. package/lib/ProForm/components/render/Render.js +1 -0
  36. package/lib/ProForm/components/render/propsType.d.ts +1 -1
  37. package/lib/ProForm/style/index.less +1 -1
  38. package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
  39. package/lib/ProForm/utils/useShouldUpdate.js +1 -1
  40. package/lib/ProSelect/index.js +2 -3
  41. package/lib/ProSelect/utils/index.js +5 -4
  42. package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
  43. package/lib/ProTable/components/FormatColumn/index.js +12 -9
  44. package/lib/ProTable/index.js +11 -1
  45. package/lib/ProTable/propsType.d.ts +4 -0
  46. package/lib/ProTree/components/ProTreeSelect/index.js +10 -0
  47. package/package.json +1 -1
@@ -6,83 +6,82 @@
6
6
  width: 32px !important;
7
7
  text-align: center !important;
8
8
 
9
- border-right: 0px;
10
- border-left: 0px;
11
9
  pointer-events: none;
12
10
  &.@{ant-prefix}-input[disabled] {
13
11
  background: #fff !important;
14
12
  }
15
13
  }
14
+ // 数字输入框error状态
16
15
  .@{ant-prefix}-input-number-status-error:not(.@{ant-prefix}-input-number-disabled):not(
17
16
  .@{ant-prefix}-input-number-borderless
18
17
  ).@{ant-prefix}-input-number {
19
18
  border-color: @zaui-danger !important;
20
19
  }
21
- .@{ant-prefix}-input-status-error {
22
- &.range-split {
23
- color: @zaui-danger !important;
20
+
21
+ // 分隔符输入框error状态
22
+ &:has(.@{ant-prefix}-input-status-error):not(.pro-number-range-disabled) {
23
+ .range-split,
24
+ .range-addon-before,
25
+ .range-addon-after {
26
+ // color: @zaui-danger !important;
24
27
  border-color: @zaui-danger;
25
28
  }
26
29
  }
27
30
 
28
- & .@{ant-prefix}-input-rtl.range-right {
29
- border-right-width: 0;
30
- }
31
-
32
- & .@{ant-prefix}-input-rtl.range-right:hover,
33
- & .@{ant-prefix}-input-rtl.range-right:focus {
34
- border-right-width: 1px;
35
- }
36
-
37
31
  .@{ant-prefix}-form-item {
38
32
  margin-bottom: 0;
39
33
  }
40
34
 
41
- .range-left,
42
- .range-right {
43
- width: calc(50% - 20px);
44
- text-align: center;
45
- }
35
+ // .range-left,
36
+ // .range-right {
37
+ // text-align: center;
38
+ // }
46
39
 
47
- .range-left {
48
- .@{ant-prefix}-input-number {
49
- border-right: none;
50
- }
51
- }
40
+ // .range-left {
41
+ // .@{ant-prefix}-input-number {
42
+ // border-right: none;
43
+ // }
44
+ // }
52
45
 
53
- .range-right {
54
- .@{ant-prefix}-input-number {
55
- border-left: none;
56
- }
46
+ // .range-right {
47
+ // .@{ant-prefix}-input-number {
48
+ // border-left: none;
49
+ // }
57
50
 
58
- .range-right {
59
- width: 100%;
60
- border-top-left-radius: 0;
61
- border-bottom-left-radius: 0;
62
- }
63
- }
51
+ // .range-right {
52
+ // width: 100%;
53
+ // border-top-left-radius: 0;
54
+ // border-bottom-left-radius: 0;
55
+ // }
56
+ // }
64
57
 
65
- &.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > *:not(:last-child) {
66
- margin-right: 0;
58
+ .range-addon-before,
59
+ .range-addon-after {
60
+ color: var(--zaui-disabled-text);
61
+ pointer-events: none;
67
62
  }
68
63
 
69
- > *:first-child {
70
- border-top-right-radius: 0 !important;
71
- border-bottom-right-radius: 0 !important;
64
+ // &.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > *:not(:last-child) {
65
+ // margin-right: 0;
66
+ // }
72
67
 
73
- > .@{ant-prefix}-select-selector {
74
- border-top-right-radius: 0 !important;
75
- border-bottom-right-radius: 0 !important;
76
- }
77
- }
68
+ // > *:first-child {
69
+ // border-top-right-radius: 0 !important;
70
+ // border-bottom-right-radius: 0 !important;
78
71
 
79
- > *:last-child {
80
- border-top-left-radius: 0 !important;
81
- border-bottom-left-radius: 0 !important;
72
+ // > .@{ant-prefix}-select-selector {
73
+ // border-top-right-radius: 0 !important;
74
+ // border-bottom-right-radius: 0 !important;
75
+ // }
76
+ // }
82
77
 
83
- > .@{ant-prefix}-select-selector {
84
- border-top-left-radius: 0 !important;
85
- border-bottom-left-radius: 0 !important;
86
- }
87
- }
78
+ // > *:last-child {
79
+ // border-top-left-radius: 0 !important;
80
+ // border-bottom-left-radius: 0 !important;
81
+
82
+ // > .@{ant-prefix}-select-selector {
83
+ // border-top-left-radius: 0 !important;
84
+ // border-bottom-left-radius: 0 !important;
85
+ // }
86
+ // }
88
87
  }
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _diffOriginal = require("../../utils/diffOriginal");
18
18
  var _ProConfigProvider = require("../../../ProConfigProvider");
19
19
  var _utils = require("../../../utils");
20
- var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
20
+ var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
21
21
  var ChangedWrapper = function ChangedWrapper(props) {
22
22
  var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
23
23
  var name = props.name,
@@ -30,6 +30,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
30
30
  diffConfig = props.diffConfig,
31
31
  _props$valuePropName = props.valuePropName,
32
32
  valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
33
+ normalize = props.normalize,
33
34
  rest = (0, _objectWithoutProperties2.default)(props, _excluded);
34
35
  var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProForm'),
35
36
  isDiffAll = _useProConfig.isDiffAll;
@@ -44,9 +45,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
44
45
  var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
45
46
  var diffType = (0, _react.useMemo)(function () {
46
47
  if (!isWatch || noChange) return 'same';
48
+ var _value = normalize ? normalize(props[valuePropName]) : props[valuePropName];
47
49
  return (0, _diffOriginal.diffOriginal)({
48
50
  originalValue: originalValue,
49
- value: props[valuePropName],
51
+ value: _value,
50
52
  form: form,
51
53
  equalWith: equalWith
52
54
  // name: namesStr || name,
@@ -84,7 +86,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
84
86
  var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
85
87
  return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
86
88
  open: tipOpenCalc(),
87
- mouseEnterDelay: 1,
89
+ // mouseEnterDelay={1}
88
90
  getPopupContainer: function getPopupContainer(target) {
89
91
  return target.parentElement;
90
92
  },
@@ -437,6 +437,7 @@ var Render = function Render(props) {
437
437
  type: type,
438
438
  onChange: handleChange,
439
439
  valuePropName: _otherFormItemProps.valuePropName,
440
+ normalize: _otherFormItemProps.normalize,
440
441
  children: child
441
442
  });
442
443
  }
@@ -197,7 +197,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
197
197
  * @default -
198
198
  */
199
199
  labelWidth?: string | number;
200
- disabled?: boolean | ReactiveFunction<Values, boolean>;
200
+ disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
201
201
  trim?: boolean;
202
202
  upperCase?: boolean;
203
203
  hiddenNames?: string[] | any[];
@@ -218,7 +218,7 @@
218
218
 
219
219
  .site-input-left,
220
220
  .site-input-right {
221
- width: calc(50% - 20px);
221
+ width: calc(50% - 16px);
222
222
  }
223
223
 
224
224
  .site-input-left {
@@ -3,7 +3,7 @@ import { ProColumnProps, ProRule } from '../components/render/propsType';
3
3
  interface Result<Values> {
4
4
  shouldUpdate?: FormItemProps<Values>['shouldUpdate'];
5
5
  show?: boolean;
6
- disabled?: boolean;
6
+ disabled?: boolean | boolean[];
7
7
  rules?: ProRule[];
8
8
  required?: boolean;
9
9
  [key: string]: any;
@@ -15,7 +15,7 @@ interface UseShouldUpdateProps<Values> {
15
15
  names?: any[];
16
16
  };
17
17
  form?: FormInstance<Values>;
18
- disabled?: ProColumnProps['disabled'];
18
+ disabled?: boolean;
19
19
  rules?: ProRule[];
20
20
  required?: boolean;
21
21
  type: string;
@@ -70,7 +70,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
70
70
  }
71
71
  if ((0, _lodash.isFunction)(disabled)) {
72
72
  // RangePicker返回数组时,特殊处理
73
- if (type === 'RangePicker' && Array.isArray(disabled(values, {
73
+ if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
74
74
  form: form,
75
75
  index: index,
76
76
  namePath: namePath
@@ -297,9 +297,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
297
297
  showArrow: true,
298
298
  loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
299
299
  onChange: handleChange,
300
- // optionLabelProp={otherProps?.isDiffChange ? "label" : 'children'} // 解决warning报错,添加默认值
301
- optionLabelProp: "label" // 解决warning报错,添加默认值
302
- ,
300
+ optionLabelProp: (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isDiffChange) ? 'label' : 'children',
301
+ // optionLabelProp="label" // 解决warning报错,添加默认值
303
302
  showSearch: true,
304
303
  filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
305
304
  var _option$children, _option$children$prop;
@@ -38,7 +38,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
38
38
  _iterator.f();
39
39
  }
40
40
  if (mode === 'multiple') {
41
- selectValues = [].concat((0, _toConsumableArray2.default)(selectValues), (0, _toConsumableArray2.default)(result));
41
+ selectValues = [].concat((0, _toConsumableArray2.default)(selectValues), (0, _toConsumableArray2.default)(result || []));
42
42
  } else {
43
43
  selectValues.push(result);
44
44
  }
@@ -61,13 +61,14 @@ var getSelectList = exports.getSelectList = function getSelectList(_ref2) {
61
61
  if (!otherProps) {
62
62
  return null;
63
63
  }
64
- var listName = otherProps.listName,
64
+ var name = otherProps.name,
65
+ listName = otherProps.listName,
65
66
  form = otherProps.form;
66
67
  var firstNumberIndex = listName.lastIndexOf(listName.findLast(function (item) {
67
68
  return typeof item === 'number';
68
69
  }));
69
- var fatherName = listName.slice(0, firstNumberIndex);
70
- var selectName = listName.slice(firstNumberIndex + 1);
70
+ var fatherName = (name || listName).slice(0, firstNumberIndex);
71
+ var selectName = (name || listName).slice(firstNumberIndex + 1);
71
72
  return findSelectNameValues({
72
73
  list: form.getFieldValue(fatherName) || [],
73
74
  selectName: selectName,
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ProTableColumn } from '../../propsType';
3
- export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, }: {
3
+ export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, }: {
4
4
  column: ProTableColumn;
5
5
  originalObj: any;
6
6
  dataSourceObj: any;
7
7
  rowKey: any;
8
8
  diffToolTip?: boolean;
9
+ wrapToolTipProps?: any;
9
10
  }) => void;
10
11
  /**
11
12
  * 查找最近的父级className
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.getParentElement = exports.formatColumn = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
8
9
  var _jsxRuntime = require("react/jsx-runtime");
9
10
  var _react = require("react");
10
11
  var _moment15 = _interopRequireDefault(require("moment"));
@@ -22,7 +23,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
22
23
  originalObj = _ref.originalObj,
23
24
  dataSourceObj = _ref.dataSourceObj,
24
25
  rowKey = _ref.rowKey,
25
- diffToolTip = _ref.diffToolTip;
26
+ diffToolTip = _ref.diffToolTip,
27
+ wrapToolTipProps = _ref.wrapToolTipProps;
26
28
  var title = column.title,
27
29
  valueType = column.valueType,
28
30
  _column$format = column.format,
@@ -42,6 +44,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
42
44
  originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
43
45
  _column$toolTipProps = column.toolTipProps,
44
46
  toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps;
47
+ var _toolTipProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, toolTipProps), wrapToolTipProps);
45
48
  var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
46
49
  // 前缀处理
47
50
  var prefixNode = function prefixNode(value, record, index) {
@@ -111,7 +114,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
111
114
  value: value,
112
115
  currentValue: renderValue,
113
116
  originalDiffTip: _originalDiffTip,
114
- toolTipProps: toolTipProps
117
+ toolTipProps: _toolTipProps
115
118
  });
116
119
  };
117
120
  // 千分位, 千分位带CNY前缀
@@ -141,7 +144,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
141
144
  value: value,
142
145
  currentValue: renderValue,
143
146
  originalDiffTip: _originalDiffTip,
144
- toolTipProps: toolTipProps
147
+ toolTipProps: _toolTipProps
145
148
  });
146
149
  };
147
150
  } else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
@@ -194,7 +197,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
194
197
  value: value,
195
198
  currentValue: renderValue,
196
199
  originalDiffTip: _originalDiffTip,
197
- toolTipProps: toolTipProps
200
+ toolTipProps: _toolTipProps
198
201
  });
199
202
  };
200
203
  } else if (['enumName', 'enumCodeName'].includes(valueType)) {
@@ -232,7 +235,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
232
235
  value: value,
233
236
  currentValue: renderValue,
234
237
  originalDiffTip: _originalDiffTip,
235
- toolTipProps: toolTipProps
238
+ toolTipProps: _toolTipProps
236
239
  });
237
240
  };
238
241
  } else if (precision || prefix || suffix) {
@@ -259,7 +262,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
259
262
  value: value,
260
263
  currentValue: renderValue,
261
264
  originalDiffTip: _originalDiffTip,
262
- toolTipProps: toolTipProps
265
+ toolTipProps: _toolTipProps
263
266
  });
264
267
  };
265
268
  } else if (valueType === 'address') {
@@ -315,7 +318,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
315
318
  node: value,
316
319
  value: value,
317
320
  currentValue: value,
318
- toolTipProps: toolTipProps
321
+ toolTipProps: _toolTipProps
319
322
  }), suffixNode(value, record, index)]
320
323
  });
321
324
  };
@@ -336,7 +339,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
336
339
  value: value,
337
340
  currentValue: value || '-',
338
341
  originalDiffTip: _originalDiffTip,
339
- toolTipProps: toolTipProps
342
+ toolTipProps: _toolTipProps
340
343
  }), suffixNode(value, record, index)]
341
344
  });
342
345
  };
@@ -359,7 +362,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
359
362
  value: value,
360
363
  currentValue: value || '-',
361
364
  originalDiffTip: _originalDiffTip,
362
- toolTipProps: toolTipProps
365
+ toolTipProps: _toolTipProps
363
366
  });
364
367
  };
365
368
  }
@@ -63,6 +63,15 @@ function ProTable(props) {
63
63
  onDragStartGuard = props.onDragStart,
64
64
  onDragEndGuard = props.onDragEnd,
65
65
  restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
66
+ var _props$scrollFollowPa = props.scrollFollowParent,
67
+ scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa;
68
+ var wrapToolTipProps = {
69
+ getPopupContainer: scrollFollowParent ? function (triggerNode) {
70
+ return triggerNode.parentNode;
71
+ } : function () {
72
+ return document.body;
73
+ }
74
+ };
66
75
  var _ref3 = diffConfig || {},
67
76
  originalDataSource = _ref3.originalDataSource,
68
77
  changeTipColor = _ref3.changeTipColor,
@@ -205,7 +214,8 @@ function ProTable(props) {
205
214
  originalObj: originalObj,
206
215
  dataSourceObj: dataSourceObj,
207
216
  rowKey: 'rowKey',
208
- diffToolTip: toolTip
217
+ diffToolTip: toolTip,
218
+ wrapToolTipProps: wrapToolTipProps
209
219
  });
210
220
  });
211
221
  return newColumns;
@@ -103,6 +103,10 @@ export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary'
103
103
  */
104
104
  onDragStart?: DragStartGuardProps;
105
105
  onDragEnd?: DragEndGuardProps;
106
+ /**
107
+ * 滚动额外配置
108
+ */
109
+ scrollFollowParent?: boolean;
106
110
  }
107
111
  export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
108
112
  export interface Response<T = any> {
@@ -297,6 +297,16 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
297
297
  var labelText = node[label];
298
298
  var value = node[code];
299
299
  var key = node[uuidKey];
300
+ // 三无走默认
301
+ if (['undefined-undefined', 'undefined'].includes(labelText) && !value && !key) {
302
+ if (showCodeName) {
303
+ labelText = "".concat(node === null || node === void 0 ? void 0 : node.value, "-").concat(node === null || node === void 0 ? void 0 : node.label);
304
+ } else {
305
+ labelText = node === null || node === void 0 ? void 0 : node.label;
306
+ }
307
+ value = node === null || node === void 0 ? void 0 : node.value;
308
+ key = node === null || node === void 0 ? void 0 : node.value;
309
+ }
300
310
  var titleHtml = (0, _jsxRuntime.jsx)("span", {
301
311
  dangerouslySetInnerHTML: {
302
312
  __html: labelText
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.8.0-beta.15",
3
+ "version": "3.8.0-beta.16",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",