@zat-design/sisyphus-react 3.6.9-beta.6 → 3.6.10-beta.1
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 -26
- package/es/ProForm/components/combination/ProCascader/index.js +14 -8
- package/es/ProForm/components/render/Render.js +39 -25
- 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/index.d.ts +0 -6
- package/es/ProForm/utils/index.js +8 -57
- package/es/ProForm/utils/useChanged.js +2 -1
- package/es/ProForm/utils/useListChanged.js +3 -3
- package/es/ProTable/components/FormatColumn/index.js +16 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +6 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +176 -40
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +20 -1
- package/es/ProTable/index.js +12 -2
- package/es/ProTable/propsType.d.ts +29 -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 -25
- package/lib/ProForm/components/combination/ProCascader/index.js +12 -6
- package/lib/ProForm/components/render/Render.js +37 -25
- 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/index.d.ts +0 -6
- package/lib/ProForm/utils/index.js +8 -59
- package/lib/ProForm/utils/useChanged.js +2 -1
- package/lib/ProForm/utils/useListChanged.js +2 -2
- package/lib/ProTable/components/FormatColumn/index.js +16 -0
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +6 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +176 -40
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +19 -1
- package/lib/ProTable/index.js +12 -2
- package/lib/ProTable/propsType.d.ts +29 -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
|
@@ -11,6 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
var _antd = require("antd");
|
|
@@ -23,10 +24,10 @@ var _index = require("../../utils/index");
|
|
|
23
24
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
24
25
|
var _transformNames = _interopRequireDefault(require("../../utils/transformNames"));
|
|
25
26
|
var _valueType = _interopRequireDefault(require("../../utils/valueType"));
|
|
27
|
+
var _useChanged3 = require("../../utils/useChanged");
|
|
26
28
|
var _tip = _interopRequireDefault(require("../../../assets/tip.svg"));
|
|
27
29
|
var _useRules = _interopRequireDefault(require("../../utils/useRules"));
|
|
28
30
|
var _ConfirmWrapper = _interopRequireDefault(require("./ConfirmWrapper"));
|
|
29
|
-
var _Changed = _interopRequireDefault(require("./Changed"));
|
|
30
31
|
var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className", "rules", "required", "labelRequired", "tooltip"];
|
|
31
32
|
/* eslint-disable prefer-destructuring */
|
|
32
33
|
// 这个组件只管渲染, 参数的整理在外部处理
|
|
@@ -98,6 +99,18 @@ var Render = function Render(props) {
|
|
|
98
99
|
return Array.isArray(name) ? name.join('_') : name;
|
|
99
100
|
}).join('-');
|
|
100
101
|
}, [otherProps === null || otherProps === void 0 ? void 0 : otherProps.names]);
|
|
102
|
+
// 判断当前字段是否变更
|
|
103
|
+
var _useChanged = (0, _useChanged3.useChanged)({
|
|
104
|
+
name: formItemProps.name,
|
|
105
|
+
names: otherProps.names,
|
|
106
|
+
namesStr: namesStr,
|
|
107
|
+
originalValues: originalValues,
|
|
108
|
+
form: form,
|
|
109
|
+
equalWith: equalWith
|
|
110
|
+
}),
|
|
111
|
+
_useChanged2 = (0, _slicedToArray2.default)(_useChanged, 2),
|
|
112
|
+
changed = _useChanged2[0],
|
|
113
|
+
originalValue = _useChanged2[1];
|
|
101
114
|
var internalRule = (0, _useRules.default)({
|
|
102
115
|
names: otherProps.names,
|
|
103
116
|
label: otherFormItemProps.label,
|
|
@@ -169,7 +182,7 @@ var Render = function Render(props) {
|
|
|
169
182
|
var lastComponentProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, componentProps), _fieldProps), {}, {
|
|
170
183
|
disabled: lastDisabled
|
|
171
184
|
});
|
|
172
|
-
var _className = (0, _classnames.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, className, className), 'pro-form-item-width-auto', ['Switch'].includes(type)));
|
|
185
|
+
var _className = (0, _classnames.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, className, className), 'pro-form-item-changed', changed), 'pro-form-item-width-auto', ['Switch'].includes(type)));
|
|
173
186
|
if (formItemProps.hidden === true || _show === false) {
|
|
174
187
|
// 为了监听shouldUpdate 必须存在一个FormItem, 空Input解决 【[antd: Form.Item] `name` is only used for validate React element】
|
|
175
188
|
return (0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
@@ -431,17 +444,7 @@ var Render = function Render(props) {
|
|
|
431
444
|
// @ts-ignore
|
|
432
445
|
_internalItemRender: internalItemRender,
|
|
433
446
|
className: _className,
|
|
434
|
-
children:
|
|
435
|
-
name: formItemProps.name,
|
|
436
|
-
names: otherProps.names,
|
|
437
|
-
namesStr: namesStr,
|
|
438
|
-
originalValues: originalValues,
|
|
439
|
-
form: form,
|
|
440
|
-
equalWith: equalWith,
|
|
441
|
-
originalDiffTip: originalDiffTip,
|
|
442
|
-
type: type,
|
|
443
|
-
children: child
|
|
444
|
-
})
|
|
447
|
+
children: child
|
|
445
448
|
}));
|
|
446
449
|
var formItem = orgFormItem;
|
|
447
450
|
// 当存在shouldUpdate时捕获所有form变更(防止表单onchange设置form值时无法更新的问题)
|
|
@@ -457,23 +460,32 @@ var Render = function Render(props) {
|
|
|
457
460
|
// @ts-ignore
|
|
458
461
|
_internalItemRender: internalItemRender,
|
|
459
462
|
className: _className,
|
|
460
|
-
children:
|
|
461
|
-
name: formItemProps.name,
|
|
462
|
-
names: otherProps.names,
|
|
463
|
-
namesStr: namesStr,
|
|
464
|
-
originalValues: originalValues,
|
|
465
|
-
form: form,
|
|
466
|
-
equalWith: equalWith,
|
|
467
|
-
originalDiffTip: originalDiffTip,
|
|
468
|
-
type: type,
|
|
469
|
-
children: child
|
|
470
|
-
})
|
|
463
|
+
children: child
|
|
471
464
|
}));
|
|
472
465
|
}
|
|
473
466
|
})
|
|
474
467
|
});
|
|
475
468
|
}
|
|
476
|
-
|
|
469
|
+
// 不渲染tooltip
|
|
470
|
+
if (!originalDiffTip || ['FormList', 'ProEditTable'].includes(type)) {
|
|
471
|
+
return formItem;
|
|
472
|
+
}
|
|
473
|
+
var title = (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
474
|
+
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.cloneElement(child, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, child), {}, {
|
|
475
|
+
isView: true,
|
|
476
|
+
value: originalValue,
|
|
477
|
+
checked: type === 'Switch' ? originalValue : undefined
|
|
478
|
+
}))]
|
|
479
|
+
});
|
|
480
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
481
|
+
title: title,
|
|
482
|
+
open: changed ? undefined : false,
|
|
483
|
+
// open={true}
|
|
484
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
485
|
+
return target.parentElement;
|
|
486
|
+
},
|
|
487
|
+
children: formItem
|
|
488
|
+
});
|
|
477
489
|
};
|
|
478
490
|
var FormItem = (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
479
491
|
children: [renderItem(), (otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$names2 = otherProps.names) === null || _otherProps$names2 === void 0 ? void 0 : _otherProps$names2.length) ? otherProps.names.map(function (name) {
|
|
@@ -116,6 +116,58 @@
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// 比较原始值场景下 不同时的样式
|
|
120
|
+
&.pro-form-item-changed {
|
|
121
|
+
span.@{ant-prefix}-input-affix-wrapper,
|
|
122
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
|
123
|
+
.@{ant-prefix}-picker,
|
|
124
|
+
.@{ant-prefix}-input-number {
|
|
125
|
+
background: @zaui-contract-bg !important;
|
|
126
|
+
|
|
127
|
+
input {
|
|
128
|
+
background: transparent;
|
|
129
|
+
}
|
|
130
|
+
.@{ant-prefix}-select-selection-placeholder {
|
|
131
|
+
z-index: 9;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.@{ant-prefix}-form-item-control:has(.@{ant-prefix}-switch-handle),
|
|
136
|
+
.@{ant-prefix}-form-item-control:has(.@{ant-prefix}-checkbox-wrapper-in-form-item) {
|
|
137
|
+
background: @zaui-contract-bg;
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 地址组件
|
|
142
|
+
.@{ant-prefix}-form-item-control-input-content {
|
|
143
|
+
// 查看模式
|
|
144
|
+
& > span {
|
|
145
|
+
border-radius: 4px;
|
|
146
|
+
padding: 5px 8px;
|
|
147
|
+
background: @zaui-contract-bg;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
& > .pro-address {
|
|
151
|
+
.@{ant-prefix}-select-selector,
|
|
152
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
153
|
+
.@{ant-prefix}-input-disabled {
|
|
154
|
+
background: @zaui-contract-bg;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
& > .@{ant-prefix}-input-group {
|
|
158
|
+
.forever-checkbox {
|
|
159
|
+
background: @zaui-contract-bg;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.pro-form-view-container {
|
|
165
|
+
padding: 4px 8px;
|
|
166
|
+
background: @zaui-contract-bg;
|
|
167
|
+
border-radius: 4px;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
119
171
|
.@{ant-prefix}-row {
|
|
120
172
|
width: 100%;
|
|
121
173
|
}
|
|
@@ -321,56 +373,4 @@
|
|
|
321
373
|
}
|
|
322
374
|
}
|
|
323
375
|
}
|
|
324
|
-
|
|
325
|
-
// 比较原始值场景下 不同时的样式
|
|
326
|
-
.pro-form-item-changed {
|
|
327
|
-
span.@{ant-prefix}-input-affix-wrapper,
|
|
328
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
|
329
|
-
.@{ant-prefix}-picker,
|
|
330
|
-
.@{ant-prefix}-input-number {
|
|
331
|
-
background: @zaui-contract-bg !important;
|
|
332
|
-
|
|
333
|
-
input {
|
|
334
|
-
background: transparent !important;
|
|
335
|
-
}
|
|
336
|
-
.@{ant-prefix}-select-selection-placeholder {
|
|
337
|
-
z-index: 9;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.@{ant-prefix}-form-item-control:has(.@{ant-prefix}-switch-handle),
|
|
342
|
-
.@{ant-prefix}-form-item-control:has(.@{ant-prefix}-checkbox-wrapper-in-form-item) {
|
|
343
|
-
background: @zaui-contract-bg;
|
|
344
|
-
border-radius: 4px;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// 地址组件
|
|
348
|
-
.@{ant-prefix}-form-item-control-input-content {
|
|
349
|
-
// 查看模式
|
|
350
|
-
& > span {
|
|
351
|
-
border-radius: 4px;
|
|
352
|
-
padding: 5px 8px;
|
|
353
|
-
background: @zaui-contract-bg;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
& > .pro-address {
|
|
357
|
-
.@{ant-prefix}-select-selector,
|
|
358
|
-
.@{ant-prefix}-input-affix-wrapper,
|
|
359
|
-
.@{ant-prefix}-input-disabled {
|
|
360
|
-
background: @zaui-contract-bg;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
& > .@{ant-prefix}-input-group {
|
|
364
|
-
.forever-checkbox {
|
|
365
|
-
background: @zaui-contract-bg;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.pro-form-view-container {
|
|
371
|
-
padding: 4px 8px;
|
|
372
|
-
background: @zaui-contract-bg;
|
|
373
|
-
border-radius: 4px;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
376
|
}
|
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.diffOriginal = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
9
|
var _lodash = require("lodash");
|
|
8
10
|
var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
|
|
11
|
+
/** 将解构后的name值,反向转回names,例如 formData {a:1, b:2} names ['a', 'b'] 返回 [1,2] */
|
|
12
|
+
var extractValues = function extractValues(form, pathString) {
|
|
13
|
+
var _pathString;
|
|
14
|
+
var result = [];
|
|
15
|
+
var PrefixesName = (0, _lodash.isString)(pathString) ? [] : pathString.slice(0, -1);
|
|
16
|
+
if ((0, _lodash.isString)(pathString)) {
|
|
17
|
+
pathString.split('-').forEach(function (item) {
|
|
18
|
+
result.push(form.getFieldValue([].concat((0, _toConsumableArray2.default)(PrefixesName), [item])));
|
|
19
|
+
});
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
(_pathString = pathString[pathString.length - 1]) === null || _pathString === void 0 ? void 0 : _pathString.split('-').forEach(function (item) {
|
|
23
|
+
result.push(form.getFieldValue([].concat((0, _toConsumableArray2.default)(PrefixesName), [item])));
|
|
24
|
+
});
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
9
27
|
var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
|
|
28
|
+
var _name$join;
|
|
10
29
|
var originalValue = params.originalValue,
|
|
11
|
-
|
|
12
|
-
equalWith = params.equalWith
|
|
30
|
+
_value = params.value,
|
|
31
|
+
equalWith = params.equalWith,
|
|
32
|
+
form = params.form,
|
|
33
|
+
name = params.name;
|
|
34
|
+
var isNames = Array.isArray(name) && ((_name$join = name.join(',')) === null || _name$join === void 0 ? void 0 : _name$join.includes('-')) || (name === null || name === void 0 ? void 0 : name.includes('-'));
|
|
35
|
+
var value = !isNames ? _value : extractValues(form, name);
|
|
13
36
|
// 支持传入自定义比较事件
|
|
14
37
|
if ((0, _lodash.isFunction)(equalWith)) {
|
|
15
38
|
return !equalWith(originalValue, value);
|
|
@@ -24,7 +47,8 @@ var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
|
|
|
24
47
|
});
|
|
25
48
|
}
|
|
26
49
|
if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
|
|
27
|
-
|
|
50
|
+
var res = !(0, _lodash.isEqual)(value, originalValue);
|
|
51
|
+
return res;
|
|
28
52
|
}
|
|
29
53
|
return false;
|
|
30
54
|
};
|
|
@@ -50,12 +50,6 @@ export declare const isNullArray: (arr: any) => boolean;
|
|
|
50
50
|
*/
|
|
51
51
|
export declare const isEmptyArray: (arr: any) => boolean;
|
|
52
52
|
export declare function toArray<T>(value?: T | T[] | null): T[];
|
|
53
|
-
/**
|
|
54
|
-
* names值合并
|
|
55
|
-
* @param obj AnyObject
|
|
56
|
-
* @returns AnyObject
|
|
57
|
-
*/
|
|
58
|
-
export declare function processHyphenKeys(obj: AnyObject): AnyObject;
|
|
59
53
|
/**
|
|
60
54
|
* 初始化值names值合并
|
|
61
55
|
* @param obj AnyObject
|
|
@@ -11,14 +11,11 @@ exports.getAllNamePath = exports.findOptionByValue = void 0;
|
|
|
11
11
|
exports.getArrayBeforeNumber = getArrayBeforeNumber;
|
|
12
12
|
exports.hasRowKey = exports.getLayout = exports.getDecimalDigits = void 0;
|
|
13
13
|
exports.initialValuesToNames = initialValuesToNames;
|
|
14
|
-
exports.parseNamePath = exports.isUpperCase = exports.isTrim = exports.isSelect = exports.isNullValue = exports.isNullArray = exports.isNotFullArray = exports.isEmptyArray = void 0;
|
|
15
|
-
exports.processHyphenKeys = processHyphenKeys;
|
|
16
|
-
exports.splitNameStr = void 0;
|
|
14
|
+
exports.splitNameStr = exports.parseNamePath = exports.isUpperCase = exports.isTrim = exports.isSelect = exports.isNullValue = exports.isNullArray = exports.isNotFullArray = exports.isEmptyArray = void 0;
|
|
17
15
|
exports.toArray = toArray;
|
|
18
16
|
exports.weedOutProps = exports.view = exports.useControlled = void 0;
|
|
19
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
20
17
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
21
|
-
var
|
|
18
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
22
19
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
23
20
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
24
21
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -265,54 +262,6 @@ function toArray(value) {
|
|
|
265
262
|
}
|
|
266
263
|
return Array.isArray(value) ? value : [value];
|
|
267
264
|
}
|
|
268
|
-
/**
|
|
269
|
-
* names值合并
|
|
270
|
-
* @param obj AnyObject
|
|
271
|
-
* @returns AnyObject
|
|
272
|
-
*/
|
|
273
|
-
function processHyphenKeys(obj) {
|
|
274
|
-
var newObj = (0, _objectSpread2.default)({}, obj);
|
|
275
|
-
var keys = Object.keys(obj);
|
|
276
|
-
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
|
|
277
|
-
var key = _keys[_i];
|
|
278
|
-
if (key.includes('-')) {
|
|
279
|
-
var keyParts = key.split('-');
|
|
280
|
-
var shouldCombine = true;
|
|
281
|
-
var combinedArray = [];
|
|
282
|
-
var _iterator = (0, _createForOfIteratorHelper2.default)(keyParts),
|
|
283
|
-
_step;
|
|
284
|
-
try {
|
|
285
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
286
|
-
var part = _step.value;
|
|
287
|
-
if (obj.hasOwnProperty(part)) {
|
|
288
|
-
combinedArray.push(obj[part]);
|
|
289
|
-
} else {
|
|
290
|
-
shouldCombine = false;
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
} catch (err) {
|
|
295
|
-
_iterator.e(err);
|
|
296
|
-
} finally {
|
|
297
|
-
_iterator.f();
|
|
298
|
-
}
|
|
299
|
-
if (shouldCombine) {
|
|
300
|
-
newObj[key] = combinedArray;
|
|
301
|
-
} else {
|
|
302
|
-
newObj[key] = undefined;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
// 匹配数组的namePath,只匹配到1层
|
|
306
|
-
if (key.includes('_')) {
|
|
307
|
-
var _keyParts = key.split('_')[0];
|
|
308
|
-
// 校验值是否存在,解决names多传额外空值报错
|
|
309
|
-
newObj[key] = (0, _lodash.isObject)(newObj[_keyParts]) ? Object.values(newObj[_keyParts]).filter(function (val) {
|
|
310
|
-
return val !== null && val !== undefined && val !== '';
|
|
311
|
-
}) : [];
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return (0, _lodash.cloneDeep)(newObj);
|
|
315
|
-
}
|
|
316
265
|
/**
|
|
317
266
|
* 初始化值names值合并
|
|
318
267
|
* @param obj AnyObject
|
|
@@ -478,11 +427,11 @@ var parseNamePath = exports.parseNamePath = function parseNamePath(input) {
|
|
|
478
427
|
};
|
|
479
428
|
/** 解析namePath */
|
|
480
429
|
function findNamesKeyInArray(arr, key) {
|
|
481
|
-
var
|
|
482
|
-
|
|
430
|
+
var _iterator = (0, _createForOfIteratorHelper2.default)(arr),
|
|
431
|
+
_step;
|
|
483
432
|
try {
|
|
484
|
-
for (
|
|
485
|
-
var item =
|
|
433
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
434
|
+
var item = _step.value;
|
|
486
435
|
if (!item.includes('_')) {
|
|
487
436
|
return null;
|
|
488
437
|
}
|
|
@@ -491,9 +440,9 @@ function findNamesKeyInArray(arr, key) {
|
|
|
491
440
|
}
|
|
492
441
|
}
|
|
493
442
|
} catch (err) {
|
|
494
|
-
|
|
443
|
+
_iterator.e(err);
|
|
495
444
|
} finally {
|
|
496
|
-
|
|
445
|
+
_iterator.f();
|
|
497
446
|
}
|
|
498
447
|
return null;
|
|
499
448
|
}
|
|
@@ -91,8 +91,8 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
|
|
|
91
91
|
value: value,
|
|
92
92
|
originalValue: originalValue,
|
|
93
93
|
form: form,
|
|
94
|
-
equalWith: equalWith
|
|
95
|
-
|
|
94
|
+
equalWith: equalWith,
|
|
95
|
+
name: (0, _lodash.isString)(namesStr) ? namesStr : originalName || name
|
|
96
96
|
});
|
|
97
97
|
return [changed, originalValue];
|
|
98
98
|
};
|
|
@@ -197,6 +197,22 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
197
197
|
var renderValue = (0, _getEnumLabel.default)(realCode, value, valueType === 'enumCodeName');
|
|
198
198
|
var originalValue = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
|
199
199
|
var originalRenderValue = (0, _getEnumLabel.default)(realCode, originalValue, valueType === 'enumCodeName');
|
|
200
|
+
if (Array.isArray(column === null || column === void 0 ? void 0 : column.codeValues) && !realCode) {
|
|
201
|
+
var _column$codeValues$fi;
|
|
202
|
+
var labelName = column === null || column === void 0 ? void 0 : (_column$codeValues$fi = column.codeValues.find(function (item) {
|
|
203
|
+
return item.value === value;
|
|
204
|
+
})) === null || _column$codeValues$fi === void 0 ? void 0 : _column$codeValues$fi.label;
|
|
205
|
+
if (valueType === 'enumName') {
|
|
206
|
+
renderValue = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
207
|
+
children: labelName || '-'
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
if (valueType === 'enumCodeName') {
|
|
211
|
+
renderValue = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
212
|
+
children: labelName ? "".concat(value, "-").concat(labelName) : labelName
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
200
216
|
var node = (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
201
217
|
size: 8,
|
|
202
218
|
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts
CHANGED
|
@@ -5,12 +5,17 @@ interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const Row: FC<RowProps>;
|
|
8
|
-
declare const DndWrapper: ({ draggable, value, onChange, disabled, children, rowKey }: {
|
|
8
|
+
declare const DndWrapper: ({ draggable, value, onChange, disabled, children, rowKey, onDragStartGuard, onDragMoveGuard, onDragOverGuard, onDragEndGuard, onDragCancelGuard, }: {
|
|
9
9
|
draggable: any;
|
|
10
10
|
value: any;
|
|
11
11
|
onChange: any;
|
|
12
12
|
disabled: any;
|
|
13
13
|
children: any;
|
|
14
14
|
rowKey: any;
|
|
15
|
+
onDragStartGuard: any;
|
|
16
|
+
onDragMoveGuard: any;
|
|
17
|
+
onDragOverGuard: any;
|
|
18
|
+
onDragEndGuard: any;
|
|
19
|
+
onDragCancelGuard: any;
|
|
15
20
|
}) => any;
|
|
16
21
|
export default DndWrapper;
|