@zat-design/sisyphus-react 3.11.5-beta.7 → 3.11.5-beta.8
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/.vscode/extensions.json +5 -0
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -3
- package/es/ProEditTable/index.js +2 -1
- package/es/ProEditTable/utils/tools.d.ts +2 -1
- package/es/ProEditTable/utils/tools.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -3
- package/lib/ProEditTable/index.js +2 -1
- package/lib/ProEditTable/utils/tools.d.ts +2 -1
- package/lib/ProEditTable/utils/tools.js +3 -3
- package/package.json +1 -1
@@ -64,19 +64,20 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
64
64
|
return clearTimeout(timeoutId);
|
65
65
|
}; // 清理定时器
|
66
66
|
}
|
67
|
+
setInitialSnapshot('');
|
67
68
|
}, [visible]); // 当 visible 变化时执行
|
68
69
|
// 快照对比
|
69
70
|
var compareSnapshots = function compareSnapshots() {
|
70
71
|
if (!ref.current) return false;
|
71
|
-
return ref.current.innerHTML
|
72
|
+
return ref.current.innerHTML === initialSnapshot;
|
72
73
|
};
|
73
74
|
var onConfirm = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
74
75
|
var _locale$ProDrawerForm, _locale$ProDrawerForm2, _locale$ProDrawerForm3, _locale$ProDrawerForm4;
|
75
76
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
76
77
|
while (1) switch (_context.prev = _context.next) {
|
77
78
|
case 0:
|
78
|
-
//
|
79
|
-
if (isView || !isConfirmClose ||
|
79
|
+
// 如果当前是查看状态,或者不需要确认关闭,或者快照对比一致,则直接关闭
|
80
|
+
if (isView || !isConfirmClose || compareSnapshots()) {
|
80
81
|
onCancel && onCancel();
|
81
82
|
} else if (!modalRef.current) {
|
82
83
|
modalRef.current = _Modal.confirm(_objectSpread({
|
package/es/ProEditTable/index.js
CHANGED
@@ -35,7 +35,7 @@ export declare const handleScrollToError: () => void;
|
|
35
35
|
* @returns 深拷贝后的对象,其中的React节点会被保留
|
36
36
|
*/
|
37
37
|
export declare function cloneDeepFilterNode(value: any): any;
|
38
|
-
export declare const onPageCheck: ({ form, name, value, columns, page, pagination, setState }: {
|
38
|
+
export declare const onPageCheck: ({ form, name, value, columns, page, pagination, setState, isView }: {
|
39
39
|
form: any;
|
40
40
|
name: any;
|
41
41
|
value: any;
|
@@ -43,4 +43,5 @@ export declare const onPageCheck: ({ form, name, value, columns, page, paginatio
|
|
43
43
|
page: any;
|
44
44
|
pagination: any;
|
45
45
|
setState: any;
|
46
|
+
isView: any;
|
46
47
|
}) => Promise<void>;
|
@@ -336,12 +336,12 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
336
336
|
}();
|
337
337
|
export var onPageCheck = /*#__PURE__*/function () {
|
338
338
|
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref7) {
|
339
|
-
var form, name, value, columns, page, pagination, setState, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, record, _iterator3, _step3, column, result, nextState;
|
339
|
+
var form, name, value, columns, page, pagination, setState, isView, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, record, _iterator3, _step3, column, result, nextState;
|
340
340
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
341
341
|
while (1) switch (_context2.prev = _context2.next) {
|
342
342
|
case 0:
|
343
|
-
form = _ref7.form, name = _ref7.name, value = _ref7.value, columns = _ref7.columns, page = _ref7.page, pagination = _ref7.pagination, setState = _ref7.setState;
|
344
|
-
if (!pagination) {
|
343
|
+
form = _ref7.form, name = _ref7.name, value = _ref7.value, columns = _ref7.columns, page = _ref7.page, pagination = _ref7.pagination, setState = _ref7.setState, isView = _ref7.isView;
|
344
|
+
if (!(pagination && !isView)) {
|
345
345
|
_context2.next = 75;
|
346
346
|
break;
|
347
347
|
}
|
@@ -67,19 +67,20 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
67
67
|
return clearTimeout(timeoutId);
|
68
68
|
}; // 清理定时器
|
69
69
|
}
|
70
|
+
setInitialSnapshot('');
|
70
71
|
}, [visible]); // 当 visible 变化时执行
|
71
72
|
// 快照对比
|
72
73
|
var compareSnapshots = function compareSnapshots() {
|
73
74
|
if (!ref.current) return false;
|
74
|
-
return ref.current.innerHTML
|
75
|
+
return ref.current.innerHTML === initialSnapshot;
|
75
76
|
};
|
76
77
|
var onConfirm = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
77
78
|
var _locale$ProDrawerForm, _locale$ProDrawerForm2, _locale$ProDrawerForm3, _locale$ProDrawerForm4;
|
78
79
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
79
80
|
while (1) switch (_context.prev = _context.next) {
|
80
81
|
case 0:
|
81
|
-
//
|
82
|
-
if (isView || !isConfirmClose ||
|
82
|
+
// 如果当前是查看状态,或者不需要确认关闭,或者快照对比一致,则直接关闭
|
83
|
+
if (isView || !isConfirmClose || compareSnapshots()) {
|
83
84
|
onCancel && onCancel();
|
84
85
|
} else if (!modalRef.current) {
|
85
86
|
modalRef.current = _antd.Modal.confirm((0, _objectSpread2.default)({
|
@@ -35,7 +35,7 @@ export declare const handleScrollToError: () => void;
|
|
35
35
|
* @returns 深拷贝后的对象,其中的React节点会被保留
|
36
36
|
*/
|
37
37
|
export declare function cloneDeepFilterNode(value: any): any;
|
38
|
-
export declare const onPageCheck: ({ form, name, value, columns, page, pagination, setState }: {
|
38
|
+
export declare const onPageCheck: ({ form, name, value, columns, page, pagination, setState, isView }: {
|
39
39
|
form: any;
|
40
40
|
name: any;
|
41
41
|
value: any;
|
@@ -43,4 +43,5 @@ export declare const onPageCheck: ({ form, name, value, columns, page, paginatio
|
|
43
43
|
page: any;
|
44
44
|
pagination: any;
|
45
45
|
setState: any;
|
46
|
+
isView: any;
|
46
47
|
}) => Promise<void>;
|
@@ -345,12 +345,12 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
345
345
|
}();
|
346
346
|
var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
|
347
347
|
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref7) {
|
348
|
-
var form, name, value, columns, page, pagination, setState, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, record, _iterator3, _step3, column, result, nextState;
|
348
|
+
var form, name, value, columns, page, pagination, setState, isView, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, record, _iterator3, _step3, column, result, nextState;
|
349
349
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
350
350
|
while (1) switch (_context2.prev = _context2.next) {
|
351
351
|
case 0:
|
352
|
-
form = _ref7.form, name = _ref7.name, value = _ref7.value, columns = _ref7.columns, page = _ref7.page, pagination = _ref7.pagination, setState = _ref7.setState;
|
353
|
-
if (!pagination) {
|
352
|
+
form = _ref7.form, name = _ref7.name, value = _ref7.value, columns = _ref7.columns, page = _ref7.page, pagination = _ref7.pagination, setState = _ref7.setState, isView = _ref7.isView;
|
353
|
+
if (!(pagination && !isView)) {
|
354
354
|
_context2.next = 75;
|
355
355
|
break;
|
356
356
|
}
|