@zat-design/sisyphus-react 3.6.9-beta.7 → 3.6.10-beta.2
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/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/dist/index.esm.css +41 -41
- package/dist/less.esm.css +41 -41
- package/es/ProEditTable/components/RenderField/index.js +46 -27
- package/es/ProForm/components/combination/ProCascader/index.js +14 -8
- package/es/ProForm/components/render/Render.js +37 -17
- package/es/ProForm/style/index.less +52 -52
- package/es/ProForm/utils/diffOriginal.d.ts +1 -0
- package/es/ProForm/utils/diffOriginal.js +27 -4
- package/es/ProForm/utils/useChanged.js +2 -1
- package/es/ProForm/utils/useListChanged.js +3 -3
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +3 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +106 -40
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +14 -1
- package/es/ProTable/index.js +6 -2
- package/es/ProTable/propsType.d.ts +22 -0
- package/es/ProThemeTools/component/{ProTools → PrdTools}/index.d.ts +2 -2
- package/es/ProThemeTools/component/{ProTools → PrdTools}/index.js +2 -2
- package/es/ProThemeTools/component/index.d.ts +2 -1
- package/es/ProThemeTools/component/index.js +2 -1
- package/es/ProThemeTools/index.js +2 -2
- package/es/ProThemeTools/style/index.less +1 -1
- package/es/ProTreeModal/components/List.js +30 -4
- package/lib/ProEditTable/components/RenderField/index.js +41 -26
- package/lib/ProForm/components/combination/ProCascader/index.js +12 -6
- package/lib/ProForm/components/render/Render.js +35 -17
- package/lib/ProForm/style/index.less +52 -52
- package/lib/ProForm/utils/diffOriginal.d.ts +1 -0
- package/lib/ProForm/utils/diffOriginal.js +27 -3
- package/lib/ProForm/utils/useChanged.js +2 -1
- package/lib/ProForm/utils/useListChanged.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +3 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +106 -40
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +13 -1
- package/lib/ProTable/index.js +6 -2
- package/lib/ProTable/propsType.d.ts +22 -0
- package/lib/ProThemeTools/component/{ProTools → PrdTools}/index.d.ts +2 -2
- package/lib/ProThemeTools/component/{ProTools → PrdTools}/index.js +2 -2
- package/lib/ProThemeTools/component/index.d.ts +2 -1
- package/lib/ProThemeTools/component/index.js +3 -3
- package/lib/ProThemeTools/index.js +1 -1
- package/lib/ProThemeTools/style/index.less +1 -1
- package/lib/ProTreeModal/components/List.js +30 -4
- package/package.json +1 -1
- package/es/ProEditTable/components/RenderField/ListChanged.d.ts +0 -16
- package/es/ProEditTable/components/RenderField/ListChanged.js +0 -124
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/es/ProForm/components/render/Changed.js +0 -64
- package/lib/ProEditTable/components/RenderField/ListChanged.d.ts +0 -16
- package/lib/ProEditTable/components/RenderField/ListChanged.js +0 -129
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.js +0 -69
- /package/es/ProThemeTools/component/{ProTools → PrdTools}/style/index.less +0 -0
- /package/lib/ProThemeTools/component/{ProTools → PrdTools}/style/index.less +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _antd = require("antd");
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
|
|
16
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type"];
|
|
17
|
-
var toNamePath = function toNamePath(name) {
|
|
18
|
-
if (Array.isArray(name)) {
|
|
19
|
-
return name;
|
|
20
|
-
}
|
|
21
|
-
return [name];
|
|
22
|
-
};
|
|
23
|
-
var toNamePaths = function toNamePaths(names) {
|
|
24
|
-
return names.map(function (name) {
|
|
25
|
-
return toNamePath(name);
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
var getOriginalValue = function getOriginalValue(_ref) {
|
|
29
|
-
var namePath = _ref.namePath,
|
|
30
|
-
originalName = _ref.originalName,
|
|
31
|
-
originalNames = _ref.originalNames,
|
|
32
|
-
originalValues = _ref.originalValues,
|
|
33
|
-
rowKeyPath = _ref.rowKeyPath,
|
|
34
|
-
form = _ref.form;
|
|
35
|
-
if (!originalValues) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
if (rowKeyPath) {
|
|
39
|
-
var rowValueNamePath = namePath.slice(0, rowKeyPath.length - 1); // 表单中变动值所在行
|
|
40
|
-
var rowKeyName = rowKeyPath[rowKeyPath.length - 1]; // rowKey在行内的name
|
|
41
|
-
var rowValue = form.getFieldValue(rowValueNamePath);
|
|
42
|
-
if (!rowValue) return undefined;
|
|
43
|
-
var keyValue = rowValue[rowKeyName]; // 获取表单中rowKey值
|
|
44
|
-
if (!keyValue) return undefined;
|
|
45
|
-
var originalValueList = (0, _lodash.get)(originalValues, originalName.slice(0, rowKeyPath.length - 2));
|
|
46
|
-
var originalValueRow = originalValueList.find(function (item) {
|
|
47
|
-
return item[rowKeyPath[rowKeyPath.length - 1]] === keyValue;
|
|
48
|
-
});
|
|
49
|
-
var originalValue;
|
|
50
|
-
if (originalNames === null || originalNames === void 0 ? void 0 : originalNames.length) {
|
|
51
|
-
var originalNamesValue = originalNames.map(function (originalName) {
|
|
52
|
-
return (0, _lodash.get)(originalValueRow, originalName.slice(rowKeyPath.length - 1));
|
|
53
|
-
});
|
|
54
|
-
// 有可能出现数组中全是undefined的情况 视为没有值
|
|
55
|
-
var fillUndefined = originalNamesValue.every(function (valItem) {
|
|
56
|
-
return valItem === undefined;
|
|
57
|
-
});
|
|
58
|
-
originalValue = fillUndefined ? undefined : originalNamesValue;
|
|
59
|
-
} else {
|
|
60
|
-
originalValue = (0, _lodash.get)(originalValueRow, originalName.slice(rowKeyPath.length - 1));
|
|
61
|
-
}
|
|
62
|
-
return originalValue;
|
|
63
|
-
}
|
|
64
|
-
// 这个方法是给editTable专用的 暂时不存在不传rowKey的情况
|
|
65
|
-
return (originalNames === null || originalNames === void 0 ? void 0 : originalNames.length) ? originalNames.map(function (originalName) {
|
|
66
|
-
return (0, _lodash.get)(originalValues, originalName);
|
|
67
|
-
}) : (0, _lodash.get)(originalValues, originalName);
|
|
68
|
-
};
|
|
69
|
-
var ListChanged = function ListChanged(props) {
|
|
70
|
-
var name = props.name,
|
|
71
|
-
names = props.names,
|
|
72
|
-
namesStr = props.namesStr,
|
|
73
|
-
_props$originalName = props.originalName,
|
|
74
|
-
originalName = _props$originalName === void 0 ? name : _props$originalName,
|
|
75
|
-
_props$originalNames = props.originalNames,
|
|
76
|
-
originalNames = _props$originalNames === void 0 ? names : _props$originalNames,
|
|
77
|
-
originalValues = props.originalValues,
|
|
78
|
-
form = props.form,
|
|
79
|
-
equalWith = props.equalWith,
|
|
80
|
-
rowKeyPath = props.rowKeyPath,
|
|
81
|
-
children = props.children,
|
|
82
|
-
type = props.type,
|
|
83
|
-
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
84
|
-
var namePath = toNamePath(namesStr || name);
|
|
85
|
-
var originalNamePath = toNamePath(originalName);
|
|
86
|
-
var originalNamePaths = originalNames && toNamePaths(originalNames);
|
|
87
|
-
var notWatch = !originalValues || ['FormList', 'ProEditTable'].includes(type);
|
|
88
|
-
var originalValue = !notWatch ? getOriginalValue({
|
|
89
|
-
namePath: namePath,
|
|
90
|
-
originalName: originalNamePath,
|
|
91
|
-
originalNames: originalNamePaths,
|
|
92
|
-
originalValues: originalValues,
|
|
93
|
-
rowKeyPath: rowKeyPath,
|
|
94
|
-
form: form
|
|
95
|
-
}) : undefined;
|
|
96
|
-
var noChange = !equalWith && (!originalValues || originalValue === undefined);
|
|
97
|
-
var changed = (0, _react.useMemo)(function () {
|
|
98
|
-
if (notWatch || noChange) return false;
|
|
99
|
-
return (0, _diffOriginal.diffOriginal)({
|
|
100
|
-
value: props.value,
|
|
101
|
-
originalValue: originalValue,
|
|
102
|
-
form: form,
|
|
103
|
-
equalWith: equalWith
|
|
104
|
-
// name: isString(namesStr) ? namesStr : originalName || name,
|
|
105
|
-
});
|
|
106
|
-
}, [props.value, originalValue]);
|
|
107
|
-
if (notWatch || noChange) {
|
|
108
|
-
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), rest));
|
|
109
|
-
}
|
|
110
|
-
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
111
|
-
open: changed ? undefined : false,
|
|
112
|
-
getPopupContainer: function getPopupContainer(target) {
|
|
113
|
-
return target.parentElement;
|
|
114
|
-
},
|
|
115
|
-
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
116
|
-
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children), {}, {
|
|
117
|
-
// @ts-ignore
|
|
118
|
-
isView: true,
|
|
119
|
-
value: originalValue,
|
|
120
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
121
|
-
})) : undefined]
|
|
122
|
-
}),
|
|
123
|
-
children: (0, _jsxRuntime.jsx)("div", {
|
|
124
|
-
className: changed ? 'pro-form-item-changed' : '',
|
|
125
|
-
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), rest)) : undefined
|
|
126
|
-
})
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
var _default = exports.default = ListChanged;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FormInstance } from 'antd';
|
|
2
|
-
import { NamePath } from 'antd/lib/form/interface';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
interface Props {
|
|
5
|
-
name?: NamePath;
|
|
6
|
-
names?: NamePath[];
|
|
7
|
-
namesStr?: string;
|
|
8
|
-
originalValues?: any;
|
|
9
|
-
form: FormInstance;
|
|
10
|
-
equalWith?: (preValue: any, curValue: any) => boolean | undefined;
|
|
11
|
-
[name: string]: any;
|
|
12
|
-
}
|
|
13
|
-
declare const Changed: React.FC<Props>;
|
|
14
|
-
export default Changed;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _antd = require("antd");
|
|
13
|
-
var _lodash = require("lodash");
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _diffOriginal = require("../../utils/diffOriginal");
|
|
16
|
-
var _excluded = ["name", "names", "namesStr", "originalValues", "form", "equalWith", "children", "type", "originalDiffTip"];
|
|
17
|
-
var Changed = function Changed(props) {
|
|
18
|
-
var name = props.name,
|
|
19
|
-
names = props.names,
|
|
20
|
-
namesStr = props.namesStr,
|
|
21
|
-
originalValues = props.originalValues,
|
|
22
|
-
form = props.form,
|
|
23
|
-
equalWith = props.equalWith,
|
|
24
|
-
children = props.children,
|
|
25
|
-
type = props.type,
|
|
26
|
-
originalDiffTip = props.originalDiffTip,
|
|
27
|
-
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
28
|
-
// 不渲染tooltip
|
|
29
|
-
var notWatch = !originalDiffTip || ['FormList', 'ProEditTable'].includes(type);
|
|
30
|
-
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
31
|
-
return (0, _lodash.get)(originalValues, name);
|
|
32
|
-
}) : (0, _lodash.get)(originalValues, name);
|
|
33
|
-
var noChange = !equalWith && (!originalValues || originalValue === undefined);
|
|
34
|
-
var changed = (0, _react.useMemo)(function () {
|
|
35
|
-
if (notWatch || noChange) return false;
|
|
36
|
-
return (0, _diffOriginal.diffOriginal)({
|
|
37
|
-
originalValue: originalValue,
|
|
38
|
-
value: props.value,
|
|
39
|
-
form: form,
|
|
40
|
-
equalWith: equalWith
|
|
41
|
-
// name: namesStr || name,
|
|
42
|
-
});
|
|
43
|
-
}, [notWatch, noChange, props.value, originalValue]);
|
|
44
|
-
var tipContent = (0, _react.useMemo)(function () {
|
|
45
|
-
if (notWatch || noChange) return undefined;
|
|
46
|
-
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), {}, {
|
|
47
|
-
isView: true,
|
|
48
|
-
value: originalValue,
|
|
49
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
50
|
-
})) : undefined;
|
|
51
|
-
}, [originalValue, children]);
|
|
52
|
-
if (notWatch || noChange) {
|
|
53
|
-
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), rest));
|
|
54
|
-
}
|
|
55
|
-
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
56
|
-
open: changed ? undefined : false,
|
|
57
|
-
getPopupContainer: function getPopupContainer(target) {
|
|
58
|
-
return target.parentElement;
|
|
59
|
-
},
|
|
60
|
-
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
61
|
-
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
62
|
-
}),
|
|
63
|
-
children: (0, _jsxRuntime.jsx)("div", {
|
|
64
|
-
className: changed ? 'pro-form-item-changed' : '',
|
|
65
|
-
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), rest)) : undefined
|
|
66
|
-
})
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
var _default = exports.default = Changed;
|
|
File without changes
|
|
File without changes
|