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,361 +1,711 @@
1
- import { defineComponent as he, ref as p, computed as s, watch as W, onDeactivated as fe, openBlock as r, createElementBlock as v, mergeProps as G, unref as I, withDirectives as pe, vModelText as ye, createCommentVNode as w, createElementVNode as E, normalizeStyle as F, Fragment as me, renderList as be, normalizeClass as ge, withModifiers as J, createBlock as O, resolveDynamicComponent as ke, toDisplayString as P, renderSlot as we, Teleport as Ce, withKeys as De, nextTick as Ke } from "vue";
2
- import Ae from "../HysCheckbox/HysCheckbox.vue.js";
3
- import { useHysRootAttrs as Me } from "../../config.js";
4
- import { LoaderCircle as Se, ChevronDown as Te, ChevronRight as Ie } from "lucide-vue-next";
5
- const Be = ["disabled"], Ve = ["aria-multiselectable"], He = ["aria-level", "aria-expanded", "aria-selected", "aria-disabled", "aria-checked", "tabindex", "draggable", "data-tree-id", "onFocus", "onKeydown", "onClick", "onDragstart", "onDragover", "onDrop", "onContextmenu", "data-drop-position"], $e = ["aria-label", "disabled", "onClick"], Ee = {
1
+ import { defineComponent as sa, useId as ua, ref as g, provide as ra, computed as B, onActivated as ca, watch as Z, shallowRef as va, onDeactivated as ya, onBeforeUnmount as fa, openBlock as r, createElementBlock as h, mergeProps as M, unref as l, createBlock as R, withCtx as w, createVNode as Y, createCommentVNode as x, createElementVNode as ue, normalizeStyle as re, normalizeClass as He, withModifiers as X, renderSlot as H, createTextVNode as P, toDisplayString as S, Fragment as Se, renderList as ha, resolveDynamicComponent as ze, Teleport as ka, nextTick as _ } from "vue";
2
+ import pa from "../../motion/PopupMotion.js";
3
+ import { Search as ga, LoaderCircle as Ae, ChevronDown as ma, ChevronRight as ba, GripVertical as Ca } from "lucide-vue-next";
4
+ import xa from "../HysInput/HysInput.vue.js";
5
+ import Ta from "../HysCheckbox/HysCheckbox.vue.js";
6
+ import xe from "../HysButton/HysButton.vue.js";
7
+ import { useHysRootAttrs as Da } from "../../config.js";
8
+ import { useHysControlState as Ka, useHysFormItemContext as Na, fieldKey as Ea } from "../../composables/formContext.js";
9
+ import { useTree as Ba } from "../../composables/useTree.js";
10
+ const Ma = ["data-size"], Ha = ["id", "tabindex", "aria-label", "aria-multiselectable", "aria-disabled", "aria-busy", "aria-invalid", "aria-describedby"], Sa = {
11
+ key: 0,
12
+ class: "hys-ui-tree-loading",
13
+ role: "status"
14
+ }, za = ["aria-level", "aria-posinset", "aria-setsize", "aria-expanded", "aria-selected", "aria-disabled", "aria-checked", "tabindex", "draggable", "data-tree-id", "data-tree-key", "data-drop-position", "onFocus", "onKeydown", "onClick", "onDblclick", "onDragstart", "onDragover", "onDragleave", "onDrop", "onContextmenu"], Aa = ["aria-label", "disabled", "onClick"], Ia = {
6
15
  key: 1,
7
- class: "hys-ui-pf-tree-spacer",
8
- "aria-hidden": "true"
9
- }, Le = {
16
+ class: "hys-ui-pf-tree-spacer"
17
+ }, $a = {
10
18
  key: 3,
19
+ class: "hys-ui-tree-icon",
11
20
  "aria-hidden": "true"
12
- }, Ne = { class: "hys-ui-pf-tree-label" }, Re = {
13
- key: 4,
14
- class: "hys-ui-pf-tree-error",
15
- role: "alert"
16
- }, qe = {
17
- key: 2,
21
+ }, Va = { class: "hys-ui-pf-tree-label" }, Fa = ["disabled", "onClick"], La = {
22
+ key: 1,
18
23
  class: "hys-ui-pf-tree-empty"
19
- }, Ye = /* @__PURE__ */ he({
24
+ }, ja = /* @__PURE__ */ sa({
20
25
  __name: "HysTree",
21
26
  props: {
27
+ popupTransition: {},
28
+ popupTransitionDuration: {},
22
29
  nodes: {},
23
30
  modelValue: {},
24
- checkedKeys: { default: () => [] },
31
+ defaultValue: {},
32
+ checkedKeys: {},
33
+ defaultCheckedKeys: {},
34
+ halfCheckedKeys: {},
25
35
  expandedKeys: {},
36
+ defaultExpandedKeys: {},
37
+ loadedKeys: {},
26
38
  multiple: { type: Boolean },
39
+ selectable: { type: Boolean, default: !0 },
27
40
  checkable: { type: Boolean },
28
41
  searchable: { type: Boolean, default: !0 },
29
42
  disabled: { type: Boolean },
43
+ inheritDisabled: { type: Boolean },
44
+ loading: { type: Boolean },
45
+ size: {},
30
46
  defaultExpandAll: { type: Boolean },
47
+ autoExpandParent: { type: Boolean },
48
+ accordion: { type: Boolean },
49
+ expandOnClickNode: { type: Boolean },
50
+ expandOnDoubleClick: { type: Boolean },
51
+ checkOnClickNode: { type: Boolean },
52
+ checkOnClickLeaf: { type: Boolean },
53
+ selectOnClickNode: { type: Boolean, default: !0 },
54
+ allowDeselect: { type: Boolean },
55
+ highlightCurrent: { type: Boolean, default: !0 },
56
+ fieldNames: {},
57
+ nodeKey: {},
31
58
  showLine: { type: Boolean },
59
+ showIcon: { type: Boolean, default: !0 },
60
+ indent: { default: 20 },
61
+ blockNode: { type: Boolean, default: !0 },
32
62
  virtual: { type: Boolean },
33
63
  rowHeight: { default: 38 },
34
64
  viewportHeight: { default: 340 },
65
+ overscan: { default: 4 },
35
66
  draggable: { type: Boolean },
67
+ dragExpandDelay: { default: 700 },
68
+ allowDrag: {},
69
+ allowDrop: {},
36
70
  contextMenu: { type: Boolean },
37
71
  checkStrictly: { type: Boolean },
72
+ searchValue: {},
73
+ defaultSearchValue: {},
74
+ searchPlaceholder: {},
38
75
  filterNode: {},
39
- loadChildren: {}
76
+ filterMode: {},
77
+ showMatchedChildren: { type: Boolean },
78
+ emptyText: {},
79
+ ariaLabel: {},
80
+ locale: {},
81
+ loadChildren: {},
82
+ renderContent: {},
83
+ nodeClass: {},
84
+ nodeStyle: {},
85
+ validateEvent: { type: Boolean, default: !0 }
40
86
  },
41
- emits: ["update:modelValue", "update:checkedKeys", "update:expandedKeys", "select", "check", "node-drop", "node-contextmenu", "load-error", "children-loaded"],
42
- setup(i, { expose: ee, emit: le }) {
43
- const Y = Me(), d = i, c = le, b = p(""), C = p({}), K = p([]), M = p({}), S = p(0), A = p(""), B = p(""), U = p("inside"), h = p(null), V = p(""), m = p(null), u = s(() => {
44
- const e = /* @__PURE__ */ new Map(), t = (l, n = 0, a, o = /* @__PURE__ */ new Set()) => {
45
- var $, k;
46
- for (const y of l)
47
- e.has(y.id) || o.has(y.id) || (e.set(y.id, { node: y, depth: n, parentId: a, hasChildren: !!(($ = y.children) != null && $.length || (k = C.value[y.id]) != null && k.length || y.hasChildren) }), t(C.value[y.id] ?? y.children ?? [], n + 1, y.id, /* @__PURE__ */ new Set([...o, y.id])));
48
- };
49
- return t(d.nodes), e;
50
- }), H = p([]);
51
- W(() => [d.nodes, d.defaultExpandAll], () => {
52
- d.defaultExpandAll && d.expandedKeys === void 0 && (H.value = [...u.value.values()].filter((e) => e.hasChildren).map((e) => e.node.id));
53
- }, { immediate: !0, deep: !0 }), W(() => d.nodes, () => {
54
- C.value = {}, M.value = {}, S.value = 0;
55
- }, { deep: !1 });
56
- const f = s(() => d.expandedKeys ?? H.value), te = s(() => {
57
- const e = /* @__PURE__ */ new Set(), t = b.value.trim().toLocaleLowerCase();
58
- if (!t) return e;
59
- for (const l of u.value.values()) {
60
- if (!(d.filterNode ? d.filterNode(t, l.node) : l.node.label.toLocaleLowerCase().includes(t))) continue;
61
- let n = l;
62
- for (; n; )
63
- e.add(n.node.id), n = n.parentId ? u.value.get(n.parentId) : void 0;
87
+ emits: ["update:modelValue", "update:checkedKeys", "update:expandedKeys", "update:loadedKeys", "update:searchValue", "update:nodes", "select", "check", "check-change", "selection-change", "node-click", "node-expand", "node-collapse", "node-drop", "node-drag-start", "node-drag-over", "node-drag-end", "node-contextmenu", "load-error", "children-loaded", "load", "data-change", "search", "scroll", "focus", "blur"],
88
+ setup(o, { expose: Ie, emit: $e }) {
89
+ const i = o, m = $e, ce = Da(), ee = Ka(i), U = Na(), Ve = ua(), ae = g(), y = g(), Te = g();
90
+ ra(Ea, void 0);
91
+ const s = Ba(
92
+ i,
93
+ ee.disabled,
94
+ (e, ...a) => m(e, ...a),
95
+ () => {
96
+ i.validateEvent && U.validate("change");
97
+ }
98
+ ), {
99
+ index: G,
100
+ visible: p,
101
+ words: v,
102
+ busy: u,
103
+ live: ve,
104
+ query: q,
105
+ expanded: b,
106
+ selection: ye,
107
+ selected: Fe,
108
+ multiple: Le,
109
+ checked: W,
110
+ halfChecked: fe,
111
+ loadingKeys: he,
112
+ failures: Oe,
113
+ matches: Re,
114
+ expandNode: z,
115
+ setChecked: ke,
116
+ selectNode: pe,
117
+ filter: De
118
+ } = s, A = B(
119
+ () => Number.isFinite(i.rowHeight) ? Math.min(240, Math.max(24, i.rowHeight)) : 38
120
+ ), j = B(
121
+ () => Number.isFinite(i.viewportHeight) ? Math.min(1600, Math.max(80, i.viewportHeight)) : 340
122
+ ), Ke = B(
123
+ () => Number.isFinite(i.overscan) ? Math.min(30, Math.max(0, Math.floor(i.overscan))) : 4
124
+ ), Pe = B(
125
+ () => Number.isFinite(i.indent) ? Math.min(80, Math.max(0, i.indent)) : 20
126
+ ), V = g(0), te = g(0), I = g(null), Ne = B(
127
+ () => i.virtual ? Math.max(0, Math.floor(V.value / A.value) - Ke.value) : 0
128
+ ), Ue = B(
129
+ () => i.virtual ? Math.min(
130
+ p.value.length,
131
+ Math.ceil(
132
+ (V.value + (te.value || j.value)) / A.value
133
+ ) + Ke.value
134
+ ) : p.value.length
135
+ ), qe = B(() => p.value.slice(Ne.value, Ue.value)), $ = B(() => p.value.filter((e) => !e.disabled)), Ye = B(
136
+ () => {
137
+ var e;
138
+ return I.value !== null && p.value.some((a) => a.key === I.value && !a.disabled) ? I.value : (e = $.value[0]) == null ? void 0 : e.key;
64
139
  }
65
- return e;
66
- }), g = s(() => {
67
- const e = b.value.trim();
68
- return [...u.value.values()].filter((t) => {
69
- var n;
70
- if (e) return te.value.has(t.node.id);
71
- let l = t.parentId;
72
- for (; l; ) {
73
- if (!f.value.includes(l)) return !1;
74
- l = (n = u.value.get(l)) == null ? void 0 : n.parentId;
140
+ );
141
+ let J = 0, F = 0, T, ge = 0;
142
+ function Xe() {
143
+ T == null || T.disconnect(), i.virtual && y.value && typeof ResizeObserver < "u" && (T = new ResizeObserver((e) => {
144
+ var a;
145
+ te.value = ((a = e[0]) == null ? void 0 : a.contentRect.height) || 0;
146
+ }), T.observe(y.value));
147
+ }
148
+ function Ge() {
149
+ ge++, cancelAnimationFrame(J), J = 0, T == null || T.disconnect(), T = void 0;
150
+ }
151
+ async function Ee() {
152
+ const e = ++ge;
153
+ await _(), !(!ve.value || e !== ge || !y.value) && (y.value.scrollTop = F, V.value = y.value.scrollTop, Xe());
154
+ }
155
+ ca(Ee), Z([y, () => i.virtual], Ee);
156
+ function We(e) {
157
+ var a;
158
+ !ve.value || !((a = y.value) != null && a.isConnected) || (F = y.value.scrollTop, i.virtual && !J && (J = requestAnimationFrame(() => {
159
+ J = 0, V.value = F;
160
+ })), m("scroll", e));
161
+ }
162
+ function je() {
163
+ F = 0, V.value = 0, y.value && (y.value.scrollTop = 0);
164
+ }
165
+ Z(q, je), Z(
166
+ () => p.value.length,
167
+ () => {
168
+ if (y.value) {
169
+ const e = Math.max(
170
+ 0,
171
+ p.value.length * A.value - (te.value || j.value)
172
+ );
173
+ i.virtual && F > e && (F = e, V.value = e, y.value.scrollTop = e);
75
174
  }
76
- return !0;
77
- });
78
- }), L = s(() => new Set(d.checkedKeys)), Q = s(() => {
79
- var t;
80
- const e = /* @__PURE__ */ new Set();
81
- for (const l of u.value.values()) {
82
- if (!L.value.has(l.node.id)) continue;
83
- let n = l.parentId;
84
- for (; n; )
85
- L.value.has(n) || e.add(n), n = (t = u.value.get(n)) == null ? void 0 : t.parentId;
86
175
  }
87
- return e;
88
- });
89
- async function N(e) {
90
- var n;
91
- const t = u.value.get(e);
92
- if (!t) return;
93
- if (!f.value.includes(e) && t.node.hasChildren && !((n = t.node.children) != null && n.length) && !Object.prototype.hasOwnProperty.call(C.value, e) && d.loadChildren && !K.value.includes(e)) {
94
- K.value = [...K.value, e], delete M.value[e];
95
- try {
96
- const a = await d.loadChildren(t.node);
97
- C.value = { ...C.value, [e]: a }, c("children-loaded", { node: t.node, children: a });
98
- } catch (a) {
99
- M.value = { ...M.value, [e]: "加载失败,点击重试" }, c("load-error", { node: t.node, error: a });
100
- return;
101
- } finally {
102
- K.value = K.value.filter((a) => a !== e);
176
+ );
177
+ const le = /* @__PURE__ */ new Map();
178
+ function Je(e, a) {
179
+ a instanceof HTMLElement ? le.set(e, a) : le.delete(e);
180
+ }
181
+ async function Be(e) {
182
+ if (u.value) return;
183
+ e.key !== void 0 && (await s.setExpandedKeys([
184
+ .../* @__PURE__ */ new Set([...s.rawExpanded.value, ...s.ancestors(e.key)])
185
+ ]), await _());
186
+ const a = y.value;
187
+ if (!a) return;
188
+ let t = e.top ?? a.scrollTop;
189
+ if (e.key !== void 0) {
190
+ const d = p.value.findIndex((n) => n.key === e.key);
191
+ if (d < 0) return;
192
+ if (i.virtual) {
193
+ const n = d * A.value, c = n + A.value, E = te.value || j.value;
194
+ t = e.align === "top" ? n : e.align === "bottom" ? c - E : n < a.scrollTop ? n : c > a.scrollTop + E ? c - E : a.scrollTop;
195
+ } else {
196
+ const n = le.get(e.key);
197
+ if (n) {
198
+ const c = n.getBoundingClientRect().top - a.getBoundingClientRect().top + a.scrollTop, E = c + n.offsetHeight;
199
+ t = e.align === "top" ? c : e.align === "bottom" ? E - a.clientHeight : c < a.scrollTop ? c : E > a.scrollTop + a.clientHeight ? E - a.clientHeight : a.scrollTop;
200
+ }
103
201
  }
104
202
  }
105
- const l = f.value.includes(e) ? f.value.filter((a) => a !== e) : [...f.value, e];
106
- d.expandedKeys === void 0 && (H.value = l), c("update:expandedKeys", l);
203
+ t = Math.max(0, Number.isFinite(t) ? t + (e.offset ?? 0) : 0), F = t, V.value = t, e.behavior === "smooth" && a.scrollTo ? a.scrollTo({ top: t, behavior: "smooth" }) : a.scrollTop = t, await _();
107
204
  }
108
- const R = s(() => new Set((Array.isArray(d.modelValue) ? d.modelValue : [d.modelValue]).filter((e) => typeof e == "string")));
109
- function q(e) {
110
- d.disabled || e.node.disabled || e.node.selectable === !1 || (c("update:modelValue", d.multiple || Array.isArray(d.modelValue) ? R.value.has(e.node.id) ? [...R.value].filter((t) => t !== e.node.id) : [...R.value, e.node.id] : e.node.id), c("select", e.node), V.value = e.node.id);
205
+ async function L(e) {
206
+ var d, n, c;
207
+ if (u.value) return;
208
+ const a = e ?? (I.value !== null ? I.value : void 0) ?? ((d = $.value[0]) == null ? void 0 : d.key);
209
+ if (a === void 0) {
210
+ (n = Te.value) == null || n.focus();
211
+ return;
212
+ }
213
+ const t = G.value.map.get(a);
214
+ !t || t.disabled || (await Be({ key: a }), !(!ve.value || !p.value.some((E) => E.key === a)) && (I.value = a, await _(), (c = le.get(a)) == null || c.focus({ preventScroll: !!i.virtual })));
111
215
  }
112
- function ne(e) {
113
- const t = [], l = (n) => {
114
- const a = u.value.get(n);
115
- if (a) {
116
- !a.node.disabled && a.node.checkable !== !1 && t.push(n);
117
- for (const o of C.value[n] ?? a.node.children ?? []) l(o.id);
118
- }
216
+ function C(e) {
217
+ return {
218
+ node: e.node,
219
+ key: e.key,
220
+ label: e.label,
221
+ depth: e.depth,
222
+ expanded: b.value.has(e.key) || !!q.value.trim() && i.filterMode !== "highlight",
223
+ selected: ye.value.has(e.key),
224
+ checked: W.value.has(e.key),
225
+ indeterminate: fe.value.has(e.key),
226
+ disabled: u.value || e.disabled,
227
+ loading: he.value.has(e.key),
228
+ leaf: !e.hasChildren
119
229
  };
120
- return l(e), t;
121
230
  }
122
- function Z(e) {
123
- if (d.disabled || e.node.disabled || e.node.checkable === !1) return;
124
- const t = d.checkStrictly ? [e.node.id] : ne(e.node.id), l = new Set(d.checkedKeys), n = !t.every((o) => l.has(o));
125
- for (const o of t)
126
- n ? l.add(o) : l.delete(o);
127
- for (const o of d.checkStrictly ? [] : [...u.value.values()].reverse()) {
128
- if (!o.hasChildren || o.node.disabled || o.node.checkable === !1) continue;
129
- const $ = (C.value[o.node.id] ?? o.node.children ?? []).filter((k) => !k.disabled && k.checkable !== !1).map((k) => k.id);
130
- $.length && $.every((k) => l.has(k)) ? l.add(o.node.id) : l.delete(o.node.id);
131
- }
132
- const a = [...l];
133
- c("update:checkedKeys", a), c("check", a);
231
+ const ne = (e, a) => e instanceof Element && !!e.closest(
232
+ 'button,input,textarea,select,a,[contenteditable="true"],[role="button"]'
233
+ ) && e !== a;
234
+ function Qe(e, a) {
235
+ ne(e.target, e.currentTarget) || u.value || a.disabled || (I.value = a.key, m("node-click", a.node, e), i.selectOnClickNode && pe(a, e), i.checkable && (i.checkOnClickNode || i.checkOnClickLeaf && !a.hasChildren) && ke(
236
+ a.key,
237
+ !W.value.has(a.key),
238
+ !i.checkStrictly,
239
+ e
240
+ ), i.expandOnClickNode && a.hasChildren && z(a.key, !b.value.has(a.key)));
134
241
  }
135
- function T(e) {
136
- const t = g.value;
137
- if (!t.length) return;
138
- const l = t[Math.max(0, Math.min(e, t.length - 1))];
139
- if (V.value = l.node.id, d.virtual && m.value) {
140
- const n = e * D.value, a = n + D.value;
141
- n < m.value.scrollTop ? m.value.scrollTop = n : a > m.value.scrollTop + z.value && (m.value.scrollTop = a - z.value), S.value = m.value.scrollTop;
142
- }
143
- Ke(() => {
144
- var a;
145
- const n = [...((a = m.value) == null ? void 0 : a.querySelectorAll("[data-tree-id]")) || []].find((o) => o.dataset.treeId === l.node.id);
146
- n == null || n.focus();
147
- });
242
+ function Ze(e, a) {
243
+ i.expandOnDoubleClick && !i.expandOnClickNode && !ne(e.target, e.currentTarget) && a.hasChildren && z(a.key, !b.value.has(a.key));
148
244
  }
149
- function ae(e, t) {
150
- const l = g.value.findIndex((n) => n.node.id === t.node.id);
151
- if (e.key === "ArrowDown")
152
- e.preventDefault(), T(l + 1);
153
- else if (e.key === "ArrowUp")
154
- e.preventDefault(), T(l - 1);
155
- else if (e.key === "Home")
156
- e.preventDefault(), T(0);
157
- else if (e.key === "End")
158
- e.preventDefault(), T(g.value.length - 1);
159
- else if (e.key === "ArrowRight")
160
- e.preventDefault(), t.hasChildren && !f.value.includes(t.node.id) ? N(t.node.id) : t.hasChildren && T(l + 1);
161
- else if (e.key === "ArrowLeft") {
162
- if (e.preventDefault(), t.hasChildren && f.value.includes(t.node.id)) N(t.node.id);
163
- else if (t.parentId) {
164
- const n = g.value.findIndex((a) => a.node.id === t.parentId);
165
- T(n);
166
- }
167
- } else e.key === "Enter" ? (e.preventDefault(), q(t)) : e.key === " " && (e.preventDefault(), d.checkable ? Z(t) : q(t));
245
+ function we(e, a) {
246
+ var d, n;
247
+ if (e.isComposing || e.keyCode === 229 || ne(e.target, e.currentTarget) || u.value)
248
+ return;
249
+ const t = $.value.findIndex((c) => c.key === a.key);
250
+ if (["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) {
251
+ e.preventDefault();
252
+ const c = e.key === "Home" ? 0 : e.key === "End" ? $.value.length - 1 : Math.max(
253
+ 0,
254
+ Math.min(
255
+ $.value.length - 1,
256
+ t + (e.key === "ArrowDown" ? 1 : -1)
257
+ )
258
+ );
259
+ L((d = $.value[c]) == null ? void 0 : d.key);
260
+ } else e.key === "ArrowRight" ? (e.preventDefault(), a.hasChildren && !b.value.has(a.key) ? z(a.key) : a.hasChildren && L((n = $.value[t + 1]) == null ? void 0 : n.key)) : e.key === "ArrowLeft" ? (e.preventDefault(), a.hasChildren && b.value.has(a.key) ? z(a.key, !1) : a.parent !== void 0 && L(a.parent)) : e.key === "Enter" ? (e.preventDefault(), pe(a, e)) : e.key === " " ? (e.preventDefault(), i.checkable ? ke(
261
+ a.key,
262
+ !W.value.has(a.key),
263
+ !i.checkStrictly,
264
+ e
265
+ ) : pe(a, e)) : e.key === "Escape" && (e.preventDefault(), f.value ? k() : D.value !== null ? O(e) : i.allowDeselect && s.setSelectedKeys([]));
168
266
  }
169
- const D = s(() => Math.max(24, d.rowHeight)), z = s(() => Math.max(120, d.viewportHeight)), X = s(() => d.virtual ? Math.max(0, Math.floor(S.value / D.value) - 5) : 0), x = s(() => d.virtual ? Math.min(g.value.length, Math.ceil((S.value + z.value) / D.value) + 5) : g.value.length), de = s(() => g.value.slice(X.value, x.value)), oe = s(() => X.value * D.value), ie = s(() => Math.max(0, (g.value.length - x.value) * D.value));
170
- W([b, f], () => {
171
- S.value = 0, m.value && (m.value.scrollTop = 0);
172
- });
173
- function re(e) {
174
- S.value = e.target.scrollTop;
267
+ function _e(e) {
268
+ var a;
269
+ e.key === "Enter" && !e.isComposing && e.keyCode !== 229 ? e.preventDefault() : e.key === "ArrowDown" && !e.isComposing && (e.preventDefault(), L((a = $.value[0]) == null ? void 0 : a.key));
175
270
  }
176
- function ue(e, t) {
177
- var l;
178
- if (!d.draggable || d.disabled || t.node.disabled) {
271
+ const D = g(null), K = g(null), ie = g("inside");
272
+ let N, de, me = null;
273
+ function Q() {
274
+ clearTimeout(de), de = void 0, me = null;
275
+ }
276
+ function oe(e) {
277
+ (e.type === "blur" || e instanceof KeyboardEvent && e.key === "Escape") && O(e);
278
+ }
279
+ function O(e) {
280
+ const a = N;
281
+ D.value = null, K.value = null, N = void 0, Q(), window.removeEventListener("blur", oe), window.removeEventListener("keydown", oe, !0), a && m("node-drag-end", { node: a, event: e });
282
+ }
283
+ function ea(e, a) {
284
+ var t, d;
285
+ if (u.value || !i.draggable || a.disabled || ((t = i.allowDrag) == null ? void 0 : t.call(i, a.node)) === !1 || ne(e.target, e.currentTarget)) {
179
286
  e.preventDefault();
180
287
  return;
181
288
  }
182
- A.value = t.node.id, (l = e.dataTransfer) == null || l.setData("text/plain", t.node.id), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
289
+ O(), D.value = a.key, N = a.node, (d = e.dataTransfer) == null || d.setData("text/plain", String(a.key)), e.dataTransfer && (e.dataTransfer.effectAllowed = "move"), window.addEventListener("blur", oe), window.addEventListener("keydown", oe, !0), m("node-drag-start", { node: a.node, event: e });
290
+ }
291
+ function be(e, a) {
292
+ var d, n;
293
+ const t = D.value;
294
+ return t === null || t === e.key || u.value || !i.draggable || e.disabled || !N || ((d = G.value.map.get(t)) == null ? void 0 : d.node) !== N || s.ancestors(e.key).includes(t) || a === "inside" && e.leaf ? !1 : ((n = i.allowDrop) == null ? void 0 : n.call(i, N, e.node, a)) !== !1;
183
295
  }
184
- function se(e, t) {
185
- if (!d.draggable || !A.value || A.value === t.node.id) return;
186
- const l = u.value.get(A.value);
187
- let n = t;
188
- for (; n; ) {
189
- if (n.node.id === (l == null ? void 0 : l.node.id)) return;
190
- n = n.parentId ? u.value.get(n.parentId) : void 0;
296
+ function aa(e, a) {
297
+ const t = e.currentTarget.getBoundingClientRect(), d = (e.clientY - t.top) / (t.height || 1), n = d < 0.25 ? "before" : d > 0.75 ? "after" : "inside";
298
+ if (!be(a, n)) {
299
+ K.value = null, Q();
300
+ return;
191
301
  }
192
- e.preventDefault();
193
- const a = e.currentTarget.getBoundingClientRect(), o = (e.clientY - a.top) / a.height;
194
- U.value = o < 0.25 ? "before" : o > 0.75 ? "after" : "inside", B.value = t.node.id;
302
+ e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), K.value = a.key, ie.value = n, m("node-drag-over", {
303
+ dragId: D.value,
304
+ targetId: a.key,
305
+ dragNode: N,
306
+ targetNode: a.node,
307
+ position: n,
308
+ event: e
309
+ }), n === "inside" && a.hasChildren && !b.value.has(a.key) && me !== a.key ? (Q(), me = a.key, Number.isFinite(i.dragExpandDelay) && i.dragExpandDelay >= 0 && (de = setTimeout(() => {
310
+ de = void 0, K.value === a.key && be(a, "inside") && z(a.key);
311
+ }, i.dragExpandDelay))) : n !== "inside" && Q();
312
+ }
313
+ function ta(e, a) {
314
+ (!(e.relatedTarget instanceof Node) || !e.currentTarget.contains(e.relatedTarget)) && (K.value === a.key && (K.value = null), Q());
195
315
  }
196
- function ce(e, t) {
197
- B.value !== t.node.id || !A.value || (e.preventDefault(), c("node-drop", { dragId: A.value, targetId: t.node.id, position: U.value }), j());
316
+ function la(e, a) {
317
+ K.value === a.key && be(a, ie.value) && (e.preventDefault(), m("node-drop", {
318
+ dragId: D.value,
319
+ targetId: a.key,
320
+ position: ie.value,
321
+ dragNode: N,
322
+ targetNode: a.node,
323
+ event: e
324
+ })), O(e);
198
325
  }
199
- function j() {
200
- A.value = "", B.value = "";
326
+ Z(
327
+ () => [u.value, i.draggable, i.nodes],
328
+ () => {
329
+ var e;
330
+ (u.value || !i.draggable || D.value !== null && ((e = G.value.map.get(D.value)) == null ? void 0 : e.node) !== N) && O();
331
+ },
332
+ { flush: "sync" }
333
+ );
334
+ const f = va(), se = g(), Ce = g();
335
+ function k(e = !0) {
336
+ f.value = void 0, e && Ce.value !== void 0 && L(Ce.value);
201
337
  }
202
- function ve(e, t) {
203
- d.contextMenu && (e.preventDefault(), h.value = { node: t.node, x: Math.max(0, Math.min(e.clientX, window.innerWidth - 190)), y: Math.max(0, Math.min(e.clientY, window.innerHeight - 130)) }, c("node-contextmenu", { node: t.node, x: e.clientX, y: e.clientY }));
338
+ async function na(e, a) {
339
+ var t, d;
340
+ !i.contextMenu || u.value || a.disabled || (e.preventDefault(), Ce.value = a.key, f.value = {
341
+ node: a.node,
342
+ key: a.key,
343
+ x: Math.max(8, Math.min(e.clientX, window.innerWidth - 230)),
344
+ y: Math.max(8, Math.min(e.clientY, window.innerHeight - 155))
345
+ }, m("node-contextmenu", {
346
+ node: a.node,
347
+ x: e.clientX,
348
+ y: e.clientY,
349
+ event: e
350
+ }), await _(), (d = (t = se.value) == null ? void 0 : t.querySelector('button,[tabindex="0"]')) == null || d.focus());
204
351
  }
205
- function _(e) {
206
- const t = h.value;
207
- if (t) {
208
- if (e === "select") {
209
- const l = u.value.get(t.node.id);
210
- l && q(l);
211
- } else N(t.node.id);
212
- h.value = null;
352
+ function ia(e) {
353
+ var a, t;
354
+ if (e.key === "Escape")
355
+ e.preventDefault(), k();
356
+ else if (e.key === "Tab") k(!1);
357
+ else if (["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) {
358
+ e.preventDefault();
359
+ const d = [
360
+ ...((a = se.value) == null ? void 0 : a.querySelectorAll(
361
+ "[role=menuitem]:not(:disabled)"
362
+ )) ?? []
363
+ ], n = d.indexOf(document.activeElement), c = e.key === "Home" ? 0 : e.key === "End" ? d.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + d.length) % d.length;
364
+ (t = d[c]) == null || t.focus();
213
365
  }
214
366
  }
215
- return fe(() => {
216
- h.value = null, j();
217
- }), ee({ getNode: (e) => {
218
- var t;
219
- return (t = u.value.get(e)) == null ? void 0 : t.node;
220
- }, getCheckedKeys: () => [...d.checkedKeys], setCheckedKeys: (e) => {
221
- c("update:checkedKeys", e), c("check", e);
222
- }, filter: (e) => b.value = e, expandAll: () => {
223
- const e = [...u.value.values()].filter((t) => t.hasChildren).map((t) => t.node.id);
224
- H.value = e, c("update:expandedKeys", e);
225
- }, collapseAll: () => {
226
- H.value = [], c("update:expandedKeys", []);
227
- } }), (e, t) => (r(), v("div", G(I(Y), {
228
- class: ["hys-ui-pf-tree", { "hys-ui-pf-tree-disabled": i.disabled }]
367
+ function da(e) {
368
+ var a;
369
+ (!(e.relatedTarget instanceof Node) || !((a = ae.value) != null && a.contains(e.relatedTarget))) && m("focus", e);
370
+ }
371
+ function oa(e) {
372
+ var a, t;
373
+ e.relatedTarget instanceof Node && ((a = ae.value) != null && a.contains(e.relatedTarget) || (t = se.value) != null && t.contains(e.relatedTarget)) || (m("blur", e), i.validateEvent && U.validate("blur"));
374
+ }
375
+ function Me() {
376
+ O(), k(!1), Ge();
377
+ }
378
+ return Z(u, (e) => {
379
+ e && k(!1);
380
+ }), ya(Me), fa(Me), Ie({
381
+ element: ae,
382
+ getNode: s.getNode,
383
+ getNodeInfo: s.getNodeInfo,
384
+ getCheckedKeys: s.getCheckedKeys,
385
+ getCheckedNodes: s.getCheckedNodes,
386
+ getHalfCheckedKeys: s.getHalfCheckedKeys,
387
+ getHalfCheckedNodes: () => s.checkInfo().halfCheckedNodes,
388
+ setCheckedKeys: s.setCheckedKeys,
389
+ setCheckedNodes: (e, a = !1) => s.setCheckedKeys(
390
+ e.flatMap((t) => {
391
+ var d;
392
+ return ((d = s.getNodeInfo(t)) == null ? void 0 : d.key) ?? [];
393
+ }),
394
+ a
395
+ ),
396
+ setChecked: s.setChecked,
397
+ getCurrentKey: s.getCurrentKey,
398
+ getCurrentNode: s.getCurrentNode,
399
+ getSelectedKeys: () => [...Fe.value],
400
+ setCurrentKey: s.setCurrentKey,
401
+ setCurrentNode: (e, a = !0) => {
402
+ var t;
403
+ return s.setCurrentKey(
404
+ e === null ? null : ((t = s.getNodeInfo(e)) == null ? void 0 : t.key) ?? null,
405
+ a
406
+ );
407
+ },
408
+ setSelectedKeys: s.setSelectedKeys,
409
+ getExpandedKeys: () => [...b.value],
410
+ setExpandedKeys: s.setExpandedKeys,
411
+ expandNode: z,
412
+ expandAll: () => s.setExpandedKeys(
413
+ G.value.rows.filter((e) => e.hasChildren).map((e) => e.key)
414
+ ),
415
+ collapseAll: () => s.setExpandedKeys([]),
416
+ filter: De,
417
+ reloadNode: s.reloadNode,
418
+ updateKeyChildren: s.updateKeyChildren,
419
+ append: s.append,
420
+ insertBefore: s.insertBefore,
421
+ insertAfter: s.insertAfter,
422
+ remove: s.remove,
423
+ scrollTo: Be,
424
+ focus: L
425
+ }), (e, a) => (r(), h("div", M({
426
+ ref_key: "element",
427
+ ref: ae
428
+ }, l(ce), {
429
+ class: ["hys-ui-pf-tree", {
430
+ "hys-ui-pf-tree-disabled": l(ee).disabled.value,
431
+ "hys-ui-tree-inline": !o.blockNode
432
+ }],
433
+ "data-size": l(ee).size.value,
434
+ onFocusin: da,
435
+ onFocusout: oa
229
436
  }), [
230
- i.searchable ? pe((r(), v("input", {
437
+ o.searchable ? (r(), R(xa, {
231
438
  key: 0,
232
- "onUpdate:modelValue": t[0] || (t[0] = (l) => b.value = l),
233
- class: "hys-ui-pf-tree-search",
234
- type: "search",
235
- placeholder: "搜索节点…",
236
- "aria-label": "搜索树节点",
237
- disabled: i.disabled
238
- }, null, 8, Be)), [
239
- [ye, b.value]
240
- ]) : w("", !0),
241
- E("div", {
439
+ ref_key: "search",
440
+ ref: Te,
441
+ class: "hys-ui-tree-search",
442
+ "data-hys-ui-form-internal": "",
443
+ "model-value": l(q),
444
+ placeholder: o.searchPlaceholder || l(v).search,
445
+ "aria-label": l(v).search,
446
+ disabled: l(u),
447
+ size: l(ee).size.value,
448
+ clearable: "",
449
+ "onUpdate:modelValue": l(De),
450
+ onKeydown: _e
451
+ }, {
452
+ prefix: w(() => [
453
+ Y(l(ga), {
454
+ size: 15,
455
+ "aria-hidden": "true"
456
+ })
457
+ ]),
458
+ _: 1
459
+ }, 8, ["model-value", "placeholder", "aria-label", "disabled", "size", "onUpdate:modelValue"])) : x("", !0),
460
+ ue("div", {
242
461
  ref_key: "root",
243
- ref: m,
462
+ ref: y,
463
+ id: l(U).id.value || l(Ve),
244
464
  role: "tree",
245
- "aria-multiselectable": i.multiple || i.checkable || Array.isArray(i.modelValue),
246
- "aria-label": "树形列表",
247
- class: "hys-ui-pf-tree-list",
248
- style: F({ maxHeight: z.value + "px" }),
249
- onScroll: re
465
+ "data-hys-ui-field-managed": "",
466
+ tabindex: l(u) ? -1 : 0,
467
+ onFocus: a[2] || (a[2] = X((t) => L(), ["self"])),
468
+ "aria-label": o.ariaLabel || l(U).label.value || l(v).tree,
469
+ "aria-multiselectable": l(Le) || o.checkable || void 0,
470
+ "aria-disabled": l(u) || void 0,
471
+ "aria-busy": o.loading || l(he).size > 0 || void 0,
472
+ "aria-invalid": l(U).invalid.value || void 0,
473
+ "aria-describedby": l(U).describedBy.value,
474
+ class: He(["hys-ui-pf-tree-list", { "hys-ui-tree-virtual": o.virtual }]),
475
+ style: re({
476
+ maxHeight: j.value + "px",
477
+ height: o.virtual ? j.value + "px" : void 0,
478
+ "--hys-ui-tree-indent": Pe.value + "px",
479
+ "--hys-ui-tree-row-height": A.value + "px"
480
+ }),
481
+ onScroll: We
250
482
  }, [
251
- i.virtual ? (r(), v("div", {
252
- key: 0,
253
- style: F({ height: oe.value + "px" }),
254
- "aria-hidden": "true"
255
- }, null, 4)) : w("", !0),
256
- (r(!0), v(me, null, be(de.value, (l, n) => (r(), v("div", {
257
- key: l.node.id,
258
- class: ge(["hys-ui-pf-tree-row", { "hys-ui-pf-tree-selected": R.value.has(l.node.id), "hys-ui-pf-tree-line": i.showLine, "hys-ui-pf-tree-drop": B.value === l.node.id }]),
259
- role: "treeitem",
260
- "aria-level": l.depth + 1,
261
- "aria-expanded": l.hasChildren ? b.value.trim() ? !0 : f.value.includes(l.node.id) : void 0,
262
- "aria-selected": i.modelValue === l.node.id,
263
- "aria-disabled": i.disabled || l.node.disabled,
264
- "aria-checked": i.checkable ? L.value.has(l.node.id) ? "true" : Q.value.has(l.node.id) ? "mixed" : "false" : void 0,
265
- tabindex: V.value === l.node.id || !V.value && n === 0 && X.value === 0 ? 0 : -1,
266
- draggable: i.draggable && !i.disabled && !l.node.disabled,
267
- "data-tree-id": l.node.id,
268
- onFocus: (a) => V.value = l.node.id,
269
- onKeydown: (a) => ae(a, l),
270
- onClick: (a) => q(l),
271
- onDragstart: (a) => ue(a, l),
272
- onDragover: (a) => se(a, l),
273
- onDrop: (a) => ce(a, l),
274
- onDragend: j,
275
- onContextmenu: (a) => ve(a, l),
276
- "data-drop-position": B.value === l.node.id ? U.value : void 0,
277
- style: F({ "--hys-ui-tree-depth": l.depth, minHeight: i.virtual ? D.value + "px" : void 0, height: i.virtual ? D.value + "px" : void 0 })
483
+ o.loading ? (r(), h("div", Sa, [
484
+ H(e.$slots, "loading", {}, () => [
485
+ Y(l(Ae), {
486
+ size: 18,
487
+ class: "hys-ui-icon-spin",
488
+ "aria-hidden": "true"
489
+ }),
490
+ P(S(l(v).loading), 1)
491
+ ], !0)
492
+ ])) : x("", !0),
493
+ ue("div", {
494
+ class: "hys-ui-tree-space",
495
+ style: re(
496
+ o.virtual ? { height: l(p).length * A.value + "px" } : void 0
497
+ )
278
498
  }, [
279
- l.hasChildren ? (r(), v("button", {
280
- key: 0,
281
- class: "hys-ui-pf-tree-expander",
282
- type: "button",
283
- "aria-label": f.value.includes(l.node.id) ? "折叠" : "展开",
284
- disabled: i.disabled || l.node.disabled || K.value.includes(l.node.id),
285
- onClick: J((a) => N(l.node.id), ["stop"])
499
+ ue("div", {
500
+ class: "hys-ui-tree-rows",
501
+ style: re(
502
+ o.virtual ? {
503
+ position: "absolute",
504
+ top: Ne.value * A.value + "px",
505
+ insetInline: "0"
506
+ } : void 0
507
+ )
286
508
  }, [
287
- K.value.includes(l.node.id) ? (r(), O(I(Se), {
509
+ (r(!0), h(Se, null, ha(qe.value, (t) => {
510
+ var d;
511
+ return r(), h("div", {
512
+ key: typeof t.key + ":" + t.key,
513
+ ref_for: !0,
514
+ ref: (n) => Je(t.key, n),
515
+ class: He(["hys-ui-pf-tree-row", [
516
+ typeof o.nodeClass == "function" ? o.nodeClass(t.node) : o.nodeClass,
517
+ {
518
+ "hys-ui-pf-tree-selected": o.highlightCurrent && l(ye).has(t.key),
519
+ "hys-ui-pf-tree-line": o.showLine,
520
+ "hys-ui-pf-tree-drop": K.value === t.key,
521
+ "hys-ui-tree-matched": l(q).trim() && l(Re).has(t.key),
522
+ "hys-ui-tree-row-disabled": t.disabled,
523
+ "hys-ui-tree-row-dragging": D.value === t.key
524
+ }
525
+ ]]),
526
+ style: re([
527
+ { "--hys-ui-tree-depth": t.depth },
528
+ typeof o.nodeStyle == "function" ? o.nodeStyle(t.node) : o.nodeStyle
529
+ ]),
530
+ role: "treeitem",
531
+ "aria-level": t.depth + 1,
532
+ "aria-posinset": t.pos,
533
+ "aria-setsize": t.size,
534
+ "aria-expanded": t.hasChildren ? C(t).expanded : void 0,
535
+ "aria-selected": o.selectable && t.selectable ? l(ye).has(t.key) : void 0,
536
+ "aria-disabled": l(u) || t.disabled || void 0,
537
+ "aria-checked": o.checkable && t.checkable ? l(fe).has(t.key) ? "mixed" : l(W).has(t.key) : void 0,
538
+ tabindex: !l(u) && Ye.value === t.key ? 0 : -1,
539
+ draggable: o.draggable && !l(u) && !t.disabled && ((d = o.allowDrag) == null ? void 0 : d.call(o, t.node)) !== !1,
540
+ "data-tree-id": t.key,
541
+ "data-tree-key": typeof t.key + ":" + t.key,
542
+ "data-drop-position": K.value === t.key ? ie.value : void 0,
543
+ onFocus: (n) => I.value = t.key,
544
+ onKeydown: (n) => we(n, t),
545
+ onClick: (n) => Qe(n, t),
546
+ onDblclick: (n) => Ze(n, t),
547
+ onDragstart: (n) => ea(n, t),
548
+ onDragover: (n) => aa(n, t),
549
+ onDragleave: (n) => ta(n, t),
550
+ onDrop: (n) => la(n, t),
551
+ onDragend: O,
552
+ onContextmenu: (n) => na(n, t)
553
+ }, [
554
+ t.hasChildren ? (r(), h("button", {
555
+ key: 0,
556
+ type: "button",
557
+ class: "hys-ui-pf-tree-expander",
558
+ "aria-label": (C(t).expanded ? l(v).collapse : l(v).expand) + " " + t.label,
559
+ disabled: l(u) || t.disabled,
560
+ tabindex: "-1",
561
+ onClick: X((n) => l(z)(t.key, !l(b).has(t.key)), ["stop"])
562
+ }, [
563
+ H(e.$slots, "switcher", M({ ref_for: !0 }, C(t)), () => [
564
+ l(he).has(t.key) ? (r(), R(l(Ae), {
565
+ key: 0,
566
+ size: 15,
567
+ class: "hys-ui-icon-spin",
568
+ "aria-hidden": "true"
569
+ })) : (r(), R(ze(C(t).expanded ? l(ma) : l(ba)), {
570
+ key: 1,
571
+ size: 15,
572
+ "aria-hidden": "true"
573
+ }))
574
+ ], !0)
575
+ ], 8, Aa)) : (r(), h("span", Ia, [
576
+ H(e.$slots, "switcher", M({ ref_for: !0 }, C(t)), void 0, !0)
577
+ ])),
578
+ o.checkable && t.checkable ? (r(), R(Ta, {
579
+ key: 2,
580
+ tabindex: -1,
581
+ "model-value": l(W).has(t.key),
582
+ indeterminate: l(fe).has(t.key),
583
+ disabled: l(u) || t.checkboxDisabled,
584
+ "aria-label": l(v).check + " " + t.label,
585
+ onClick: a[0] || (a[0] = X(() => {
586
+ }, ["stop"])),
587
+ "onUpdate:modelValue": (n) => l(ke)(t.key, n, !o.checkStrictly)
588
+ }, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "onUpdate:modelValue"])) : x("", !0),
589
+ o.showIcon && (t.icon || e.$slots.icon) ? (r(), h("span", $a, [
590
+ H(e.$slots, "icon", M({ ref_for: !0 }, C(t)), () => [
591
+ P(S(t.icon), 1)
592
+ ], !0)
593
+ ])) : x("", !0),
594
+ ue("span", Va, [
595
+ H(e.$slots, "node", M({ ref_for: !0 }, C(t)), () => [
596
+ H(e.$slots, "default", M({ ref_for: !0 }, C(t)), () => [
597
+ o.renderContent ? (r(), R(ze(() => o.renderContent(C(t))), { key: 0 })) : (r(), h(Se, { key: 1 }, [
598
+ P(S(t.label), 1)
599
+ ], 64))
600
+ ], !0)
601
+ ], !0)
602
+ ]),
603
+ l(Oe).has(t.key) ? (r(), h("button", {
604
+ key: 4,
605
+ type: "button",
606
+ class: "hys-ui-tree-retry",
607
+ disabled: l(u) || t.disabled,
608
+ onClick: X((n) => l(s).reloadNode(t.key), ["stop"])
609
+ }, S(l(v).loadError) + " · " + S(l(v).retry), 9, Fa)) : x("", !0),
610
+ e.$slots.actions ? (r(), h("span", {
611
+ key: 5,
612
+ class: "hys-ui-tree-actions",
613
+ onClick: a[1] || (a[1] = X(() => {
614
+ }, ["stop"]))
615
+ }, [
616
+ H(e.$slots, "actions", M({ ref_for: !0 }, C(t)), void 0, !0)
617
+ ])) : x("", !0),
618
+ o.draggable ? (r(), R(l(Ca), {
619
+ key: 6,
620
+ class: "hys-ui-tree-grip",
621
+ size: 13,
622
+ "aria-hidden": "true"
623
+ })) : x("", !0)
624
+ ], 46, za);
625
+ }), 128))
626
+ ], 4)
627
+ ], 4),
628
+ !l(p).length && !o.loading ? (r(), h("div", La, [
629
+ H(e.$slots, "empty", { query: l(q) }, () => [
630
+ P(S(l(q).trim() ? l(v).noMatch : o.emptyText || l(v).empty), 1)
631
+ ], !0)
632
+ ])) : x("", !0)
633
+ ], 46, Ha),
634
+ (r(), R(ka, { to: "body" }, [
635
+ f.value ? (r(), h("div", M({ key: 0 }, l(ce), {
636
+ class: "hys-ui-tree-menu-backdrop",
637
+ onClick: a[3] || (a[3] = (t) => k()),
638
+ onContextmenu: a[4] || (a[4] = X((t) => k(), ["prevent"]))
639
+ }), null, 16)) : x("", !0),
640
+ Y(l(pa), {
641
+ "popup-transition": i.popupTransition,
642
+ "popup-transition-duration": i.popupTransitionDuration,
643
+ onInactive: k
644
+ }, {
645
+ default: w(() => [
646
+ f.value ? (r(), h("div", M({
288
647
  key: 0,
289
- size: 15,
290
- "aria-hidden": "true",
291
- class: "hys-ui-icon-spin"
292
- })) : (r(), O(ke(b.value.trim() || f.value.includes(l.node.id) ? I(Te) : I(Ie)), {
293
- key: 1,
294
- size: 15,
295
- "aria-hidden": "true"
296
- }))
297
- ], 8, $e)) : (r(), v("span", Ee)),
298
- i.checkable ? (r(), O(Ae, {
299
- key: 2,
300
- tabindex: -1,
301
- "model-value": L.value.has(l.node.id),
302
- disabled: i.disabled || l.node.disabled || l.node.checkable === !1,
303
- "aria-label": `勾选${l.node.label}`,
304
- indeterminate: Q.value.has(l.node.id),
305
- onClick: t[1] || (t[1] = J(() => {
306
- }, ["stop"])),
307
- onChange: (a) => Z(l)
308
- }, null, 8, ["model-value", "disabled", "aria-label", "indeterminate", "onChange"])) : w("", !0),
309
- l.node.icon ? (r(), v("span", Le, P(l.node.icon), 1)) : w("", !0),
310
- we(e.$slots, "node", {
311
- node: l.node,
312
- depth: l.depth,
313
- expanded: f.value.includes(l.node.id),
314
- selected: i.modelValue === l.node.id
315
- }, () => [
316
- E("span", Ne, P(l.node.label), 1)
317
- ], !0),
318
- M.value[l.node.id] ? (r(), v("span", Re, P(M.value[l.node.id]), 1)) : w("", !0)
319
- ], 46, He))), 128)),
320
- i.virtual ? (r(), v("div", {
321
- key: 1,
322
- style: F({ height: ie.value + "px" }),
323
- "aria-hidden": "true"
324
- }, null, 4)) : w("", !0),
325
- g.value.length ? w("", !0) : (r(), v("div", qe, P(b.value ? "无匹配节点" : "暂无数据"), 1))
326
- ], 44, Ve),
327
- (r(), O(Ce, { to: "body" }, [
328
- h.value ? (r(), v("div", G({ key: 0 }, I(Y), {
329
- class: "hys-ui-pf-tree-context",
330
- style: { left: h.value.x + "px", top: h.value.y + "px" },
331
- role: "menu",
332
- onKeydown: t[5] || (t[5] = De((l) => h.value = null, ["esc"]))
333
- }), [
334
- E("button", {
335
- type: "button",
336
- role: "menuitem",
337
- onClick: t[2] || (t[2] = (l) => _("select"))
338
- }, "选择节点"),
339
- E("button", {
340
- type: "button",
341
- role: "menuitem",
342
- onClick: t[3] || (t[3] = (l) => _("expand"))
343
- }, "展开 / 折叠"),
344
- E("button", {
345
- type: "button",
346
- role: "menuitem",
347
- onClick: t[4] || (t[4] = (l) => h.value = null)
348
- }, "关闭")
349
- ], 16)) : w("", !0),
350
- h.value ? (r(), v("div", G({ key: 1 }, I(Y), {
351
- class: "hys-ui-pf-tree-context-backdrop",
352
- onClick: t[6] || (t[6] = (l) => h.value = null),
353
- onContextmenu: t[7] || (t[7] = J((l) => h.value = null, ["prevent"]))
354
- }), null, 16)) : w("", !0)
648
+ ref_key: "menuPanel",
649
+ ref: se
650
+ }, l(ce), {
651
+ class: "hys-ui-tree-context",
652
+ style: { left: f.value.x + "px", top: f.value.y + "px" },
653
+ role: "menu",
654
+ onKeydown: ia
655
+ }), [
656
+ H(e.$slots, "contextmenu", {
657
+ node: f.value.node,
658
+ key: f.value.key,
659
+ close: k
660
+ }, () => {
661
+ var t;
662
+ return [
663
+ Y(xe, {
664
+ role: "menuitem",
665
+ variant: "ghost",
666
+ disabled: l(u),
667
+ onClick: a[5] || (a[5] = (d) => {
668
+ l(s).setCurrentKey(f.value.key), k();
669
+ })
670
+ }, {
671
+ default: w(() => [
672
+ P(S(l(v).select), 1)
673
+ ]),
674
+ _: 1
675
+ }, 8, ["disabled"]),
676
+ Y(xe, {
677
+ role: "menuitem",
678
+ variant: "ghost",
679
+ disabled: l(u) || !((t = l(G).map.get(f.value.key)) != null && t.hasChildren),
680
+ onClick: a[6] || (a[6] = (d) => {
681
+ l(z)(f.value.key, !l(b).has(f.value.key)), k();
682
+ })
683
+ }, {
684
+ default: w(() => [
685
+ P(S(l(b).has(f.value.key) ? l(v).collapse : l(v).expand), 1)
686
+ ]),
687
+ _: 1
688
+ }, 8, ["disabled"]),
689
+ Y(xe, {
690
+ role: "menuitem",
691
+ variant: "ghost",
692
+ onClick: a[7] || (a[7] = (d) => k())
693
+ }, {
694
+ default: w(() => [
695
+ P(S(l(v).close), 1)
696
+ ]),
697
+ _: 1
698
+ })
699
+ ];
700
+ }, !0)
701
+ ], 16)) : x("", !0)
702
+ ]),
703
+ _: 3
704
+ }, 8, ["popup-transition", "popup-transition-duration"])
355
705
  ]))
356
- ], 16));
706
+ ], 16, Ma));
357
707
  }
358
708
  });
359
709
  export {
360
- Ye as default
710
+ ja as default
361
711
  };