@cloud-app-dev/vidc 2.0.0-alpha.7 → 2.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.fatherrc.js +11 -4
- package/.umirc.ts +1 -1
- package/es/Api/index.js +7 -7
- package/es/AppRedirect/index.d.ts +1 -1
- package/es/AppRedirect/index.js +7 -12
- package/es/AppRouter/index.d.ts +8 -0
- package/es/AppRouter/index.js +17 -0
- package/es/Auth/index.js +1 -1
- package/es/AutoExit/index.js +12 -10
- package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
- package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
- package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
- package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
- package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
- package/es/{ContentBox → Box}/index.css +0 -0
- package/es/{ContentBox → Box}/index.d.ts +3 -3
- package/es/{ContentBox → Box}/index.js +5 -5
- package/es/CheckGroupFixed/index.js +4 -2
- package/es/Config/index.js +44 -14
- package/es/Config/interface.d.ts +12 -5
- package/es/Config/utils.d.ts +1 -1
- package/es/Config/utils.js +1 -3
- package/es/ConfigContext/index.d.ts +15 -2
- package/es/ConfigContext/index.js +25 -3
- package/es/DeviceSelect/TreeType.d.ts +6 -0
- package/es/DeviceSelect/TreeType.js +36 -0
- package/es/DeviceSelect/demo.js +2 -2
- package/es/DeviceSelect/index.css +6 -1
- package/es/DeviceSelect/index.d.ts +5 -0
- package/es/DeviceSelect/index.js +21 -52
- package/es/Dict/hook.d.ts +0 -1
- package/es/Dict/hook.js +5 -21
- package/es/Dict/index.d.ts +1 -5
- package/es/Dict/index.js +2 -6
- package/es/Dict/utils.d.ts +0 -1
- package/es/Dict/utils.js +2 -9
- package/es/IconFont/index.d.ts +0 -1
- package/es/IconFont/index.js +12 -13
- package/es/InitialConfig/index.js +7 -6
- package/es/InitialConfig/utils.d.ts +5 -0
- package/es/InitialConfig/utils.js +33 -6
- package/es/InitialRequest/index.d.ts +3 -1
- package/es/InitialRequest/index.js +20 -16
- package/es/InitialRequest/utils.d.ts +6 -4
- package/es/InitialRequest/utils.js +52 -70
- package/es/Input/index.js +3 -2
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +9 -0
- package/es/List/CheckExt.d.ts +3 -5
- package/es/List/CheckExt.js +21 -13
- package/es/{AppRoute → List/DeviceList}/index.css +0 -0
- package/es/List/DeviceList/index.d.ts +11 -0
- package/es/{DeviceList → List/DeviceList}/index.js +6 -18
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
- package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
- package/es/List/DynamicDeviceList/index.d.ts +11 -0
- package/es/List/DynamicDeviceList/index.js +205 -0
- package/es/List/DynamicDeviceList/interface.d.ts +37 -0
- package/es/List/DynamicDeviceList/utils.d.ts +16 -0
- package/es/List/DynamicDeviceList/utils.js +61 -0
- package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
- package/es/List/DynamicGridList/Demo.js +70 -0
- package/es/List/DynamicGridList/index.d.ts +26 -0
- package/es/List/DynamicGridList/index.js +73 -0
- package/es/List/GridList/Demo.d.ts +2 -0
- package/es/List/GridList/Demo.js +91 -0
- package/es/List/GridList/hook.d.ts +13 -0
- package/es/List/GridList/hook.js +301 -0
- package/es/List/GridList/index.css +7 -0
- package/es/List/GridList/index.d.ts +15 -0
- package/es/List/GridList/index.js +47 -0
- package/es/List/GridList/interface.d.ts +59 -0
- package/es/List/GridList/utils.d.ts +9 -0
- package/es/List/GridList/utils.js +43 -0
- package/es/List/ListExt/index.css +3 -0
- package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
- package/es/{ListExt → List/ListExt}/index.js +3 -3
- package/es/List/VList/index.css +6 -0
- package/es/List/VList/index.d.ts +18 -0
- package/es/List/VList/index.js +51 -0
- package/es/List/VList/utils.d.ts +14 -0
- package/es/{VList → List/VList}/utils.js +0 -0
- package/es/List/index.css +11 -12
- package/es/List/index.d.ts +5 -70
- package/es/List/index.js +32 -24
- package/es/List/interface.d.ts +87 -0
- package/es/List/renderItem.d.ts +1 -1
- package/es/List/renderItem.js +13 -10
- package/es/LoaderApp/index.d.ts +1 -1
- package/es/LoaderApp/index.js +39 -35
- package/es/LoaderApp/loader.js +2 -6
- package/es/LoaderApp/utils.d.ts +3 -1
- package/es/LoaderApp/utils.js +43 -3
- package/es/LoaderScript/index.js +7 -89
- package/es/LoaderScript/utils.d.ts +2 -0
- package/es/LoaderScript/utils.js +170 -33
- package/es/Picture/component/MoveContent/index.js +3 -3
- package/es/RefDrawer/index.js +1 -1
- package/es/RefModal/index.js +1 -1
- package/es/Service/http.d.ts +6 -4
- package/es/Service/http.js +20 -22
- package/es/Service/index.d.ts +3 -3
- package/es/Service/index.js +7 -11
- package/es/Service/interface.d.ts +5 -11
- package/es/Service/middleware.d.ts +1 -1
- package/es/Service/middleware.js +1 -1
- package/es/TableLayout/index.d.ts +3 -0
- package/es/TableLayout/index.js +14 -45
- package/es/{TreeTitle → Title}/index.css +5 -5
- package/es/{TreeTitle → Title}/index.d.ts +2 -2
- package/es/{TreeTitle → Title}/index.js +7 -4
- package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
- package/es/Tree/BaseTree/demo.js +69 -0
- package/es/Tree/BaseTree/index.css +64 -0
- package/es/Tree/BaseTree/index.d.ts +24 -0
- package/es/Tree/BaseTree/index.js +83 -0
- package/es/Tree/demo.js +19 -56
- package/es/Tree/index.css +29 -55
- package/es/Tree/index.d.ts +19 -20
- package/es/Tree/index.js +185 -70
- package/es/UserSelect/index.js +6 -4
- package/es/WorkerFlow/Form/Condition.js +2 -4
- package/es/WorkerFlow/Form/EmptyUserSet.js +2 -4
- package/es/WorkerFlow/Form/FormAuth.js +2 -2
- package/es/WorkerFlow/Form/GroupList.js +2 -2
- package/es/WorkerFlow/Form/GroupSelect.js +2 -4
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
- package/es/WorkerFlow/Form/LevelGroupSelect.js +3 -5
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -4
- package/es/WorkerFlow/Form/UserSelect.js +2 -4
- package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -3
- package/es/WorkerFlow/Form/UserSet.js +2 -2
- package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
- package/es/WorkerFlow/index.css +9 -3
- package/es/WorkerFlow/index.js +13 -8
- package/es/WorkerFlow/utils.js +2 -2
- package/es/index.d.ts +4 -11
- package/es/index.js +4 -11
- package/es/useDrawer/index.d.ts +1 -1
- package/es/useDrawer/index.js +3 -2
- package/es/useHistory/index.d.ts +2 -2
- package/es/useHistory/index.js +3 -6
- package/es/useHttp/index.js +1 -1
- package/es/useModal/index.d.ts +1 -1
- package/es/useModal/index.js +3 -2
- package/es/utils.d.ts +9 -0
- package/es/utils.js +36 -1
- package/package.json +10 -12
- package/tsconfig.json +1 -1
- package/es/AppRoute/Render.d.ts +0 -23
- package/es/AppRoute/Render.js +0 -111
- package/es/AppRoute/Rendered.d.ts +0 -4
- package/es/AppRoute/Rendered.js +0 -11
- package/es/AppRoute/index.d.ts +0 -14
- package/es/AppRoute/index.js +0 -106
- package/es/AppRoute/interface.d.ts +0 -18
- package/es/AppRoute/utils.d.ts +0 -1
- package/es/AppRoute/utils.js +0 -28
- package/es/DeviceList/index.css +0 -32
- package/es/DeviceList/index.d.ts +0 -14
- package/es/Dict/desc.d.ts +0 -64
- package/es/Dict/desc.js +0 -162
- package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
- package/es/DynamicDeviceList/CheckExt.js +0 -36
- package/es/DynamicDeviceList/Demo.js +0 -17
- package/es/DynamicDeviceList/index.d.ts +0 -35
- package/es/DynamicDeviceList/index.js +0 -224
- package/es/DynamicDeviceList/utils.d.ts +0 -2
- package/es/DynamicDeviceList/utils.js +0 -15
- package/es/DynamicList/index.css +0 -7
- package/es/DynamicList/index.d.ts +0 -31
- package/es/DynamicList/index.js +0 -132
- package/es/IconFont/index.css +0 -0
- package/es/List/utils.d.ts +0 -5
- package/es/List/utils.js +0 -18
- package/es/ListExt/index.css +0 -9
- package/es/ScrollList/index.css +0 -73
- package/es/ScrollList/index.d.ts +0 -24
- package/es/ScrollList/index.js +0 -261
- package/es/ScrollList/utils.js +0 -84
- package/es/Service/logger.d.ts +0 -3
- package/es/Service/logger.js +0 -13
- package/es/Service/utils.d.ts +0 -3
- package/es/Service/utils.js +0 -11
- package/es/TreeMode/demo.js +0 -32
- package/es/TreeMode/index.css +0 -38
- package/es/TreeMode/index.d.ts +0 -23
- package/es/TreeMode/index.js +0 -201
- package/es/VList/index.css +0 -4
- package/es/VList/index.d.ts +0 -16
- package/es/VList/index.js +0 -56
- package/es/VList/utils.d.ts +0 -10
- package/es/useChangeEffect/index.d.ts +0 -3
- package/es/useChangeEffect/index.js +0 -32
- package/es/useHistory/index.css +0 -0
package/es/ScrollList/index.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import "antd/lib/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/lib/tooltip";
|
|
3
|
-
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
|
-
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
|
|
10
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
11
|
-
|
|
12
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
-
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
|
|
16
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
|
|
18
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
-
|
|
20
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
21
|
-
|
|
22
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
23
|
-
|
|
24
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
-
|
|
26
|
-
import React, { useState, useEffect, useMemo, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
27
|
-
import AutoSizer from 'react-virtualized/dist/es/AutoSizer';
|
|
28
|
-
import InfiniteLoader from 'react-virtualized/dist/es/InfiniteLoader';
|
|
29
|
-
import List from 'react-virtualized/dist/es/List';
|
|
30
|
-
import IconFont from '../IconFont';
|
|
31
|
-
import { debounce, cloneDeep } from 'lodash';
|
|
32
|
-
import { computedCuurentGrid, arraySliceForX, simpleGrid } from './utils';
|
|
33
|
-
import "./index.css";
|
|
34
|
-
var ScrollList = /*#__PURE__*/forwardRef(function InfiniteScrollLayout(props, ref) {
|
|
35
|
-
var data = props.data,
|
|
36
|
-
itemGrid = props.itemGrid,
|
|
37
|
-
itemHeight = props.itemHeight,
|
|
38
|
-
threshold = props.threshold,
|
|
39
|
-
isNoData = props.isNoData,
|
|
40
|
-
_props$className = props.className,
|
|
41
|
-
className = _props$className === void 0 ? '' : _props$className,
|
|
42
|
-
hasLoadPrev = props.hasLoadPrev,
|
|
43
|
-
loadPrev = props.loadPrev,
|
|
44
|
-
prethreshold = props.prethreshold,
|
|
45
|
-
noDataUrl = props.noDataUrl;
|
|
46
|
-
var infiniteRef = useRef(null);
|
|
47
|
-
var loadingRef = useRef(false);
|
|
48
|
-
var scrollRef = useRef(false);
|
|
49
|
-
|
|
50
|
-
var _useState = useState(false),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
showBackTop = _useState2[0],
|
|
53
|
-
setShowBackUp = _useState2[1];
|
|
54
|
-
|
|
55
|
-
var _useState3 = useState(computedCuurentGrid()),
|
|
56
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
-
currentGrid = _useState4[0],
|
|
58
|
-
setContentGrid = _useState4[1];
|
|
59
|
-
|
|
60
|
-
var debounced = null;
|
|
61
|
-
useEffect(function () {
|
|
62
|
-
var bindResizeEvent = function bindResizeEvent() {
|
|
63
|
-
setContentGrid(computedCuurentGrid());
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
window.addEventListener('resize', bindResizeEvent, false);
|
|
67
|
-
return function () {
|
|
68
|
-
debounced && debounced.cancel();
|
|
69
|
-
window.removeEventListener('resize', bindResizeEvent, false);
|
|
70
|
-
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
-
}, []);
|
|
72
|
-
var rowCount = useMemo(function () {
|
|
73
|
-
return Math.floor(24 / itemGrid[currentGrid]);
|
|
74
|
-
}, [itemGrid, currentGrid]);
|
|
75
|
-
var renderData = useMemo(function () {
|
|
76
|
-
return arraySliceForX(data, rowCount);
|
|
77
|
-
}, [data, rowCount]);
|
|
78
|
-
|
|
79
|
-
function forceUpdateGrid() {
|
|
80
|
-
infiniteRef.current && infiniteRef.current._registeredChild.forceUpdateGrid();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function scrollToPosition() {
|
|
84
|
-
var _infiniteRef$current$;
|
|
85
|
-
|
|
86
|
-
infiniteRef.current && (_infiniteRef$current$ = infiniteRef.current._registeredChild).scrollToPosition.apply(_infiniteRef$current$, arguments);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function scrollToRow() {
|
|
90
|
-
var _infiniteRef$current$2;
|
|
91
|
-
|
|
92
|
-
infiniteRef.current && (_infiniteRef$current$2 = infiniteRef.current._registeredChild).scrollToRow.apply(_infiniteRef$current$2, arguments);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
useImperativeHandle(ref, function () {
|
|
96
|
-
return {
|
|
97
|
-
forceUpdateGrid: forceUpdateGrid,
|
|
98
|
-
scrollToRow: scrollToRow,
|
|
99
|
-
scrollToPosition: scrollToPosition
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
var loadMore = /*#__PURE__*/function () {
|
|
104
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
105
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
106
|
-
while (1) {
|
|
107
|
-
switch (_context.prev = _context.next) {
|
|
108
|
-
case 0:
|
|
109
|
-
if (!(props.hasLoadMore && props.loadMore && !loadingRef.current)) {
|
|
110
|
-
_context.next = 5;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
loadingRef.current = true;
|
|
115
|
-
_context.next = 4;
|
|
116
|
-
return props.loadMore();
|
|
117
|
-
|
|
118
|
-
case 4:
|
|
119
|
-
loadingRef.current = false;
|
|
120
|
-
|
|
121
|
-
case 5:
|
|
122
|
-
case "end":
|
|
123
|
-
return _context.stop();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, _callee);
|
|
127
|
-
}));
|
|
128
|
-
|
|
129
|
-
return function loadMore() {
|
|
130
|
-
return _ref.apply(this, arguments);
|
|
131
|
-
};
|
|
132
|
-
}();
|
|
133
|
-
|
|
134
|
-
function onListScroll(options) {
|
|
135
|
-
if (hasLoadPrev && !loadingRef.current && loadPrev && options.scrollTop === 0 && scrollRef.current) {
|
|
136
|
-
loadingRef.current = true;
|
|
137
|
-
loadPrev().then(function (dataLength) {
|
|
138
|
-
if (dataLength) {
|
|
139
|
-
var row = Math.ceil(dataLength / rowCount);
|
|
140
|
-
|
|
141
|
-
if (row > 0) {
|
|
142
|
-
scrollToPosition(row * itemHeight);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
loadingRef.current = false;
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (!scrollRef.current && options.scrollTop >= prethreshold) {
|
|
151
|
-
scrollRef.current = true;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
debounced && debounced.cancel();
|
|
155
|
-
debounced = debounce(function () {
|
|
156
|
-
var flag = options.scrollTop > 200;
|
|
157
|
-
|
|
158
|
-
if (showBackTop !== flag) {
|
|
159
|
-
setShowBackUp(flag);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
props.onScroll && props.onScroll(options);
|
|
163
|
-
}, 500);
|
|
164
|
-
debounced();
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function rowRender(_ref2) {
|
|
168
|
-
var key = _ref2.key,
|
|
169
|
-
index = _ref2.index,
|
|
170
|
-
style = _ref2.style;
|
|
171
|
-
var gutter = props.gutter,
|
|
172
|
-
paddingRow = props.paddingRow,
|
|
173
|
-
rowClass = props.rowClass,
|
|
174
|
-
hasLoadMore = props.hasLoadMore,
|
|
175
|
-
itemClass = props.itemClass;
|
|
176
|
-
var rowData = renderData[index] || [];
|
|
177
|
-
var len = rowCount - rowData.length;
|
|
178
|
-
|
|
179
|
-
if (rowData.length < rowCount) {
|
|
180
|
-
for (var i = 0; i < len; i++) {
|
|
181
|
-
rowData.push(null);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
186
|
-
key: key,
|
|
187
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
188
|
-
padding: "0 ".concat(paddingRow)
|
|
189
|
-
}),
|
|
190
|
-
className: "row-group-part ".concat(rowClass)
|
|
191
|
-
}, rowData.map(function (v, i) {
|
|
192
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
193
|
-
key: "".concat(key, "-").concat(i),
|
|
194
|
-
className: "row-item-part ".concat(v === null && hasLoadMore ? 'row-item-placeholder' : '', " ").concat(v !== null ? itemClass : ''),
|
|
195
|
-
style: {
|
|
196
|
-
width: "".concat(100 / 24 * itemGrid[currentGrid], "%"),
|
|
197
|
-
height: itemHeight,
|
|
198
|
-
marginRight: gutter,
|
|
199
|
-
paddingBottom: gutter
|
|
200
|
-
}
|
|
201
|
-
}, v && props.renderItem(v, i));
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function _isRowLoaded(_ref3) {
|
|
206
|
-
var index = _ref3.index;
|
|
207
|
-
return !!renderData[index];
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
-
className: "lm-c-infinite-scroll-layout ".concat(isNoData ? 'infinite-scroll-empty' : '', " ").concat(className),
|
|
212
|
-
style: isNoData ? {
|
|
213
|
-
backgroundImage: "url(".concat(noDataUrl, ")")
|
|
214
|
-
} : undefined
|
|
215
|
-
}, /*#__PURE__*/React.createElement(InfiniteLoader, {
|
|
216
|
-
isRowLoaded: _isRowLoaded,
|
|
217
|
-
loadMoreRows: loadMore,
|
|
218
|
-
rowCount: renderData.length + 1,
|
|
219
|
-
ref: infiniteRef,
|
|
220
|
-
threshold: threshold
|
|
221
|
-
}, function (_ref4) {
|
|
222
|
-
var onRowsRendered = _ref4.onRowsRendered,
|
|
223
|
-
registerChild = _ref4.registerChild;
|
|
224
|
-
return /*#__PURE__*/React.createElement(AutoSizer, null, function (_ref5) {
|
|
225
|
-
var width = _ref5.width,
|
|
226
|
-
height = _ref5.height;
|
|
227
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
228
|
-
width: width,
|
|
229
|
-
onRowsRendered: onRowsRendered,
|
|
230
|
-
ref: registerChild,
|
|
231
|
-
height: height,
|
|
232
|
-
rowCount: renderData.length,
|
|
233
|
-
rowHeight: itemHeight,
|
|
234
|
-
rowRenderer: rowRender,
|
|
235
|
-
onScroll: onListScroll
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
}), props.hasBackTop && showBackTop && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
239
|
-
title: "\u8FD4\u56DE\u9876\u90E8",
|
|
240
|
-
placement: "top"
|
|
241
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
242
|
-
className: "scoll-back-top",
|
|
243
|
-
onClick: function onClick() {
|
|
244
|
-
return scrollToPosition(0);
|
|
245
|
-
}
|
|
246
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
247
|
-
type: "icon-S_Arrow_MoveUp"
|
|
248
|
-
}))));
|
|
249
|
-
});
|
|
250
|
-
ScrollList.defaultProps = {
|
|
251
|
-
itemHeight: 200,
|
|
252
|
-
gutter: 20,
|
|
253
|
-
itemGrid: cloneDeep(simpleGrid),
|
|
254
|
-
hasLoadMore: true,
|
|
255
|
-
hasLoadPrev: true,
|
|
256
|
-
threshold: 5,
|
|
257
|
-
prethreshold: 200,
|
|
258
|
-
hasBackTop: false,
|
|
259
|
-
data: []
|
|
260
|
-
};
|
|
261
|
-
export default ScrollList;
|
package/es/ScrollList/utils.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
export function computedCuurentGrid() {
|
|
2
|
-
var width = document.body.clientWidth;
|
|
3
|
-
|
|
4
|
-
if (width >= 1600) {
|
|
5
|
-
return 'xxl';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (width >= 1200 && width < 1600) {
|
|
9
|
-
return 'xl';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (width >= 992 && width < 1200) {
|
|
13
|
-
return 'lg';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (width >= 768 && width < 992) {
|
|
17
|
-
return 'md';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (width >= 576 && width < 768) {
|
|
21
|
-
return 'sm';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (width < 576) {
|
|
25
|
-
return 'xs';
|
|
26
|
-
}
|
|
27
|
-
} // 切割数组 1维变2维
|
|
28
|
-
|
|
29
|
-
export function arraySliceForX(arr) {
|
|
30
|
-
var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
31
|
-
var newArr = [];
|
|
32
|
-
|
|
33
|
-
for (var i = 0, l = arr.length; i < l; i++) {
|
|
34
|
-
if (newArr.length === 0) {
|
|
35
|
-
newArr.push([]);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (newArr[newArr.length - 1].length > x - 1) {
|
|
39
|
-
newArr.push([]);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
newArr[newArr.length - 1].push(arr[i]);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return newArr;
|
|
46
|
-
} // 切割数组 1维变2维,分组聚合展示
|
|
47
|
-
|
|
48
|
-
export function arraySliceForXG(arr) {
|
|
49
|
-
var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
50
|
-
var isGroupTitle = arguments.length > 2 ? arguments[2] : undefined;
|
|
51
|
-
var newArr = [];
|
|
52
|
-
|
|
53
|
-
for (var i = 0, l = arr.length; i < l; i++) {
|
|
54
|
-
if (newArr.length === 0) {
|
|
55
|
-
newArr.push([]);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (isGroupTitle(arr[i])) {
|
|
59
|
-
if (newArr[newArr.length - 1].length === 0) {
|
|
60
|
-
newArr[newArr.length - 1].push(arr[i]);
|
|
61
|
-
} else {
|
|
62
|
-
newArr.push([arr[i]]);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
newArr.push([]);
|
|
66
|
-
} else {
|
|
67
|
-
if (newArr[newArr.length - 1].length > x - 1) {
|
|
68
|
-
newArr.push([]);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
newArr[newArr.length - 1].push(arr[i]);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return newArr;
|
|
76
|
-
}
|
|
77
|
-
export var simpleGrid = {
|
|
78
|
-
xxl: 4,
|
|
79
|
-
xl: 6,
|
|
80
|
-
lg: 6,
|
|
81
|
-
md: 7,
|
|
82
|
-
sm: 24,
|
|
83
|
-
xs: 24
|
|
84
|
-
};
|
package/es/Service/logger.d.ts
DELETED
package/es/Service/logger.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
2
|
-
import { $http } from './http';
|
|
3
|
-
export function save(data, token) {
|
|
4
|
-
return $http({
|
|
5
|
-
method: 'post',
|
|
6
|
-
url: "/api/log/v1/addLog",
|
|
7
|
-
data: data,
|
|
8
|
-
requestId: 'addLog',
|
|
9
|
-
headers: {
|
|
10
|
-
Authorization: token || _cache.getCache('token', 'session')
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}
|
package/es/Service/utils.d.ts
DELETED
package/es/Service/utils.js
DELETED
package/es/TreeMode/demo.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import "antd/lib/config-provider/style";
|
|
2
|
-
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import BsTree from './index';
|
|
5
|
-
|
|
6
|
-
function App() {
|
|
7
|
-
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
8
|
-
prefixCls: "cloudapp"
|
|
9
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
style: {
|
|
11
|
-
padding: 20,
|
|
12
|
-
height: 400,
|
|
13
|
-
display: 'flex'
|
|
14
|
-
}
|
|
15
|
-
}, /*#__PURE__*/React.createElement(BsTree, {
|
|
16
|
-
title: "\u8BBE\u5907\u4E1A\u52A1\u6811",
|
|
17
|
-
mode: "Bz"
|
|
18
|
-
}), /*#__PURE__*/React.createElement(BsTree, {
|
|
19
|
-
title: "\u81EA\u5B9A\u4E49\u5206\u7EC4",
|
|
20
|
-
mode: "Custom"
|
|
21
|
-
}), /*#__PURE__*/React.createElement(BsTree, {
|
|
22
|
-
title: "\u884C\u653F\u533A\u5212",
|
|
23
|
-
mode: "Place",
|
|
24
|
-
checkable: true,
|
|
25
|
-
checkStrictly: true
|
|
26
|
-
}), /*#__PURE__*/React.createElement(BsTree, {
|
|
27
|
-
title: "\u7EC4\u7EC7\u673A\u6784",
|
|
28
|
-
mode: "Org"
|
|
29
|
-
})));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default App;
|
package/es/TreeMode/index.css
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.bc-type-tree-layout {
|
|
2
|
-
height: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
border: 1px solid var(--bd-color);
|
|
6
|
-
margin-left: -1px;
|
|
7
|
-
}
|
|
8
|
-
.bc-type-tree-layout .lm-c-tree-title-part {
|
|
9
|
-
border-bottom: 1px solid var(--bd-color);
|
|
10
|
-
background-color: var(--form-bg-light);
|
|
11
|
-
}
|
|
12
|
-
.bc-type-tree-layout > .lm-base-tree-component {
|
|
13
|
-
flex: 1;
|
|
14
|
-
overflow: auto;
|
|
15
|
-
}
|
|
16
|
-
.bc-type-tree-layout .cloudapp-tree {
|
|
17
|
-
height: 100%;
|
|
18
|
-
overflow: auto;
|
|
19
|
-
}
|
|
20
|
-
.bc-type-tree-layout .anticon {
|
|
21
|
-
font-size: var(--fs);
|
|
22
|
-
}
|
|
23
|
-
.bc-type-tree-layout .cloudapp-tree-title {
|
|
24
|
-
font-size: var(--fs-small);
|
|
25
|
-
flex: 1;
|
|
26
|
-
}
|
|
27
|
-
.bc-type-tree-layout .cloudapp-tree-title > span {
|
|
28
|
-
min-width: 100%;
|
|
29
|
-
display: inline-flex;
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
}
|
|
32
|
-
.bc-type-tree-layout .cloudapp-tree-title > span .anticon {
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
color: var(--icon);
|
|
35
|
-
padding-right: 6px;
|
|
36
|
-
position: relative;
|
|
37
|
-
top: 1px;
|
|
38
|
-
}
|
package/es/TreeMode/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseTreeProps } from '../Tree';
|
|
3
|
-
import './index.less';
|
|
4
|
-
interface IBsTreeProps extends BaseTreeProps {
|
|
5
|
-
title?: React.ReactNode;
|
|
6
|
-
inputPlaceholder?: string;
|
|
7
|
-
renderHeader?: () => JSX.Element;
|
|
8
|
-
/**
|
|
9
|
-
* @description 需要默认选中时触发 事件
|
|
10
|
-
*/
|
|
11
|
-
onDefailtSelect?: (id?: string) => void;
|
|
12
|
-
mode?: 'Bz' | 'Custom' | 'Place' | 'Org';
|
|
13
|
-
}
|
|
14
|
-
declare function TreeMode({ title, className, renderHeader, inputPlaceholder, treeNodeProps, onDefailtSelect, mode, showIcon, ...props }: IBsTreeProps): JSX.Element;
|
|
15
|
-
declare namespace TreeMode {
|
|
16
|
-
var defaultProps: {
|
|
17
|
-
mode: string;
|
|
18
|
-
className: string;
|
|
19
|
-
treeNodeProps: {};
|
|
20
|
-
showIcon: boolean;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export default TreeMode;
|
package/es/TreeMode/index.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
2
|
-
|
|
3
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
|
|
9
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
-
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
-
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
|
-
import { __rest } from "tslib";
|
|
24
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
25
|
-
import api from '../Api';
|
|
26
|
-
import TreeTitle from '../TreeTitle';
|
|
27
|
-
import { getParentListById, getPlaceCodesWithParent } from '../utils';
|
|
28
|
-
import IconFont from '../IconFont';
|
|
29
|
-
import useHttp from '../useHttp';
|
|
30
|
-
import Tree from '../Tree';
|
|
31
|
-
import "./index.css";
|
|
32
|
-
var defaultList = [];
|
|
33
|
-
|
|
34
|
-
function TreeMode(_a) {
|
|
35
|
-
var title = _a.title,
|
|
36
|
-
className = _a.className,
|
|
37
|
-
renderHeader = _a.renderHeader,
|
|
38
|
-
inputPlaceholder = _a.inputPlaceholder,
|
|
39
|
-
treeNodeProps = _a.treeNodeProps,
|
|
40
|
-
onDefailtSelect = _a.onDefailtSelect,
|
|
41
|
-
mode = _a.mode,
|
|
42
|
-
showIcon = _a.showIcon,
|
|
43
|
-
props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode", "showIcon"]);
|
|
44
|
-
|
|
45
|
-
var _useState = useState({
|
|
46
|
-
keyword: undefined,
|
|
47
|
-
expandedKeys: undefined,
|
|
48
|
-
focusKey: Date.now()
|
|
49
|
-
}),
|
|
50
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
-
state = _useState2[0],
|
|
52
|
-
setState = _useState2[1];
|
|
53
|
-
/**
|
|
54
|
-
* @description 根据mode获取树的数据
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var _useHttp = useHttp(['TreeMode', mode], function (_ref) {
|
|
59
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
60
|
-
_ = _ref2[0],
|
|
61
|
-
mode = _ref2[1];
|
|
62
|
-
|
|
63
|
-
return mode === 'Bz' ? api.getDeviceBzTree() : mode === 'Custom' ? api.getCustomDeviceGroup() : mode === 'Org' ? api.getOrgs() : api.getPlacesByHasDevice();
|
|
64
|
-
}),
|
|
65
|
-
_useHttp$data = _useHttp.data,
|
|
66
|
-
list = _useHttp$data === void 0 ? defaultList : _useHttp$data;
|
|
67
|
-
|
|
68
|
-
var treeData = useMemo(function () {
|
|
69
|
-
return mode === 'Place' ? _treeHelper.computPlaceTree(list) : _treeHelper.computTreeList(list);
|
|
70
|
-
}, [list, mode]);
|
|
71
|
-
/**
|
|
72
|
-
* @description 实现关键字展开节点
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
useEffect(function () {
|
|
76
|
-
var _a, _b;
|
|
77
|
-
|
|
78
|
-
var keys = [];
|
|
79
|
-
var defaultKeys = mode === 'Place' ? [] : ((_a = treeData[0]) === null || _a === void 0 ? void 0 : _a.id) ? [(_b = treeData[0]) === null || _b === void 0 ? void 0 : _b.id] : [];
|
|
80
|
-
|
|
81
|
-
if (!state.keyword) {
|
|
82
|
-
setState(function (old) {
|
|
83
|
-
return Object.assign(Object.assign({}, old), {
|
|
84
|
-
expandedKeys: defaultKeys,
|
|
85
|
-
focusKey: Date.now()
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
switch (mode) {
|
|
92
|
-
case 'Place':
|
|
93
|
-
var places = list.filter(function (v) {
|
|
94
|
-
return v.areaName.includes(state.keyword);
|
|
95
|
-
});
|
|
96
|
-
places.forEach(function (v) {
|
|
97
|
-
var codes = getPlaceCodesWithParent(v.areaCode, list);
|
|
98
|
-
keys = [].concat(keys, codes);
|
|
99
|
-
});
|
|
100
|
-
break;
|
|
101
|
-
|
|
102
|
-
case 'Bz':
|
|
103
|
-
case 'Custom':
|
|
104
|
-
var trees = list.filter(function (v) {
|
|
105
|
-
return v.groupName.includes(state.keyword);
|
|
106
|
-
});
|
|
107
|
-
trees.forEach(function (v) {
|
|
108
|
-
var ids = getParentListById(v.id, list).map(function (v) {
|
|
109
|
-
return v.id;
|
|
110
|
-
});
|
|
111
|
-
keys = [].concat(keys, ids);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
case 'Org':
|
|
115
|
-
var orgs = list.filter(function (v) {
|
|
116
|
-
return v.organizationName.includes(state.keyword);
|
|
117
|
-
});
|
|
118
|
-
orgs.forEach(function (v) {
|
|
119
|
-
var ids = getParentListById(v.id, list).map(function (v) {
|
|
120
|
-
return v.id;
|
|
121
|
-
});
|
|
122
|
-
keys = [].concat(keys, ids);
|
|
123
|
-
});
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
var expandedKeys = _toConsumableArray(new Set(_toConsumableArray(keys)));
|
|
128
|
-
|
|
129
|
-
setState(function (old) {
|
|
130
|
-
var _a;
|
|
131
|
-
|
|
132
|
-
return Object.assign(Object.assign({}, old), {
|
|
133
|
-
expandedKeys: expandedKeys.length > 0 ? expandedKeys : [(_a = treeData[0]) === null || _a === void 0 ? void 0 : _a.id],
|
|
134
|
-
focusKey: Date.now()
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}, [state.keyword, list, treeData, mode]);
|
|
138
|
-
var treeKey = useMemo(function () {
|
|
139
|
-
return mode === 'Place' ? 'areaCode' : 'id';
|
|
140
|
-
}, [mode]);
|
|
141
|
-
var treeName = useMemo(function () {
|
|
142
|
-
return mode === 'Place' ? 'areaName' : mode === 'Org' ? 'organizationName' : 'groupName';
|
|
143
|
-
}, [mode]);
|
|
144
|
-
/**
|
|
145
|
-
* @description 触发默认选中节点事件
|
|
146
|
-
*/
|
|
147
|
-
|
|
148
|
-
useEffect(function () {
|
|
149
|
-
var id = treeData[0] ? treeData[0][treeKey] : undefined;
|
|
150
|
-
|
|
151
|
-
if (id && onDefailtSelect) {
|
|
152
|
-
onDefailtSelect(id);
|
|
153
|
-
}
|
|
154
|
-
}, [treeData, treeKey]);
|
|
155
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
-
className: "bc-type-tree-layout ".concat(className)
|
|
157
|
-
}, /*#__PURE__*/React.createElement(TreeTitle, {
|
|
158
|
-
title: title,
|
|
159
|
-
value: state.keyword,
|
|
160
|
-
inputPlaceholder: inputPlaceholder,
|
|
161
|
-
onChange: function onChange(val) {
|
|
162
|
-
return setState(function (old) {
|
|
163
|
-
return Object.assign(Object.assign({}, old), {
|
|
164
|
-
keyword: val
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}), renderHeader && renderHeader(), list.length > 0 && /*#__PURE__*/React.createElement(Tree, Object.assign({}, props, {
|
|
169
|
-
treeData: treeData,
|
|
170
|
-
key: state.focusKey,
|
|
171
|
-
showIcon: showIcon,
|
|
172
|
-
onExpand: function onExpand(keys) {
|
|
173
|
-
return setState(function (old) {
|
|
174
|
-
return Object.assign(Object.assign({}, old), {
|
|
175
|
-
expandedKeys: keys
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
},
|
|
179
|
-
expandedKeys: state.expandedKeys,
|
|
180
|
-
defaultExpandedKeys: treeData[0] ? [treeData[0].id] : undefined,
|
|
181
|
-
treeNodeProps: {
|
|
182
|
-
keyword: state.keyword,
|
|
183
|
-
suffix: treeNodeProps === null || treeNodeProps === void 0 ? void 0 : treeNodeProps.suffix,
|
|
184
|
-
nameKey: treeName,
|
|
185
|
-
key: treeKey
|
|
186
|
-
},
|
|
187
|
-
icon: function icon(node) {
|
|
188
|
-
return /*#__PURE__*/React.createElement(IconFont, {
|
|
189
|
-
type: "".concat(treeData.length === 1 && node.id === treeData[0].id ? 'icon-S_Bar_Home' : mode === 'Place' ? node.level > 4 ? 'icon-S_Place_Place' : 'icon-S_Bar_Add' : 'icon-S_Photo_ListTree')
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
})));
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
TreeMode.defaultProps = {
|
|
196
|
-
mode: 'Bz',
|
|
197
|
-
className: '',
|
|
198
|
-
treeNodeProps: {},
|
|
199
|
-
showIcon: true
|
|
200
|
-
};
|
|
201
|
-
export default TreeMode;
|
package/es/VList/index.css
DELETED