@cloud-app-dev/vidc 2.0.0-alpha.1 → 2.0.0-alpha.13

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 (277) hide show
  1. package/.umirc.ts +2 -3
  2. package/es/Api/index.d.ts +3 -4
  3. package/es/Api/index.js +7 -8
  4. package/es/AppRedirect/index.css +0 -0
  5. package/es/AppRedirect/index.d.ts +16 -0
  6. package/es/AppRedirect/index.js +34 -0
  7. package/es/AppRoute/index.d.ts +10 -0
  8. package/es/AppRoute/index.js +115 -0
  9. package/es/AppRoute/interface.d.ts +8 -0
  10. package/es/Auth/index.d.ts +8 -0
  11. package/es/Auth/index.js +17 -0
  12. package/es/AutoExit/index.js +15 -10
  13. package/es/Box/BetweenBox/index.css +5 -0
  14. package/es/Box/BetweenBox/index.d.ts +12 -0
  15. package/es/Box/BetweenBox/index.js +24 -0
  16. package/es/Box/InfoBox/index.css +23 -0
  17. package/es/Box/InfoBox/index.d.ts +12 -0
  18. package/es/Box/InfoBox/index.js +26 -0
  19. package/es/Box/TwoColumnBox/index.css +77 -0
  20. package/es/Box/TwoColumnBox/index.d.ts +10 -0
  21. package/es/Box/TwoColumnBox/index.js +50 -0
  22. package/es/Box/deps/content-grid.d.ts +9 -0
  23. package/es/Box/deps/content-grid.js +9 -0
  24. package/es/Box/deps/grid-factory.d.ts +10 -0
  25. package/es/Box/deps/grid-factory.js +72 -0
  26. package/es/Box/deps/simple-grid.d.ts +9 -0
  27. package/es/Box/deps/simple-grid.js +8 -0
  28. package/es/Box/index.css +9 -0
  29. package/es/Box/index.d.ts +14 -0
  30. package/es/Box/index.js +28 -0
  31. package/es/CheckGroupFixed/index.css +49 -0
  32. package/es/CheckGroupFixed/index.d.ts +17 -0
  33. package/es/CheckGroupFixed/index.js +148 -0
  34. package/es/Config/index.js +63 -6
  35. package/es/Config/interface.d.ts +30 -5
  36. package/es/Config/utils.d.ts +2 -11
  37. package/es/Config/utils.js +1 -12
  38. package/es/ConfigContext/index.d.ts +3 -0
  39. package/es/DeviceIcon/icon.js +5 -5
  40. package/es/DeviceIcon/index.js +2 -2
  41. package/es/DeviceSelect/TreeType.d.ts +6 -0
  42. package/es/DeviceSelect/TreeType.js +36 -0
  43. package/es/DeviceSelect/demo.js +2 -2
  44. package/es/DeviceSelect/index.css +6 -1
  45. package/es/DeviceSelect/index.d.ts +5 -0
  46. package/es/DeviceSelect/index.js +22 -53
  47. package/es/Dict/cache.d.ts +3 -0
  48. package/es/Dict/cache.js +21 -0
  49. package/es/Dict/desc.d.ts +64 -0
  50. package/es/Dict/desc.js +162 -0
  51. package/es/Dict/device.d.ts +28 -0
  52. package/es/Dict/device.js +117 -0
  53. package/es/Dict/hook.d.ts +4 -0
  54. package/es/Dict/hook.js +114 -0
  55. package/es/Dict/index.d.ts +13 -0
  56. package/es/Dict/index.js +14 -0
  57. package/es/Dict/interface.d.ts +16 -0
  58. package/es/Dict/utils.d.ts +11 -0
  59. package/es/Dict/utils.js +51 -0
  60. package/es/Drag/DragAndDropItem.d.ts +4 -0
  61. package/es/Drag/DragAndDropItem.js +145 -0
  62. package/es/Drag/DropItem.d.ts +4 -0
  63. package/es/Drag/DropItem.js +54 -0
  64. package/es/Drag/index.css +0 -0
  65. package/es/Drag/index.d.ts +7 -0
  66. package/es/Drag/index.js +7 -0
  67. package/es/Drag/interface.d.ts +16 -0
  68. package/es/Drawer/Demo.d.ts +3 -0
  69. package/es/Drawer/Demo.js +52 -0
  70. package/es/Drawer/Footer.d.ts +4 -0
  71. package/es/Drawer/Footer.js +26 -0
  72. package/es/Drawer/index.css +39 -0
  73. package/es/Drawer/index.d.ts +12 -0
  74. package/es/Drawer/index.js +41 -0
  75. package/es/Drawer/interface.d.ts +191 -0
  76. package/es/FullScreen/index.css +16 -0
  77. package/es/FullScreen/index.d.ts +10 -0
  78. package/es/FullScreen/index.js +68 -0
  79. package/es/HightLevel/index.css +3 -0
  80. package/es/HightLevel/index.d.ts +9 -0
  81. package/es/HightLevel/index.js +23 -0
  82. package/es/IconFont/index.d.ts +12 -0
  83. package/es/IconFont/index.js +57 -0
  84. package/es/ImageView/index.css +6 -0
  85. package/es/ImageView/index.d.ts +17 -0
  86. package/es/ImageView/index.js +58 -0
  87. package/es/InitialConfig/index.js +7 -11
  88. package/es/InitialConfig/utils.d.ts +1 -1
  89. package/es/InitialConfig/utils.js +8 -31
  90. package/es/InitialRequest/index.d.ts +1 -1
  91. package/es/InitialRequest/index.js +19 -11
  92. package/es/InitialRequest/utils.d.ts +5 -4
  93. package/es/InitialRequest/utils.js +58 -94
  94. package/es/Input/index.css +8 -0
  95. package/es/Input/index.d.ts +18 -0
  96. package/es/Input/index.js +76 -0
  97. package/es/LabelValue/index.css +18 -0
  98. package/es/LabelValue/index.d.ts +23 -0
  99. package/es/LabelValue/index.js +32 -0
  100. package/es/{DynamicDeviceList → List}/CheckExt.d.ts +0 -0
  101. package/es/{DynamicDeviceList → List}/CheckExt.js +4 -4
  102. package/es/List/DeviceList/index.css +0 -0
  103. package/es/List/DeviceList/index.d.ts +11 -0
  104. package/es/{DeviceList → List/DeviceList}/index.js +8 -20
  105. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  106. package/es/List/DynamicDeviceList/Demo.js +54 -0
  107. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  108. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  109. package/es/List/DynamicDeviceList/index.js +205 -0
  110. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  111. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  112. package/es/List/DynamicDeviceList/utils.js +61 -0
  113. package/es/List/DynamicGridList/Demo.d.ts +2 -0
  114. package/es/List/DynamicGridList/Demo.js +70 -0
  115. package/es/List/DynamicGridList/index.d.ts +26 -0
  116. package/es/List/DynamicGridList/index.js +73 -0
  117. package/es/List/GridList/Demo.d.ts +2 -0
  118. package/es/List/GridList/Demo.js +91 -0
  119. package/es/List/GridList/hook.d.ts +13 -0
  120. package/es/List/GridList/hook.js +301 -0
  121. package/es/List/GridList/index.css +7 -0
  122. package/es/List/GridList/index.d.ts +15 -0
  123. package/es/List/GridList/index.js +47 -0
  124. package/es/List/GridList/interface.d.ts +59 -0
  125. package/es/List/GridList/utils.d.ts +9 -0
  126. package/es/List/GridList/utils.js +43 -0
  127. package/es/List/ListExt/index.css +3 -0
  128. package/es/List/ListExt/index.d.ts +19 -0
  129. package/es/List/ListExt/index.js +44 -0
  130. package/es/List/VList/index.css +6 -0
  131. package/es/List/VList/index.d.ts +18 -0
  132. package/es/List/VList/index.js +51 -0
  133. package/es/List/VList/utils.d.ts +14 -0
  134. package/es/List/VList/utils.js +17 -0
  135. package/es/List/index.css +60 -5
  136. package/es/List/index.d.ts +10 -13
  137. package/es/List/index.js +170 -36
  138. package/es/List/interface.d.ts +87 -0
  139. package/es/List/renderItem.d.ts +20 -0
  140. package/es/List/renderItem.js +71 -0
  141. package/es/LoaderApp/index.css +3 -0
  142. package/es/LoaderApp/index.d.ts +31 -0
  143. package/es/LoaderApp/index.js +135 -0
  144. package/es/LoaderApp/interface.d.ts +6 -0
  145. package/es/LoaderApp/loader.d.ts +20 -0
  146. package/es/LoaderApp/loader.js +86 -0
  147. package/es/LoaderApp/utils.d.ts +13 -0
  148. package/es/LoaderApp/utils.js +121 -0
  149. package/es/LoaderScript/index.d.ts +26 -0
  150. package/es/LoaderScript/index.js +127 -0
  151. package/es/LoaderScript/interface.d.ts +26 -0
  152. package/es/LoaderScript/utils.d.ts +12 -0
  153. package/es/LoaderScript/utils.js +133 -0
  154. package/es/Modal/index.css +43 -0
  155. package/es/Modal/index.d.ts +17 -0
  156. package/es/Modal/index.js +34 -0
  157. package/es/Modal/interface.d.ts +339 -0
  158. package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
  159. package/es/Picture/component/DefaultRects/RectInfo.js +94 -0
  160. package/es/Picture/component/DefaultRects/index.css +247 -0
  161. package/es/Picture/component/DefaultRects/index.d.ts +12 -0
  162. package/es/Picture/component/DefaultRects/index.js +47 -0
  163. package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
  164. package/es/Picture/component/DefaultRects/utils.js +11 -0
  165. package/es/Picture/component/DrawRect/index.css +8 -0
  166. package/es/Picture/component/DrawRect/index.d.ts +14 -0
  167. package/es/Picture/component/DrawRect/index.js +41 -0
  168. package/es/Picture/component/MoveContent/index.css +0 -0
  169. package/es/Picture/component/MoveContent/index.d.ts +39 -0
  170. package/es/Picture/component/MoveContent/index.js +240 -0
  171. package/es/Picture/component/MoveContent/utils.d.ts +4 -0
  172. package/es/Picture/component/MoveContent/utils.js +19 -0
  173. package/es/Picture/component/RectMenu/index.css +31 -0
  174. package/es/Picture/component/RectMenu/index.d.ts +13 -0
  175. package/es/Picture/component/RectMenu/index.js +81 -0
  176. package/es/Picture/component/RectMenu/utils.d.ts +12 -0
  177. package/es/Picture/component/RectMenu/utils.js +22 -0
  178. package/es/Picture/component/Tools/index.css +42 -0
  179. package/es/Picture/component/Tools/index.d.ts +13 -0
  180. package/es/Picture/component/Tools/index.js +83 -0
  181. package/es/Picture/component/WheelScale/index.d.ts +6 -0
  182. package/es/Picture/component/WheelScale/index.js +29 -0
  183. package/es/Picture/dragBound.d.ts +5 -0
  184. package/es/Picture/dragBound.js +77 -0
  185. package/es/Picture/index.css +12 -0
  186. package/es/Picture/index.d.ts +16 -0
  187. package/es/Picture/index.js +344 -0
  188. package/es/Picture/interface.d.ts +67 -0
  189. package/es/Picture/loadCaptureRectImage.d.ts +8 -0
  190. package/es/Picture/loadCaptureRectImage.js +119 -0
  191. package/es/Picture/useDraw.d.ts +1 -0
  192. package/es/Picture/useDraw.js +136 -0
  193. package/es/Picture/utils.d.ts +22 -0
  194. package/es/Picture/utils.js +90 -0
  195. package/es/Progress/index.css +20 -0
  196. package/es/Progress/index.d.ts +11 -0
  197. package/es/Progress/index.js +68 -0
  198. package/es/RefDrawer/index.js +4 -5
  199. package/es/RefModal/index.js +4 -5
  200. package/es/Service/http.d.ts +1 -1
  201. package/es/Service/http.js +2 -25
  202. package/es/TableLayout/index.css +4 -0
  203. package/es/TableLayout/index.d.ts +13 -0
  204. package/es/TableLayout/index.js +33 -0
  205. package/es/ThemeAntd/index.css +501 -0
  206. package/es/ThemeAntd/index.d.ts +7 -0
  207. package/es/ThemeAntd/index.js +6 -0
  208. package/es/ThemeAntd/style/button.css +46 -0
  209. package/es/ThemeAntd/style/checkbox.css +64 -0
  210. package/es/ThemeAntd/style/form.css +10 -0
  211. package/es/ThemeAntd/style/input.css +58 -0
  212. package/es/ThemeAntd/style/pagination.css +44 -0
  213. package/es/ThemeAntd/style/picker.css +86 -0
  214. package/es/ThemeAntd/style/popover.css +3 -0
  215. package/es/ThemeAntd/style/radio.css +71 -0
  216. package/es/ThemeAntd/style/scrollbar.css +19 -0
  217. package/es/ThemeAntd/style/select.css +57 -0
  218. package/es/ThemeAntd/style/table.css +36 -0
  219. package/es/ThemeAntd/style/tree.css +4 -0
  220. package/es/{TreeTitle → Title}/index.css +5 -5
  221. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  222. package/es/{TreeTitle → Title}/index.js +9 -6
  223. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  224. package/es/Tree/BaseTree/demo.js +69 -0
  225. package/es/Tree/BaseTree/index.css +64 -0
  226. package/es/Tree/BaseTree/index.d.ts +24 -0
  227. package/es/Tree/BaseTree/index.js +83 -0
  228. package/es/Tree/demo.d.ts +2 -0
  229. package/es/{TreeMode → Tree}/demo.js +0 -0
  230. package/es/{TreeMode → Tree}/index.css +1 -1
  231. package/es/{TreeMode → Tree}/index.d.ts +1 -1
  232. package/es/{TreeMode → Tree}/index.js +9 -12
  233. package/es/UserSelect/index.d.ts +3 -3
  234. package/es/UserSelect/index.js +18 -15
  235. package/es/WorkerFlow/Form/Condition.js +6 -8
  236. package/es/WorkerFlow/Form/EmptyUserSet.js +4 -6
  237. package/es/WorkerFlow/Form/FormAuth.js +3 -3
  238. package/es/WorkerFlow/Form/GroupList.js +2 -2
  239. package/es/WorkerFlow/Form/GroupSelect.js +4 -6
  240. package/es/WorkerFlow/Form/GroupSelectModalContent.js +8 -7
  241. package/es/WorkerFlow/Form/LevelGroupSelect.js +5 -7
  242. package/es/WorkerFlow/Form/UserAndGroupSelect.js +4 -6
  243. package/es/WorkerFlow/Form/UserSelect.js +4 -6
  244. package/es/WorkerFlow/Form/UserSelectModalContent.js +8 -6
  245. package/es/WorkerFlow/Form/UserSet.js +3 -3
  246. package/es/WorkerFlow/Nodes/Add.js +2 -3
  247. package/es/WorkerFlow/Nodes/AddOption.js +2 -2
  248. package/es/WorkerFlow/Nodes/Approver.js +2 -2
  249. package/es/WorkerFlow/Nodes/Condition.js +2 -2
  250. package/es/WorkerFlow/Nodes/Handle.js +2 -2
  251. package/es/WorkerFlow/Nodes/Notifier.js +2 -2
  252. package/es/WorkerFlow/Nodes/TitleElement.js +70 -36
  253. package/es/WorkerFlow/index.css +9 -3
  254. package/es/WorkerFlow/index.js +3 -3
  255. package/es/WorkerFlow/utils.js +2 -2
  256. package/es/core.d.ts +27 -0
  257. package/es/index.d.ts +27 -4
  258. package/es/index.js +27 -4
  259. package/es/useDrawer/index.d.ts +14 -0
  260. package/es/useDrawer/index.js +91 -0
  261. package/es/useHttp/index.d.ts +8 -0
  262. package/es/useHttp/index.js +78 -0
  263. package/es/useModal/index.d.ts +14 -0
  264. package/es/useModal/index.js +93 -0
  265. package/es/useNavigate/index.css +0 -0
  266. package/es/useNavigate/index.d.ts +4 -0
  267. package/es/useNavigate/index.js +14 -0
  268. package/es/utils.d.ts +11 -0
  269. package/es/utils.js +68 -1
  270. package/package.json +10 -8
  271. package/es/DeviceList/index.css +0 -32
  272. package/es/DeviceList/index.d.ts +0 -14
  273. package/es/DynamicDeviceList/Demo.js +0 -17
  274. package/es/DynamicDeviceList/index.d.ts +0 -35
  275. package/es/DynamicDeviceList/index.js +0 -224
  276. package/es/DynamicDeviceList/utils.d.ts +0 -2
  277. package/es/DynamicDeviceList/utils.js +0 -15
@@ -0,0 +1,72 @@
1
+ export function getGridClassName(grid) {
2
+ var classNames = [];
3
+
4
+ for (var k in grid) {
5
+ classNames.push("cloudapp-col-".concat(k, "-").concat(grid[k]));
6
+ }
7
+
8
+ return [].concat('cloudapp-col', classNames);
9
+ }
10
+ export function computedGrid(grid) {
11
+ var contentGrid = {
12
+ xxl: 0,
13
+ xl: 0,
14
+ lg: 0,
15
+ md: 0,
16
+ sm: 0,
17
+ xs: 0
18
+ };
19
+
20
+ if (Array.isArray(grid)) {
21
+ grid.forEach(function (item) {
22
+ for (var k in item) {
23
+ if (contentGrid[k]) {
24
+ contentGrid[k] = contentGrid[k] - item[k];
25
+ } else {
26
+ contentGrid[k] = 24 - item[k];
27
+ }
28
+ }
29
+ });
30
+ } else {
31
+ for (var k in grid) {
32
+ contentGrid[k] = 24 - grid[k];
33
+ }
34
+ }
35
+
36
+ for (var _k in contentGrid) {
37
+ if (contentGrid[_k] <= 0) {
38
+ contentGrid[_k] = 24;
39
+ }
40
+ }
41
+
42
+ return contentGrid;
43
+ }
44
+ export function computedCuurentGrid() {
45
+ var width = document.body.clientWidth;
46
+
47
+ if (width >= 1600) {
48
+ return 'xxl';
49
+ }
50
+
51
+ if (width >= 1200 && width < 1600) {
52
+ return 'xl';
53
+ }
54
+
55
+ if (width >= 992 && width < 1200) {
56
+ return 'lg';
57
+ }
58
+
59
+ if (width >= 768 && width < 992) {
60
+ return 'md';
61
+ }
62
+
63
+ if (width >= 576 && width < 768) {
64
+ return 'sm';
65
+ }
66
+
67
+ if (width < 576) {
68
+ return 'xs';
69
+ }
70
+
71
+ return undefined;
72
+ }
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ xxl: number;
3
+ xl: number;
4
+ lg: number;
5
+ md: number;
6
+ sm: number;
7
+ xs: number;
8
+ };
9
+ export default _default;
@@ -0,0 +1,8 @@
1
+ export default {
2
+ xxl: 4,
3
+ xl: 6,
4
+ lg: 6,
5
+ md: 7,
6
+ sm: 24,
7
+ xs: 24
8
+ };
@@ -0,0 +1,9 @@
1
+ .single-column-layout-container {
2
+ width: 100%;
3
+ height: 100%;
4
+ background-color: var(--content-box-bg);
5
+ }
6
+ .single-column-layout-container .single-column-content {
7
+ margin: 0 auto;
8
+ height: 100%;
9
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface ContentBoxProps {
4
+ className?: string;
5
+ contentGrid?: any;
6
+ children?: React.ReactNode;
7
+ }
8
+ declare function Box({ className, contentGrid, children }: ContentBoxProps): JSX.Element;
9
+ declare namespace Box {
10
+ var TwoColumnBox: typeof import("./TwoColumnBox").default;
11
+ var InfoBox: typeof import("./InfoBox").default;
12
+ var BetweenBox: typeof import("./BetweenBox").default;
13
+ }
14
+ export default Box;
@@ -0,0 +1,28 @@
1
+ import "antd/lib/col/style";
2
+ import _Col from "antd/lib/col";
3
+ import "antd/lib/row/style";
4
+ import _Row from "antd/lib/row";
5
+ import React from 'react';
6
+ import TwoColumnBox from './TwoColumnBox';
7
+ import InfoBox from './InfoBox';
8
+ import defaultContentGrid from './deps/content-grid';
9
+ import BetweenBox from './BetweenBox';
10
+ import "./index.css";
11
+
12
+ function Box(_ref) {
13
+ var _ref$className = _ref.className,
14
+ className = _ref$className === void 0 ? '' : _ref$className,
15
+ _ref$contentGrid = _ref.contentGrid,
16
+ contentGrid = _ref$contentGrid === void 0 ? defaultContentGrid : _ref$contentGrid,
17
+ children = _ref.children;
18
+ return /*#__PURE__*/React.createElement(_Row, {
19
+ className: "single-column-layout-container ".concat(className)
20
+ }, /*#__PURE__*/React.createElement(_Col, Object.assign({
21
+ className: "single-column-content"
22
+ }, contentGrid), children));
23
+ }
24
+
25
+ Box.TwoColumnBox = TwoColumnBox;
26
+ Box.InfoBox = InfoBox;
27
+ Box.BetweenBox = BetweenBox;
28
+ export default Box;
@@ -0,0 +1,49 @@
1
+ .c-check-group-layout {
2
+ position: relative;
3
+ }
4
+ .c-check-group-layout .c-check-group-box {
5
+ padding: 10px;
6
+ display: flex;
7
+ }
8
+ .c-check-group-layout .check-label-box {
9
+ width: 80px;
10
+ color: #999;
11
+ }
12
+ .c-check-group-layout .check-content-box {
13
+ width: 100%;
14
+ flex: 1;
15
+ overflow: hidden;
16
+ height: 30px;
17
+ }
18
+ .c-check-group-layout .check-content-box .cloudapp-checkbox-group {
19
+ display: grid;
20
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
21
+ grid-row-gap: 10px;
22
+ grid-column-gap: 10px;
23
+ }
24
+ .c-check-group-layout .check-content-box .cloudapp-checkbox-group .cloudapp-checkbox-wrapper {
25
+ width: 120px;
26
+ margin-left: 0;
27
+ height: 30px;
28
+ display: flex;
29
+ }
30
+ .c-check-group-layout .check-content-box .cloudapp-checkbox-group .cloudapp-checkbox-wrapper > span:not(.cloudapp-checkbox) {
31
+ flex: 1;
32
+ white-space: nowrap;
33
+ overflow: hidden;
34
+ text-overflow: ellipsis;
35
+ }
36
+ .c-check-group-layout .sider-mask {
37
+ position: fixed;
38
+ z-index: 98;
39
+ width: 100%;
40
+ height: 100%;
41
+ left: 0;
42
+ top: 0;
43
+ }
44
+ .c-check-group-layout .slice-btn {
45
+ color: var(--primary);
46
+ cursor: pointer;
47
+ position: relative;
48
+ top: 4px;
49
+ }
@@ -0,0 +1,17 @@
1
+ import './index.less';
2
+ export interface SourceDictType {
3
+ value?: string | number;
4
+ label: string;
5
+ icon?: string;
6
+ }
7
+ interface ICheckGroupFixedProps {
8
+ label: string;
9
+ source: SourceDictType[];
10
+ onChange?: (keys: string[] & number[] & boolean[]) => void;
11
+ checboxSize?: number;
12
+ labelSize?: number;
13
+ cutRow?: number;
14
+ value?: string[] & number[] & boolean[];
15
+ }
16
+ declare function CheckGroupFixed({ label, source, checboxSize, cutRow, labelSize, value, onChange }: ICheckGroupFixedProps): JSX.Element;
17
+ export default CheckGroupFixed;
@@ -0,0 +1,148 @@
1
+ import "antd/lib/badge/style";
2
+ import _Badge from "antd/lib/badge";
3
+ import "antd/lib/checkbox/style";
4
+ import _Checkbox from "antd/lib/checkbox";
5
+ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ 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."); }
10
+
11
+ 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); }
12
+
13
+ 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; }
14
+
15
+ 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; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
20
+ import "./index.css";
21
+
22
+ function CheckGroupFixed(_ref) {
23
+ var label = _ref.label,
24
+ source = _ref.source,
25
+ _ref$checboxSize = _ref.checboxSize,
26
+ checboxSize = _ref$checboxSize === void 0 ? 120 : _ref$checboxSize,
27
+ _ref$cutRow = _ref.cutRow,
28
+ cutRow = _ref$cutRow === void 0 ? 1 : _ref$cutRow,
29
+ _ref$labelSize = _ref.labelSize,
30
+ labelSize = _ref$labelSize === void 0 ? 100 : _ref$labelSize,
31
+ value = _ref.value,
32
+ onChange = _ref.onChange;
33
+
34
+ var _useState = useState({
35
+ visible: false,
36
+ sider: false,
37
+ pos: [0, 0],
38
+ w: 0,
39
+ selectKeys: value || []
40
+ }),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ state = _useState2[0],
43
+ setState = _useState2[1];
44
+
45
+ var domRef = useRef(null);
46
+ useLayoutEffect(function () {
47
+ var _a, _b;
48
+
49
+ var contentEle = (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('.check-content-box');
50
+ var contentRect = (contentEle === null || contentEle === void 0 ? void 0 : contentEle.getBoundingClientRect()) || {
51
+ width: 0
52
+ };
53
+
54
+ if (contentRect.width < checboxSize * source.length) {
55
+ var lr = (_b = domRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
56
+ setState(function (old) {
57
+ return Object.assign(Object.assign({}, old), {
58
+ visible: true,
59
+ w: (lr === null || lr === void 0 ? void 0 : lr.width) || 0,
60
+ pos: [(lr === null || lr === void 0 ? void 0 : lr.x) || 0, (lr === null || lr === void 0 ? void 0 : lr.y) || 0]
61
+ });
62
+ });
63
+ }
64
+ }, [checboxSize, source.length]);
65
+ var fixedStyle = useMemo(function () {
66
+ return state.sider ? {
67
+ position: 'fixed',
68
+ width: state.w,
69
+ height: 'auto',
70
+ backgroundColor: 'white',
71
+ zIndex: 99,
72
+ boxShadow: ' 0 0 10px rgba(0,0,0,0.1)'
73
+ } : {};
74
+ }, [state.sider, state.w]);
75
+
76
+ _useUpdateEffect(function () {
77
+ return onChange && onChange(state.selectKeys);
78
+ }, [state.selectKeys]);
79
+
80
+ useLayoutEffect(function () {
81
+ var dom = domRef.current.querySelector('.check-box-group-layout');
82
+ dom === null || dom === void 0 ? void 0 : dom.setAttribute('style', "grid-template-columns:repeat(auto-fill, minmax(".concat(checboxSize, "px, 1fr));"));
83
+ }, [checboxSize]);
84
+ return /*#__PURE__*/React.createElement("div", {
85
+ className: "c-check-group-layout",
86
+ ref: domRef,
87
+ style: {
88
+ height: state.sider ? cutRow * 30 + 20 : 'auto'
89
+ }
90
+ }, /*#__PURE__*/React.createElement("div", {
91
+ className: "c-check-group-box",
92
+ style: fixedStyle
93
+ }, /*#__PURE__*/React.createElement("span", {
94
+ className: "check-label-box",
95
+ style: {
96
+ width: labelSize
97
+ }
98
+ }, label, "\uFF1A"), /*#__PURE__*/React.createElement("div", {
99
+ className: "check-content-box",
100
+ style: {
101
+ height: state.sider ? 'auto' : cutRow * 30
102
+ }
103
+ }, /*#__PURE__*/React.createElement(_Checkbox.Group, {
104
+ value: state.selectKeys,
105
+ className: "check-box-group-layout",
106
+ onChange: function onChange(keys) {
107
+ return setState(function (old) {
108
+ return Object.assign(Object.assign({}, old), {
109
+ selectKeys: keys
110
+ });
111
+ });
112
+ }
113
+ }, source.map(function (v) {
114
+ return /*#__PURE__*/React.createElement(_Checkbox, {
115
+ style: {
116
+ width: checboxSize
117
+ },
118
+ key: v.value,
119
+ value: v.value
120
+ }, /*#__PURE__*/React.createElement("span", {
121
+ title: v.label
122
+ }, v.label));
123
+ }))), state.visible && /*#__PURE__*/React.createElement(_Badge, {
124
+ count: state.sider ? 0 : state.selectKeys.length,
125
+ size: "small",
126
+ offset: [10, 0]
127
+ }, /*#__PURE__*/React.createElement("span", {
128
+ className: "slice-btn",
129
+ onClick: function onClick() {
130
+ return setState(function (old) {
131
+ return Object.assign(Object.assign({}, old), {
132
+ sider: !state.sider
133
+ });
134
+ });
135
+ }
136
+ }, state.sider ? '收起' : '展开'))), state.sider && /*#__PURE__*/React.createElement("div", {
137
+ className: "sider-mask",
138
+ onClick: function onClick() {
139
+ return setState(function (old) {
140
+ return Object.assign(Object.assign({}, old), {
141
+ sider: false
142
+ });
143
+ });
144
+ }
145
+ }));
146
+ }
147
+
148
+ export default CheckGroupFixed;
@@ -1,13 +1,70 @@
1
1
  import produce from 'immer';
2
+ import { insertThemeStyle } from './utils';
2
3
  var Config = {
3
- app: produce([], function () {}),
4
+ app: produce({}, function () {}),
4
5
  bs: produce({}, function () {}),
5
- feature: produce([], function () {}),
6
- pFeature: produce([], function () {}),
7
- registerConfig: function registerConfig(key, conf) {
8
- Config[key] = produce(Config.AppConfig, function (draft) {
9
- draft = conf;
6
+ features: produce([], function () {}),
7
+ featureIds: produce([], function () {}),
8
+ theme: produce({}, function () {}),
9
+ registerAppConfig: function registerAppConfig() {
10
+ var app = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
11
+ Config.app = produce(Config.app, function (draft) {
12
+ app.forEach(function (item) {
13
+ draft[item.routerPrefix] = item;
14
+ });
10
15
  });
16
+ },
17
+ registerFeatrueIds: function registerFeatrueIds() {
18
+ var featureIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
19
+ Config.featureIds = produce(Config.featureIds, function (draft) {
20
+ featureIds.forEach(function (id) {
21
+ var index = draft.findIndex(function (v) {
22
+ return v === id;
23
+ });
24
+
25
+ if (index === -1) {
26
+ draft.push(id);
27
+ } else {
28
+ draft[index] = id;
29
+ }
30
+ });
31
+ });
32
+ },
33
+ registerBSConfig: function registerBSConfig() {
34
+ var bs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35
+ Config.bs = produce(Config.bs, function (draft) {
36
+ Object.keys(bs).forEach(function (key) {
37
+ draft[key] = bs[key];
38
+ });
39
+ });
40
+ },
41
+ registerPlatformFeature: function registerPlatformFeature() {
42
+ var features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
43
+ Config.features = produce(Config.features, function (draft) {
44
+ features.forEach(function (item) {
45
+ var index = draft.findIndex(function (v) {
46
+ return v.id === item.id;
47
+ });
48
+
49
+ if (index === -1) {
50
+ draft.push(item);
51
+ } else {
52
+ draft[index] = item;
53
+ }
54
+ });
55
+ });
56
+ },
57
+ registerThemeConfig: function registerThemeConfig() {
58
+ var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59
+ insertThemeStyle(theme);
60
+ Config.theme = produce(Config.theme, function (draft) {
61
+ Object.keys(theme).forEach(function (key) {
62
+ draft[key] = theme[key];
63
+ });
64
+ });
65
+ },
66
+ getThemeVarValue: function getThemeVarValue(themeKey) {
67
+ return getComputedStyle(document.querySelector(':root')).getPropertyValue("--".concat(themeKey));
11
68
  }
12
69
  };
13
70
 
@@ -17,23 +17,48 @@ export type FeatureItemType = {
17
17
  type: 1 | 2 | 3; //功能类型1:实际菜单,2:权限,3:虚拟分组
18
18
  interfaceCodes: string[];
19
19
  icon: string;
20
- routerUrl: string;
20
+ routeUrl: string;
21
21
  sort: number;
22
+ children?: FeatureItemType[];
23
+ parentId?: string;
24
+ level?: number;
22
25
  };
23
26
 
24
27
  export type BSConfigType = {
25
28
  systemLogo: string;
26
29
  systemName: string;
30
+ parterLogo: string[];
31
+ loginBG: string;
27
32
  icp: string[];
28
33
  openSocket: boolean;
29
34
  chromeDownloadUrl: string;
35
+ AppTimeOut: number;
36
+ shortcut: string;
37
+ download: { chrome: string; player: string };
38
+ [key: string]: any;
39
+ };
40
+
41
+ export type ThemeInfoType = {
42
+ vars: { [key: string]: string[] };
43
+ style: {
44
+ menuType: 'inline' | 'horizontal';
45
+ hasTab: boolean;
46
+ };
30
47
  };
31
48
 
49
+ export type ConfigKey = 'app' | 'feature' | 'featureIds' | 'bs' | 'theme';
50
+
32
51
  export type ConfigJOSN = {
33
- app: AppItemType[];
34
- feature: FeatureItemType[];
35
- pFeature: FeatureItemType[];
52
+ app: { [key: string]: AppItemType };
53
+ features: FeatureItemType[];
54
+ featureIds: string[];
36
55
  bs: BSConfigType;
37
- registerConfig: (key: string, conf: { [key: string]: any }) => void;
56
+ theme: ThemeInfoType;
57
+ registerAppConfig: (conf: AppItemType[]) => void;
58
+ registerFeatrueIds: (conf: string[]) => void;
59
+ registerBSConfig: (conf: BSConfigType) => void;
60
+ registerPlatformFeature: (conf: FeatureItemType[]) => void;
61
+ registerThemeConfig: (conf: ThemeInfoType) => void;
62
+ getThemeVarValue: (themeKey: string) => string;
38
63
  [key: string]: any;
39
64
  };
@@ -1,11 +1,2 @@
1
- import { ConfigJOSN } from './interface';
2
- export declare function formartThemeConfig(options: ConfigJOSN): {
3
- [x: string]: any;
4
- app: import("./interface").AppItemType[];
5
- feature: import("./interface").FeatureItemType[];
6
- pFeature: import("./interface").FeatureItemType[];
7
- bs: import("./interface").BSConfigType;
8
- registerConfig: (key: string, conf: {
9
- [key: string]: any;
10
- }) => void;
11
- };
1
+ import { ThemeInfoType } from './interface';
2
+ export declare function insertThemeStyle(options: ThemeInfoType): void;
@@ -20,13 +20,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
20
20
 
21
21
  var style = document.createElement('style');
22
22
  var isInit = false;
23
- export function formartThemeConfig(options) {
23
+ export function insertThemeStyle(options) {
24
24
  var _ref;
25
25
 
26
26
  var tplStr = ':root{<content>}';
27
- var data = Object.assign({}, options);
28
- data.vars = {};
29
- data.style = {};
30
27
 
31
28
  var attrArr = (_ref = []).concat.apply(_ref, _toConsumableArray(Object.values(options.vars)));
32
29
 
@@ -43,12 +40,4 @@ export function formartThemeConfig(options) {
43
40
  isInit = true;
44
41
  document.head.appendChild(style);
45
42
  }
46
-
47
- if (options.style) {
48
- Object.keys(options.style).forEach(function (k) {
49
- data.style[k] = options.style[k];
50
- });
51
- }
52
-
53
- return data;
54
43
  }
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
2
  export interface IConfigContextProps {
3
+ /**
4
+ * @description 用于获取微应用顶层的dom节点
5
+ */
3
6
  root: HTMLElement;
4
7
  }
5
8
  declare const ConfigContext: React.Context<IConfigContextProps>;
@@ -1,8 +1,8 @@
1
- import _Dict from "@cloud-app-dev/basic-components/es/Dict";
2
-
1
+ import Dict from '../Dict';
3
2
  /**根据设备类型和状态获取设备展示图标 */
3
+
4
4
  export var getCameraTypeIcon = function getCameraTypeIcon(type, status) {
5
- var _Dict$device = _Dict.device,
5
+ var _Dict$device = Dict.device,
6
6
  znxj = _Dict$device.znxj,
7
7
  qj = _Dict$device.qj,
8
8
  db = _Dict$device.db,
@@ -13,7 +13,7 @@ export var getCameraTypeIcon = function getCameraTypeIcon(type, status) {
13
13
  xfs = _Dict$device.xfs,
14
14
  znjg = _Dict$device.znjg,
15
15
  qt = _Dict$device.qt;
16
- var _Dict$device2 = _Dict.device,
16
+ var _Dict$device2 = Dict.device,
17
17
  ptjk = _Dict$device2.ptjk,
18
18
  rlzp = _Dict$device2.rlzp,
19
19
  zpj = _Dict$device2.zpj,
@@ -127,7 +127,7 @@ export var getCameraTypeIcon = function getCameraTypeIcon(type, status) {
127
127
  }
128
128
 
129
129
  if (Object.keys(option).length === 0) {
130
- console.debug('未获取到设备类型!返回默认');
130
+ console.debug('未获取到设备类型!,返回默认');
131
131
  option.color = !onLine ? '#ccc' : 'rgba(255, 156, 84, 1)';
132
132
  option.bgColor = !onLine ? '#ccc' : '#29CCCC';
133
133
  option.icon = 'icon-S_Point_CameraSmart';
@@ -1,6 +1,6 @@
1
- import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
1
  import { __rest } from "tslib";
3
2
  import React, { useMemo } from 'react';
3
+ import IconFont from '../IconFont';
4
4
  import { getCameraTypeIcon } from './icon';
5
5
  import "./index.css";
6
6
 
@@ -27,7 +27,7 @@ function DeviceIcon(_a) {
27
27
  var iconClassName = useMemo(function () {
28
28
  return onLine ? onlineClass : offlineClass;
29
29
  }, [offlineClass, onLine, onlineClass]);
30
- return /*#__PURE__*/React.createElement(_IconFont, Object.assign({
30
+ return /*#__PURE__*/React.createElement(IconFont, Object.assign({
31
31
  style: style,
32
32
  type: options.icon,
33
33
  className: "".concat(iconClassName, " ").concat(className ? className : '')
@@ -0,0 +1,6 @@
1
+ interface ITreeTypeProps {
2
+ mode: string;
3
+ onChange: (mode: string) => void;
4
+ }
5
+ declare function TreeType({ mode, onChange }: ITreeTypeProps): JSX.Element;
6
+ export default TreeType;
@@ -0,0 +1,36 @@
1
+ import "antd/lib/menu/style";
2
+ import _Menu from "antd/lib/menu";
3
+ import "antd/lib/dropdown/style";
4
+ import _Dropdown from "antd/lib/dropdown";
5
+ import React from 'react';
6
+ import IconFont from '../IconFont';
7
+
8
+ function TreeType(_ref) {
9
+ var mode = _ref.mode,
10
+ onChange = _ref.onChange;
11
+ return /*#__PURE__*/React.createElement(_Dropdown, {
12
+ overlay: /*#__PURE__*/React.createElement(_Menu, {
13
+ onClick: function onClick(info) {
14
+ return onChange(info.key);
15
+ }
16
+ }, /*#__PURE__*/React.createElement(_Menu.Item, {
17
+ style: {
18
+ fontSize: 12
19
+ },
20
+ key: "Bz"
21
+ }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
22
+ style: {
23
+ fontSize: 12
24
+ },
25
+ key: "Place"
26
+ }, "\u884C\u653F\u533A\u5212"))
27
+ }, /*#__PURE__*/React.createElement("span", null, mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
28
+ style: {
29
+ position: 'relative',
30
+ top: 1
31
+ },
32
+ type: "icon-S_Arrow_BigDown"
33
+ })));
34
+ }
35
+
36
+ export default TreeType;
@@ -10,11 +10,11 @@ function App() {
10
10
  style: {
11
11
  padding: 20,
12
12
  width: 1000,
13
- height: 500
13
+ height: 700
14
14
  }
15
15
  }, /*#__PURE__*/React.createElement("div", {
16
16
  style: {
17
- height: 400
17
+ height: 660
18
18
  }
19
19
  }, /*#__PURE__*/React.createElement(DeviceSelect, null))));
20
20
  }
@@ -1,6 +1,11 @@
1
1
  .vidc-device-select-layout {
2
2
  height: 100%;
3
+ display: flex;
3
4
  }
4
- .vidc-device-select-layout > .cloudapp-col {
5
+ .vidc-device-select-layout > div {
5
6
  height: 100%;
7
+ flex: 1;
8
+ }
9
+ .vidc-device-select-layout > div:first-child.bc-type-tree-layout {
10
+ border-right: none;
6
11
  }
@@ -4,4 +4,9 @@ interface IDeviceSelectProps {
4
4
  selectDevices?: DeviceItemType[];
5
5
  }
6
6
  declare function DeviceSelect({ selectDevices }: IDeviceSelectProps): JSX.Element;
7
+ declare namespace DeviceSelect {
8
+ var defaultProps: {
9
+ className: string;
10
+ };
11
+ }
7
12
  export default DeviceSelect;