@cloud-app-dev/vidc 3.2.11 → 3.2.14

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 (347) hide show
  1. package/.dumirc.ts +71 -0
  2. package/.editorconfig +0 -3
  3. package/.eslintrc.js +3 -0
  4. package/.fatherrc.ts +19 -0
  5. package/.husky/commit-msg +5 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.prettierrc.js +16 -0
  8. package/README.md +14 -26
  9. package/es/Api/index.js +100 -30
  10. package/es/AppContext/Sync.js +19 -3
  11. package/es/AppContext/index.js +86 -42
  12. package/es/AppContext/static.js +7 -0
  13. package/es/Auth/index.js +11 -4
  14. package/es/AutoExit/index.js +11 -3
  15. package/es/Box/BetweenBox/index.js +19 -10
  16. package/es/Box/BetweenBox/{index.css → index.less} +0 -0
  17. package/es/Box/InfoBox/index.js +24 -18
  18. package/es/Box/InfoBox/index.less +22 -0
  19. package/es/Box/TwoColumnBox/index.js +42 -25
  20. package/es/Box/TwoColumnBox/index.less +70 -0
  21. package/es/Box/deps/grid-factory.d.ts +2 -2
  22. package/es/Box/deps/grid-factory.js +12 -0
  23. package/es/Box/index.js +29 -16
  24. package/es/Box/{index.css → index.less} +5 -4
  25. package/es/CheckGroupFixed/demo.d.ts +3 -0
  26. package/es/CheckGroupFixed/demo.js +28 -0
  27. package/es/CheckGroupFixed/index.js +117 -82
  28. package/es/CheckGroupFixed/index.less +50 -0
  29. package/es/Config/index.js +5 -1
  30. package/es/Config/utils.js +18 -3
  31. package/es/ConfigContext/index.js +8 -4
  32. package/es/CustomRenderSelect/index.js +71 -36
  33. package/es/CustomRenderSelect/index.less +25 -0
  34. package/es/DisableMark/index.js +14 -11
  35. package/es/DisableMark/{index.css → index.less} +0 -0
  36. package/es/DomMove/demo.js +14 -10
  37. package/es/DomMove/index.js +52 -30
  38. package/es/DomMove/utils.js +8 -3
  39. package/es/Drag/DragAndDropItem.js +44 -20
  40. package/es/Drag/DropItem.js +22 -6
  41. package/es/Drag/index.js +2 -2
  42. package/es/Drag/{index.css → index.less} +0 -0
  43. package/es/Drawer/Footer.js +22 -15
  44. package/es/Drawer/{Demo.d.ts → demo.d.ts} +0 -0
  45. package/es/Drawer/demo.js +109 -0
  46. package/es/Drawer/index.js +98 -60
  47. package/es/Drawer/index.less +42 -0
  48. package/es/ErrorFallback/index.js +23 -14
  49. package/es/FrontendPlayer/index.js +1 -1
  50. package/es/FullScreen/index.js +30 -17
  51. package/es/FullScreen/index.less +16 -0
  52. package/es/HightLevel/index.js +11 -4
  53. package/es/HightLevel/{index.css → index.less} +0 -0
  54. package/es/IconFont/index.js +39 -18
  55. package/es/ImageView/index.js +37 -13
  56. package/es/ImageView/index.less +10 -0
  57. package/es/Input/demo.d.ts +3 -0
  58. package/es/Input/demo.js +16 -0
  59. package/es/Input/index.js +46 -22
  60. package/es/Input/index.less +12 -0
  61. package/es/InstanceHistory/index.js +2 -0
  62. package/es/LabelValue/index.js +25 -18
  63. package/es/LabelValue/index.less +20 -0
  64. package/es/List/DynamicGridList/Demo.d.ts +1 -0
  65. package/es/List/DynamicGridList/Demo.js +52 -32
  66. package/es/List/DynamicGridList/index.d.ts +3 -3
  67. package/es/List/DynamicGridList/index.js +41 -26
  68. package/es/List/DynamicList/index.js +76 -56
  69. package/es/List/DynamicList/index.less +15 -0
  70. package/es/List/GridList/Demo.d.ts +1 -0
  71. package/es/List/GridList/Demo.js +60 -38
  72. package/es/List/GridList/hook.d.ts +1 -1
  73. package/es/List/GridList/hook.js +66 -35
  74. package/es/List/GridList/index.js +33 -29
  75. package/es/List/GridList/{index.css → index.less} +0 -0
  76. package/es/List/GridList/utils.d.ts +2 -2
  77. package/es/List/GridList/utils.js +1 -0
  78. package/es/List/VList/index.d.ts +1 -1
  79. package/es/List/VList/index.js +32 -19
  80. package/es/List/VList/{index.css → index.less} +0 -0
  81. package/es/List/VList/utils.d.ts +2 -2
  82. package/es/List/VList/utils.js +8 -6
  83. package/es/List/demo.d.ts +3 -0
  84. package/es/List/demo.js +26 -0
  85. package/es/List/index.d.ts +1 -1
  86. package/es/List/index.js +31 -23
  87. package/es/List/{index.css → index.less} +5 -4
  88. package/es/ListWithSizeAnimate/demo.d.ts +2 -0
  89. package/es/ListWithSizeAnimate/demo.js +19 -0
  90. package/es/ListWithSizeAnimate/index.d.ts +9 -0
  91. package/es/ListWithSizeAnimate/index.js +71 -0
  92. package/es/ListWithSizeAnimate/index.less +13 -0
  93. package/es/LoaderApp/index.js +59 -25
  94. package/es/LoaderApp/{index.css → index.less} +0 -0
  95. package/es/LoaderApp/loader.js +40 -23
  96. package/es/LoaderApp/sandbox.back.js +101 -24
  97. package/es/LoaderApp/sandbox.js +26 -9
  98. package/es/LoaderApp/utils.d.ts +1 -1
  99. package/es/LoaderApp/utils.js +68 -25
  100. package/es/LoaderScript/index.js +25 -10
  101. package/es/LoaderScript/utils.js +151 -87
  102. package/es/Map/BasicMap/AMapInstance.d.ts +1 -1
  103. package/es/Map/BasicMap/AMapInstance.js +25 -3
  104. package/es/Map/BasicMap/LeafletInstance.js +28 -11
  105. package/es/Map/BasicMap/index.js +67 -27
  106. package/es/Map/BasicMap/index.less +24 -0
  107. package/es/Map/ClusterLayer/hook.d.ts +2 -2
  108. package/es/Map/ClusterLayer/hook.js +51 -23
  109. package/es/Map/ClusterLayer/index.d.ts +1 -1
  110. package/es/Map/ClusterLayer/index.js +14 -6
  111. package/es/Map/ClusterLayer/index.less +27 -0
  112. package/es/Map/Config/index.js +44 -16
  113. package/es/Map/Config/utils.js +17 -3
  114. package/es/Map/Context/index.js +43 -9
  115. package/es/Map/FindPio/index.js +5 -2
  116. package/es/Map/FindPio/{index.css → index.less} +0 -0
  117. package/es/Map/InfoWindow/MakerLikeWindow.d.ts +1 -1
  118. package/es/Map/InfoWindow/MakerLikeWindow.js +41 -18
  119. package/es/Map/InfoWindow/demo.d.ts +1 -0
  120. package/es/Map/InfoWindow/demo.js +51 -29
  121. package/es/Map/InfoWindow/index.d.ts +1 -1
  122. package/es/Map/InfoWindow/index.js +39 -18
  123. package/es/Map/LevelCenter/DragMarker/index.js +16 -10
  124. package/es/Map/LevelCenter/demo.d.ts +1 -0
  125. package/es/Map/LevelCenter/demo.js +41 -22
  126. package/es/Map/LevelCenter/index.js +41 -29
  127. package/es/Map/LevelCenter/index.less +2 -0
  128. package/es/Map/LoaderMap/index.js +38 -22
  129. package/es/Map/MapDrawSelect/demo.d.ts +1 -0
  130. package/es/Map/MapDrawSelect/demo.js +65 -46
  131. package/es/Map/MapDrawSelect/index.js +43 -31
  132. package/es/Map/MapDrawSelect/index.less +2 -0
  133. package/es/Map/MouseTool/index.js +32 -18
  134. package/es/Map/MouseTool/useMouseTools.js +37 -8
  135. package/es/Map/ResetTools/index.js +58 -44
  136. package/es/Map/ResetTools/index.less +35 -0
  137. package/es/Map/SinglePoint/index.js +39 -27
  138. package/es/Map/SinglePoint/index.less +41 -0
  139. package/es/Map/hook/useMapEvent.js +8 -4
  140. package/es/Map/hook/useMapType.js +3 -2
  141. package/es/Map/index.d.ts +1 -0
  142. package/es/Map/index.js +11 -11
  143. package/es/Map/useMarker/index.d.ts +1 -1
  144. package/es/Map/useMarker/index.js +33 -13
  145. package/es/Map/{LevelCenter/index.css → useMarker/index.less} +0 -0
  146. package/es/Map/withMap/index.d.ts +1 -0
  147. package/es/Map/withMap/index.js +14 -4
  148. package/es/Modal/demo.d.ts +3 -0
  149. package/es/Modal/demo.js +106 -0
  150. package/es/Modal/index.js +94 -57
  151. package/es/Modal/index.less +45 -0
  152. package/es/Picture/component/DefaultRects/RectInfo.js +59 -37
  153. package/es/Picture/component/DefaultRects/index.js +46 -32
  154. package/es/Picture/component/DefaultRects/index.less +188 -0
  155. package/es/Picture/component/DrawRect/index.js +37 -24
  156. package/es/Picture/component/DrawRect/{index.css → index.less} +0 -0
  157. package/es/Picture/component/RectMenu/index.js +35 -26
  158. package/es/Picture/component/RectMenu/index.less +31 -0
  159. package/es/Picture/component/RectMenu/utils.js +6 -3
  160. package/es/Picture/component/Tools/index.js +91 -69
  161. package/es/Picture/component/Tools/index.less +43 -0
  162. package/es/Picture/component/WheelScale/index.js +9 -4
  163. package/es/Picture/demo.js +14 -11
  164. package/es/Picture/dragBound.d.ts +1 -1
  165. package/es/Picture/dragBound.js +17 -4
  166. package/es/Picture/index.d.ts +2 -2
  167. package/es/Picture/index.js +201 -137
  168. package/es/Picture/index.less +14 -0
  169. package/es/Picture/interface.d.ts +0 -6
  170. package/es/Picture/loadCaptureRectImage.d.ts +1 -1
  171. package/es/Picture/loadCaptureRectImage.js +39 -14
  172. package/es/Picture/useDraw.js +40 -20
  173. package/es/Picture/utils.d.ts +9 -9
  174. package/es/Picture/utils.js +18 -3
  175. package/es/Player/api/index.d.ts +3 -3
  176. package/es/Player/api/index.js +117 -82
  177. package/es/Player/context.js +21 -7
  178. package/es/Player/contraller_bar/bar.d.ts +1 -1
  179. package/es/Player/contraller_bar/bar.js +28 -10
  180. package/es/Player/contraller_bar/contraller_event.js +34 -12
  181. package/es/Player/contraller_bar/index.js +30 -22
  182. package/es/Player/contraller_bar/left_bar.js +62 -39
  183. package/es/Player/contraller_bar/right_bar.js +34 -18
  184. package/es/Player/contraller_bar/time.js +19 -8
  185. package/es/Player/contraller_bar/useBarStatus.js +29 -11
  186. package/es/Player/contraller_bar/volume.d.ts +1 -1
  187. package/es/Player/contraller_bar/volume.js +43 -21
  188. package/es/Player/demo.d.ts +1 -0
  189. package/es/Player/demo.js +258 -215
  190. package/es/Player/event/errorEvent.js +41 -16
  191. package/es/Player/event/eventName.js +12 -1
  192. package/es/Player/event/index.js +66 -24
  193. package/es/Player/fps_play.js +33 -15
  194. package/es/Player/frontend_player.js +42 -20
  195. package/es/Player/frontend_timeline.js +95 -55
  196. package/es/Player/iconfont.js +23 -8
  197. package/es/Player/index.js +1 -1
  198. package/es/Player/live_heart.js +15 -3
  199. package/es/Player/message.js +68 -37
  200. package/es/Player/segment_player.js +113 -62
  201. package/es/Player/segment_timeline.js +145 -97
  202. package/es/Player/single_player.js +153 -111
  203. package/es/Player/style/bar.less +39 -0
  204. package/es/Player/style/iconfont.js +17 -10
  205. package/es/Player/style/index.less +30 -0
  206. package/es/Player/style/message.less +50 -0
  207. package/es/Player/style/slider.less +103 -0
  208. package/es/Player/style/timeline.less +106 -0
  209. package/es/Player/style/volume.less +21 -0
  210. package/es/Player/timeline.d.ts +1 -1
  211. package/es/Player/timeline.js +59 -32
  212. package/es/Player/util.js +46 -7
  213. package/es/PlayerExt/demo.d.ts +1 -0
  214. package/es/PlayerExt/demo.js +145 -112
  215. package/es/PlayerExt/index.d.ts +2 -2
  216. package/es/PlayerExt/index.js +139 -87
  217. package/es/PlayerExt/{index.css → index.less} +0 -0
  218. package/es/Progress/index.js +18 -5
  219. package/es/Progress/index.less +20 -0
  220. package/es/ROI/demo.d.ts +1 -0
  221. package/es/ROI/demo.js +12 -8
  222. package/es/ROI/index.js +45 -35
  223. package/es/ROI/index.less +29 -0
  224. package/es/ScreenPlayer/Live.d.ts +2 -2
  225. package/es/ScreenPlayer/Live.js +172 -109
  226. package/es/ScreenPlayer/LiveTools.d.ts +2 -2
  227. package/es/ScreenPlayer/LiveTools.js +156 -116
  228. package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
  229. package/es/ScreenPlayer/PlayerWithExt.js +172 -115
  230. package/es/ScreenPlayer/RatePick.js +35 -22
  231. package/es/ScreenPlayer/Record.d.ts +1 -1
  232. package/es/ScreenPlayer/Record.js +307 -192
  233. package/es/ScreenPlayer/RecordTools.d.ts +2 -2
  234. package/es/ScreenPlayer/RecordTools.js +201 -149
  235. package/es/ScreenPlayer/ScreenSelect.js +37 -28
  236. package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
  237. package/es/ScreenPlayer/SegmentTimeLine.js +24 -17
  238. package/es/ScreenPlayer/TimeMode.js +22 -16
  239. package/es/ScreenPlayer/TimeSelect.js +86 -65
  240. package/es/ScreenPlayer/demo.js +16 -18
  241. package/es/ScreenPlayer/demo2.js +193 -178
  242. package/es/ScreenPlayer/index.d.ts +1 -0
  243. package/es/ScreenPlayer/index.js +3 -3
  244. package/es/ScreenPlayer/index.less +178 -0
  245. package/es/ScreenPlayer/interface.d.ts +2 -2
  246. package/es/ScreenPlayer/useTimeSlider.d.ts +8 -8
  247. package/es/ScreenPlayer/useTimeSlider.js +167 -60
  248. package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
  249. package/es/ScreenPlayer/useVideoFit.js +18 -5
  250. package/es/ScreenPlayer/utils.d.ts +1 -1
  251. package/es/ScreenPlayer/utils.js +10 -1
  252. package/es/SegmentPlayer/index.js +1 -1
  253. package/es/Service/fetch-adapter.d.ts +1 -1
  254. package/es/Service/fetch-adapter.js +48 -5
  255. package/es/Service/http.js +46 -16
  256. package/es/Service/index.js +2 -2
  257. package/es/TableLayout/index.js +18 -12
  258. package/es/TableLayout/{index.css → index.less} +0 -0
  259. package/es/ThemeAntd/demo.d.ts +1 -0
  260. package/es/ThemeAntd/demo.js +126 -76
  261. package/es/ThemeAntd/{demo.css → demo.less} +4 -3
  262. package/es/ThemeAntd/index.js +6 -2
  263. package/es/ThemeAntd/index.less +16 -0
  264. package/es/ThemeAntd/style/button.less +67 -0
  265. package/es/ThemeAntd/style/checkbox.less +72 -0
  266. package/es/ThemeAntd/style/form.less +12 -0
  267. package/es/ThemeAntd/style/input.less +83 -0
  268. package/es/ThemeAntd/style/pagination.less +95 -0
  269. package/es/ThemeAntd/style/picker.less +106 -0
  270. package/es/ThemeAntd/style/popover.less +5 -0
  271. package/es/ThemeAntd/style/radio.less +87 -0
  272. package/es/ThemeAntd/style/{scrollbar.css → scrollbar.less} +4 -2
  273. package/es/ThemeAntd/style/select.less +81 -0
  274. package/es/ThemeAntd/style/table.less +57 -0
  275. package/es/ThemeAntd/style/tree.less +18 -0
  276. package/es/Timeout/index.js +36 -12
  277. package/es/Tree/demo.js +26 -21
  278. package/es/Tree/index.js +51 -30
  279. package/es/Tree/index.less +59 -0
  280. package/es/index.d.ts +1 -0
  281. package/es/index.js +48 -47
  282. package/es/useDrawROI/index.js +130 -65
  283. package/es/useEventEmitterHandle/index.js +6 -2
  284. package/es/useFullscreen/demo.js +44 -27
  285. package/es/useFullscreen/index.js +30 -8
  286. package/es/useHistory/index.js +3 -1
  287. package/es/useInfiniteScroll/index.js +50 -19
  288. package/es/useRafInterval/index.js +28 -4
  289. package/es/useSimpleState/index.js +23 -6
  290. package/es/useVirtualList/index.js +58 -20
  291. package/es/utils.d.ts +1 -1
  292. package/es/utils.js +53 -14
  293. package/package.json +37 -32
  294. package/tsconfig.json +8 -32
  295. package/.eslintrc +0 -4
  296. package/.fatherrc.js +0 -25
  297. package/.prettierrc +0 -11
  298. package/.umirc.ts +0 -55
  299. package/clear-cache.sh +0 -4
  300. package/es/Box/InfoBox/index.css +0 -22
  301. package/es/Box/TwoColumnBox/index.css +0 -70
  302. package/es/CheckGroupFixed/index.css +0 -49
  303. package/es/CustomRenderSelect/index.css +0 -20
  304. package/es/Drawer/Demo.js +0 -59
  305. package/es/Drawer/index.css +0 -40
  306. package/es/FullScreen/index.css +0 -16
  307. package/es/ImageView/index.css +0 -10
  308. package/es/Input/index.css +0 -8
  309. package/es/LabelValue/index.css +0 -18
  310. package/es/List/DynamicList/index.css +0 -15
  311. package/es/Map/BasicMap/index.css +0 -24
  312. package/es/Map/ClusterLayer/index.css +0 -26
  313. package/es/Map/MapDrawSelect/index.css +0 -0
  314. package/es/Map/ResetTools/index.css +0 -32
  315. package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +0 -15
  316. package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +0 -15
  317. package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +0 -15
  318. package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +0 -15
  319. package/es/Map/SinglePoint/index.css +0 -29
  320. package/es/Map/useMarker/index.css +0 -0
  321. package/es/Modal/index.css +0 -43
  322. package/es/Picture/component/DefaultRects/index.css +0 -247
  323. package/es/Picture/component/RectMenu/index.css +0 -31
  324. package/es/Picture/component/Tools/index.css +0 -42
  325. package/es/Picture/index.css +0 -12
  326. package/es/Player/style/bar.css +0 -38
  327. package/es/Player/style/index.css +0 -30
  328. package/es/Player/style/message.css +0 -49
  329. package/es/Player/style/slider.css +0 -96
  330. package/es/Player/style/timeline.css +0 -99
  331. package/es/Player/style/volume.css +0 -19
  332. package/es/Progress/index.css +0 -20
  333. package/es/ROI/index.css +0 -29
  334. package/es/ScreenPlayer/index.css +0 -166
  335. package/es/ThemeAntd/index.css +0 -620
  336. package/es/ThemeAntd/style/button.css +0 -55
  337. package/es/ThemeAntd/style/checkbox.css +0 -64
  338. package/es/ThemeAntd/style/form.css +0 -10
  339. package/es/ThemeAntd/style/input.css +0 -68
  340. package/es/ThemeAntd/style/pagination.css +0 -82
  341. package/es/ThemeAntd/style/picker.css +0 -98
  342. package/es/ThemeAntd/style/popover.css +0 -3
  343. package/es/ThemeAntd/style/radio.css +0 -80
  344. package/es/ThemeAntd/style/select.css +0 -76
  345. package/es/ThemeAntd/style/table.css +0 -46
  346. package/es/ThemeAntd/style/tree.css +0 -16
  347. package/es/Tree/index.css +0 -64
@@ -1,76 +1,110 @@
1
1
  import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
2
2
  import _nextTick from "@cloud-app-dev/utils/es/nextTick";
3
3
  import _cache from "@cloud-app-dev/utils/es/cache";
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ 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; }
10
+
4
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+
5
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
+
6
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
+
7
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
+
8
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
+
9
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
+
10
23
  import React, { useCallback, useMemo, useState } from 'react';
11
- import Sync from './Sync';
12
- import * as Static from './static';
24
+ import Sync from "./Sync";
25
+ import * as Static from "./static";
13
26
  import { isEmpty } from 'lodash-es';
27
+ import { jsx as _jsx } from "react/jsx-runtime";
28
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
29
  var _USER_SESSION_ = Static._USER_SESSION_,
15
- _OPERATION_SESSION_ = Static._OPERATION_SESSION_,
16
- _LOGIN_STATUS_SESSION_ = Static._LOGIN_STATUS_SESSION_,
17
- _USER_EVENT_CHANGE_ = Static._USER_EVENT_CHANGE_,
18
- _OPERATION_EVENT_CHANGE_ = Static._OPERATION_EVENT_CHANGE_,
19
- _LOGIN_STATUS_EVENT_CHANGE_ = Static._LOGIN_STATUS_EVENT_CHANGE_,
20
- _STORE_SESSION_ = Static._STORE_SESSION_,
21
- _STORE_EVENT_CHANGE_ = Static._STORE_EVENT_CHANGE_;
30
+ _OPERATION_SESSION_ = Static._OPERATION_SESSION_,
31
+ _LOGIN_STATUS_SESSION_ = Static._LOGIN_STATUS_SESSION_,
32
+ _USER_EVENT_CHANGE_ = Static._USER_EVENT_CHANGE_,
33
+ _OPERATION_EVENT_CHANGE_ = Static._OPERATION_EVENT_CHANGE_,
34
+ _LOGIN_STATUS_EVENT_CHANGE_ = Static._LOGIN_STATUS_EVENT_CHANGE_,
35
+ _STORE_SESSION_ = Static._STORE_SESSION_,
36
+ _STORE_EVENT_CHANGE_ = Static._STORE_EVENT_CHANGE_;
22
37
  var Context = /*#__PURE__*/React.createContext(null);
38
+
23
39
  function Provider(_ref) {
24
40
  var children = _ref.children;
41
+
25
42
  var _useState = useState({
26
- user: _cache.getCache(_USER_SESSION_, 'session') || {},
27
- operation: _cache.getCache(_OPERATION_SESSION_, 'session') || {},
28
- loginStatus: _cache.getCache(_LOGIN_STATUS_SESSION_, 'session') || false,
29
- store: _cache.getCache(_STORE_SESSION_, 'session') || {}
30
- }),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- state = _useState2[0],
33
- setState = _useState2[1];
43
+ user: _cache.getCache(_USER_SESSION_, 'session') || {},
44
+ operation: _cache.getCache(_OPERATION_SESSION_, 'session') || {},
45
+ loginStatus: _cache.getCache(_LOGIN_STATUS_SESSION_, 'session') || false,
46
+ store: _cache.getCache(_STORE_SESSION_, 'session') || {}
47
+ }),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ state = _useState2[0],
50
+ setState = _useState2[1];
51
+
34
52
  function updateUser() {
35
53
  var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
- var newUser = Object.assign(Object.assign({}, state.user), user);
54
+
55
+ var newUser = _objectSpread(_objectSpread({}, state.user), user);
56
+
37
57
  setState(function (old) {
38
- return Object.assign(Object.assign({}, old), {
58
+ return _objectSpread(_objectSpread({}, old), {}, {
39
59
  user: newUser
40
60
  });
41
61
  });
62
+
42
63
  _nextTick(function () {
43
64
  _SocketEmitter.emit(_USER_EVENT_CHANGE_, newUser);
65
+
44
66
  _cache.setCache(_USER_SESSION_, newUser, 'session');
67
+
45
68
  console.info('AppContext updateUser is run !', user);
46
69
  });
47
70
  }
71
+
48
72
  function updateOperation() {
49
73
  var operation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
50
- var newOperation = Object.assign(Object.assign({}, state.operation), operation);
74
+
75
+ var newOperation = _objectSpread(_objectSpread({}, state.operation), operation);
76
+
51
77
  setState(function (old) {
52
- return Object.assign(Object.assign({}, old), {
78
+ return _objectSpread(_objectSpread({}, old), {}, {
53
79
  operation: newOperation
54
80
  });
55
81
  });
82
+
56
83
  _nextTick(function () {
57
84
  _SocketEmitter.emit(_OPERATION_EVENT_CHANGE_, newOperation);
85
+
58
86
  _cache.setCache(_OPERATION_SESSION_, newOperation, 'session');
87
+
59
88
  console.info('AppContext updateOperation is run !', operation);
60
89
  });
61
90
  }
91
+
62
92
  function updateLoginStatus(status) {
63
93
  if (typeof status !== 'boolean') {
64
94
  throw new Error('status type is boolean !');
65
95
  }
96
+
66
97
  setState(function (old) {
67
- return status !== old.loginStatus ? Object.assign(Object.assign({}, old), {
98
+ return status !== old.loginStatus ? _objectSpread(_objectSpread({}, old), {}, {
68
99
  loginStatus: status
69
100
  }) : old;
70
101
  });
102
+
71
103
  _nextTick(function () {
72
104
  _SocketEmitter.emit(_LOGIN_STATUS_EVENT_CHANGE_, status);
105
+
73
106
  _cache.setCache(_LOGIN_STATUS_SESSION_, status, 'session');
107
+
74
108
  console.info('AppContext updateLoginStatus is run !', status);
75
109
  });
76
110
  }
@@ -78,39 +112,48 @@ function Provider(_ref) {
78
112
  * @desc 用于全局自定义状态存储,依赖sessionStorage持久化能力,不建议存储大数据量
79
113
  * @param data
80
114
  */
115
+
116
+
81
117
  function updateStore() {
82
118
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
83
119
  setState(function (old) {
84
- var newData = {};
85
- //获取变更项
86
- for (var key in data) {
87
- if (data[key] !== old.store[key]) {
88
- newData[key] = data[key];
120
+ var newData = {}; //获取变更项
121
+
122
+ for (var _key in data) {
123
+ if (data[_key] !== old.store[_key]) {
124
+ newData[_key] = data[_key];
89
125
  }
90
126
  }
127
+
91
128
  if (isEmpty(newData)) {
92
129
  return old;
93
130
  }
94
- var newStore = Object.assign(Object.assign({}, old.store), newData);
131
+
132
+ var newStore = _objectSpread(_objectSpread({}, old.store), newData);
133
+
95
134
  _cache.setCache(_STORE_SESSION_, newStore, 'session');
96
- return Object.assign(Object.assign({}, old), {
135
+
136
+ return _objectSpread(_objectSpread({}, old), {}, {
97
137
  store: newStore
98
138
  });
99
139
  });
140
+
100
141
  _nextTick(function () {
101
142
  _SocketEmitter.emit(_STORE_EVENT_CHANGE_, data);
143
+
102
144
  console.info('AppContext updateStore is run !', data);
103
145
  });
104
146
  }
147
+
105
148
  var stateChange = useCallback(function (options) {
106
149
  return setState(function (old) {
107
- return Object.assign(Object.assign({}, old), options);
150
+ return _objectSpread(_objectSpread({}, old), options);
108
151
  });
109
152
  }, []);
110
153
  var storeChange = useCallback(function (store) {
111
154
  return setState(function (old) {
112
- return Object.assign(Object.assign({}, old), {
113
- store: Object.assign(Object.assign({}, old.store), store)
155
+ return _objectSpread(_objectSpread({}, old), {}, {
156
+ store: _objectSpread(_objectSpread({}, old.store), store)
114
157
  });
115
158
  });
116
159
  }, []);
@@ -125,17 +168,18 @@ function Provider(_ref) {
125
168
  updateLoginStatus: updateLoginStatus,
126
169
  updateStore: updateStore
127
170
  };
128
- },
129
- // eslint-disable-next-line react-hooks/exhaustive-deps
171
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
130
172
  [state.user, state.operation, state.loginStatus]);
131
- return /*#__PURE__*/React.createElement(Context.Provider, {
132
- value: providerValue
133
- }, children, /*#__PURE__*/React.createElement(Sync, {
134
- stateChange: stateChange,
135
- storeChange: storeChange
136
- }));
137
- }
138
- // eslint-disable-next-line import/no-anonymous-default-export
173
+ return /*#__PURE__*/_jsxs(Context.Provider, {
174
+ value: providerValue,
175
+ children: [children, /*#__PURE__*/_jsx(Sync, {
176
+ stateChange: stateChange,
177
+ storeChange: storeChange
178
+ })]
179
+ });
180
+ } // eslint-disable-next-line import/no-anonymous-default-export
181
+
182
+
139
183
  export default {
140
184
  Provider: Provider,
141
185
  Context: Context
@@ -1,8 +1,15 @@
1
1
  export var _USER_EVENT_CHANGE_ = '_USER_EVENT_CHANGE_'; //用户信息变化
2
+
2
3
  export var _OPERATION_EVENT_CHANGE_ = '_OPERATION_EVENT_CHANGE_'; //应用系统信息变化
4
+
3
5
  export var _LOGIN_STATUS_EVENT_CHANGE_ = '_LOGIN_STATUS_EVENT_CHANGE_'; //登录状态变化
6
+
4
7
  export var _STORE_EVENT_CHANGE_ = '_STORE_EVENT_CHANGE_'; //登录状态变化
8
+
5
9
  export var _USER_SESSION_ = '_USER_SESSION_'; //用户信息 缓存key
10
+
6
11
  export var _OPERATION_SESSION_ = '_OPERATION_SESSION_'; //应用系统信息 缓存key
12
+
7
13
  export var _LOGIN_STATUS_SESSION_ = '_LOGIN_STATUS_SESSION_'; //登录状态 缓存key
14
+
8
15
  export var _STORE_SESSION_ = '_STORE_SESSION_'; //登录状态 缓存key
package/es/Auth/index.js CHANGED
@@ -1,14 +1,21 @@
1
1
  import React, { useMemo } from 'react';
2
- import Config from '../Config';
2
+ import Config from "../Config";
3
+ import { Fragment as _Fragment } from "react/jsx-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+
3
6
  function Auth(_ref) {
4
7
  var featureId = _ref.featureId,
5
- noAuthContent = _ref.noAuthContent,
6
- children = _ref.children;
8
+ noAuthContent = _ref.noAuthContent,
9
+ children = _ref.children;
7
10
  var action = useMemo(function () {
8
11
  return !!Config.feature.find(function (v) {
9
12
  return v === featureId;
10
13
  });
11
14
  }, [featureId]); //获取按钮权限
12
- return /*#__PURE__*/React.createElement(React.Fragment, null, !action ? noAuthContent ? noAuthContent : null : children);
15
+
16
+ return /*#__PURE__*/_jsx(_Fragment, {
17
+ children: !action ? noAuthContent ? noAuthContent : null : children
18
+ });
13
19
  }
20
+
14
21
  export default Auth;
@@ -1,11 +1,16 @@
1
1
  import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
2
  import React, { useContext, useEffect } from 'react';
3
3
  import { useNavigate } from 'react-router-dom';
4
- import AppContext from '../AppContext';
4
+ import AppContext from "../AppContext";
5
+ import { Fragment as _Fragment } from "react/jsx-runtime";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+
5
8
  function AutoExit(_ref) {
6
9
  var children = _ref.children;
10
+
7
11
  var _useContext = useContext(AppContext.Context),
8
- loginStatus = _useContext.loginStatus;
12
+ loginStatus = _useContext.loginStatus;
13
+
9
14
  var navigate = useNavigate();
10
15
  useEffect(function () {
11
16
  if (!loginStatus) {
@@ -14,6 +19,9 @@ function AutoExit(_ref) {
14
19
  });
15
20
  }
16
21
  }, [loginStatus, navigate]);
17
- return /*#__PURE__*/React.createElement(React.Fragment, null, loginStatus ? children : null);
22
+ return /*#__PURE__*/_jsx(_Fragment, {
23
+ children: loginStatus ? children : null
24
+ });
18
25
  }
26
+
19
27
  export default AutoExit;
@@ -1,22 +1,31 @@
1
1
  import React, { useMemo } from 'react';
2
- import "./index.css";
2
+ import "./index.less";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+
3
6
  function BetweenBox(_ref) {
4
7
  var _ref$className = _ref.className,
5
- className = _ref$className === void 0 ? '' : _ref$className,
6
- left = _ref.left,
7
- right = _ref.right,
8
- style = _ref.style,
9
- children = _ref.children,
10
- extNode = _ref.extNode;
8
+ className = _ref$className === void 0 ? '' : _ref$className,
9
+ left = _ref.left,
10
+ right = _ref.right,
11
+ style = _ref.style,
12
+ children = _ref.children,
13
+ extNode = _ref.extNode;
11
14
  var title = useMemo(function () {
12
15
  return left || children;
13
16
  }, [left, children]);
14
17
  var other = useMemo(function () {
15
18
  return right || extNode;
16
19
  }, [right, extNode]);
17
- return /*#__PURE__*/React.createElement("div", {
20
+ return /*#__PURE__*/_jsxs("div", {
18
21
  className: "lm-between-box ".concat(className),
19
- style: style
20
- }, title && /*#__PURE__*/React.createElement("div", null, title), other && /*#__PURE__*/React.createElement("div", null, other));
22
+ style: style,
23
+ children: [title && /*#__PURE__*/_jsx("div", {
24
+ children: title
25
+ }), other && /*#__PURE__*/_jsx("div", {
26
+ children: other
27
+ })]
28
+ });
21
29
  }
30
+
22
31
  export default BetweenBox;
File without changes
@@ -1,24 +1,30 @@
1
1
  import React from 'react';
2
- import BetweenBox from '../BetweenBox';
3
- import "./index.css";
2
+ import BetweenBox from "../BetweenBox";
3
+ import "./index.less";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+
4
7
  function InfoBox(_ref) {
5
8
  var title = _ref.title,
6
- titleExt = _ref.titleExt,
7
- children = _ref.children,
8
- _ref$className = _ref.className,
9
- className = _ref$className === void 0 ? '' : _ref$className,
10
- style = _ref.style,
11
- contentStyle = _ref.contentStyle;
12
- return /*#__PURE__*/React.createElement("div", {
9
+ titleExt = _ref.titleExt,
10
+ children = _ref.children,
11
+ _ref$className = _ref.className,
12
+ className = _ref$className === void 0 ? '' : _ref$className,
13
+ style = _ref.style,
14
+ contentStyle = _ref.contentStyle;
15
+ return /*#__PURE__*/_jsxs("div", {
13
16
  className: "info-box-layout ".concat(className),
14
- style: style
15
- }, (!!title || !!titleExt) && /*#__PURE__*/React.createElement(BetweenBox, {
16
- className: "info-box-title-wrapper",
17
- left: title,
18
- right: titleExt
19
- }), /*#__PURE__*/React.createElement("div", {
20
- className: "info-box-content-wrapper",
21
- style: contentStyle
22
- }, children));
17
+ style: style,
18
+ children: [(!!title || !!titleExt) && /*#__PURE__*/_jsx(BetweenBox, {
19
+ className: "info-box-title-wrapper",
20
+ left: title,
21
+ right: titleExt
22
+ }), /*#__PURE__*/_jsx("div", {
23
+ className: "info-box-content-wrapper",
24
+ style: contentStyle,
25
+ children: children
26
+ })]
27
+ });
23
28
  }
29
+
24
30
  export default InfoBox;
@@ -0,0 +1,22 @@
1
+ .info-box-layout {
2
+ width: 100%;
3
+ margin-bottom: 20px;
4
+ display: flex;
5
+ flex-direction: column;
6
+ .info-box-title-wrapper {
7
+ background-color: var(--gray2);
8
+ border: 1px solid var(--gray3);
9
+ border-bottom: none;
10
+ height: 3em;
11
+ min-height: max-content;
12
+ display: flex;
13
+ align-items: center;
14
+ padding: 0 10px;
15
+ font-weight: 700;
16
+ }
17
+ .info-box-content-wrapper {
18
+ background-color: var(--gray1);
19
+ border: 1px solid var(--gray3);
20
+ flex: 1;
21
+ }
22
+ }
@@ -1,37 +1,54 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
2
3
  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."); }
4
+
3
5
  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); }
6
+
4
7
  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; }
8
+
5
9
  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; }
10
+
6
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
7
13
  import React, { useState } from 'react';
8
- import "./index.css";
14
+ import "./index.less";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
+
9
18
  function TwoColumnBox(_ref) {
10
19
  var _ref$className = _ref.className,
11
- className = _ref$className === void 0 ? '' : _ref$className,
12
- _ref$collapsible = _ref.collapsible,
13
- collapsible = _ref$collapsible === void 0 ? true : _ref$collapsible,
14
- leftContent = _ref.leftContent,
15
- children = _ref.children;
20
+ className = _ref$className === void 0 ? '' : _ref$className,
21
+ _ref$collapsible = _ref.collapsible,
22
+ collapsible = _ref$collapsible === void 0 ? true : _ref$collapsible,
23
+ leftContent = _ref.leftContent,
24
+ children = _ref.children;
25
+
16
26
  var _useState = useState(false),
17
- _useState2 = _slicedToArray(_useState, 2),
18
- collapsed = _useState2[0],
19
- setCollapsed = _useState2[1];
20
- return /*#__PURE__*/React.createElement("div", {
21
- className: "two-column-layout-container ".concat(className)
22
- }, /*#__PURE__*/React.createElement("div", {
23
- className: "two-column-aside ".concat(collapsed ? 'hide-left-aside' : '')
24
- }, /*#__PURE__*/React.createElement("div", {
25
- className: "two-colum-left-wrapper"
26
- }, /*#__PURE__*/React.createElement("div", {
27
- className: "two-colum-left-content"
28
- }, leftContent, collapsible && /*#__PURE__*/React.createElement("span", {
29
- onClick: function onClick() {
30
- return setCollapsed(!collapsed);
31
- },
32
- className: "left-aside-slider-btn"
33
- })))), /*#__PURE__*/React.createElement("div", {
34
- className: "two-column-content"
35
- }, children));
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ collapsed = _useState2[0],
29
+ setCollapsed = _useState2[1];
30
+
31
+ return /*#__PURE__*/_jsxs("div", {
32
+ className: "two-column-layout-container ".concat(className),
33
+ children: [/*#__PURE__*/_jsx("div", {
34
+ className: "two-column-aside ".concat(collapsed ? 'hide-left-aside' : ''),
35
+ children: /*#__PURE__*/_jsx("div", {
36
+ className: "two-colum-left-wrapper",
37
+ children: /*#__PURE__*/_jsxs("div", {
38
+ className: "two-colum-left-content",
39
+ children: [leftContent, collapsible && /*#__PURE__*/_jsx("span", {
40
+ onClick: function onClick() {
41
+ return setCollapsed(!collapsed);
42
+ },
43
+ className: "left-aside-slider-btn"
44
+ })]
45
+ })
46
+ })
47
+ }), /*#__PURE__*/_jsx("div", {
48
+ className: "two-column-content",
49
+ children: children
50
+ })]
51
+ });
36
52
  }
53
+
37
54
  export default TwoColumnBox;
@@ -0,0 +1,70 @@
1
+ .two-column-layout-container {
2
+ width: 100%;
3
+ height: 100%;
4
+ position: relative;
5
+ color: var(--color1);
6
+ .two-column-aside {
7
+ transition: width 0.1s ease-in;
8
+ width: 30%;
9
+ height: 100%;
10
+ z-index: 9;
11
+ position: absolute;
12
+ left: 0;
13
+ top: 0;
14
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
15
+ .two-colum-left-wrapper {
16
+ width: 100%;
17
+ height: 100%;
18
+ overflow: hidden;
19
+ }
20
+ .two-colum-left-content {
21
+ width: 100%;
22
+ height: 100%;
23
+ background-color: var(--gray1);
24
+ }
25
+ .left-aside-slider-btn {
26
+ position: absolute;
27
+ width: 8px;
28
+ height: 20px;
29
+ right: -8px;
30
+ top: 50%;
31
+ margin-top: -8px;
32
+ font-size: var(--fs-large);
33
+ background-color: var(--gray5);
34
+ cursor: pointer;
35
+ z-index: 9;
36
+ &:before,
37
+ &:after {
38
+ content: '';
39
+ width: 1px;
40
+ height: 16px;
41
+ z-index: 2;
42
+ background-color: var(--gray1);
43
+ position: absolute;
44
+ }
45
+ &:before {
46
+ left: 2px;
47
+ bottom: 2px;
48
+ }
49
+ &:after {
50
+ right: 2px;
51
+ top: 2px;
52
+ }
53
+ }
54
+ &.hide-left-aside {
55
+ width: 0;
56
+ & + .two-column-content {
57
+ padding-left: 0;
58
+ }
59
+ }
60
+ }
61
+ .two-column-content {
62
+ width: 100%;
63
+ height: 100%;
64
+ overflow: hidden;
65
+ padding-left: 30%;
66
+ background-color: var(--gray2);
67
+ transition: padding-left 0.3s ease-in-out;
68
+ box-sizing: border-box;
69
+ }
70
+ }
@@ -1,4 +1,4 @@
1
- export declare function getGridClassName(grid: any): any[];
1
+ export declare function getGridClassName(grid: any): never[];
2
2
  export declare function computedGrid(grid: any): {
3
3
  xxl: number;
4
4
  xl: number;
@@ -7,4 +7,4 @@ export declare function computedGrid(grid: any): {
7
7
  sm: number;
8
8
  xs: number;
9
9
  };
10
- export declare function computedCuurentGrid(): "xxl" | "xl" | "lg" | "md" | "sm" | "xs";
10
+ export declare function computedCuurentGrid(): "xxl" | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
@@ -1,8 +1,10 @@
1
1
  export function getGridClassName(grid) {
2
2
  var classNames = [];
3
+
3
4
  for (var k in grid) {
4
5
  classNames.push("cloudapp-col-".concat(k, "-").concat(grid[k]));
5
6
  }
7
+
6
8
  return [].concat('cloudapp-col', classNames);
7
9
  }
8
10
  export function computedGrid(grid) {
@@ -14,6 +16,7 @@ export function computedGrid(grid) {
14
16
  sm: 0,
15
17
  xs: 0
16
18
  };
19
+
17
20
  if (Array.isArray(grid)) {
18
21
  grid.forEach(function (item) {
19
22
  for (var k in item) {
@@ -29,32 +32,41 @@ export function computedGrid(grid) {
29
32
  contentGrid[k] = 24 - grid[k];
30
33
  }
31
34
  }
35
+
32
36
  for (var _k in contentGrid) {
33
37
  if (contentGrid[_k] <= 0) {
34
38
  contentGrid[_k] = 24;
35
39
  }
36
40
  }
41
+
37
42
  return contentGrid;
38
43
  }
39
44
  export function computedCuurentGrid() {
40
45
  var width = document.body.clientWidth;
46
+
41
47
  if (width >= 1600) {
42
48
  return 'xxl';
43
49
  }
50
+
44
51
  if (width >= 1200 && width < 1600) {
45
52
  return 'xl';
46
53
  }
54
+
47
55
  if (width >= 992 && width < 1200) {
48
56
  return 'lg';
49
57
  }
58
+
50
59
  if (width >= 768 && width < 992) {
51
60
  return 'md';
52
61
  }
62
+
53
63
  if (width >= 576 && width < 768) {
54
64
  return 'sm';
55
65
  }
66
+
56
67
  if (width < 576) {
57
68
  return 'xs';
58
69
  }
70
+
59
71
  return undefined;
60
72
  }