@zat-design/sisyphus-react 3.9.0-beta.6 → 3.9.0-beta.8
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/es/ProAction/index.js +5 -5
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +5 -5
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +4 -4
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +2 -2
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +3 -3
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProIcon/utils/index.js +3 -4
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.d.ts +1 -2
- package/es/ProTable/components/FormatColumn/index.js +13 -24
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +0 -1
- package/es/ProTable/components/RenderColumn/index.js +2 -3
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +6 -5
- package/es/ProTable/index.js +5 -7
- package/es/ProTable/propsType.d.ts +1 -1
- package/es/ProTable/utils/index.js +2 -2
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +2 -1
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +20 -20
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +4 -4
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +11 -12
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/utils.js +14 -16
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/lib/ProAction/index.js +5 -5
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +5 -5
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +4 -4
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +2 -2
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +3 -3
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +1 -1
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +3 -3
- package/lib/ProTable/components/FormatColumn/index.d.ts +1 -2
- package/lib/ProTable/components/FormatColumn/index.js +13 -24
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +0 -1
- package/lib/ProTable/components/RenderColumn/index.js +2 -3
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +6 -5
- package/lib/ProTable/index.js +5 -7
- package/lib/ProTable/propsType.d.ts +1 -1
- package/lib/ProTable/utils/index.js +2 -2
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +2 -1
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +20 -20
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +4 -4
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/utils.js +13 -13
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/package.json +1 -1
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +0 -241
- package/coverage/lcov-report/src/.umi/core/history.ts.html +0 -148
- package/coverage/lcov-report/src/.umi/core/index.html +0 -206
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +0 -109
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +0 -160
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +0 -97
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +0 -26050
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +0 -112
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
- package/coverage/lcov-report/src/.umi/dumi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +0 -109
- package/coverage/lcov-report/src/.umi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +0 -172
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +0 -94
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +0 -196
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +0 -106
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +0 -88
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +0 -124
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +0 -1246
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +0 -161
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +0 -268
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +0 -778
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +0 -115
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +0 -202
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +0 -97
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +0 -142
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +0 -334
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +0 -121
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +0 -298
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +0 -919
- package/coverage/lcov-report/src/.umi/umi.ts.html +0 -268
@@ -49,7 +49,6 @@ var calcMinWidth = function calcMinWidth(_ref) {
|
|
49
49
|
export var formatColumn = function formatColumn(_ref2) {
|
50
50
|
var column = _ref2.column,
|
51
51
|
originalObj = _ref2.originalObj,
|
52
|
-
dataSourceObj = _ref2.dataSourceObj,
|
53
52
|
rowKey = _ref2.rowKey,
|
54
53
|
diffToolTip = _ref2.diffToolTip,
|
55
54
|
wrapToolTipProps = _ref2.wrapToolTipProps,
|
@@ -120,34 +119,24 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
120
119
|
var originalRender = column.render; // 保存原始的 render 方法
|
121
120
|
// 自定义render 手动重载下
|
122
121
|
column.render = function (value, record, index) {
|
123
|
-
var _originalObj$record$r;
|
124
122
|
var isFn = isFunction(originalRender);
|
125
123
|
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : null;
|
126
124
|
var originalValue = getOriginalValue(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
|
127
|
-
var originalRenderValue = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(originalValue, (_originalObj$record$r = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r !== void 0 ? _originalObj$record$r : {}, index) : null;
|
128
125
|
var isInNewRowFlag = isInNewRow(record);
|
129
|
-
var extraDiffFlag = false;
|
130
|
-
// 把比对结果告诉我
|
131
|
-
if (onDiff) {
|
132
|
-
var isDiff = onDiff({
|
133
|
-
value: record,
|
134
|
-
originValue: originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]
|
135
|
-
});
|
136
|
-
if (!isDiff) {
|
137
|
-
originalValue = null;
|
138
|
-
} else {
|
139
|
-
originalValue = true;
|
140
|
-
extraDiffFlag = true;
|
141
|
-
}
|
142
|
-
}
|
143
126
|
// 存在比对
|
144
|
-
if (
|
145
|
-
var _originalObj$record$
|
146
|
-
|
127
|
+
if (isFunction(otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewRender)) {
|
128
|
+
var _originalObj$record$r;
|
129
|
+
originalValue = otherProps.viewRender({
|
130
|
+
originalValue: originalValue,
|
131
|
+
originalRecord: (_originalObj$record$r = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r !== void 0 ? _originalObj$record$r : {},
|
132
|
+
value: value,
|
133
|
+
record: record,
|
134
|
+
index: index
|
135
|
+
});
|
147
136
|
}
|
148
137
|
return _jsx(RenderColumn, _objectSpread(_objectSpread({}, otherProps), {}, {
|
149
138
|
valueType: valueType,
|
150
|
-
originalValue: isEmpty(originalValue) ? null :
|
139
|
+
originalValue: isEmpty(originalValue) ? null : originalValue,
|
151
140
|
ellipsis: ellipsis,
|
152
141
|
width: width,
|
153
142
|
value: _value,
|
@@ -536,14 +525,14 @@ export var getParentElement = function getParentElement(element, name) {
|
|
536
525
|
if (!element || !name) {
|
537
526
|
return result;
|
538
527
|
}
|
539
|
-
var
|
528
|
+
var searchDom = function searchDom(element, name) {
|
540
529
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
|
541
530
|
if (element.parentElement[type] === name) {
|
542
531
|
result = element.parentElement;
|
543
532
|
return false;
|
544
533
|
}
|
545
|
-
|
534
|
+
searchDom(element.parentElement, name, type = 'className');
|
546
535
|
};
|
547
|
-
|
536
|
+
searchDom(element, name, type = 'className');
|
548
537
|
return result;
|
549
538
|
};
|
package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js
CHANGED
@@ -74,7 +74,7 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
74
74
|
onDragStartGuard = _ref2.onDragStartGuard,
|
75
75
|
onDragEndGuard = _ref2.onDragEndGuard;
|
76
76
|
var onDragStart = /*#__PURE__*/function () {
|
77
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
|
77
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
|
78
78
|
var active, _transformedValue, activeObject;
|
79
79
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
80
80
|
while (1) switch (_context.prev = _context.next) {
|
@@ -105,7 +105,7 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
105
105
|
};
|
106
106
|
}();
|
107
107
|
var onDragEnd = /*#__PURE__*/function () {
|
108
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
108
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
109
109
|
var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
|
110
110
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
111
111
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -9,7 +9,7 @@ export var getRowKey = function getRowKey(rowKey, record) {
|
|
9
9
|
}
|
10
10
|
return key;
|
11
11
|
};
|
12
|
-
var
|
12
|
+
export var addLevelAndParentId = function addLevelAndParentId(tree, rowKey) {
|
13
13
|
var currentLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
14
14
|
var currentParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
15
15
|
return tree.map(function (node) {
|
@@ -18,12 +18,11 @@ var _addLevelAndParentId = function addLevelAndParentId(tree, rowKey) {
|
|
18
18
|
newNode.parentId = currentParentId;
|
19
19
|
newNode.rowKey = getRowKey(rowKey, node);
|
20
20
|
if (node.children) {
|
21
|
-
newNode.children =
|
21
|
+
newNode.children = addLevelAndParentId(node.children, rowKey, currentLevel + 1, newNode.rowKey);
|
22
22
|
}
|
23
23
|
return newNode;
|
24
24
|
});
|
25
25
|
};
|
26
|
-
export { _addLevelAndParentId as addLevelAndParentId };
|
27
26
|
export function getFinalChildrenKey(tree, meta, options) {
|
28
27
|
if (typeof options.getChildrenKey === 'function') {
|
29
28
|
var dynamicChildrenKey = options.getChildrenKey(tree, meta);
|
@@ -34,7 +33,7 @@ export function getFinalChildrenKey(tree, meta, options) {
|
|
34
33
|
return options.childrenKey;
|
35
34
|
}
|
36
35
|
// 前置深度优先遍历
|
37
|
-
var
|
36
|
+
var treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
38
37
|
var callbackResult = callback(treeItem, options);
|
39
38
|
if (callbackResult) {
|
40
39
|
return treeItem;
|
@@ -46,7 +45,7 @@ var _treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
46
45
|
}
|
47
46
|
for (var i = 0, count = children.length; i < count; i++) {
|
48
47
|
var childItem = children[i];
|
49
|
-
var findOne =
|
48
|
+
var findOne = treeNodePreImpl(childItem, callback, _objectSpread(_objectSpread({}, options), {}, {
|
50
49
|
parents: [].concat(_toConsumableArray(options.parents), [treeItem]),
|
51
50
|
depth: options.depth + 1
|
52
51
|
}));
|
@@ -57,7 +56,7 @@ var _treeNodePreImpl = function treeNodePreImpl(treeItem, callback, options) {
|
|
57
56
|
return undefined;
|
58
57
|
};
|
59
58
|
var treeNodeStrategies = {
|
60
|
-
pre:
|
59
|
+
pre: treeNodePreImpl
|
61
60
|
};
|
62
61
|
export function treeNodeFind(tree, callback, options) {
|
63
62
|
var _options$childrenKey, _options$strategy;
|
@@ -122,7 +121,7 @@ export function createTreeFromArray(array, options) {
|
|
122
121
|
return result;
|
123
122
|
}
|
124
123
|
// 前置遍历
|
125
|
-
var
|
124
|
+
var treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, options) {
|
126
125
|
callback(treeItem, options);
|
127
126
|
var finalChildrenKey = getFinalChildrenKey(treeItem, options, options);
|
128
127
|
var children = treeItem === null || treeItem === void 0 ? void 0 : treeItem[finalChildrenKey];
|
@@ -132,12 +131,12 @@ var _treeForEachPreImpl = function treeForEachPreImpl(treeItem, callback, option
|
|
132
131
|
depth: options.depth + 1
|
133
132
|
});
|
134
133
|
children.forEach(function (childItem) {
|
135
|
-
|
134
|
+
treeForEachPreImpl(childItem, callback, nextLevelOptions);
|
136
135
|
});
|
137
136
|
}
|
138
137
|
};
|
139
138
|
var treeForEachStrategies = {
|
140
|
-
pre:
|
139
|
+
pre: treeForEachPreImpl
|
141
140
|
};
|
142
141
|
export function treeForEach(tree, callback, options) {
|
143
142
|
var _options$childrenKey2, _options$strategy2;
|
@@ -13,7 +13,6 @@ interface Props {
|
|
13
13
|
toolTipProps?: TooltipProps & React.RefAttributes<unknown>;
|
14
14
|
minWidth?: number;
|
15
15
|
isInNewRowFlag?: boolean;
|
16
|
-
viewRender?: (value: any, record: any, index: number) => any;
|
17
16
|
}
|
18
17
|
declare const RenderColumn: FC<Props>;
|
19
18
|
export default RenderColumn;
|
@@ -28,8 +28,7 @@ var RenderColumn = function RenderColumn(props) {
|
|
28
28
|
_props$toolTipProps = props.toolTipProps,
|
29
29
|
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
|
30
30
|
minWidth = props.minWidth,
|
31
|
-
isInNewRowFlag = props.isInNewRowFlag
|
32
|
-
viewRender = props.viewRender;
|
31
|
+
isInNewRowFlag = props.isInNewRowFlag;
|
33
32
|
var _useSetState = useSetState({
|
34
33
|
tooltip: false
|
35
34
|
}),
|
@@ -65,7 +64,7 @@ var RenderColumn = function RenderColumn(props) {
|
|
65
64
|
children: [_jsxs(_Space, {
|
66
65
|
align: "start",
|
67
66
|
className: "original-value-container",
|
68
|
-
children: ["\u521D\u59CB\u503C\uFF1A",
|
67
|
+
children: ["\u521D\u59CB\u503C\uFF1A", originalValue]
|
69
68
|
}), _jsx(_Space, {
|
70
69
|
className: "current-value-container",
|
71
70
|
children: ellipsis ? _jsxs(_Space, {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const RenderFooter: (props: any) =>
|
1
|
+
declare const RenderFooter: (props: any) => JSX.Element;
|
2
2
|
export default RenderFooter;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const RenderTableHeader: (props: any) =>
|
1
|
+
declare const RenderTableHeader: (props: any) => JSX.Element;
|
2
2
|
export default RenderTableHeader;
|
@@ -276,7 +276,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
276
276
|
}
|
277
277
|
};
|
278
278
|
var handleRefresh = /*#__PURE__*/function () {
|
279
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
279
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
280
280
|
var res;
|
281
281
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
282
282
|
while (1) switch (_context.prev = _context.next) {
|
@@ -388,7 +388,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
388
388
|
total: total
|
389
389
|
}),
|
390
390
|
onSelect: function () {
|
391
|
-
var _onSelect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(changeableRowKeys) {
|
391
|
+
var _onSelect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(changeableRowKeys) {
|
392
392
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
393
393
|
while (1) switch (_context2.prev = _context2.next) {
|
394
394
|
case 0:
|
@@ -412,7 +412,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
412
412
|
key: 'uncheckAll',
|
413
413
|
text: locale === null || locale === void 0 ? void 0 : (_locale$ProTable4 = locale.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
414
414
|
onSelect: function () {
|
415
|
-
var _onSelect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
415
|
+
var _onSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
416
416
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
417
417
|
while (1) switch (_context3.prev = _context3.next) {
|
418
418
|
case 0:
|
package/es/ProTable/index.d.ts
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProTableProps } from './propsType';
|
3
|
+
import useAntdTable from './hooks/useAntdTable';
|
3
4
|
export declare const TableContext: import("react").Context<{}>;
|
4
5
|
export declare const defaultPage: {
|
5
6
|
pageNum: number;
|
6
7
|
pageSize: number;
|
7
8
|
};
|
8
|
-
declare
|
9
|
-
|
10
|
-
|
9
|
+
declare const ProTable: {
|
10
|
+
(props: ProTableProps): JSX.Element;
|
11
|
+
defaultProps: {
|
11
12
|
quickConfig: boolean;
|
12
13
|
stripe: boolean;
|
13
14
|
draggable: boolean;
|
14
15
|
disabled: boolean;
|
15
16
|
isView: boolean;
|
16
17
|
};
|
17
|
-
|
18
|
-
}
|
18
|
+
useAntdTable: typeof useAntdTable;
|
19
|
+
};
|
19
20
|
export default ProTable;
|
package/es/ProTable/index.js
CHANGED
@@ -29,7 +29,7 @@ export var defaultPage = {
|
|
29
29
|
pageNum: 1,
|
30
30
|
pageSize: 10
|
31
31
|
};
|
32
|
-
function ProTable(props) {
|
32
|
+
var ProTable = function ProTable(props) {
|
33
33
|
var _locale$ProTable, _props$scroll, _curTableConfig$pathK;
|
34
34
|
var _ref = useProConfig('globalConfig') || {},
|
35
35
|
configStorage = _ref.storage; // 获取全局缓存位置配置
|
@@ -114,7 +114,6 @@ function ProTable(props) {
|
|
114
114
|
});
|
115
115
|
});
|
116
116
|
var originalObj = _originalDataSource ? keyBy(_originalDataSource, 'rowKey') : undefined;
|
117
|
-
var dataSourceObj = _dataSource ? keyBy(_dataSource, 'rowKey') : {};
|
118
117
|
var propsColumnObj = useMemo(function () {
|
119
118
|
return propsColumns.reduce(function (acc, cur) {
|
120
119
|
// @ts-ignore
|
@@ -213,8 +212,7 @@ function ProTable(props) {
|
|
213
212
|
formatColumn({
|
214
213
|
column: item,
|
215
214
|
originalObj: originalObj,
|
216
|
-
|
217
|
-
rowKey: 'rowKey',
|
215
|
+
rowKey: props.rowKey,
|
218
216
|
diffToolTip: toolTip,
|
219
217
|
wrapToolTipProps: wrapToolTipProps,
|
220
218
|
scroll: _scroll,
|
@@ -246,7 +244,7 @@ function ProTable(props) {
|
|
246
244
|
_scroll = props === null || props === void 0 ? void 0 : props.scroll;
|
247
245
|
}
|
248
246
|
var handleColumnConfig = /*#__PURE__*/function () {
|
249
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
247
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
250
248
|
var newColumns, _columnConfig$onColum, catchColumns;
|
251
249
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
252
250
|
while (1) switch (_context.prev = _context.next) {
|
@@ -355,7 +353,7 @@ function ProTable(props) {
|
|
355
353
|
return _rowSelection;
|
356
354
|
};
|
357
355
|
var onDataSourceChange = /*#__PURE__*/function () {
|
358
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
356
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
359
357
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
360
358
|
while (1) switch (_context2.prev = _context2.next) {
|
361
359
|
case 0:
|
@@ -447,7 +445,7 @@ function ProTable(props) {
|
|
447
445
|
})]
|
448
446
|
})
|
449
447
|
});
|
450
|
-
}
|
448
|
+
};
|
451
449
|
ProTable.defaultProps = {
|
452
450
|
quickConfig: false,
|
453
451
|
stripe: true,
|
@@ -45,7 +45,7 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
45
45
|
value: any;
|
46
46
|
originValue: any;
|
47
47
|
}) => boolean;
|
48
|
-
viewRender?: (value
|
48
|
+
viewRender?: ({ value, record, index, originalValue, originalRecord }: any) => any;
|
49
49
|
}
|
50
50
|
export interface CreateTreeFromArrayOptions {
|
51
51
|
itemKey?: string;
|
@@ -20,14 +20,14 @@ export var getDecimalDigits = function getDecimalDigits() {
|
|
20
20
|
*/
|
21
21
|
export var getOriginalValue = function getOriginalValue(value, record, originalObj, rowKey, dataIndex) {
|
22
22
|
if (!originalObj) {
|
23
|
-
return
|
23
|
+
return null;
|
24
24
|
}
|
25
25
|
var originalRecord = get(originalObj, get(record, rowKey));
|
26
26
|
var originalValue = get(originalRecord, dataIndex);
|
27
27
|
if (!isEqual(originalValue, value)) {
|
28
28
|
return originalValue;
|
29
29
|
}
|
30
|
-
return
|
30
|
+
return null;
|
31
31
|
};
|
32
32
|
export var getColumnDataIndex = function getColumnDataIndex(dataIndex) {
|
33
33
|
return typeof dataIndex === 'string' ? dataIndex : dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.join('-');
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
2
|
-
declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) =>
|
2
|
+
declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
|
3
3
|
export default ProTools;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProThemeToolsProps } from './propsType';
|
2
2
|
declare const ProThemeTools: {
|
3
|
-
({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps):
|
3
|
+
({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, onChange, ...props }: ProThemeToolsProps): JSX.Element;
|
4
4
|
defaultProps: {
|
5
5
|
size: number;
|
6
6
|
mode: string;
|
package/es/ProTooltip/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import { ProTooltipPropsType } from './propsType';
|
2
2
|
import './style/index.less';
|
3
|
-
declare const ProTooltip: (props: ProTooltipPropsType) =>
|
3
|
+
declare const ProTooltip: (props: ProTooltipPropsType) => JSX.Element;
|
4
4
|
export default ProTooltip;
|
@@ -12,6 +12,6 @@ interface ListProps {
|
|
12
12
|
handleFilterClose?: (code: string) => void;
|
13
13
|
optionRender?: (item: any, searchStr?: string) => string | ReactNode;
|
14
14
|
}
|
15
|
-
declare function List(props: ListProps):
|
15
|
+
declare function List(props: ListProps): JSX.Element;
|
16
16
|
declare const _default: import("react").MemoExoticComponent<typeof List>;
|
17
17
|
export default _default;
|
@@ -359,7 +359,7 @@ var ProTree = function ProTree(props) {
|
|
359
359
|
};
|
360
360
|
/** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
|
361
361
|
var onSelectTreeNode = /*#__PURE__*/function () {
|
362
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
|
362
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
|
363
363
|
var _options$;
|
364
364
|
var values, options, option;
|
365
365
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { PropTreeSelectProps } from './propsType';
|
3
|
-
export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) =>
|
3
|
+
export declare const ProTreeSelect: (props: PropTreeSelectProps, ref: React.Ref<unknown> | undefined) => JSX.Element;
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<PropTreeSelectProps & React.RefAttributes<unknown>>;
|
5
5
|
export default _default;
|
@@ -110,14 +110,14 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
110
110
|
}
|
111
111
|
var count = 0;
|
112
112
|
var result = [];
|
113
|
-
var
|
113
|
+
var loopCount = function loopCount(data) {
|
114
114
|
data.map(function (item) {
|
115
115
|
count += 1;
|
116
116
|
var children = item.children,
|
117
117
|
other = _objectWithoutProperties(item, _excluded2);
|
118
118
|
result.push(_objectSpread({}, other));
|
119
119
|
if (item.children) {
|
120
|
-
|
120
|
+
loopCount(item.children);
|
121
121
|
}
|
122
122
|
return item;
|
123
123
|
});
|
@@ -125,7 +125,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
125
125
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
126
126
|
return dictsEnum;
|
127
127
|
}
|
128
|
-
|
128
|
+
loopCount(dictsEnum);
|
129
129
|
if (count <= 10) {
|
130
130
|
return result;
|
131
131
|
}
|
@@ -139,17 +139,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
139
139
|
*/
|
140
140
|
var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
|
141
141
|
var copyData = cloneDeep(dataArr);
|
142
|
-
var
|
142
|
+
var loop = function loop(arr) {
|
143
143
|
arr.map(function (item) {
|
144
144
|
item[label] = "".concat(item[code], "-").concat(item[label]);
|
145
145
|
if (item.children) {
|
146
|
-
|
146
|
+
loop(item.children);
|
147
147
|
}
|
148
148
|
return item;
|
149
149
|
});
|
150
150
|
};
|
151
151
|
if (showCodeAndName) {
|
152
|
-
|
152
|
+
loop(copyData);
|
153
153
|
}
|
154
154
|
return copyData;
|
155
155
|
};
|
@@ -243,19 +243,19 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
243
243
|
return viewEmpty;
|
244
244
|
}
|
245
245
|
var labelResult = [];
|
246
|
-
var
|
246
|
+
var queryLabel = function queryLabel(dicts) {
|
247
247
|
return dicts.map(function (item) {
|
248
248
|
if (value.includes(item[code])) {
|
249
249
|
var labelText = item[label];
|
250
250
|
labelResult.push(labelText);
|
251
251
|
}
|
252
252
|
if (item.children) {
|
253
|
-
|
253
|
+
queryLabel(item.children);
|
254
254
|
}
|
255
255
|
return item;
|
256
256
|
});
|
257
257
|
};
|
258
|
-
|
258
|
+
queryLabel(origDataSource);
|
259
259
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
260
260
|
};
|
261
261
|
// 纯展示处理
|
@@ -293,7 +293,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
293
293
|
* @param node 每个节点数据对象
|
294
294
|
* @returns 整个react节点树
|
295
295
|
*/
|
296
|
-
var
|
296
|
+
var renderTreeNode = function renderTreeNode(node, grade) {
|
297
297
|
var children = node.children,
|
298
298
|
icon = node.icon;
|
299
299
|
var labelText = node[label];
|
@@ -364,7 +364,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
364
364
|
checkable: node.checkable,
|
365
365
|
className: "node-val-".concat(value),
|
366
366
|
children: children.map(function (child) {
|
367
|
-
return
|
367
|
+
return renderTreeNode(child, sonGrade);
|
368
368
|
})
|
369
369
|
}, key);
|
370
370
|
};
|
@@ -375,7 +375,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
375
375
|
* @returns 处理后得树
|
376
376
|
*/
|
377
377
|
function filterTree(sourceList, keyWord) {
|
378
|
-
var
|
378
|
+
var filterData = function filterData(data) {
|
379
379
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
380
380
|
// 遍历数组
|
381
381
|
for (var i = 0; i < data.length; i++) {
|
@@ -383,7 +383,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
383
383
|
// 一直递归到最后一层子节点
|
384
384
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
385
385
|
if (item.children && item.children.length > 0) {
|
386
|
-
currentNodeChild =
|
386
|
+
currentNodeChild = filterData(item.children);
|
387
387
|
}
|
388
388
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
389
389
|
item.children = currentNodeChild;
|
@@ -397,11 +397,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
397
397
|
}
|
398
398
|
return currentAllNodeChild;
|
399
399
|
};
|
400
|
-
sourceList =
|
400
|
+
sourceList = filterData(sourceList);
|
401
401
|
return sourceList;
|
402
402
|
}
|
403
|
-
var searchTreeEvent = debounce(/*#__PURE__*/function () {
|
404
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
|
403
|
+
var searchTreeEvent = debounce( /*#__PURE__*/function () {
|
404
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
|
405
405
|
var result;
|
406
406
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
407
407
|
while (1) switch (_context.prev = _context.next) {
|
@@ -431,7 +431,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
431
431
|
}(), 500);
|
432
432
|
function findTreeNode(treeList, nodeValue) {
|
433
433
|
var result = {};
|
434
|
-
var
|
434
|
+
var filterData = function filterData(data) {
|
435
435
|
for (var i = 0; i < data.length; i++) {
|
436
436
|
var item = data[i];
|
437
437
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
@@ -443,11 +443,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
443
443
|
}
|
444
444
|
// 一直递归到最后一层子节点
|
445
445
|
if (item.children && item.children.length > 0) {
|
446
|
-
|
446
|
+
filterData(item.children);
|
447
447
|
}
|
448
448
|
}
|
449
449
|
};
|
450
|
-
|
450
|
+
filterData(treeList);
|
451
451
|
return result;
|
452
452
|
}
|
453
453
|
function getLabelByValue(treeList, nodeValue) {
|
@@ -584,7 +584,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
584
584
|
}
|
585
585
|
}, treeProps), {}, {
|
586
586
|
children: selectList.map(function (node) {
|
587
|
-
return
|
587
|
+
return renderTreeNode(node, 1);
|
588
588
|
})
|
589
589
|
}))
|
590
590
|
});
|
@@ -6,6 +6,6 @@ declare function SearchTitle(props: {
|
|
6
6
|
showEllipse?: boolean;
|
7
7
|
ellipseWidth?: string;
|
8
8
|
otherProps?: ProFormOtherProps;
|
9
|
-
}):
|
9
|
+
}): JSX.Element;
|
10
10
|
declare const _default: import("react").MemoExoticComponent<typeof SearchTitle>;
|
11
11
|
export default _default;
|
@@ -23,5 +23,5 @@ interface ListProps extends ProTreeProps {
|
|
23
23
|
handleFilterClose?: (code: string, node?: any) => void;
|
24
24
|
[key: string]: any;
|
25
25
|
}
|
26
|
-
declare function List(props: ListProps):
|
26
|
+
declare function List(props: ListProps): JSX.Element;
|
27
27
|
export default List;
|
@@ -110,7 +110,7 @@ function List(props) {
|
|
110
110
|
}
|
111
111
|
}, [selectedKey]);
|
112
112
|
var onSelect = /*#__PURE__*/function () {
|
113
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
113
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
114
114
|
var _props$onSelect;
|
115
115
|
var val;
|
116
116
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -298,7 +298,7 @@ function List(props) {
|
|
298
298
|
}, onlyKey);
|
299
299
|
};
|
300
300
|
function fn() {
|
301
|
-
var
|
301
|
+
var loop = function loop(data, index) {
|
302
302
|
index++;
|
303
303
|
var treeRow = data.map(function (item) {
|
304
304
|
var nodeClass = 'pro-tree-tree-node ';
|
@@ -320,7 +320,7 @@ function List(props) {
|
|
320
320
|
return _objectSpread(_objectSpread({}, item), {}, {
|
321
321
|
title: nodeTitle,
|
322
322
|
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
323
|
-
children:
|
323
|
+
children: loop(item[fieldNames.children], index)
|
324
324
|
});
|
325
325
|
}
|
326
326
|
return _objectSpread(_objectSpread({}, item), {}, {
|
@@ -337,7 +337,7 @@ function List(props) {
|
|
337
337
|
if (searchStr) {
|
338
338
|
newTreeData = filterCheckedNodes(originalTreeData, [], searchStr, fieldNames);
|
339
339
|
}
|
340
|
-
return
|
340
|
+
return loop(newTreeData, -1);
|
341
341
|
}
|
342
342
|
var _treeData = fn();
|
343
343
|
var onExpand = function onExpand(newExpandedKeys, nextPara) {
|