@zat-design/sisyphus-react 3.6.3 → 3.6.4-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.
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProEditTable/utils/index.js +1 -1
- package/es/ProEditTable/utils/tools.d.ts +1 -1
- package/es/ProEditTable/utils/tools.js +5 -4
- package/es/ProForm/components/FormFooter/index.js +1 -1
- package/es/ProForm/components/combination/ProCascader/style/index.less +1 -1
- package/es/ProForm/index.js +4 -4
- package/es/ProForm/utils/useShouldUpdate.js +5 -3
- package/es/ProTable/index.js +3 -3
- package/lib/ProEditTable/utils/index.js +1 -1
- package/lib/ProEditTable/utils/tools.d.ts +1 -1
- package/lib/ProEditTable/utils/tools.js +5 -4
- package/lib/ProForm/components/FormFooter/index.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/style/index.less +1 -1
- package/lib/ProForm/index.js +4 -4
- package/lib/ProForm/utils/useShouldUpdate.js +4 -2
- package/lib/ProTable/index.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -2316,7 +2316,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2316
2316
|
width: 100%;
|
|
2317
2317
|
}
|
|
2318
2318
|
.pro-address .ant-cascader {
|
|
2319
|
-
width: 45
|
|
2319
|
+
width: 45%;
|
|
2320
2320
|
}
|
|
2321
2321
|
.pro-address .ant-cascader.no-detail {
|
|
2322
2322
|
width: 100% !important;
|
package/dist/less.esm.css
CHANGED
|
@@ -2316,7 +2316,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2316
2316
|
width: 100%;
|
|
2317
2317
|
}
|
|
2318
2318
|
.pro-address .ant-cascader {
|
|
2319
|
-
width: 45
|
|
2319
|
+
width: 45%;
|
|
2320
2320
|
}
|
|
2321
2321
|
.pro-address .ant-cascader.no-detail {
|
|
2322
2322
|
width: 100% !important;
|
|
@@ -195,7 +195,7 @@ export var transformColumns = function transformColumns() {
|
|
|
195
195
|
setState = config.setState,
|
|
196
196
|
page = config.page;
|
|
197
197
|
var isCell = mode === 'cell';
|
|
198
|
-
var _columns =
|
|
198
|
+
var _columns = _toConsumableArray(columns);
|
|
199
199
|
var _cacheMap = _objectSpread({}, cacheMap.current);
|
|
200
200
|
var pageNum = tools.calc(page.pageNum, '-', 1);
|
|
201
201
|
var firstIndex = tools.calc(pageNum, '*', page.pageSize);
|
|
@@ -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)
|
|
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
|
|
168
|
-
|
|
169
|
-
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;
|
package/es/ProForm/index.js
CHANGED
|
@@ -229,7 +229,7 @@ var ProForm = function ProForm(props, ref) {
|
|
|
229
229
|
otherProps.layout = otherProps.layout || 'vertical';
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
return
|
|
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
|
-
}),
|
|
270
|
-
}))
|
|
269
|
+
}), footerRender()]
|
|
270
|
+
})), children]
|
|
271
271
|
}));
|
|
272
272
|
};
|
|
273
273
|
// @ts-ignore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
|
-
import { isFunction, isEqualWith
|
|
3
|
+
import { isFunction, isEqualWith } from 'lodash';
|
|
4
4
|
import { customEqualForFun, equalDependencies } from './index';
|
|
5
5
|
// 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
|
|
6
6
|
var useShouldUpdate = function useShouldUpdate(props) {
|
|
@@ -172,9 +172,11 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
172
172
|
clearTimeout(timerRef.current);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
|
|
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
|
-
isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues) ||
|
|
179
|
+
// (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
|
|
178
180
|
// !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
|
|
179
181
|
equalDependencies(dependencies, prevValues, _currentValues)) {
|
|
180
182
|
showRef.current = _show;
|
package/es/ProTable/index.js
CHANGED
|
@@ -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 {
|
|
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(
|
|
138
|
+
setCurColumns(localColumns || propsColumns);
|
|
139
139
|
} else {
|
|
140
|
-
setCurColumns(
|
|
140
|
+
setCurColumns(propsColumns);
|
|
141
141
|
}
|
|
142
142
|
}, [pathKey, cacheTime, propsColumns]);
|
|
143
143
|
useEffect(function () {
|
|
@@ -199,7 +199,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
199
199
|
setState = config.setState,
|
|
200
200
|
page = config.page;
|
|
201
201
|
var isCell = mode === 'cell';
|
|
202
|
-
var _columns = (0,
|
|
202
|
+
var _columns = (0, _toConsumableArray2.default)(columns);
|
|
203
203
|
var _cacheMap = (0, _objectSpread2.default)({}, cacheMap.current);
|
|
204
204
|
var pageNum = _utils.tools.calc(page.pageNum, '-', 1);
|
|
205
205
|
var firstIndex = _utils.tools.calc(pageNum, '*', page.pageSize);
|
|
@@ -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)
|
|
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
|
|
175
|
-
|
|
176
|
-
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;
|
package/lib/ProForm/index.js
CHANGED
|
@@ -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.
|
|
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
|
-
}),
|
|
271
|
-
}))
|
|
270
|
+
}), footerRender()]
|
|
271
|
+
})), children]
|
|
272
272
|
}));
|
|
273
273
|
};
|
|
274
274
|
// @ts-ignore
|
|
@@ -179,9 +179,11 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
179
179
|
clearTimeout(timerRef.current);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
|
|
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) ||
|
|
186
188
|
(0, _index.equalDependencies)(dependencies, prevValues, _currentValues)) {
|
|
187
189
|
showRef.current = _show;
|
package/lib/ProTable/index.js
CHANGED
|
@@ -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(
|
|
142
|
+
setCurColumns(localColumns || propsColumns);
|
|
143
143
|
} else {
|
|
144
|
-
setCurColumns(
|
|
144
|
+
setCurColumns(propsColumns);
|
|
145
145
|
}
|
|
146
146
|
}, [pathKey, cacheTime, propsColumns]);
|
|
147
147
|
(0, _react.useEffect)(function () {
|