@zat-design/sisyphus-react 3.9.3 → 3.9.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/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 +42 -1
- package/dist/less.esm.css +38 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +20 -11
- package/es/ProEditTable/components/RenderField/index.js +42 -32
- package/es/ProEditTable/propsType.d.ts +1 -0
- package/es/ProEditTable/style/index.less +41 -0
- package/es/ProEditTable/utils/diffOriginal.d.ts +21 -0
- package/es/ProEditTable/utils/diffOriginal.js +62 -0
- package/es/ProEnum/index.js +1 -1
- package/es/ProForm/components/combination/Group/utils.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +11 -5
- package/es/ProForm/components/render/ChangedWrapper.js +14 -10
- package/es/ProForm/style/index.less +8 -0
- package/es/ProForm/utils/useShouldUpdate.js +10 -2
- package/es/ProStep/components/Item/index.js +13 -4
- package/es/ProTable/components/FormatColumn/index.js +16 -5
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -32
- package/es/ProTable/index.js +22 -15
- package/es/ProTable/propsType.d.ts +3 -2
- package/es/style/theme/antd.less +4 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +20 -11
- package/lib/ProEditTable/components/RenderField/index.js +42 -32
- package/lib/ProEditTable/propsType.d.ts +1 -0
- package/lib/ProEditTable/style/index.less +41 -0
- package/lib/ProEditTable/utils/diffOriginal.d.ts +21 -0
- package/lib/ProEditTable/utils/diffOriginal.js +68 -0
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +10 -4
- package/lib/ProForm/components/render/ChangedWrapper.js +14 -10
- package/lib/ProForm/style/index.less +8 -0
- package/lib/ProForm/utils/useShouldUpdate.js +10 -2
- package/lib/ProStep/components/Item/index.js +13 -4
- package/lib/ProTable/components/FormatColumn/index.js +16 -5
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -32
- package/lib/ProTable/index.js +22 -15
- package/lib/ProTable/propsType.d.ts +3 -2
- package/lib/style/theme/antd.less +4 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -111,6 +111,12 @@ var ProCascader = function ProCascader(props) {
|
|
111
111
|
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
112
112
|
return result;
|
113
113
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
114
|
+
var lastDisabled = (0, _react.useMemo)(function () {
|
115
|
+
if ((0, _lodash.isBoolean)(disabled) || disabled === undefined) {
|
116
|
+
return [disabled, disabled];
|
117
|
+
}
|
118
|
+
return disabled;
|
119
|
+
}, [disabled]);
|
114
120
|
var _useRequest = (0, _objectSpread3.default)({}, useRequest),
|
115
121
|
service = _useRequest.service,
|
116
122
|
_useRequest$defaultPa = _useRequest.defaultParams,
|
@@ -268,7 +274,7 @@ var ProCascader = function ProCascader(props) {
|
|
268
274
|
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar = _locale.default.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
|
269
275
|
value: addressValue,
|
270
276
|
options: service ? serviceData : realDataSource,
|
271
|
-
disabled:
|
277
|
+
disabled: lastDisabled[0],
|
272
278
|
displayRender: displayRender,
|
273
279
|
showSearch: {
|
274
280
|
filter: handlefilter,
|
@@ -278,19 +284,19 @@ var ProCascader = function ProCascader(props) {
|
|
278
284
|
getPopupContainer: function getPopupContainer(trigger) {
|
279
285
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
280
286
|
}
|
281
|
-
}, (0, _lodash.omit)(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip &&
|
287
|
+
}, (0, _lodash.omit)(otherProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip && lastDisabled[1] && detail ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
282
288
|
title: detail,
|
283
289
|
children: (0, _jsxRuntime.jsx)("span", {
|
284
290
|
className: "pro-address-detail",
|
285
291
|
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
286
|
-
disabled:
|
292
|
+
disabled: lastDisabled[1],
|
287
293
|
value: detail
|
288
294
|
})
|
289
295
|
})
|
290
296
|
}) : (0, _jsxRuntime.jsx)(_antd.Input, {
|
291
297
|
allowClear: true,
|
292
298
|
autoComplete: "off",
|
293
|
-
disabled:
|
299
|
+
disabled: lastDisabled[1],
|
294
300
|
value: detail,
|
295
301
|
maxLength: detailMaxLength,
|
296
302
|
placeholder: detailPlaceholder || (_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar2 = _locale.default.ProAddressBar) === null || _locale$ProAddressBar2 === void 0 ? void 0 : _locale$ProAddressBar2.detailPlaceholder),
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.default = void 0;
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
11
|
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
@@ -52,9 +53,15 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
52
53
|
if (!isWatch || noChange) return 'same';
|
53
54
|
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
54
55
|
: props[valuePropName];
|
56
|
+
// fix:修复 DatePicker时,originalValue与最新值一致时,显示为 changed的问题
|
57
|
+
var _originalValue = normalize && ['DatePicker'].includes(props.type) ? normalize(originalValue, undefined, undefined, true) : originalValue;
|
58
|
+
// fix:修复 InputNumber 时,originalValue与最新值一致都为'0'时,显示为 changed的问题
|
59
|
+
if (['InputNumber'].includes(props.type) && normalize && _value === Number(originalValue)) {
|
60
|
+
return 'same';
|
61
|
+
}
|
55
62
|
return (0, _diffOriginal.diffOriginal)({
|
56
|
-
originalValue: originalValue,
|
57
63
|
value: _value,
|
64
|
+
originalValue: _originalValue,
|
58
65
|
form: form,
|
59
66
|
equalWith: equalWith
|
60
67
|
// name: namesStr || name,
|
@@ -62,23 +69,20 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
62
69
|
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
63
70
|
var isAdd = diffType === 'add';
|
64
71
|
var isChanged = diffType === 'changed';
|
65
|
-
var viewRenderFun = (0, _react.useMemo)(function () {
|
66
|
-
return function (orgValue) {
|
67
|
-
return viewRender(orgValue, originalValues, {
|
68
|
-
form: form
|
69
|
-
});
|
70
|
-
};
|
71
|
-
}, [form]);
|
72
72
|
var tipContent = (0, _react.useMemo)(function () {
|
73
73
|
if (!isWatch || noChange) return undefined;
|
74
74
|
var valueProps = getValueProps && !names ? getValueProps(originalValue) : {
|
75
75
|
value: originalValue
|
76
76
|
};
|
77
|
-
if (viewRender)
|
77
|
+
if (viewRender) {
|
78
|
+
return viewRender(valueProps === null || valueProps === void 0 ? void 0 : valueProps.value, originalValues, {
|
79
|
+
form: form
|
80
|
+
});
|
81
|
+
}
|
78
82
|
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
|
79
83
|
isView: true
|
80
84
|
}, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
|
81
|
-
}, [originalValue, children]);
|
85
|
+
}, [(0, _typeof2.default)(viewRender), originalValue, children]);
|
82
86
|
if (!isWatch || noChange) {
|
83
87
|
// 嵌套子组件
|
84
88
|
var isNestedField = ['ProEditTable'].includes(type);
|
@@ -341,6 +341,10 @@
|
|
341
341
|
background: @zaui-contract-bg !important;
|
342
342
|
}
|
343
343
|
|
344
|
+
.ant-picker-clear {
|
345
|
+
background: @zaui-contract-bg;
|
346
|
+
}
|
347
|
+
|
344
348
|
span.@{ant-prefix}-input-affix-wrapper,
|
345
349
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
346
350
|
.@{ant-prefix}-picker,
|
@@ -419,6 +423,10 @@
|
|
419
423
|
background: @zaui-contract-bg-add !important;
|
420
424
|
}
|
421
425
|
|
426
|
+
.ant-picker-clear {
|
427
|
+
background: @zaui-contract-bg-add;
|
428
|
+
}
|
429
|
+
|
422
430
|
span.@{ant-prefix}-input-affix-wrapper,
|
423
431
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
424
432
|
.@{ant-prefix}-picker,
|
@@ -9,6 +9,14 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
9
9
|
var _react = require("react");
|
10
10
|
var _lodash = require("lodash");
|
11
11
|
var _index = require("./index");
|
12
|
+
/** FormList中被删除的行也会再触发一次响应式函数 排除这种场景 */
|
13
|
+
var isDeleteLine = function isDeleteLine(form, namePath) {
|
14
|
+
if (namePath) {
|
15
|
+
var line = form.getFieldValue(namePath);
|
16
|
+
return line === undefined;
|
17
|
+
}
|
18
|
+
return false;
|
19
|
+
};
|
12
20
|
// 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
|
13
21
|
var useShouldUpdate = function useShouldUpdate(props) {
|
14
22
|
var show = props.show,
|
@@ -71,7 +79,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
71
79
|
}
|
72
80
|
if ((0, _lodash.isFunction)(disabled)) {
|
73
81
|
// RangePicker返回数组时,特殊处理
|
74
|
-
if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
|
82
|
+
if (['Group', 'RangePicker', 'ProCascader'].includes(type) && Array.isArray(disabled(values, {
|
75
83
|
form: form,
|
76
84
|
index: index,
|
77
85
|
namePath: namePath
|
@@ -176,7 +184,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
176
184
|
namePath: namePath
|
177
185
|
}) : fieldProps;
|
178
186
|
// 清值防抖 多次刷新时以最后一次为准
|
179
|
-
if (clearNotShow !== false && (name || names)) {
|
187
|
+
if (clearNotShow !== false && (name || names) && !isDeleteLine(form, namePath)) {
|
180
188
|
// 当show为其他变为false的时候记录一次需要清值
|
181
189
|
if (_show !== showRef.current && _show === false) {
|
182
190
|
needClear.current = true;
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
11
|
+
var _react = require("react");
|
11
12
|
var _index = require("../../index");
|
12
13
|
var _ProCollapse = _interopRequireDefault(require("../../../ProLayout/components/ProCollapse"));
|
13
14
|
var _excluded = ["id", "title", "collapse", "children"];
|
@@ -21,10 +22,18 @@ var _default = exports.default = function _default(_ref) {
|
|
21
22
|
var _useStep = (0, _index.useStep)(),
|
22
23
|
register = _useStep.register,
|
23
24
|
collapse = _useStep.collapse;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
(0, _react.useEffect)(function () {
|
26
|
+
// 子组件更新父组件 延迟状态更新,避免重渲染
|
27
|
+
var timeoutId = setTimeout(function () {
|
28
|
+
register === null || register === void 0 ? void 0 : register((0, _objectSpread2.default)((0, _objectSpread2.default)({}, restProps), {}, {
|
29
|
+
title: title,
|
30
|
+
id: id
|
31
|
+
}));
|
32
|
+
}, 0);
|
33
|
+
return function () {
|
34
|
+
return clearTimeout(timeoutId);
|
35
|
+
};
|
36
|
+
}, [register]);
|
28
37
|
return (0, _jsxRuntime.jsx)("div", {
|
29
38
|
className: "pro-step-item",
|
30
39
|
id: id,
|
@@ -129,11 +129,13 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
|
|
129
129
|
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : null;
|
130
130
|
var originalResult = (0, _utils2.getOriginalValue)(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
|
131
131
|
var originalValue = originalResult.originalValue;
|
132
|
+
var _originalValue = originalValue;
|
132
133
|
var isChanged = originalResult.isChanged,
|
133
134
|
isAddCell = originalResult.isAddCell;
|
134
135
|
var isInNewRowFlag = isInNewRow(record);
|
135
136
|
var _isAddCell = isAddCell;
|
136
137
|
otherProps.isChanged = isChanged;
|
138
|
+
var nextValue = value;
|
137
139
|
// 存在比对
|
138
140
|
if ((0, _lodash.isFunction)(otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewRender) && (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalDataSource)) {
|
139
141
|
var _originalObj$record$r;
|
@@ -145,25 +147,34 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
|
|
145
147
|
index: index
|
146
148
|
});
|
147
149
|
// viewRender 返回值为 false 时,不显示对比
|
148
|
-
if ((0, _lodash.isBoolean)(diffResult)) {
|
150
|
+
if ((0, _lodash.isBoolean)(diffResult) && !diffResult) {
|
149
151
|
otherProps.isChanged = false;
|
150
152
|
}
|
151
|
-
|
153
|
+
_originalValue = diffResult;
|
154
|
+
nextValue = otherProps.viewRender({
|
155
|
+
originalValue: value,
|
156
|
+
originalRecord: record !== null && record !== void 0 ? record : {},
|
157
|
+
value: value,
|
158
|
+
record: record,
|
159
|
+
index: index
|
160
|
+
});
|
152
161
|
}
|
153
162
|
// 存在自定义onDiff比对
|
154
163
|
if ((0, _lodash.isFunction)(onDiff)) {
|
155
164
|
var _originalObj$record$r2;
|
156
165
|
var _diffResult = onDiff({
|
157
|
-
originalValue:
|
166
|
+
originalValue: _originalValue,
|
158
167
|
originalRecord: (_originalObj$record$r2 = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r2 !== void 0 ? _originalObj$record$r2 : {},
|
159
|
-
value:
|
168
|
+
value: nextValue,
|
160
169
|
record: record,
|
161
170
|
index: index
|
162
171
|
});
|
163
172
|
if (_diffResult === 'changed') {
|
173
|
+
_isAddCell = false;
|
164
174
|
otherProps.isChanged = true;
|
165
175
|
}
|
166
176
|
if (_diffResult === 'same') {
|
177
|
+
_isAddCell = false;
|
167
178
|
otherProps.isChanged = false;
|
168
179
|
}
|
169
180
|
if (_diffResult === 'add') {
|
@@ -173,7 +184,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
|
|
173
184
|
}
|
174
185
|
return (0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
175
186
|
valueType: valueType,
|
176
|
-
originalValue: (0, _utils3.isEmpty)(
|
187
|
+
originalValue: (0, _utils3.isEmpty)(_originalValue) ? null : _originalValue,
|
177
188
|
ellipsis: ellipsis,
|
178
189
|
width: width,
|
179
190
|
value: _value,
|
package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js
CHANGED
@@ -113,7 +113,7 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
113
113
|
}();
|
114
114
|
var onDragEnd = /*#__PURE__*/function () {
|
115
115
|
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
|
116
|
-
var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
|
116
|
+
var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
|
117
117
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
118
118
|
while (1) switch (_context2.prev = _context2.next) {
|
119
119
|
case 0:
|
@@ -121,7 +121,7 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
121
121
|
// 为数据源划分层级及parentId
|
122
122
|
transformedValue = (0, _index.addLevelAndParentId)(value, rowKey); // 同一level层级的且parentId相同的,可以互相之间拖拽替换
|
123
123
|
if (!(active.id !== (over === null || over === void 0 ? void 0 : over.id))) {
|
124
|
-
_context2.next =
|
124
|
+
_context2.next = 20;
|
125
125
|
break;
|
126
126
|
}
|
127
127
|
activeObject = (0, _index.treeNodeFind)(transformedValue, function (t) {
|
@@ -131,47 +131,51 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
131
131
|
return t.rowKey === (over === null || over === void 0 ? void 0 : over.id);
|
132
132
|
});
|
133
133
|
if (!(activeObject && overObject)) {
|
134
|
-
_context2.next =
|
134
|
+
_context2.next = 20;
|
135
135
|
break;
|
136
136
|
}
|
137
137
|
activeLevel = activeObject.level, activeParentId = activeObject.parentId;
|
138
|
-
overLevel = overObject.level, overParentId = overObject.parentId;
|
138
|
+
overLevel = overObject.level, overParentId = overObject.parentId;
|
139
|
+
nextDataSource = value;
|
140
|
+
if (!(activeLevel === overLevel && activeParentId === overParentId)) {
|
141
|
+
_context2.next = 20;
|
142
|
+
break;
|
143
|
+
}
|
144
|
+
// 将树平铺
|
145
|
+
_flatTree = (0, _index.transformTreeToArray)(transformedValue).map(function (item) {
|
146
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
147
|
+
children: undefined
|
148
|
+
});
|
149
|
+
});
|
150
|
+
activeIndex = _flatTree.findIndex(function (i) {
|
151
|
+
return i.rowKey === active.id;
|
152
|
+
});
|
153
|
+
overIndex = _flatTree.findIndex(function (i) {
|
154
|
+
return i.rowKey === (over === null || over === void 0 ? void 0 : over.id);
|
155
|
+
});
|
156
|
+
nextValue = (0, _sortable.arrayMove)(_flatTree, activeIndex, overIndex);
|
157
|
+
nextDataSource = (0, _index.createTreeFromArray)(nextValue, {
|
158
|
+
itemKey: 'rowKey',
|
159
|
+
parentKey: 'parentId',
|
160
|
+
childrenKey: 'children'
|
161
|
+
});
|
162
|
+
// 如果传了onDragEndGuard 则视为外部业务逻辑自处理
|
139
163
|
if (!(onDragEndGuard && (0, _lodash.isFunction)(onDragEndGuard))) {
|
140
|
-
_context2.next =
|
164
|
+
_context2.next = 19;
|
141
165
|
break;
|
142
166
|
}
|
143
|
-
_context2.next =
|
167
|
+
_context2.next = 18;
|
144
168
|
return onDragEndGuard({
|
145
169
|
activeObject: activeObject,
|
146
170
|
overObject: overObject,
|
147
|
-
|
171
|
+
originDataSource: value,
|
172
|
+
currentDataSource: nextDataSource
|
148
173
|
});
|
149
|
-
case
|
174
|
+
case 18:
|
150
175
|
nextDataSource = _context2.sent;
|
151
|
-
|
152
|
-
|
153
|
-
case
|
154
|
-
if (activeLevel === overLevel && activeParentId === overParentId) {
|
155
|
-
// 将树平铺
|
156
|
-
_flatTree = (0, _index.transformTreeToArray)(transformedValue).map(function (item) {
|
157
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
158
|
-
children: undefined
|
159
|
-
});
|
160
|
-
});
|
161
|
-
activeIndex = _flatTree.findIndex(function (i) {
|
162
|
-
return i.rowKey === active.id;
|
163
|
-
});
|
164
|
-
overIndex = _flatTree.findIndex(function (i) {
|
165
|
-
return i.rowKey === (over === null || over === void 0 ? void 0 : over.id);
|
166
|
-
});
|
167
|
-
nextValue = (0, _sortable.arrayMove)(_flatTree, activeIndex, overIndex);
|
168
|
-
onChange((0, _index.createTreeFromArray)(nextValue, {
|
169
|
-
itemKey: 'rowKey',
|
170
|
-
parentKey: 'parentId',
|
171
|
-
childrenKey: 'children'
|
172
|
-
}));
|
173
|
-
}
|
174
|
-
case 15:
|
176
|
+
case 19:
|
177
|
+
onChange((_nextDataSource = nextDataSource) !== null && _nextDataSource !== void 0 ? _nextDataSource : []);
|
178
|
+
case 20:
|
175
179
|
case "end":
|
176
180
|
return _context2.stop();
|
177
181
|
}
|
package/lib/ProTable/index.js
CHANGED
@@ -194,6 +194,26 @@ var ProTable = function ProTable(props) {
|
|
194
194
|
return 'new-cell';
|
195
195
|
}
|
196
196
|
};
|
197
|
+
var _formatColumns = function formatColumns(nextColumns) {
|
198
|
+
nextColumns === null || nextColumns === void 0 ? void 0 : nextColumns.forEach(function (item, index) {
|
199
|
+
(0, _FormatColumn.formatColumn)({
|
200
|
+
column: item,
|
201
|
+
originalObj: originalObj,
|
202
|
+
rowKey: props.rowKey,
|
203
|
+
diffConfig: diffConfig,
|
204
|
+
wrapToolTipProps: wrapToolTipProps,
|
205
|
+
scroll: _scroll,
|
206
|
+
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
207
|
+
curColumns[index].minWidth = w;
|
208
|
+
},
|
209
|
+
isInNewRow: _rowClassName
|
210
|
+
});
|
211
|
+
if (item.children && Array.isArray(item.children)) {
|
212
|
+
_formatColumns(item.children);
|
213
|
+
}
|
214
|
+
});
|
215
|
+
return nextColumns;
|
216
|
+
};
|
197
217
|
var columns = (0, _react.useMemo)(function () {
|
198
218
|
var newColumns = curColumns.map(function (item, index) {
|
199
219
|
var _propsColumnObj$getCo2;
|
@@ -215,21 +235,8 @@ var ProTable = function ProTable(props) {
|
|
215
235
|
}).filter(function (item) {
|
216
236
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
217
237
|
});
|
218
|
-
|
219
|
-
|
220
|
-
column: item,
|
221
|
-
originalObj: originalObj,
|
222
|
-
rowKey: props.rowKey,
|
223
|
-
diffConfig: diffConfig,
|
224
|
-
wrapToolTipProps: wrapToolTipProps,
|
225
|
-
scroll: _scroll,
|
226
|
-
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
227
|
-
curColumns[index].minWidth = w;
|
228
|
-
},
|
229
|
-
isInNewRow: _rowClassName
|
230
|
-
});
|
231
|
-
});
|
232
|
-
return newColumns;
|
238
|
+
var nextColumns = _formatColumns(newColumns);
|
239
|
+
return nextColumns;
|
233
240
|
}, [curColumns, handleResize, _scroll, originalDataSource, originalObj, _rowClassName]);
|
234
241
|
var _columns = (0, _react.useMemo)(function () {
|
235
242
|
return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
|
@@ -19,7 +19,7 @@ export interface ProTableSummaryProps {
|
|
19
19
|
fixed?: boolean;
|
20
20
|
}
|
21
21
|
export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
22
|
-
dataIndex
|
22
|
+
dataIndex?: string | string[];
|
23
23
|
width?: number | string;
|
24
24
|
minWidth?: number;
|
25
25
|
valueType?: ProTableValueType;
|
@@ -43,8 +43,9 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
43
43
|
/** 自定义比对函数, 触发条件必须写render */
|
44
44
|
onDiff?: ({ value, record, index, originalValue, originalRecord }: any) => any;
|
45
45
|
/** 自定义提示render, 触发条件必须写render */
|
46
|
-
viewRender?: ({ value, record, index, originalValue, originalRecord }: any) => 'same' | 'changed' | 'add' | undefined;
|
46
|
+
viewRender?: ({ value, record, index, originalValue, originalRecord, }: any) => 'same' | 'changed' | 'add' | undefined;
|
47
47
|
isChanged?: boolean | null;
|
48
|
+
children?: ProTableColumn[];
|
48
49
|
}
|
49
50
|
export interface CreateTreeFromArrayOptions {
|
50
51
|
itemKey?: string;
|
@@ -753,6 +753,9 @@
|
|
753
753
|
}
|
754
754
|
|
755
755
|
.@{ant-prefix}-picker.@{ant-prefix}-picker-disabled {
|
756
|
-
background: var(--zaui-disabled-bg);
|
756
|
+
background: var(--zaui-disabled-bg) !important;
|
757
757
|
}
|
758
758
|
|
759
|
+
.@{ant-prefix}-input-affix-wrapper-disabled {
|
760
|
+
background: var(--zaui-disabled-bg) !important;
|
761
|
+
}
|
package/package.json
CHANGED