@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
package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
1
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
5
|
var _excluded = ["disabled", "children"];
|
|
@@ -6,6 +8,7 @@ import React from 'react';
|
|
|
6
8
|
import { DndContext, closestCorners } from '@dnd-kit/core';
|
|
7
9
|
import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
8
10
|
import { CSS } from '@dnd-kit/utilities';
|
|
11
|
+
import { isFunction } from 'lodash';
|
|
9
12
|
import { addLevelAndParentId, treeNodeFind, transformTreeToArray, createTreeFromArray } from './utils/index';
|
|
10
13
|
import ProIcon from '../../../../../../../ProIcon';
|
|
11
14
|
export var Row = function Row(props) {
|
|
@@ -67,48 +70,177 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
|
67
70
|
onChange = _ref2.onChange,
|
|
68
71
|
disabled = _ref2.disabled,
|
|
69
72
|
children = _ref2.children,
|
|
70
|
-
rowKey = _ref2.rowKey
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
overParentId = overObject.parentId;
|
|
89
|
-
if (activeLevel === overLevel && activeParentId === overParentId) {
|
|
90
|
-
// 将树平铺
|
|
91
|
-
var _flatTree = transformTreeToArray(transformedValue).map(function (item) {
|
|
92
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
93
|
-
children: undefined
|
|
73
|
+
rowKey = _ref2.rowKey,
|
|
74
|
+
onDragStartGuard = _ref2.onDragStartGuard,
|
|
75
|
+
onDragMoveGuard = _ref2.onDragMoveGuard,
|
|
76
|
+
onDragOverGuard = _ref2.onDragOverGuard,
|
|
77
|
+
onDragEndGuard = _ref2.onDragEndGuard,
|
|
78
|
+
onDragCancelGuard = _ref2.onDragCancelGuard;
|
|
79
|
+
var onDragStart = /*#__PURE__*/function () {
|
|
80
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
81
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
82
|
+
while (1) switch (_context.prev = _context.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
if (!(onDragStartGuard && isFunction(onDragStartGuard))) {
|
|
85
|
+
_context.next = 3;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
_context.next = 3;
|
|
89
|
+
return onDragStartGuard({
|
|
90
|
+
event: event
|
|
94
91
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return
|
|
98
|
-
});
|
|
99
|
-
var overIndex = _flatTree.findIndex(function (i) {
|
|
100
|
-
return i.rowKey === (over === null || over === void 0 ? void 0 : over.id);
|
|
101
|
-
});
|
|
102
|
-
var nextValue = arrayMove(_flatTree, activeIndex, overIndex);
|
|
103
|
-
onChange(createTreeFromArray(nextValue, {
|
|
104
|
-
itemKey: 'rowKey',
|
|
105
|
-
parentKey: 'parentId',
|
|
106
|
-
childrenKey: 'children'
|
|
107
|
-
}));
|
|
92
|
+
case 3:
|
|
93
|
+
case "end":
|
|
94
|
+
return _context.stop();
|
|
108
95
|
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
96
|
+
}, _callee);
|
|
97
|
+
}));
|
|
98
|
+
return function onDragStart(_x) {
|
|
99
|
+
return _ref3.apply(this, arguments);
|
|
100
|
+
};
|
|
101
|
+
}();
|
|
102
|
+
var onDragMove = /*#__PURE__*/function () {
|
|
103
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
104
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
105
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
if (!(onDragMoveGuard && isFunction(onDragMoveGuard))) {
|
|
108
|
+
_context2.next = 3;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
_context2.next = 3;
|
|
112
|
+
return onDragMoveGuard({
|
|
113
|
+
event: event
|
|
114
|
+
});
|
|
115
|
+
case 3:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context2.stop();
|
|
118
|
+
}
|
|
119
|
+
}, _callee2);
|
|
120
|
+
}));
|
|
121
|
+
return function onDragMove(_x2) {
|
|
122
|
+
return _ref4.apply(this, arguments);
|
|
123
|
+
};
|
|
124
|
+
}();
|
|
125
|
+
var onDragOver = /*#__PURE__*/function () {
|
|
126
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(event) {
|
|
127
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
128
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
129
|
+
case 0:
|
|
130
|
+
if (!(onDragOverGuard && isFunction(onDragOverGuard))) {
|
|
131
|
+
_context3.next = 3;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
_context3.next = 3;
|
|
135
|
+
return onDragOverGuard({
|
|
136
|
+
event: event
|
|
137
|
+
});
|
|
138
|
+
case 3:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context3.stop();
|
|
141
|
+
}
|
|
142
|
+
}, _callee3);
|
|
143
|
+
}));
|
|
144
|
+
return function onDragOver(_x3) {
|
|
145
|
+
return _ref5.apply(this, arguments);
|
|
146
|
+
};
|
|
147
|
+
}();
|
|
148
|
+
var onDragEnd = /*#__PURE__*/function () {
|
|
149
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref6) {
|
|
150
|
+
var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
|
|
151
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
152
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
153
|
+
case 0:
|
|
154
|
+
active = _ref6.active, over = _ref6.over;
|
|
155
|
+
// 为数据源划分层级及parentId
|
|
156
|
+
transformedValue = addLevelAndParentId(value, rowKey); // 同一level层级的且parentId相同的,可以互相之间拖拽替换
|
|
157
|
+
if (!(active.id !== (over === null || over === void 0 ? void 0 : over.id))) {
|
|
158
|
+
_context4.next = 15;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
activeObject = treeNodeFind(transformedValue, function (t) {
|
|
162
|
+
return t.rowKey === active.id;
|
|
163
|
+
});
|
|
164
|
+
overObject = treeNodeFind(transformedValue, function (t) {
|
|
165
|
+
return t.rowKey === (over === null || over === void 0 ? void 0 : over.id);
|
|
166
|
+
});
|
|
167
|
+
if (!(activeObject && overObject)) {
|
|
168
|
+
_context4.next = 15;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
activeLevel = activeObject.level, activeParentId = activeObject.parentId;
|
|
172
|
+
overLevel = overObject.level, overParentId = overObject.parentId; // 如果传了onDragEndGuard 则视为外部业务逻辑自处理
|
|
173
|
+
if (!(onDragEndGuard && isFunction(onDragEndGuard))) {
|
|
174
|
+
_context4.next = 14;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
_context4.next = 11;
|
|
178
|
+
return onDragEndGuard({
|
|
179
|
+
activeObject: activeObject,
|
|
180
|
+
overObject: overObject,
|
|
181
|
+
currentDataSource: value,
|
|
182
|
+
transformTreeToArray: transformTreeToArray,
|
|
183
|
+
arrayMove: arrayMove,
|
|
184
|
+
createTreeFromArray: createTreeFromArray
|
|
185
|
+
});
|
|
186
|
+
case 11:
|
|
187
|
+
nextDataSource = _context4.sent;
|
|
188
|
+
onChange(nextDataSource !== null && nextDataSource !== void 0 ? nextDataSource : []);
|
|
189
|
+
return _context4.abrupt("return");
|
|
190
|
+
case 14:
|
|
191
|
+
if (activeLevel === overLevel && activeParentId === overParentId) {
|
|
192
|
+
// 将树平铺
|
|
193
|
+
_flatTree = transformTreeToArray(transformedValue).map(function (item) {
|
|
194
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
195
|
+
children: undefined
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
activeIndex = _flatTree.findIndex(function (i) {
|
|
199
|
+
return i.rowKey === active.id;
|
|
200
|
+
});
|
|
201
|
+
overIndex = _flatTree.findIndex(function (i) {
|
|
202
|
+
return i.rowKey === (over === null || over === void 0 ? void 0 : over.id);
|
|
203
|
+
});
|
|
204
|
+
nextValue = arrayMove(_flatTree, activeIndex, overIndex);
|
|
205
|
+
onChange(createTreeFromArray(nextValue, {
|
|
206
|
+
itemKey: 'rowKey',
|
|
207
|
+
parentKey: 'parentId',
|
|
208
|
+
childrenKey: 'children'
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
case 15:
|
|
212
|
+
case "end":
|
|
213
|
+
return _context4.stop();
|
|
214
|
+
}
|
|
215
|
+
}, _callee4);
|
|
216
|
+
}));
|
|
217
|
+
return function onDragEnd(_x4) {
|
|
218
|
+
return _ref7.apply(this, arguments);
|
|
219
|
+
};
|
|
220
|
+
}();
|
|
221
|
+
var onDragCancel = /*#__PURE__*/function () {
|
|
222
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(event) {
|
|
223
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
224
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
225
|
+
case 0:
|
|
226
|
+
if (!(onDragCancelGuard && isFunction(onDragCancelGuard))) {
|
|
227
|
+
_context5.next = 3;
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
_context5.next = 3;
|
|
231
|
+
return onDragCancelGuard({
|
|
232
|
+
event: event
|
|
233
|
+
});
|
|
234
|
+
case 3:
|
|
235
|
+
case "end":
|
|
236
|
+
return _context5.stop();
|
|
237
|
+
}
|
|
238
|
+
}, _callee5);
|
|
239
|
+
}));
|
|
240
|
+
return function onDragCancel(_x5) {
|
|
241
|
+
return _ref8.apply(this, arguments);
|
|
242
|
+
};
|
|
243
|
+
}();
|
|
112
244
|
// 将树平铺
|
|
113
245
|
var flatTree = transformTreeToArray(value).map(function (item) {
|
|
114
246
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -117,6 +249,10 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
|
117
249
|
});
|
|
118
250
|
return draggable && !disabled ? _jsx(DndContext, {
|
|
119
251
|
onDragEnd: onDragEnd,
|
|
252
|
+
onDragStart: onDragStart,
|
|
253
|
+
onDragMove: onDragMove,
|
|
254
|
+
onDragOver: onDragOver,
|
|
255
|
+
onDragCancel: onDragCancel,
|
|
120
256
|
collisionDetection: closestCorners,
|
|
121
257
|
children: _jsx(SortableContext, {
|
|
122
258
|
items: (flatTree === null || flatTree === void 0 ? void 0 : (_flatTree$ = flatTree[0]) === null || _flatTree$ === void 0 ? void 0 : _flatTree$.rowKey) ? flatTree.map(function (i) {
|
|
@@ -4,6 +4,15 @@ import _Table from "antd/es/table";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["dataSource", "tableProps", "draggableProps", "summaryProps", "emptyTextProps"];
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/*
|
|
8
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
9
|
+
* @Date: 2024-08-09 13:48:59
|
|
10
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
11
|
+
* @LastEditTime: 2024-08-20 19:31:24
|
|
12
|
+
* @FilePath: /za-material-warehouse/src/ProTable/components/RcTable/components/DraggableTable/index.tsx
|
|
13
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
14
|
+
*/
|
|
15
|
+
|
|
7
16
|
import { memo } from 'react';
|
|
8
17
|
import DndWrapper, { Row } from './components/DndWrapper';
|
|
9
18
|
import { RenderEmptyText, RenderSummary } from '../../../index';
|
|
@@ -21,13 +30,23 @@ var DraggableTable = function DraggableTable(_ref) {
|
|
|
21
30
|
disabled = tableProps.disabled;
|
|
22
31
|
var onChange = draggableProps.onChange,
|
|
23
32
|
draggable = draggableProps.draggable,
|
|
24
|
-
rowKey = draggableProps.rowKey
|
|
33
|
+
rowKey = draggableProps.rowKey,
|
|
34
|
+
onDragStartGuard = draggableProps.onDragStartGuard,
|
|
35
|
+
onDragMoveGuard = draggableProps.onDragMoveGuard,
|
|
36
|
+
onDragOverGuard = draggableProps.onDragOverGuard,
|
|
37
|
+
onDragEndGuard = draggableProps.onDragEndGuard,
|
|
38
|
+
onDragCancelGuard = draggableProps.onDragCancelGuard;
|
|
25
39
|
return _jsx(DndWrapper, {
|
|
26
40
|
value: dataSource !== null && dataSource !== void 0 ? dataSource : [],
|
|
27
41
|
onChange: onChange,
|
|
28
42
|
disabled: disabled,
|
|
29
43
|
draggable: draggable,
|
|
30
44
|
rowKey: rowKey,
|
|
45
|
+
onDragStartGuard: onDragStartGuard,
|
|
46
|
+
onDragMoveGuard: onDragMoveGuard,
|
|
47
|
+
onDragOverGuard: onDragOverGuard,
|
|
48
|
+
onDragEndGuard: onDragEndGuard,
|
|
49
|
+
onDragCancelGuard: onDragCancelGuard,
|
|
31
50
|
children: _jsx(_Table, _objectSpread(_objectSpread({
|
|
32
51
|
className: "pro-edit-table-drag",
|
|
33
52
|
components: {
|
package/es/ProTable/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
-
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "originalDataSource"],
|
|
8
|
+
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "originalDataSource", "onDragStart", "onDragMove", "onDragOver", "onDragEnd", "onDragCancel"],
|
|
9
9
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
10
10
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useEffect, useMemo, useState, createContext } from 'react';
|
|
@@ -53,6 +53,11 @@ function ProTable(props) {
|
|
|
53
53
|
_props$emptyText = props.emptyText,
|
|
54
54
|
emptyText = _props$emptyText === void 0 ? locale === null || locale === void 0 ? void 0 : (_locale$ProTable = locale.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
|
|
55
55
|
originalDataSource = props.originalDataSource,
|
|
56
|
+
onDragStartGuard = props.onDragStart,
|
|
57
|
+
onDragMoveGuard = props.onDragMove,
|
|
58
|
+
onDragOverGuard = props.onDragOver,
|
|
59
|
+
onDragEndGuard = props.onDragEnd,
|
|
60
|
+
onDragCancelGuard = props.onDragCancel,
|
|
56
61
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
57
62
|
var quickTableConfig = quickConfig ? _objectSpread({
|
|
58
63
|
columnConfig: true,
|
|
@@ -352,7 +357,12 @@ function ProTable(props) {
|
|
|
352
357
|
draggableProps: {
|
|
353
358
|
onChange: onDataSourceChange,
|
|
354
359
|
draggable: draggable,
|
|
355
|
-
rowKey: rowKey
|
|
360
|
+
rowKey: rowKey,
|
|
361
|
+
onDragStartGuard: onDragStartGuard,
|
|
362
|
+
onDragMoveGuard: onDragMoveGuard,
|
|
363
|
+
onDragOverGuard: onDragOverGuard,
|
|
364
|
+
onDragEndGuard: onDragEndGuard,
|
|
365
|
+
onDragCancelGuard: onDragCancelGuard
|
|
356
366
|
},
|
|
357
367
|
tableProps: {
|
|
358
368
|
value: _dataSource,
|
|
@@ -3,6 +3,7 @@ import { TableProps } from 'antd/es/table/Table';
|
|
|
3
3
|
import { ColumnType, GetRowKey, RowSelectionType } from 'antd/es/table/interface';
|
|
4
4
|
import { FormInstance } from 'antd';
|
|
5
5
|
import type { TooltipProps } from 'antd';
|
|
6
|
+
import type { DragStartEvent, DragMoveEvent, DragOverEvent, DragCancelEvent } from '@dnd-kit/core';
|
|
6
7
|
interface SummaryColumnProps {
|
|
7
8
|
key: string | string[];
|
|
8
9
|
index: number;
|
|
@@ -26,6 +27,10 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
|
26
27
|
format?: string;
|
|
27
28
|
precision?: number;
|
|
28
29
|
code?: string | string[] | ((text: any, record: any) => string);
|
|
30
|
+
codeValues?: {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string | number;
|
|
33
|
+
}[];
|
|
29
34
|
copyable?: boolean;
|
|
30
35
|
originalDiffTip?: boolean;
|
|
31
36
|
prefix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
|
@@ -37,6 +42,22 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
|
37
42
|
toolTipProps?: TooltipProps & React.RefAttributes<unknown>;
|
|
38
43
|
transform?: (value: any, record?: any) => string[];
|
|
39
44
|
}
|
|
45
|
+
export interface CreateTreeFromArrayOptions {
|
|
46
|
+
itemKey?: string;
|
|
47
|
+
parentKey?: string;
|
|
48
|
+
childrenKey?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface DragCommonGuardProps<T> {
|
|
51
|
+
event: T;
|
|
52
|
+
}
|
|
53
|
+
export interface DragEndGuardProps {
|
|
54
|
+
activeObject: any;
|
|
55
|
+
overObject: any;
|
|
56
|
+
currentDataSource: any[];
|
|
57
|
+
transformTreeToArray: (tree: any[]) => any[];
|
|
58
|
+
arrayMove: (array: any[], from: number, to: number) => any[];
|
|
59
|
+
createTreeFromArray: (array: any[], options: CreateTreeFromArrayOptions) => any[];
|
|
60
|
+
}
|
|
40
61
|
export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary' | 'columns'> {
|
|
41
62
|
tableId?: string;
|
|
42
63
|
rowKey?: string | GetRowKey<any>;
|
|
@@ -63,6 +84,14 @@ export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary'
|
|
|
63
84
|
stripe?: boolean;
|
|
64
85
|
columns: ProTableColumn[];
|
|
65
86
|
originalDataSource?: any[];
|
|
87
|
+
/**
|
|
88
|
+
* 拖拽额外配置
|
|
89
|
+
*/
|
|
90
|
+
onDragStart?: DragCommonGuardProps<DragStartEvent>;
|
|
91
|
+
onDragMove?: DragCommonGuardProps<DragMoveEvent>;
|
|
92
|
+
onDragOver?: DragCommonGuardProps<DragOverEvent>;
|
|
93
|
+
onDragCancel?: DragCommonGuardProps<DragCancelEvent>;
|
|
94
|
+
onDragEnd?: DragEndGuardProps;
|
|
66
95
|
}
|
|
67
96
|
export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
|
|
68
97
|
export interface Response<T = any> {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default PrdTools;
|
|
@@ -21,7 +21,7 @@ var connect = function connect(Component) {
|
|
|
21
21
|
return ComponentWrapper;
|
|
22
22
|
};
|
|
23
23
|
var NewDrawer = connect(_Drawer);
|
|
24
|
-
var
|
|
24
|
+
var PrdTools = function PrdTools(_ref) {
|
|
25
25
|
var onReset = _ref.onReset,
|
|
26
26
|
onClose = _ref.onClose,
|
|
27
27
|
setState = _ref.setState,
|
|
@@ -266,4 +266,4 @@ var ProTools = function ProTools(_ref) {
|
|
|
266
266
|
})]
|
|
267
267
|
});
|
|
268
268
|
};
|
|
269
|
-
export default
|
|
269
|
+
export default PrdTools;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="typings" />
|
|
2
|
+
export { default as PrdTools } from './PrdTools';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference path="../../../typings.d.ts" />;
|
|
2
|
+
export { default as PrdTools } from './PrdTools';
|
|
@@ -17,7 +17,7 @@ import { isEqual } from 'lodash';
|
|
|
17
17
|
import classnames from 'classnames';
|
|
18
18
|
import { getKebabCase, setThemes, setTableBorder, getMapKebabCase, getMapHumpCase } from './utils/index';
|
|
19
19
|
import settingSvg from '../assets/setting.svg';
|
|
20
|
-
import {
|
|
20
|
+
import { PrdTools } from './component';
|
|
21
21
|
import locale from '../locale';
|
|
22
22
|
var defaultCacheTime = 1; // 配置保存时间为一天
|
|
23
23
|
var defaultThemeConfig = {
|
|
@@ -183,7 +183,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
|
183
183
|
className: "setting-icon",
|
|
184
184
|
src: settingSvg
|
|
185
185
|
})
|
|
186
|
-
}), _jsx(
|
|
186
|
+
}), _jsx(PrdTools, {
|
|
187
187
|
prefixCls: prefixCls,
|
|
188
188
|
onReset: onReset,
|
|
189
189
|
onClose: toggle,
|
|
@@ -122,11 +122,32 @@ function List(props, ref) {
|
|
|
122
122
|
document.body.removeChild(temp);
|
|
123
123
|
return len * 20;
|
|
124
124
|
}
|
|
125
|
+
var handleCommonTitle = function handleCommonTitle(item) {
|
|
126
|
+
if (isCASCADER) {
|
|
127
|
+
return item === null || item === void 0 ? void 0 : item.title;
|
|
128
|
+
}
|
|
129
|
+
return item[fieldNameLabel];
|
|
130
|
+
};
|
|
131
|
+
var handleGetTitle = function handleGetTitle(item) {
|
|
132
|
+
if (showCodeName) {
|
|
133
|
+
if (isCASCADER) {
|
|
134
|
+
if (item[fieldNameValue] && (item === null || item === void 0 ? void 0 : item.title)) {
|
|
135
|
+
return "".concat(item[fieldNameValue], "-").concat(item.title);
|
|
136
|
+
}
|
|
137
|
+
return handleCommonTitle(item);
|
|
138
|
+
}
|
|
139
|
+
if (item[fieldNameValue] && item[fieldNameValue]) {
|
|
140
|
+
return "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]);
|
|
141
|
+
}
|
|
142
|
+
return handleCommonTitle(item);
|
|
143
|
+
}
|
|
144
|
+
return handleCommonTitle(item);
|
|
145
|
+
};
|
|
125
146
|
var _useVirtualList = useVirtualList(originalList, {
|
|
126
147
|
containerTarget: containerRef,
|
|
127
148
|
wrapperTarget: wrapperRef,
|
|
128
149
|
itemHeight: function itemHeight(index, item) {
|
|
129
|
-
var title =
|
|
150
|
+
var title = handleGetTitle(item);
|
|
130
151
|
return Math.floor(getLineHeight(title, 406)) + 12;
|
|
131
152
|
}
|
|
132
153
|
}),
|
|
@@ -182,7 +203,7 @@ function List(props, ref) {
|
|
|
182
203
|
children: _jsx(_Row, {
|
|
183
204
|
children: list.map(function (_item) {
|
|
184
205
|
var item = _item.data;
|
|
185
|
-
var title =
|
|
206
|
+
var title = handleGetTitle(item);
|
|
186
207
|
var content = optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
|
|
187
208
|
label: title,
|
|
188
209
|
searchStr: searchStr
|
|
@@ -220,7 +241,7 @@ function List(props, ref) {
|
|
|
220
241
|
value: checkedValues,
|
|
221
242
|
children: _jsx(_Row, {
|
|
222
243
|
children: treeData.map(function (item) {
|
|
223
|
-
var title =
|
|
244
|
+
var title = handleGetTitle(item);
|
|
224
245
|
var content = optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
|
|
225
246
|
label: title,
|
|
226
247
|
searchStr: searchStr
|
|
@@ -257,7 +278,12 @@ function List(props, ref) {
|
|
|
257
278
|
ref: wrapperRef,
|
|
258
279
|
children: list.map(function (_item) {
|
|
259
280
|
var item = _item.data;
|
|
260
|
-
var title =
|
|
281
|
+
var title = item[fieldNameLabel];
|
|
282
|
+
if (showCodeName) {
|
|
283
|
+
if (item[fieldNameValue] && item[fieldNameLabel]) {
|
|
284
|
+
title = "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
261
287
|
return _jsxs("div", {
|
|
262
288
|
className: "pro-tree-modal-checkbox-content",
|
|
263
289
|
children: [_jsx("div", {
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
11
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -25,10 +26,10 @@ var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
|
25
26
|
var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
|
|
26
27
|
var _transformNames = _interopRequireDefault(require("../../../ProForm/utils/transformNames"));
|
|
27
28
|
var _useFieldProps = require("../../../ProForm/utils/useFieldProps");
|
|
29
|
+
var _useListChanged3 = require("../../../ProForm/utils/useListChanged");
|
|
28
30
|
var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"));
|
|
29
31
|
var _utils = require("../../../ProForm/utils");
|
|
30
32
|
var _ConfirmWrapper = _interopRequireDefault(require("../../../ProForm/components/render/ConfirmWrapper"));
|
|
31
|
-
var _ListChanged = _interopRequireDefault(require("./ListChanged"));
|
|
32
33
|
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className", "trim", "confirm"];
|
|
33
34
|
/* eslint-disable prefer-destructuring */
|
|
34
35
|
/* eslint-disable prefer-const */
|
|
@@ -491,6 +492,21 @@ var RenderField = function RenderField(_ref) {
|
|
|
491
492
|
return _ref3.apply(this, arguments);
|
|
492
493
|
};
|
|
493
494
|
}();
|
|
495
|
+
// 判断当前字段是否变更
|
|
496
|
+
var _useListChanged = (0, _useListChanged3.useListChanged)({
|
|
497
|
+
name: cellName,
|
|
498
|
+
names: names,
|
|
499
|
+
namesStr: [].concat((0, _toConsumableArray2.default)(baseName), [index, dataIndex]),
|
|
500
|
+
rowKeyPath: [].concat((0, _toConsumableArray2.default)(baseName), [index, 'rowKey']),
|
|
501
|
+
originalName: originalName,
|
|
502
|
+
originalNames: originalNames,
|
|
503
|
+
originalValues: originalValues,
|
|
504
|
+
form: form,
|
|
505
|
+
equalWith: equalWith
|
|
506
|
+
}),
|
|
507
|
+
_useListChanged2 = (0, _slicedToArray2.default)(_useListChanged, 2),
|
|
508
|
+
changed = _useListChanged2[0],
|
|
509
|
+
originalValue = _useListChanged2[1];
|
|
494
510
|
var componentProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
495
511
|
form: form,
|
|
496
512
|
name: cellName
|
|
@@ -536,35 +552,16 @@ var RenderField = function RenderField(_ref) {
|
|
|
536
552
|
if (isView) {
|
|
537
553
|
delete _formItemProps.rules;
|
|
538
554
|
}
|
|
539
|
-
var _className = (0, _classnames.default)((0, _defineProperty2.default)({}, className, className));
|
|
555
|
+
var _className = (0, _classnames.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, className, className), 'pro-form-item-changed', changed));
|
|
540
556
|
var FormItem = null;
|
|
541
|
-
var FieldComponent = /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? ( /*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps));
|
|
542
|
-
if (originalValues) {
|
|
543
|
-
FieldComponent = (0, _jsxRuntime.jsx)(_ListChanged.default, {
|
|
544
|
-
name: cellName,
|
|
545
|
-
names: names,
|
|
546
|
-
namesStr: [].concat((0, _toConsumableArray2.default)(baseName), [index, dataIndex]),
|
|
547
|
-
rowKeyPath: [].concat((0, _toConsumableArray2.default)(baseName), [index, 'rowKey']),
|
|
548
|
-
originalName: originalName,
|
|
549
|
-
originalNames: originalNames,
|
|
550
|
-
originalValues: originalValues,
|
|
551
|
-
form: form,
|
|
552
|
-
equalWith: equalWith,
|
|
553
|
-
type: type,
|
|
554
|
-
children: FieldComponent
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
if ((_componentProps = componentProps) === null || _componentProps === void 0 ? void 0 : _componentProps.confirm) {
|
|
558
|
-
FieldComponent = (0, _jsxRuntime.jsx)(_ConfirmWrapper.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, componentProps), {}, {
|
|
559
|
-
children: FieldComponent
|
|
560
|
-
}));
|
|
561
|
-
}
|
|
562
557
|
FormItem = TargetComponent ? (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
563
558
|
validateFirst: true
|
|
564
559
|
}, (0, _lodash.omit)(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name', 'onCell'])), {}, {
|
|
565
560
|
className: _className,
|
|
566
561
|
name: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName,
|
|
567
|
-
children:
|
|
562
|
+
children: ((_componentProps = componentProps) === null || _componentProps === void 0 ? void 0 : _componentProps.confirm) ? (0, _jsxRuntime.jsx)(_ConfirmWrapper.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, componentProps), {}, {
|
|
563
|
+
children: /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? ( /*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps))
|
|
564
|
+
})) : /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? ( /*#__PURE__*/_react.default.cloneElement(TargetComponent, componentProps)) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, componentProps))
|
|
568
565
|
})) : (0, _jsxRuntime.jsx)(_Container.default, {
|
|
569
566
|
viewEmpty: viewEmpty
|
|
570
567
|
});
|
|
@@ -582,9 +579,28 @@ var RenderField = function RenderField(_ref) {
|
|
|
582
579
|
}
|
|
583
580
|
}));
|
|
584
581
|
}
|
|
582
|
+
var originalTitle = originalDiffTip && originalValues ? (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
583
|
+
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? ( /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, componentProps), {}, {
|
|
584
|
+
isView: true,
|
|
585
|
+
value: originalValue,
|
|
586
|
+
checked: type === 'Switch' ? originalValue : undefined
|
|
587
|
+
}))) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, componentProps), {}, {
|
|
588
|
+
isView: true,
|
|
589
|
+
value: originalValue,
|
|
590
|
+
checked: type === 'Switch' ? originalValue : undefined
|
|
591
|
+
}))]
|
|
592
|
+
}) : null;
|
|
585
593
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
586
594
|
value: (_componentProps2 = componentProps) === null || _componentProps2 === void 0 ? void 0 : _componentProps2.otherProps,
|
|
587
|
-
children: FormItem
|
|
595
|
+
children: !originalTitle || ['FormList', 'ProEditTable'].includes(type) ? FormItem : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
596
|
+
title: originalTitle,
|
|
597
|
+
placement: "topLeft",
|
|
598
|
+
open: changed ? undefined : false,
|
|
599
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
600
|
+
return target.parentElement;
|
|
601
|
+
},
|
|
602
|
+
children: FormItem
|
|
603
|
+
})
|
|
588
604
|
});
|
|
589
605
|
};
|
|
590
606
|
var _default = exports.default = RenderField;
|
|
@@ -21,7 +21,6 @@ var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
|
21
21
|
var _useEnum = _interopRequireDefault(require("../../../../ProEnum/hooks/useEnum"));
|
|
22
22
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
23
23
|
var _ = _interopRequireDefault(require("../../.."));
|
|
24
|
-
var _Container = _interopRequireDefault(require("../../Container"));
|
|
25
24
|
var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder"];
|
|
26
25
|
var Text = _antd.Typography.Text;
|
|
27
26
|
var defaultFieldNames = {
|
|
@@ -83,8 +82,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
83
82
|
detailPlaceholder = props.detailPlaceholder,
|
|
84
83
|
otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
85
84
|
var _ref3 = _.default.useFieldProps() || {},
|
|
86
|
-
isViewCon = _ref3.isView
|
|
87
|
-
viewEmpty = _ref3.viewEmpty;
|
|
85
|
+
isViewCon = _ref3.isView;
|
|
88
86
|
var addressCode = code || enumCode;
|
|
89
87
|
var realIsView = typeof isView === 'boolean' ? isView : isViewCon;
|
|
90
88
|
var realLevel = Math.max(2, level);
|
|
@@ -240,9 +238,17 @@ var ProCascader = function ProCascader(props) {
|
|
|
240
238
|
}
|
|
241
239
|
}
|
|
242
240
|
};
|
|
243
|
-
return realIsView ? (0, _jsxRuntime.jsx)(
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
return realIsView ? tooltip ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
242
|
+
className: className,
|
|
243
|
+
title: tooltip === true ? viewValue : tooltip,
|
|
244
|
+
children: (0, _jsxRuntime.jsx)(Text, {
|
|
245
|
+
ellipsis: {
|
|
246
|
+
tooltip: false
|
|
247
|
+
},
|
|
248
|
+
children: viewValue
|
|
249
|
+
})
|
|
250
|
+
}) : (0, _jsxRuntime.jsx)("span", {
|
|
251
|
+
className: className,
|
|
246
252
|
children: viewValue
|
|
247
253
|
}) : (0, _jsxRuntime.jsxs)("div", {
|
|
248
254
|
className: "pro-address ".concat(className),
|