@spacecorexdev/core 0.0.5 → 0.2.0

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 (414) hide show
  1. package/dist/api/index.js +1 -0
  2. package/dist/contract.js +1 -0
  3. package/dist/hooks/index.js +1 -0
  4. package/dist/index.js +7 -0
  5. package/{src → dist}/styles/ant-table.css +5 -26
  6. package/{src → dist}/styles/index.css +8 -8
  7. package/dist/types/index.js +1 -0
  8. package/dist/ui/index.js +1 -0
  9. package/dist/utils/index.js +7 -0
  10. package/package.json +67 -70
  11. package/types/api/project.d.ts +10 -1
  12. package/types/index.d.ts +4 -4
  13. package/types/types/index.d.ts +1 -3
  14. package/types/types/project/base.d.ts +6 -1
  15. package/types/types/project/index.d.ts +1 -0
  16. package/types/types/project/member.d.ts +1 -1
  17. package/types/types/{projectRole.d.ts → project/projectRole.d.ts} +2 -2
  18. package/types/ui/ResizableTable/index.d.ts +7 -0
  19. package/types/ui/RoleSelector/index.d.ts +7 -1
  20. package/types/ui/UIFileUpload.d.ts +2 -2
  21. package/types/ui/index.d.ts +1 -10
  22. package/types/ui/upload/index.d.ts +6 -0
  23. package/types/utils/CacheIndexedDB.d.ts +9 -0
  24. package/types/utils/index.d.ts +2 -2
  25. package/types/utils/mailto.d.ts +12 -0
  26. package/public/cmaps/78-EUC-H.bcmap +0 -0
  27. package/public/cmaps/78-EUC-V.bcmap +0 -0
  28. package/public/cmaps/78-H.bcmap +0 -0
  29. package/public/cmaps/78-RKSJ-H.bcmap +0 -0
  30. package/public/cmaps/78-RKSJ-V.bcmap +0 -0
  31. package/public/cmaps/78-V.bcmap +0 -0
  32. package/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
  33. package/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
  34. package/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
  35. package/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
  36. package/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
  37. package/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
  38. package/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
  39. package/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
  40. package/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
  41. package/public/cmaps/Add-H.bcmap +0 -0
  42. package/public/cmaps/Add-RKSJ-H.bcmap +0 -0
  43. package/public/cmaps/Add-RKSJ-V.bcmap +0 -0
  44. package/public/cmaps/Add-V.bcmap +0 -0
  45. package/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
  46. package/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
  47. package/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
  48. package/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
  49. package/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
  50. package/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
  51. package/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
  52. package/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  53. package/public/cmaps/Adobe-GB1-0.bcmap +0 -0
  54. package/public/cmaps/Adobe-GB1-1.bcmap +0 -0
  55. package/public/cmaps/Adobe-GB1-2.bcmap +0 -0
  56. package/public/cmaps/Adobe-GB1-3.bcmap +0 -0
  57. package/public/cmaps/Adobe-GB1-4.bcmap +0 -0
  58. package/public/cmaps/Adobe-GB1-5.bcmap +0 -0
  59. package/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  60. package/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
  61. package/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
  62. package/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
  63. package/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
  64. package/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
  65. package/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
  66. package/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
  67. package/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  68. package/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
  69. package/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
  70. package/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
  71. package/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  72. package/public/cmaps/B5-H.bcmap +0 -0
  73. package/public/cmaps/B5-V.bcmap +0 -0
  74. package/public/cmaps/B5pc-H.bcmap +0 -0
  75. package/public/cmaps/B5pc-V.bcmap +0 -0
  76. package/public/cmaps/CNS-EUC-H.bcmap +0 -0
  77. package/public/cmaps/CNS-EUC-V.bcmap +0 -0
  78. package/public/cmaps/CNS1-H.bcmap +0 -0
  79. package/public/cmaps/CNS1-V.bcmap +0 -0
  80. package/public/cmaps/CNS2-H.bcmap +0 -0
  81. package/public/cmaps/CNS2-V.bcmap +0 -3
  82. package/public/cmaps/ETHK-B5-H.bcmap +0 -0
  83. package/public/cmaps/ETHK-B5-V.bcmap +0 -0
  84. package/public/cmaps/ETen-B5-H.bcmap +0 -0
  85. package/public/cmaps/ETen-B5-V.bcmap +0 -0
  86. package/public/cmaps/ETenms-B5-H.bcmap +0 -3
  87. package/public/cmaps/ETenms-B5-V.bcmap +0 -0
  88. package/public/cmaps/EUC-H.bcmap +0 -0
  89. package/public/cmaps/EUC-V.bcmap +0 -0
  90. package/public/cmaps/Ext-H.bcmap +0 -0
  91. package/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
  92. package/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
  93. package/public/cmaps/Ext-V.bcmap +0 -0
  94. package/public/cmaps/GB-EUC-H.bcmap +0 -0
  95. package/public/cmaps/GB-EUC-V.bcmap +0 -0
  96. package/public/cmaps/GB-H.bcmap +0 -4
  97. package/public/cmaps/GB-V.bcmap +0 -0
  98. package/public/cmaps/GBK-EUC-H.bcmap +0 -0
  99. package/public/cmaps/GBK-EUC-V.bcmap +0 -0
  100. package/public/cmaps/GBK2K-H.bcmap +0 -0
  101. package/public/cmaps/GBK2K-V.bcmap +0 -0
  102. package/public/cmaps/GBKp-EUC-H.bcmap +0 -0
  103. package/public/cmaps/GBKp-EUC-V.bcmap +0 -0
  104. package/public/cmaps/GBT-EUC-H.bcmap +0 -0
  105. package/public/cmaps/GBT-EUC-V.bcmap +0 -0
  106. package/public/cmaps/GBT-H.bcmap +0 -0
  107. package/public/cmaps/GBT-V.bcmap +0 -0
  108. package/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
  109. package/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
  110. package/public/cmaps/GBpc-EUC-H.bcmap +0 -0
  111. package/public/cmaps/GBpc-EUC-V.bcmap +0 -0
  112. package/public/cmaps/H.bcmap +0 -0
  113. package/public/cmaps/HKdla-B5-H.bcmap +0 -0
  114. package/public/cmaps/HKdla-B5-V.bcmap +0 -0
  115. package/public/cmaps/HKdlb-B5-H.bcmap +0 -0
  116. package/public/cmaps/HKdlb-B5-V.bcmap +0 -0
  117. package/public/cmaps/HKgccs-B5-H.bcmap +0 -0
  118. package/public/cmaps/HKgccs-B5-V.bcmap +0 -0
  119. package/public/cmaps/HKm314-B5-H.bcmap +0 -0
  120. package/public/cmaps/HKm314-B5-V.bcmap +0 -0
  121. package/public/cmaps/HKm471-B5-H.bcmap +0 -0
  122. package/public/cmaps/HKm471-B5-V.bcmap +0 -0
  123. package/public/cmaps/HKscs-B5-H.bcmap +0 -0
  124. package/public/cmaps/HKscs-B5-V.bcmap +0 -0
  125. package/public/cmaps/Hankaku.bcmap +0 -0
  126. package/public/cmaps/Hiragana.bcmap +0 -0
  127. package/public/cmaps/KSC-EUC-H.bcmap +0 -0
  128. package/public/cmaps/KSC-EUC-V.bcmap +0 -0
  129. package/public/cmaps/KSC-H.bcmap +0 -0
  130. package/public/cmaps/KSC-Johab-H.bcmap +0 -0
  131. package/public/cmaps/KSC-Johab-V.bcmap +0 -0
  132. package/public/cmaps/KSC-V.bcmap +0 -0
  133. package/public/cmaps/KSCms-UHC-H.bcmap +0 -0
  134. package/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  135. package/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  136. package/public/cmaps/KSCms-UHC-V.bcmap +0 -0
  137. package/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
  138. package/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
  139. package/public/cmaps/Katakana.bcmap +0 -0
  140. package/public/cmaps/LICENSE +0 -36
  141. package/public/cmaps/NWP-H.bcmap +0 -0
  142. package/public/cmaps/NWP-V.bcmap +0 -0
  143. package/public/cmaps/RKSJ-H.bcmap +0 -0
  144. package/public/cmaps/RKSJ-V.bcmap +0 -0
  145. package/public/cmaps/Roman.bcmap +0 -0
  146. package/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  147. package/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  148. package/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  149. package/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  150. package/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  151. package/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  152. package/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  153. package/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  154. package/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
  155. package/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
  156. package/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
  157. package/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
  158. package/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
  159. package/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
  160. package/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
  161. package/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
  162. package/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  163. package/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  164. package/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  165. package/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  166. package/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  167. package/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  168. package/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  169. package/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  170. package/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  171. package/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  172. package/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  173. package/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  174. package/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  175. package/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  176. package/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  177. package/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  178. package/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  179. package/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  180. package/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  181. package/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  182. package/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  183. package/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  184. package/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  185. package/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
  186. package/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
  187. package/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
  188. package/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
  189. package/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
  190. package/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
  191. package/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
  192. package/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
  193. package/public/cmaps/V.bcmap +0 -0
  194. package/public/cmaps/WP-Symbol.bcmap +0 -0
  195. package/public/polyfills/polyfills.js +0 -802
  196. package/public/vendor/docx/docx.worker.js +0 -5
  197. package/public/vendor/docx/jszip.min.js +0 -13
  198. package/public/vendor/libarchive/libarchive.wasm +0 -0
  199. package/public/vendor/libarchive/worker-bundle.js +0 -6
  200. package/public/vendor/pptx/pptx.worker.js +0 -26
  201. package/public/wasm/cad/0.8.2/dwfv-render.wasm +0 -0
  202. package/public/wasm/cad/0.8.2/dwg-worker.js +0 -24
  203. package/public/wasm/cad/0.8.2/dwg-worker.js.map +0 -1
  204. package/public/wasm/cad/0.8.2/libredwg-web.js +0 -2
  205. package/public/wasm/cad/0.8.2/libredwg-web.wasm +0 -0
  206. package/public/wasm/cad/dwfv-render.wasm +0 -0
  207. package/public/wasm/cad/dwg-worker.js +0 -24
  208. package/public/wasm/cad/dwg-worker.js.map +0 -1
  209. package/public/wasm/cad/libredwg-web.js +0 -2
  210. package/public/wasm/cad/libredwg-web.wasm +0 -0
  211. package/public/wasm/data/sql-wasm.wasm +0 -0
  212. package/public/wasm/hdiff.wasm +0 -0
  213. package/public/wasm/model/LICENSE.occt-import-js.txt +0 -504
  214. package/public/wasm/model/LICENSE.occt.txt +0 -502
  215. package/public/wasm/model/occt-import-js.js +0 -19
  216. package/public/wasm/model/occt-import-js.wasm +0 -0
  217. package/public/wasm/model/occt-worker.js +0 -83
  218. package/public/wasm/typst/fonts/DejaVuSansMono-Bold.ttf +0 -0
  219. package/public/wasm/typst/fonts/DejaVuSansMono-BoldOblique.ttf +0 -0
  220. package/public/wasm/typst/fonts/DejaVuSansMono-Oblique.ttf +0 -0
  221. package/public/wasm/typst/fonts/DejaVuSansMono.ttf +0 -0
  222. package/public/wasm/typst/fonts/LibertinusSerif-Bold.otf +0 -0
  223. package/public/wasm/typst/fonts/LibertinusSerif-BoldItalic.otf +0 -0
  224. package/public/wasm/typst/fonts/LibertinusSerif-Italic.otf +0 -0
  225. package/public/wasm/typst/fonts/LibertinusSerif-Regular.otf +0 -0
  226. package/public/wasm/typst/fonts/LibertinusSerif-Semibold.otf +0 -0
  227. package/public/wasm/typst/fonts/LibertinusSerif-SemiboldItalic.otf +0 -0
  228. package/public/wasm/typst/fonts/NewCM10-Bold.otf +0 -0
  229. package/public/wasm/typst/fonts/NewCM10-BoldItalic.otf +0 -0
  230. package/public/wasm/typst/fonts/NewCM10-Italic.otf +0 -0
  231. package/public/wasm/typst/fonts/NewCM10-Regular.otf +0 -0
  232. package/public/wasm/typst/fonts/NewCMMath-Bold.otf +0 -0
  233. package/public/wasm/typst/fonts/NewCMMath-Book.otf +0 -0
  234. package/public/wasm/typst/fonts/NewCMMath-Regular.otf +0 -0
  235. package/public/wasm/typst/fonts/README.md +0 -7
  236. package/public/wasm/typst/typst_ts_renderer_bg.wasm +0 -0
  237. package/public/wasm/typst/typst_ts_web_compiler_bg.wasm +0 -0
  238. package/scripts/patch-docx-grid.cjs +0 -412
  239. package/src/api/_base.ts +0 -243
  240. package/src/api/index.ts +0 -17
  241. package/src/api/project.ts +0 -1345
  242. package/src/api/user.ts +0 -1174
  243. package/src/contract.ts +0 -50
  244. package/src/hooks/index.ts +0 -2
  245. package/src/hooks/useLongPress.ts +0 -137
  246. package/src/hooks/useOnlineStatus.ts +0 -22
  247. package/src/index.ts +0 -14
  248. package/src/types/id.ts +0 -2
  249. package/src/types/index.ts +0 -5
  250. package/src/types/project/base.ts +0 -63
  251. package/src/types/project/contract.ts +0 -79
  252. package/src/types/project/contractStatus.tsx +0 -15
  253. package/src/types/project/index.ts +0 -5
  254. package/src/types/project/member.ts +0 -46
  255. package/src/types/project/progress.ts +0 -43
  256. package/src/types/projectRole.ts +0 -17
  257. package/src/types/theme.ts +0 -1
  258. package/src/types/user/index.ts +0 -1
  259. package/src/types/user/role.ts +0 -7
  260. package/src/ui/CommentTimeline/index.tsx +0 -330
  261. package/src/ui/FileManager/FileContextMenu.tsx +0 -628
  262. package/src/ui/FileManager/FileGridView.tsx +0 -529
  263. package/src/ui/FileManager/FileTableView.tsx +0 -405
  264. package/src/ui/FileManager/FileToolbar.tsx +0 -119
  265. package/src/ui/FileManager/FileVersionHistoryModal.tsx +0 -175
  266. package/src/ui/FileManager/MoveCopyToProjectModal.tsx +0 -119
  267. package/src/ui/FileManager/ShareToWechatModal.tsx +0 -419
  268. package/src/ui/FileManager/hooks/useFileManagerActions.ts +0 -2532
  269. package/src/ui/FileManager/hooks/useFileManagerState.ts +0 -419
  270. package/src/ui/FileManager/index.tsx +0 -580
  271. package/src/ui/FileManager/projectFileManagerApi.ts +0 -57
  272. package/src/ui/FileManager/types.ts +0 -184
  273. package/src/ui/FileManager/utils/fileDeltaWorker.ts +0 -193
  274. package/src/ui/FileManager/utils/fileTree.ts +0 -178
  275. package/src/ui/FileManager/utils/fileUpload.ts +0 -714
  276. package/src/ui/FileManager/utils/fileUtils.ts +0 -65
  277. package/src/ui/InvoiceRecordsList/index.tsx +0 -813
  278. package/src/ui/MyFileSelectorModal.tsx +0 -261
  279. package/src/ui/ProjectSelector/index.tsx +0 -472
  280. package/src/ui/ProjectSelector/projectCache.ts +0 -40
  281. package/src/ui/RoleSelector/index.tsx +0 -473
  282. package/src/ui/RoleSelector/roleCache.ts +0 -40
  283. package/src/ui/UIAlert.tsx +0 -399
  284. package/src/ui/UIAlertExample.tsx +0 -129
  285. package/src/ui/UIConfirm.tsx +0 -335
  286. package/src/ui/UIConfirmExample.tsx +0 -165
  287. package/src/ui/UIDatePicker.tsx +0 -146
  288. package/src/ui/UIDateRangePicker.tsx +0 -38
  289. package/src/ui/UIFilePreview/ExcelEditor/index.tsx +0 -617
  290. package/src/ui/UIFilePreview/ExcelEditor/types.ts +0 -24
  291. package/src/ui/UIFilePreview/ExportDropdown.css +0 -85
  292. package/src/ui/UIFilePreview/ExportDropdown.tsx +0 -109
  293. package/src/ui/UIFilePreview/IndexedDBUtils.ts +0 -564
  294. package/src/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.ts +0 -576
  295. package/src/ui/UIFilePreview/MarkdownEditor/index.tsx +0 -677
  296. package/src/ui/UIFilePreview/MarkdownEditor/markdownEditor.css +0 -1005
  297. package/src/ui/UIFilePreview/MarkdownEditor/types.ts +0 -15
  298. package/src/ui/UIFilePreview/PPTXEditor/index.tsx +0 -602
  299. package/src/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.ts +0 -77
  300. package/src/ui/UIFilePreview/RichDocEditor/exportRDocPdf.ts +0 -374
  301. package/src/ui/UIFilePreview/RichDocEditor/index.tsx +0 -730
  302. package/src/ui/UIFilePreview/RichDocEditor/richdoc-editor.css +0 -59
  303. package/src/ui/UIFilePreview/UIFilePreview.tsx +0 -611
  304. package/src/ui/UIFilePreview/WordEditor/index.tsx +0 -3933
  305. package/src/ui/UIFilePreview/WordEditor/style.ts +0 -1213
  306. package/src/ui/UIFilePreview/WordEditor/word-editor.css +0 -999
  307. package/src/ui/UIFilePreview/filePreview.css +0 -193
  308. package/src/ui/UIFilePreview/filetypes/archive.tsx +0 -66
  309. package/src/ui/UIFilePreview/filetypes/cad.tsx +0 -287
  310. package/src/ui/UIFilePreview/filetypes/excel.tsx +0 -355
  311. package/src/ui/UIFilePreview/filetypes/image.tsx +0 -20
  312. package/src/ui/UIFilePreview/filetypes/imageLoader.ts +0 -63
  313. package/src/ui/UIFilePreview/filetypes/pdf.tsx +0 -156
  314. package/src/ui/UIFilePreview/filetypes/ppt.tsx +0 -535
  315. package/src/ui/UIFilePreview/filetypes/pptExportPdf.ts +0 -523
  316. package/src/ui/UIFilePreview/filetypes/video.tsx +0 -482
  317. package/src/ui/UIFilePreview/filetypes/word.tsx +0 -245
  318. package/src/ui/UIFilePreview/filetypes/wordExportMarkdown.ts +0 -86
  319. package/src/ui/UIFilePreview/filetypes/wordExportPdf.tsx +0 -427
  320. package/src/ui/UIFilePreview/index.ts +0 -35
  321. package/src/ui/UIFilePreview/pdfPagination.ts +0 -143
  322. package/src/ui/UIFilePreview/previewUtils.tsx +0 -531
  323. package/src/ui/UIFileUpload.tsx +0 -382
  324. package/src/ui/UIImageUpload.tsx +0 -195
  325. package/src/ui/UILoading.tsx +0 -255
  326. package/src/ui/UILoadingExample.tsx +0 -139
  327. package/src/ui/UISelect.tsx +0 -105
  328. package/src/ui/UIToast.tsx +0 -381
  329. package/src/ui/UIToastExample.tsx +0 -69
  330. package/src/ui/UIToastSingle.tsx +0 -279
  331. package/src/ui/UIViewToggle.tsx +0 -64
  332. package/src/ui/UserSelector/index.tsx +0 -583
  333. package/src/ui/index.ts +0 -84
  334. package/src/ui/upload/image.ts +0 -135
  335. package/src/ui/upload/index.ts +0 -73
  336. package/src/ui/upload/submitFile.ts +0 -106
  337. package/src/ui/upload/submitForm.ts +0 -124
  338. package/src/ui/upload/upload.err.ts +0 -15
  339. package/src/ui/upload/upload.ts +0 -250
  340. package/src/utils/CacheDepartmentInfo.ts +0 -372
  341. package/src/utils/CacheFileContent.ts +0 -315
  342. package/src/utils/CachePermissionInfo.ts +0 -235
  343. package/src/utils/CacheRoleInfo.ts +0 -303
  344. package/src/utils/CacheUserInfo.ts +0 -818
  345. package/src/utils/CacheViewToggleInfo.ts +0 -182
  346. package/src/utils/MessageContentUtils.ts +0 -268
  347. package/src/utils/clipboard.ts +0 -70
  348. package/src/utils/companyEmail.ts +0 -19
  349. package/src/utils/forbidDebugger.ts +0 -59
  350. package/src/utils/formatters.ts +0 -94
  351. package/src/utils/htmlUtils.tsx +0 -59
  352. package/src/utils/index.ts +0 -18
  353. package/src/utils/keyboard.ts +0 -114
  354. package/src/utils/mammothApi.ts +0 -16
  355. package/src/utils/polyfills.ts +0 -928
  356. package/src/utils/regex.ts +0 -14
  357. package/src/utils/storage.ts +0 -95
  358. package/src/utils/workerBootstrap.ts +0 -87
  359. package/types/hooks.d.ts +0 -5
  360. package/types/types/user/index.d.ts +0 -1
  361. package/types/types/user/role.d.ts +0 -7
  362. package/types/ui/FileManager/FileContextMenu.d.ts +0 -50
  363. package/types/ui/FileManager/FileGridView.d.ts +0 -51
  364. package/types/ui/FileManager/FileTableView.d.ts +0 -49
  365. package/types/ui/FileManager/FileToolbar.d.ts +0 -16
  366. package/types/ui/FileManager/FileVersionHistoryModal.d.ts +0 -9
  367. package/types/ui/FileManager/MoveCopyToProjectModal.d.ts +0 -17
  368. package/types/ui/FileManager/ShareToWechatModal.d.ts +0 -10
  369. package/types/ui/FileManager/hooks/useFileManagerActions.d.ts +0 -143
  370. package/types/ui/FileManager/hooks/useFileManagerState.d.ts +0 -146
  371. package/types/ui/FileManager/index.d.ts +0 -16
  372. package/types/ui/FileManager/projectFileManagerApi.d.ts +0 -6
  373. package/types/ui/FileManager/types.d.ts +0 -178
  374. package/types/ui/FileManager/utils/fileDeltaWorker.d.ts +0 -14
  375. package/types/ui/FileManager/utils/fileTree.d.ts +0 -7
  376. package/types/ui/FileManager/utils/fileUpload.d.ts +0 -60
  377. package/types/ui/FileManager/utils/fileUtils.d.ts +0 -26
  378. package/types/ui/InvoiceRecordsList/index.d.ts +0 -43
  379. package/types/ui/MyFileSelectorModal.d.ts +0 -16
  380. package/types/ui/UIFilePreview/ExcelEditor/index.d.ts +0 -20
  381. package/types/ui/UIFilePreview/ExcelEditor/types.d.ts +0 -29
  382. package/types/ui/UIFilePreview/ExportDropdown.d.ts +0 -26
  383. package/types/ui/UIFilePreview/IndexedDBUtils.d.ts +0 -109
  384. package/types/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.d.ts +0 -27
  385. package/types/ui/UIFilePreview/MarkdownEditor/index.d.ts +0 -34
  386. package/types/ui/UIFilePreview/MarkdownEditor/types.d.ts +0 -14
  387. package/types/ui/UIFilePreview/PPTXEditor/index.d.ts +0 -19
  388. package/types/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.d.ts +0 -23
  389. package/types/ui/UIFilePreview/RichDocEditor/exportRDocPdf.d.ts +0 -22
  390. package/types/ui/UIFilePreview/RichDocEditor/index.d.ts +0 -39
  391. package/types/ui/UIFilePreview/UIFilePreview.d.ts +0 -34
  392. package/types/ui/UIFilePreview/WordEditor/index.d.ts +0 -20
  393. package/types/ui/UIFilePreview/WordEditor/style.d.ts +0 -81
  394. package/types/ui/UIFilePreview/filetypes/archive.d.ts +0 -6
  395. package/types/ui/UIFilePreview/filetypes/cad.d.ts +0 -5
  396. package/types/ui/UIFilePreview/filetypes/excel.d.ts +0 -6
  397. package/types/ui/UIFilePreview/filetypes/image.d.ts +0 -6
  398. package/types/ui/UIFilePreview/filetypes/imageLoader.d.ts +0 -7
  399. package/types/ui/UIFilePreview/filetypes/pdf.d.ts +0 -7
  400. package/types/ui/UIFilePreview/filetypes/ppt.d.ts +0 -5
  401. package/types/ui/UIFilePreview/filetypes/pptExportPdf.d.ts +0 -28
  402. package/types/ui/UIFilePreview/filetypes/video.d.ts +0 -6
  403. package/types/ui/UIFilePreview/filetypes/word.d.ts +0 -5
  404. package/types/ui/UIFilePreview/filetypes/wordExportMarkdown.d.ts +0 -19
  405. package/types/ui/UIFilePreview/filetypes/wordExportPdf.d.ts +0 -32
  406. package/types/ui/UIFilePreview/index.d.ts +0 -46
  407. package/types/ui/UIFilePreview/pdfPagination.d.ts +0 -25
  408. package/types/ui/UIFilePreview/previewUtils.d.ts +0 -62
  409. package/types/ui.d.ts +0 -5
  410. package/types/utils/CacheFileContent.d.ts +0 -31
  411. package/types/utils/mammothApi.d.ts +0 -14
  412. package/types/utils.d.ts +0 -5
  413. /package/{src → dist}/styles/ant-modal.css +0 -0
  414. /package/{src → dist}/styles/ant-spin.css +0 -0
@@ -1,335 +0,0 @@
1
- /* eslint-disable react-refresh/only-export-components */
2
- /**
3
- * UIConfirm - 全局确认对话框组件
4
- *
5
- * 使用示例:
6
- *
7
- * 1. 直接调用 API(推荐):
8
- * import uiConfirm from './UIConfirm';
9
- *
10
- * // 简单确认
11
- * uiConfirm.confirm('确定要删除吗?').then((confirmed) => {
12
- * if (confirmed) {
13
- * // 用户点击了确定
14
- * } else {
15
- * // 用户点击了取消
16
- * }
17
- * });
18
- *
19
- * // 完整配置
20
- * uiConfirm.confirm({
21
- * title: '警告',
22
- * content: '此操作不可恢复,确定要继续吗?',
23
- * okText: '继续',
24
- * cancelText: '取消',
25
- * okType: 'danger',
26
- * onOk: async () => {
27
- * // 执行异步操作
28
- * await fetch('/api/delete');
29
- * },
30
- * onCancel: () => {
31
- * console.log('用户取消了操作');
32
- * }
33
- * }).then((confirmed) => {
34
- * console.log('操作结果:', confirmed);
35
- * });
36
- *
37
- * // 警告对话框
38
- * uiConfirm.warning('这是一个警告信息');
39
- *
40
- * // 信息对话框
41
- * uiConfirm.info('这是一个提示信息');
42
- *
43
- * // 错误对话框
44
- * uiConfirm.error('操作失败');
45
- *
46
- * 特点:
47
- * - 返回 Promise,可以 await 或使用 then
48
- * - 支持同步和异步 onOk
49
- * - 自定义按钮文字和样式
50
- */
51
-
52
- import React from 'react';
53
- import { Modal, Button, Space } from 'antd';
54
- import { ExclamationCircleFilled, InfoCircleFilled, QuestionCircleFilled, WarningFilled } from '@ant-design/icons';
55
- import { createRoot, Root } from 'react-dom/client';
56
- import type { ButtonProps } from 'antd/es/button';
57
- import { title } from 'process';
58
-
59
- // Confirm类型定义
60
- export type UIConfirmType = 'confirm' | 'warning' | 'info' | 'error';
61
-
62
- // Confirm选项接口
63
- export interface UIConfirmOptions {
64
- type?: UIConfirmType;
65
- title?: React.ReactNode;
66
- content?: React.ReactNode;
67
- width?: number | string;
68
- centered?: boolean;
69
- closable?: boolean;
70
- maskClosable?: boolean;
71
- okText?: string;
72
- okType?: ButtonProps['type'];
73
- cancelText?: string;
74
- cancelButtonProps?: ButtonProps;
75
- okButtonProps?: ButtonProps;
76
- onOk?: () => void | Promise<void>;
77
- onCancel?: () => void;
78
- afterClose?: () => void;
79
- className?: string;
80
- showIcon?: boolean;
81
- zIndex?: number;
82
- keyboard?: boolean; // 是否支持键盘 esc 关闭
83
- autoFocusButton?: 'ok' | 'cancel' | null; // 自动聚焦按钮
84
- }
85
-
86
- // 默认选项
87
- const defaultOptions: UIConfirmOptions = {
88
- type: 'confirm',
89
- title: '确认',
90
- content: '',
91
- width: 420,
92
- centered: true,
93
- closable: true,
94
- maskClosable: false, // 默认点击遮罩层不关闭
95
- okText: '确定',
96
- okType: 'primary',
97
- cancelText: '取消',
98
- showIcon: false,
99
- keyboard: true,
100
- autoFocusButton: 'ok',
101
- zIndex: 20000,
102
- };
103
-
104
- // 单例管理
105
- let confirmInstance: HTMLDivElement | null = null;
106
- let rootInstance: Root | null = null;
107
-
108
- // Confirm组件
109
- const ConfirmComponent: React.FC<UIConfirmOptions & { open: boolean; onClose: (confirmed: boolean) => void }> = (props) => {
110
- const {
111
- type = 'confirm',
112
- title,
113
- content,
114
- width,
115
- centered,
116
- closable,
117
- maskClosable,
118
- okText,
119
- okType,
120
- cancelText,
121
- okButtonProps,
122
- cancelButtonProps,
123
- onOk,
124
- onCancel,
125
- open,
126
- onClose,
127
- className,
128
- showIcon,
129
- zIndex,
130
- keyboard,
131
- autoFocusButton
132
- } = props;
133
-
134
- // 图标映射
135
- const iconMap = {
136
- confirm: <QuestionCircleFilled style={{ color: '#1677ff', fontSize: 22, marginRight: 12 }} />,
137
- warning: <ExclamationCircleFilled style={{ color: '#faad14', fontSize: 22, marginRight: 12 }} />,
138
- info: <InfoCircleFilled style={{ color: '#1677ff', fontSize: 22, marginRight: 12 }} />,
139
- error: <WarningFilled style={{ color: '#ff4d4f', fontSize: 22, marginRight: 12 }} />
140
- };
141
-
142
- // 处理确定按钮点击
143
- const handleOk = async () => {
144
- try {
145
- if (onOk) {
146
- const result = onOk();
147
- if (result instanceof Promise) {
148
- await result;
149
- }
150
- }
151
- onClose(true);
152
- } catch (error) {
153
- console.error('Confirm onOk error:', error);
154
- // 错误时不关闭对话框
155
- }
156
- };
157
-
158
- // 处理取消按钮点击
159
- const handleCancel = () => {
160
- if (onCancel) {
161
- onCancel();
162
- }
163
- onClose(false);
164
- };
165
-
166
- // 渲染标题
167
- const renderTitle = () => {
168
- if (!title) return null;
169
-
170
- return (
171
- <div style={{ display: 'flex', alignItems: 'center' }}>
172
- {showIcon && iconMap[type]}
173
- <span>{title}</span>
174
- </div>
175
- );
176
- };
177
-
178
- return (
179
- <Modal
180
- title={renderTitle()}
181
- open={open}
182
- width={width}
183
- centered={centered}
184
- closable={closable}
185
- maskClosable={maskClosable}
186
- onCancel={handleCancel}
187
- className={className ? className + ' ant-modal-nofull' : 'ant-modal-nofull'}
188
- zIndex={zIndex}
189
- keyboard={keyboard}
190
- footer={(
191
- <Space>
192
- <Button
193
- onClick={handleCancel}
194
- {...cancelButtonProps}
195
- autoFocus={autoFocusButton === 'cancel'}
196
- >
197
- {cancelText}
198
- </Button>
199
- <Button
200
- type={okType}
201
- onClick={handleOk}
202
- {...okButtonProps}
203
- autoFocus={autoFocusButton === 'ok'}
204
- >
205
- {okText}
206
- </Button>
207
- </Space>
208
- )}
209
- >
210
- <div style={{ marginLeft: showIcon ? 34 : 0 }}>
211
- {content}
212
- </div>
213
- </Modal>
214
- );
215
- };
216
-
217
- // 创建Confirm实例,返回Promise
218
- const createConfirmInstance = (options: UIConfirmOptions): Promise<boolean> => {
219
- // 合并选项
220
- const mergedOptions = { ...defaultOptions, ...options };
221
-
222
- // 关闭已存在的实例
223
- if (confirmInstance && rootInstance) {
224
- rootInstance.unmount();
225
- document.body.removeChild(confirmInstance);
226
- confirmInstance = null;
227
- rootInstance = null;
228
- }
229
-
230
- // 返回Promise
231
- return new Promise((resolve) => {
232
- // 关闭Confirm的方法
233
- const closeConfirm = (confirmed: boolean) => {
234
- if (confirmInstance && rootInstance) {
235
- rootInstance.render(
236
- <ConfirmComponent
237
- {...mergedOptions}
238
- open={false}
239
- onClose={(confirmed) => {
240
- if (mergedOptions.afterClose) {
241
- mergedOptions.afterClose();
242
- }
243
-
244
- setTimeout(() => {
245
- if (confirmInstance && rootInstance) {
246
- rootInstance.unmount();
247
- document.body.removeChild(confirmInstance);
248
- confirmInstance = null;
249
- rootInstance = null;
250
- }
251
- resolve(confirmed);
252
- }, 300); // 等待动画结束
253
- }}
254
- />
255
- );
256
- resolve(confirmed);
257
- } else {
258
- resolve(confirmed);
259
- }
260
- };
261
-
262
- // 创建新实例
263
- confirmInstance = document.createElement('div');
264
- document.body.appendChild(confirmInstance);
265
- rootInstance = createRoot(confirmInstance);
266
- rootInstance.render(
267
- <ConfirmComponent
268
- {...mergedOptions}
269
- open={true}
270
- onClose={closeConfirm}
271
- />
272
- );
273
- });
274
- };
275
-
276
- // 全局Confirm API
277
- const uiConfirm = {
278
- // 基本确认对话框
279
- confirm: (options: string | UIConfirmOptions): Promise<boolean> => {
280
- const config = typeof options === 'string'
281
- ? { content: options, showIcon: false, title: '' }
282
- : options;
283
-
284
- return createConfirmInstance({
285
- ...config,
286
- type: 'confirm',
287
- });
288
- },
289
-
290
- // 警告确认对话框
291
- warning: (options: string | UIConfirmOptions): Promise<boolean> => {
292
- const config = typeof options === 'string'
293
- ? { content: options }
294
- : options;
295
-
296
- return createConfirmInstance({
297
- ...config,
298
- type: 'warning',
299
- title: config.title || '警告',
300
- });
301
- },
302
-
303
- // 信息确认对话框
304
- info: (options: string | UIConfirmOptions): Promise<boolean> => {
305
- const config = typeof options === 'string'
306
- ? { content: options }
307
- : options;
308
-
309
- return createConfirmInstance({
310
- ...config,
311
- type: 'info',
312
- title: config.title || '信息',
313
- });
314
- },
315
-
316
- // 错误确认对话框
317
- error: (options: string | UIConfirmOptions): Promise<boolean> => {
318
- const config = typeof options === 'string'
319
- ? { content: options }
320
- : options;
321
-
322
- return createConfirmInstance({
323
- ...config,
324
- type: 'error',
325
- title: config.title || '错误',
326
- });
327
- },
328
-
329
- // 自定义确认对话框
330
- custom: (options: UIConfirmOptions): Promise<boolean> => {
331
- return createConfirmInstance(options);
332
- },
333
- };
334
-
335
- export default uiConfirm;
@@ -1,165 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button, Space, Card, Divider, message } from 'antd';
3
- import uiConfirm from './UIConfirm';
4
-
5
- const ConfirmExample: React.FC = () => {
6
- const [result, setResult] = useState<string>('未操作');
7
-
8
- // 基本确认对话框
9
- const showBasicConfirm = async () => {
10
- const confirmed = await uiConfirm.confirm('您确定要执行此操作吗?');
11
- setResult(confirmed ? '用户点击了确定' : '用户点击了取消');
12
-
13
- if (confirmed) {
14
- message.success('操作已确认');
15
- } else {
16
- message.info('操作已取消');
17
- }
18
- };
19
-
20
- // 警告确认对话框
21
- const showWarningConfirm = async () => {
22
- const confirmed = await uiConfirm.warning({
23
- title: '删除警告',
24
- content: '此操作将永久删除所选数据,确定要继续吗?',
25
- okText: '删除',
26
- okType: 'primary',
27
- okButtonProps: { danger: true },
28
- cancelText: '取消',
29
- });
30
-
31
- setResult(confirmed ? '用户确认删除' : '用户取消删除');
32
-
33
- if (confirmed) {
34
- message.success('数据已删除');
35
- }
36
- };
37
-
38
- // 信息确认对话框
39
- const showInfoConfirm = async () => {
40
- const confirmed = await uiConfirm.info({
41
- title: '保存提醒',
42
- content: '您有未保存的更改,是否保存后继续?',
43
- okText: '保存',
44
- cancelText: '不保存',
45
- });
46
-
47
- setResult(confirmed ? '用户选择保存' : '用户选择不保存');
48
- };
49
-
50
- // 错误确认对话框
51
- const showErrorConfirm = async () => {
52
- const confirmed = await uiConfirm.error({
53
- title: '连接错误',
54
- content: '服务器连接失败,是否重新尝试连接?',
55
- okText: '重试',
56
- cancelText: '取消',
57
- });
58
-
59
- setResult(confirmed ? '用户选择重试' : '用户选择取消');
60
- };
61
-
62
- // 带有异步操作的确认对话框
63
- const showAsyncConfirm = async () => {
64
- const confirmed = await uiConfirm.confirm({
65
- title: '异步操作确认',
66
- content: '确认后将执行一个异步操作(模拟3秒)',
67
- onOk: async () => {
68
- // 返回Promise将会阻止对话框关闭,直到Promise完成
69
- return new Promise<void>((resolve) => {
70
- setTimeout(() => {
71
- resolve();
72
- }, 3000);
73
- });
74
- }
75
- });
76
-
77
- setResult(confirmed ? '异步操作完成并确认' : '用户取消操作');
78
- };
79
-
80
- // 自定义焦点的确认对话框
81
- const showFocusConfirm = async () => {
82
- const confirmed = await uiConfirm.custom({
83
- type: 'warning',
84
- title: '危险操作',
85
- content: '此操作有风险,默认焦点设置在取消按钮上',
86
- autoFocusButton: 'cancel', // 自动聚焦到取消按钮
87
- okType: 'primary',
88
- okButtonProps: { danger: true },
89
- cancelButtonProps: { type: 'primary' },
90
- });
91
-
92
- setResult(confirmed ? '用户确认风险操作' : '用户取消风险操作');
93
- };
94
-
95
- // 自定义宽度的确认对话框
96
- const showWideConfirm = async () => {
97
- const confirmed = await uiConfirm.custom({
98
- type: 'info',
99
- title: '详细信息确认',
100
- content: (
101
- <div>
102
- <p>请查看以下详细信息,并确认是否继续:</p>
103
- <ul>
104
- <li>项目名称:示例项目</li>
105
- <li>创建时间:2023-06-15</li>
106
- <li>项目状态:待审核</li>
107
- <li>提交人:管理员</li>
108
- <li>备注:这是一个展示宽对话框的示例</li>
109
- </ul>
110
- <p>确认后将自动提交审核。</p>
111
- </div>
112
- ),
113
- width: 600,
114
- });
115
-
116
- setResult(confirmed ? '用户确认提交' : '用户取消提交');
117
- };
118
-
119
- return (
120
- <Card title="Confirm 确认对话框示例" style={{ width: '100%', maxWidth: 600, margin: '20px auto' }}>
121
- <Space direction="vertical" style={{ width: '100%' }}>
122
- <div style={{ marginBottom: 16 }}>
123
- <h3>操作结果:</h3>
124
- <div style={{ background: '#f0f0f0', padding: 10, borderRadius: 4 }}>
125
- {result}
126
- </div>
127
- </div>
128
-
129
- <Divider>基本用法</Divider>
130
-
131
- <Button type="primary" block onClick={showBasicConfirm}>
132
- 基本确认对话框
133
- </Button>
134
-
135
- <Button danger block onClick={showWarningConfirm}>
136
- 警告确认对话框
137
- </Button>
138
-
139
- <Button type="dashed" block onClick={showInfoConfirm}>
140
- 信息确认对话框
141
- </Button>
142
-
143
- <Button type="default" block onClick={showErrorConfirm}>
144
- 错误确认对话框
145
- </Button>
146
-
147
- <Divider>高级用法</Divider>
148
-
149
- <Button type="primary" ghost block onClick={showAsyncConfirm}>
150
- 异步操作确认对话框
151
- </Button>
152
-
153
- <Button block onClick={showFocusConfirm}>
154
- 自定义焦点确认对话框
155
- </Button>
156
-
157
- <Button type="default" block onClick={showWideConfirm}>
158
- 自定义宽度确认对话框
159
- </Button>
160
- </Space>
161
- </Card>
162
- );
163
- };
164
-
165
- export default ConfirmExample;
@@ -1,146 +0,0 @@
1
- import React, { useState, useRef, useEffect } from 'react';
2
- import { Calendar, ChevronLeft, ChevronRight } from 'lucide-react';
3
- import { Button } from 'antd';
4
-
5
- interface UIDatePickerProps {
6
- value: string;
7
- onChange: (value: string) => void;
8
- type?: 'date' | 'month';
9
- placeholder?: string;
10
- className?: string;
11
- }
12
-
13
- export function UIDatePicker({
14
- value,
15
- onChange,
16
- type = 'date',
17
- placeholder = '选择日期',
18
- className = ''
19
- }: UIDatePickerProps) {
20
- const [isOpen, setIsOpen] = useState(false);
21
- const datePickerRef = useRef<HTMLDivElement>(null);
22
-
23
- const formattedValue = value ? formatDisplayDate(value, type) : '';
24
-
25
- useEffect(() => {
26
- function handleClickOutside(event: MouseEvent) {
27
- if (datePickerRef.current && !datePickerRef.current.contains(event.target as Node)) {
28
- setIsOpen(false);
29
- }
30
- }
31
-
32
- document.addEventListener('mousedown', handleClickOutside);
33
- return () => document.removeEventListener('mousedown', handleClickOutside);
34
- }, []);
35
-
36
- function formatDisplayDate(dateString: string, type: 'date' | 'month'): string {
37
- if (!dateString) return '';
38
-
39
- try {
40
- if (type === 'month') {
41
- const [year, month] = dateString.split('-');
42
- return `${year}年${month}月`;
43
- } else {
44
- const date = new Date(dateString);
45
- return date.toLocaleDateString('zh-CN', {
46
- year: 'numeric',
47
- month: 'long',
48
- day: 'numeric'
49
- });
50
- }
51
- } catch (e) {
52
- return dateString;
53
- }
54
- }
55
-
56
- // Handle direct input change
57
- const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
58
- onChange(e.target.value);
59
- };
60
-
61
- // Handle click on input to open the custom date picker
62
- const handleInputClick = () => {
63
- setIsOpen(!isOpen);
64
- };
65
-
66
- return (
67
- <div className={`relative ${className}`} ref={datePickerRef}>
68
- <div className="relative cursor-pointer">
69
- <input
70
- type={type}
71
- value={value}
72
- onChange={handleInputChange}
73
- onClick={handleInputClick}
74
- className="w-full bg-white border border-ios-gray-200 rounded-ios py-2.5 pl-3 pr-10 text-sm text-ios-gray-700 shadow-ios focus:outline-none focus:ring-2 focus:ring-ios-blue-400 focus:border-transparent transition-all duration-200 hover:border-ios-blue-300 cursor-pointer"
75
- placeholder={placeholder}
76
- />
77
- <div className="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
78
- <Calendar className="h-4 w-4 text-ios-gray-400" />
79
- </div>
80
- </div>
81
-
82
- {isOpen && (
83
- <div className="absolute z-10 mt-1 bg-white rounded-ios shadow-ios-md p-4 ring-1 ring-ios-gray-200 ring-opacity-5">
84
- <div className="flex justify-between items-center mb-4">
85
- <Button
86
- type="text"
87
- className="p-1.5 hover:bg-ios-gray-100 rounded-full transition-colors duration-150"
88
- icon={<ChevronLeft className="h-4 w-4 text-ios-gray-600" />}
89
- >
90
- </Button>
91
- <span className="text-sm font-medium text-ios-gray-700">2024年5月</span>
92
- <Button
93
- type="text"
94
- className="p-1.5 hover:bg-ios-gray-100 rounded-full transition-colors duration-150"
95
- icon={<ChevronRight className="h-4 w-4 text-ios-gray-600" />}
96
- >
97
- </Button>
98
- </div>
99
-
100
- <div className="grid grid-cols-7 gap-1 text-center text-xs">
101
- <div className="text-ios-gray-500 font-medium">日</div>
102
- <div className="text-ios-gray-500 font-medium">一</div>
103
- <div className="text-ios-gray-500 font-medium">二</div>
104
- <div className="text-ios-gray-500 font-medium">三</div>
105
- <div className="text-ios-gray-500 font-medium">四</div>
106
- <div className="text-ios-gray-500 font-medium">五</div>
107
- <div className="text-ios-gray-500 font-medium">六</div>
108
-
109
- {/* Empty cells for days from previous month */}
110
- <div className="text-ios-gray-300 py-1.5">30</div>
111
- <div className="text-ios-gray-300 py-1.5">31</div>
112
-
113
- {/* Current month days */}
114
- {Array.from({ length: 30 }).map((_, i) => (
115
- <div
116
- key={i}
117
- className={`py-1.5 hover:bg-ios-blue-50 rounded-full cursor-pointer transition-colors duration-150 ${
118
- i === 14 ? 'bg-ios-blue-500 text-white' : 'text-ios-gray-700'
119
- }`}
120
- onClick={() => {
121
- // In a real implementation, this would set the actual date
122
- const day = i + 1;
123
- const dateStr = `2024-05-${day < 10 ? '0' + day : day}`;
124
- onChange(dateStr);
125
- setIsOpen(false);
126
- }}
127
- >
128
- {i + 1}
129
- </div>
130
- ))}
131
- </div>
132
-
133
- <div className="mt-4 flex justify-end">
134
- <Button
135
- type="text"
136
- className="px-4 py-1.5 text-sm text-ios-blue-500 hover:bg-ios-blue-50 rounded-ios transition-colors duration-150"
137
- onClick={() => setIsOpen(false)}
138
- >
139
- 确定
140
- </Button>
141
- </div>
142
- </div>
143
- )}
144
- </div>
145
- );
146
- }
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import { UIDatePicker } from './UIDatePicker';
3
-
4
- interface UIDateRangePickerProps {
5
- startDate: string;
6
- endDate: string;
7
- onStartDateChange: (date: string) => void;
8
- onEndDateChange: (date: string) => void;
9
- type?: 'date' | 'month';
10
- className?: string;
11
- }
12
-
13
- export function UIDateRangePicker({
14
- startDate,
15
- endDate,
16
- onStartDateChange,
17
- onEndDateChange,
18
- type = 'date',
19
- className = ''
20
- }: UIDateRangePickerProps) {
21
- return (
22
- <div className={`flex items-center space-x-2 ${className}`}>
23
- <UIDatePicker
24
- value={startDate}
25
- onChange={onStartDateChange}
26
- type={type}
27
- placeholder="开始日期"
28
- />
29
- <span className="text-gray-500">至</span>
30
- <UIDatePicker
31
- value={endDate}
32
- onChange={onEndDateChange}
33
- type={type}
34
- placeholder="结束日期"
35
- />
36
- </div>
37
- );
38
- }