@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
package/es/Box/index.js CHANGED
@@ -1,25 +1,38 @@
1
- import "antd/lib/col/style";
2
- import _Col from "antd/lib/col";
3
1
  import "antd/lib/row/style";
4
2
  import _Row from "antd/lib/row";
3
+ import "antd/lib/col/style";
4
+ import _Col from "antd/lib/col";
5
+
6
+ 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; }
7
+
8
+ 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; }
9
+
10
+ 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; }
11
+
5
12
  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";
13
+ import TwoColumnBox from "./TwoColumnBox";
14
+ import InfoBox from "./InfoBox";
15
+ import defaultContentGrid from "./deps/content-grid";
16
+ import BetweenBox from "./BetweenBox";
17
+ import "./index.less";
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+
11
20
  function Box(_ref) {
12
21
  var _ref$className = _ref.className,
13
- className = _ref$className === void 0 ? '' : _ref$className,
14
- _ref$contentGrid = _ref.contentGrid,
15
- contentGrid = _ref$contentGrid === void 0 ? defaultContentGrid : _ref$contentGrid,
16
- children = _ref.children;
17
- return /*#__PURE__*/React.createElement(_Row, {
18
- className: "single-column-layout-container ".concat(className)
19
- }, /*#__PURE__*/React.createElement(_Col, Object.assign({
20
- className: "single-column-content"
21
- }, contentGrid), children));
22
+ className = _ref$className === void 0 ? '' : _ref$className,
23
+ _ref$contentGrid = _ref.contentGrid,
24
+ contentGrid = _ref$contentGrid === void 0 ? defaultContentGrid : _ref$contentGrid,
25
+ children = _ref.children;
26
+ return /*#__PURE__*/_jsx(_Row, {
27
+ className: "single-column-layout-container ".concat(className),
28
+ children: /*#__PURE__*/_jsx(_Col, _objectSpread(_objectSpread({
29
+ className: "single-column-content"
30
+ }, contentGrid), {}, {
31
+ children: children
32
+ }))
33
+ });
22
34
  }
35
+
23
36
  Box.TwoColumnBox = TwoColumnBox;
24
37
  Box.InfoBox = InfoBox;
25
38
  Box.BetweenBox = BetweenBox;
@@ -2,8 +2,9 @@
2
2
  width: 100%;
3
3
  height: 100%;
4
4
  background-color: var(--gray1);
5
- }
6
- .single-column-layout-container .single-column-content {
7
- margin: 0 auto;
8
- height: 100%;
5
+
6
+ .single-column-content {
7
+ margin: 0 auto;
8
+ height: 100%;
9
+ }
9
10
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const App: () => JSX.Element;
3
+ export default App;
@@ -0,0 +1,28 @@
1
+ import "antd/lib/config-provider/style";
2
+ import _ConfigProvider from "antd/lib/config-provider";
3
+ import React from 'react';
4
+ import CheckGroupFixed from "./index";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ var defaultSource = Array.from(new Array(100)).map(function (_, i) {
7
+ return {
8
+ label: "\u9009\u9879".concat(i),
9
+ value: i
10
+ };
11
+ });
12
+
13
+ var App = function App() {
14
+ return /*#__PURE__*/_jsx(_ConfigProvider, {
15
+ prefixCls: "cloudapp",
16
+ children: /*#__PURE__*/_jsx("div", {
17
+ style: {
18
+ width: '100%'
19
+ },
20
+ children: /*#__PURE__*/_jsx(CheckGroupFixed, {
21
+ label: "\u6807\u9898",
22
+ source: defaultSource
23
+ })
24
+ })
25
+ });
26
+ };
27
+
28
+ export default App;
@@ -3,47 +3,69 @@ import _Badge from "antd/lib/badge";
3
3
  import "antd/lib/checkbox/style";
4
4
  import _Checkbox from "antd/lib/checkbox";
5
5
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
6
+
7
+ 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; }
8
+
9
+ 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; }
10
+
11
+ 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; }
12
+
6
13
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+
7
15
  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."); }
16
+
8
17
  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); }
18
+
9
19
  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; }
20
+
10
21
  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; }
22
+
11
23
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
+
12
25
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
13
- import "./index.css";
26
+ import "./index.less";
27
+ import { jsxs as _jsxs } from "react/jsx-runtime";
28
+ import { jsx as _jsx } from "react/jsx-runtime";
29
+
14
30
  function CheckGroupFixed(_ref) {
15
31
  var label = _ref.label,
16
- _ref$source = _ref.source,
17
- source = _ref$source === void 0 ? [] : _ref$source,
18
- _ref$checboxSize = _ref.checboxSize,
19
- checboxSize = _ref$checboxSize === void 0 ? 120 : _ref$checboxSize,
20
- _ref$cutRow = _ref.cutRow,
21
- cutRow = _ref$cutRow === void 0 ? 1 : _ref$cutRow,
22
- _ref$labelSize = _ref.labelSize,
23
- labelSize = _ref$labelSize === void 0 ? 100 : _ref$labelSize,
24
- value = _ref.value,
25
- onChange = _ref.onChange;
32
+ _ref$source = _ref.source,
33
+ source = _ref$source === void 0 ? [] : _ref$source,
34
+ _ref$checboxSize = _ref.checboxSize,
35
+ checboxSize = _ref$checboxSize === void 0 ? 120 : _ref$checboxSize,
36
+ _ref$cutRow = _ref.cutRow,
37
+ cutRow = _ref$cutRow === void 0 ? 1 : _ref$cutRow,
38
+ _ref$labelSize = _ref.labelSize,
39
+ labelSize = _ref$labelSize === void 0 ? 100 : _ref$labelSize,
40
+ value = _ref.value,
41
+ onChange = _ref.onChange;
42
+
26
43
  var _useState = useState({
27
- visible: false,
28
- sider: false,
29
- pos: [0, 0],
30
- w: 0,
31
- selectKeys: value || []
32
- }),
33
- _useState2 = _slicedToArray(_useState, 2),
34
- state = _useState2[0],
35
- setState = _useState2[1];
44
+ visible: false,
45
+ sider: false,
46
+ pos: [0, 0],
47
+ w: 0,
48
+ selectKeys: value || []
49
+ }),
50
+ _useState2 = _slicedToArray(_useState, 2),
51
+ state = _useState2[0],
52
+ setState = _useState2[1];
53
+
36
54
  var domRef = useRef(null);
37
55
  useLayoutEffect(function () {
38
- var _a, _b;
39
- var contentEle = (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('.check-content-box');
56
+ var _domRef$current;
57
+
58
+ var contentEle = (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.querySelector('.check-content-box');
40
59
  var contentRect = (contentEle === null || contentEle === void 0 ? void 0 : contentEle.getBoundingClientRect()) || {
41
60
  width: 0
42
61
  };
62
+
43
63
  if (contentRect.width < checboxSize * source.length) {
44
- var lr = (_b = domRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
64
+ var _domRef$current2;
65
+
66
+ var lr = (_domRef$current2 = domRef.current) === null || _domRef$current2 === void 0 ? void 0 : _domRef$current2.getBoundingClientRect();
45
67
  setState(function (old) {
46
- return Object.assign(Object.assign({}, old), {
68
+ return _objectSpread(_objectSpread({}, old), {}, {
47
69
  visible: true,
48
70
  w: (lr === null || lr === void 0 ? void 0 : lr.width) || 0
49
71
  });
@@ -62,74 +84,87 @@ function CheckGroupFixed(_ref) {
62
84
  boxShadow: ' 0 0 10px rgba(0,0,0,0.1)'
63
85
  } : {};
64
86
  }, [state.sider, state.w, state.pos]);
87
+
65
88
  _useUpdateEffect(function () {
66
89
  return onChange === null || onChange === void 0 ? void 0 : onChange(state.selectKeys);
67
90
  }, [state.selectKeys]);
91
+
68
92
  useLayoutEffect(function () {
69
- var dom = domRef.current.querySelector('.check-box-group-layout');
93
+ var _domRef$current3;
94
+
95
+ var dom = (_domRef$current3 = domRef.current) === null || _domRef$current3 === void 0 ? void 0 : _domRef$current3.querySelector('.check-box-group-layout');
70
96
  dom === null || dom === void 0 ? void 0 : dom.setAttribute('style', "grid-template-columns:repeat(auto-fill, minmax(".concat(checboxSize, "px, 1fr));"));
71
97
  }, [checboxSize]);
72
- return /*#__PURE__*/React.createElement("div", {
98
+ return /*#__PURE__*/_jsxs("div", {
73
99
  className: "c-check-group-layout",
74
100
  ref: domRef,
75
101
  style: {
76
102
  height: state.sider ? cutRow * 30 + 20 : 'auto'
77
- }
78
- }, /*#__PURE__*/React.createElement("div", {
79
- className: "c-check-group-box",
80
- style: fixedStyle
81
- }, /*#__PURE__*/React.createElement("span", {
82
- className: "check-label-box",
83
- style: {
84
- width: labelSize
85
- }
86
- }, label, "\uFF1A"), /*#__PURE__*/React.createElement("div", {
87
- className: "check-content-box",
88
- style: {
89
- height: state.sider ? 'auto' : cutRow * 30
90
- }
91
- }, /*#__PURE__*/React.createElement(_Checkbox.Group, {
92
- value: state.selectKeys,
93
- className: "check-box-group-layout",
94
- onChange: function onChange(keys) {
95
- return setState(function (old) {
96
- return Object.assign(Object.assign({}, old), {
97
- selectKeys: keys
103
+ },
104
+ children: [/*#__PURE__*/_jsxs("div", {
105
+ className: "c-check-group-box",
106
+ style: fixedStyle,
107
+ children: [/*#__PURE__*/_jsxs("span", {
108
+ className: "check-label-box",
109
+ style: {
110
+ width: labelSize
111
+ },
112
+ children: [label, "\uFF1A"]
113
+ }), /*#__PURE__*/_jsx("div", {
114
+ className: "check-content-box",
115
+ style: {
116
+ height: state.sider ? 'auto' : cutRow * 30
117
+ },
118
+ children: /*#__PURE__*/_jsx(_Checkbox.Group, {
119
+ value: state.selectKeys,
120
+ className: "check-box-group-layout",
121
+ onChange: function onChange(keys) {
122
+ return setState(function (old) {
123
+ return _objectSpread(_objectSpread({}, old), {}, {
124
+ selectKeys: keys
125
+ });
126
+ });
127
+ },
128
+ children: source.map(function (v) {
129
+ return /*#__PURE__*/_jsx(_Checkbox, {
130
+ style: {
131
+ width: checboxSize
132
+ },
133
+ value: v.value,
134
+ children: /*#__PURE__*/_jsx("span", {
135
+ title: v.label,
136
+ children: v.label
137
+ })
138
+ }, v.value);
139
+ })
140
+ })
141
+ }), state.visible && /*#__PURE__*/_jsx(_Badge, {
142
+ count: state.sider ? 0 : state.selectKeys.length,
143
+ size: "small",
144
+ offset: [10, 0],
145
+ children: /*#__PURE__*/_jsx("span", {
146
+ className: "slice-btn",
147
+ onClick: function onClick() {
148
+ return setState(function (old) {
149
+ return _objectSpread(_objectSpread({}, old), {}, {
150
+ sider: !state.sider
151
+ });
152
+ });
153
+ },
154
+ children: state.sider ? '收起' : '展开'
155
+ })
156
+ })]
157
+ }), state.sider && /*#__PURE__*/_jsx("div", {
158
+ className: "sider-mask",
159
+ onClick: function onClick() {
160
+ return setState(function (old) {
161
+ return _objectSpread(_objectSpread({}, old), {}, {
162
+ sider: false
163
+ });
98
164
  });
99
- });
100
- }
101
- }, source.map(function (v) {
102
- return /*#__PURE__*/React.createElement(_Checkbox, {
103
- style: {
104
- width: checboxSize
105
- },
106
- key: v.value,
107
- value: v.value
108
- }, /*#__PURE__*/React.createElement("span", {
109
- title: v.label
110
- }, v.label));
111
- }))), state.visible && /*#__PURE__*/React.createElement(_Badge, {
112
- count: state.sider ? 0 : state.selectKeys.length,
113
- size: "small",
114
- offset: [10, 0]
115
- }, /*#__PURE__*/React.createElement("span", {
116
- className: "slice-btn",
117
- onClick: function onClick() {
118
- return setState(function (old) {
119
- return Object.assign(Object.assign({}, old), {
120
- sider: !state.sider
121
- });
122
- });
123
- }
124
- }, state.sider ? '收起' : '展开'))), state.sider && /*#__PURE__*/React.createElement("div", {
125
- className: "sider-mask",
126
- onClick: function onClick() {
127
- return setState(function (old) {
128
- return Object.assign(Object.assign({}, old), {
129
- sider: false
130
- });
131
- });
132
- }
133
- }));
165
+ }
166
+ })]
167
+ });
134
168
  }
169
+
135
170
  export default CheckGroupFixed;
@@ -0,0 +1,50 @@
1
+ .c-check-group-layout {
2
+ position: relative;
3
+ .c-check-group-box {
4
+ padding: 10px;
5
+ display: flex;
6
+ }
7
+ .check-label-box {
8
+ width: 80px;
9
+ color: #999;
10
+ }
11
+ .check-content-box {
12
+ width: 100%;
13
+ flex: 1;
14
+ overflow: hidden;
15
+ height: 30px;
16
+ .@{ant-prefix}-checkbox-group {
17
+ display: grid;
18
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
19
+ grid-row-gap: 10px;
20
+ grid-column-gap: 10px;
21
+ .@{ant-prefix}-checkbox-wrapper {
22
+ width: 120px;
23
+ margin-left: 0;
24
+ height: 30px;
25
+ display: flex;
26
+ > span:not(.@{ant-prefix}-checkbox) {
27
+ flex: 1;
28
+ overflow: hidden;
29
+ white-space: nowrap;
30
+ overflow: hidden;
31
+ text-overflow: ellipsis;
32
+ }
33
+ }
34
+ }
35
+ }
36
+ .sider-mask {
37
+ position: fixed;
38
+ z-index: 98;
39
+ width: 100%;
40
+ height: 100%;
41
+ left: 0;
42
+ top: 0;
43
+ }
44
+ .slice-btn {
45
+ color: var(--primary);
46
+ cursor: pointer;
47
+ position: relative;
48
+ top: 4px;
49
+ }
50
+ }
@@ -1,5 +1,5 @@
1
1
  import produce from 'immer';
2
- import { insertThemeStyle, lock } from './utils';
2
+ import { insertThemeStyle, lock } from "./utils";
3
3
  var Config = {
4
4
  app: produce({}, function () {}),
5
5
  bs: produce({}, function () {}),
@@ -21,6 +21,7 @@ var Config = {
21
21
  var index = draft.findIndex(function (v) {
22
22
  return v === id;
23
23
  });
24
+
24
25
  if (index === -1) {
25
26
  draft.push(id);
26
27
  } else {
@@ -44,6 +45,7 @@ var Config = {
44
45
  var index = draft.findIndex(function (v) {
45
46
  return v.id === item.id;
46
47
  });
48
+
47
49
  if (index === -1) {
48
50
  draft.push(item);
49
51
  } else {
@@ -65,6 +67,7 @@ var Config = {
65
67
  return getComputedStyle(document.querySelector(':root')).getPropertyValue("--".concat(themeKey));
66
68
  }
67
69
  };
70
+
68
71
  var LMConfig = function () {
69
72
  if (window['_CONFIG_']) {
70
73
  return window['_CONFIG_'];
@@ -74,4 +77,5 @@ var LMConfig = function () {
74
77
  return Config;
75
78
  }
76
79
  }();
80
+
77
81
  export default LMConfig;
@@ -1,26 +1,41 @@
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 _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; }
6
+
4
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+
5
9
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
10
+
6
11
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+
7
13
  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); }
14
+
8
15
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+
9
17
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
+
10
19
  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; }
20
+
11
21
  var style = document.createElement('style');
12
22
  var isInit = false;
13
23
  export function insertThemeStyle(options) {
14
24
  var _ref;
25
+
15
26
  var tplStr = ':root{<content>}';
27
+
16
28
  var attrArr = (_ref = []).concat.apply(_ref, _toConsumableArray(Object.values(options.vars)));
29
+
17
30
  style.innerHTML = tplStr.replace('<content>', attrArr.reduce(function (a, b) {
18
31
  var _b$split = b.split(':'),
19
- _b$split2 = _slicedToArray(_b$split, 2),
20
- key = _b$split2[0],
21
- value = _b$split2[1];
32
+ _b$split2 = _slicedToArray(_b$split, 2),
33
+ key = _b$split2[0],
34
+ value = _b$split2[1];
35
+
22
36
  return a + "--".concat(key, ":").concat(value, ";\n");
23
37
  }, ''));
38
+
24
39
  if (!isInit) {
25
40
  isInit = true;
26
41
  document.head.appendChild(style);
@@ -1,17 +1,21 @@
1
1
  import React, { useMemo } from 'react';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  var Context = /*#__PURE__*/React.createContext(null);
4
+
3
5
  function Provider(_ref) {
4
6
  var getContainer = _ref.getContainer,
5
- children = _ref.children;
7
+ children = _ref.children;
6
8
  var root = useMemo(function () {
7
9
  return getContainer();
8
10
  }, [getContainer]);
9
- return /*#__PURE__*/React.createElement(Context.Provider, {
11
+ return /*#__PURE__*/_jsx(Context.Provider, {
10
12
  value: {
11
13
  root: root
12
- }
13
- }, children);
14
+ },
15
+ children: children
16
+ });
14
17
  }
18
+
15
19
  Provider.defaultProps = {
16
20
  getContainer: function getContainer() {
17
21
  return document.body;
@@ -3,67 +3,102 @@ import _Select from "antd/lib/select";
3
3
  import _useClickAway from "ahooks/es/useClickAway";
4
4
  import _useToggle3 from "ahooks/es/useToggle";
5
5
  import _uuid from "@cloud-app-dev/utils/es/uuid";
6
+ var _excluded = ["children", "value", "customRender", "popupClassName", "getPopupContainer", "onChange", "selectAotoClose"];
7
+
8
+ 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; }
9
+
10
+ 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; }
11
+
12
+ 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; }
13
+
6
14
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
+
7
16
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+
8
18
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
+
9
20
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
+
10
22
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
23
+
11
24
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
- import { __rest } from "tslib";
25
+
26
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
27
+
28
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
+
13
30
  import React, { useMemo, useRef } from 'react';
14
- import "./index.css";
15
- function CustomRenderSelect(_a) {
16
- var children = _a.children,
17
- value = _a.value,
18
- customRender = _a.customRender,
19
- popupClassName = _a.popupClassName,
20
- getPopupContainer = _a.getPopupContainer,
21
- onChange = _a.onChange,
22
- _a$selectAotoClose = _a.selectAotoClose,
23
- selectAotoClose = _a$selectAotoClose === void 0 ? true : _a$selectAotoClose,
24
- props = __rest(_a, ["children", "value", "customRender", "popupClassName", "getPopupContainer", "onChange", "selectAotoClose"]);
31
+ import "./index.less";
32
+ import { jsx as _jsx } from "react/jsx-runtime";
33
+ import { jsxs as _jsxs } from "react/jsx-runtime";
34
+
35
+ function CustomRenderSelect(_ref) {
36
+ var children = _ref.children,
37
+ value = _ref.value,
38
+ customRender = _ref.customRender,
39
+ popupClassName = _ref.popupClassName,
40
+ getPopupContainer = _ref.getPopupContainer,
41
+ onChange = _ref.onChange,
42
+ _ref$selectAotoClose = _ref.selectAotoClose,
43
+ selectAotoClose = _ref$selectAotoClose === void 0 ? true : _ref$selectAotoClose,
44
+ props = _objectWithoutProperties(_ref, _excluded);
45
+
25
46
  var classname = useMemo(function () {
26
47
  return "custom-render-select-dropdown-".concat(_uuid());
27
48
  }, []);
28
49
  var domRef = useRef(null);
50
+
29
51
  var _useToggle = _useToggle3(),
30
- _useToggle2 = _slicedToArray(_useToggle, 2),
31
- open = _useToggle2[0],
32
- _useToggle2$ = _useToggle2[1],
33
- toggle = _useToggle2$.toggle,
34
- set = _useToggle2$.set;
52
+ _useToggle2 = _slicedToArray(_useToggle, 2),
53
+ open = _useToggle2[0],
54
+ _useToggle2$ = _useToggle2[1],
55
+ toggle = _useToggle2$.toggle,
56
+ set = _useToggle2$.set;
57
+
35
58
  var getDoms = useMemo(function () {
36
59
  return [function () {
37
- return domRef.current.querySelector('.custom-render-box');
60
+ var _domRef$current;
61
+
62
+ return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.querySelector('.custom-render-box');
38
63
  }, function () {
39
64
  return document.querySelector(".".concat(classname));
40
65
  }];
41
- }, []);
66
+ }, [classname]);
67
+
42
68
  _useClickAway(function () {
43
69
  return set(false);
44
70
  }, getDoms, ['click']);
71
+
45
72
  var onSelectChange = function onSelectChange(v) {
46
- onChange && onChange(v);
73
+ onChange === null || onChange === void 0 ? void 0 : onChange(v);
74
+
47
75
  if (selectAotoClose) {
48
76
  set(false);
49
77
  }
50
78
  };
51
- return /*#__PURE__*/React.createElement("div", {
79
+
80
+ return /*#__PURE__*/_jsxs("div", {
52
81
  className: "custom-render-select",
53
- ref: domRef
54
- }, /*#__PURE__*/React.createElement(_Select, Object.assign({}, props, {
55
- value: value,
56
- popupClassName: "custom-render-select-dropdown ".concat(classname, " ").concat(popupClassName),
57
- getPopupContainer: getPopupContainer ? getPopupContainer : function () {
58
- return domRef.current.parentElement.parentElement;
59
- },
60
- open: open,
61
- onChange: onSelectChange
62
- }), children), /*#__PURE__*/React.createElement("div", {
63
- className: "custom-render-box",
64
- onClick: toggle
65
- }, customRender(value)), /*#__PURE__*/React.createElement("div", {
66
- className: "popup-container"
67
- }));
82
+ ref: domRef,
83
+ children: [/*#__PURE__*/_jsx(_Select, _objectSpread(_objectSpread({}, props), {}, {
84
+ value: value,
85
+ popupClassName: "custom-render-select-dropdown ".concat(classname, " ").concat(popupClassName),
86
+ getPopupContainer: getPopupContainer ? getPopupContainer : function () {
87
+ var _domRef$current$paren, _domRef$current2, _domRef$current2$pare;
88
+
89
+ return (_domRef$current$paren = (_domRef$current2 = domRef.current) === null || _domRef$current2 === void 0 ? void 0 : (_domRef$current2$pare = _domRef$current2.parentElement) === null || _domRef$current2$pare === void 0 ? void 0 : _domRef$current2$pare.parentElement) !== null && _domRef$current$paren !== void 0 ? _domRef$current$paren : document.body;
90
+ },
91
+ open: open,
92
+ onChange: onSelectChange,
93
+ children: children
94
+ })), /*#__PURE__*/_jsx("div", {
95
+ className: "custom-render-box",
96
+ onClick: toggle,
97
+ children: customRender(value)
98
+ }), /*#__PURE__*/_jsx("div", {
99
+ className: "popup-container"
100
+ })]
101
+ });
68
102
  }
103
+
69
104
  export default CustomRenderSelect;