@zat-design/sisyphus-react 3.6.4 → 3.6.5

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.
@@ -25,7 +25,7 @@ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
25
25
  * @param params 当前列的参数
26
26
  * @param rowDisabled 行禁用参数
27
27
  */
28
- export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled }: any) => any;
28
+ export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: any) => any;
29
29
  /** 表格自动滚动到报错位置
30
30
  */
31
31
  export declare const handleScrollToError: () => void;
@@ -86,6 +86,7 @@ export var onDelete = function onDelete(_ref) {
86
86
  * @param rowDisabled 行禁用参数
87
87
  */
88
88
  export var getDisabled = function getDisabled(_ref2) {
89
+ var _ref3, _column$disabled;
89
90
  var globalControl = _ref2.globalControl,
90
91
  formDisabled = _ref2.formDisabled,
91
92
  column = _ref2.column,
@@ -147,7 +148,7 @@ export var getDisabled = function getDisabled(_ref2) {
147
148
  if (isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
148
149
  return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled.apply(columnFieldProps, _toConsumableArray(params)));
149
150
  }
150
- return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled) || convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || convertToBoolean(tabledDisabled);
151
+ return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
151
152
  };
152
153
  /** 表格自动滚动到报错位置
153
154
  */
@@ -164,9 +165,9 @@ export var handleScrollToError = function handleScrollToError() {
164
165
  while (previousSibling) {
165
166
  if (previousSibling.nodeType === 1) {
166
167
  var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
167
- var _ref3 = previousSibling.getBoundingClientRect() || {},
168
- _ref3$width = _ref3.width,
169
- width = _ref3$width === void 0 ? 0 : _ref3$width;
168
+ var _ref4 = previousSibling.getBoundingClientRect() || {},
169
+ _ref4$width = _ref4.width,
170
+ width = _ref4$width === void 0 ? 0 : _ref4$width;
170
171
  childOffsetLeft += width;
171
172
  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')) {
172
173
  childFixedLeft += width;
@@ -34,7 +34,7 @@ var FormFooter = function FormFooter(props) {
34
34
  form.setFieldsValue(cache[formId]);
35
35
  }
36
36
  return cache;
37
- }, []);
37
+ }, [formId]);
38
38
  var _onOk = function _onOk() {
39
39
  if (formId) {
40
40
  var values = form.getFieldsValue();
@@ -5,7 +5,6 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  import { forwardRef, useCallback, useImperativeHandle } from 'react';
7
7
  import { DndContext } from '@dnd-kit/core';
8
- import { cloneDeep, isFunction } from 'lodash';
9
8
  import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
10
9
  import { toArray } from '../../../utils';
11
10
  import { namesPathTransform } from './utils';
@@ -56,10 +55,6 @@ var FormList = function FormList(props, ref) {
56
55
  listName: [].concat(_toConsumableArray(namePath), [item.name]),
57
56
  label: mode === 'less' ? undefined : item.label
58
57
  });
59
- // 可编辑表格的columns需要消除引用关系,防止串数据
60
- if (column.type === 'ProEditTable' && !isFunction(column.fieldProps)) {
61
- column.fieldProps.columns = cloneDeep(column.fieldProps.columns);
62
- }
63
58
  return column;
64
59
  });
65
60
  }, [columns]);
@@ -160,7 +160,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
160
160
  var defaultOptionRender = function defaultOptionRender(rowData) {
161
161
  return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
162
162
  };
163
- var handleFormat = optionRender || onFormat || defaultOptionRender;
163
+ var handleFormat = onFormat || defaultOptionRender;
164
164
  if (showCodeName) {
165
165
  handleFormat = function handleFormat(_ref5) {
166
166
  var value = _ref5.value,
@@ -681,6 +681,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
681
681
  showCodeName: showCodeName,
682
682
  labelInValue: labelInValue,
683
683
  dataSource: options,
684
+ optionRender: optionRender,
684
685
  scrollFollowParent: false,
685
686
  mode: isMultiple ? 'multiple' : undefined,
686
687
  onFocus: function onFocus() {
@@ -229,7 +229,7 @@ var ProForm = function ProForm(props, ref) {
229
229
  otherProps.layout = otherProps.layout || 'vertical';
230
230
  }
231
231
  }
232
- return _jsx(_Form, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
232
+ return _jsxs(_Form, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
233
233
  onKeyPress: function onKeyPress(event) {
234
234
  if (!submitOnEnter) return;
235
235
  if (event.key === 'Enter') {
@@ -247,7 +247,7 @@ var ProForm = function ProForm(props, ref) {
247
247
  block: 'center',
248
248
  behavior: 'smooth'
249
249
  },
250
- children: _jsxs(_Row, _objectSpread(_objectSpread({
250
+ children: [_jsxs(_Row, _objectSpread(_objectSpread({
251
251
  gutter: 24
252
252
  }, rowProps), {}, {
253
253
  children: [_jsx(RenderFields, {
@@ -266,8 +266,8 @@ var ProForm = function ProForm(props, ref) {
266
266
  required: required,
267
267
  originalDiffTip: originalDiffTip,
268
268
  globalControl: globalControl
269
- }), children, footerRender()]
270
- }))
269
+ }), footerRender()]
270
+ })), children]
271
271
  }));
272
272
  };
273
273
  // @ts-ignore
@@ -172,7 +172,9 @@ var useShouldUpdate = function useShouldUpdate(props) {
172
172
  clearTimeout(timerRef.current);
173
173
  }
174
174
  }
175
- if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !isEqualWith(rulesRef.current, _rules, customEqualForFun) || !isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) ||
175
+ var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFun);
176
+ var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun);
177
+ if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes ||
176
178
  // 值变更,需要同步更新函数式的fieldProps
177
179
  // (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
178
180
  // !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
@@ -14,7 +14,7 @@ var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stri
14
14
  _excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
15
15
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
16
16
  import { useEffect, useMemo, useState, createContext } from 'react';
17
- import { cloneDeep, get, keyBy, assign } from 'lodash';
17
+ import { get, keyBy, assign } from 'lodash';
18
18
  import { useDebounceEffect, useDeepCompareEffect, useSetState } from 'ahooks';
19
19
  import { ReactSVG } from 'react-svg';
20
20
  import classnames from 'classnames';
@@ -135,9 +135,9 @@ function ProTable(props) {
135
135
  });
136
136
  });
137
137
  localColumns = ((_localColumns = localColumns) === null || _localColumns === void 0 ? void 0 : _localColumns.length) === 0 ? undefined : localColumns;
138
- setCurColumns(cloneDeep(localColumns || propsColumns));
138
+ setCurColumns(localColumns || propsColumns);
139
139
  } else {
140
- setCurColumns(cloneDeep(propsColumns));
140
+ setCurColumns(propsColumns);
141
141
  }
142
142
  }, [pathKey, cacheTime, propsColumns]);
143
143
  useEffect(function () {
@@ -25,7 +25,7 @@ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
25
25
  * @param params 当前列的参数
26
26
  * @param rowDisabled 行禁用参数
27
27
  */
28
- export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled }: any) => any;
28
+ export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: any) => any;
29
29
  /** 表格自动滚动到报错位置
30
30
  */
31
31
  export declare const handleScrollToError: () => void;
@@ -93,6 +93,7 @@ var onDelete = exports.onDelete = function onDelete(_ref) {
93
93
  * @param rowDisabled 行禁用参数
94
94
  */
95
95
  var getDisabled = exports.getDisabled = function getDisabled(_ref2) {
96
+ var _ref3, _column$disabled;
96
97
  var globalControl = _ref2.globalControl,
97
98
  formDisabled = _ref2.formDisabled,
98
99
  column = _ref2.column,
@@ -154,7 +155,7 @@ var getDisabled = exports.getDisabled = function getDisabled(_ref2) {
154
155
  if ((0, _lodash.isFunction)(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
155
156
  return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled.apply(columnFieldProps, (0, _toConsumableArray2.default)(params)));
156
157
  }
157
- return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled) || convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || convertToBoolean(tabledDisabled);
158
+ return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
158
159
  };
159
160
  /** 表格自动滚动到报错位置
160
161
  */
@@ -171,9 +172,9 @@ var handleScrollToError = exports.handleScrollToError = function handleScrollToE
171
172
  while (previousSibling) {
172
173
  if (previousSibling.nodeType === 1) {
173
174
  var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
174
- var _ref3 = previousSibling.getBoundingClientRect() || {},
175
- _ref3$width = _ref3.width,
176
- width = _ref3$width === void 0 ? 0 : _ref3$width;
175
+ var _ref4 = previousSibling.getBoundingClientRect() || {},
176
+ _ref4$width = _ref4.width,
177
+ width = _ref4$width === void 0 ? 0 : _ref4$width;
177
178
  childOffsetLeft += width;
178
179
  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')) {
179
180
  childFixedLeft += width;
@@ -38,7 +38,7 @@ var FormFooter = function FormFooter(props) {
38
38
  form.setFieldsValue(cache[formId]);
39
39
  }
40
40
  return cache;
41
- }, []);
41
+ }, [formId]);
42
42
  var _onOk = function _onOk() {
43
43
  if (formId) {
44
44
  var values = form.getFieldsValue();
@@ -11,7 +11,6 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  var _react = require("react");
12
12
  var _antd = require("antd");
13
13
  var _core = require("@dnd-kit/core");
14
- var _lodash = require("lodash");
15
14
  var _sortable = require("@dnd-kit/sortable");
16
15
  var _utils = require("../../../utils");
17
16
  var _utils2 = require("./utils");
@@ -62,10 +61,6 @@ var FormList = function FormList(props, ref) {
62
61
  listName: [].concat((0, _toConsumableArray2.default)(namePath), [item.name]),
63
62
  label: mode === 'less' ? undefined : item.label
64
63
  });
65
- // 可编辑表格的columns需要消除引用关系,防止串数据
66
- if (column.type === 'ProEditTable' && !(0, _lodash.isFunction)(column.fieldProps)) {
67
- column.fieldProps.columns = (0, _lodash.cloneDeep)(column.fieldProps.columns);
68
- }
69
64
  return column;
70
65
  });
71
66
  }, [columns]);
@@ -157,7 +157,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
157
157
  var defaultOptionRender = function defaultOptionRender(rowData) {
158
158
  return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
159
159
  };
160
- var handleFormat = optionRender || onFormat || defaultOptionRender;
160
+ var handleFormat = onFormat || defaultOptionRender;
161
161
  if (showCodeName) {
162
162
  handleFormat = function handleFormat(_ref5) {
163
163
  var value = _ref5.value,
@@ -678,6 +678,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
678
678
  showCodeName: showCodeName,
679
679
  labelInValue: labelInValue,
680
680
  dataSource: options,
681
+ optionRender: optionRender,
681
682
  scrollFollowParent: false,
682
683
  mode: isMultiple ? 'multiple' : undefined,
683
684
  onFocus: function onFocus() {
@@ -230,7 +230,7 @@ var ProForm = function ProForm(props, ref) {
230
230
  otherProps.layout = otherProps.layout || 'vertical';
231
231
  }
232
232
  }
233
- return (0, _jsxRuntime.jsx)(_antd.Form, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
233
+ return (0, _jsxRuntime.jsxs)(_antd.Form, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
234
234
  onKeyPress: function onKeyPress(event) {
235
235
  if (!submitOnEnter) return;
236
236
  if (event.key === 'Enter') {
@@ -248,7 +248,7 @@ var ProForm = function ProForm(props, ref) {
248
248
  block: 'center',
249
249
  behavior: 'smooth'
250
250
  },
251
- children: (0, _jsxRuntime.jsxs)(_antd.Row, (0, _objectSpread2.default)((0, _objectSpread2.default)({
251
+ children: [(0, _jsxRuntime.jsxs)(_antd.Row, (0, _objectSpread2.default)((0, _objectSpread2.default)({
252
252
  gutter: 24
253
253
  }, rowProps), {}, {
254
254
  children: [(0, _jsxRuntime.jsx)(_RenderFields.default, {
@@ -267,8 +267,8 @@ var ProForm = function ProForm(props, ref) {
267
267
  required: required,
268
268
  originalDiffTip: originalDiffTip,
269
269
  globalControl: globalControl
270
- }), children, footerRender()]
271
- }))
270
+ }), footerRender()]
271
+ })), children]
272
272
  }));
273
273
  };
274
274
  // @ts-ignore
@@ -179,7 +179,9 @@ var useShouldUpdate = function useShouldUpdate(props) {
179
179
  clearTimeout(timerRef.current);
180
180
  }
181
181
  }
182
- if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !(0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun) || !(0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun) ||
182
+ var equalRes = (0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun);
183
+ var proEqualRes = (0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun);
184
+ if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes ||
183
185
  // 值变更,需要同步更新函数式的fieldProps
184
186
  // (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
185
187
  // !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
@@ -139,9 +139,9 @@ function ProTable(props) {
139
139
  });
140
140
  });
141
141
  localColumns = ((_localColumns = localColumns) === null || _localColumns === void 0 ? void 0 : _localColumns.length) === 0 ? undefined : localColumns;
142
- setCurColumns((0, _lodash.cloneDeep)(localColumns || propsColumns));
142
+ setCurColumns(localColumns || propsColumns);
143
143
  } else {
144
- setCurColumns((0, _lodash.cloneDeep)(propsColumns));
144
+ setCurColumns(propsColumns);
145
145
  }
146
146
  }, [pathKey, cacheTime, propsColumns]);
147
147
  (0, _react.useEffect)(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.6.4",
3
+ "version": "3.6.5",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",