@zat-design/sisyphus-react 3.7.3 → 3.8.0-beat.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 +100 -4
- package/dist/less.esm.css +97 -4
- package/es/ProAction/index.js +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +29 -14
- package/es/ProEditTable/components/RenderField/index.js +10 -8
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +1 -1
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.js +6 -5
- package/es/ProEnum/style/index.less +14 -4
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProEnum/utils/index.js +4 -0
- package/es/ProForm/components/combination/Container/index.js +5 -3
- package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +6 -5
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/Group/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +6 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +57 -46
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ChangedWrapper.js +110 -0
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +11 -11
- package/es/ProForm/components/render/RenderFields.d.ts +2 -3
- package/es/ProForm/components/render/RenderFields.js +3 -4
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +4 -7
- package/es/ProForm/propsType.d.ts +13 -2
- package/es/ProForm/style/index.less +103 -5
- package/es/ProForm/utils/diffOriginal.d.ts +4 -4
- package/es/ProForm/utils/diffOriginal.js +18 -7
- package/es/ProForm/utils/transformValue.js +17 -11
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -1
- package/es/ProSelect/index.js +12 -11
- package/es/ProSelect/propsType.d.ts +4 -0
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProStep/components/Listener/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +6 -3
- package/es/ProStep/index.d.ts +1 -1
- package/es/ProStep/index.js +25 -18
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.js +30 -13
- package/es/ProTable/propsType.d.ts +14 -1
- package/es/ProTable/style/index.less +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/AdaptiveTooltip.js +55 -0
- package/es/ProTree/components/List.js +15 -3
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +38 -5
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.js +17 -8
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/style/index.less +14 -0
- package/es/ProTreeModal/components/Tree.js +15 -17
- package/es/ProTreeModal/index.js +62 -7
- package/es/ProTreeModal/utils.d.ts +1 -0
- package/es/ProTreeModal/utils.js +21 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/es/style/theme/antd.less +5 -0
- package/es/style/theme/index.less +2 -1
- package/es/style/theme/tokens.less +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +13 -0
- package/lib/ProAction/index.js +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +32 -15
- package/lib/ProEditTable/components/RenderField/index.js +10 -8
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +1 -1
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.js +6 -5
- package/lib/ProEnum/style/index.less +14 -4
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProEnum/utils/index.js +4 -0
- package/lib/ProForm/components/combination/Container/index.js +5 -3
- package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +5 -4
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +6 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +56 -45
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/lib/ProForm/components/render/ChangedWrapper.js +115 -0
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +11 -11
- package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +4 -7
- package/lib/ProForm/propsType.d.ts +13 -2
- package/lib/ProForm/style/index.less +103 -5
- package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
- package/lib/ProForm/utils/diffOriginal.js +18 -7
- package/lib/ProForm/utils/transformValue.js +17 -11
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -1
- package/lib/ProSelect/index.js +12 -11
- package/lib/ProSelect/propsType.d.ts +4 -0
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProStep/components/Listener/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +6 -3
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/ProStep/index.js +25 -18
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.js +30 -13
- package/lib/ProTable/propsType.d.ts +14 -1
- package/lib/ProTable/style/index.less +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
- package/lib/ProTree/components/List.js +15 -3
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +38 -5
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.js +19 -7
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/style/index.less +14 -0
- package/lib/ProTreeModal/components/Tree.js +15 -17
- package/lib/ProTreeModal/index.js +61 -6
- package/lib/ProTreeModal/utils.d.ts +1 -0
- package/lib/ProTreeModal/utils.js +20 -0
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/lib/style/theme/antd.less +5 -0
- package/lib/style/theme/index.less +2 -1
- package/lib/style/theme/tokens.less +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/package.json +4 -4
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/es/ProForm/components/render/Changed.js +0 -64
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.js +0 -69
- /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
- /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.addLevelAndParentId = void 0;
|
|
7
8
|
exports.filterCheckedNodes = filterCheckedNodes;
|
|
8
9
|
exports.findTreeNodeByKey = findTreeNodeByKey;
|
|
9
10
|
exports.getAllKeys = getAllKeys;
|
|
@@ -209,4 +210,23 @@ var transformMessage = exports.transformMessage = function transformMessage(obj,
|
|
|
209
210
|
_message = message.replaceAll("{".concat(key, "}"), obj[key]);
|
|
210
211
|
});
|
|
211
212
|
return _message;
|
|
213
|
+
};
|
|
214
|
+
var _addLevelAndParentId = exports.addLevelAndParentId = function addLevelAndParentId() {
|
|
215
|
+
var tree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
216
|
+
var fieldNames = arguments.length > 1 ? arguments[1] : undefined;
|
|
217
|
+
var currentLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
218
|
+
var currentParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
219
|
+
var _fieldNames$children = fieldNames.children,
|
|
220
|
+
children = _fieldNames$children === void 0 ? 'children' : _fieldNames$children,
|
|
221
|
+
_fieldNames$value = fieldNames.value,
|
|
222
|
+
value = _fieldNames$value === void 0 ? 'value' : _fieldNames$value;
|
|
223
|
+
return tree.map(function (node) {
|
|
224
|
+
var newNode = (0, _objectSpread4.default)({}, node);
|
|
225
|
+
newNode.level = currentLevel;
|
|
226
|
+
newNode.parentId = currentParentId;
|
|
227
|
+
if (node[children]) {
|
|
228
|
+
newNode[children] = _addLevelAndParentId(node[children], fieldNames, currentLevel + 1, newNode[value]);
|
|
229
|
+
}
|
|
230
|
+
return newNode;
|
|
231
|
+
});
|
|
212
232
|
};
|
|
@@ -166,7 +166,7 @@ var ImageRender = function ImageRender(props) {
|
|
|
166
166
|
disabled: isView || disabled,
|
|
167
167
|
className: "action-item",
|
|
168
168
|
onClick: function () {
|
|
169
|
-
var _onClick = (0, _asyncToGenerator2.default)(
|
|
169
|
+
var _onClick = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
170
170
|
var res;
|
|
171
171
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
172
172
|
while (1) switch (_context.prev = _context.next) {
|
package/lib/ProViewer/index.js
CHANGED
|
@@ -112,8 +112,8 @@ var ProViewer = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
112
112
|
(0, _react.useEffect)(function () {
|
|
113
113
|
if (previewFile) {
|
|
114
114
|
try {
|
|
115
|
-
previewFile().then(
|
|
116
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
115
|
+
previewFile().then(/*#__PURE__*/function () {
|
|
116
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(response) {
|
|
117
117
|
var res, blob, blobUrl;
|
|
118
118
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
119
119
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -166,7 +166,7 @@ var ProEditableTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
166
166
|
* @returns {Promise<{nextList: IRowDataPropsType[], list: IRowDataPropsType[], rowData: IRowDataPropsType, rowIndex: number}>}
|
|
167
167
|
*/
|
|
168
168
|
var onMultipleDelete = /*#__PURE__*/function () {
|
|
169
|
-
var _ref2 = (0, _asyncToGenerator2.default)(
|
|
169
|
+
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
170
170
|
var res, values, nextList, resetFieldsIndex;
|
|
171
171
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
172
172
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -272,7 +272,7 @@ var ProEditableTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
272
272
|
* @returns {Promise<{nextList: IRowDataPropsType[], list: IRowDataPropsType[], rowData: IRowDataPropsType, rowIndex: number}>}
|
|
273
273
|
*/
|
|
274
274
|
var onSave = /*#__PURE__*/function () {
|
|
275
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
275
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(rowIndex, callback) {
|
|
276
276
|
var _form$getFieldsValue$, _form$getFieldsValue, nextValues, res, values;
|
|
277
277
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
278
278
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -398,12 +398,12 @@ var ProEditableTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
398
398
|
}, antButtonProps), {}, {
|
|
399
399
|
children: buttonText
|
|
400
400
|
}))]
|
|
401
|
-
}) : (
|
|
401
|
+
}) : (/*#__PURE__*/(0, _react.cloneElement)(buttonText, antButtonProps))
|
|
402
402
|
}) : null
|
|
403
403
|
});
|
|
404
404
|
};
|
|
405
405
|
var validateFields = /*#__PURE__*/function () {
|
|
406
|
-
var _ref4 = (0, _asyncToGenerator2.default)(
|
|
406
|
+
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
407
407
|
var values, nextValues, nextList, isEditing;
|
|
408
408
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
409
409
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--zaui-brand : #006aff;
|
|
9
9
|
--zaui-brand-hover : #3387ff;
|
|
10
10
|
--zaui-brand-active : #005ad9;
|
|
11
|
-
--zaui-brand-disabled :
|
|
11
|
+
--zaui-brand-disabled : color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
12
12
|
--zaui-text : #343434;
|
|
13
13
|
--zaui-text-weak : #616161;
|
|
14
14
|
--zaui-aide-text : #909090;
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
--zaui-table-selected-hover-bg : var(--zaui-table-hover-bg); // 默认同悬停
|
|
56
56
|
--zaui-table-nested-bg : #fafcfe;
|
|
57
57
|
--zaui-contract-bg : #fffaa1; // 对比背景色
|
|
58
|
+
--zaui-contract-bg-add : #d2fff4; // 新增对比背景色
|
|
58
59
|
--zaui-form-label-width : 130px; // 8个全角字符宽度
|
|
59
60
|
--zaui-border-radius : 8px;
|
|
60
61
|
--zaui-border-radius-card : 4px;
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
@zaui-table-selected-hover-bg: var(--zaui-table-hover-bg #fafafa);
|
|
54
54
|
@zaui-table-nested-bg: var(--zaui-table-nested-bg #FAFCFE);
|
|
55
55
|
@zaui-contract-bg: var(--zaui-contract-bg; #fffaa1); // 对比背景色
|
|
56
|
+
@zaui-contract-bg-add: var(--zaui-contract-bg-add; #d2fff4); // 新增对比背景色
|
|
56
57
|
@zaui-form-required-after: var(--zaui-form-required-after; inline);
|
|
57
58
|
@zaui-form-required-before: var(--zaui-form-required-before; none);
|
|
58
59
|
@zaui-form-label-width: var(--zaui-form-label-width; 130px);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isEmpty = void 0;
|
|
7
|
+
var EMPTY_VALUE = [undefined, null, ''];
|
|
8
|
+
/** 判断一个值是否是空值 */
|
|
9
|
+
var isEmpty = exports.isEmpty = function isEmpty(value) {
|
|
10
|
+
if (EMPTY_VALUE.includes(value)) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
return !(value === null || value === void 0 ? void 0 : value.length) || value.every(function (item) {
|
|
15
|
+
return EMPTY_VALUE.includes(item);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0-beat.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -84,7 +84,6 @@
|
|
|
84
84
|
"@types/classnames": "^2.3.1",
|
|
85
85
|
"@types/jest": "^29.5.11",
|
|
86
86
|
"@types/lodash": "^4.14.171",
|
|
87
|
-
"@types/mockjs": "^1.0.6",
|
|
88
87
|
"@types/react": "^17.0.53",
|
|
89
88
|
"@types/react-dom": "^17.0.0",
|
|
90
89
|
"@types/react-resizable": "^1.7.4",
|
|
@@ -96,12 +95,13 @@
|
|
|
96
95
|
"@zat-design/login-react": "1.0.25",
|
|
97
96
|
"babel-eslint": "10.0.3",
|
|
98
97
|
"babel-plugin-import": "^1.13.3",
|
|
99
|
-
"commander": "
|
|
98
|
+
"commander": "9.2.0",
|
|
100
99
|
"cross-env": "^7.0.3",
|
|
101
100
|
"dumi": "^1.0.9",
|
|
102
101
|
"eslint": "7.10.0",
|
|
103
102
|
"eslint-config-za": "2.1.0",
|
|
104
103
|
"eslint-plugin-babel": "5.3.0",
|
|
104
|
+
"eslint-plugin-complexity": "^1.0.2",
|
|
105
105
|
"eslint-plugin-import": "^2.22.1",
|
|
106
106
|
"eslint-plugin-jsx-a11y": "6.2.3",
|
|
107
107
|
"eslint-plugin-react": "7.16.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"husky": "^4.0.7",
|
|
113
113
|
"jest-canvas-mock": "^2.5.2",
|
|
114
114
|
"lint-staged": "^10.0.0",
|
|
115
|
-
"mockjs": "^1.
|
|
115
|
+
"mockjs": "^1.0.0",
|
|
116
116
|
"prettier": "^2.5.0",
|
|
117
117
|
"pretty-quick": "^3.1.3",
|
|
118
118
|
"react-json-view": "^1.21.3",
|
|
@@ -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,64 +0,0 @@
|
|
|
1
|
-
import "antd/es/space/style";
|
|
2
|
-
import _Space from "antd/es/space";
|
|
3
|
-
import "antd/es/tooltip/style";
|
|
4
|
-
import _Tooltip from "antd/es/tooltip";
|
|
5
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["name", "names", "namesStr", "originalValues", "form", "equalWith", "children", "type", "originalDiffTip"];
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { get } from 'lodash';
|
|
10
|
-
import React, { useMemo } from 'react';
|
|
11
|
-
import { diffOriginal } from '../../utils/diffOriginal';
|
|
12
|
-
var Changed = function Changed(props) {
|
|
13
|
-
var name = props.name,
|
|
14
|
-
names = props.names,
|
|
15
|
-
namesStr = props.namesStr,
|
|
16
|
-
originalValues = props.originalValues,
|
|
17
|
-
form = props.form,
|
|
18
|
-
equalWith = props.equalWith,
|
|
19
|
-
children = props.children,
|
|
20
|
-
type = props.type,
|
|
21
|
-
originalDiffTip = props.originalDiffTip,
|
|
22
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
23
|
-
// 不渲染tooltip
|
|
24
|
-
var notWatch = !originalDiffTip || ['FormList', 'ProEditTable'].includes(type);
|
|
25
|
-
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
26
|
-
return get(originalValues, name);
|
|
27
|
-
}) : get(originalValues, name);
|
|
28
|
-
var noChange = !equalWith && (!originalValues || originalValue === undefined);
|
|
29
|
-
var changed = useMemo(function () {
|
|
30
|
-
if (notWatch || noChange) return false;
|
|
31
|
-
return diffOriginal({
|
|
32
|
-
originalValue: originalValue,
|
|
33
|
-
value: props.value,
|
|
34
|
-
form: form,
|
|
35
|
-
equalWith: equalWith
|
|
36
|
-
// name: namesStr || name,
|
|
37
|
-
});
|
|
38
|
-
}, [notWatch, noChange, props.value, originalValue]);
|
|
39
|
-
var tipContent = useMemo(function () {
|
|
40
|
-
if (notWatch || noChange) return undefined;
|
|
41
|
-
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, {
|
|
42
|
-
isView: true,
|
|
43
|
-
value: originalValue,
|
|
44
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
45
|
-
})) : undefined;
|
|
46
|
-
}, [originalValue, children]);
|
|
47
|
-
if (notWatch || noChange) {
|
|
48
|
-
return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest));
|
|
49
|
-
}
|
|
50
|
-
return _jsx(_Tooltip, {
|
|
51
|
-
open: changed ? undefined : false,
|
|
52
|
-
getPopupContainer: function getPopupContainer(target) {
|
|
53
|
-
return target.parentElement;
|
|
54
|
-
},
|
|
55
|
-
title: _jsxs(_Space, {
|
|
56
|
-
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
57
|
-
}),
|
|
58
|
-
children: _jsx("div", {
|
|
59
|
-
className: changed ? 'pro-form-item-changed' : '',
|
|
60
|
-
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest)) : undefined
|
|
61
|
-
})
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
export default Changed;
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|