@zw-team/react-lib 1.0.1

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 (338) hide show
  1. package/README.md +207 -0
  2. package/dist/components/AccessReport/index.d.ts +29 -0
  3. package/dist/components/AccessReport/index.js +129 -0
  4. package/dist/components/Avatar/Avatar.d.ts +3 -0
  5. package/dist/components/Avatar/Avatar.js +58 -0
  6. package/dist/components/Avatar/index.d.ts +2 -0
  7. package/dist/components/Avatar/index.js +2 -0
  8. package/dist/components/Avatar/types.d.ts +9 -0
  9. package/dist/components/Avatar/types.js +0 -0
  10. package/dist/components/Block/Block.css +8 -0
  11. package/dist/components/Block/Block.d.ts +4 -0
  12. package/dist/components/Block/Block.js +11 -0
  13. package/dist/components/Block/index.d.ts +2 -0
  14. package/dist/components/Block/index.js +2 -0
  15. package/dist/components/Block/types.d.ts +3 -0
  16. package/dist/components/Block/types.js +0 -0
  17. package/dist/components/ConfigProvider/ConfigContext.d.ts +4 -0
  18. package/dist/components/ConfigProvider/ConfigContext.js +19 -0
  19. package/dist/components/ConfigProvider/ConfigProvider.d.ts +4 -0
  20. package/dist/components/ConfigProvider/ConfigProvider.js +57 -0
  21. package/dist/components/ConfigProvider/index.d.ts +2 -0
  22. package/dist/components/ConfigProvider/index.js +2 -0
  23. package/dist/components/ConfigProvider/types.d.ts +19 -0
  24. package/dist/components/ConfigProvider/types.js +0 -0
  25. package/dist/components/CustomColumn/CustomColumn.d.ts +4 -0
  26. package/dist/components/CustomColumn/CustomColumn.js +388 -0
  27. package/dist/components/CustomColumn/CustomColumn.scss +135 -0
  28. package/dist/components/CustomColumn/index.d.ts +2 -0
  29. package/dist/components/CustomColumn/index.js +2 -0
  30. package/dist/components/CustomColumn/types.d.ts +19 -0
  31. package/dist/components/CustomColumn/types.js +0 -0
  32. package/dist/components/DatePicker/DatePicker.d.ts +4 -0
  33. package/dist/components/DatePicker/DatePicker.js +89 -0
  34. package/dist/components/DatePicker/datePickerOption.d.ts +14 -0
  35. package/dist/components/DatePicker/datePickerOption.js +149 -0
  36. package/dist/components/DatePicker/index.d.ts +2 -0
  37. package/dist/components/DatePicker/index.js +2 -0
  38. package/dist/components/DatePicker/types.d.ts +12 -0
  39. package/dist/components/DatePicker/types.js +0 -0
  40. package/dist/components/DatePickerPanel/DatePickerPanel.d.ts +6 -0
  41. package/dist/components/DatePickerPanel/DatePickerPanel.js +397 -0
  42. package/dist/components/DatePickerPanel/datePickerPanel.scss +362 -0
  43. package/dist/components/DatePickerPanel/index.d.ts +2 -0
  44. package/dist/components/DatePickerPanel/index.js +2 -0
  45. package/dist/components/DatePickerPanel/type.d.ts +23 -0
  46. package/dist/components/DatePickerPanel/type.js +0 -0
  47. package/dist/components/DownloadCenter/DownloadCenter.d.ts +5 -0
  48. package/dist/components/DownloadCenter/DownloadCenter.js +367 -0
  49. package/dist/components/DownloadCenter/index.css +54 -0
  50. package/dist/components/DownloadCenter/index.d.ts +2 -0
  51. package/dist/components/DownloadCenter/index.js +2 -0
  52. package/dist/components/DownloadCenter/types.d.ts +27 -0
  53. package/dist/components/DownloadCenter/types.js +0 -0
  54. package/dist/components/Fireworks/Fireworks.d.ts +11 -0
  55. package/dist/components/Fireworks/Fireworks.js +415 -0
  56. package/dist/components/Fireworks/imgs/birthday-cake.svg +180 -0
  57. package/dist/components/Fireworks/imgs/hb.png +0 -0
  58. package/dist/components/Fireworks/imgs/sd.png +0 -0
  59. package/dist/components/Fireworks/imgs/xc.png +0 -0
  60. package/dist/components/Fireworks/imgs/yd.png +0 -0
  61. package/dist/components/Fireworks/index.d.ts +2 -0
  62. package/dist/components/Fireworks/index.js +2 -0
  63. package/dist/components/Fireworks/index.scss +9 -0
  64. package/dist/components/Fireworks/types.d.ts +6 -0
  65. package/dist/components/Fireworks/types.js +0 -0
  66. package/dist/components/Form/Form.css +4 -0
  67. package/dist/components/Form/Form.d.ts +9 -0
  68. package/dist/components/Form/Form.js +18 -0
  69. package/dist/components/Form/index.d.ts +1 -0
  70. package/dist/components/Form/index.js +2 -0
  71. package/dist/components/FormItem/FormItem.css +38 -0
  72. package/dist/components/FormItem/FormItem.d.ts +9 -0
  73. package/dist/components/FormItem/FormItem.js +25 -0
  74. package/dist/components/FormItem/index.d.ts +1 -0
  75. package/dist/components/FormItem/index.js +2 -0
  76. package/dist/components/HomeData/HomeData.d.ts +6 -0
  77. package/dist/components/HomeData/HomeData.js +364 -0
  78. package/dist/components/HomeData/HomeData.scss +161 -0
  79. package/dist/components/HomeData/index.d.ts +1 -0
  80. package/dist/components/HomeData/index.js +2 -0
  81. package/dist/components/Icon/Icon.d.ts +4 -0
  82. package/dist/components/Icon/Icon.js +34 -0
  83. package/dist/components/Icon/index.d.ts +2 -0
  84. package/dist/components/Icon/index.js +2 -0
  85. package/dist/components/Icon/types.d.ts +8 -0
  86. package/dist/components/Icon/types.js +0 -0
  87. package/dist/components/Log/index.d.ts +2 -0
  88. package/dist/components/Log/index.js +2 -0
  89. package/dist/components/Log/src/Detail.d.ts +7 -0
  90. package/dist/components/Log/src/Detail.js +71 -0
  91. package/dist/components/Log/src/Detail.scss +27 -0
  92. package/dist/components/Log/src/Log.d.ts +5 -0
  93. package/dist/components/Log/src/Log.js +335 -0
  94. package/dist/components/Log/src/Log.scss +50 -0
  95. package/dist/components/Log/src/useLogTableColumns.d.ts +2 -0
  96. package/dist/components/Log/src/useLogTableColumns.js +141 -0
  97. package/dist/components/Log/types.d.ts +5 -0
  98. package/dist/components/Log/types.js +0 -0
  99. package/dist/components/LogButton/LogButton.d.ts +4 -0
  100. package/dist/components/LogButton/LogButton.js +30 -0
  101. package/dist/components/LogButton/index.d.ts +2 -0
  102. package/dist/components/LogButton/index.js +2 -0
  103. package/dist/components/LogButton/logbutton.css +15 -0
  104. package/dist/components/LogButton/types.d.ts +10 -0
  105. package/dist/components/LogButton/types.js +0 -0
  106. package/dist/components/LogDialog/BiLogManager.d.ts +29 -0
  107. package/dist/components/LogDialog/BiLogManager.js +78 -0
  108. package/dist/components/LogDialog/LogDialog.d.ts +8 -0
  109. package/dist/components/LogDialog/LogDialog.js +106 -0
  110. package/dist/components/LogDialog/LogDialog.scss +29 -0
  111. package/dist/components/LogDialog/index.d.ts +3 -0
  112. package/dist/components/LogDialog/index.js +3 -0
  113. package/dist/components/LogDialog/types.d.ts +8 -0
  114. package/dist/components/LogDialog/types.js +0 -0
  115. package/dist/components/MediaPreview/MediaPreview.d.ts +5 -0
  116. package/dist/components/MediaPreview/MediaPreview.js +124 -0
  117. package/dist/components/MediaPreview/hook.d.ts +26 -0
  118. package/dist/components/MediaPreview/hook.js +174 -0
  119. package/dist/components/MediaPreview/index.css +202 -0
  120. package/dist/components/MediaPreview/index.d.ts +2 -0
  121. package/dist/components/MediaPreview/index.js +2 -0
  122. package/dist/components/MediaPreview/types.d.ts +24 -0
  123. package/dist/components/MediaPreview/types.js +0 -0
  124. package/dist/components/Modal/Modal.d.ts +3 -0
  125. package/dist/components/Modal/Modal.js +31 -0
  126. package/dist/components/Modal/index.d.ts +2 -0
  127. package/dist/components/Modal/index.js +2 -0
  128. package/dist/components/Modal/types.d.ts +8 -0
  129. package/dist/components/Modal/types.js +0 -0
  130. package/dist/components/ModalStore/ModalProvider.d.ts +11 -0
  131. package/dist/components/ModalStore/ModalProvider.js +15 -0
  132. package/dist/components/ModalStore/ModalStore.d.ts +78 -0
  133. package/dist/components/ModalStore/ModalStore.js +188 -0
  134. package/dist/components/ModalStore/index.d.ts +3 -0
  135. package/dist/components/ModalStore/index.js +4 -0
  136. package/dist/components/ModalStore/types.d.ts +73 -0
  137. package/dist/components/ModalStore/types.js +0 -0
  138. package/dist/components/MoreButton/MoreButton.d.ts +3 -0
  139. package/dist/components/MoreButton/MoreButton.js +50 -0
  140. package/dist/components/MoreButton/index.d.ts +2 -0
  141. package/dist/components/MoreButton/index.js +2 -0
  142. package/dist/components/MoreButton/types.d.ts +15 -0
  143. package/dist/components/MoreButton/types.js +0 -0
  144. package/dist/components/NavbarTool/NavbarTool.d.ts +5 -0
  145. package/dist/components/NavbarTool/NavbarTool.js +143 -0
  146. package/dist/components/NavbarTool/components/index.css +49 -0
  147. package/dist/components/NavbarTool/components/index.d.ts +5 -0
  148. package/dist/components/NavbarTool/components/index.js +98 -0
  149. package/dist/components/NavbarTool/index.css +14 -0
  150. package/dist/components/NavbarTool/index.d.ts +2 -0
  151. package/dist/components/NavbarTool/index.js +2 -0
  152. package/dist/components/NavbarTool/types.d.ts +40 -0
  153. package/dist/components/NavbarTool/types.js +0 -0
  154. package/dist/components/NoticeCenter/NoticeCenter.d.ts +4 -0
  155. package/dist/components/NoticeCenter/NoticeCenter.js +334 -0
  156. package/dist/components/NoticeCenter/assets/notice.png +0 -0
  157. package/dist/components/NoticeCenter/assets/tongzhi.png +0 -0
  158. package/dist/components/NoticeCenter/index.d.ts +2 -0
  159. package/dist/components/NoticeCenter/index.js +2 -0
  160. package/dist/components/NoticeCenter/noticeCenter.scss +232 -0
  161. package/dist/components/NoticeCenter/types.d.ts +6 -0
  162. package/dist/components/NoticeCenter/types.js +0 -0
  163. package/dist/components/Pagination/BiPagination.css +152 -0
  164. package/dist/components/Pagination/Pagination.d.ts +5 -0
  165. package/dist/components/Pagination/Pagination.js +67 -0
  166. package/dist/components/Pagination/index.d.ts +2 -0
  167. package/dist/components/Pagination/index.js +2 -0
  168. package/dist/components/Pagination/types.d.ts +14 -0
  169. package/dist/components/Pagination/types.js +0 -0
  170. package/dist/components/ResponseInterceptor/index.d.ts +17 -0
  171. package/dist/components/ResponseInterceptor/index.js +43 -0
  172. package/dist/components/SuperDate/SuperDate.d.ts +6 -0
  173. package/dist/components/SuperDate/SuperDate.js +113 -0
  174. package/dist/components/SuperDate/SuperDate.scss +42 -0
  175. package/dist/components/SuperDate/components/CustomRangPanel/CustomRangPanel.d.ts +5 -0
  176. package/dist/components/SuperDate/components/CustomRangPanel/CustomRangPanel.js +87 -0
  177. package/dist/components/SuperDate/components/CustomRangPanel/CustomRangPanel.scss +52 -0
  178. package/dist/components/SuperDate/components/DynamicTimeCom/DynamicTimeCom.d.ts +6 -0
  179. package/dist/components/SuperDate/components/DynamicTimeCom/DynamicTimeCom.js +129 -0
  180. package/dist/components/SuperDate/components/DynamicTimeCom/dynamicTimeCom.scss +70 -0
  181. package/dist/components/SuperDate/constant.d.ts +35 -0
  182. package/dist/components/SuperDate/constant.js +27 -0
  183. package/dist/components/SuperDate/index.d.ts +2 -0
  184. package/dist/components/SuperDate/index.js +2 -0
  185. package/dist/components/SuperDate/store.d.ts +68 -0
  186. package/dist/components/SuperDate/store.js +254 -0
  187. package/dist/components/SuperDate/types.d.ts +34 -0
  188. package/dist/components/SuperDate/types.js +0 -0
  189. package/dist/components/SuperDate/utils.d.ts +18 -0
  190. package/dist/components/SuperDate/utils.js +14 -0
  191. package/dist/components/SystemLink/SystemLink.d.ts +4 -0
  192. package/dist/components/SystemLink/SystemLink.js +85 -0
  193. package/dist/components/SystemLink/index.d.ts +1 -0
  194. package/dist/components/SystemLink/index.js +2 -0
  195. package/dist/components/SystemLink/index.scss +142 -0
  196. package/dist/components/Table/ResizableTitle.d.ts +3 -0
  197. package/dist/components/Table/ResizableTitle.js +43 -0
  198. package/dist/components/Table/Table.d.ts +9 -0
  199. package/dist/components/Table/Table.js +189 -0
  200. package/dist/components/Table/index.d.ts +2 -0
  201. package/dist/components/Table/index.js +2 -0
  202. package/dist/components/Table/index.scss +42 -0
  203. package/dist/components/Table/types.d.ts +24 -0
  204. package/dist/components/Table/types.js +0 -0
  205. package/dist/components/Table/useHeaderPopper.d.ts +8 -0
  206. package/dist/components/Table/useHeaderPopper.js +95 -0
  207. package/dist/components/TableHeaderPopper/EditBox.d.ts +6 -0
  208. package/dist/components/TableHeaderPopper/EditBox.js +208 -0
  209. package/dist/components/TableHeaderPopper/Popover.d.ts +6 -0
  210. package/dist/components/TableHeaderPopper/Popover.js +85 -0
  211. package/dist/components/TableHeaderPopper/index.d.ts +3 -0
  212. package/dist/components/TableHeaderPopper/index.js +3 -0
  213. package/dist/components/TableHeaderPopper/index.scss +96 -0
  214. package/dist/components/TaskCenter/TaskCenter.d.ts +4 -0
  215. package/dist/components/TaskCenter/TaskCenter.js +257 -0
  216. package/dist/components/TaskCenter/TaskCenter.scss +44 -0
  217. package/dist/components/TaskCenter/api.d.ts +13 -0
  218. package/dist/components/TaskCenter/api.js +13 -0
  219. package/dist/components/TaskCenter/index.d.ts +2 -0
  220. package/dist/components/TaskCenter/index.js +2 -0
  221. package/dist/components/TaskCenter/types.d.ts +29 -0
  222. package/dist/components/TaskCenter/types.js +0 -0
  223. package/dist/components/TooltipIcon/TooltipIcon.d.ts +3 -0
  224. package/dist/components/TooltipIcon/TooltipIcon.js +43 -0
  225. package/dist/components/TooltipIcon/index.d.ts +2 -0
  226. package/dist/components/TooltipIcon/index.js +2 -0
  227. package/dist/components/TooltipIcon/types.d.ts +14 -0
  228. package/dist/components/TooltipIcon/types.js +0 -0
  229. package/dist/components/Verification/content.d.ts +11 -0
  230. package/dist/components/Verification/content.js +223 -0
  231. package/dist/components/Verification/index.css +43 -0
  232. package/dist/components/Verification/index.d.ts +1 -0
  233. package/dist/components/Verification/index.js +37 -0
  234. package/dist/components/index.d.ts +32 -0
  235. package/dist/components/index.js +29 -0
  236. package/dist/config/index.d.ts +83 -0
  237. package/dist/config/index.js +115 -0
  238. package/dist/config/theme/index.d.ts +368 -0
  239. package/dist/config/theme/index.js +369 -0
  240. package/dist/hooks/createAlive.d.ts +11 -0
  241. package/dist/hooks/createAlive.js +22 -0
  242. package/dist/hooks/createGlobalState.d.ts +7 -0
  243. package/dist/hooks/createGlobalState.js +28 -0
  244. package/dist/hooks/index.d.ts +26 -0
  245. package/dist/hooks/index.js +25 -0
  246. package/dist/hooks/useAsync.d.ts +27 -0
  247. package/dist/hooks/useAsync.js +76 -0
  248. package/dist/hooks/useClickOther.d.ts +10 -0
  249. package/dist/hooks/useClickOther.js +30 -0
  250. package/dist/hooks/useCopyToClipboard.d.ts +7 -0
  251. package/dist/hooks/useCopyToClipboard.js +32 -0
  252. package/dist/hooks/useCreate.d.ts +7 -0
  253. package/dist/hooks/useCreate.js +21 -0
  254. package/dist/hooks/useEventListener.d.ts +22 -0
  255. package/dist/hooks/useEventListener.js +33 -0
  256. package/dist/hooks/useHistoryStore.d.ts +16 -0
  257. package/dist/hooks/useHistoryStore.js +106 -0
  258. package/dist/hooks/useIntersectionObserver.d.ts +8 -0
  259. package/dist/hooks/useIntersectionObserver.js +23 -0
  260. package/dist/hooks/useInterval.d.ts +8 -0
  261. package/dist/hooks/useInterval.js +19 -0
  262. package/dist/hooks/useLatest.d.ts +2 -0
  263. package/dist/hooks/useLatest.js +12 -0
  264. package/dist/hooks/useLockAsyncFn.d.ts +7 -0
  265. package/dist/hooks/useLockAsyncFn.js +24 -0
  266. package/dist/hooks/useLockFn.d.ts +7 -0
  267. package/dist/hooks/useLockFn.js +17 -0
  268. package/dist/hooks/useMergedState.d.ts +10 -0
  269. package/dist/hooks/useMergedState.js +30 -0
  270. package/dist/hooks/useMountedState.d.ts +4 -0
  271. package/dist/hooks/useMountedState.js +13 -0
  272. package/dist/hooks/usePermission.d.ts +8 -0
  273. package/dist/hooks/usePermission.js +21 -0
  274. package/dist/hooks/usePersistFn.d.ts +8 -0
  275. package/dist/hooks/usePersistFn.js +13 -0
  276. package/dist/hooks/useReactive.d.ts +7 -0
  277. package/dist/hooks/useReactive.js +34 -0
  278. package/dist/hooks/useRefresh.d.ts +5 -0
  279. package/dist/hooks/useRefresh.js +8 -0
  280. package/dist/hooks/useToggle.d.ts +16 -0
  281. package/dist/hooks/useToggle.js +20 -0
  282. package/dist/hooks/useUnmount.d.ts +6 -0
  283. package/dist/hooks/useUnmount.js +10 -0
  284. package/dist/hooks/useUpdateEffect.d.ts +9 -0
  285. package/dist/hooks/useUpdateEffect.js +10 -0
  286. package/dist/hooks/useWindowSize.d.ts +6 -0
  287. package/dist/hooks/useWindowSize.js +15 -0
  288. package/dist/hooks/util.d.ts +9 -0
  289. package/dist/hooks/util.js +6 -0
  290. package/dist/index.d.ts +5 -0
  291. package/dist/index.js +2 -0
  292. package/dist/utils/array.d.ts +12 -0
  293. package/dist/utils/array.js +15 -0
  294. package/dist/utils/classNames.d.ts +4 -0
  295. package/dist/utils/classNames.js +19 -0
  296. package/dist/utils/date.d.ts +98 -0
  297. package/dist/utils/date.js +101 -0
  298. package/dist/utils/debounce.d.ts +8 -0
  299. package/dist/utils/debounce.js +38 -0
  300. package/dist/utils/deepClone.d.ts +6 -0
  301. package/dist/utils/deepClone.js +10 -0
  302. package/dist/utils/empty.d.ts +16 -0
  303. package/dist/utils/empty.js +24 -0
  304. package/dist/utils/formatPrice.d.ts +2 -0
  305. package/dist/utils/formatPrice.js +15 -0
  306. package/dist/utils/getUUID.d.ts +1 -0
  307. package/dist/utils/getUUID.js +17 -0
  308. package/dist/utils/getUrlParams.d.ts +11 -0
  309. package/dist/utils/getUrlParams.js +10 -0
  310. package/dist/utils/index.d.ts +20 -0
  311. package/dist/utils/index.js +19 -0
  312. package/dist/utils/listToTree.d.ts +12 -0
  313. package/dist/utils/listToTree.js +14 -0
  314. package/dist/utils/object.d.ts +6 -0
  315. package/dist/utils/object.js +5 -0
  316. package/dist/utils/ossUpload.d.ts +45 -0
  317. package/dist/utils/ossUpload.js +88 -0
  318. package/dist/utils/parseTo.d.ts +6 -0
  319. package/dist/utils/parseTo.js +9 -0
  320. package/dist/utils/request/accessReport.d.ts +2 -0
  321. package/dist/utils/request/accessReport.js +27 -0
  322. package/dist/utils/request/defaultRequest.d.ts +9 -0
  323. package/dist/utils/request/defaultRequest.js +33 -0
  324. package/dist/utils/request/exportDownload.d.ts +2 -0
  325. package/dist/utils/request/exportDownload.js +28 -0
  326. package/dist/utils/request/index.d.ts +29 -0
  327. package/dist/utils/request/index.js +40 -0
  328. package/dist/utils/request/noticeCenter.d.ts +2 -0
  329. package/dist/utils/request/noticeCenter.js +28 -0
  330. package/dist/utils/svgIcon/index.d.ts +47 -0
  331. package/dist/utils/svgIcon/index.js +76 -0
  332. package/dist/utils/throttle.d.ts +10 -0
  333. package/dist/utils/throttle.js +21 -0
  334. package/dist/utils/time/index.d.ts +7 -0
  335. package/dist/utils/time/index.js +12 -0
  336. package/dist/utils/tools.d.ts +43 -0
  337. package/dist/utils/tools.js +57 -0
  338. package/package.json +116 -0
@@ -0,0 +1,202 @@
1
+ .image-preview-mask {
2
+ position: fixed;
3
+ inset: 0;
4
+ background: rgba(0, 0, 0, 0.5);
5
+ z-index: 20600;
6
+ display: flex;
7
+ flex-direction: column;
8
+ justify-content: center;
9
+ align-items: center;
10
+ padding-bottom: 100px;
11
+ user-select: none;
12
+ -webkit-user-select: none;
13
+ /* Safari */
14
+ -moz-user-select: none;
15
+ /* Firefox */
16
+ -ms-user-select: none;
17
+ /* IE/Edge */
18
+ }
19
+
20
+ .main-containerImage {
21
+ flex: 1;
22
+ display: flex;
23
+ justify-content: center;
24
+ align-items: center;
25
+ max-height: 100%;
26
+ width: 100%;
27
+ min-height: 0;
28
+ contain: layout style paint;
29
+ }
30
+
31
+ .main-image {
32
+ max-width: 90vw;
33
+ max-height: 75vh;
34
+ object-fit: contain;
35
+ opacity: 0;
36
+ animation: fadeIn 0.15s ease-out forwards;
37
+ }
38
+
39
+ @keyframes fadeIn {
40
+ to {
41
+ opacity: 1;
42
+ }
43
+ }
44
+
45
+ /* 主图左右切换按钮 */
46
+ .nav {
47
+ position: fixed;
48
+ top: 50%;
49
+ font-size: 24px;
50
+ color: rgba(255, 255, 255, 0.8);
51
+ cursor: pointer;
52
+ user-select: none;
53
+ transform: translateY(-50%);
54
+ z-index: 20061;
55
+ transition: color 0.15s;
56
+ width: 44px;
57
+ height: 44px;
58
+ background: rgba(13, 13, 13, 0.5);
59
+ border-radius: 50%;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ }
64
+
65
+ .nav:hover {
66
+ color: white;
67
+ }
68
+
69
+ .nav.left {
70
+ left: 30px;
71
+ }
72
+
73
+ .nav.right {
74
+ right: 30px;
75
+ }
76
+
77
+ /* 缩略图整体容器 */
78
+ .thumb-container {
79
+ position: fixed;
80
+ bottom: 0px;
81
+ left: 50%;
82
+ transform: translateX(-50%);
83
+ display: flex;
84
+ align-items: center;
85
+ z-index: 20061;
86
+ }
87
+
88
+ /* 缩略图列表 */
89
+ .thumb-list {
90
+ display: flex;
91
+ gap: 16px;
92
+ overflow-x: auto;
93
+ max-width: 80vw;
94
+ scroll-behavior: smooth;
95
+ padding: 30px 10px;
96
+ border-radius: 5px;
97
+ height: 150px;
98
+ align-items: center;
99
+ contain: layout style;
100
+ }
101
+
102
+ .thumb-list::-webkit-scrollbar {
103
+ display: none;
104
+ }
105
+
106
+ .thumb {
107
+ position: relative;
108
+ width: 80px;
109
+ height: 80px;
110
+ cursor: pointer;
111
+ flex-shrink: 0;
112
+ transition:
113
+ transform 0.2s ease,
114
+ box-shadow 0.2s ease;
115
+ border-radius: 4px;
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ will-change: transform;
120
+ }
121
+
122
+ .thumb img {
123
+ width: 100%;
124
+ height: 100%;
125
+ object-fit: cover;
126
+ border-radius: 4px;
127
+ pointer-events: none;
128
+ }
129
+
130
+ .thumb:hover {
131
+ transform: scale(1.08);
132
+ z-index: 2;
133
+ }
134
+
135
+ .thumb.active {
136
+ box-shadow: 0 0 0 2px #fff;
137
+ transform: scale(1.2);
138
+ z-index: 1;
139
+ }
140
+
141
+ /* 缩略图滚动按钮 */
142
+ .thumb-scroll-btn {
143
+ width: 24px;
144
+ height: 32px;
145
+ background: rgba(13, 13, 13, 0.5);
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ color: rgba(255, 255, 255, 0.8);
150
+ cursor: pointer;
151
+ transition:
152
+ color 0.2s,
153
+ background 0.2s;
154
+ }
155
+
156
+ .thumb-scroll-btn:hover {
157
+ color: white;
158
+ background: rgba(13, 13, 13, 0.8);
159
+ }
160
+
161
+ .thumb-scroll-btn.left {
162
+ margin-right: 8px;
163
+ }
164
+
165
+ .thumb-scroll-btn.right {
166
+ margin-left: 8px;
167
+ }
168
+
169
+ /* 关闭按钮 */
170
+ .close-btn {
171
+ position: fixed;
172
+ top: 20px;
173
+ right: 30px;
174
+ font-size: 19px;
175
+ width: 44px;
176
+ height: 44px;
177
+ display: flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ border-radius: 50%;
181
+ background: rgba(13, 13, 13, 0.5);
182
+ color: rgba(255, 255, 255, 0.8);
183
+ cursor: pointer;
184
+ z-index: 20061;
185
+ transition: color 0.15s;
186
+ }
187
+
188
+ .close-btn:hover {
189
+ color: white;
190
+ }
191
+
192
+ /* 外层触发图片样式,按需要加 */
193
+ .image-preview-trigger {
194
+ display: inline-block;
195
+ cursor: pointer;
196
+ }
197
+
198
+ .image-preview-trigger-img {
199
+ border-radius: 4px;
200
+ display: block;
201
+ object-fit: cover;
202
+ }
@@ -0,0 +1,2 @@
1
+ export { default as BiMediaPreview } from './MediaPreview';
2
+ export type { MediaPreviewProps } from './types';
@@ -0,0 +1,2 @@
1
+ import MediaPreview from "./MediaPreview.js";
2
+ export { MediaPreview as BiMediaPreview };
@@ -0,0 +1,24 @@
1
+ import type { ImageProps } from 'antd';
2
+ export interface MediaPreviewProps {
3
+ /** 图片地址数组 */
4
+ items: string[];
5
+ /** 外层展示第几张图,默认 0 */
6
+ triggerIndex?: number;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ /** 受控:预览是否可见(传了就是受控) */
10
+ previewVisible?: boolean;
11
+ /** 非受控:预览默认是否可见 */
12
+ defaultPreviewVisible?: boolean;
13
+ /** 可见性变化回调(受控/非受控都会触发) */
14
+ onPreviewVisibleChange?: (visible: boolean) => void;
15
+ /** 外层触发图片的 antd Image 额外属性(如 width/height 等) */
16
+ triggerImageProps?: Omit<ImageProps, 'src' | 'preview'>;
17
+ /**
18
+ * 预览挂载容器,学习 antd:
19
+ * - 不传:挂载到 document.body
20
+ * - 函数:返回 DOM 容器
21
+ * - 直接传 DOM 元素
22
+ */
23
+ getContainer?: HTMLElement | (() => HTMLElement) | null;
24
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ import type { BiModalProps } from './types';
2
+ declare const BiModal: ({ open, top, title, showFooter, showConfirm, showCancel, okText, cancelText, confirmLoading, footer, onOk, onCancel, ...props }: BiModalProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default BiModal;
@@ -0,0 +1,31 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Button, Modal } from "antd";
3
+ const BiModal = ({ open, top = '15vh', title = '提示', showFooter = true, showConfirm = true, showCancel = true, okText = '确定', cancelText = '取消', confirmLoading = false, footer, onOk, onCancel, ...props })=>{
4
+ const defaultFooter = /*#__PURE__*/ jsxs(Fragment, {
5
+ children: [
6
+ showCancel && /*#__PURE__*/ jsx(Button, {
7
+ onClick: onCancel,
8
+ children: cancelText
9
+ }),
10
+ showConfirm && /*#__PURE__*/ jsx(Button, {
11
+ type: "primary",
12
+ loading: confirmLoading,
13
+ onClick: onOk,
14
+ children: okText
15
+ })
16
+ ]
17
+ });
18
+ return /*#__PURE__*/ jsx(Modal, {
19
+ open: open,
20
+ title: title,
21
+ style: {
22
+ top
23
+ },
24
+ onCancel: onCancel,
25
+ footer: showFooter ? footer || defaultFooter : null,
26
+ ...props,
27
+ children: props.children
28
+ });
29
+ };
30
+ const Modal_Modal = BiModal;
31
+ export { Modal_Modal as default };
@@ -0,0 +1,2 @@
1
+ export { default as BiModal } from './Modal';
2
+ export type { BiModalProps } from './types';
@@ -0,0 +1,2 @@
1
+ import Modal from "./Modal.js";
2
+ export { Modal as BiModal };
@@ -0,0 +1,8 @@
1
+ import type { ModalProps } from 'antd';
2
+ export interface BiModalProps extends ModalProps {
3
+ top?: React.CSSProperties['top'];
4
+ showFooter?: boolean;
5
+ showCancel?: boolean;
6
+ showConfirm?: boolean;
7
+ confirmLoading?: boolean;
8
+ }
File without changes
@@ -0,0 +1,11 @@
1
+ import type { ModalStore } from './index';
2
+ /**
3
+ * 弹窗占位
4
+ * @example
5
+ * <ModalProvider>{() => modalStore}</ModalProvider>
6
+ * @param props
7
+ */
8
+ declare const ModalProvider: (props: {
9
+ children: () => ModalStore;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export default ModalProvider;
@@ -0,0 +1,15 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { useStore } from "zustand";
3
+ const ModalProvider = (props)=>{
4
+ const { children } = props;
5
+ const modalStore = children();
6
+ const list = useStore(modalStore.getStore(), (state)=>state.list);
7
+ return /*#__PURE__*/ jsx(Fragment, {
8
+ children: list.map((item)=>/*#__PURE__*/ jsx(item.Modal, {
9
+ ref: item.refObject,
10
+ ...item.innerProps || {}
11
+ }, item.innerId))
12
+ });
13
+ };
14
+ const ModalStore_ModalProvider = ModalProvider;
15
+ export { ModalStore_ModalProvider as default };
@@ -0,0 +1,78 @@
1
+ import { type JSX } from 'react';
2
+ import type { IModal, IModalItem, IModalItemBase, IModalItemInner, IModalItemNoRef, IModalProps, IModalPropsR, IModalWithRef } from './types';
3
+ interface ModalStoreState {
4
+ list: IModalItemInner[];
5
+ pushItem: (item: IModalItemInner) => void;
6
+ updateItem: (id: number, updater: (item: IModalItemInner) => void) => void;
7
+ closeItem: (id: number) => void;
8
+ removeItem: (id: number) => void;
9
+ removeItems: (predicate: (item: IModalItemInner) => boolean) => void;
10
+ clearAll: () => void;
11
+ }
12
+ /**
13
+ * 弹窗管理
14
+ */
15
+ declare class ModalStore {
16
+ protected _id: number;
17
+ protected get id(): number;
18
+ protected store: import("zustand").UseBoundStore<import("zustand").StoreApi<ModalStoreState>>;
19
+ get list(): IModalItemInner<any, any, any>[];
20
+ protected pushItem(item: IModalItem): IModalItemInner<any, any, any>;
21
+ protected findItem<P, V, R = any>(Modal: IModalItemBase<P, V, R>['Modal'], single: boolean): IModalItemInner<P, V, R>;
22
+ protected findById<P, V>(id: number): IModalItemInner<P, V>;
23
+ protected _create<P extends IModalProps<V>, V, R>(Modal: IModal<P, V> | IModalWithRef<P, V, R>, destroyOnClose: boolean): IModalItem<P, V, R>;
24
+ /**
25
+ * 创建弹窗实例
26
+ * @param Modal 弹窗组件
27
+ * @param destroyOnClose 关闭后是否直接销毁
28
+ */
29
+ create<P extends IModalProps<V>, V>(Modal: IModal<P, V>, destroyOnClose?: boolean): IModalItemNoRef<P, V>;
30
+ /**
31
+ * 创建弹窗实例(带ref的)
32
+ * @param Modal 弹窗组件
33
+ * @param destroyOnClose 关闭后是否直接销毁
34
+ */
35
+ create<P extends IModalProps<V>, V, R>(Modal: IModalWithRef<P, V, R>, destroyOnClose?: boolean): IModalItem<P, V, R>;
36
+ /**
37
+ * 打开弹窗
38
+ * @param Modal 弹窗组件
39
+ * @param props 属性
40
+ * @param destroyOnClose 关闭后是否直接销毁
41
+ * @param single 是否同时只打开一个
42
+ */
43
+ open<P extends IModalProps<V>, V>(Modal: IModal<P, V>, props: IModalPropsR<P, V>, destroyOnClose?: boolean, single?: boolean): IModalItemNoRef<P, V>;
44
+ /**
45
+ * 打开弹窗(带ref的)
46
+ * @param Modal 弹窗组件
47
+ * @param props 属性
48
+ * @param destroyOnClose 关闭后是否直接销毁,默认 `true`
49
+ * @param single 是否同时只打开一个,默认 `true`
50
+ */
51
+ open<P extends IModalProps<V>, V, R>(Modal: IModalWithRef<P, V, R>, props: IModalPropsR<P, V>, destroyOnClose?: boolean, single?: boolean): IModalItem<P, V, R>;
52
+ /**
53
+ * 更新弹窗属性
54
+ * @param id
55
+ * @param props
56
+ * @param top 弹窗置顶
57
+ */
58
+ update<P extends IModalProps<V>, V>(id: number, props: Partial<Omit<P, keyof Omit<IModalProps<V>, 'zIndex'>>>, top?: boolean): boolean;
59
+ /**
60
+ * 关闭弹窗
61
+ * @param id
62
+ */
63
+ close(id: number): boolean;
64
+ /**
65
+ * 销毁弹窗
66
+ * @param id
67
+ */
68
+ destroy(id?: number | ((item: IModalItemInner<any, any, any>) => boolean)): boolean;
69
+ /**
70
+ * 生成弹窗组件
71
+ */
72
+ component<P, R>(Component: (props: IModalProps<R> & P) => JSX.Element): (props: IModalProps<R> & P) => JSX.Element;
73
+ /**
74
+ * 获取 zustand store,供 ModalProvider 使用
75
+ */
76
+ getStore(): import("zustand").UseBoundStore<import("zustand").StoreApi<ModalStoreState>>;
77
+ }
78
+ export default ModalStore;
@@ -0,0 +1,188 @@
1
+ import react, { createRef } from "react";
2
+ import { create } from "zustand";
3
+ const REACT_MEMO_TYPE = Symbol.for('react.forward_ref');
4
+ class ModalStore_ModalStore {
5
+ _id = 1;
6
+ get id() {
7
+ return this._id++;
8
+ }
9
+ store = create((set, get)=>({
10
+ list: [],
11
+ pushItem: (item)=>{
12
+ set((state)=>({
13
+ list: [
14
+ ...state.list,
15
+ item
16
+ ]
17
+ }));
18
+ },
19
+ updateItem: (id, updater)=>{
20
+ set((state)=>{
21
+ const index = state.list.findIndex((v)=>v.innerId === id);
22
+ if (-1 === index) return state;
23
+ const newList = [
24
+ ...state.list
25
+ ];
26
+ updater(newList[index]);
27
+ return {
28
+ list: newList
29
+ };
30
+ });
31
+ },
32
+ closeItem: (id)=>{
33
+ set((state)=>{
34
+ const index = state.list.findIndex((v)=>v.innerId === id);
35
+ if (-1 === index) return state;
36
+ const newList = [
37
+ ...state.list
38
+ ];
39
+ if (newList[index].innerProps) newList[index].innerProps.visible = false;
40
+ return {
41
+ list: newList
42
+ };
43
+ });
44
+ },
45
+ removeItem: (id)=>{
46
+ set((state)=>({
47
+ list: state.list.filter((v)=>v.innerId !== id)
48
+ }));
49
+ },
50
+ removeItems: (predicate)=>{
51
+ set((state)=>({
52
+ list: state.list.filter((v)=>!predicate(v))
53
+ }));
54
+ },
55
+ clearAll: ()=>{
56
+ set({
57
+ list: []
58
+ });
59
+ }
60
+ }));
61
+ get list() {
62
+ return this.store.getState().list;
63
+ }
64
+ pushItem(item) {
65
+ const innerItem = item;
66
+ innerItem.innerId = this.id;
67
+ this.store.getState().pushItem(innerItem);
68
+ return innerItem;
69
+ }
70
+ findItem(Modal, single) {
71
+ return this.list.find((v)=>v.Modal === Modal && (single || v.innerProps?.visible === false));
72
+ }
73
+ findById(id) {
74
+ return this.list.find((item)=>item.innerId === id);
75
+ }
76
+ _create(Modal, destroyOnClose) {
77
+ let resolve;
78
+ let future;
79
+ let innerItem;
80
+ const ref = REACT_MEMO_TYPE === Modal.$$typeof ? createRef() : void 0;
81
+ const item = {
82
+ get id () {
83
+ return innerItem?.innerId || -1;
84
+ },
85
+ get Modal () {
86
+ return Modal;
87
+ },
88
+ get props () {
89
+ return innerItem?.innerProps;
90
+ },
91
+ get refObject () {
92
+ return ref;
93
+ },
94
+ get ref () {
95
+ return ref?.current;
96
+ },
97
+ get afterClose () {
98
+ if (!future) future = new Promise((_resolve)=>{
99
+ resolve = _resolve;
100
+ });
101
+ return future;
102
+ },
103
+ destroyOnClose,
104
+ open: (props)=>{
105
+ if (!innerItem) innerItem = this.pushItem(item);
106
+ this.update(item.id, props);
107
+ return item;
108
+ },
109
+ update: (props, top)=>this.update(item.id, props, top),
110
+ close: (value)=>{
111
+ this.close(item.id);
112
+ if (resolve) {
113
+ resolve(value);
114
+ future = null;
115
+ }
116
+ if (item.destroyOnClose) setTimeout(()=>{
117
+ if (!item.props?.visible) item.destroy();
118
+ }, 500);
119
+ },
120
+ destroy: ()=>{
121
+ const id = item.id;
122
+ innerItem = null;
123
+ return this.destroy(id);
124
+ }
125
+ };
126
+ return item;
127
+ }
128
+ create(Modal, destroyOnClose = true) {
129
+ return this._create(Modal, destroyOnClose);
130
+ }
131
+ open(Modal, props, destroyOnClose = true, single = true) {
132
+ let item = this.findItem(Modal, single);
133
+ if (!item) item = this._create(Modal, destroyOnClose);
134
+ return item.open(props);
135
+ }
136
+ update(id, props, top) {
137
+ const state = this.store.getState();
138
+ const item = this.findById(id);
139
+ if (!item) return false;
140
+ state.updateItem(id, (item)=>{
141
+ let zIndex = props.zIndex || item.innerProps?.zIndex;
142
+ if (top) {
143
+ const currentList = state.list;
144
+ let min = 1001;
145
+ currentList.forEach((v)=>{
146
+ if (v.innerProps?.visible && min < (v.innerProps?.zIndex ?? 0)) min = v.innerProps.zIndex;
147
+ });
148
+ zIndex = min;
149
+ }
150
+ item.innerProps = {
151
+ ...item.innerProps,
152
+ visible: true,
153
+ hidden: item.close,
154
+ zIndex,
155
+ ...props
156
+ };
157
+ });
158
+ return true;
159
+ }
160
+ close(id) {
161
+ const state = this.store.getState();
162
+ const item = this.findById(id);
163
+ if (!item) return false;
164
+ state.closeItem(id);
165
+ return true;
166
+ }
167
+ destroy(id) {
168
+ const state = this.store.getState();
169
+ if (void 0 === id) {
170
+ state.clearAll();
171
+ return true;
172
+ }
173
+ if ('number' == typeof id) {
174
+ state.removeItem(id);
175
+ return true;
176
+ }
177
+ state.removeItems(id);
178
+ return true;
179
+ }
180
+ component(Component) {
181
+ return react.memo(Component);
182
+ }
183
+ getStore() {
184
+ return this.store;
185
+ }
186
+ }
187
+ const ModalStore = ModalStore_ModalStore;
188
+ export { ModalStore as default };
@@ -0,0 +1,3 @@
1
+ export { default as ModalProvider } from './ModalProvider';
2
+ export { default as ModalStore } from './ModalStore';
3
+ export * from './types';
@@ -0,0 +1,4 @@
1
+ import ModalProvider from "./ModalProvider.js";
2
+ import ModalStore from "./ModalStore.js";
3
+ export * from "./types.js";
4
+ export { ModalProvider, ModalStore };
@@ -0,0 +1,73 @@
1
+ import type React from 'react';
2
+ import type { ForwardRefExoticComponent, JSX, PropsWithoutRef, RefAttributes } from 'react';
3
+ type NoVoidValue<T> = T extends void ? never : T;
4
+ type IHidden<V> = NoVoidValue<V> extends never ? () => void : (result: V) => void;
5
+ export type IModalProps<V> = {
6
+ visible: boolean;
7
+ hidden: IHidden<V>;
8
+ zIndex?: number;
9
+ };
10
+ export type IModalPropsR<P, V> = Omit<P, keyof Omit<IModalProps<V>, 'zIndex'>>;
11
+ export type IModalPropsRP<P, V> = Omit<Partial<P>, keyof IModalProps<V>>;
12
+ export type IModalResult<T> = T extends IModalProps<infer V> ? V : never;
13
+ export type IModal<P, V> = (props: P & IModalProps<V>) => JSX.Element;
14
+ export type IModalWithRef<P, V, R> = ForwardRefExoticComponent<PropsWithoutRef<P & IModalProps<V>> & RefAttributes<R>>;
15
+ export interface IModalOptions {
16
+ destroyOnClose: boolean;
17
+ }
18
+ export interface IModalItemBase<P = any, V = any, R = any> extends IModalOptions {
19
+ /**
20
+ * 弹窗组件
21
+ */
22
+ Modal: R extends unknown ? IModal<P, V> : IModalWithRef<P, V, R>;
23
+ /**
24
+ * 关闭回调
25
+ */
26
+ afterClose: Promise<IModalResult<P>>;
27
+ /**
28
+ * ref
29
+ */
30
+ refObject: R extends unknown ? unknown : React.RefObject<R>;
31
+ /**
32
+ * ref对象
33
+ */
34
+ ref: R | null;
35
+ /**
36
+ * 打开弹窗
37
+ */
38
+ open: (props: Omit<P, keyof Omit<IModalProps<V>, 'zIndex'>>) => IModalItem<P, V, R>;
39
+ /**
40
+ * 更新弹窗,只有在窗口打开时才生效
41
+ */
42
+ update: (props: Partial<P>, top?: boolean) => boolean;
43
+ /**
44
+ * 关闭弹窗
45
+ */
46
+ close: (value?: IModalResult<P>) => void;
47
+ /**
48
+ * 销毁弹窗
49
+ */
50
+ destroy: () => boolean;
51
+ }
52
+ export interface IModalItem<P = any, V = any, R = any> extends IModalItemBase<P, V, R> {
53
+ /**
54
+ * 唯一标识
55
+ */
56
+ id: number;
57
+ /**
58
+ * 弹窗属性
59
+ */
60
+ props?: P & IModalProps<V>;
61
+ }
62
+ export type IModalItemNoRef<P = any, V = any> = IModalItem<P, V, unknown>;
63
+ export interface IModalItemInner<P = any, V = any, R = any> extends IModalItemBase<P, V, R> {
64
+ /**
65
+ * 唯一标识
66
+ */
67
+ innerId?: number;
68
+ /**
69
+ * 弹窗内部属性
70
+ */
71
+ innerProps?: P & IModalProps<V>;
72
+ }
73
+ export {};
File without changes
@@ -0,0 +1,3 @@
1
+ import type { MoreButtonProps } from './types';
2
+ declare const MoreButton: ({ button: buttons, buttonInfo: userPermission, trigger, buttonText, children, }: MoreButtonProps) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
3
+ export default MoreButton;