@zat-design/sisyphus-react 3.10.1 → 3.10.2-beta.1

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 (68) hide show
  1. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  2. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  3. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  4. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  5. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  6. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  7. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  8. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  9. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  11. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  12. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  13. package/coverage/lcov-report/src/.umi/index.html +116 -0
  14. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  16. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  18. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  24. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  29. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  37. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  39. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  40. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +2 -3
  41. package/es/ProEditTable/components/RenderField/index.js +8 -16
  42. package/es/ProForm/components/base/Input/index.js +23 -2
  43. package/es/ProForm/components/base/Input/propsType.d.ts +2 -0
  44. package/es/ProForm/components/combination/Group/utils.js +1 -13
  45. package/es/ProForm/components/combination/ProCascader/index.js +13 -8
  46. package/es/ProForm/components/combination/ProCascader/propsType.d.ts +1 -0
  47. package/es/ProForm/components/render/ChangedWrapper.js +1 -1
  48. package/es/ProForm/components/render/Render.js +11 -19
  49. package/es/ProForm/utils/transformValue.js +9 -5
  50. package/es/ProForm/utils/valueType.d.ts +0 -6
  51. package/es/ProForm/utils/valueType.js +4 -50
  52. package/es/ProSelect/index.js +11 -3
  53. package/es/ProTable/components/RenderColumn/index.js +67 -42
  54. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +1 -2
  55. package/lib/ProEditTable/components/RenderField/index.js +8 -16
  56. package/lib/ProForm/components/base/Input/index.js +23 -2
  57. package/lib/ProForm/components/base/Input/propsType.d.ts +2 -0
  58. package/lib/ProForm/components/combination/Group/utils.js +1 -13
  59. package/lib/ProForm/components/combination/ProCascader/index.js +13 -6
  60. package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -0
  61. package/lib/ProForm/components/render/ChangedWrapper.js +1 -1
  62. package/lib/ProForm/components/render/Render.js +11 -19
  63. package/lib/ProForm/utils/transformValue.js +9 -5
  64. package/lib/ProForm/utils/valueType.d.ts +0 -6
  65. package/lib/ProForm/utils/valueType.js +4 -50
  66. package/lib/ProSelect/index.js +10 -2
  67. package/lib/ProTable/components/RenderColumn/index.js +66 -41
  68. package/package.json +1 -1
@@ -27,13 +27,17 @@ var transformValue = exports.transformValue = function transformValue(names, for
27
27
  });
28
28
  return _value;
29
29
  },
30
- getValueProps: function getValueProps(value) {
30
+ getValueProps: function getValueProps(value, isOrg) {
31
31
  var _curValue;
32
32
  var _value = [];
33
- names.forEach(function (name, index) {
34
- var value = form.getFieldValue(name);
35
- _value[index] = value;
36
- });
33
+ if (!isOrg) {
34
+ names.forEach(function (name, index) {
35
+ var value = form.getFieldValue(name);
36
+ _value[index] = value;
37
+ });
38
+ } else {
39
+ _value = value;
40
+ }
37
41
  // 支持外部传入转换函数
38
42
  var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
39
43
  value: _value
@@ -66,11 +66,5 @@ declare const _default: {
66
66
  value: any;
67
67
  };
68
68
  };
69
- /** 脱敏 转换 */
70
- desensitization: (props: any) => {
71
- getValueProps: (value: any) => {
72
- value: any;
73
- };
74
- };
75
69
  };
76
70
  export default _default;
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.maskStringRangeWithRegex = exports.default = void 0;
8
- var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
9
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
10
  var _big = _interopRequireDefault(require("big.js"));
@@ -199,6 +198,7 @@ var dateTransform = function dateTransform(_ref2) {
199
198
  };
200
199
  /** 脱敏处理函数 */
201
200
  var maskStringRangeWithRegex = exports.maskStringRangeWithRegex = function maskStringRangeWithRegex(input, range) {
201
+ var _input$replace;
202
202
  var _ref3 = range || [],
203
203
  _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
204
204
  start = _ref4[0],
@@ -206,13 +206,13 @@ var maskStringRangeWithRegex = exports.maskStringRangeWithRegex = function maskS
206
206
  if (start < 0) {
207
207
  throw new Error('脱敏数据: start index cannot be negative');
208
208
  }
209
- var adjustedEnd = Math.min(end, input.length - 1);
210
- if (start >= input.length) {
209
+ var adjustedEnd = Math.min(end, (input === null || input === void 0 ? void 0 : input.length) - 1);
210
+ if (start >= (input === null || input === void 0 ? void 0 : input.length)) {
211
211
  return '';
212
212
  }
213
213
  var regexPattern = "^(.{".concat(start, "})(.{").concat(adjustedEnd - start + 1, "})(.*)$");
214
214
  var regex = new RegExp(regexPattern);
215
- var maskedValue = input.replace(regex, "$1".concat('*'.repeat(adjustedEnd - start + 1), "$3"));
215
+ var maskedValue = input === null || input === void 0 ? void 0 : (_input$replace = input.replace) === null || _input$replace === void 0 ? void 0 : _input$replace.call(input, regex, "$1".concat('*'.repeat(adjustedEnd - start + 1), "$3"));
216
216
  return maskedValue;
217
217
  };
218
218
  var _default = exports.default = {
@@ -310,51 +310,5 @@ var _default = exports.default = {
310
310
  switch: function _switch(_ref12) {
311
311
  var switchValue = _ref12.switchValue;
312
312
  return switchTransform(switchValue);
313
- },
314
- /** 脱敏 转换 */
315
- desensitization: function desensitization(props) {
316
- var desensitization = props.desensitization,
317
- type = props.type,
318
- mode = props.mode,
319
- names = props.names;
320
- // 判断是否是地址控件,并带地址详情场景
321
- if (type === 'ProCascader' && mode === 'address' && (names === null || names === void 0 ? void 0 : names.length) === 4) {
322
- return {
323
- getValueProps: function getValueProps(value) {
324
- try {
325
- if (value === null || value === void 0 ? void 0 : value.length) {
326
- var _value = (0, _slicedToArray2.default)(value, 4),
327
- province = _value[0],
328
- city = _value[1],
329
- county = _value[2],
330
- address = _value[3];
331
- return {
332
- value: [province, city, county, maskStringRangeWithRegex(address, desensitization)]
333
- };
334
- }
335
- return {
336
- value: value
337
- };
338
- } catch (error) {
339
- return {
340
- value: value
341
- }; // 如果发生错误,返回原始值
342
- }
343
- }
344
- };
345
- }
346
- return {
347
- getValueProps: function getValueProps(value) {
348
- try {
349
- return {
350
- value: maskStringRangeWithRegex(value, desensitization)
351
- };
352
- } catch (error) {
353
- return {
354
- value: value
355
- }; // 如果发生错误,返回原始值
356
- }
357
- }
358
- };
359
313
  }
360
314
  };
@@ -217,7 +217,15 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
217
217
  }
218
218
  return props.children;
219
219
  };
220
- var handleChange = function handleChange(value, option) {
220
+ var isReactElement = function isReactElement(element) {
221
+ return /*#__PURE__*/(0, _react.isValidElement)(element);
222
+ };
223
+ var handleChange = function handleChange(value, _option) {
224
+ // option/其第一层子节点是react节点且是labelInValue就拿record
225
+ var option = _option;
226
+ if (labelInValue && (isReactElement(_option) || isReactElement(_option === null || _option === void 0 ? void 0 : _option.children))) {
227
+ option = _option === null || _option === void 0 ? void 0 : _option.record;
228
+ }
221
229
  var getChangeValue = selectProps.getChangeValue;
222
230
  if (selectProps.mode && selectProps.mode === 'multiple') {
223
231
  if (Array.isArray(option)) {
@@ -235,7 +243,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
235
243
  } else if (!selectProps.mode && labelInValue) {
236
244
  onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
237
245
  } else {
238
- onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option === null || option === void 0 ? void 0 : option.record);
246
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, _option === null || _option === void 0 ? void 0 : _option.record);
239
247
  }
240
248
  };
241
249
  /**
@@ -43,6 +43,45 @@ var RenderColumn = function RenderColumn(props) {
43
43
  'varied-cell': props === null || props === void 0 ? void 0 : props.isChanged,
44
44
  'add-cell': props === null || props === void 0 ? void 0 : props.isAddCell
45
45
  });
46
+ var getPadding = function getPadding(el) {
47
+ var style = window.getComputedStyle(el, null);
48
+ var paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
49
+ var paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
50
+ var paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
51
+ var paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0;
52
+ return {
53
+ pLeft: paddingLeft,
54
+ pRight: paddingRight,
55
+ pTop: paddingTop,
56
+ pBottom: paddingBottom
57
+ };
58
+ };
59
+ var checkEllipsis = function checkEllipsis(box) {
60
+ var range = document.createRange();
61
+ range.setStart(box, 0);
62
+ range.setEnd(box, box.childNodes.length);
63
+ var rangeWidth = range.getBoundingClientRect().width;
64
+ var _getPadding = getPadding(box),
65
+ pLeft = _getPadding.pLeft,
66
+ pRight = _getPadding.pRight,
67
+ pTop = _getPadding.pTop,
68
+ pBottom = _getPadding.pBottom;
69
+ var horizontalPadding = pLeft + pRight;
70
+ if (rangeWidth + horizontalPadding > box.clientWidth) {
71
+ return true;
72
+ }
73
+ return false;
74
+ };
75
+ var handleMouseOver = function handleMouseOver(e) {
76
+ setState({
77
+ tooltip: checkEllipsis(e.target)
78
+ });
79
+ };
80
+ var tooltipProps = (0, _objectSpread2.default)({
81
+ getPopupContainer: function getPopupContainer(triggerNode) {
82
+ return triggerNode.parentNode;
83
+ }
84
+ }, toolTipProps);
46
85
  // 比对场景走的逻辑
47
86
  if (!isInNewRowFlag && (0, _lodash.isBoolean)(props === null || props === void 0 ? void 0 : props.isChanged)) {
48
87
  var renderNode = value ? node : '-';
@@ -60,11 +99,36 @@ var RenderColumn = function RenderColumn(props) {
60
99
  }) : (0, _jsxRuntime.jsx)("div", {
61
100
  style: {
62
101
  minWidth: minWidth,
63
- width: width
102
+ width: width,
103
+ overflow: 'hidden',
104
+ textOverflow: 'ellipsis',
105
+ whiteSpace: 'nowrap'
64
106
  },
65
107
  children: ellipsis ? currentValue : renderNode
66
108
  });
67
109
  if ((props === null || props === void 0 ? void 0 : props.isChanged) === false) {
110
+ if (ellipsis) {
111
+ return (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
112
+ title: renderNode,
113
+ onOpenChange: function onOpenChange(open) {
114
+ setState({
115
+ tooltip: false
116
+ });
117
+ },
118
+ open: tooltip
119
+ }, tooltipProps), {}, {
120
+ children: (0, _jsxRuntime.jsx)(Text, {
121
+ style: {
122
+ width: width,
123
+ minWidth: minWidth
124
+ },
125
+ ellipsis: true,
126
+ onMouseOver: handleMouseOver,
127
+ onFocus: handleMouseOver,
128
+ children: renderNode
129
+ })
130
+ }));
131
+ }
68
132
  return renderNode;
69
133
  }
70
134
  if (Array.isArray(originalValue)) {
@@ -88,7 +152,7 @@ var RenderColumn = function RenderColumn(props) {
88
152
  title: (0, _jsxRuntime.jsx)(_antd.Space, {
89
153
  direction: "vertical",
90
154
  className: "changed-tooltip",
91
- children: (props === null || props === void 0 ? void 0 : props.isChanged) ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
155
+ children: (props === null || props === void 0 ? void 0 : props.isChanged) && !(props === null || props === void 0 ? void 0 : props.isAddCell) ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
92
156
  children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
93
157
  align: "start",
94
158
  className: "original-value-container",
@@ -140,45 +204,6 @@ var RenderColumn = function RenderColumn(props) {
140
204
  });
141
205
  }
142
206
  if (ellipsis) {
143
- var getPadding = function getPadding(el) {
144
- var style = window.getComputedStyle(el, null);
145
- var paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
146
- var paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
147
- var paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
148
- var paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0;
149
- return {
150
- pLeft: paddingLeft,
151
- pRight: paddingRight,
152
- pTop: paddingTop,
153
- pBottom: paddingBottom
154
- };
155
- };
156
- var checkEllipsis = function checkEllipsis(box) {
157
- var range = document.createRange();
158
- range.setStart(box, 0);
159
- range.setEnd(box, box.childNodes.length);
160
- var rangeWidth = range.getBoundingClientRect().width;
161
- var _getPadding = getPadding(box),
162
- pLeft = _getPadding.pLeft,
163
- pRight = _getPadding.pRight,
164
- pTop = _getPadding.pTop,
165
- pBottom = _getPadding.pBottom;
166
- var horizontalPadding = pLeft + pRight;
167
- if (rangeWidth + horizontalPadding > box.clientWidth) {
168
- return true;
169
- }
170
- return false;
171
- };
172
- var handleMouseOver = function handleMouseOver(e) {
173
- setState({
174
- tooltip: checkEllipsis(e.target)
175
- });
176
- };
177
- var tooltipProps = (0, _objectSpread2.default)({
178
- getPopupContainer: function getPopupContainer(triggerNode) {
179
- return triggerNode.parentNode;
180
- }
181
- }, toolTipProps);
182
207
  if (!value) {
183
208
  return (0, _jsxRuntime.jsx)("div", {
184
209
  style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.10.1",
3
+ "version": "3.10.2-beta.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",