@zat-design/sisyphus-react 3.9.0-beta.2 → 3.9.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +41 -15
- package/dist/less.esm.css +37 -13
- 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 +7 -5
- package/es/ProDrawerForm/components/ProModal/index.js +8 -6
- package/es/ProDrawerForm/propsType.d.ts +1 -0
- 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/ListChangedWrapper.js +7 -3
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +8 -7
- 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/index.js +23 -16
- package/es/ProEditTable/style/index.less +14 -2
- 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 +7 -5
- package/es/ProEnum/propsType.d.ts +1 -0
- 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/base/SwitchCheckbox/index.js +9 -2
- 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.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +13 -2
- package/es/ProForm/components/combination/Group/index.js +4 -3
- 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 +7 -6
- 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/ChangedWrapper.js +1 -2
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +3 -3
- package/es/ProForm/components/render/RenderFields.js +3 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/style/index.less +8 -5
- package/es/ProForm/utils/diffOriginal.js +18 -12
- 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 +5 -3
- package/es/ProTable/components/FormatColumn/index.js +95 -74
- 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 +1 -1
- package/es/ProTable/components/RenderColumn/index.js +29 -11
- 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/components/TableResizable/index.js +1 -5
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +6 -5
- package/es/ProTable/index.js +6 -8
- package/es/ProTable/propsType.d.ts +2 -1
- package/es/ProTable/style/index.less +10 -1
- package/es/ProTable/utils/index.d.ts +5 -2
- package/es/ProTable/utils/index.js +13 -4
- 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 +50 -31
- 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/es/style/theme/antd.less +4 -2
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.js +4 -1
- 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 +7 -5
- package/lib/ProDrawerForm/components/ProModal/index.js +8 -6
- package/lib/ProDrawerForm/propsType.d.ts +1 -0
- 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/ListChangedWrapper.js +5 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +8 -7
- 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/index.js +23 -16
- package/lib/ProEditTable/style/index.less +14 -2
- 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 +7 -5
- package/lib/ProEnum/propsType.d.ts +1 -0
- 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/base/SwitchCheckbox/index.js +9 -2
- 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.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +13 -2
- package/lib/ProForm/components/combination/Group/index.js +4 -3
- 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 +7 -6
- 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/ChangedWrapper.js +1 -2
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +3 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/style/index.less +8 -5
- package/lib/ProForm/utils/diffOriginal.js +18 -12
- 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 +5 -3
- package/lib/ProTable/components/FormatColumn/index.js +94 -73
- 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 +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +29 -11
- 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/components/TableResizable/index.js +0 -4
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +6 -5
- package/lib/ProTable/index.js +6 -8
- package/lib/ProTable/propsType.d.ts +2 -1
- package/lib/ProTable/style/index.less +10 -1
- package/lib/ProTable/utils/index.d.ts +5 -2
- package/lib/ProTable/utils/index.js +13 -4
- 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 +49 -30
- 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/lib/style/theme/antd.less +4 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +4 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const RenderTableHeader: (props: any) =>
|
1
|
+
declare const RenderTableHeader: (props: any) => JSX.Element;
|
2
2
|
export default RenderTableHeader;
|
@@ -12,7 +12,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
var _react = require("react");
|
13
13
|
var _reactResizable = require("react-resizable");
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
15
|
-
var _index = require("../../index");
|
16
15
|
var _FormatColumn = require("../FormatColumn");
|
17
16
|
var _excluded = ["onDrag", "width", "minwidth"];
|
18
17
|
var ResizableTitle = function ResizableTitle(props) {
|
@@ -22,9 +21,6 @@ var ResizableTitle = function ResizableTitle(props) {
|
|
22
21
|
_props$minwidth = props.minwidth,
|
23
22
|
minwidth = _props$minwidth === void 0 ? 50 : _props$minwidth,
|
24
23
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
25
|
-
var _useContext = (0, _react.useContext)(_index.TableContext),
|
26
|
-
tableConfig = _useContext.tableConfig,
|
27
|
-
Storage = _useContext.Storage;
|
28
24
|
// 添加偏移量
|
29
25
|
var _useState = (0, _react.useState)(0),
|
30
26
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
@@ -283,7 +283,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
283
283
|
}
|
284
284
|
};
|
285
285
|
var handleRefresh = /*#__PURE__*/function () {
|
286
|
-
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
286
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
287
287
|
var res;
|
288
288
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
289
289
|
while (1) switch (_context.prev = _context.next) {
|
@@ -395,7 +395,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
395
395
|
total: total
|
396
396
|
}),
|
397
397
|
onSelect: function () {
|
398
|
-
var _onSelect = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
|
398
|
+
var _onSelect = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
|
399
399
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
400
400
|
while (1) switch (_context2.prev = _context2.next) {
|
401
401
|
case 0:
|
@@ -419,7 +419,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
419
419
|
key: 'uncheckAll',
|
420
420
|
text: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
421
421
|
onSelect: function () {
|
422
|
-
var _onSelect2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
422
|
+
var _onSelect2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
423
423
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
424
424
|
while (1) switch (_context3.prev = _context3.next) {
|
425
425
|
case 0:
|
package/lib/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/lib/ProTable/index.js
CHANGED
@@ -36,7 +36,7 @@ var defaultPage = exports.defaultPage = {
|
|
36
36
|
pageNum: 1,
|
37
37
|
pageSize: 10
|
38
38
|
};
|
39
|
-
function ProTable(props) {
|
39
|
+
var ProTable = function ProTable(props) {
|
40
40
|
var _locale$ProTable, _props$scroll, _curTableConfig$pathK;
|
41
41
|
var _ref = (0, _index.useProConfig)('globalConfig') || {},
|
42
42
|
configStorage = _ref.storage; // 获取全局缓存位置配置
|
@@ -121,7 +121,6 @@ function ProTable(props) {
|
|
121
121
|
});
|
122
122
|
});
|
123
123
|
var originalObj = _originalDataSource ? (0, _lodash.keyBy)(_originalDataSource, 'rowKey') : undefined;
|
124
|
-
var dataSourceObj = _dataSource ? (0, _lodash.keyBy)(_dataSource, 'rowKey') : {};
|
125
124
|
var propsColumnObj = (0, _react.useMemo)(function () {
|
126
125
|
return propsColumns.reduce(function (acc, cur) {
|
127
126
|
// @ts-ignore
|
@@ -220,9 +219,8 @@ function ProTable(props) {
|
|
220
219
|
(0, _FormatColumn.formatColumn)({
|
221
220
|
column: item,
|
222
221
|
originalObj: originalObj,
|
223
|
-
|
224
|
-
|
225
|
-
diffToolTip: toolTip,
|
222
|
+
rowKey: props.rowKey,
|
223
|
+
diffConfig: diffConfig,
|
226
224
|
wrapToolTipProps: wrapToolTipProps,
|
227
225
|
scroll: _scroll,
|
228
226
|
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
@@ -253,7 +251,7 @@ function ProTable(props) {
|
|
253
251
|
_scroll = props === null || props === void 0 ? void 0 : props.scroll;
|
254
252
|
}
|
255
253
|
var handleColumnConfig = /*#__PURE__*/function () {
|
256
|
-
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(checkList) {
|
254
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(checkList) {
|
257
255
|
var newColumns, _columnConfig$onColum, catchColumns;
|
258
256
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
259
257
|
while (1) switch (_context.prev = _context.next) {
|
@@ -362,7 +360,7 @@ function ProTable(props) {
|
|
362
360
|
return _rowSelection;
|
363
361
|
};
|
364
362
|
var onDataSourceChange = /*#__PURE__*/function () {
|
365
|
-
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(nextDataSource) {
|
363
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(nextDataSource) {
|
366
364
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
367
365
|
while (1) switch (_context2.prev = _context2.next) {
|
368
366
|
case 0:
|
@@ -454,7 +452,7 @@ function ProTable(props) {
|
|
454
452
|
})]
|
455
453
|
})
|
456
454
|
});
|
457
|
-
}
|
455
|
+
};
|
458
456
|
ProTable.defaultProps = {
|
459
457
|
quickConfig: false,
|
460
458
|
stripe: true,
|
@@ -31,7 +31,6 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
31
31
|
value: string | number;
|
32
32
|
}[];
|
33
33
|
copyable?: boolean;
|
34
|
-
originalDiffTip?: boolean;
|
35
34
|
prefix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
36
35
|
suffix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
37
36
|
tooltip?: ReactNode | {
|
@@ -45,6 +44,8 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
45
44
|
value: any;
|
46
45
|
originValue: any;
|
47
46
|
}) => boolean;
|
47
|
+
viewRender?: ({ value, record, index, originalValue, originalRecord }: any) => any;
|
48
|
+
isChanged?: boolean | null;
|
48
49
|
}
|
49
50
|
export interface CreateTreeFromArrayOptions {
|
50
51
|
itemKey?: string;
|
@@ -261,11 +261,20 @@
|
|
261
261
|
tr.@{ant-prefix}-table-row.new-cell {
|
262
262
|
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
263
263
|
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
264
|
-
|
265
264
|
td.@{ant-prefix}-table-cell {
|
266
265
|
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
267
266
|
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
268
267
|
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
268
|
+
&.@{ant-prefix}-table-cell-fix-right {
|
269
|
+
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
270
|
+
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
271
|
+
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
272
|
+
}
|
273
|
+
&.@{ant-prefix}-table-cell-fix-left {
|
274
|
+
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
275
|
+
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
276
|
+
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
277
|
+
}
|
269
278
|
}
|
270
279
|
}
|
271
280
|
|
@@ -11,9 +11,12 @@ export declare const getDecimalDigits: (num?: number) => number;
|
|
11
11
|
* @param any value
|
12
12
|
* @param any originalObj
|
13
13
|
* @param {any} dataIndex
|
14
|
-
* @return {any}
|
14
|
+
* @return {any} isChanged 返回bool值,表示存在比对
|
15
15
|
*/
|
16
|
-
export declare const getOriginalValue: (value: any, record: any, originalObj: any, rowKey: any, dataIndex: any) =>
|
16
|
+
export declare const getOriginalValue: (value: any, record: any, originalObj: any, rowKey: any, dataIndex: any) => {
|
17
|
+
originalValue: any;
|
18
|
+
isChanged: boolean;
|
19
|
+
};
|
17
20
|
export declare const getColumnDataIndex: (dataIndex: string | string[]) => string;
|
18
21
|
/**
|
19
22
|
* 判断数据是否为Response<List<any>>结构
|
@@ -22,18 +22,27 @@ var getDecimalDigits = exports.getDecimalDigits = function getDecimalDigits() {
|
|
22
22
|
* @param any value
|
23
23
|
* @param any originalObj
|
24
24
|
* @param {any} dataIndex
|
25
|
-
* @return {any}
|
25
|
+
* @return {any} isChanged 返回bool值,表示存在比对
|
26
26
|
*/
|
27
27
|
var getOriginalValue = exports.getOriginalValue = function getOriginalValue(value, record, originalObj, rowKey, dataIndex) {
|
28
28
|
if (!originalObj) {
|
29
|
-
return
|
29
|
+
return {
|
30
|
+
originalValue: null,
|
31
|
+
isChanged: null
|
32
|
+
};
|
30
33
|
}
|
31
34
|
var originalRecord = (0, _lodash.get)(originalObj, (0, _lodash.get)(record, rowKey));
|
32
35
|
var originalValue = (0, _lodash.get)(originalRecord, dataIndex);
|
33
36
|
if (!(0, _lodash.isEqual)(originalValue, value)) {
|
34
|
-
return
|
37
|
+
return {
|
38
|
+
originalValue: originalValue,
|
39
|
+
isChanged: true
|
40
|
+
};
|
35
41
|
}
|
36
|
-
return
|
42
|
+
return {
|
43
|
+
originalValue: null,
|
44
|
+
isChanged: false
|
45
|
+
};
|
37
46
|
};
|
38
47
|
var getColumnDataIndex = exports.getColumnDataIndex = function getColumnDataIndex(dataIndex) {
|
39
48
|
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;
|
@@ -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 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(props, info) {
|
362
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(props, info) {
|
363
363
|
var _options$;
|
364
364
|
var values, options, option;
|
365
365
|
return (0, _regeneratorRuntime2.default)().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;
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.default = exports.ProTreeSelect = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
9
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
10
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
@@ -108,14 +110,14 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
108
110
|
}
|
109
111
|
var count = 0;
|
110
112
|
var result = [];
|
111
|
-
var
|
113
|
+
var loopCount = function loopCount(data) {
|
112
114
|
data.map(function (item) {
|
113
115
|
count += 1;
|
114
116
|
var children = item.children,
|
115
117
|
other = (0, _objectWithoutProperties2.default)(item, _excluded2);
|
116
118
|
result.push((0, _objectSpread2.default)({}, other));
|
117
119
|
if (item.children) {
|
118
|
-
|
120
|
+
loopCount(item.children);
|
119
121
|
}
|
120
122
|
return item;
|
121
123
|
});
|
@@ -123,7 +125,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
123
125
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
124
126
|
return dictsEnum;
|
125
127
|
}
|
126
|
-
|
128
|
+
loopCount(dictsEnum);
|
127
129
|
if (count <= 10) {
|
128
130
|
return result;
|
129
131
|
}
|
@@ -137,17 +139,17 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
137
139
|
*/
|
138
140
|
var transferDataSource = function transferDataSource(dataArr, showCodeAndName) {
|
139
141
|
var copyData = (0, _lodash.cloneDeep)(dataArr);
|
140
|
-
var
|
142
|
+
var loop = function loop(arr) {
|
141
143
|
arr.map(function (item) {
|
142
144
|
item[label] = "".concat(item[code], "-").concat(item[label]);
|
143
145
|
if (item.children) {
|
144
|
-
|
146
|
+
loop(item.children);
|
145
147
|
}
|
146
148
|
return item;
|
147
149
|
});
|
148
150
|
};
|
149
151
|
if (showCodeAndName) {
|
150
|
-
|
152
|
+
loop(copyData);
|
151
153
|
}
|
152
154
|
return copyData;
|
153
155
|
};
|
@@ -241,19 +243,19 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
241
243
|
return viewEmpty;
|
242
244
|
}
|
243
245
|
var labelResult = [];
|
244
|
-
var
|
246
|
+
var queryLabel = function queryLabel(dicts) {
|
245
247
|
return dicts.map(function (item) {
|
246
248
|
if (value.includes(item[code])) {
|
247
249
|
var labelText = item[label];
|
248
250
|
labelResult.push(labelText);
|
249
251
|
}
|
250
252
|
if (item.children) {
|
251
|
-
|
253
|
+
queryLabel(item.children);
|
252
254
|
}
|
253
255
|
return item;
|
254
256
|
});
|
255
257
|
};
|
256
|
-
|
258
|
+
queryLabel(origDataSource);
|
257
259
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
258
260
|
};
|
259
261
|
// 纯展示处理
|
@@ -291,7 +293,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
291
293
|
* @param node 每个节点数据对象
|
292
294
|
* @returns 整个react节点树
|
293
295
|
*/
|
294
|
-
var
|
296
|
+
var renderTreeNode = function renderTreeNode(node, grade) {
|
295
297
|
var children = node.children,
|
296
298
|
icon = node.icon;
|
297
299
|
var labelText = node[label];
|
@@ -362,7 +364,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
362
364
|
checkable: node.checkable,
|
363
365
|
className: "node-val-".concat(value),
|
364
366
|
children: children.map(function (child) {
|
365
|
-
return
|
367
|
+
return renderTreeNode(child, sonGrade);
|
366
368
|
})
|
367
369
|
}, key);
|
368
370
|
};
|
@@ -373,7 +375,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
373
375
|
* @returns 处理后得树
|
374
376
|
*/
|
375
377
|
function filterTree(sourceList, keyWord) {
|
376
|
-
var
|
378
|
+
var filterData = function filterData(data) {
|
377
379
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
378
380
|
// 遍历数组
|
379
381
|
for (var i = 0; i < data.length; i++) {
|
@@ -381,7 +383,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
381
383
|
// 一直递归到最后一层子节点
|
382
384
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
383
385
|
if (item.children && item.children.length > 0) {
|
384
|
-
currentNodeChild =
|
386
|
+
currentNodeChild = filterData(item.children);
|
385
387
|
}
|
386
388
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
387
389
|
item.children = currentNodeChild;
|
@@ -395,24 +397,41 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
395
397
|
}
|
396
398
|
return currentAllNodeChild;
|
397
399
|
};
|
398
|
-
sourceList =
|
400
|
+
sourceList = filterData(sourceList);
|
399
401
|
return sourceList;
|
400
402
|
}
|
401
|
-
var searchTreeEvent = function
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
403
|
+
var searchTreeEvent = (0, _lodash.debounce)( /*#__PURE__*/function () {
|
404
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(searchVal) {
|
405
|
+
var result;
|
406
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
407
|
+
while (1) switch (_context.prev = _context.next) {
|
408
|
+
case 0:
|
409
|
+
if (searchVal) {
|
410
|
+
_context.next = 3;
|
411
|
+
break;
|
412
|
+
}
|
413
|
+
setState({
|
414
|
+
selectList: (0, _lodash.cloneDeep)(origDataSource || [])
|
415
|
+
});
|
416
|
+
return _context.abrupt("return", null);
|
417
|
+
case 3:
|
418
|
+
result = filterTree((0, _lodash.cloneDeep)(origDataSource || []), searchVal);
|
419
|
+
setState({
|
420
|
+
selectList: result || []
|
421
|
+
});
|
422
|
+
case 5:
|
423
|
+
case "end":
|
424
|
+
return _context.stop();
|
425
|
+
}
|
426
|
+
}, _callee);
|
427
|
+
}));
|
428
|
+
return function (_x) {
|
429
|
+
return _ref5.apply(this, arguments);
|
430
|
+
};
|
431
|
+
}(), 500);
|
413
432
|
function findTreeNode(treeList, nodeValue) {
|
414
433
|
var result = {};
|
415
|
-
var
|
434
|
+
var filterData = function filterData(data) {
|
416
435
|
for (var i = 0; i < data.length; i++) {
|
417
436
|
var item = data[i];
|
418
437
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
@@ -424,11 +443,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
424
443
|
}
|
425
444
|
// 一直递归到最后一层子节点
|
426
445
|
if (item.children && item.children.length > 0) {
|
427
|
-
|
446
|
+
filterData(item.children);
|
428
447
|
}
|
429
448
|
}
|
430
449
|
};
|
431
|
-
|
450
|
+
filterData(treeList);
|
432
451
|
return result;
|
433
452
|
}
|
434
453
|
function getLabelByValue(treeList, nodeValue) {
|
@@ -565,7 +584,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
565
584
|
}
|
566
585
|
}, treeProps), {}, {
|
567
586
|
children: selectList.map(function (node) {
|
568
|
-
return
|
587
|
+
return renderTreeNode(node, 1);
|
569
588
|
})
|
570
589
|
}))
|
571
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;
|
@@ -115,7 +115,7 @@ function List(props) {
|
|
115
115
|
}
|
116
116
|
}, [selectedKey]);
|
117
117
|
var onSelect = /*#__PURE__*/function () {
|
118
|
-
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value, item) {
|
118
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value, item) {
|
119
119
|
var _props$onSelect;
|
120
120
|
var val;
|
121
121
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
@@ -303,7 +303,7 @@ function List(props) {
|
|
303
303
|
}, onlyKey);
|
304
304
|
};
|
305
305
|
function fn() {
|
306
|
-
var
|
306
|
+
var loop = function loop(data, index) {
|
307
307
|
index++;
|
308
308
|
var treeRow = data.map(function (item) {
|
309
309
|
var nodeClass = 'pro-tree-tree-node ';
|
@@ -325,7 +325,7 @@ function List(props) {
|
|
325
325
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
326
326
|
title: nodeTitle,
|
327
327
|
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
328
|
-
children:
|
328
|
+
children: loop(item[fieldNames.children], index)
|
329
329
|
});
|
330
330
|
}
|
331
331
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
@@ -342,7 +342,7 @@ function List(props) {
|
|
342
342
|
if (searchStr) {
|
343
343
|
newTreeData = (0, _utils.filterCheckedNodes)(originalTreeData, [], searchStr, fieldNames);
|
344
344
|
}
|
345
|
-
return
|
345
|
+
return loop(newTreeData, -1);
|
346
346
|
}
|
347
347
|
var _treeData = fn();
|
348
348
|
var onExpand = function onExpand(newExpandedKeys, nextPara) {
|
package/lib/ProTree/index.d.ts
CHANGED
package/lib/ProTree/utils.js
CHANGED
@@ -63,7 +63,7 @@ function getAllKeys(data, fieldNames) {
|
|
63
63
|
* @param fieldNames
|
64
64
|
* @returns
|
65
65
|
*/
|
66
|
-
var
|
66
|
+
var getParentKey = exports.getParentKey = function getParentKey(key, tree, fieldNames) {
|
67
67
|
var parentKey;
|
68
68
|
for (var i = 0; i < tree.length; i++) {
|
69
69
|
var node = tree[i];
|
@@ -72,8 +72,8 @@ var _getParentKey = exports.getParentKey = function getParentKey(key, tree, fiel
|
|
72
72
|
return item[fieldNames.value] === key;
|
73
73
|
})) {
|
74
74
|
parentKey = node[fieldNames.value];
|
75
|
-
} else if (
|
76
|
-
parentKey =
|
75
|
+
} else if (getParentKey(key, node[fieldNames.children], fieldNames)) {
|
76
|
+
parentKey = getParentKey(key, node[fieldNames.children], fieldNames);
|
77
77
|
}
|
78
78
|
}
|
79
79
|
}
|
@@ -81,7 +81,7 @@ var _getParentKey = exports.getParentKey = function getParentKey(key, tree, fiel
|
|
81
81
|
};
|
82
82
|
function findTreeNodeByKey(treeData, key, fieldNames) {
|
83
83
|
var result = [];
|
84
|
-
var
|
84
|
+
var traverse = function traverse(node, parents) {
|
85
85
|
if (node[fieldNames.value] === key) {
|
86
86
|
result.push.apply(result, [node].concat((0, _toConsumableArray2.default)(parents)));
|
87
87
|
return true;
|
@@ -92,7 +92,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
92
92
|
try {
|
93
93
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
94
94
|
var child = _step.value;
|
95
|
-
if (
|
95
|
+
if (traverse(child, [node].concat((0, _toConsumableArray2.default)(parents)))) {
|
96
96
|
return true;
|
97
97
|
}
|
98
98
|
}
|
@@ -108,7 +108,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
108
108
|
try {
|
109
109
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
110
110
|
var node = _step2.value;
|
111
|
-
|
111
|
+
traverse(node, []);
|
112
112
|
}
|
113
113
|
} catch (err) {
|
114
114
|
_iterator2.e(err);
|
@@ -127,23 +127,23 @@ function filterCheckedNodes(data, checkedKeys) {
|
|
127
127
|
var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
128
128
|
var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
|
129
129
|
var result = [];
|
130
|
-
var
|
130
|
+
var traverse = function traverse(node) {
|
131
131
|
var _node$fieldNames$chil3;
|
132
132
|
var title = node[fieldNames.value] + node[fieldNames.label];
|
133
133
|
if (!searchStr) {
|
134
134
|
if (checkedKeys.includes(node[fieldNames.value])) {
|
135
135
|
var _node$fieldNames$chil;
|
136
|
-
var _children = (node === null || node === void 0 ? void 0 : (_node$fieldNames$chil = node[fieldNames.children]) === null || _node$fieldNames$chil === void 0 ? void 0 : _node$fieldNames$chil.map(
|
136
|
+
var _children = (node === null || node === void 0 ? void 0 : (_node$fieldNames$chil = node[fieldNames.children]) === null || _node$fieldNames$chil === void 0 ? void 0 : _node$fieldNames$chil.map(traverse).filter(Boolean)) || [];
|
137
137
|
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, node), {}, (0, _defineProperty2.default)({}, fieldNames.children, _children));
|
138
138
|
}
|
139
139
|
} else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
140
140
|
var _node$fieldNames$chil2;
|
141
|
-
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(
|
141
|
+
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(traverse).filter(Boolean)) || [];
|
142
142
|
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, node), {}, {
|
143
143
|
children: _children2
|
144
144
|
});
|
145
145
|
}
|
146
|
-
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(
|
146
|
+
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(traverse).filter(Boolean);
|
147
147
|
if (children && children.length > 0) {
|
148
148
|
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, node), {}, (0, _defineProperty2.default)({}, fieldNames.children, children));
|
149
149
|
}
|
@@ -155,7 +155,7 @@ function filterCheckedNodes(data, checkedKeys) {
|
|
155
155
|
try {
|
156
156
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
157
157
|
var node = _step3.value;
|
158
|
-
var filtered =
|
158
|
+
var filtered = traverse(node);
|
159
159
|
if (filtered) {
|
160
160
|
result.push(filtered);
|
161
161
|
}
|