hys-ui 0.1.1 → 0.3.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 (337) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/README.md +17 -1
  3. package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
  4. package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
  5. package/dist/components/HysAlert/HysAlert.vue.js +5 -54
  6. package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
  7. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
  8. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +639 -0
  9. package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
  10. package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
  11. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
  12. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +256 -0
  13. package/dist/components/HysBadge/HysBadge.vue.js +2 -2
  14. package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
  15. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
  16. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +288 -2
  17. package/dist/components/HysButton/HysButton.vue.js +2 -2
  18. package/dist/components/HysButton/HysButton2.vue.js +29 -28
  19. package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
  20. package/dist/components/HysCalendar/HysCalendar2.vue.js +815 -2
  21. package/dist/components/HysCard/HysCard.vue.js +2 -2
  22. package/dist/components/HysCard/HysCard2.vue.js +175 -42
  23. package/dist/components/HysCascader/HysCascader.vue.js +5 -194
  24. package/dist/components/HysCascader/HysCascader2.vue.js +773 -2
  25. package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
  26. package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
  27. package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
  28. package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
  29. package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
  30. package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
  31. package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
  32. package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
  33. package/dist/components/HysColorPicker/HysColorPicker.vue.js +1 -1
  34. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -216
  35. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
  36. package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
  37. package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
  38. package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
  39. package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
  40. package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
  41. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  42. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1019 -563
  43. package/dist/components/HysDatePicker/HysDatePicker.vue.js +270 -139
  44. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
  45. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +820 -0
  46. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
  47. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
  48. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +270 -158
  49. package/dist/components/HysDivider/HysDivider.vue.js +2 -2
  50. package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
  51. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  52. package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
  53. package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
  54. package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
  55. package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
  56. package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
  57. package/dist/components/HysForm/HysForm.vue.js +3 -3
  58. package/dist/components/HysForm/HysForm2.vue.js +578 -92
  59. package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
  60. package/dist/components/HysFormItem/HysFormItem2.vue.js +528 -2
  61. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  62. package/dist/components/HysGantt/HysGantt2.vue.js +1380 -268
  63. package/dist/components/HysInput/HysInput.vue.js +2 -2
  64. package/dist/components/HysInput/HysInput2.vue.js +467 -120
  65. package/dist/components/HysMention/HysMention.vue.js +2 -2
  66. package/dist/components/HysMention/HysMention2.vue.js +122 -109
  67. package/dist/components/HysModal/HysModal.vue.js +2 -2
  68. package/dist/components/HysModal/HysModal2.vue.js +490 -85
  69. package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
  70. package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
  71. package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
  72. package/dist/components/HysPagination/HysPagination.vue.js +1 -1
  73. package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
  74. package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
  75. package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
  76. package/dist/components/HysPopover/HysPopover.vue.js +5 -91
  77. package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
  78. package/dist/components/HysProgress/HysProgress.vue.js +2 -2
  79. package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
  80. package/dist/components/HysRadio/HysRadio.vue.js +7 -0
  81. package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
  82. package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
  83. package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
  84. package/dist/components/HysRating/HysRating.vue.js +1 -1
  85. package/dist/components/HysRating/HysRating2.vue.js +288 -68
  86. package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
  87. package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
  88. package/dist/components/HysSearch/HysSearch.vue.js +37 -36
  89. package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
  90. package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
  91. package/dist/components/HysSelect/HysSelect.vue.js +3 -2
  92. package/dist/components/HysSelect/HysSelect2.vue.js +999 -189
  93. package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
  94. package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
  95. package/dist/components/HysSlider/HysSlider.vue.js +1 -1
  96. package/dist/components/HysSlider/HysSlider2.vue.js +536 -59
  97. package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
  98. package/dist/components/HysSlider/SliderTooltip2.vue.js +170 -0
  99. package/dist/components/HysSteps/HysSteps.vue.js +1 -1
  100. package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
  101. package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
  102. package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
  103. package/dist/components/HysTable/HysTable.vue.js +1 -1
  104. package/dist/components/HysTable/HysTable2.vue.js +1494 -88
  105. package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
  106. package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
  107. package/dist/components/HysTabs/HysTabs.vue.js +2 -2
  108. package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
  109. package/dist/components/HysTagInput/HysTagInput.vue.js +5 -81
  110. package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
  111. package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
  112. package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
  113. package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
  114. package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
  115. package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
  116. package/dist/components/HysTour/HysTour.vue.js +46 -42
  117. package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
  118. package/dist/components/HysTransfer/HysTransfer2.vue.js +446 -2
  119. package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
  120. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +503 -0
  121. package/dist/components/HysTree/HysTree.vue.js +2 -3
  122. package/dist/components/HysTree/HysTree2.vue.js +651 -301
  123. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
  124. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +570 -2
  125. package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
  126. package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
  127. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  128. package/dist/components/HysUpload/HysUpload2.vue.js +459 -124
  129. package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
  130. package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
  131. package/dist/composables/autocomplete.js +50 -0
  132. package/dist/composables/avatar.js +57 -0
  133. package/dist/composables/calendar.js +96 -0
  134. package/dist/composables/cascader.js +79 -0
  135. package/dist/composables/choice.js +38 -0
  136. package/dist/composables/choiceModel.js +67 -0
  137. package/dist/composables/color.js +97 -0
  138. package/dist/composables/dataGrid.js +68 -0
  139. package/dist/composables/datePicker.js +227 -0
  140. package/dist/composables/drawer.js +17 -0
  141. package/dist/composables/feedback.js +14 -0
  142. package/dist/composables/formContext.js +92 -7
  143. package/dist/composables/formLayout.js +57 -0
  144. package/dist/composables/formValidation.js +240 -0
  145. package/dist/composables/ganttConflicts.js +143 -0
  146. package/dist/composables/menu.js +96 -0
  147. package/dist/composables/modal.js +14 -0
  148. package/dist/composables/numberInput.js +91 -0
  149. package/dist/composables/overlayManager.js +48 -18
  150. package/dist/composables/progress.js +94 -0
  151. package/dist/composables/rating.js +16 -0
  152. package/dist/composables/selectOptions.js +54 -0
  153. package/dist/composables/table.js +150 -0
  154. package/dist/composables/tagInput.js +16 -0
  155. package/dist/composables/textInput.js +34 -0
  156. package/dist/composables/timeline.js +19 -0
  157. package/dist/composables/transfer.js +65 -0
  158. package/dist/composables/tree.js +118 -0
  159. package/dist/composables/treeSelect.js +71 -0
  160. package/dist/composables/upload.js +55 -0
  161. package/dist/composables/uploadRequest.js +58 -0
  162. package/dist/composables/useAlert.js +124 -0
  163. package/dist/composables/useCascader.js +438 -0
  164. package/dist/composables/useColorPicker.js +402 -0
  165. package/dist/composables/useContextMenu.js +514 -0
  166. package/dist/composables/useDataGridRemote.js +67 -0
  167. package/dist/composables/useDatePicker.js +425 -0
  168. package/dist/composables/useDialog.js +86 -43
  169. package/dist/composables/useDrawerPush.js +33 -0
  170. package/dist/composables/useDrawerResize.js +221 -0
  171. package/dist/composables/useFloating.js +136 -56
  172. package/dist/composables/useGanttDependencies.js +306 -0
  173. package/dist/composables/useGanttHistory.js +157 -0
  174. package/dist/composables/useGanttLabelResize.js +100 -0
  175. package/dist/composables/useHysModal.js +185 -0
  176. package/dist/composables/useModal.js +295 -0
  177. package/dist/composables/useModalInteraction.js +394 -0
  178. package/dist/composables/usePopupSurface.js +458 -0
  179. package/dist/composables/useTable.js +474 -0
  180. package/dist/composables/useTagInput.js +313 -0
  181. package/dist/composables/useTextareaSize.js +72 -0
  182. package/dist/composables/useTransfer.js +257 -0
  183. package/dist/composables/useTransferMotion.js +185 -0
  184. package/dist/composables/useTree.js +439 -0
  185. package/dist/composables/useTreeSelect.js +361 -0
  186. package/dist/composables/useUpload.js +472 -0
  187. package/dist/composables/useUploadModel.js +65 -0
  188. package/dist/composables/useUploadRequests.js +266 -0
  189. package/dist/composables/useVirtualTableLayout.js +277 -0
  190. package/dist/composables/virtualTable.js +43 -0
  191. package/dist/index.js +152 -139
  192. package/dist/internal/PopupReference.js +39 -0
  193. package/dist/internal/PopupSurfacePanel.vue.js +7 -0
  194. package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
  195. package/dist/motion/PopupMotion.js +105 -0
  196. package/dist/motion/popup.js +10 -0
  197. package/dist/style.css +1 -1
  198. package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
  199. package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
  200. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
  201. package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
  202. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +104 -0
  203. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
  204. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +71 -20
  205. package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
  206. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +120 -31
  207. package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
  208. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
  209. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
  210. package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
  211. package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
  212. package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
  213. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
  214. package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
  215. package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
  216. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
  217. package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
  218. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
  219. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
  220. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
  221. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
  222. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
  223. package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
  224. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
  225. package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
  226. package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
  227. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
  228. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +84 -5
  229. package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
  230. package/dist/types/components/HysMention/HysMention.vue.d.ts +4 -3
  231. package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
  232. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
  233. package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
  234. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
  235. package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
  236. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
  237. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
  238. package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
  239. package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
  240. package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
  241. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
  242. package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
  243. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
  244. package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
  245. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +131 -22
  246. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
  247. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +69 -11
  248. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +24 -0
  249. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +3 -3
  250. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
  251. package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
  252. package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
  253. package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
  254. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
  255. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +50 -28
  256. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
  257. package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
  258. package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
  259. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
  260. package/dist/types/components/HysTour/HysTour.vue.d.ts +4 -3
  261. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
  262. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +107 -0
  263. package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
  264. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
  265. package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
  266. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
  267. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
  268. package/dist/types/composables/autocomplete.d.ts +109 -0
  269. package/dist/types/composables/avatar.d.ts +73 -0
  270. package/dist/types/composables/calendar.d.ts +66 -0
  271. package/dist/types/composables/cascader.d.ts +195 -0
  272. package/dist/types/composables/choice.d.ts +110 -0
  273. package/dist/types/composables/choiceModel.d.ts +11 -0
  274. package/dist/types/composables/color.d.ts +97 -0
  275. package/dist/types/composables/dataGrid.d.ts +100 -0
  276. package/dist/types/composables/datePicker.d.ts +250 -0
  277. package/dist/types/composables/drawer.d.ts +102 -0
  278. package/dist/types/composables/feedback.d.ts +98 -0
  279. package/dist/types/composables/formContext.d.ts +135 -8
  280. package/dist/types/composables/formLayout.d.ts +11 -0
  281. package/dist/types/composables/formValidation.d.ts +13 -0
  282. package/dist/types/composables/gantt.d.ts +68 -0
  283. package/dist/types/composables/ganttConflicts.d.ts +30 -0
  284. package/dist/types/composables/menu.d.ts +183 -0
  285. package/dist/types/composables/modal.d.ts +183 -0
  286. package/dist/types/composables/numberInput.d.ts +45 -0
  287. package/dist/types/composables/overlayManager.d.ts +7 -3
  288. package/dist/types/composables/popupSurface.d.ts +83 -0
  289. package/dist/types/composables/progress.d.ts +92 -0
  290. package/dist/types/composables/rating.d.ts +18 -0
  291. package/dist/types/composables/segmented.d.ts +15 -0
  292. package/dist/types/composables/selectOptions.d.ts +46 -0
  293. package/dist/types/composables/slider.d.ts +21 -0
  294. package/dist/types/composables/table.d.ts +312 -0
  295. package/dist/types/composables/tagInput.d.ts +96 -0
  296. package/dist/types/composables/textInput.d.ts +76 -0
  297. package/dist/types/composables/timeline.d.ts +82 -0
  298. package/dist/types/composables/transfer.d.ts +187 -0
  299. package/dist/types/composables/tree.d.ts +240 -0
  300. package/dist/types/composables/treeSelect.d.ts +170 -0
  301. package/dist/types/composables/upload.d.ts +202 -0
  302. package/dist/types/composables/uploadRequest.d.ts +3 -0
  303. package/dist/types/composables/useAlert.d.ts +21 -0
  304. package/dist/types/composables/useCascader.d.ts +162 -0
  305. package/dist/types/composables/useColorPicker.d.ts +101 -0
  306. package/dist/types/composables/useContextMenu.d.ts +81 -0
  307. package/dist/types/composables/useDataGridRemote.d.ts +15 -0
  308. package/dist/types/composables/useDatePicker.d.ts +79 -0
  309. package/dist/types/composables/useDialog.d.ts +16 -3
  310. package/dist/types/composables/useDrawerPush.d.ts +6 -0
  311. package/dist/types/composables/useDrawerResize.d.ts +27 -0
  312. package/dist/types/composables/useFloating.d.ts +28 -6
  313. package/dist/types/composables/useGanttDependencies.d.ts +83 -0
  314. package/dist/types/composables/useGanttHistory.d.ts +42 -0
  315. package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
  316. package/dist/types/composables/useHysModal.d.ts +44 -0
  317. package/dist/types/composables/useModal.d.ts +62 -0
  318. package/dist/types/composables/useModalInteraction.d.ts +27 -0
  319. package/dist/types/composables/usePopupSurface.d.ts +3341 -0
  320. package/dist/types/composables/useTable.d.ts +60 -0
  321. package/dist/types/composables/useTagInput.d.ts +66 -0
  322. package/dist/types/composables/useTextareaSize.d.ts +3 -0
  323. package/dist/types/composables/useTransfer.d.ts +58 -0
  324. package/dist/types/composables/useTransferMotion.d.ts +36 -0
  325. package/dist/types/composables/useTree.d.ts +77 -0
  326. package/dist/types/composables/useTreeSelect.d.ts +117 -0
  327. package/dist/types/composables/useUpload.d.ts +94 -0
  328. package/dist/types/composables/useUploadModel.d.ts +14 -0
  329. package/dist/types/composables/useUploadRequests.d.ts +38 -0
  330. package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
  331. package/dist/types/composables/virtualTable.d.ts +126 -0
  332. package/dist/types/index.d.ts +50 -9
  333. package/dist/types/internal/PopupReference.d.ts +18 -0
  334. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
  335. package/dist/types/motion/PopupMotion.d.ts +59 -0
  336. package/dist/types/motion/popup.d.ts +12 -0
  337. package/package.json +2 -1
@@ -1,304 +1,1416 @@
1
- import { defineComponent as ge, ref as W, watch as j, computed as y, onMounted as ye, onActivated as fe, nextTick as le, onDeactivated as me, onBeforeUnmount as we, openBlock as i, createElementBlock as o, mergeProps as be, unref as q, createElementVNode as r, createVNode as se, withCtx as xe, createTextVNode as ie, toDisplayString as f, normalizeStyle as p, Fragment as P, renderList as S, withKeys as _, withModifiers as x, normalizeClass as K, createCommentVNode as z } from "vue";
2
- import { useHysRootAttrs as ke } from "../../config.js";
3
- import $e from "../HysSegmented/HysSegmented.vue.js";
4
- import Ce from "../HysButton/HysButton.vue.js";
5
- const Me = { class: "hys-ui-pg-toolbar" }, De = { class: "hys-ui-pg-hint" }, Pe = { class: "hys-ui-pg-body" }, Se = ["onClick", "onKeydown"], _e = ["title"], Te = {
1
+ import { defineComponent as Ot, ref as z, watch as N, computed as g, onMounted as Yt, onActivated as Xt, nextTick as te, onDeactivated as Jt, onBeforeUnmount as Qt, useId as Zt, shallowRef as jt, openBlock as r, createElementBlock as c, mergeProps as kt, unref as l, createElementVNode as d, createVNode as f, withCtx as H, createTextVNode as Z, createCommentVNode as y, toDisplayString as h, normalizeStyle as _, withModifiers as k, Fragment as B, renderList as j, withKeys as A, normalizeClass as O, createBlock as ze, Teleport as ea } from "vue";
2
+ import ta from "../../motion/PopupMotion.js";
3
+ import { useHysRootAttrs as aa } from "../../config.js";
4
+ import la from "../HysSegmented/HysSegmented.vue.js";
5
+ import U from "../HysButton/HysButton.vue.js";
6
+ import bt from "../HysInput/HysInput.vue.js";
7
+ import sa from "../HysPagination/HysPagination.vue.js";
8
+ import { ganttDependencyPickPath as ia, ganttDependencyPath as na, useGanttDependencies as oa } from "../../composables/useGanttDependencies.js";
9
+ import { Undo2 as ra, Redo2 as ua, TriangleAlert as wt, X as xt, Trash2 as It, ChevronDown as da, Search as Ct, LocateFixed as Xe, GitBranch as ca, Check as va, CornerDownRight as pa } from "lucide-vue-next";
10
+ import { useGanttLabelResize as ha } from "../../composables/useGanttLabelResize.js";
11
+ import { useFloating as ga } from "../../composables/useFloating.js";
12
+ import { useGanttHistory as fa } from "../../composables/useGanttHistory.js";
13
+ import { analyzeGanttSchedule as ya, previewGanttConflicts as ma, ganttEdgeKey as ka } from "../../composables/ganttConflicts.js";
14
+ const ba = { class: "hys-ui-pg-toolbar" }, wa = {
15
+ key: 0,
16
+ class: "hys-ui-pg-history-controls",
17
+ role: "group",
18
+ "aria-label": "排期历史操作"
19
+ }, xa = { class: "hys-ui-pg-hint" }, Ia = { class: "hys-ui-pg-label-head" }, Ca = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], Ta = ["aria-pressed", "data-row-index", "onClick", "onKeydown"], Pa = ["title"], Ma = ["title"], za = {
6
20
  key: 0,
7
21
  class: "hys-ui-pg-empty"
8
- }, He = { class: "hys-ui-pg-months" }, Ue = ["title"], Ve = { class: "hys-ui-pg-days" }, We = ["aria-label", "title", "onClick", "onKeydown", "onPointerdown"], ze = { class: "hys-ui-pg-bar-title" }, Le = ["onPointerdown"], Ae = ["onPointerdown"], Be = ["width", "height"], Fe = ["d"], Ee = { class: "hys-ui-pg-footer" }, Ke = { key: 0 }, oe = 864e5, Oe = /* @__PURE__ */ ge({
22
+ }, Sa = { class: "hys-ui-pg-months" }, Da = ["title"], La = { class: "hys-ui-pg-days" }, $a = ["data-row-index"], Ea = ["aria-pressed", "aria-label", "title", "onClick", "onKeydown", "onPointerdown"], _a = { class: "hys-ui-pg-bar-title" }, Ka = ["onPointerdown"], Ha = ["onPointerdown"], Fa = ["aria-label", "onPointerdown", "onClick", "onKeydown"], Ra = ["width", "height", "aria-hidden"], Aa = ["data-edge-key"], Ua = ["d"], Va = ["d", "aria-label", "onClick", "onFocus", "onKeydown"], Wa = ["cx", "cy"], Ba = ["cx", "cy", "aria-label", "onFocus", "onPointerdown", "onClick", "onKeydown"], Na = ["d"], qa = ["cx", "cy"], Ga = ["transform", "aria-expanded", "aria-label", "onClick", "onKeydown"], Oa = {
23
+ key: 0,
24
+ cx: "29",
25
+ r: "13",
26
+ fill: "transparent",
27
+ class: "hys-ui-pg-incoming-hit"
28
+ }, Ya = {
29
+ "text-anchor": "middle",
30
+ dy: ".35em"
31
+ }, Xa = ["d"], Ja = { class: "hys-ui-pg-footer" }, Qa = { key: 0 }, Za = {
32
+ key: 1,
33
+ class: "hys-ui-pg-link-feedback"
34
+ }, ja = {
35
+ role: "status",
36
+ "aria-live": "polite"
37
+ }, el = {
38
+ key: 2,
39
+ class: "hys-ui-pg-history-message",
40
+ "aria-live": "polite"
41
+ }, tl = {
42
+ key: 3,
43
+ class: "hys-ui-pg-conflict-area"
44
+ }, al = { class: "hys-ui-pg-conflict-summary" }, ll = { "aria-live": "polite" }, sl = {
45
+ key: 0,
46
+ class: "hys-ui-pg-conflict-preview"
47
+ }, il = { class: "hys-ui-pg-conflict-list" }, nl = { class: "hys-ui-pg-conflict-tag" }, ol = {
48
+ key: 0,
49
+ class: "hys-ui-pg-conflict-empty"
50
+ }, rl = ["aria-label"], ul = { class: "hys-ui-pg-picker-heading" }, dl = { class: "hys-ui-pg-picker-target" }, cl = { class: "hys-ui-pg-picker-target-main" }, vl = ["title"], pl = { class: "hys-ui-pg-picker-options" }, hl = ["data-current"], gl = { class: "hys-ui-pg-picker-names" }, fl = ["title"], yl = { class: "hys-ui-pg-picker-check" }, ml = { class: "hys-ui-pg-picker-actions" }, kl = {
51
+ key: 0,
52
+ class: "hys-ui-pg-picker-empty"
53
+ }, bl = {
54
+ key: 0,
55
+ class: "hys-ui-pg-picker-notice",
56
+ role: "status"
57
+ }, Tt = 864e5, _l = /* @__PURE__ */ Ot({
9
58
  __name: "HysGantt",
10
59
  props: {
60
+ popupTransition: {},
61
+ popupTransitionDuration: {},
11
62
  items: {},
12
63
  modelValue: {},
13
64
  scale: { default: "day" },
14
65
  editable: { type: Boolean, default: !1 },
15
66
  rowHeight: { default: 46 },
16
67
  labelWidth: { default: 270 },
17
- fitContainer: { type: Boolean, default: !0 }
68
+ labelResizable: { type: Boolean, default: !0 },
69
+ minLabelWidth: { default: 120 },
70
+ maxLabelWidth: { default: 600 },
71
+ fitContainer: { type: Boolean, default: !0 },
72
+ height: {},
73
+ maxHeight: { type: [Number, String, Boolean], default: void 0 },
74
+ virtual: { type: Boolean, default: !1 },
75
+ overscan: { default: 6 },
76
+ dependencyEditable: { type: Boolean, default: void 0 },
77
+ showDependencies: { type: Boolean, default: !0 },
78
+ history: { type: Boolean, default: !0 },
79
+ historyLimit: { default: 50 },
80
+ historyKeyboard: { type: Boolean, default: !0 },
81
+ showHistoryControls: { type: Boolean, default: !0 },
82
+ showConflicts: { type: Boolean, default: !0 }
18
83
  },
19
- emits: ["update:modelValue", "update:scale", "scaleChange", "update:items", "change", "open"],
20
- setup(d, { emit: re }) {
21
- const ue = ke(), c = d, m = re, w = W(c.scale);
22
- j(() => c.scale, (e) => w.value = e);
23
- const T = W(c.modelValue ?? null);
24
- j(() => c.modelValue, (e) => T.value = e ?? null);
25
- const k = W(null), H = /* @__PURE__ */ new Date();
26
- H.setHours(0, 0, 0, 0);
27
- function $(e) {
84
+ emits: ["update:modelValue", "update:scale", "scaleChange", "update:items", "change", "open", "dependencyAdd", "dependencyRemove", "dependencyInvalid", "dependencyMove", "update:labelWidth", "labelResize", "historyChange", "undo", "redo", "historyInvalid", "conflictChange"],
85
+ setup(L, { expose: Pt, emit: Mt }) {
86
+ const Je = aa(), u = L, b = Mt, Y = z(u.scale);
87
+ N(
88
+ () => u.scale,
89
+ (e) => Y.value = e
90
+ );
91
+ const K = z(u.modelValue ?? null);
92
+ N(
93
+ () => u.modelValue,
94
+ (e) => K.value = e ?? null
95
+ );
96
+ const Se = z(), w = z(null), De = z(null), Le = z(0), Qe = z(null), ke = /* @__PURE__ */ new Date();
97
+ ke.setHours(0, 0, 0, 0);
98
+ function Ze(e) {
99
+ return typeof e == "number" ? Number.isFinite(e) && e >= 0 ? e + "px" : void 0 : typeof e == "string" && e.trim() ? e : void 0;
100
+ }
101
+ const zt = g(() => ({
102
+ height: Ze(u.height),
103
+ maxHeight: u.maxHeight === !1 || u.height !== void 0 && u.maxHeight === void 0 ? "none" : Ze(
104
+ u.maxHeight ?? (u.height === void 0 ? 620 : void 0)
105
+ ),
106
+ scrollPaddingInlineStart: Le.value + "px"
107
+ }));
108
+ function be(e) {
28
109
  if (!/^\d{4}-\d{2}-\d{2}$/.test(e)) return null;
29
- const [n, t, l] = e.split("-").map(Number), a = new Date(n, t - 1, l);
30
- return a.getFullYear() === n && a.getMonth() === t - 1 && a.getDate() === l ? a : null;
31
- }
32
- function h(e) {
33
- return Math.round((Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - Date.UTC(1970, 0, 1)) / oe);
34
- }
35
- function U(e) {
36
- return new Date(e * oe);
37
- }
38
- function L(e) {
39
- return U(e).toISOString().slice(0, 10);
40
- }
41
- const v = y(() => c.items.map((e) => {
42
- const n = $(e.start), t = $(e.end);
43
- return !n || !t || h(t) < h(n) ? null : { ...e, s: h(n), e: h(t), progress: Math.min(100, Math.max(0, e.progress ?? 0)) };
44
- }).filter((e) => e !== null)), de = y(() => w.value === "day" ? 36 : w.value === "week" ? 17 : w.value === "month" ? 7 : 36), b = y(() => {
45
- const e = v.value.flatMap((t) => [t.s, t.e]), n = h(H);
46
- return { start: Math.min(n - 7, ...e) - 7, end: Math.max(n + 21, ...e) + 14 };
47
- }), N = y(() => b.value.end - b.value.start + 1), Y = W(0), u = y(() => Math.max(de.value, c.fitContainer ? Y.value / N.value : 0)), J = y(() => Math.max(N.value * u.value, c.fitContainer ? Y.value : 0));
48
- let C, M = !0;
49
- function A() {
50
- var e;
51
- M && (Y.value = ((e = k.value) == null ? void 0 : e.clientWidth) || 0);
52
- }
53
- function R() {
54
- C == null || C.disconnect(), C = void 0, window.removeEventListener("resize", A);
55
- }
56
- function Q() {
57
- R(), !(!M || !k.value) && (A(), k.value && typeof ResizeObserver < "u" ? (C = new ResizeObserver(A), C.observe(k.value)) : window.addEventListener("resize", A));
58
- }
59
- ye(Q), fe(() => {
60
- M = !0, le(() => M && Q());
61
- }), me(() => {
62
- M = !1, R(), V();
63
- }), we(() => {
64
- M = !1, R(), V();
110
+ const [t, s, a] = e.split("-").map(Number), n = new Date(t, s - 1, a);
111
+ return n.getFullYear() === t && n.getMonth() === s - 1 && n.getDate() === a ? n : null;
112
+ }
113
+ function X(e) {
114
+ return Math.round(
115
+ (Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - Date.UTC(1970, 0, 1)) / Tt
116
+ );
117
+ }
118
+ function we(e) {
119
+ return new Date(e * Tt);
120
+ }
121
+ function $e(e) {
122
+ return we(e).toISOString().slice(0, 10);
123
+ }
124
+ const x = g(
125
+ () => Number.isFinite(u.rowHeight) && u.rowHeight > 0 ? u.rowHeight : 46
126
+ ), $ = g(() => {
127
+ const e = /* @__PURE__ */ new Map(), t = (s) => {
128
+ if (!e.has(s)) {
129
+ const a = be(s);
130
+ e.set(s, a ? X(a) : null);
131
+ }
132
+ return e.get(s);
133
+ };
134
+ return u.items.map((s) => {
135
+ const a = t(s.start), n = t(s.end);
136
+ return a === null || n === null || n < a ? null : {
137
+ ...s,
138
+ s: a,
139
+ e: n,
140
+ progress: Math.min(100, Math.max(0, s.progress ?? 0))
141
+ };
142
+ }).filter((s) => s !== null);
143
+ }), St = g(
144
+ () => $.value.filter((e) => e.status === "已完成").length
145
+ ), Ae = z(620), ce = z(0), ae = g(() => {
146
+ const e = $.value.length;
147
+ if (!u.virtual) return { start: 0, end: e };
148
+ const t = Number.isFinite(u.overscan) ? Math.max(0, Math.min(100, Math.floor(u.overscan))) : 6, s = Math.min(
149
+ Math.max(0, e - 1),
150
+ Math.max(0, Math.floor(ce.value / x.value))
151
+ );
152
+ return {
153
+ start: Math.max(0, s - t),
154
+ end: Math.min(
155
+ e,
156
+ s + Math.ceil(
157
+ Math.max(x.value, Ae.value - 66) / x.value
158
+ ) + t + 1
159
+ )
160
+ };
161
+ }), je = g(
162
+ () => $.value.slice(ae.value.start, ae.value.end).map((e, t) => ({ task: e, index: t + ae.value.start }))
163
+ ), Dt = g(
164
+ () => Y.value === "day" ? 36 : Y.value === "week" ? 17 : Y.value === "month" ? 7 : 36
165
+ ), q = g(() => {
166
+ const e = X(ke);
167
+ let t = e - 7, s = e + 21;
168
+ for (const a of $.value)
169
+ t = Math.min(t, a.s), s = Math.max(s, a.e);
170
+ return { start: t - 7, end: s + 14 };
171
+ }), Ue = g(() => q.value.end - q.value.start + 1), le = z(0), S = g(
172
+ () => Math.max(
173
+ Dt.value,
174
+ u.fitContainer ? le.value / Ue.value : 0
175
+ )
176
+ ), Ve = g(
177
+ () => Math.max(
178
+ Ue.value * S.value,
179
+ u.fitContainer ? le.value : 0
180
+ )
181
+ );
182
+ let se, C = !0;
183
+ const et = z(0), T = ha({
184
+ width: () => u.labelWidth,
185
+ min: () => u.minLabelWidth,
186
+ max: () => u.maxLabelWidth,
187
+ enabled: () => u.labelResizable,
188
+ available: et,
189
+ live: () => C,
190
+ start: () => {
191
+ V(), i.cancel();
192
+ },
193
+ update: (e) => b("update:labelWidth", e),
194
+ commit: (e) => b("labelResize", e)
195
+ });
196
+ let Ee = !1, ve = 0, pe, xe, J = { top: 0, left: 0 };
197
+ function Lt() {
198
+ pe = void 0, C && u.virtual && (ce.value = Math.floor(J.top / x.value) * x.value);
199
+ }
200
+ N(
201
+ [() => u.virtual, x],
202
+ () => {
203
+ var e;
204
+ ce.value = Math.floor(
205
+ (((e = w.value) == null ? void 0 : e.scrollTop) ?? J.top) / x.value
206
+ ) * x.value;
207
+ },
208
+ { flush: "sync" }
209
+ );
210
+ function tt() {
211
+ const e = w.value;
212
+ if (!C || Ee || !(e != null && e.isConnected)) return;
213
+ const t = J.top !== e.scrollTop, s = J.left !== e.scrollLeft;
214
+ J = { top: e.scrollTop, left: e.scrollLeft }, (t || s) && M.close(), u.virtual && t && pe === void 0 && (pe = requestAnimationFrame(Lt));
215
+ }
216
+ function at() {
217
+ pe !== void 0 && cancelAnimationFrame(pe), xe !== void 0 && cancelAnimationFrame(xe), pe = xe = void 0;
218
+ }
219
+ function Ie() {
220
+ var e, t, s, a;
221
+ C && (et.value = ((e = w.value) == null ? void 0 : e.clientWidth) || 0, Le.value = ((t = De.value) == null ? void 0 : t.offsetWidth) || T.width.value, Ae.value = ((s = w.value) == null ? void 0 : s.clientHeight) || 620, le.value = Math.max(
222
+ 0,
223
+ (((a = w.value) == null ? void 0 : a.clientWidth) || 0) - Le.value
224
+ ));
225
+ }
226
+ function We() {
227
+ se == null || se.disconnect(), se = void 0, window.removeEventListener("resize", Ie);
228
+ }
229
+ function lt() {
230
+ We(), !(!C || !w.value) && (Ie(), typeof ResizeObserver < "u" ? (se = new ResizeObserver(Ie), se.observe(w.value), De.value && se.observe(De.value)) : window.addEventListener("resize", Ie));
231
+ }
232
+ Yt(lt), Xt(async () => {
233
+ const e = ++ve;
234
+ C = !0, Ee = !0, await te(), !(!C || e !== ve) && (lt(), await te(), !(!C || e !== ve || !w.value) && (w.value.scrollTop = J.top, w.value.scrollLeft = J.left, ce.value = w.value.scrollTop, xe = requestAnimationFrame(() => {
235
+ xe = void 0, C && e === ve && (Ee = !1, tt());
236
+ })));
237
+ }), Jt(() => {
238
+ C = !1, Ee = !0, ve++, at(), We(), V();
239
+ }), Qt(() => {
240
+ C = !1, ve++, at(), We(), V();
65
241
  });
66
- function ce(e) {
67
- !["day", "week", "month"].includes(e) || e === w.value || (w.value = e, m("update:scale", e), m("scaleChange", e));
242
+ function $t(e) {
243
+ !["day", "week", "month"].includes(e) || e === Y.value || (i.cancel(), V(), Y.value = e, b("update:scale", e), b("scaleChange", e));
68
244
  }
69
- const B = y(() => Array.from({ length: N.value }, (e, n) => b.value.start + n)), he = y(() => {
245
+ const _e = g(
246
+ () => Array.from({ length: Ue.value }, (e, t) => q.value.start + t)
247
+ ), Et = g(() => {
70
248
  const e = [];
71
- for (let n = 0; n < B.value.length; n++) {
72
- const t = U(B.value[n]), l = `${t.getUTCFullYear()}-${t.getUTCMonth()}`, a = e[e.length - 1];
73
- (a == null ? void 0 : a.key) === l ? a.width += u.value : e.push({ key: l, label: `${t.getUTCFullYear()}年${t.getUTCMonth() + 1}月`, left: n * u.value, width: u.value });
249
+ for (let t = 0; t < _e.value.length; t++) {
250
+ const s = we(_e.value[t]), a = `${s.getUTCFullYear()}-${s.getUTCMonth()}`, n = e[e.length - 1];
251
+ (n == null ? void 0 : n.key) === a ? n.width += S.value : e.push({
252
+ key: a,
253
+ label: `${s.getUTCFullYear()}年${s.getUTCMonth() + 1}月`,
254
+ left: t * S.value,
255
+ width: S.value
256
+ });
74
257
  }
75
258
  return e;
76
- }), Z = y(() => new Map(v.value.map((e, n) => [String(e.id), { x: (e.s - b.value.start) * u.value, w: (e.e - e.s + 1) * u.value, y: n * c.rowHeight + c.rowHeight / 2 }]))), ee = y(() => v.value.flatMap((e) => (e.dependencies ?? []).flatMap((n) => {
77
- const t = Z.value.get(String(n)), l = Z.value.get(String(e.id));
78
- return !t || !l || String(n) === String(e.id) ? [] : [{ id: `${n}-${e.id}`, path: `M ${t.x + t.w} ${t.y} H ${t.x + t.w + 9} V ${l.y} H ${l.x}` }];
79
- })));
80
- function F(e) {
81
- T.value = e.id, m("update:modelValue", e.id), m("open", e);
82
- }
83
- function te() {
84
- const e = k.value;
85
- e && (e.scrollLeft = Math.max(0, (h(H) - b.value.start) * u.value - e.clientWidth / 3));
86
- }
87
- j(w, () => le(te));
88
- const g = W(null);
89
- let I;
90
- function ne() {
91
- var n, t;
92
- const e = I;
93
- I = void 0, (t = e == null ? void 0 : (n = e.element).hasPointerCapture) != null && t.call(n, e.id) && e.element.releasePointerCapture(e.id);
259
+ }), he = g(
260
+ () => new Map(
261
+ $.value.map((e, t) => [
262
+ e.id,
263
+ {
264
+ x: (e.s - q.value.start) * S.value,
265
+ w: (e.e - e.s + 1) * S.value,
266
+ y: t * x.value + x.value / 2,
267
+ index: t
268
+ }
269
+ ])
270
+ )
271
+ ), Be = g(
272
+ () => $.value.flatMap(
273
+ (e) => [...new Set(e.dependencies ?? [])].flatMap((t) => {
274
+ var n;
275
+ const s = he.value.get(t), a = he.value.get(e.id);
276
+ return !s || !a || t === e.id ? [] : [
277
+ {
278
+ id: JSON.stringify([t, e.id]),
279
+ sourceId: t,
280
+ sourceTitle: $.value[s.index].title,
281
+ targetId: e.id,
282
+ targetTitle: e.title,
283
+ first: Math.min(s.index, a.index),
284
+ last: Math.max(s.index, a.index),
285
+ endpoint: { x: a.x - 9, y: a.y },
286
+ editable: !e.disabled && !((n = $.value[s.index]) != null && n.disabled),
287
+ removable: !e.disabled,
288
+ path: na(s, a, x.value),
289
+ pickPath: ia(s, a, x.value)
290
+ }
291
+ ];
292
+ })
293
+ )
294
+ ), st = g(
295
+ () => u.virtual ? Be.value.filter(
296
+ (e) => e.last >= ae.value.start && e.first < ae.value.end
297
+ ) : Be.value
298
+ ), Ce = g(() => {
299
+ const e = /* @__PURE__ */ new Map();
300
+ for (const t of Be.value) {
301
+ const s = e.get(t.targetId);
302
+ s ? s.push(t) : e.set(t.targetId, [t]);
303
+ }
304
+ return e;
305
+ }), _t = g(
306
+ () => [...Ce.value].flatMap(([e, t]) => {
307
+ const s = he.value.get(e);
308
+ return t.length > 1 && s && s.index >= ae.value.start && s.index < ae.value.end ? [
309
+ {
310
+ id: e,
311
+ title: t[0].targetTitle,
312
+ count: t.length,
313
+ x: s.x - 38,
314
+ y: s.y
315
+ }
316
+ ] : [];
317
+ })
318
+ ), F = g(
319
+ () => u.dependencyEditable ?? u.editable
320
+ ), m = fa({
321
+ items: () => u.items,
322
+ enabled: () => u.history,
323
+ limit: () => u.historyLimit,
324
+ live: () => C,
325
+ allowed: (e, t) => !e.disabled && t.every(
326
+ (s) => s === "dependencies" ? F.value : u.editable
327
+ ),
328
+ send: (e) => b("update:items", e),
329
+ change: (e) => b("change", e),
330
+ beforeReplay: () => {
331
+ V(), i.cancel(), i.clearSelected(), M.close();
332
+ },
333
+ external: () => {
334
+ V(), i.cancel(), i.clearSelected(), M.close();
335
+ },
336
+ state: (e) => b("historyChange", e),
337
+ invalid: (e) => b("historyInvalid", e),
338
+ replay: (e, t) => {
339
+ var s;
340
+ b(e === "undo" ? "undo" : "redo", t), (s = w.value) == null || s.focus({ preventScroll: !0 });
341
+ }
342
+ }), Ne = g(
343
+ () => new Map(u.items.map((e) => [e.id, e]))
344
+ ), ie = g(() => ya(u.items)), ne = g(() => ie.value.conflicts), Kt = g(
345
+ () => ne.value.map((e) => ({ ...e }))
346
+ ), ee = z(!1), ge = z(""), oe = z(1), it = "hys-gantt-conflicts-" + Zt(), fe = g(() => {
347
+ const e = ge.value.trim().toLocaleLowerCase();
348
+ return e ? ne.value.filter(
349
+ (t) => (t.taskTitle + " " + t.taskId + " " + (t.sourceTitle ?? "") + " " + (t.sourceId ?? "") + " " + t.message).toLocaleLowerCase().includes(e)
350
+ ) : ne.value;
351
+ }), Ht = g(
352
+ () => fe.value.slice(
353
+ (oe.value - 1) * 10,
354
+ oe.value * 10
355
+ )
356
+ );
357
+ N([fe, ge], () => {
358
+ oe.value = Math.min(
359
+ oe.value,
360
+ Math.max(1, Math.ceil(fe.value.length / 10))
361
+ );
362
+ }), N(ge, () => oe.value = 1), N(
363
+ () => u.showConflicts,
364
+ (e) => {
365
+ e || (ee.value = !1);
366
+ }
367
+ );
368
+ let nt = "";
369
+ N(
370
+ ne,
371
+ (e) => {
372
+ const t = JSON.stringify(e);
373
+ t !== nt && (nt = t, b(
374
+ "conflictChange",
375
+ e.map((s) => ({ ...s }))
376
+ ));
377
+ },
378
+ { immediate: !0 }
379
+ );
380
+ const i = oa({
381
+ items: () => u.items,
382
+ rows: () => $.value,
383
+ enabled: F,
384
+ live: () => C,
385
+ root: Se,
386
+ viewport: w,
387
+ grid: Qe,
388
+ labelWidth: () => Le.value,
389
+ rowHeight: () => x.value,
390
+ position: (e) => he.value.get(e),
391
+ locate: Me,
392
+ cancelTask: V,
393
+ update: (e, t) => {
394
+ var s, a;
395
+ return m.capture(e, {
396
+ type: t.type === "add" ? "dependency-add" : t.type === "remove" ? "dependency-remove" : "dependency-move",
397
+ label: (t.type === "add" ? "添加依赖:" : t.type === "remove" ? "删除依赖:" : "改接依赖:") + (((s = Ne.value.get(t.sourceId)) == null ? void 0 : s.title) ?? t.sourceId) + " → " + (((a = Ne.value.get(t.targetId)) == null ? void 0 : a.title) ?? t.targetId)
398
+ });
399
+ },
400
+ change: (e) => b("change", e),
401
+ added: (e, t) => b("dependencyAdd", e, t),
402
+ removed: (e, t) => b("dependencyRemove", e, t),
403
+ moved: (e, t, s) => b("dependencyMove", e, t, s),
404
+ invalid: (e) => b("dependencyInvalid", e)
405
+ }), re = g(() => {
406
+ var t;
407
+ const e = i.selected.value;
408
+ return e ? (t = Ce.value.get(e.targetId)) == null ? void 0 : t.find((s) => s.sourceId === e.sourceId) : void 0;
409
+ }), ot = jt(), ye = z(), ue = z(), Ke = z(""), Te = z(), Pe = z(""), M = ga(ot, ye, {
410
+ placement: "bottom-start",
411
+ gap: 8,
412
+ width: () => 380
413
+ }), de = g(
414
+ () => ue.value === void 0 ? [] : Ce.value.get(ue.value) ?? []
415
+ ), rt = g(() => {
416
+ const e = Ke.value.trim().toLocaleLowerCase();
417
+ return e ? de.value.filter(
418
+ (t) => (t.sourceTitle + " " + t.sourceId).toLocaleLowerCase().includes(e)
419
+ ) : de.value;
420
+ });
421
+ async function qe(e, t) {
422
+ var s, a, n;
423
+ if (!(!C || !F.value)) {
424
+ if (M.open.value && ue.value === t) {
425
+ M.close(!0);
426
+ return;
427
+ }
428
+ i.cancel(!i.selected.value), M.close(), ue.value = t, Ke.value = "", Pe.value = "", ot.value = e.currentTarget, await M.show(), C && M.open.value && ((n = ((s = ye.value) == null ? void 0 : s.querySelector(
429
+ '[data-pg-choice][aria-pressed="true"]'
430
+ )) ?? ((a = ye.value) == null ? void 0 : a.querySelector("[data-pg-choice]"))) == null || n.focus());
431
+ }
432
+ }
433
+ async function Ft(e, t) {
434
+ var a, n;
435
+ if (M.close(), i.selectEdge(e, t.sourceId, t.targetId), await te(), !C) return;
436
+ const s = [
437
+ ...((a = Se.value) == null ? void 0 : a.querySelectorAll(".hys-ui-pg-edge-group")) ?? []
438
+ ].find((v) => v.dataset.edgeKey === t.id);
439
+ (n = (s == null ? void 0 : s.querySelector(".hys-ui-pg-edge-endpoint-hit")) ?? (s == null ? void 0 : s.querySelector(".hys-ui-pg-edge-hit"))) == null || n.focus({ preventScroll: !0 });
440
+ }
441
+ async function ut(e, t, s) {
442
+ var a;
443
+ M.close(), t && s && i.selectEdge(t, s.sourceId, s.targetId), await Me(e) && (K.value = e, b("update:modelValue", e), (a = w.value) == null || a.focus({ preventScroll: !0 }));
444
+ }
445
+ async function Rt(e) {
446
+ M.close(), await Me(e.targetId, { block: "nearest" }), i.beginKeyboard(e.sourceId, e.targetId);
447
+ }
448
+ async function At(e) {
449
+ var t, s, a;
450
+ if (!Te.value) {
451
+ Te.value = e.id, Pe.value = "";
452
+ try {
453
+ await i.remove(e.sourceId, e.targetId) || (Pe.value = i.message.value);
454
+ } finally {
455
+ Te.value = void 0;
456
+ }
457
+ await te(), C && M.open.value ? (s = (t = ye.value) == null ? void 0 : t.querySelector("[data-pg-choice]")) == null || s.focus() : C && ((a = w.value) == null || a.focus({ preventScroll: !0 }));
458
+ }
459
+ }
460
+ function Ut(e) {
461
+ var n, v;
462
+ if (ct(e) || !["ArrowUp", "ArrowDown", "Home", "End"].includes(e.key) || e.target instanceof HTMLInputElement && ["Home", "End"].includes(e.key))
463
+ return;
464
+ e.preventDefault(), e.stopPropagation();
465
+ const t = [
466
+ ...((n = ye.value) == null ? void 0 : n.querySelectorAll(
467
+ "[data-pg-choice]"
468
+ )) ?? []
469
+ ], s = t.indexOf(document.activeElement), a = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : s < 0 ? e.key === "ArrowUp" ? t.length - 1 : 0 : (s + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length;
470
+ (v = t[a]) == null || v.focus();
471
+ }
472
+ N(de, () => {
473
+ M.open.value && (de.value.length < 2 ? M.close() : te(M.update));
474
+ }), N(
475
+ [F, () => u.showDependencies, () => !!i.draft.value],
476
+ () => {
477
+ (!F.value || !u.showDependencies || i.draft.value) && M.close();
478
+ }
479
+ ), N(
480
+ () => u.showDependencies,
481
+ (e) => {
482
+ e || i.cancel();
483
+ }
484
+ );
485
+ async function Me(e, t = {}) {
486
+ if (!C) return !1;
487
+ const s = $.value.findIndex((p) => p.id === e);
488
+ if (s < 0 || (await te(), !C || !w.value)) return !1;
489
+ Ie();
490
+ const a = w.value, n = $.value[s];
491
+ if (!n || n.id !== e) return !1;
492
+ const v = Math.max(x.value, a.clientHeight - 66), o = s * x.value, I = o + x.value;
493
+ let P = t.block === "start" ? o : t.block === "end" ? I - v : t.block === "nearest" ? o < a.scrollTop ? o : I > a.scrollTop + v ? I - v : a.scrollTop : o - (v - x.value) / 2, D = a.scrollLeft;
494
+ if (t.horizontal !== !1) {
495
+ const p = (n.s - q.value.start) * S.value, Q = (n.e - n.s + 1) * S.value;
496
+ p < D || Q > le.value ? D = p : p + Q > D + le.value && (D = p + Q - le.value);
497
+ }
498
+ const W = {
499
+ top: Math.max(0, P),
500
+ left: Math.max(0, D),
501
+ behavior: t.behavior ?? "auto"
502
+ };
503
+ return a.scrollTo ? a.scrollTo(W) : (a.scrollTop = W.top, a.scrollLeft = W.left), J = { top: a.scrollTop, left: a.scrollLeft }, ce.value = a.scrollTop, await te(), C;
504
+ }
505
+ function Vt(e = {}) {
506
+ if (!C || !w.value) return;
507
+ const t = w.value;
508
+ t.scrollTo ? t.scrollTo({
509
+ top: 0,
510
+ left: t.scrollLeft,
511
+ behavior: e.behavior ?? "auto"
512
+ }) : t.scrollTop = 0, J = { top: t.scrollTop, left: t.scrollLeft }, ce.value = t.scrollTop;
513
+ }
514
+ function He(e) {
515
+ var t;
516
+ if (((t = i.draft.value) == null ? void 0 : t.mode) === "keyboard") {
517
+ i.submit(e.id);
518
+ return;
519
+ }
520
+ performance.now() < ht || (i.clearSelected(), K.value = e.id, b("update:modelValue", e.id), b("open", e));
521
+ }
522
+ function dt() {
523
+ K.value !== null && (K.value = null, b("update:modelValue", null));
524
+ }
525
+ function Wt(e) {
526
+ ct(e) || (i.key(e), !(e.defaultPrevented || e.key !== "Escape") && (!E.value && K.value === null || (E.value ? V() : dt(), e.preventDefault(), e.stopPropagation())));
527
+ }
528
+ function ct(e) {
529
+ if (!m.enabled.value || !u.historyKeyboard || e.defaultPrevented || e.isComposing || e.altKey || !(e.ctrlKey || e.metaKey))
530
+ return !1;
531
+ const t = e.key.toLowerCase(), s = t === "y" || t === "z" && e.shiftKey;
532
+ return t !== "z" && t !== "y" || e.target instanceof Element && e.target.closest(
533
+ 'input,textarea,select,[contenteditable="true"],[role="textbox"]'
534
+ ) ? !1 : (e.preventDefault(), e.stopPropagation(), E.value || i.draft.value || T.resizing.value ? (V(), i.cancel(), T.cancel(), !0) : (m.pending.value || (s ? m.redo() : m.undo()), !0));
535
+ }
536
+ function vt(e) {
537
+ if (e.type === "click" && e.detail > 0 || e.target instanceof Element && e.target.closest(
538
+ ".hys-ui-pg-edge-hit, .hys-ui-pg-edge-endpoint-hit, .hys-ui-pg-incoming-trigger, .hys-ui-pg-link-feedback button"
539
+ ))
540
+ return;
541
+ i.clearSelected(), M.close();
542
+ const t = e.target;
543
+ !i.draft.value && !E.value && t instanceof Element && !t.closest(
544
+ ".hys-ui-pg-bar, .hys-ui-pg-task-label, .hys-ui-pg-link-port"
545
+ ) && (t === w.value || t.closest(".hys-ui-pg-grid, .hys-ui-pg-task-list")) && dt();
546
+ }
547
+ function pt() {
548
+ if (!C) return;
549
+ const e = w.value;
550
+ e && (e.scrollLeft = Math.max(
551
+ 0,
552
+ (X(ke) - q.value.start) * S.value - le.value / 3
553
+ ));
554
+ }
555
+ N(Y, () => te(pt));
556
+ const E = z(null);
557
+ let Ge, ht = 0;
558
+ function gt() {
559
+ var t, s;
560
+ const e = Ge;
561
+ Ge = void 0, (s = e == null ? void 0 : (t = e.element).hasPointerCapture) != null && s.call(t, e.id) && e.element.releasePointerCapture(e.id);
94
562
  }
95
563
  function V() {
96
- g.value = null, ne();
564
+ E.value && (ht = performance.now() + 350), E.value = null, gt();
97
565
  }
98
- function O(e, n, t) {
99
- !c.editable || n.disabled || e.button !== 0 || (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), I = { element: e.currentTarget, id: e.pointerId }, g.value = { id: n.id, type: t, x: e.clientX, original: { ...n }, days: 0, unitWidth: u.value }, T.value = n.id, m("update:modelValue", n.id));
566
+ function Oe(e, t, s) {
567
+ var a;
568
+ !u.editable || t.disabled || e.button !== 0 || m.pending.value || (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), Ge = { element: e.currentTarget, id: e.pointerId }, (a = e.currentTarget.closest(".hys-ui-pg-bar")) == null || a.focus({ preventScroll: !0 }), E.value = {
569
+ id: t.id,
570
+ type: s,
571
+ x: e.clientX,
572
+ original: { ...t },
573
+ days: 0,
574
+ unitWidth: S.value
575
+ }, K.value = t.id, b("update:modelValue", t.id));
100
576
  }
101
- function X(e) {
102
- g.value && (g.value.days = Math.round((e.clientX - g.value.x) / g.value.unitWidth));
103
- }
104
- function D(e) {
105
- const n = g.value;
106
- if (!n || (g.value = null, ne(), e.type === "pointercancel" || !n.days)) return;
107
- const t = $(n.original.start), l = $(n.original.end);
108
- if (!t || !l) return;
109
- let a = h(t), s = h(l);
110
- n.type === "move" ? (a += n.days, s += n.days) : n.type === "start" ? a = Math.min(s, a + n.days) : s = Math.max(a, s + n.days);
111
- const G = { ...n.original, start: L(a), end: L(s) };
112
- m("update:items", c.items.map((ae) => String(ae.id) === String(G.id) ? G : ae)), m("change", G);
113
- }
114
- function ve(e) {
115
- const n = g.value;
116
- if (!n || String(n.id) !== String(e.id)) return { s: e.s, e: e.e };
117
- const t = n.days;
118
- return n.type === "move" ? { s: e.s + t, e: e.e + t } : n.type === "start" ? { s: Math.min(e.e, e.s + t), e: e.e } : { s: e.s, e: Math.max(e.s, e.e + t) };
119
- }
120
- function pe(e) {
121
- const n = ve(e);
122
- return { left: `${(n.s - b.value.start) * u.value}px`, width: `${Math.max(u.value, (n.e - n.s + 1) * u.value)}px`, background: e.color || "var(--hys-ui-primary,var(--hys-ui-theme-primary, #4776ed))" };
123
- }
124
- function E(e, n) {
125
- if (!c.editable || e.disabled) return;
126
- const t = $(e.start), l = $(e.end);
127
- if (!t || !l) return;
128
- const a = { ...e, start: L(h(t) + n), end: L(h(l) + n) };
129
- m("update:items", c.items.map((s) => String(s.id) === String(e.id) ? a : s)), m("change", a);
130
- }
131
- return (e, n) => (i(), o("section", be(q(ue), {
132
- class: "hys-ui-pg-gantt",
133
- "aria-label": "项目甘特图"
134
- }), [
135
- r("div", Me, [
136
- se($e, {
137
- class: "hys-ui-pg-scale",
138
- "model-value": w.value,
139
- options: [{ label: "日", value: "day" }, { label: "周", value: "week" }, { label: "月", value: "month" }],
140
- "aria-label": "时间刻度",
141
- "onUpdate:modelValue": ce
142
- }, null, 8, ["model-value"]),
143
- se(Ce, {
144
- variant: "secondary",
145
- size: "sm",
146
- class: "hys-ui-pg-today",
147
- onClick: te
148
- }, {
149
- default: xe(() => [...n[0] || (n[0] = [
150
- ie("定位今天", -1)
151
- ])]),
152
- _: 1
153
- }),
154
- r("span", De, f(d.editable ? "拖动任务条调整排期 · Alt + 左/右方向键微调日期" : "点击任务查看详情"), 1)
155
- ]),
156
- r("div", Pe, [
157
- r("div", {
158
- class: "hys-ui-pg-labels",
159
- style: p({ width: d.labelWidth + "px", minWidth: d.labelWidth + "px" })
160
- }, [
161
- n[1] || (n[1] = r("div", { class: "hys-ui-pg-label-head" }, "任务 / 负责人", -1)),
162
- (i(!0), o(P, null, S(v.value, (t) => (i(), o("button", {
163
- type: "button",
164
- key: t.id,
165
- class: K(["hys-ui-pg-task-label", { "hys-ui-selected": T.value === t.id }]),
166
- style: p({ height: d.rowHeight + "px" }),
167
- onClick: (l) => F(t),
168
- onKeydown: [
169
- _(x((l) => E(t, -1), ["alt", "prevent"]), ["left"]),
170
- _(x((l) => E(t, 1), ["alt", "prevent"]), ["right"])
171
- ]
172
- }, [
173
- r("strong", {
174
- title: t.title
175
- }, f(t.title), 9, _e),
176
- r("small", null, f(t.owner || "未分配") + " · " + f(t.status || "待办"), 1)
177
- ], 46, Se))), 128)),
178
- v.value.length ? z("", !0) : (i(), o("div", Te, "暂无有效排期任务"))
179
- ], 4),
180
- r("div", {
577
+ function Ye(e) {
578
+ E.value && (E.value.days = Math.round(
579
+ (e.clientX - E.value.x) / E.value.unitWidth
580
+ ));
581
+ }
582
+ function me(e) {
583
+ const t = E.value;
584
+ if (!t || (E.value = null, gt(), e.type === "pointercancel" || !t.days)) return;
585
+ const s = Ne.value.get(t.id);
586
+ if (!u.editable || !s || s.disabled) return;
587
+ const a = be(t.original.start), n = be(t.original.end);
588
+ if (!a || !n) return;
589
+ let v = X(a), o = X(n);
590
+ t.type === "move" ? (v += t.days, o += t.days) : t.type === "start" ? v = Math.min(o, v + t.days) : o = Math.max(v, o + t.days);
591
+ const I = {
592
+ ...s,
593
+ start: $e(v),
594
+ end: $e(o)
595
+ };
596
+ m.capture(
597
+ u.items.map((P) => P.id === I.id ? I : P),
598
+ {
599
+ type: t.type === "move" ? "move" : t.type === "start" ? "resize-start" : "resize-end",
600
+ label: (t.type === "move" ? "移动任务:" : t.type === "start" ? "调整开始日期:" : "调整结束日期:") + I.title
601
+ }
602
+ ) && b("change", I);
603
+ }
604
+ function ft(e) {
605
+ const t = E.value;
606
+ if (!t || t.id !== e.id) return { s: e.s, e: e.e };
607
+ const s = t.days;
608
+ return t.type === "move" ? { s: e.s + s, e: e.e + s } : t.type === "start" ? { s: Math.min(e.e, e.s + s), e: e.e } : { s: e.s, e: Math.max(e.s, e.e + s) };
609
+ }
610
+ function Bt(e) {
611
+ const t = ft(e);
612
+ return {
613
+ left: `${(t.s - q.value.start) * S.value}px`,
614
+ width: `${Math.max(S.value, (t.e - t.s + 1) * S.value)}px`,
615
+ background: e.color || "var(--hys-ui-primary,var(--hys-ui-theme-primary, #4776ed))"
616
+ };
617
+ }
618
+ function Nt(e) {
619
+ return {
620
+ left: (ft(e).e - q.value.start + 1) * S.value + 5 + "px"
621
+ };
622
+ }
623
+ function Fe(e, t) {
624
+ if (!u.editable || e.disabled || m.pending.value) return;
625
+ const s = be(e.start), a = be(e.end);
626
+ if (!s || !a) return;
627
+ const n = {
628
+ ...e,
629
+ start: $e(X(s) + t),
630
+ end: $e(X(a) + t)
631
+ };
632
+ m.capture(
633
+ u.items.map((v) => v.id === e.id ? n : v),
634
+ { type: "nudge", label: "微调排期:" + n.title }
635
+ ) && b("change", n);
636
+ }
637
+ const G = g(() => {
638
+ const e = E.value;
639
+ if (!e || !e.days) return;
640
+ const t = ie.value.tasks.get(e.id);
641
+ if (!t || t.s === null || t.e === null) return;
642
+ const s = e.type === "end" ? t.s : e.type === "start" ? Math.min(t.e, t.s + e.days) : t.s + e.days, a = e.type === "start" ? t.e : e.type === "end" ? Math.max(t.s, t.e + e.days) : t.e + e.days, n = (ie.value.incident.get(e.id) ?? []).flatMap(
643
+ (P) => {
644
+ const D = ie.value.byEdge.get(P.id);
645
+ return (D == null ? void 0 : D.type) === "dependency-order" ? [D] : [];
646
+ }
647
+ ), v = ma(ie.value, e.id, s, a), o = new Set(n.map((P) => P.id)), I = new Set(v.map((P) => P.id));
648
+ return {
649
+ conflicts: v,
650
+ added: v.filter((P) => !o.has(P.id)).length,
651
+ resolved: n.filter((P) => !I.has(P.id)).length,
652
+ before: n.length
653
+ };
654
+ });
655
+ function Re(e) {
656
+ return ie.value.byTask.get(e) ?? [];
657
+ }
658
+ function yt(e, t) {
659
+ return ie.value.byEdge.get(ka(e, t));
660
+ }
661
+ function qt(e) {
662
+ return {
663
+ "dependency-order": "前后置日期冲突",
664
+ "invalid-date": "日期无效",
665
+ "missing-dependency": "前置引用失效",
666
+ "dependency-cycle": "循环依赖"
667
+ }[e];
668
+ }
669
+ async function Gt(e) {
670
+ var t;
671
+ await Me(e.taskId) && (K.value = e.taskId, b("update:modelValue", e.taskId), e.sourceId !== void 0 && he.value.has(e.sourceId) && i.selectEdge(new Event("select"), e.sourceId, e.taskId), (t = w.value) == null || t.focus({ preventScroll: !0 }));
672
+ }
673
+ return Pt({
674
+ element: Se,
675
+ viewport: w,
676
+ scrollToTask: Me,
677
+ scrollToTop: Vt,
678
+ addDependency: i.add,
679
+ removeDependency: i.remove,
680
+ moveDependency: i.moveTarget,
681
+ cancelDependency: () => i.cancel(),
682
+ undo: m.undo,
683
+ redo: m.redo,
684
+ clearHistory: m.clear,
685
+ canUndo: m.canUndo,
686
+ canRedo: m.canRedo,
687
+ historyState: m.state,
688
+ conflicts: Kt
689
+ }), (e, t) => {
690
+ var s;
691
+ return r(), c("section", kt({
692
+ ref_key: "root",
693
+ ref: Se
694
+ }, l(Je), {
695
+ class: ["hys-ui-pg-gantt", { "hys-ui-pg-resizing-label": l(T).resizing.value }],
696
+ "aria-label": "项目甘特图",
697
+ onKeydown: Wt,
698
+ onPointerdownCapture: vt,
699
+ onClickCapture: vt
700
+ }), [
701
+ d("div", ba, [
702
+ f(la, {
703
+ class: "hys-ui-pg-scale",
704
+ "model-value": Y.value,
705
+ options: [
706
+ { label: "日", value: "day" },
707
+ { label: "周", value: "week" },
708
+ { label: "月", value: "month" }
709
+ ],
710
+ "aria-label": "时间刻度",
711
+ "onUpdate:modelValue": $t
712
+ }, null, 8, ["model-value"]),
713
+ f(U, {
714
+ variant: "secondary",
715
+ size: "sm",
716
+ class: "hys-ui-pg-today",
717
+ onClick: pt
718
+ }, {
719
+ default: H(() => [...t[23] || (t[23] = [
720
+ Z("定位今天", -1)
721
+ ])]),
722
+ _: 1
723
+ }),
724
+ l(m).enabled.value && L.showHistoryControls && (L.editable || F.value || l(m).state.value.undoCount || l(m).state.value.redoCount) ? (r(), c("div", wa, [
725
+ f(U, {
726
+ variant: "secondary",
727
+ size: "sm",
728
+ disabled: !l(m).canUndo.value,
729
+ "aria-label": "撤销",
730
+ title: (l(m).state.value.undoLabel ? "撤销:" + l(m).state.value.undoLabel : "没有可撤销的操作") + "(Ctrl/⌘ + Z)",
731
+ onClick: t[0] || (t[0] = (a) => l(m).undo())
732
+ }, {
733
+ default: H(() => [
734
+ f(l(ra), { size: 15 }),
735
+ t[24] || (t[24] = Z("撤销", -1))
736
+ ]),
737
+ _: 1
738
+ }, 8, ["disabled", "title"]),
739
+ f(U, {
740
+ variant: "secondary",
741
+ size: "sm",
742
+ disabled: !l(m).canRedo.value,
743
+ "aria-label": "重做",
744
+ title: (l(m).state.value.redoLabel ? "重做:" + l(m).state.value.redoLabel : "没有可重做的操作") + "(Ctrl/⌘ + Shift + Z)",
745
+ onClick: t[1] || (t[1] = (a) => l(m).redo())
746
+ }, {
747
+ default: H(() => [
748
+ f(l(ua), { size: 15 }),
749
+ t[25] || (t[25] = Z("重做", -1))
750
+ ]),
751
+ _: 1
752
+ }, 8, ["disabled", "title"])
753
+ ])) : y("", !0),
754
+ d("span", xa, h(L.editable ? "拖动任务条调整排期 · Alt + 左/右方向键微调日期 · Esc / 点击空白取消选中" : "点击任务查看详情 · Esc / 点击空白取消选中"), 1)
755
+ ]),
756
+ d("div", {
181
757
  ref_key: "scroller",
182
- ref: k,
183
- class: "hys-ui-pg-scroll",
758
+ ref: w,
759
+ class: "hys-ui-pg-body hys-ui-pg-scroll",
760
+ style: _(zt.value),
761
+ role: "region",
184
762
  tabindex: "0",
185
- "aria-label": "可横向滚动的甘特图时间轴"
763
+ "aria-label": "可滚动的甘特图任务与时间轴",
764
+ onScrollPassive: tt,
765
+ onPointermove: t[11] || (t[11] = //@ts-ignore
766
+ (...a) => l(i).move && l(i).move(...a)),
767
+ onPointerup: t[12] || (t[12] = //@ts-ignore
768
+ (...a) => l(i).end && l(i).end(...a)),
769
+ onPointercancel: t[13] || (t[13] = //@ts-ignore
770
+ (...a) => l(i).lost && l(i).lost(...a)),
771
+ onLostpointercapture: t[14] || (t[14] = //@ts-ignore
772
+ (...a) => l(i).lost && l(i).lost(...a))
186
773
  }, [
187
- r("div", {
188
- class: "hys-ui-pg-canvas",
189
- style: p({ width: J.value + "px" })
774
+ d("div", {
775
+ ref_key: "labels",
776
+ ref: De,
777
+ class: "hys-ui-pg-labels",
778
+ style: _({
779
+ width: l(T).width.value + "px",
780
+ minWidth: l(T).width.value + "px"
781
+ })
190
782
  }, [
191
- r("div", He, [
192
- (i(!0), o(P, null, S(he.value, (t) => (i(), o("span", {
193
- key: t.key,
194
- title: t.label,
195
- style: p({ left: t.left + "px", width: t.width + "px" })
196
- }, f(t.label), 13, Ue))), 128))
197
- ]),
198
- r("div", Ve, [
199
- (i(!0), o(P, null, S(B.value, (t) => (i(), o("span", {
200
- key: t,
201
- class: K({ "hys-ui-weekend": [0, 6].includes(U(t).getUTCDay()), "hys-ui-today": t === h(q(H)) }),
202
- style: p({ width: u.value + "px" })
203
- }, f(w.value === "month" ? "" : U(t).getUTCDate()), 7))), 128))
783
+ d("div", Ia, [
784
+ t[26] || (t[26] = Z(" 任务 / 负责人 ", -1)),
785
+ L.labelResizable ? (r(), c("div", {
786
+ key: 0,
787
+ class: "hys-ui-pg-label-resizer",
788
+ role: "separator",
789
+ tabindex: "0",
790
+ "aria-label": "任务名称列宽",
791
+ "aria-orientation": "vertical",
792
+ "aria-valuenow": l(T).width.value,
793
+ "aria-valuemin": l(T).minimum.value,
794
+ "aria-valuemax": l(T).maximum.value,
795
+ style: _({ height: Ae.value + "px" }),
796
+ title: "拖动调整任务列宽;左右键微调,Shift 加速,双击还原",
797
+ onPointerdown: t[2] || (t[2] = k(
798
+ //@ts-ignore
799
+ (...a) => l(T).down && l(T).down(...a),
800
+ ["stop", "prevent"]
801
+ )),
802
+ onPointermove: t[3] || (t[3] = //@ts-ignore
803
+ (...a) => l(T).move && l(T).move(...a)),
804
+ onPointerup: t[4] || (t[4] = //@ts-ignore
805
+ (...a) => l(T).up && l(T).up(...a)),
806
+ onPointercancel: t[5] || (t[5] = //@ts-ignore
807
+ (...a) => l(T).up && l(T).up(...a)),
808
+ onLostpointercapture: t[6] || (t[6] = //@ts-ignore
809
+ (...a) => l(T).cancel && l(T).cancel(...a)),
810
+ onKeydown: t[7] || (t[7] = //@ts-ignore
811
+ (...a) => l(T).key && l(T).key(...a)),
812
+ onDblclick: t[8] || (t[8] = k(
813
+ //@ts-ignore
814
+ (...a) => l(T).reset && l(T).reset(...a),
815
+ ["stop"]
816
+ ))
817
+ }, null, 44, Ca)) : y("", !0)
204
818
  ]),
205
- r("div", {
206
- class: "hys-ui-pg-grid",
207
- style: p({ height: v.value.length * d.rowHeight + "px" })
819
+ d("div", {
820
+ class: "hys-ui-pg-task-list",
821
+ style: _({ height: $.value.length * x.value + "px" })
208
822
  }, [
209
- (i(!0), o(P, null, S(B.value, (t) => (i(), o("div", {
210
- key: t,
211
- class: K(["hys-ui-pg-day-column", { "hys-ui-weekend": [0, 6].includes(U(t).getUTCDay()) }]),
212
- style: p({ left: (t - b.value.start) * u.value + "px", width: u.value + "px" })
213
- }, null, 6))), 128)),
214
- r("div", {
215
- class: "hys-ui-pg-today-line",
216
- style: p({ left: (h(q(H)) - b.value.start) * u.value + u.value / 2 + "px" })
217
- }, null, 4),
218
- (i(!0), o(P, null, S(v.value, (t, l) => {
219
- var a;
220
- return i(), o("div", {
221
- key: t.id,
222
- class: "hys-ui-pg-row",
223
- style: p({ top: l * d.rowHeight + "px", height: d.rowHeight + "px" })
823
+ (r(!0), c(B, null, j(je.value, (a) => {
824
+ var n, v, o;
825
+ return r(), c("button", {
826
+ type: "button",
827
+ key: a.task.id,
828
+ class: O(["hys-ui-pg-task-label", {
829
+ "hys-ui-selected": K.value === a.task.id,
830
+ "hys-ui-pg-task-has-conflict": L.showConflicts && Re(a.task.id).length > 0,
831
+ "hys-ui-pg-link-target": ((n = l(i).draft.value) == null ? void 0 : n.targetId) === a.task.id,
832
+ "hys-ui-pg-link-invalid": ((v = l(i).draft.value) == null ? void 0 : v.targetId) === a.task.id && !!((o = l(i).draft.value) != null && o.reason)
833
+ }]),
834
+ "aria-pressed": K.value === a.task.id,
835
+ "data-row-index": a.index,
836
+ style: _({
837
+ height: x.value + "px",
838
+ top: a.index * x.value + "px"
839
+ }),
840
+ onClick: (I) => He(a.task),
841
+ onKeydown: [
842
+ A(k((I) => Fe(a.task, -1), ["alt", "prevent"]), ["left"]),
843
+ A(k((I) => Fe(a.task, 1), ["alt", "prevent"]), ["right"])
844
+ ]
224
845
  }, [
225
- r("div", {
226
- class: K(["hys-ui-pg-bar", { "hys-ui-selected": T.value === t.id, "hys-ui-dragging": ((a = g.value) == null ? void 0 : a.id) === t.id, "hys-ui-disabled": t.disabled }]),
227
- style: p(pe(t)),
228
- role: "button",
229
- tabindex: "0",
230
- "aria-label": `${t.title},${t.start} 至 ${t.end},完成 ${t.progress}%`,
231
- title: `${t.title}
232
- ${t.start} → ${t.end}
233
- 完成 ${t.progress}%`,
234
- onClick: (s) => F(t),
235
- onKeydown: [
236
- _((s) => F(t), ["enter"]),
237
- _(x((s) => F(t), ["prevent"]), ["space"]),
238
- _(x((s) => E(t, -1), ["alt", "prevent"]), ["left"]),
239
- _(x((s) => E(t, 1), ["alt", "prevent"]), ["right"])
240
- ],
241
- onPointerdown: (s) => O(s, t, "move"),
242
- onPointermove: X,
243
- onPointerup: D,
244
- onPointercancel: D,
245
- onLostpointercapture: V
846
+ d("strong", {
847
+ title: a.task.title
848
+ }, h(a.task.title), 9, Pa),
849
+ d("small", null, h(a.task.owner || "未分配") + " · " + h(a.task.status || "待办"), 1),
850
+ L.showConflicts && Re(a.task.id).length ? (r(), c("span", {
851
+ key: 0,
852
+ class: "hys-ui-pg-task-warning",
853
+ "aria-hidden": "true",
854
+ title: Re(a.task.id).map((I) => I.message).join(`
855
+ `)
246
856
  }, [
247
- r("div", {
248
- class: "hys-ui-pg-progress",
249
- style: p({ width: t.progress + "%" })
250
- }, null, 4),
251
- r("span", ze, f(t.progress) + "%", 1),
252
- d.editable && !t.disabled ? (i(), o("span", {
253
- key: 0,
254
- class: "hys-ui-pg-handle hys-ui-start",
255
- title: "调整开始日期",
256
- onPointerdown: x((s) => O(s, t, "start"), ["stop"]),
257
- onPointermove: X,
258
- onPointerup: D,
259
- onPointercancel: D,
260
- onLostpointercapture: V
261
- }, null, 40, Le)) : z("", !0),
262
- d.editable && !t.disabled ? (i(), o("span", {
263
- key: 1,
264
- class: "hys-ui-pg-handle hys-ui-end",
265
- title: "调整结束日期",
266
- onPointerdown: x((s) => O(s, t, "end"), ["stop"]),
267
- onPointermove: X,
268
- onPointerup: D,
269
- onPointercancel: D,
270
- onLostpointercapture: V
271
- }, null, 40, Ae)) : z("", !0)
272
- ], 46, We)
273
- ], 4);
274
- }), 128)),
275
- ee.value.length ? (i(), o("svg", {
276
- key: 0,
277
- class: "hys-ui-pg-dependencies",
278
- width: J.value,
279
- height: v.value.length * d.rowHeight,
280
- "aria-hidden": "true"
857
+ f(l(wt), { size: 14 })
858
+ ], 8, Ma)) : y("", !0)
859
+ ], 46, Ta);
860
+ }), 128))
861
+ ], 4),
862
+ $.value.length ? y("", !0) : (r(), c("div", za, " 暂无有效排期任务 "))
863
+ ], 4),
864
+ d("div", {
865
+ class: "hys-ui-pg-timeline",
866
+ style: _({ width: Ve.value + "px" })
867
+ }, [
868
+ d("div", {
869
+ class: "hys-ui-pg-canvas",
870
+ style: _({ width: Ve.value + "px" })
871
+ }, [
872
+ d("div", Sa, [
873
+ (r(!0), c(B, null, j(Et.value, (a) => (r(), c("span", {
874
+ key: a.key,
875
+ title: a.label,
876
+ style: _({ left: a.left + "px", width: a.width + "px" })
877
+ }, h(a.label), 13, Da))), 128))
878
+ ]),
879
+ d("div", La, [
880
+ (r(!0), c(B, null, j(_e.value, (a) => (r(), c("span", {
881
+ key: a,
882
+ class: O({
883
+ "hys-ui-weekend": [0, 6].includes(we(a).getUTCDay()),
884
+ "hys-ui-today": a === X(l(ke))
885
+ }),
886
+ style: _({ width: S.value + "px" })
887
+ }, h(Y.value === "month" ? "" : we(a).getUTCDate()), 7))), 128))
888
+ ]),
889
+ d("div", {
890
+ ref_key: "grid",
891
+ ref: Qe,
892
+ class: "hys-ui-pg-grid",
893
+ style: _({ height: $.value.length * x.value + "px" })
281
894
  }, [
282
- (i(!0), o(P, null, S(ee.value, (t) => (i(), o("path", {
283
- key: t.id,
284
- d: t.path,
285
- fill: "none",
286
- stroke: "currentColor",
287
- "stroke-width": "1.5",
288
- "stroke-dasharray": "4 3"
289
- }, null, 8, Fe))), 128))
290
- ], 8, Be)) : z("", !0)
895
+ (r(!0), c(B, null, j(_e.value, (a) => (r(), c("div", {
896
+ key: a,
897
+ class: O(["hys-ui-pg-day-column", {
898
+ "hys-ui-weekend": [0, 6].includes(we(a).getUTCDay())
899
+ }]),
900
+ style: _({
901
+ left: (a - q.value.start) * S.value + "px",
902
+ width: S.value + "px"
903
+ })
904
+ }, null, 6))), 128)),
905
+ d("div", {
906
+ class: "hys-ui-pg-today-line",
907
+ style: _({
908
+ left: (X(l(ke)) - q.value.start) * S.value + S.value / 2 + "px"
909
+ })
910
+ }, null, 4),
911
+ (r(!0), c(B, null, j(je.value, (a) => {
912
+ var n, v, o, I, P, D, W;
913
+ return r(), c("div", {
914
+ key: a.task.id,
915
+ class: "hys-ui-pg-row",
916
+ "data-row-index": a.index,
917
+ style: _({
918
+ top: a.index * x.value + "px",
919
+ height: x.value + "px"
920
+ })
921
+ }, [
922
+ d("div", {
923
+ class: O(["hys-ui-pg-bar", {
924
+ "hys-ui-selected": K.value === a.task.id,
925
+ "hys-ui-dragging": ((n = E.value) == null ? void 0 : n.id) === a.task.id,
926
+ "hys-ui-disabled": a.task.disabled,
927
+ "hys-ui-pg-bar-has-conflict": L.showConflicts && (((v = E.value) == null ? void 0 : v.id) === a.task.id && G.value ? G.value.conflicts.length > 0 : Re(a.task.id).length > 0),
928
+ "hys-ui-pg-link-source": ((o = l(i).draft.value) == null ? void 0 : o.sourceId) === a.task.id,
929
+ "hys-ui-pg-link-target": ((I = l(i).draft.value) == null ? void 0 : I.targetId) === a.task.id,
930
+ "hys-ui-pg-link-invalid": ((P = l(i).draft.value) == null ? void 0 : P.targetId) === a.task.id && !!((D = l(i).draft.value) != null && D.reason)
931
+ }]),
932
+ style: _(Bt(a.task)),
933
+ role: "button",
934
+ "aria-pressed": K.value === a.task.id,
935
+ tabindex: "0",
936
+ "aria-label": `${a.task.title},${a.task.start} 至 ${a.task.end},完成 ${a.task.progress}%`,
937
+ title: `${a.task.title}
938
+ ${a.task.start} → ${a.task.end}
939
+ 完成 ${a.task.progress}%`,
940
+ onClick: (p) => He(a.task),
941
+ onKeydown: [
942
+ A((p) => He(a.task), ["enter"]),
943
+ A(k((p) => He(a.task), ["prevent"]), ["space"]),
944
+ A(k((p) => Fe(a.task, -1), ["alt", "prevent"]), ["left"]),
945
+ A(k((p) => Fe(a.task, 1), ["alt", "prevent"]), ["right"])
946
+ ],
947
+ onPointerdown: (p) => Oe(p, a.task, "move"),
948
+ onPointermove: Ye,
949
+ onPointerup: me,
950
+ onPointercancel: me,
951
+ onLostpointercapture: V
952
+ }, [
953
+ d("div", {
954
+ class: "hys-ui-pg-progress",
955
+ style: _({ width: a.task.progress + "%" })
956
+ }, null, 4),
957
+ d("span", _a, h(a.task.progress) + "%", 1),
958
+ L.editable && !a.task.disabled ? (r(), c("span", {
959
+ key: 0,
960
+ class: "hys-ui-pg-handle hys-ui-start",
961
+ title: "调整开始日期",
962
+ onPointerdown: k((p) => Oe(p, a.task, "start"), ["stop"]),
963
+ onPointermove: Ye,
964
+ onPointerup: me,
965
+ onPointercancel: me,
966
+ onLostpointercapture: V
967
+ }, null, 40, Ka)) : y("", !0),
968
+ L.editable && !a.task.disabled ? (r(), c("span", {
969
+ key: 1,
970
+ class: "hys-ui-pg-handle hys-ui-end",
971
+ title: "调整结束日期",
972
+ onPointerdown: k((p) => Oe(p, a.task, "end"), ["stop"]),
973
+ onPointermove: Ye,
974
+ onPointerup: me,
975
+ onPointercancel: me,
976
+ onLostpointercapture: V
977
+ }, null, 40, Ha)) : y("", !0)
978
+ ], 46, Ea),
979
+ F.value && L.showDependencies && !a.task.disabled ? (r(), c("button", {
980
+ key: 0,
981
+ type: "button",
982
+ class: O(["hys-ui-pg-link-port", {
983
+ "hys-ui-pg-link-port-visible": K.value === a.task.id || ((W = l(i).draft.value) == null ? void 0 : W.sourceId) === a.task.id
984
+ }]),
985
+ style: _(Nt(a.task)),
986
+ "aria-label": "连接后续任务:" + a.task.title,
987
+ title: "拖动到后置任务,或点击后选择任务;也支持 Enter 和上下键",
988
+ onPointerdown: k((p) => l(i).beginPointer(p, a.task.id), ["stop", "prevent"]),
989
+ onClick: k((p) => l(i).clickSource(p, a.task.id), ["stop"]),
990
+ onKeydown: [
991
+ A(k((p) => l(i).beginKeyboard(a.task.id), ["stop", "prevent"]), ["enter"]),
992
+ A(k((p) => l(i).beginKeyboard(a.task.id), ["stop", "prevent"]), ["space"])
993
+ ]
994
+ }, null, 46, Fa)) : y("", !0)
995
+ ], 12, $a);
996
+ }), 128)),
997
+ L.showDependencies && st.value.length || l(i).draft.value ? (r(), c("svg", {
998
+ key: 0,
999
+ class: O(["hys-ui-pg-dependencies", {
1000
+ "hys-ui-pg-has-edge-selection": !!l(i).selected.value
1001
+ }]),
1002
+ width: Ve.value,
1003
+ height: $.value.length * x.value,
1004
+ "aria-hidden": !F.value || void 0
1005
+ }, [
1006
+ L.showDependencies ? (r(), c(B, { key: 0 }, [
1007
+ (r(!0), c(B, null, j(st.value, (a) => {
1008
+ var n, v, o, I, P, D, W, p, Q, mt;
1009
+ return r(), c("g", {
1010
+ key: a.id,
1011
+ class: O(["hys-ui-pg-edge-group", {
1012
+ "hys-ui-pg-edge-shared": (((n = Ce.value.get(a.targetId)) == null ? void 0 : n.length) ?? 0) > 1,
1013
+ "hys-ui-pg-edge-current": ((v = l(i).selected.value) == null ? void 0 : v.sourceId) === a.sourceId && ((o = l(i).selected.value) == null ? void 0 : o.targetId) === a.targetId,
1014
+ "hys-ui-pg-edge-rewiring": ((I = l(i).draft.value) == null ? void 0 : I.sourceId) === a.sourceId && ((P = l(i).draft.value) == null ? void 0 : P.previousTargetId) === a.targetId
1015
+ }]),
1016
+ "data-edge-key": a.id
1017
+ }, [
1018
+ d("path", {
1019
+ class: O(["hys-ui-pg-edge-line", {
1020
+ "hys-ui-pg-edge-selected": ((D = l(i).selected.value) == null ? void 0 : D.sourceId) === a.sourceId && ((W = l(i).selected.value) == null ? void 0 : W.targetId) === a.targetId,
1021
+ "hys-ui-pg-edge-conflict": L.showConflicts && !!yt(a.sourceId, a.targetId),
1022
+ "hys-ui-pg-edge-related": K.value === a.sourceId || K.value === a.targetId
1023
+ }]),
1024
+ d: a.path,
1025
+ fill: "none",
1026
+ stroke: "currentColor",
1027
+ "stroke-width": "1.5"
1028
+ }, null, 10, Ua),
1029
+ F.value ? (r(), c("path", {
1030
+ key: 0,
1031
+ class: "hys-ui-pg-edge-hit",
1032
+ d: (((p = Ce.value.get(a.targetId)) == null ? void 0 : p.length) ?? 0) > 1 && !(((Q = l(i).selected.value) == null ? void 0 : Q.sourceId) === a.sourceId && ((mt = l(i).selected.value) == null ? void 0 : mt.targetId) === a.targetId) ? a.pickPath : a.path,
1033
+ fill: "none",
1034
+ stroke: "transparent",
1035
+ "stroke-width": "12",
1036
+ role: "button",
1037
+ tabindex: "0",
1038
+ "aria-label": "依赖 " + a.sourceId + " → " + a.targetId + ",选中后按 Delete 移除",
1039
+ onPointerdown: t[9] || (t[9] = k(() => {
1040
+ }, ["stop"])),
1041
+ onClick: k((R) => l(i).selectEdge(R, a.sourceId, a.targetId), ["stop"]),
1042
+ onFocus: (R) => l(i).selectEdge(R, a.sourceId, a.targetId),
1043
+ onKeydown: A(k((R) => l(i).selectEdge(R, a.sourceId, a.targetId), ["prevent", "stop"]), ["enter"])
1044
+ }, null, 40, Va)) : y("", !0),
1045
+ F.value && a.editable ? (r(), c(B, { key: 1 }, [
1046
+ d("circle", {
1047
+ class: "hys-ui-pg-edge-endpoint",
1048
+ cx: a.endpoint.x,
1049
+ cy: a.endpoint.y,
1050
+ r: "5",
1051
+ "aria-hidden": "true"
1052
+ }, null, 8, Wa),
1053
+ d("circle", {
1054
+ class: "hys-ui-pg-edge-endpoint-hit",
1055
+ cx: a.endpoint.x,
1056
+ cy: a.endpoint.y,
1057
+ r: "12",
1058
+ fill: "transparent",
1059
+ role: "button",
1060
+ tabindex: "0",
1061
+ "aria-label": "改接依赖终点:" + a.sourceId + " → " + a.targetId,
1062
+ onFocus: (R) => l(i).selectEdge(R, a.sourceId, a.targetId),
1063
+ onPointerdown: k((R) => l(i).beginPointer(R, a.sourceId, a.targetId), ["stop", "prevent"]),
1064
+ onClick: k((R) => l(i).clickSource(R, a.sourceId, a.targetId), ["stop"]),
1065
+ onKeydown: [
1066
+ A(k((R) => l(i).beginKeyboard(a.sourceId, a.targetId), ["stop", "prevent"]), ["enter"]),
1067
+ A(k((R) => l(i).beginKeyboard(a.sourceId, a.targetId), ["stop", "prevent"]), ["space"])
1068
+ ]
1069
+ }, [
1070
+ d("title", null, h(a.sourceTitle) + " → " + h(a.targetTitle) + ":拖动修改连接终点,或按 Enter 后用上下键选择新任务 ", 1)
1071
+ ], 40, Ba)
1072
+ ], 64)) : y("", !0)
1073
+ ], 10, Aa);
1074
+ }), 128)),
1075
+ re.value ? (r(), c(B, { key: 0 }, [
1076
+ d("path", {
1077
+ class: O(["hys-ui-pg-active-edge-line", {
1078
+ "hys-ui-pg-edge-conflict": L.showConflicts && !!yt(
1079
+ re.value.sourceId,
1080
+ re.value.targetId
1081
+ )
1082
+ }]),
1083
+ d: re.value.path,
1084
+ fill: "none",
1085
+ "stroke-width": "2.5"
1086
+ }, null, 10, Na),
1087
+ re.value.editable && F.value ? (r(), c("circle", {
1088
+ key: 0,
1089
+ class: "hys-ui-pg-active-endpoint",
1090
+ cx: re.value.endpoint.x,
1091
+ cy: re.value.endpoint.y,
1092
+ r: "5"
1093
+ }, null, 8, qa)) : y("", !0)
1094
+ ], 64)) : y("", !0),
1095
+ F.value ? (r(!0), c(B, { key: 1 }, j(_t.value, (a) => {
1096
+ var n;
1097
+ return r(), c("g", {
1098
+ key: a.id,
1099
+ class: "hys-ui-pg-incoming-trigger",
1100
+ transform: `translate(${a.x} ${a.y})`,
1101
+ role: "button",
1102
+ tabindex: "0",
1103
+ "aria-haspopup": "dialog",
1104
+ "aria-expanded": l(M).open.value && ue.value === a.id,
1105
+ "aria-label": "选择前置依赖:" + a.title + "," + a.count + " 条",
1106
+ onPointerdown: t[10] || (t[10] = k(() => {
1107
+ }, ["stop"])),
1108
+ onClick: k((v) => qe(v, a.id), ["stop"]),
1109
+ onKeydown: [
1110
+ A(k((v) => qe(v, a.id), ["stop", "prevent"]), ["enter"]),
1111
+ A(k((v) => qe(v, a.id), ["stop", "prevent"]), ["space"])
1112
+ ]
1113
+ }, [
1114
+ t[27] || (t[27] = d("circle", {
1115
+ r: "13",
1116
+ fill: "transparent",
1117
+ class: "hys-ui-pg-incoming-hit"
1118
+ }, null, -1)),
1119
+ ((n = l(i).selected.value) == null ? void 0 : n.targetId) !== a.id ? (r(), c("circle", Oa)) : y("", !0),
1120
+ t[28] || (t[28] = d("circle", {
1121
+ r: "9",
1122
+ class: "hys-ui-pg-incoming-badge"
1123
+ }, null, -1)),
1124
+ d("text", Ya, h(a.count > 99 ? "99+" : a.count), 1),
1125
+ d("title", null, h(a.title) + " 有 " + h(a.count) + " 条前置关系,点击选择要编辑的连线 ", 1)
1126
+ ], 40, Ga);
1127
+ }), 128)) : y("", !0)
1128
+ ], 64)) : y("", !0),
1129
+ l(i).draft.value ? (r(), c("path", {
1130
+ key: 1,
1131
+ class: O(["hys-ui-pg-link-preview", {
1132
+ "hys-ui-pg-link-preview-invalid": !!l(i).draft.value.reason
1133
+ }]),
1134
+ d: l(i).path.value,
1135
+ fill: "none",
1136
+ stroke: "currentColor",
1137
+ "stroke-width": "2",
1138
+ "stroke-dasharray": "5 4"
1139
+ }, null, 10, Xa)) : y("", !0)
1140
+ ], 10, Ra)) : y("", !0)
1141
+ ], 4)
291
1142
  ], 4)
292
1143
  ], 4)
293
- ], 512)
294
- ]),
295
- r("div", Ee, [
296
- ie(f(v.value.length) + " 项任务 · " + f(v.value.filter((t) => t.status === "已完成").length) + " 项已完成 ", 1),
297
- v.value.length !== d.items.length ? (i(), o("span", Ke, "· " + f(d.items.length - v.value.length) + " 项日期无效已隐藏", 1)) : z("", !0)
298
- ])
299
- ], 16));
1144
+ ], 36),
1145
+ d("div", Ja, [
1146
+ Z(h($.value.length) + " 项任务 · " + h(St.value) + " 项已完成 ", 1),
1147
+ $.value.length !== L.items.length ? (r(), c("span", Qa, "· " + h(L.items.length - $.value.length) + " 项日期无效已隐藏", 1)) : y("", !0),
1148
+ F.value ? (r(), c("div", Za, [
1149
+ d("span", ja, h(l(i).message.value || "拖动圆点连接依赖;选中连线可拖动终点改接或移除。"), 1),
1150
+ l(i).draft.value ? (r(), ze(U, {
1151
+ key: 0,
1152
+ variant: "ghost",
1153
+ size: "sm",
1154
+ onClick: t[15] || (t[15] = (a) => l(i).cancel())
1155
+ }, {
1156
+ default: H(() => [
1157
+ f(l(xt), { size: 14 }),
1158
+ t[29] || (t[29] = Z("取消连接", -1))
1159
+ ]),
1160
+ _: 1
1161
+ })) : l(i).selected.value ? (r(), ze(U, {
1162
+ key: 1,
1163
+ variant: "ghost",
1164
+ size: "sm",
1165
+ onClick: t[16] || (t[16] = (a) => l(i).remove(
1166
+ l(i).selected.value.sourceId,
1167
+ l(i).selected.value.targetId
1168
+ ))
1169
+ }, {
1170
+ default: H(() => [
1171
+ f(l(It), { size: 14 }),
1172
+ t[30] || (t[30] = Z("移除依赖", -1))
1173
+ ]),
1174
+ _: 1
1175
+ })) : y("", !0)
1176
+ ])) : y("", !0),
1177
+ l(m).message.value ? (r(), c("p", el, h(l(m).message.value), 1)) : y("", !0),
1178
+ L.showConflicts && (ne.value.length || ee.value || G.value && (G.value.before || G.value.conflicts.length)) ? (r(), c("div", tl, [
1179
+ d("div", al, [
1180
+ f(l(wt), { size: 14 }),
1181
+ d("span", ll, h(ne.value.length ? ne.value.length + " 项排期冲突" : "当前排期检查正常"), 1),
1182
+ f(U, {
1183
+ variant: "ghost",
1184
+ size: "sm",
1185
+ "aria-expanded": ee.value,
1186
+ "aria-controls": it,
1187
+ onClick: t[17] || (t[17] = (a) => ee.value = !ee.value)
1188
+ }, {
1189
+ default: H(() => [
1190
+ Z(h(ee.value ? "收起详情" : "查看详情"), 1),
1191
+ f(l(da), {
1192
+ size: 13,
1193
+ style: _({
1194
+ transform: ee.value ? "rotate(180deg)" : void 0
1195
+ })
1196
+ }, null, 8, ["style"])
1197
+ ]),
1198
+ _: 1
1199
+ }, 8, ["aria-expanded"])
1200
+ ]),
1201
+ G.value ? (r(), c("p", sl, " 调整预览:相关依赖有 " + h(G.value.conflicts.length) + " 项冲突,新增 " + h(G.value.added) + " 项、消除 " + h(G.value.resolved) + " 项。" + h(((s = G.value.conflicts[0]) == null ? void 0 : s.message) ?? ""), 1)) : y("", !0),
1202
+ ee.value ? (r(), c("section", {
1203
+ key: 1,
1204
+ id: it,
1205
+ class: "hys-ui-pg-conflict-panel",
1206
+ "aria-label": "排期冲突详情"
1207
+ }, [
1208
+ f(bt, {
1209
+ modelValue: ge.value,
1210
+ "onUpdate:modelValue": t[18] || (t[18] = (a) => ge.value = a),
1211
+ size: "sm",
1212
+ "prefix-icon": l(Ct),
1213
+ clearable: "",
1214
+ placeholder: "搜索任务、编号或冲突说明",
1215
+ "aria-label": "搜索排期冲突"
1216
+ }, null, 8, ["modelValue", "prefix-icon"]),
1217
+ d("ul", il, [
1218
+ (r(!0), c(B, null, j(Ht.value, (a) => (r(), c("li", {
1219
+ key: a.id
1220
+ }, [
1221
+ d("div", null, [
1222
+ d("span", nl, h(qt(a.type)), 1),
1223
+ d("strong", null, h(a.sourceTitle ? a.sourceTitle + " → " : "") + h(a.taskTitle), 1),
1224
+ d("p", null, h(a.message), 1)
1225
+ ]),
1226
+ f(U, {
1227
+ variant: "ghost",
1228
+ size: "sm",
1229
+ disabled: !he.value.has(a.taskId),
1230
+ "aria-label": "定位冲突任务:" + a.taskTitle,
1231
+ onClick: (n) => Gt(a)
1232
+ }, {
1233
+ default: H(() => [
1234
+ f(l(Xe), { size: 14 }),
1235
+ t[31] || (t[31] = Z("定位", -1))
1236
+ ]),
1237
+ _: 1
1238
+ }, 8, ["disabled", "aria-label", "onClick"])
1239
+ ]))), 128)),
1240
+ fe.value.length ? y("", !0) : (r(), c("li", ol, h(ge.value ? "没有匹配的排期冲突" : "当前没有排期冲突"), 1))
1241
+ ]),
1242
+ fe.value.length > 10 ? (r(), ze(sa, {
1243
+ key: 0,
1244
+ page: oe.value,
1245
+ "onUpdate:page": t[19] || (t[19] = (a) => oe.value = a),
1246
+ total: fe.value.length,
1247
+ "page-size": 10,
1248
+ compact: ""
1249
+ }, null, 8, ["page", "total"])) : y("", !0)
1250
+ ])) : y("", !0)
1251
+ ])) : y("", !0)
1252
+ ]),
1253
+ (r(), ze(ea, { to: "body" }, [
1254
+ f(l(ta), {
1255
+ "popup-transition": u.popupTransition,
1256
+ "popup-transition-duration": u.popupTransitionDuration,
1257
+ placement: l(M).placement.value
1258
+ }, {
1259
+ default: H(() => {
1260
+ var a, n, v;
1261
+ return [
1262
+ l(M).open.value ? (r(), c("div", kt({
1263
+ key: 0,
1264
+ ref_key: "pickerPanel",
1265
+ ref: ye
1266
+ }, l(Je), {
1267
+ class: "hys-ui-pg-dependency-picker hys-ui-floating-surface",
1268
+ style: l(M).style.value,
1269
+ role: "dialog",
1270
+ "aria-label": "选择前置依赖:" + (((a = de.value[0]) == null ? void 0 : a.targetTitle) ?? ""),
1271
+ onKeydown: Ut
1272
+ }), [
1273
+ d("div", ul, [
1274
+ t[32] || (t[32] = d("strong", null, "选择前置关系", -1)),
1275
+ f(U, {
1276
+ variant: "ghost",
1277
+ size: "sm",
1278
+ class: "hys-ui-pg-picker-close",
1279
+ "aria-label": "关闭前置关系列表",
1280
+ onClick: t[20] || (t[20] = (o) => l(M).close(!0))
1281
+ }, {
1282
+ default: H(() => [
1283
+ f(l(xt), { size: 15 })
1284
+ ]),
1285
+ _: 1
1286
+ })
1287
+ ]),
1288
+ d("div", dl, [
1289
+ d("div", cl, [
1290
+ t[33] || (t[33] = d("span", null, "后置", -1)),
1291
+ d("strong", {
1292
+ title: (n = de.value[0]) == null ? void 0 : n.targetTitle
1293
+ }, h((v = de.value[0]) == null ? void 0 : v.targetTitle), 9, vl)
1294
+ ]),
1295
+ f(U, {
1296
+ variant: "ghost",
1297
+ size: "sm",
1298
+ class: "hys-ui-pg-picker-action",
1299
+ "aria-label": "定位后置任务",
1300
+ title: "定位后置任务",
1301
+ onClick: t[21] || (t[21] = (o) => ue.value !== void 0 && ut(ue.value))
1302
+ }, {
1303
+ default: H(() => [
1304
+ f(l(Xe), { size: 15 })
1305
+ ]),
1306
+ _: 1
1307
+ })
1308
+ ]),
1309
+ f(bt, {
1310
+ modelValue: Ke.value,
1311
+ "onUpdate:modelValue": t[22] || (t[22] = (o) => Ke.value = o),
1312
+ size: "sm",
1313
+ "prefix-icon": l(Ct),
1314
+ clearable: "",
1315
+ placeholder: "搜索前置任务或编号",
1316
+ "aria-label": "搜索前置关系",
1317
+ class: "hys-ui-pg-picker-search"
1318
+ }, null, 8, ["modelValue", "prefix-icon"]),
1319
+ d("div", pl, [
1320
+ (r(!0), c(B, null, j(rt.value, (o) => {
1321
+ var I, P, D, W;
1322
+ return r(), c("div", {
1323
+ key: o.id,
1324
+ class: "hys-ui-pg-picker-option",
1325
+ "data-current": ((I = l(i).selected.value) == null ? void 0 : I.sourceId) === o.sourceId && ((P = l(i).selected.value) == null ? void 0 : P.targetId) === o.targetId
1326
+ }, [
1327
+ f(U, {
1328
+ variant: "ghost",
1329
+ "data-pg-choice": "",
1330
+ "aria-label": o.sourceTitle + " → " + o.targetTitle,
1331
+ "aria-pressed": ((D = l(i).selected.value) == null ? void 0 : D.sourceId) === o.sourceId && ((W = l(i).selected.value) == null ? void 0 : W.targetId) === o.targetId,
1332
+ onClick: (p) => Ft(p, o)
1333
+ }, {
1334
+ default: H(() => {
1335
+ var p, Q;
1336
+ return [
1337
+ f(l(ca), {
1338
+ size: 15,
1339
+ class: "hys-ui-pg-picker-icon"
1340
+ }),
1341
+ d("span", gl, [
1342
+ d("span", {
1343
+ title: o.sourceTitle
1344
+ }, h(o.sourceTitle), 9, fl)
1345
+ ]),
1346
+ d("span", yl, [
1347
+ ((p = l(i).selected.value) == null ? void 0 : p.sourceId) === o.sourceId && ((Q = l(i).selected.value) == null ? void 0 : Q.targetId) === o.targetId ? (r(), ze(l(va), {
1348
+ key: 0,
1349
+ size: 14
1350
+ })) : y("", !0)
1351
+ ])
1352
+ ];
1353
+ }),
1354
+ _: 2
1355
+ }, 1032, ["aria-label", "aria-pressed", "onClick"]),
1356
+ d("div", ml, [
1357
+ f(U, {
1358
+ variant: "ghost",
1359
+ size: "sm",
1360
+ class: "hys-ui-pg-picker-action",
1361
+ "aria-label": "定位前置任务:" + o.sourceTitle,
1362
+ title: "定位前置任务",
1363
+ onClick: k((p) => ut(o.sourceId, p, o), ["stop"])
1364
+ }, {
1365
+ default: H(() => [
1366
+ f(l(Xe), { size: 14 })
1367
+ ]),
1368
+ _: 1
1369
+ }, 8, ["aria-label", "onClick"]),
1370
+ f(U, {
1371
+ variant: "ghost",
1372
+ size: "sm",
1373
+ class: "hys-ui-pg-picker-action",
1374
+ disabled: !o.editable || !!Te.value,
1375
+ "aria-label": "修改终点:" + o.sourceTitle + " → " + o.targetTitle,
1376
+ title: "修改连接终点",
1377
+ onClick: k((p) => Rt(o), ["stop"])
1378
+ }, {
1379
+ default: H(() => [
1380
+ f(l(pa), { size: 14 })
1381
+ ]),
1382
+ _: 1
1383
+ }, 8, ["disabled", "aria-label", "onClick"]),
1384
+ f(U, {
1385
+ variant: "ghost",
1386
+ size: "sm",
1387
+ class: "hys-ui-pg-picker-action hys-ui-pg-picker-delete",
1388
+ disabled: !o.removable || !!Te.value,
1389
+ "aria-label": "删除依赖:" + o.sourceTitle + " → " + o.targetTitle,
1390
+ title: "删除这条依赖",
1391
+ onClick: k((p) => At(o), ["stop"])
1392
+ }, {
1393
+ default: H(() => [
1394
+ f(l(It), { size: 14 })
1395
+ ]),
1396
+ _: 1
1397
+ }, 8, ["disabled", "aria-label", "onClick"])
1398
+ ])
1399
+ ], 8, hl);
1400
+ }), 128)),
1401
+ rt.value.length ? y("", !0) : (r(), c("p", kl, " 没有匹配的前置关系 "))
1402
+ ]),
1403
+ Pe.value ? (r(), c("p", bl, h(Pe.value), 1)) : y("", !0)
1404
+ ], 16, rl)) : y("", !0)
1405
+ ];
1406
+ }),
1407
+ _: 1
1408
+ }, 8, ["popup-transition", "popup-transition-duration", "placement"])
1409
+ ]))
1410
+ ], 16);
1411
+ };
300
1412
  }
301
1413
  });
302
1414
  export {
303
- Oe as default
1415
+ _l as default
304
1416
  };