@zat-design/sisyphus-react 3.9.8-beta.1 → 3.9.8-beta.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 (62) 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/RenderToolbar/index.js +1 -1
  41. package/es/ProForm/components/render/Render.js +12 -4
  42. package/es/ProForm/components/render/RenderFields.js +4 -2
  43. package/es/ProForm/components/render/propsType.d.ts +2 -0
  44. package/es/ProForm/utils/useShouldUpdate.js +25 -5
  45. package/es/ProForm/utils/valueType.d.ts +10 -0
  46. package/es/ProForm/utils/valueType.js +69 -33
  47. package/es/ProTable/components/FormatColumn/index.js +1 -0
  48. package/es/ProTable/components/RenderColumn/index.d.ts +2 -0
  49. package/es/ProTable/components/RenderColumn/index.js +10 -2
  50. package/es/ProTable/propsType.d.ts +2 -0
  51. package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
  52. package/lib/ProForm/components/render/Render.js +12 -4
  53. package/lib/ProForm/components/render/RenderFields.js +4 -2
  54. package/lib/ProForm/components/render/propsType.d.ts +2 -0
  55. package/lib/ProForm/utils/useShouldUpdate.js +25 -5
  56. package/lib/ProForm/utils/valueType.d.ts +10 -0
  57. package/lib/ProForm/utils/valueType.js +70 -34
  58. package/lib/ProTable/components/FormatColumn/index.js +1 -0
  59. package/lib/ProTable/components/RenderColumn/index.d.ts +2 -0
  60. package/lib/ProTable/components/RenderColumn/index.js +10 -2
  61. package/lib/ProTable/propsType.d.ts +2 -0
  62. package/package.json +1 -1
@@ -29,7 +29,8 @@ var RenderColumn = function RenderColumn(props) {
29
29
  _props$toolTipProps = props.toolTipProps,
30
30
  toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
31
31
  minWidth = props.minWidth,
32
- isInNewRowFlag = props.isInNewRowFlag;
32
+ isInNewRowFlag = props.isInNewRowFlag,
33
+ scroll = props.scroll;
33
34
  var _useSetState = useSetState({
34
35
  tooltip: false
35
36
  }),
@@ -43,8 +44,9 @@ var RenderColumn = function RenderColumn(props) {
43
44
  // 比对场景走的逻辑
44
45
  if (!isInNewRowFlag && isBoolean(props === null || props === void 0 ? void 0 : props.isChanged)) {
45
46
  var renderNode = value ? node : '-';
47
+ var isXMaxContent = (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content';
46
48
  if (ellipsis || (props === null || props === void 0 ? void 0 : props.isChanged)) {
47
- renderNode = _jsx(Text, {
49
+ renderNode = !isXMaxContent ? _jsx(Text, {
48
50
  style: {
49
51
  width: currentValue === '-' ? 32.5 : width,
50
52
  minWidth: minWidth
@@ -53,6 +55,12 @@ var RenderColumn = function RenderColumn(props) {
53
55
  tooltip: false
54
56
  },
55
57
  children: ellipsis ? currentValue : renderNode
58
+ }) : _jsx("div", {
59
+ style: {
60
+ minWidth: minWidth,
61
+ width: width
62
+ },
63
+ children: ellipsis ? currentValue : renderNode
56
64
  });
57
65
  if ((props === null || props === void 0 ? void 0 : props.isChanged) === false) {
58
66
  return renderNode;
@@ -46,6 +46,8 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
46
46
  viewRender?: ({ value, record, index, originalValue, originalRecord, }: any) => 'same' | 'changed' | 'add' | undefined;
47
47
  isChanged?: boolean | null;
48
48
  children?: ProTableColumn[];
49
+ /** table透传下来的scroll配置 */
50
+ scroll?: any;
49
51
  }
50
52
  export interface CreateTreeFromArrayOptions {
51
53
  itemKey?: string;
@@ -104,7 +104,7 @@ var RenderToolbar = function RenderToolbar(config) {
104
104
  case 7:
105
105
  result = _context.sent;
106
106
  case 8:
107
- if (result && type !== 'custom') {
107
+ if (result !== false && type !== 'custom') {
108
108
  _config.actions[type]((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
109
109
  index: index,
110
110
  record: record,
@@ -51,7 +51,8 @@ var Render = function Render(props) {
51
51
  confirm = props.confirm,
52
52
  globalControl = props.globalControl,
53
53
  diffConfig = props.diffConfig,
54
- viewRender = props.viewRender;
54
+ viewRender = props.viewRender,
55
+ desensitization = props.desensitization;
55
56
  var colProps = props.colProps;
56
57
  // 剔除一些不是FormItem的属性, 防止控制台报warning
57
58
  var labelWidth = formItemProps.labelWidth,
@@ -75,7 +76,8 @@ var Render = function Render(props) {
75
76
  fieldProps: fieldProps,
76
77
  component: component,
77
78
  originComponent: originComponent,
78
- type: type
79
+ type: type,
80
+ desensitization: desensitization
79
81
  }),
80
82
  shouldUpdate = _useShouldUpdate.shouldUpdate,
81
83
  _show = _useShouldUpdate.show,
@@ -83,7 +85,8 @@ var Render = function Render(props) {
83
85
  _rules = _useShouldUpdate.rules,
84
86
  _required = _useShouldUpdate.required,
85
87
  _fieldProps = _useShouldUpdate.fieldProps,
86
- AutoComponent = _useShouldUpdate.component;
88
+ AutoComponent = _useShouldUpdate.component,
89
+ _desensitization = _useShouldUpdate.desensitization;
87
90
  otherFormItemProps.shouldUpdate = shouldUpdate;
88
91
  var namesStr = (0, _react.useMemo)(function () {
89
92
  var _otherProps$names;
@@ -121,11 +124,16 @@ var Render = function Render(props) {
121
124
  if (type === 'Input') {
122
125
  valueType = valueType || 'trim';
123
126
  }
127
+ if (_desensitization === null || _desensitization === void 0 ? void 0 : _desensitization.length) {
128
+ valueType = 'desensitization';
129
+ }
124
130
  // 不存在valueType返回空
125
131
  if (!valueType) {
126
132
  return {};
127
133
  }
128
- var params = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), otherFormItemProps);
134
+ var params = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), otherFormItemProps), {}, {
135
+ desensitization: _desensitization
136
+ });
129
137
  return (0, _lodash.isFunction)(_valueType.default[valueType]) ? _valueType.default[valueType](params) : {};
130
138
  };
131
139
  /**
@@ -17,7 +17,7 @@ var componentMap = _interopRequireWildcard(require("../index"));
17
17
  var _utils = require("../../utils");
18
18
  var _useFieldProps = require("../../utils/useFieldProps");
19
19
  var _locale = _interopRequireDefault(require("../../../locale"));
20
- var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "onDiff", "clearNotShow", "required", "confirm"];
20
+ var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "onDiff", "clearNotShow", "required", "confirm", "desensitization"];
21
21
  var RenderFields = function RenderFields(props) {
22
22
  var isView = props.isView,
23
23
  _props$columns = props.columns,
@@ -82,6 +82,7 @@ var RenderFields = function RenderFields(props) {
82
82
  clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
83
83
  columnRequired = column.required,
84
84
  confirm = column.confirm,
85
+ desensitization = column.desensitization,
85
86
  otherFormItemProps = (0, _objectWithoutProperties2.default)(column, _excluded);
86
87
  var component = column.component;
87
88
  var _isView = typeof column.isView === 'boolean' ? column.isView : isView;
@@ -220,7 +221,8 @@ var RenderFields = function RenderFields(props) {
220
221
  equalWith: onDiff || equalWith,
221
222
  requiredOnView: requiredOnView,
222
223
  globalControl: globalControl,
223
- viewRender: viewRender
224
+ viewRender: viewRender,
225
+ desensitization: desensitization
224
226
  })
225
227
  }, "".concat(_formItemProps.name || _formItemProps.label).concat(index));
226
228
  });
@@ -229,6 +229,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
229
229
  confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void | Promise<boolean | ModalFuncProps | void>>;
230
230
  /** 防抖模式 */
231
231
  debounceWait?: number;
232
+ /** 脱敏数据位置下标 */
233
+ desensitization?: [number, number] | ReactiveFunction<Values, [number, number]>;
232
234
  }
233
235
  export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
234
236
  /**
@@ -28,7 +28,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
28
28
  fieldProps = props.fieldProps,
29
29
  component = props.component,
30
30
  originComponent = props.originComponent,
31
- type = props.type;
31
+ type = props.type,
32
+ desensitization = props.desensitization;
32
33
  var _shouldUpdate = formItemProps.shouldUpdate,
33
34
  name = formItemProps.name,
34
35
  clearNotShow = formItemProps.clearNotShow,
@@ -45,13 +46,14 @@ var useShouldUpdate = function useShouldUpdate(props) {
45
46
  var fieldPropsRef = (0, _react.useRef)();
46
47
  var originComponentRef = (0, _react.useRef)();
47
48
  var dependNamesRef = (0, _react.useRef)();
49
+ var desensitizationRef = (0, _react.useRef)();
48
50
  var newComponent = originComponent || component; // 解决component默认赋值污染问题,需要使用originComponent
49
51
  var _useState = (0, _react.useState)({}),
50
52
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
51
53
  reRender = _useState2[1];
52
54
  var values = {};
53
55
  // 不是动态函数直接返回
54
- if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !(0, _lodash.isFunction)(show) && !(0, _lodash.isFunction)(disabled) && !(0, _lodash.isFunction)(required) && !(0, _lodash.isFunction)(rules) && !(0, _lodash.isFunction)(fieldProps) && !(0, _lodash.isFunction)(originComponent)) {
56
+ if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !(0, _lodash.isFunction)(show) && !(0, _lodash.isFunction)(disabled) && !(0, _lodash.isFunction)(required) && !(0, _lodash.isFunction)(rules) && !(0, _lodash.isFunction)(fieldProps) && !(0, _lodash.isFunction)(originComponent) && !(0, _lodash.isFunction)(desensitization)) {
55
57
  return {
56
58
  shouldUpdate: _shouldUpdate,
57
59
  show: show,
@@ -59,7 +61,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
59
61
  required: required,
60
62
  rules: rules,
61
63
  fieldProps: fieldProps,
62
- component: newComponent
64
+ component: newComponent,
65
+ desensitization: desensitization
63
66
  };
64
67
  }
65
68
  if (namePath) {
@@ -77,6 +80,15 @@ var useShouldUpdate = function useShouldUpdate(props) {
77
80
  } else {
78
81
  showRef.current = show;
79
82
  }
83
+ if ((0, _lodash.isFunction)(desensitization)) {
84
+ desensitizationRef.current = desensitization(values, {
85
+ form: form,
86
+ index: index,
87
+ namePath: namePath
88
+ });
89
+ } else {
90
+ desensitizationRef.current = desensitization;
91
+ }
80
92
  if ((0, _lodash.isFunction)(disabled)) {
81
93
  // RangePicker返回数组时,特殊处理
82
94
  if (['Group', 'RangePicker', 'ProCascader'].includes(type) && Array.isArray(disabled(values, {
@@ -183,6 +195,11 @@ var useShouldUpdate = function useShouldUpdate(props) {
183
195
  index: index,
184
196
  namePath: namePath
185
197
  }) : fieldProps;
198
+ var _desensitization = (0, _lodash.isFunction)(desensitization) ? desensitization(_currentValues, {
199
+ form: form,
200
+ index: index,
201
+ namePath: namePath
202
+ }) : desensitization;
186
203
  // 清值防抖 多次刷新时以最后一次为准
187
204
  if (clearNotShow !== false && (name || names) && !isDeleteLine(form, namePath)) {
188
205
  // 当show为其他变为false的时候记录一次需要清值
@@ -208,13 +225,15 @@ var useShouldUpdate = function useShouldUpdate(props) {
208
225
  }
209
226
  var equalRes = (0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun);
210
227
  var proEqualRes = (0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun);
211
- if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes || (_fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.transformResponse) // 防止fieldProps变更时,transformResponse根据fieldProps新值无法触发更新
228
+ var desensitizationRes = (0, _lodash.isEqualWith)(desensitizationRef.current, _desensitization);
229
+ if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes || !desensitizationRes || (_fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.transformResponse) // 防止fieldProps变更时,transformResponse根据fieldProps新值无法触发更新
212
230
  ) {
213
231
  showRef.current = _show;
214
232
  disabledRef.current = _disabled;
215
233
  requiredRef.current = _required;
216
234
  rulesRef.current = _rules;
217
235
  fieldPropsRef.current = _fieldProps;
236
+ desensitizationRef.current = _desensitization;
218
237
  reRender({});
219
238
  return false;
220
239
  }
@@ -231,7 +250,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
231
250
  rules: rulesRef.current,
232
251
  required: requiredRef.current,
233
252
  component: originComponentRef.current,
234
- fieldProps: fieldPropsRef.current
253
+ fieldProps: fieldPropsRef.current,
254
+ desensitization: desensitizationRef.current
235
255
  };
236
256
  };
237
257
  var _default = exports.default = useShouldUpdate;
@@ -1,3 +1,5 @@
1
+ /** 脱敏处理函数 */
2
+ export declare const maskStringRangeWithRegex: (input: string, range: [number, number]) => string;
1
3
  declare const _default: {
2
4
  /** 年月日 */
3
5
  date: ({ type, toISOString, toCSTString, mode }: {
@@ -64,5 +66,13 @@ declare const _default: {
64
66
  value: any;
65
67
  };
66
68
  };
69
+ /** 脱敏 转换 */
70
+ desensitization: ({ desensitization }: {
71
+ desensitization: any;
72
+ }) => {
73
+ getValueProps: (value: any) => {
74
+ value: any;
75
+ };
76
+ };
67
77
  };
68
78
  export default _default;
@@ -4,7 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.maskStringRangeWithRegex = exports.default = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
8
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
10
  var _big = _interopRequireDefault(require("big.js"));
10
11
  var _lodash = require("lodash");
@@ -195,13 +196,31 @@ var dateTransform = function dateTransform(_ref2) {
195
196
  }
196
197
  return result;
197
198
  };
199
+ /** 脱敏处理函数 */
200
+ var maskStringRangeWithRegex = exports.maskStringRangeWithRegex = function maskStringRangeWithRegex(input, range) {
201
+ var _ref3 = range || [],
202
+ _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
203
+ start = _ref4[0],
204
+ end = _ref4[1];
205
+ if (start < 0) {
206
+ throw new Error('脱敏数据: start index cannot be negative');
207
+ }
208
+ var adjustedEnd = Math.min(end, input.length - 1);
209
+ if (start >= input.length) {
210
+ return '';
211
+ }
212
+ var regexPattern = "^(.{".concat(start, "})(.{").concat(adjustedEnd - start + 1, "})(.*)$");
213
+ var regex = new RegExp(regexPattern);
214
+ var maskedValue = input.replace(regex, "$1".concat('*'.repeat(adjustedEnd - start + 1), "$3"));
215
+ return maskedValue;
216
+ };
198
217
  var _default = exports.default = {
199
218
  /** 年月日 */
200
- date: function date(_ref3) {
201
- var type = _ref3.type,
202
- toISOString = _ref3.toISOString,
203
- toCSTString = _ref3.toCSTString,
204
- mode = _ref3.mode;
219
+ date: function date(_ref5) {
220
+ var type = _ref5.type,
221
+ toISOString = _ref5.toISOString,
222
+ toCSTString = _ref5.toCSTString,
223
+ mode = _ref5.mode;
205
224
  return dateTransform({
206
225
  type: type,
207
226
  _valueType: 'date',
@@ -211,11 +230,11 @@ var _default = exports.default = {
211
230
  });
212
231
  },
213
232
  /** 年月日 时分秒 */
214
- dateTime: function dateTime(_ref4) {
215
- var type = _ref4.type,
216
- toISOString = _ref4.toISOString,
217
- toCSTString = _ref4.toCSTString,
218
- mode = _ref4.mode;
233
+ dateTime: function dateTime(_ref6) {
234
+ var type = _ref6.type,
235
+ toISOString = _ref6.toISOString,
236
+ toCSTString = _ref6.toCSTString,
237
+ mode = _ref6.mode;
219
238
  return dateTransform({
220
239
  type: type,
221
240
  _valueType: 'dateTime',
@@ -225,11 +244,11 @@ var _default = exports.default = {
225
244
  });
226
245
  },
227
246
  /** 年月日 00:00:00 */
228
- dateStartTime: function dateStartTime(_ref5) {
229
- var type = _ref5.type,
230
- toISOString = _ref5.toISOString,
231
- toCSTString = _ref5.toCSTString,
232
- mode = _ref5.mode;
247
+ dateStartTime: function dateStartTime(_ref7) {
248
+ var type = _ref7.type,
249
+ toISOString = _ref7.toISOString,
250
+ toCSTString = _ref7.toCSTString,
251
+ mode = _ref7.mode;
233
252
  return dateTransform({
234
253
  type: type,
235
254
  _valueType: 'dateStartTime',
@@ -239,11 +258,11 @@ var _default = exports.default = {
239
258
  });
240
259
  },
241
260
  /** 年月日 23:59:59 */
242
- dateEndTime: function dateEndTime(_ref6) {
243
- var type = _ref6.type,
244
- toISOString = _ref6.toISOString,
245
- toCSTString = _ref6.toCSTString,
246
- mode = _ref6.mode;
261
+ dateEndTime: function dateEndTime(_ref8) {
262
+ var type = _ref8.type,
263
+ toISOString = _ref8.toISOString,
264
+ toCSTString = _ref8.toCSTString,
265
+ mode = _ref8.mode;
247
266
  return dateTransform({
248
267
  type: type,
249
268
  _valueType: 'dateEndTime',
@@ -253,11 +272,11 @@ var _default = exports.default = {
253
272
  });
254
273
  },
255
274
  /** 年月日 00:00:00 ~ 年月日 23:59:59 */
256
- dateStartEndTime: function dateStartEndTime(_ref7) {
257
- var type = _ref7.type,
258
- toISOString = _ref7.toISOString,
259
- toCSTString = _ref7.toCSTString,
260
- mode = _ref7.mode;
275
+ dateStartEndTime: function dateStartEndTime(_ref9) {
276
+ var type = _ref9.type,
277
+ toISOString = _ref9.toISOString,
278
+ toCSTString = _ref9.toCSTString,
279
+ mode = _ref9.mode;
261
280
  return dateTransform({
262
281
  type: type,
263
282
  _valueType: 'dateStartEndTime',
@@ -267,9 +286,9 @@ var _default = exports.default = {
267
286
  });
268
287
  },
269
288
  /** 百分比 */
270
- percentage: function percentage(_ref8) {
271
- var type = _ref8.type,
272
- valueType = _ref8.valueType;
289
+ percentage: function percentage(_ref10) {
290
+ var type = _ref10.type,
291
+ valueType = _ref10.valueType;
273
292
  return transformRatio({
274
293
  type: type,
275
294
  valueType: valueType,
@@ -277,9 +296,9 @@ var _default = exports.default = {
277
296
  });
278
297
  },
279
298
  /** 千分比 */
280
- permillage: function permillage(_ref9) {
281
- var type = _ref9.type,
282
- valueType = _ref9.valueType;
299
+ permillage: function permillage(_ref11) {
300
+ var type = _ref11.type,
301
+ valueType = _ref11.valueType;
283
302
  return transformRatio({
284
303
  type: type,
285
304
  valueType: valueType,
@@ -287,8 +306,25 @@ var _default = exports.default = {
287
306
  });
288
307
  },
289
308
  /** 开关 YN转换 */
290
- switch: function _switch(_ref10) {
291
- var switchValue = _ref10.switchValue;
309
+ switch: function _switch(_ref12) {
310
+ var switchValue = _ref12.switchValue;
292
311
  return switchTransform(switchValue);
312
+ },
313
+ /** 脱敏 转换 */
314
+ desensitization: function desensitization(_ref13) {
315
+ var _desensitization = _ref13.desensitization;
316
+ return {
317
+ getValueProps: function getValueProps(value) {
318
+ try {
319
+ return {
320
+ value: maskStringRangeWithRegex(value, _desensitization)
321
+ };
322
+ } catch (error) {
323
+ return {
324
+ value: value
325
+ }; // 如果发生错误,返回原始值
326
+ }
327
+ }
328
+ };
293
329
  }
294
330
  };
@@ -84,6 +84,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
84
84
  minWidth = column.minWidth,
85
85
  onDiff = column.onDiff,
86
86
  otherProps = (0, _objectWithoutProperties2.default)(column, _excluded);
87
+ otherProps.scroll = scroll;
87
88
  // 仅在 {x: 'max-content', y: 300 } 且 column无指定 width minWidth 情况下 才开启 minWidth的自动计算
88
89
  var isMaxContentOverFlow = (0, _lodash.isObject)(scroll) ? (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' && Reflect.ownKeys(scroll).includes('y') : false;
89
90
  calcMinWidth({
@@ -15,6 +15,8 @@ interface Props {
15
15
  isChanged?: boolean;
16
16
  /** 新增单元格字段 */
17
17
  isAddCell?: boolean;
18
+ /** 表格透传下来的scroll配置 */
19
+ scroll?: any;
18
20
  }
19
21
  declare const RenderColumn: FC<Props>;
20
22
  export default RenderColumn;
@@ -31,7 +31,8 @@ var RenderColumn = function RenderColumn(props) {
31
31
  _props$toolTipProps = props.toolTipProps,
32
32
  toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
33
33
  minWidth = props.minWidth,
34
- isInNewRowFlag = props.isInNewRowFlag;
34
+ isInNewRowFlag = props.isInNewRowFlag,
35
+ scroll = props.scroll;
35
36
  var _useSetState = (0, _ahooks.useSetState)({
36
37
  tooltip: false
37
38
  }),
@@ -45,8 +46,9 @@ var RenderColumn = function RenderColumn(props) {
45
46
  // 比对场景走的逻辑
46
47
  if (!isInNewRowFlag && (0, _lodash.isBoolean)(props === null || props === void 0 ? void 0 : props.isChanged)) {
47
48
  var renderNode = value ? node : '-';
49
+ var isXMaxContent = (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content';
48
50
  if (ellipsis || (props === null || props === void 0 ? void 0 : props.isChanged)) {
49
- renderNode = (0, _jsxRuntime.jsx)(Text, {
51
+ renderNode = !isXMaxContent ? (0, _jsxRuntime.jsx)(Text, {
50
52
  style: {
51
53
  width: currentValue === '-' ? 32.5 : width,
52
54
  minWidth: minWidth
@@ -55,6 +57,12 @@ var RenderColumn = function RenderColumn(props) {
55
57
  tooltip: false
56
58
  },
57
59
  children: ellipsis ? currentValue : renderNode
60
+ }) : (0, _jsxRuntime.jsx)("div", {
61
+ style: {
62
+ minWidth: minWidth,
63
+ width: width
64
+ },
65
+ children: ellipsis ? currentValue : renderNode
58
66
  });
59
67
  if ((props === null || props === void 0 ? void 0 : props.isChanged) === false) {
60
68
  return renderNode;
@@ -46,6 +46,8 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
46
46
  viewRender?: ({ value, record, index, originalValue, originalRecord, }: any) => 'same' | 'changed' | 'add' | undefined;
47
47
  isChanged?: boolean | null;
48
48
  children?: ProTableColumn[];
49
+ /** table透传下来的scroll配置 */
50
+ scroll?: any;
49
51
  }
50
52
  export interface CreateTreeFromArrayOptions {
51
53
  itemKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.9.8-beta.1",
3
+ "version": "3.9.8-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",