@zat-design/sisyphus-react 3.5.0-beta.1 → 3.5.0-beta.10

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.
@@ -2937,6 +2937,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2937
2937
  }
2938
2938
  .pro-form .ant-form-item-label > label {
2939
2939
  white-space: pre-wrap;
2940
+ word-break: break-all;
2940
2941
  }
2941
2942
  .pro-form .suffix-value {
2942
2943
  margin-left: calc(var(--zaui-space-size-sm, 8px) * var(--zaui-size, 1));
@@ -5312,7 +5313,7 @@ input[type='button'] {
5312
5313
  .ant-form .ant-form-item .ant-form-item-label > label,
5313
5314
  .ant-drawer .ant-form-item .ant-form-item-label > label,
5314
5315
  .ant-modal .ant-form-item .ant-form-item-label > label {
5315
- word-break: break-word;
5316
+ word-break: break-all;
5316
5317
  }
5317
5318
  .ant-form .ant-form-item .ant-form-item-label > label::after,
5318
5319
  .ant-drawer .ant-form-item .ant-form-item-label > label::after,
package/dist/less.esm.css CHANGED
@@ -2937,6 +2937,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2937
2937
  }
2938
2938
  .pro-form .ant-form-item-label > label {
2939
2939
  white-space: pre-wrap;
2940
+ word-break: break-all;
2940
2941
  }
2941
2942
  .pro-form .suffix-value {
2942
2943
  margin-left: calc(var(--zaui-space-size-sm, 8px) * var(--zaui-size, 1));
@@ -222,6 +222,7 @@
222
222
 
223
223
  .@{ant-prefix}-table-tbody>.is-editing:not(.@{ant-prefix}-table-measure-row)>td {
224
224
  border-bottom : 0;
225
+ // vertical-align: top;
225
226
  vertical-align: middle;
226
227
  }
227
228
 
@@ -18,7 +18,7 @@ import classnames from 'classnames';
18
18
  import { ReactSVG } from 'react-svg';
19
19
  import { tools } from '@zat-design/utils';
20
20
  import { actions, defaultBtnNameMap, defaultSingleActionKeys, defaultMultipleActionKeys, defaultEditingActionKeys } from './config';
21
- import { customValidate, getNamePath, splitNames } from './tools';
21
+ import { customValidate, getNamePath, splitNames, handleScrollToError } from './tools';
22
22
  import ProTooltip from '../../ProTooltip';
23
23
  import { RenderField, ActionButton } from '../components';
24
24
  import tipSvg from '../../assets/tip.svg';
@@ -98,35 +98,7 @@ var getActionColumn = function getActionColumn(config) {
98
98
  case 8:
99
99
  _context.prev = 8;
100
100
  _context.t0 = _context["catch"](3);
101
- setTimeout(function () {
102
- var errorDom = document.querySelector('.ant-form-item-has-error');
103
- if (errorDom) {
104
- var tableBody = errorDom.closest('.ant-table-content') || errorDom.closest('.ant-table-body');
105
- var tableCell = errorDom.closest('.ant-table-cell');
106
- if (tableBody && tableCell) {
107
- var previousSibling = tableCell.previousElementSibling;
108
- var childOffsetLeft = 0;
109
- var childFixedLeft = 0;
110
- while (previousSibling) {
111
- if (previousSibling.nodeType === 1) {
112
- var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
113
- var _ref2 = previousSibling.getBoundingClientRect() || {},
114
- _ref2$width = _ref2.width,
115
- width = _ref2$width === void 0 ? 0 : _ref2$width;
116
- childOffsetLeft += width;
117
- if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = (_previousSibling$clas3 = _previousSibling$clas).contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas3, 'ant-table-cell-fix-left')) {
118
- childFixedLeft += width;
119
- }
120
- }
121
- previousSibling = previousSibling.previousElementSibling;
122
- }
123
- tableBody.scrollTo({
124
- left: childOffsetLeft - childFixedLeft,
125
- behavior: 'smooth'
126
- });
127
- }
128
- }
129
- }, 0);
101
+ handleScrollToError();
130
102
  return _context.abrupt("return", Promise.reject(_context.t0));
131
103
  case 12:
132
104
  // 编辑状态使用自定义form值,非编辑状态直接使用行数据
@@ -254,10 +226,10 @@ export var transformColumns = function transformColumns() {
254
226
  if (typeof columnTitle === 'string') {
255
227
  item.originTitle = columnTitle;
256
228
  if (tooltip) {
257
- var _ref3 = tooltip || {},
258
- tooltipTitle = _ref3.title,
259
- icon = _ref3.icon,
260
- resetProps = _objectWithoutProperties(_ref3, _excluded2);
229
+ var _ref2 = tooltip || {},
230
+ tooltipTitle = _ref2.title,
231
+ icon = _ref2.icon,
232
+ resetProps = _objectWithoutProperties(_ref2, _excluded2);
261
233
  item.title = _jsxs("span", {
262
234
  className: "pro-edit-table-title pro-edit-table-tooltip",
263
235
  children: [before, columnTitle, _jsx(_Tooltip, _objectSpread(_objectSpread({
@@ -409,13 +381,13 @@ export var transformColumns = function transformColumns() {
409
381
  // cacheMap 用来存储缓存值,若有值后不再请求
410
382
  if (JSON.stringify(cacheMap.current) === '{}') {
411
383
  Promise.all(Object.entries(_cacheMap).map( /*#__PURE__*/function () {
412
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
413
- var _item, key, value, _ref5, service, option;
384
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
385
+ var _item, key, value, _ref4, service, option;
414
386
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
415
387
  while (1) switch (_context2.prev = _context2.next) {
416
388
  case 0:
417
389
  _item = _slicedToArray(item, 2), key = _item[0], value = _item[1];
418
- _ref5 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref5.service, option = _ref5.option;
390
+ _ref4 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref4.service, option = _ref4.option;
419
391
  if (!service) {
420
392
  _context2.next = 8;
421
393
  break;
@@ -435,7 +407,7 @@ export var transformColumns = function transformColumns() {
435
407
  }, _callee2);
436
408
  }));
437
409
  return function (_x3) {
438
- return _ref4.apply(this, arguments);
410
+ return _ref3.apply(this, arguments);
439
411
  };
440
412
  }())).then(function (res) {
441
413
  res.forEach(function (item) {
@@ -26,3 +26,6 @@ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
26
26
  * @param rowDisabled 行禁用参数
27
27
  */
28
28
  export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled }: any) => any;
29
+ /** 表格自动滚动到报错位置
30
+ */
31
+ export declare const handleScrollToError: () => void;
@@ -151,4 +151,37 @@ export var getDisabled = function getDisabled(_ref2) {
151
151
  return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled.apply(columnFieldProps, _toConsumableArray(params)));
152
152
  }
153
153
  return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled) || convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || convertToBoolean(tabledDisabled);
154
+ };
155
+ /** 表格自动滚动到报错位置
156
+ */
157
+ export var handleScrollToError = function handleScrollToError() {
158
+ setTimeout(function () {
159
+ var errorDom = document.querySelector('.ant-form-item-has-error');
160
+ if (errorDom) {
161
+ var tableBody = errorDom.closest('.ant-table-content') || errorDom.closest('.ant-table-body');
162
+ var tableCell = errorDom.closest('.ant-table-cell');
163
+ if (tableBody && tableCell) {
164
+ var previousSibling = tableCell.previousElementSibling;
165
+ var childOffsetLeft = 0;
166
+ var childFixedLeft = 0;
167
+ while (previousSibling) {
168
+ if (previousSibling.nodeType === 1) {
169
+ var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
170
+ var _ref3 = previousSibling.getBoundingClientRect() || {},
171
+ _ref3$width = _ref3.width,
172
+ width = _ref3$width === void 0 ? 0 : _ref3$width;
173
+ childOffsetLeft += width;
174
+ if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = (_previousSibling$clas3 = _previousSibling$clas).contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas3, 'ant-table-cell-fix-left')) {
175
+ childFixedLeft += width;
176
+ }
177
+ }
178
+ previousSibling = previousSibling.previousElementSibling;
179
+ }
180
+ tableBody.scrollTo({
181
+ left: childOffsetLeft - childFixedLeft,
182
+ behavior: 'smooth'
183
+ });
184
+ }
185
+ }
186
+ }, 0);
154
187
  };
@@ -122,7 +122,7 @@ var ActionButton = function ActionButton(props) {
122
122
  var _actionProps = (_props$actionProps = props.actionProps) === null || _props$actionProps === void 0 ? void 0 : _props$actionProps.map(function (item) {
123
123
  return _objectSpread(_objectSpread({}, item), {}, {
124
124
  // @ts-ignore
125
- type: item.actionType
125
+ type: item.actionType || item.type
126
126
  });
127
127
  });
128
128
  if (!(_actionProps === null || _actionProps === void 0 ? void 0 : _actionProps.find(function (item) {
@@ -46,7 +46,7 @@ var ToolbarButton = function ToolbarButton(props) {
46
46
  var _toolbarProps = (_props$toolbarProps = props.toolbarProps) === null || _props$toolbarProps === void 0 ? void 0 : _props$toolbarProps.map(function (item) {
47
47
  return _objectSpread(_objectSpread({}, item), {}, {
48
48
  // @ts-ignore
49
- type: item.actionType
49
+ type: item.actionType || item.type
50
50
  });
51
51
  });
52
52
  if (!(_toolbarProps === null || _toolbarProps === void 0 ? void 0 : _toolbarProps.find(function (item) {
@@ -20,7 +20,7 @@ import { isObject, isString, merge } from 'lodash';
20
20
  import { FormFooter, InputRange, ProAddress, ProCascader, ProCertNo, ProCertValidity, ProCombination, ProModalSelect, ProNumberRange, ProRangeBox, ProTimeLimit, transferAddressInfoToRegion, ProUpload, ProTreeModal, ProTree, EnumSelect } from './components';
21
21
  import RenderFields from './components/render/RenderFields';
22
22
  import { useProConfig, useContextForms } from '../ProConfigProvider';
23
- import { getLayout, splitNameStr, useControlled, initialValuesToNames } from './utils/index';
23
+ import { getLayout, splitNameStr, useControlled, initialValuesToNames, filterInternalFields } from './utils/index';
24
24
  import { useForm } from './utils/useForm';
25
25
  import { useFieldProps } from './utils/useFieldProps';
26
26
  import locale from '../locale';
@@ -163,7 +163,7 @@ var ProForm = function ProForm(props, ref) {
163
163
  // 暂时通过'-'区分组合组件字段和普通字段
164
164
  var keys = Object.keys(changedValue);
165
165
  if (!keys.length) {
166
- onValuesChange(changedValue, form.getFieldsValue());
166
+ onValuesChange(filterInternalFields(changedValue), form.getFieldsValue());
167
167
  } else {
168
168
  var values = keys.map(function (key) {
169
169
  if (key.includes('-')) {
@@ -175,7 +175,7 @@ var ProForm = function ProForm(props, ref) {
175
175
  }
176
176
  return {};
177
177
  });
178
- onValuesChange(merge.apply(void 0, [changedValue].concat(_toConsumableArray(values))), form.getFieldsValue());
178
+ onValuesChange(filterInternalFields(merge.apply(void 0, [changedValue].concat(_toConsumableArray(values)))), form.getFieldsValue());
179
179
  }
180
180
  };
181
181
  // 包装一层兼容 names 改变
@@ -215,6 +215,7 @@
215
215
  .@{ant-prefix}-form-item-label {
216
216
  > label {
217
217
  white-space: pre-wrap;
218
+ word-break: break-all;
218
219
  }
219
220
  }
220
221
 
@@ -4,6 +4,7 @@ import "antd/es/form/style";
4
4
  import _Form from "antd/es/form";
5
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  import { filterInternalFields } from './index';
7
+ import { handleScrollToError } from '../../ProEditTable/utils/tools';
7
8
  export var useForm = function useForm(originForm) {
8
9
  var _Form$useForm = _Form.useForm(originForm),
9
10
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -89,8 +90,9 @@ export var useForm = function useForm(originForm) {
89
90
  behavior: 'smooth'
90
91
  });
91
92
  }
93
+ handleScrollToError();
92
94
  throw _context.t0;
93
- case 21:
95
+ case 22:
94
96
  case "end":
95
97
  return _context.stop();
96
98
  }
@@ -18,8 +18,7 @@ var OpenMenu = function OpenMenu(props) {
18
18
  dataSource = props.dataSource,
19
19
  style = props.style,
20
20
  _props$theme = props.theme,
21
- theme = _props$theme === void 0 ? 'dark' : _props$theme,
22
- otherProps = props.otherProps;
21
+ theme = _props$theme === void 0 ? 'dark' : _props$theme;
23
22
  var _ref = dataSource || {},
24
23
  menus = _ref.menus,
25
24
  sideMenu = _ref.sideMenu;
@@ -30,9 +30,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
30
30
  dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
31
31
  var label = 'label';
32
32
  var code = 'value';
33
+ var uuidKey = 'value';
33
34
  if (proSelectFieldNames && Object.keys(proSelectFieldNames).length) {
34
35
  code = proSelectFieldNames.value;
35
36
  label = proSelectFieldNames.label;
37
+ uuidKey = proSelectFieldNames.key || proSelectFieldNames.value;
36
38
  }
37
39
  // 配置属性
38
40
  var disabled = props.disabled,
@@ -76,6 +78,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
76
78
  if (fieldNames && Object.keys(fieldNames).length) {
77
79
  code = fieldNames.value || 'value';
78
80
  label = fieldNames.label || 'label';
81
+ uuidKey = fieldNames.key || code;
79
82
  }
80
83
  // 经过处理后的枚举数据,可能来自用户配置的处理函数后返回的结果
81
84
  var _useSetState = useSetState({}),
@@ -285,6 +288,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
285
288
  icon = node.icon;
286
289
  var labelText = node[label];
287
290
  var value = node[code];
291
+ var key = node[uuidKey];
288
292
  var titleHtml = _jsx("span", {
289
293
  dangerouslySetInnerHTML: {
290
294
  __html: labelText
@@ -315,7 +319,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
315
319
  checkable: node.checkable,
316
320
  icon: icon,
317
321
  className: "node-val-".concat(value)
318
- }, value);
322
+ }, key);
319
323
  }
320
324
  var sonGrade = grade + 1;
321
325
  return _jsx(_TreeSelect.TreeNode, {
@@ -328,7 +332,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
328
332
  children: children.map(function (child) {
329
333
  return renderTreeNode(child, sonGrade);
330
334
  })
331
- }, value);
335
+ }, key);
332
336
  };
333
337
  /**
334
338
  * 从树形数据中找出用户搜索得数据,并且将搜索字符串高亮标识
@@ -55,7 +55,7 @@
55
55
  }
56
56
 
57
57
  & > label {
58
- word-break: break-word;
58
+ word-break: break-all;
59
59
 
60
60
  // 隐藏冒号
61
61
  &::after {
@@ -222,6 +222,7 @@
222
222
 
223
223
  .@{ant-prefix}-table-tbody>.is-editing:not(.@{ant-prefix}-table-measure-row)>td {
224
224
  border-bottom : 0;
225
+ // vertical-align: top;
225
226
  vertical-align: middle;
226
227
  }
227
228
 
@@ -102,35 +102,7 @@ var getActionColumn = function getActionColumn(config) {
102
102
  case 8:
103
103
  _context.prev = 8;
104
104
  _context.t0 = _context["catch"](3);
105
- setTimeout(function () {
106
- var errorDom = document.querySelector('.ant-form-item-has-error');
107
- if (errorDom) {
108
- var tableBody = errorDom.closest('.ant-table-content') || errorDom.closest('.ant-table-body');
109
- var tableCell = errorDom.closest('.ant-table-cell');
110
- if (tableBody && tableCell) {
111
- var previousSibling = tableCell.previousElementSibling;
112
- var childOffsetLeft = 0;
113
- var childFixedLeft = 0;
114
- while (previousSibling) {
115
- if (previousSibling.nodeType === 1) {
116
- var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
117
- var _ref2 = previousSibling.getBoundingClientRect() || {},
118
- _ref2$width = _ref2.width,
119
- width = _ref2$width === void 0 ? 0 : _ref2$width;
120
- childOffsetLeft += width;
121
- if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = (_previousSibling$clas3 = _previousSibling$clas).contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas3, 'ant-table-cell-fix-left')) {
122
- childFixedLeft += width;
123
- }
124
- }
125
- previousSibling = previousSibling.previousElementSibling;
126
- }
127
- tableBody.scrollTo({
128
- left: childOffsetLeft - childFixedLeft,
129
- behavior: 'smooth'
130
- });
131
- }
132
- }
133
- }, 0);
105
+ (0, _tools.handleScrollToError)();
134
106
  return _context.abrupt("return", Promise.reject(_context.t0));
135
107
  case 12:
136
108
  // 编辑状态使用自定义form值,非编辑状态直接使用行数据
@@ -258,10 +230,10 @@ var transformColumns = exports.transformColumns = function transformColumns() {
258
230
  if (typeof columnTitle === 'string') {
259
231
  item.originTitle = columnTitle;
260
232
  if (tooltip) {
261
- var _ref3 = tooltip || {},
262
- tooltipTitle = _ref3.title,
263
- icon = _ref3.icon,
264
- resetProps = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
233
+ var _ref2 = tooltip || {},
234
+ tooltipTitle = _ref2.title,
235
+ icon = _ref2.icon,
236
+ resetProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
265
237
  item.title = (0, _jsxRuntime.jsxs)("span", {
266
238
  className: "pro-edit-table-title pro-edit-table-tooltip",
267
239
  children: [before, columnTitle, (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
@@ -413,13 +385,13 @@ var transformColumns = exports.transformColumns = function transformColumns() {
413
385
  // cacheMap 用来存储缓存值,若有值后不再请求
414
386
  if (JSON.stringify(cacheMap.current) === '{}') {
415
387
  Promise.all(Object.entries(_cacheMap).map( /*#__PURE__*/function () {
416
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(item) {
417
- var _item, key, value, _ref5, service, option;
388
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(item) {
389
+ var _item, key, value, _ref4, service, option;
418
390
  return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
419
391
  while (1) switch (_context2.prev = _context2.next) {
420
392
  case 0:
421
393
  _item = (0, _slicedToArray2.default)(item, 2), key = _item[0], value = _item[1];
422
- _ref5 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref5.service, option = _ref5.option;
394
+ _ref4 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref4.service, option = _ref4.option;
423
395
  if (!service) {
424
396
  _context2.next = 8;
425
397
  break;
@@ -439,7 +411,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
439
411
  }, _callee2);
440
412
  }));
441
413
  return function (_x3) {
442
- return _ref4.apply(this, arguments);
414
+ return _ref3.apply(this, arguments);
443
415
  };
444
416
  }())).then(function (res) {
445
417
  res.forEach(function (item) {
@@ -26,3 +26,6 @@ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
26
26
  * @param rowDisabled 行禁用参数
27
27
  */
28
28
  export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled }: any) => any;
29
+ /** 表格自动滚动到报错位置
30
+ */
31
+ export declare const handleScrollToError: () => void;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.splitNames = exports.onDelete = exports.getRandom = exports.getNamePath = exports.getDisabled = exports.difference = exports.customValidate = void 0;
7
+ exports.splitNames = exports.onDelete = exports.handleScrollToError = exports.getRandom = exports.getNamePath = exports.getDisabled = exports.difference = exports.customValidate = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _lodash = require("lodash");
10
10
  var getRandom = exports.getRandom = function getRandom() {
@@ -158,4 +158,37 @@ var getDisabled = exports.getDisabled = function getDisabled(_ref2) {
158
158
  return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled.apply(columnFieldProps, (0, _toConsumableArray2.default)(params)));
159
159
  }
160
160
  return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled) || convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || convertToBoolean(tabledDisabled);
161
+ };
162
+ /** 表格自动滚动到报错位置
163
+ */
164
+ var handleScrollToError = exports.handleScrollToError = function handleScrollToError() {
165
+ setTimeout(function () {
166
+ var errorDom = document.querySelector('.ant-form-item-has-error');
167
+ if (errorDom) {
168
+ var tableBody = errorDom.closest('.ant-table-content') || errorDom.closest('.ant-table-body');
169
+ var tableCell = errorDom.closest('.ant-table-cell');
170
+ if (tableBody && tableCell) {
171
+ var previousSibling = tableCell.previousElementSibling;
172
+ var childOffsetLeft = 0;
173
+ var childFixedLeft = 0;
174
+ while (previousSibling) {
175
+ if (previousSibling.nodeType === 1) {
176
+ var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
177
+ var _ref3 = previousSibling.getBoundingClientRect() || {},
178
+ _ref3$width = _ref3.width,
179
+ width = _ref3$width === void 0 ? 0 : _ref3$width;
180
+ childOffsetLeft += width;
181
+ if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = (_previousSibling$clas3 = _previousSibling$clas).contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas3, 'ant-table-cell-fix-left')) {
182
+ childFixedLeft += width;
183
+ }
184
+ }
185
+ previousSibling = previousSibling.previousElementSibling;
186
+ }
187
+ tableBody.scrollTo({
188
+ left: childOffsetLeft - childFixedLeft,
189
+ behavior: 'smooth'
190
+ });
191
+ }
192
+ }
193
+ }, 0);
161
194
  };
@@ -123,7 +123,7 @@ var ActionButton = function ActionButton(props) {
123
123
  var _actionProps = (_props$actionProps = props.actionProps) === null || _props$actionProps === void 0 ? void 0 : _props$actionProps.map(function (item) {
124
124
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
125
125
  // @ts-ignore
126
- type: item.actionType
126
+ type: item.actionType || item.type
127
127
  });
128
128
  });
129
129
  if (!(_actionProps === null || _actionProps === void 0 ? void 0 : _actionProps.find(function (item) {
@@ -50,7 +50,7 @@ var ToolbarButton = function ToolbarButton(props) {
50
50
  var _toolbarProps = (_props$toolbarProps = props.toolbarProps) === null || _props$toolbarProps === void 0 ? void 0 : _props$toolbarProps.map(function (item) {
51
51
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
52
52
  // @ts-ignore
53
- type: item.actionType
53
+ type: item.actionType || item.type
54
54
  });
55
55
  });
56
56
  if (!(_toolbarProps === null || _toolbarProps === void 0 ? void 0 : _toolbarProps.find(function (item) {
@@ -164,7 +164,7 @@ var ProForm = function ProForm(props, ref) {
164
164
  // 暂时通过'-'区分组合组件字段和普通字段
165
165
  var keys = Object.keys(changedValue);
166
166
  if (!keys.length) {
167
- onValuesChange(changedValue, form.getFieldsValue());
167
+ onValuesChange((0, _index.filterInternalFields)(changedValue), form.getFieldsValue());
168
168
  } else {
169
169
  var values = keys.map(function (key) {
170
170
  if (key.includes('-')) {
@@ -176,7 +176,7 @@ var ProForm = function ProForm(props, ref) {
176
176
  }
177
177
  return {};
178
178
  });
179
- onValuesChange(_lodash.merge.apply(void 0, [changedValue].concat((0, _toConsumableArray2.default)(values))), form.getFieldsValue());
179
+ onValuesChange((0, _index.filterInternalFields)(_lodash.merge.apply(void 0, [changedValue].concat((0, _toConsumableArray2.default)(values)))), form.getFieldsValue());
180
180
  }
181
181
  };
182
182
  // 包装一层兼容 names 改变
@@ -215,6 +215,7 @@
215
215
  .@{ant-prefix}-form-item-label {
216
216
  > label {
217
217
  white-space: pre-wrap;
218
+ word-break: break-all;
218
219
  }
219
220
  }
220
221
 
@@ -10,6 +10,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _antd = require("antd");
12
12
  var _index = require("./index");
13
+ var _tools = require("../../ProEditTable/utils/tools");
13
14
  var useForm = exports.useForm = function useForm(originForm) {
14
15
  var _Form$useForm = _antd.Form.useForm(originForm),
15
16
  _Form$useForm2 = (0, _slicedToArray2.default)(_Form$useForm, 1),
@@ -95,8 +96,9 @@ var useForm = exports.useForm = function useForm(originForm) {
95
96
  behavior: 'smooth'
96
97
  });
97
98
  }
99
+ (0, _tools.handleScrollToError)();
98
100
  throw _context.t0;
99
- case 21:
101
+ case 22:
100
102
  case "end":
101
103
  return _context.stop();
102
104
  }
@@ -24,8 +24,7 @@ var OpenMenu = function OpenMenu(props) {
24
24
  dataSource = props.dataSource,
25
25
  style = props.style,
26
26
  _props$theme = props.theme,
27
- theme = _props$theme === void 0 ? 'dark' : _props$theme,
28
- otherProps = props.otherProps;
27
+ theme = _props$theme === void 0 ? 'dark' : _props$theme;
29
28
  var _ref = dataSource || {},
30
29
  menus = _ref.menus,
31
30
  sideMenu = _ref.sideMenu;
@@ -32,9 +32,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
32
32
  dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
33
33
  var label = 'label';
34
34
  var code = 'value';
35
+ var uuidKey = 'value';
35
36
  if (proSelectFieldNames && Object.keys(proSelectFieldNames).length) {
36
37
  code = proSelectFieldNames.value;
37
38
  label = proSelectFieldNames.label;
39
+ uuidKey = proSelectFieldNames.key || proSelectFieldNames.value;
38
40
  }
39
41
  // 配置属性
40
42
  var disabled = props.disabled,
@@ -78,6 +80,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
78
80
  if (fieldNames && Object.keys(fieldNames).length) {
79
81
  code = fieldNames.value || 'value';
80
82
  label = fieldNames.label || 'label';
83
+ uuidKey = fieldNames.key || code;
81
84
  }
82
85
  // 经过处理后的枚举数据,可能来自用户配置的处理函数后返回的结果
83
86
  var _useSetState = (0, _ahooks.useSetState)({}),
@@ -287,6 +290,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
287
290
  icon = node.icon;
288
291
  var labelText = node[label];
289
292
  var value = node[code];
293
+ var key = node[uuidKey];
290
294
  var titleHtml = (0, _jsxRuntime.jsx)("span", {
291
295
  dangerouslySetInnerHTML: {
292
296
  __html: labelText
@@ -317,7 +321,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
317
321
  checkable: node.checkable,
318
322
  icon: icon,
319
323
  className: "node-val-".concat(value)
320
- }, value);
324
+ }, key);
321
325
  }
322
326
  var sonGrade = grade + 1;
323
327
  return (0, _jsxRuntime.jsx)(_antd.TreeSelect.TreeNode, {
@@ -330,7 +334,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
330
334
  children: children.map(function (child) {
331
335
  return renderTreeNode(child, sonGrade);
332
336
  })
333
- }, value);
337
+ }, key);
334
338
  };
335
339
  /**
336
340
  * 从树形数据中找出用户搜索得数据,并且将搜索字符串高亮标识
@@ -55,7 +55,7 @@
55
55
  }
56
56
 
57
57
  & > label {
58
- word-break: break-word;
58
+ word-break: break-all;
59
59
 
60
60
  // 隐藏冒号
61
61
  &::after {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.5.0-beta.1",
3
+ "version": "3.5.0-beta.10",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -58,7 +58,7 @@
58
58
  "@dnd-kit/sortable": "^7.0.2",
59
59
  "@dnd-kit/utilities": "^3.2.1",
60
60
  "@pansy/react-watermark": "^3.1.13",
61
- "@zat-design/utils": "^1.1.22",
61
+ "@zat-design/utils": "^1.1.23",
62
62
  "ahooks": "3.7.4",
63
63
  "antd": "4.24.8",
64
64
  "big.js": "^6.2.1",