@cloud-app-dev/vidc 2.0.0-alpha.9 → 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.
Files changed (207) hide show
  1. package/.fatherrc.js +11 -4
  2. package/.umirc.ts +1 -1
  3. package/es/Api/index.js +7 -7
  4. package/es/AppRedirect/index.d.ts +1 -1
  5. package/es/AppRedirect/index.js +7 -12
  6. package/es/AppRouter/index.d.ts +8 -0
  7. package/es/AppRouter/index.js +17 -0
  8. package/es/Auth/index.js +1 -1
  9. package/es/AutoExit/index.js +12 -10
  10. package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
  11. package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
  12. package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
  13. package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
  14. package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
  15. package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
  16. package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
  17. package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
  18. package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
  19. package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
  20. package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
  21. package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
  22. package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
  23. package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
  24. package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
  25. package/es/{ContentBox → Box}/index.css +0 -0
  26. package/es/{ContentBox → Box}/index.d.ts +3 -3
  27. package/es/{ContentBox → Box}/index.js +5 -5
  28. package/es/CheckGroupFixed/index.js +4 -2
  29. package/es/Config/index.js +12 -12
  30. package/es/Config/interface.d.ts +6 -4
  31. package/es/ConfigContext/index.d.ts +15 -2
  32. package/es/ConfigContext/index.js +25 -3
  33. package/es/DeviceSelect/TreeType.d.ts +6 -0
  34. package/es/DeviceSelect/TreeType.js +36 -0
  35. package/es/DeviceSelect/demo.js +2 -2
  36. package/es/DeviceSelect/index.css +6 -1
  37. package/es/DeviceSelect/index.d.ts +5 -0
  38. package/es/DeviceSelect/index.js +22 -54
  39. package/es/Dict/hook.d.ts +0 -1
  40. package/es/Dict/hook.js +5 -21
  41. package/es/Dict/index.d.ts +1 -5
  42. package/es/Dict/index.js +2 -6
  43. package/es/Dict/utils.d.ts +0 -1
  44. package/es/Dict/utils.js +2 -9
  45. package/es/HightLevel/index.js +1 -2
  46. package/es/IconFont/index.d.ts +0 -1
  47. package/es/IconFont/index.js +12 -13
  48. package/es/InitialConfig/index.js +7 -6
  49. package/es/InitialConfig/utils.d.ts +5 -0
  50. package/es/InitialConfig/utils.js +33 -6
  51. package/es/InitialRequest/index.d.ts +3 -1
  52. package/es/InitialRequest/index.js +20 -18
  53. package/es/InitialRequest/utils.d.ts +4 -3
  54. package/es/InitialRequest/utils.js +28 -29
  55. package/es/Input/index.js +3 -2
  56. package/es/InstanceHistory/index.d.ts +3 -0
  57. package/es/InstanceHistory/index.js +9 -0
  58. package/es/List/CheckExt.d.ts +3 -5
  59. package/es/List/CheckExt.js +21 -13
  60. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  61. package/es/List/DeviceList/index.d.ts +11 -0
  62. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  63. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  64. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  65. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  66. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  67. package/es/List/DynamicDeviceList/index.js +205 -0
  68. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  69. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  70. package/es/List/DynamicDeviceList/utils.js +61 -0
  71. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  72. package/es/List/DynamicGridList/Demo.js +70 -0
  73. package/es/List/DynamicGridList/index.d.ts +26 -0
  74. package/es/List/DynamicGridList/index.js +73 -0
  75. package/es/List/GridList/Demo.d.ts +2 -0
  76. package/es/List/GridList/Demo.js +91 -0
  77. package/es/List/GridList/hook.d.ts +13 -0
  78. package/es/List/GridList/hook.js +301 -0
  79. package/es/List/GridList/index.css +7 -0
  80. package/es/List/GridList/index.d.ts +15 -0
  81. package/es/List/GridList/index.js +47 -0
  82. package/es/List/GridList/interface.d.ts +59 -0
  83. package/es/List/GridList/utils.d.ts +9 -0
  84. package/es/List/GridList/utils.js +43 -0
  85. package/es/List/ListExt/index.css +3 -0
  86. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  87. package/es/{ListExt → List/ListExt}/index.js +3 -3
  88. package/es/List/VList/index.css +6 -0
  89. package/es/List/VList/index.d.ts +18 -0
  90. package/es/List/VList/index.js +51 -0
  91. package/es/List/VList/utils.d.ts +14 -0
  92. package/es/{VList → List/VList}/utils.js +0 -0
  93. package/es/List/index.css +11 -12
  94. package/es/List/index.d.ts +5 -70
  95. package/es/List/index.js +32 -25
  96. package/es/List/interface.d.ts +87 -0
  97. package/es/List/renderItem.d.ts +1 -1
  98. package/es/List/renderItem.js +13 -10
  99. package/es/LoaderApp/index.d.ts +1 -1
  100. package/es/LoaderApp/index.js +39 -35
  101. package/es/LoaderApp/loader.js +2 -6
  102. package/es/LoaderApp/utils.d.ts +3 -1
  103. package/es/LoaderApp/utils.js +43 -3
  104. package/es/LoaderScript/index.js +7 -89
  105. package/es/LoaderScript/utils.d.ts +2 -0
  106. package/es/LoaderScript/utils.js +170 -33
  107. package/es/Picture/component/MoveContent/index.js +3 -3
  108. package/es/Picture/index.js +1 -1
  109. package/es/Picture/utils.js +1 -1
  110. package/es/RefDrawer/index.js +1 -1
  111. package/es/RefModal/index.js +1 -1
  112. package/es/Service/http.d.ts +6 -4
  113. package/es/Service/http.js +20 -22
  114. package/es/Service/index.d.ts +3 -3
  115. package/es/Service/index.js +7 -11
  116. package/es/Service/interface.d.ts +5 -11
  117. package/es/Service/middleware.d.ts +1 -1
  118. package/es/Service/middleware.js +1 -1
  119. package/es/TableLayout/index.d.ts +3 -0
  120. package/es/TableLayout/index.js +14 -45
  121. package/es/{TreeTitle → Title}/index.css +5 -5
  122. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  123. package/es/{TreeTitle → Title}/index.js +7 -4
  124. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  125. package/es/Tree/BaseTree/demo.js +69 -0
  126. package/es/Tree/BaseTree/index.css +64 -0
  127. package/es/Tree/BaseTree/index.d.ts +24 -0
  128. package/es/Tree/BaseTree/index.js +83 -0
  129. package/es/Tree/demo.js +19 -56
  130. package/es/Tree/index.css +29 -55
  131. package/es/Tree/index.d.ts +19 -20
  132. package/es/Tree/index.js +185 -70
  133. package/es/UserSelect/index.js +7 -8
  134. package/es/WorkerFlow/Form/Condition.js +2 -4
  135. package/es/WorkerFlow/Form/EmptyUserSet.js +1 -1
  136. package/es/WorkerFlow/Form/FormAuth.js +3 -3
  137. package/es/WorkerFlow/Form/GroupList.js +2 -2
  138. package/es/WorkerFlow/Form/GroupSelect.js +1 -1
  139. package/es/WorkerFlow/Form/GroupSelectModalContent.js +2 -3
  140. package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -2
  141. package/es/WorkerFlow/Form/UserAndGroupSelect.js +1 -1
  142. package/es/WorkerFlow/Form/UserSelect.js +1 -1
  143. package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -6
  144. package/es/WorkerFlow/Form/UserSet.js +3 -3
  145. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  146. package/es/WorkerFlow/index.css +9 -3
  147. package/es/WorkerFlow/index.js +14 -9
  148. package/es/WorkerFlow/utils.js +1 -1
  149. package/es/index.d.ts +4 -11
  150. package/es/index.js +4 -11
  151. package/es/useDrawer/index.d.ts +1 -1
  152. package/es/useDrawer/index.js +3 -2
  153. package/es/useHistory/index.d.ts +2 -2
  154. package/es/useHistory/index.js +3 -6
  155. package/es/useHttp/index.js +1 -1
  156. package/es/useModal/index.d.ts +1 -1
  157. package/es/useModal/index.js +3 -2
  158. package/es/utils.d.ts +9 -0
  159. package/es/utils.js +36 -1
  160. package/package.json +10 -12
  161. package/tsconfig.json +1 -1
  162. package/es/AppRoute/Render.d.ts +0 -23
  163. package/es/AppRoute/Render.js +0 -111
  164. package/es/AppRoute/Rendered.d.ts +0 -4
  165. package/es/AppRoute/Rendered.js +0 -11
  166. package/es/AppRoute/index.d.ts +0 -14
  167. package/es/AppRoute/index.js +0 -106
  168. package/es/AppRoute/interface.d.ts +0 -18
  169. package/es/AppRoute/utils.d.ts +0 -1
  170. package/es/AppRoute/utils.js +0 -28
  171. package/es/DeviceList/index.css +0 -32
  172. package/es/DeviceList/index.d.ts +0 -14
  173. package/es/Dict/desc.d.ts +0 -64
  174. package/es/Dict/desc.js +0 -162
  175. package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
  176. package/es/DynamicDeviceList/CheckExt.js +0 -36
  177. package/es/DynamicDeviceList/Demo.js +0 -17
  178. package/es/DynamicDeviceList/index.d.ts +0 -35
  179. package/es/DynamicDeviceList/index.js +0 -224
  180. package/es/DynamicDeviceList/utils.d.ts +0 -2
  181. package/es/DynamicDeviceList/utils.js +0 -15
  182. package/es/DynamicList/index.css +0 -7
  183. package/es/DynamicList/index.d.ts +0 -31
  184. package/es/DynamicList/index.js +0 -132
  185. package/es/IconFont/index.css +0 -0
  186. package/es/List/utils.d.ts +0 -5
  187. package/es/List/utils.js +0 -18
  188. package/es/ListExt/index.css +0 -9
  189. package/es/ScrollList/index.css +0 -73
  190. package/es/ScrollList/index.d.ts +0 -24
  191. package/es/ScrollList/index.js +0 -262
  192. package/es/ScrollList/utils.js +0 -84
  193. package/es/Service/logger.d.ts +0 -3
  194. package/es/Service/logger.js +0 -13
  195. package/es/Service/utils.d.ts +0 -3
  196. package/es/Service/utils.js +0 -11
  197. package/es/TreeMode/demo.js +0 -32
  198. package/es/TreeMode/index.css +0 -38
  199. package/es/TreeMode/index.d.ts +0 -23
  200. package/es/TreeMode/index.js +0 -201
  201. package/es/VList/index.css +0 -4
  202. package/es/VList/index.d.ts +0 -16
  203. package/es/VList/index.js +0 -56
  204. package/es/VList/utils.d.ts +0 -10
  205. package/es/useChangeEffect/index.d.ts +0 -3
  206. package/es/useChangeEffect/index.js +0 -32
  207. package/es/useHistory/index.css +0 -0
@@ -1,111 +0,0 @@
1
- import { __rest } from "tslib";
2
- import React, { useEffect, useMemo } from 'react';
3
- import { getRouteItem } from './utils';
4
- import useHistory from '../useHistory';
5
- import { Route, Switch } from 'react-router-dom';
6
- /**
7
- * @TODO
8
- * @多种修正使用url判断异步处理这里防止回调执行的时候url变化导致一直执行
9
- * @每次执行先清除上一次的
10
- */
11
-
12
- export var RenderRoute = /*#__PURE__*/React.memo(function (_ref) {
13
- var location = _ref.location,
14
- match = _ref.match,
15
- history = _ref.history,
16
- setRouteProps = _ref.setRouteProps;
17
- // eslint-disable-next-line react-hooks/exhaustive-deps
18
- useEffect(function () {
19
- return setRouteProps(match, location, history);
20
- }, [location.pathname]);
21
- return null;
22
- });
23
- export var RenderComponents = /*#__PURE__*/React.memo(function (_ref2) {
24
- var state = _ref2.state,
25
- props = _ref2.props;
26
-
27
- var _useMemo = useMemo(function () {
28
- return state;
29
- }, [state]),
30
- match = _useMemo.match,
31
- location = _useMemo.location;
32
-
33
- var history = useHistory();
34
-
35
- var _a = useMemo(function () {
36
- return props;
37
- }, [props]),
38
- path = _a.path,
39
- component = _a.component,
40
- render = _a.render,
41
- routes = _a.routes,
42
- other = __rest(_a, ["path", "component", "render", "routes"]);
43
-
44
- var _useMemo2 = useMemo(function () {
45
- var Com, Ren;
46
-
47
- if (!routes) {
48
- Com = component;
49
- Ren = render;
50
- } else {
51
- var routeItem = getRouteItem(match, routes);
52
- Com = routeItem.component;
53
- Ren = routeItem.render;
54
- }
55
-
56
- return {
57
- Com: Com,
58
- Ren: Ren
59
- };
60
- }, [component, match, render, routes]),
61
- Com = _useMemo2.Com,
62
- Ren = _useMemo2.Ren;
63
-
64
- return Com ? /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.createElement(Com, null), Object.assign(Object.assign({}, other), {
65
- match: match,
66
- location: location,
67
- history: history
68
- })) : Ren(Object.assign(Object.assign({}, other), {
69
- match: match,
70
- location: location,
71
- history: history
72
- }));
73
- });
74
- export function RenderRoutes(_ref3) {
75
- var routes = _ref3.routes,
76
- setRouteProps = _ref3.setRouteProps,
77
- children = _ref3.children;
78
- return /*#__PURE__*/React.createElement(Switch, null, routes.map(function (item, i) {
79
- return /*#__PURE__*/React.createElement(Route, {
80
- exact: !!item.exact,
81
- sensitive: !!item.sensitive,
82
- strict: !!item.strict,
83
- key: i,
84
- path: item.path,
85
- render: function render(props) {
86
- return /*#__PURE__*/React.createElement(RenderRoute, Object.assign({}, props, {
87
- setRouteProps: setRouteProps
88
- }));
89
- }
90
- });
91
- }), children);
92
- }
93
- export function RenderSingleRoute(_ref4) {
94
- var exact = _ref4.exact,
95
- strict = _ref4.strict,
96
- sensitive = _ref4.sensitive,
97
- path = _ref4.path,
98
- setRouteProps = _ref4.setRouteProps,
99
- children = _ref4.children;
100
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
101
- exact: !!exact,
102
- strict: !!strict,
103
- sensitive: !!sensitive,
104
- path: path,
105
- render: function render(props) {
106
- return /*#__PURE__*/React.createElement(RenderRoute, Object.assign({}, props, {
107
- setRouteProps: setRouteProps
108
- }));
109
- }
110
- }), children);
111
- }
@@ -1,4 +0,0 @@
1
- declare function Rendered({ onRendered }: {
2
- onRendered: () => void;
3
- }): JSX.Element;
4
- export default Rendered;
@@ -1,11 +0,0 @@
1
- import React, { useEffect } from 'react';
2
-
3
- function Rendered(_ref) {
4
- var onRendered = _ref.onRendered;
5
- useEffect(function () {
6
- return onRendered();
7
- }, []);
8
- return /*#__PURE__*/React.createElement(React.Fragment, null);
9
- }
10
-
11
- export default Rendered;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { match } from 'react-router-dom';
3
- import { IAppRouteType, IAppRouteProps } from './interface';
4
- import * as H from 'history';
5
- import './index.less';
6
- declare class AppRoute extends React.Component<IAppRouteProps, IAppRouteType> {
7
- private isRender;
8
- constructor(props: IAppRouteProps);
9
- shouldComponentUpdate(props: IAppRouteProps): boolean;
10
- componentWillUnmount(): void;
11
- setRouteProps: (newMatch: match<any>, newLocation: H.Location<any>, history: H.History<any>) => void;
12
- render(): JSX.Element;
13
- }
14
- export default AppRoute;
@@ -1,106 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
- import _logger from "@cloud-app-dev/utils/es/logger";
4
- import _cache from "@cloud-app-dev/utils/es/cache";
5
- import _isEqual from "@cloud-app-dev/utils/es/isEqual";
6
-
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
-
9
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
10
-
11
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
12
-
13
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
-
15
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
-
17
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
18
-
19
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
20
-
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
-
23
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
-
25
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
-
27
- import React from 'react';
28
- import { RenderComponents, RenderRoutes, RenderSingleRoute } from './Render';
29
- import Rendered from './Rendered';
30
- import "./index.css";
31
- var _global = window;
32
-
33
- var AppRoute = /*#__PURE__*/function (_React$Component) {
34
- _inherits(AppRoute, _React$Component);
35
-
36
- var _super = _createSuper(AppRoute);
37
-
38
- function AppRoute(props) {
39
- var _this;
40
-
41
- _classCallCheck(this, AppRoute);
42
-
43
- _this = _super.call(this, props);
44
-
45
- _this.setRouteProps = function (newMatch, newLocation, history) {
46
- if (!_isEqual(_this.props.match, newMatch)) {
47
- _this.setState({
48
- match: newMatch,
49
- location: newLocation,
50
- history: history
51
- });
52
- }
53
- }; //可能存在路由创建但是没有render 导致UI无法渲染
54
-
55
-
56
- _this.isRender = false;
57
- _this.state = {
58
- match: undefined,
59
- location: undefined,
60
- history: undefined
61
- };
62
- return _this;
63
- }
64
-
65
- _createClass(AppRoute, [{
66
- key: "shouldComponentUpdate",
67
- value: function shouldComponentUpdate(props) {
68
- if (!_global._IS_RUN_MICRO_BASIC || !this.isRender || _global._IS_ALLOW_ROUTE_RENDER) {
69
- return true;
70
- }
71
-
72
- return (props.currentId || _cache.getCache('currentTabKey', 'session')) === props.tabId;
73
- }
74
- }, {
75
- key: "componentWillUnmount",
76
- value: function componentWillUnmount() {
77
- _logger.debug('路由销毁');
78
- }
79
- }, {
80
- key: "render",
81
- value: function render() {
82
- var _this2 = this;
83
-
84
- var _this$state = this.state,
85
- match = _this$state.match,
86
- location = _this$state.location;
87
- var isRouteMath = match && location;
88
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.routes ? /*#__PURE__*/React.createElement(RenderRoutes, Object.assign({}, this.props, {
89
- setRouteProps: this.setRouteProps
90
- })) : /*#__PURE__*/React.createElement(RenderSingleRoute, Object.assign({}, this.props, {
91
- setRouteProps: this.setRouteProps
92
- })), isRouteMath && /*#__PURE__*/React.createElement(RenderComponents, {
93
- state: this.state,
94
- props: this.props
95
- }), isRouteMath && /*#__PURE__*/React.createElement(Rendered, {
96
- onRendered: function onRendered() {
97
- return _this2.isRender = true;
98
- }
99
- }));
100
- }
101
- }]);
102
-
103
- return AppRoute;
104
- }(React.Component);
105
-
106
- export default AppRoute;
@@ -1,18 +0,0 @@
1
- import * as H from 'history';
2
- import { RouteProps, match } from 'react-router-dom';
3
-
4
- export interface IAppRouteType {
5
- match?: match<any>;
6
- location?: H.Location | undefined;
7
- history?: H.History;
8
- }
9
-
10
- export interface IAppRouteProps extends RouteProps, IAppRouteType {
11
- routes?: RouteProps[];
12
- tabId?: string;
13
- currentId?: string;
14
- }
15
-
16
- export interface IRenderRouteProps extends IAppRouteType {
17
- setRouteProps: (match: match<any>, location: H.Location, history: H.History) => void;
18
- }
@@ -1 +0,0 @@
1
- export declare const getRouteItem: (match: any, routes: any[]) => any;
@@ -1,28 +0,0 @@
1
- export var getRouteItem = function getRouteItem(match, routes) {
2
- var matchParams = match.params || {};
3
- var routeItem = routes.find(function (v) {
4
- return v.path === match.url;
5
- });
6
-
7
- if (routeItem) {
8
- return routeItem;
9
- } else {
10
- var keys = Object.keys(matchParams);
11
- var tempPaths = routes.map(function (v) {
12
- return v.path;
13
- });
14
- tempPaths.forEach(function (path, index) {
15
- var newPath = path;
16
- keys.forEach(function (key) {
17
- if (path.includes(":".concat(key))) {
18
- newPath = path.replace(":".concat(key), matchParams[key]);
19
- }
20
- });
21
- tempPaths[index] = newPath;
22
- });
23
- var index = tempPaths.findIndex(function (v) {
24
- return v === match.url;
25
- });
26
- return routes[index];
27
- }
28
- };
@@ -1,32 +0,0 @@
1
- .lm-c-device-list-wrapper {
2
- margin-left: -1px;
3
- }
4
- .lm-c-device-list-wrapper .list-item label .clear-item {
5
- display: none;
6
- cursor: pointer;
7
- font-size: var(--fs);
8
- }
9
- .lm-c-device-list-wrapper .list-item:hover .clear-item {
10
- display: inline-block;
11
- }
12
- .lm-c-device-list-wrapper .list-item .an-device-task {
13
- width: 250px;
14
- display: flex;
15
- }
16
- .lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-operate {
17
- margin-right: 8px;
18
- }
19
- .lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-operate .operateitem {
20
- margin-right: 14px;
21
- font-size: 14px;
22
- }
23
- .lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-chose {
24
- display: flex;
25
- justify-content: center;
26
- align-items: center;
27
- width: 120px;
28
- margin-left: 46px;
29
- }
30
- .lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-chose .operate-item {
31
- margin-right: 22px;
32
- }
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { CheckListProps } from '../List';
3
- import { DeviceItemType } from '../core';
4
- import './index.less';
5
- interface DeviceListProps extends CheckListProps<DeviceItemType> {
6
- deviceList?: Array<DeviceItemType>;
7
- deleteItem?: (item: DeviceItemType) => void;
8
- className?: string;
9
- getIconStyle?: (item: DeviceItemType) => React.CSSProperties;
10
- title?: string;
11
- onKeywordChange?: (v: string) => void;
12
- }
13
- declare function DeviceList({ getIconStyle, className, deleteItem, deviceList, onMouseOverItem, renderItemExt, title, onKeywordChange, itemKey, ...props }: DeviceListProps): JSX.Element;
14
- export default DeviceList;
package/es/Dict/desc.d.ts DELETED
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- import { DictItem } from './interface';
3
- export declare function withDict(codes?: any[], isWebVisible?: boolean): (Component: any) => (props: any) => JSX.Element;
4
- export declare function withTypeCodes(Component: any): {
5
- new (props: any): {
6
- componentDidMount(): void;
7
- render(): JSX.Element;
8
- context: any;
9
- setState<K extends "typeCodes" | "isInit">(state: {
10
- typeCodes: DictItem[];
11
- isInit: boolean;
12
- } | ((prevState: Readonly<{
13
- typeCodes: DictItem[];
14
- isInit: boolean;
15
- }>, props: Readonly<any>) => {
16
- typeCodes: DictItem[];
17
- isInit: boolean;
18
- } | Pick<{
19
- typeCodes: DictItem[];
20
- isInit: boolean;
21
- }, K>) | Pick<{
22
- typeCodes: DictItem[];
23
- isInit: boolean;
24
- }, K>, callback?: () => void): void;
25
- forceUpdate(callback?: () => void): void;
26
- readonly props: Readonly<any> & Readonly<{
27
- children?: React.ReactNode;
28
- }>;
29
- state: Readonly<{
30
- typeCodes: DictItem[];
31
- isInit: boolean;
32
- }>;
33
- refs: {
34
- [key: string]: React.ReactInstance;
35
- };
36
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{
37
- typeCodes: DictItem[];
38
- isInit: boolean;
39
- }>, nextContext: any): boolean;
40
- componentWillUnmount?(): void;
41
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
42
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{
43
- typeCodes: DictItem[];
44
- isInit: boolean;
45
- }>): any;
46
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{
47
- typeCodes: DictItem[];
48
- isInit: boolean;
49
- }>, snapshot?: any): void;
50
- componentWillMount?(): void;
51
- UNSAFE_componentWillMount?(): void;
52
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
53
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
54
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{
55
- typeCodes: DictItem[];
56
- isInit: boolean;
57
- }>, nextContext: any): void;
58
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{
59
- typeCodes: DictItem[];
60
- isInit: boolean;
61
- }>, nextContext: any): void;
62
- };
63
- contextType?: React.Context<any>;
64
- };
package/es/Dict/desc.js DELETED
@@ -1,162 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
-
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8
-
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
-
11
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
-
13
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
-
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
-
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
-
21
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
-
23
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
24
-
25
- 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."); }
26
-
27
- 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); }
28
-
29
- 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; }
30
-
31
- 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; }
32
-
33
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
-
35
- import React, { useRef, useState, useEffect } from 'react';
36
- import { queryByTypeCodes, queryTypeCodes, formartItemTextExt } from './utils';
37
- import LMDict from './cache';
38
- export function withDict() {
39
- var codes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
40
- var isWebVisible = arguments.length > 1 ? arguments[1] : undefined;
41
- return function (Component) {
42
- return function (props) {
43
- var isInitRef = useRef(false);
44
-
45
- var _useState = useState(function () {
46
- var map = {};
47
- codes.forEach(function (code) {
48
- if (LMDict.data[code]) {
49
- map[code] = LMDict.data[code];
50
- } else {
51
- map[code] = [];
52
- }
53
- });
54
- return map;
55
- }),
56
- _useState2 = _slicedToArray(_useState, 2),
57
- dictMap = _useState2[0],
58
- setDictMap = _useState2[1];
59
-
60
- useEffect(function () {
61
- var nocacheCodes = codes.filter(function (v) {
62
- return !LMDict.data[v];
63
- });
64
-
65
- if (nocacheCodes.length === 0) {
66
- isInitRef.current = true;
67
- setDictMap(function (old) {
68
- return Object.assign({}, old);
69
- });
70
- return;
71
- }
72
-
73
- queryByTypeCodes(nocacheCodes, isWebVisible).then(function (res) {
74
- isInitRef.current = true;
75
- var data = res.data;
76
- data.forEach(function (item) {
77
- item.label = item.name;
78
- item.value = item.code;
79
- item = Object.assign(Object.assign({}, item), formartItemTextExt(item.extText));
80
- });
81
- setDictMap(function (old) {
82
- nocacheCodes.forEach(function (code) {
83
- var itemCodes = data.filter(function (v1) {
84
- return +v1.typeCode === +code;
85
- });
86
- old[code] = itemCodes;
87
- LMDict.updateDictMap(code, itemCodes);
88
- });
89
- return Object.assign({}, old);
90
- });
91
- });
92
- }, []);
93
-
94
- if (!isInitRef.current) {
95
- return null;
96
- }
97
-
98
- return /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {
99
- dictMap: dictMap
100
- }));
101
- };
102
- };
103
- }
104
- export function withTypeCodes(Component) {
105
- return /*#__PURE__*/function (_React$Component) {
106
- _inherits(withTypeCodesComponent, _React$Component);
107
-
108
- var _super = _createSuper(withTypeCodesComponent);
109
-
110
- function withTypeCodesComponent(props) {
111
- var _this;
112
-
113
- _classCallCheck(this, withTypeCodesComponent);
114
-
115
- _this = _super.call(this, props);
116
- _this.state = {
117
- typeCodes: LMDict.data['typeCodes'] || [],
118
- isInit: false
119
- };
120
- return _this;
121
- }
122
-
123
- _createClass(withTypeCodesComponent, [{
124
- key: "componentDidMount",
125
- value: function componentDidMount() {
126
- var _this2 = this;
127
-
128
- if (!LMDict.data['typeCodes']) {
129
- queryTypeCodes().then(function (res) {
130
- LMDict.updateDictMap('typeCodes', res);
131
-
132
- _this2.setState({
133
- typeCodes: res,
134
- isInit: true
135
- });
136
- }).catch(function () {
137
- _this2.setState({
138
- typeCodes: [],
139
- isInit: true
140
- });
141
- });
142
- } else this.setState({
143
- typeCodes: LMDict.data['typeCodes'],
144
- isInit: true
145
- });
146
- }
147
- }, {
148
- key: "render",
149
- value: function render() {
150
- if (!this.state.isInit) {
151
- return null;
152
- }
153
-
154
- return /*#__PURE__*/React.createElement(Component, Object.assign({}, this.props, {
155
- typeCodes: this.state.typeCodes
156
- }));
157
- }
158
- }]);
159
-
160
- return withTypeCodesComponent;
161
- }(React.Component);
162
- }
@@ -1,8 +0,0 @@
1
- interface ICheckExtProps {
2
- selectCount: number;
3
- count: number;
4
- onCheck: () => void;
5
- onCancel: () => void;
6
- }
7
- declare function CheckExt({ selectCount, onCheck, count, onCancel }: ICheckExtProps): JSX.Element;
8
- export default CheckExt;
@@ -1,36 +0,0 @@
1
- import "antd/lib/tooltip/style";
2
- import _Tooltip from "antd/lib/tooltip";
3
- import React from 'react';
4
- import IconFont from '../IconFont';
5
-
6
- function CheckExt(_ref) {
7
- var selectCount = _ref.selectCount,
8
- onCheck = _ref.onCheck,
9
- count = _ref.count,
10
- onCancel = _ref.onCancel;
11
- return /*#__PURE__*/React.createElement("div", {
12
- className: "c-check-list-checkext"
13
- }, /*#__PURE__*/React.createElement("span", {
14
- className: "select-group"
15
- }, /*#__PURE__*/React.createElement(_Tooltip, {
16
- title: "\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D"
17
- }, /*#__PURE__*/React.createElement(IconFont, {
18
- type: "icon-S_Photo_MarkYes",
19
- onClick: onCheck
20
- })), /*#__PURE__*/React.createElement(_Tooltip, {
21
- title: "\u53D6\u6D88\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D\u9879"
22
- }, /*#__PURE__*/React.createElement(IconFont, {
23
- type: "icon-MarkNo",
24
- onClick: onCancel
25
- }))), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009 ", /*#__PURE__*/React.createElement("span", {
26
- style: {
27
- color: 'var(--success)'
28
- }
29
- }, selectCount), " / \u603B\u6570 ", /*#__PURE__*/React.createElement("span", {
30
- style: {
31
- color: 'var(--primary)'
32
- }
33
- }, count)));
34
- }
35
-
36
- export default CheckExt;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import DynamicDeviceList from './index';
3
-
4
- function App() {
5
- return /*#__PURE__*/React.createElement("div", {
6
- style: {
7
- display: 'flex'
8
- }
9
- }, /*#__PURE__*/React.createElement("div", {
10
- style: {
11
- height: 400,
12
- width: 300
13
- }
14
- }, /*#__PURE__*/React.createElement(DynamicDeviceList, null)));
15
- }
16
-
17
- export default App;