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,800 +1,1256 @@
1
- import { defineComponent as Mt, ref as v, watch as K, computed as b, nextTick as Ke, onDeactivated as Vt, onBeforeUnmount as Dt, openBlock as s, createElementBlock as u, mergeProps as Kt, unref as F, createElementVNode as g, createVNode as m, createTextVNode as H, createCommentVNode as k, withCtx as z, toDisplayString as E, Fragment as B, normalizeStyle as X, normalizeClass as ue, renderList as de, withModifiers as A, createBlock as ce, withKeys as ve, resolveDynamicComponent as qe, renderSlot as At } from "vue";
2
- import { useHysRootAttrs as Rt } from "../../config.js";
3
- import { Settings2 as Lt, ChevronUp as Et, ChevronDown as Ae, Search as Bt, ChevronRight as We } from "lucide-vue-next";
4
- import { useMotion as Tt } from "../../motion/useMotion.js";
5
- import Ut from "../HysSortableList/HysSortableList.vue.js";
6
- import Ie from "../HysSelect/HysSelect.vue.js";
7
- import ze from "../HysInput/HysInput.vue.js";
8
- import Re from "../HysCheckbox/HysCheckbox.vue.js";
9
- import M from "../HysButton/HysButton.vue.js";
10
- import $t from "../HysPagination/HysPagination.vue.js";
11
- const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-search" }, Nt = {
1
+ import { defineComponent as xa, ref as w, useId as Vt, computed as c, shallowRef as Me, watch as L, onMounted as za, onDeactivated as Ra, onBeforeUnmount as Ma, openBlock as s, createElementBlock as u, mergeProps as Ta, unref as m, createElementVNode as y, createVNode as g, createTextVNode as V, createCommentVNode as h, withCtx as z, toDisplayString as O, createBlock as D, normalizeStyle as $, normalizeClass as ve, Fragment as N, renderList as ye, withModifiers as q, withKeys as nt, renderSlot as $e, resolveDynamicComponent as Dt, nextTick as pe } from "vue";
2
+ import { Settings2 as Ea, ChevronUp as Ka, ChevronDown as it, Search as Aa, ChevronRight as Ft } from "lucide-vue-next";
3
+ import { useHysRootAttrs as Va } from "../../config.js";
4
+ import Da from "../../motion/PopupMotion.js";
5
+ import { useMotion as Fa } from "../../motion/useMotion.js";
6
+ import { gridRows as La, gridValue as me, gridTree as Oa, gridToken as st, positiveInteger as Te, gridKey as Na } from "../../composables/dataGrid.js";
7
+ import { useDataGridRemote as qa } from "../../composables/useDataGridRemote.js";
8
+ import Ba from "../HysSortableList/HysSortableList.vue.js";
9
+ import Lt from "../HysSelect/HysSelect.vue.js";
10
+ import Ie from "../HysInput/HysInput.vue.js";
11
+ import rt from "../HysCheckbox/HysCheckbox.vue.js";
12
+ import Ha from "../HysRadio/HysRadio.vue.js";
13
+ import T from "../HysButton/HysButton.vue.js";
14
+ import Ua from "../HysPagination/HysPagination.vue.js";
15
+ const $a = ["aria-busy"], Ia = { class: "hys-ui-pf-grid-toolbar" }, ja = { class: "hys-ui-pf-grid-search" }, Pa = {
12
16
  key: 0,
13
17
  class: "hys-ui-pf-grid-group-label"
14
- }, Ot = {
18
+ }, Qa = {
15
19
  key: 1,
16
20
  class: "hys-ui-pf-grid-batch"
17
- }, Pt = { class: "hys-ui-pf-grid-count" }, jt = {
21
+ }, Wa = { class: "hys-ui-pf-grid-count" }, Ja = {
18
22
  key: 0,
19
23
  class: "hys-ui-pf-grid-panel"
20
- }, qt = {
24
+ }, Xa = {
21
25
  key: 0,
22
26
  style: { width: "44px" }
23
- }, Wt = {
27
+ }, Ga = {
24
28
  key: 0,
25
29
  scope: "col",
26
30
  class: "hys-ui-pf-grid-select-col"
27
- }, It = ["data-column-key", "data-drop-position", "draggable", "onDragstart", "onDragover", "onDrop", "aria-sort"], Xt = { class: "hys-ui-pf-grid-head" }, Gt = { class: "hys-ui-pf-grid-sort-group" }, Jt = { class: "hys-ui-pf-grid-sort-label" }, Qt = ["aria-label"], Yt = ["aria-label", "onPointerdown", "onKeydown"], Zt = {
31
+ }, Ya = { key: 1 }, Za = ["data-column-key", "data-drop-position", "draggable", "onDragstart", "onDragover", "onDrop", "aria-sort"], _a = { class: "hys-ui-pf-grid-head" }, el = { class: "hys-ui-pf-grid-sort-group" }, tl = { class: "hys-ui-pf-grid-sort-label" }, al = ["aria-label"], ll = ["aria-label", "onPointerdown", "aria-valuemin", "aria-valuemax", "aria-valuenow", "onKeydown"], ol = ["id"], nl = {
28
32
  key: 0,
29
33
  class: "hys-ui-pf-grid-select-col"
30
- }, _t = ["data-filter-key", "data-column-key"], el = { key: 0 }, tl = ["colspan"], ll = {
34
+ }, il = ["data-filter-key", "data-column-key"], sl = { key: 0 }, rl = ["colspan"], ul = { role: "status" }, dl = { key: 1 }, cl = ["colspan"], fl = {
31
35
  key: 0,
32
36
  class: "hys-ui-pf-grid-group-row"
33
- }, al = ["colspan"], nl = ["onClick"], ol = {
37
+ }, vl = ["colspan"], yl = ["data-grid-row", "onClick"], pl = {
34
38
  key: 0,
35
39
  class: "hys-ui-pf-grid-select-col"
36
- }, sl = ["data-column-key", "title"], rl = ["onDblclick"], il = { key: 0 }, ul = ["colspan"], dl = { key: 0 }, cl = { class: "hys-ui-pf-grid-summary-row" }, fl = {
40
+ }, ml = ["data-column-key", "title"], gl = ["onDblclick"], hl = { key: 0 }, kl = ["colspan"], bl = { key: 0 }, wl = { class: "hys-ui-pf-grid-summary-row" }, Sl = {
37
41
  key: 0,
38
42
  class: "hys-ui-pf-grid-select-col"
39
- }, yl = ["data-column-key"], vl = { class: "hys-ui-pf-grid-footer" }, Xe = 160, Ml = /* @__PURE__ */ Mt({
43
+ }, Cl = ["data-column-key"], xl = { class: "hys-ui-pf-grid-footer" }, Bl = /* @__PURE__ */ xa({
40
44
  __name: "HysDataGrid",
41
45
  props: {
42
46
  columns: {},
43
47
  rows: {},
44
- rowKey: { default: "id" },
45
- pageSize: { default: 10 },
48
+ rowKey: { type: [String, Function], default: "id" },
49
+ page: {},
50
+ pageSize: {},
51
+ query: {},
52
+ defaultQuery: {},
53
+ immediateQuery: { type: Boolean },
54
+ serverMode: { type: Boolean },
55
+ loadRows: {},
56
+ totalRows: {},
46
57
  storageKey: {},
47
58
  selectable: { type: Boolean, default: !0 },
48
- loading: { type: Boolean, default: !1 },
59
+ rowSelectable: {},
60
+ selectedRowKeys: {},
61
+ defaultSelectedRowKeys: {},
62
+ reserveSelection: { type: Boolean, default: void 0 },
63
+ selectionType: { default: "checkbox" },
64
+ loading: { type: Boolean },
49
65
  emptyText: { default: "暂无数据" },
50
66
  density: { default: "normal" },
51
- serverMode: { type: Boolean },
52
- totalRows: {},
53
- page: {},
54
67
  multiSort: { type: Boolean },
55
68
  stickyHeader: { type: Boolean },
69
+ maxHeight: {},
70
+ scrollToTopOnQuery: { type: Boolean },
56
71
  groupable: { type: Boolean },
57
72
  showSummary: { type: Boolean },
73
+ summaryMethod: {},
58
74
  treeMode: { type: Boolean },
59
75
  parentKey: { default: "parentId" },
60
- editable: { type: Boolean }
76
+ editable: { type: Boolean },
77
+ popupTransition: {},
78
+ popupTransitionDuration: {}
61
79
  },
62
- emits: ["rowClick", "selectionChange", "columnsChange", "sortChange", "pageChange", "queryChange", "pageSizeChange", "cellEdit", "batchEdit"],
63
- setup(r, { expose: Ge, emit: Je }) {
64
- const Qe = Rt(), o = r, V = Je, N = (() => {
65
- if (!o.storageKey || typeof localStorage > "u") return {};
66
- try {
67
- const t = JSON.parse(localStorage.getItem("hys-ui-grid:" + o.storageKey) || "{}");
68
- return t && typeof t == "object" && !Array.isArray(t) ? t : {};
69
- } catch {
70
- return {};
80
+ emits: ["rowClick", "selectionChange", "update:selectedRowKeys", "columnsChange", "sortChange", "pageChange", "pageSizeChange", "update:query", "queryChange", "loadError", "cellEdit", "batchEdit"],
81
+ setup(v, { expose: Ot, emit: Nt }) {
82
+ const i = v, x = Nt, qt = Va(), te = w(null), ge = w(null), je = w(null), I = w(!1), j = w(!1), ae = w(), ut = Vt(), Bt = Vt(), F = c(
83
+ () => new Map(i.columns.map((e) => [e.key, e]))
84
+ );
85
+ function le(e) {
86
+ const a = [], t = /* @__PURE__ */ new Set();
87
+ for (const o of e.sort ?? []) {
88
+ const n = F.value.get(o.key);
89
+ if (!(!n || n.sortable === !1 || t.has(o.key)) && !(o.direction !== "asc" && o.direction !== "desc") && (t.add(o.key), a.push({ key: o.key, direction: o.direction }), !i.multiSort))
90
+ break;
71
91
  }
72
- })(), Ye = Array.isArray(N.order) ? N.order.filter((t) => typeof t == "string") : [], Ze = Array.isArray(N.hidden) ? N.hidden.filter((t) => typeof t == "string") : [], _e = N.widths && typeof N.widths == "object" && !Array.isArray(N.widths) ? Object.fromEntries(Object.entries(N.widths).filter((t) => typeof t[1] == "number" && Number.isFinite(t[1]))) : {}, D = v(Ye), w = v(Ze), p = v(_e), te = v(null), O = v([]), me = v(Math.max(1, o.pageSize)), P = v({}), le = v(""), G = v(""), J = v([]), Q = v(null), ge = v(""), fe = v(""), pe = v(""), j = v([]), C = v(1), h = v([]), Y = v(!1), Me = v(null), he = v(null);
73
- K(() => o.columns, () => {
74
- if (!o.columns.length) return;
75
- const t = o.columns.map((l) => l.key);
76
- D.value = [.../* @__PURE__ */ new Set([...D.value.filter((l) => t.includes(l)), ...t])], w.value = [...new Set(w.value.filter((l) => o.columns.some((e) => e.key === l && e.hideable !== !1)))], t.every((l) => w.value.includes(l)) && (w.value = []), p.value = Object.fromEntries(o.columns.filter((l) => p.value[l.key] != null).map((l) => [
77
- l.key,
78
- Math.max(l.minWidth || 80, Math.min(l.maxWidth || 800, p.value[l.key]))
79
- ]));
80
- }, { immediate: !0, deep: !0 });
81
- function Le() {
82
- if (!(!o.storageKey || typeof localStorage > "u"))
83
- try {
84
- localStorage.setItem("hys-ui-grid:" + o.storageKey, JSON.stringify({ order: D.value, hidden: w.value, widths: p.value }));
85
- } catch {
86
- }
92
+ const l = Object.fromEntries(
93
+ Object.entries(e.filters ?? {}).filter(([o, n]) => {
94
+ const r = F.value.get(o);
95
+ return r && r.filterable !== !1 && typeof n == "string" && n !== "";
96
+ })
97
+ );
98
+ return {
99
+ page: Te(e.page, 1),
100
+ pageSize: Te(e.pageSize, 10),
101
+ sort: a,
102
+ search: e.search ?? "",
103
+ filters: l
104
+ };
87
105
  }
88
- Le(), K([D, w, p], () => {
89
- Le(), V("columnsChange", R.value.map((t) => t.key));
90
- }, { deep: !0 });
91
- const R = b(() => {
92
- const l = [.../* @__PURE__ */ new Set([...D.value, ...o.columns.map((e) => e.key)])].filter((e) => !w.value.includes(e)).map((e) => o.columns.find((a) => a.key === e)).filter((e) => !!e);
93
- return l.length ? l : o.columns;
94
- });
95
- Ge({ resetColumns: je });
96
- const L = b(() => [...R.value.filter((t) => t.pinned === "left"), ...R.value.filter((t) => !t.pinned), ...R.value.filter((t) => t.pinned === "right")]), ae = v(!1);
97
- async function et(t) {
106
+ const dt = () => {
98
107
  var e, a;
99
- ae.value = !0, await Ke();
100
- const l = Array.from(((e = he.value) == null ? void 0 : e.querySelectorAll("[data-filter-key]")) || []).find((n) => n.dataset.filterKey === t.key);
101
- (a = l == null ? void 0 : l.querySelector("input")) == null || a.focus({ preventScroll: !0 });
102
- }
103
- const tt = b(() => [.../* @__PURE__ */ new Set([...D.value, ...o.columns.map((t) => t.key)])].flatMap((t) => {
104
- const l = o.columns.find((e) => e.key === t);
105
- return l ? [{ id: t, label: l.label }] : [];
106
- })), lt = b(() => L.value.reduce((t, l) => t + (p.value[l.key] || l.width || 160), o.selectable ? 44 : 0)), at = b(() => {
107
- const t = {};
108
- let l = o.selectable ? 44 : 0;
109
- for (const a of L.value.filter((n) => n.pinned === "left"))
110
- t[a.key] = { left: l + "px" }, l += p.value[a.key] || a.width || 160;
111
- let e = 0;
112
- for (const a of [...L.value].reverse().filter((n) => n.pinned === "right"))
113
- t[a.key] = { right: e + "px" }, e += p.value[a.key] || a.width || 160;
114
- return t;
115
- }), ke = (t) => t.pinned ? { position: "sticky", ...at.value[t.key], zIndex: 2, background: "var(--hys-ui-surface,var(--hys-ui-theme-surface,#fff))" } : {}, ne = b(() => Math.max(1, me.value));
116
- K(() => o.pageSize, (t) => me.value = Math.max(1, t)), K(() => o.page, (t) => {
117
- t != null && (C.value = Math.max(1, t));
118
- });
119
- const x = b(() => o.multiSort ? O.value : te.value ? [te.value] : []), oe = (t, l) => t[l] == null ? "" : String(t[l]), q = b(() => {
120
- if (o.serverMode) return o.rows;
121
- const t = le.value.trim().toLocaleLowerCase();
122
- let l = o.rows.filter((e) => (!t || o.columns.some((a) => oe(e, a.key).toLocaleLowerCase().includes(t))) && Object.entries(P.value).every(([a, n]) => !n || oe(e, a).toLocaleLowerCase().includes(n.toLocaleLowerCase())));
123
- return x.value.length && (l = [...l].sort((e, a) => {
124
- for (const { key: n, direction: d } of x.value) {
125
- const i = e[n], y = a[n], f = typeof i == "number" && typeof y == "number" ? i - y : String(i ?? "").localeCompare(String(y ?? ""), "zh-CN", { numeric: !0 });
126
- if (f) return d === "asc" ? f : -f;
108
+ return le({
109
+ ...i.defaultQuery,
110
+ page: i.page ?? ((e = i.defaultQuery) == null ? void 0 : e.page),
111
+ pageSize: i.pageSize ?? ((a = i.defaultQuery) == null ? void 0 : a.pageSize)
112
+ });
113
+ }, P = Me(dt()), oe = c(
114
+ () => le(i.query ?? P.value)
115
+ ), S = c(() => oe.value.sort), Pe = c({
116
+ get: () => oe.value.search,
117
+ set: (e) => J({ search: e, page: 1 })
118
+ }), Ee = c(() => oe.value.filters), ct = (e) => Object.hasOwn(Ee.value, e) ? Ee.value[e] : "", Q = c(() => oe.value.pageSize), ne = c(() => i.serverMode || !!i.loadRows), he = w(""), ie = Me(/* @__PURE__ */ new Set()), se = Me(/* @__PURE__ */ new Set()), W = w(null), Ke = w(""), ke = w(""), Ae = w(""), Ht = new Intl.Collator("zh-CN", { numeric: !0 }), ee = c(() => ({
119
+ ...oe.value,
120
+ page: Math.min(oe.value.page, Je.value)
121
+ })), {
122
+ pending: Ut,
123
+ failure: Ve,
124
+ reload: $t,
125
+ sourceRows: ft,
126
+ remoteTotal: De
127
+ } = qa(i, ee, (e) => x("loadError", e)), Fe = c(() => i.loading || Ut.value), vt = c(
128
+ () => La(
129
+ ft.value,
130
+ i.rowKey,
131
+ ne.value ? (ee.value.page - 1) * Q.value : 0
132
+ )
133
+ ), re = (e, a) => String(me(e, a) ?? ""), be = c(() => {
134
+ const e = vt.value;
135
+ if (ne.value) return e;
136
+ const a = Pe.value.trim().toLocaleLowerCase(), t = Object.entries(Ee.value).flatMap(
137
+ ([o, n]) => {
138
+ const r = F.value.get(o);
139
+ return r ? [{ column: r, value: n, term: n.toLocaleLowerCase() }] : [];
140
+ }
141
+ ), l = e.filter(
142
+ ({ row: o }) => (!a || i.columns.some(
143
+ (n) => re(o, n).toLocaleLowerCase().includes(a)
144
+ )) && t.every(
145
+ (n) => n.column.filterMethod ? n.column.filterMethod(n.value, o) : re(o, n.column).toLocaleLowerCase().includes(n.term)
146
+ )
147
+ );
148
+ return S.value.length ? l.sort((o, n) => {
149
+ for (const { key: r, direction: f } of S.value) {
150
+ const k = F.value.get(r), _ = me(o.row, k), d = me(n.row, k), M = k.sortMethod ? k.sortMethod(o.row, n.row) : typeof _ == "number" && typeof d == "number" ? _ - d : Ht.compare(String(_ ?? ""), String(d ?? ""));
151
+ if (M) return f === "asc" ? M : -M;
127
152
  }
128
153
  return 0;
129
- })), l;
130
- }), Ee = b(() => Math.max(1, Math.ceil((o.serverMode ? o.totalRows ?? o.rows.length : q.value.length) / ne.value)));
131
- K([le, P, te, O, () => o.pageSize], () => {
132
- C.value = 1;
133
- }, { deep: !0 }), K(Ee, (t) => {
134
- C.value = Math.min(C.value, t);
135
- });
136
- const Be = b(() => {
137
- if (!o.treeMode) return q.value;
138
- const t = q.value, l = new Set(t.map((i) => i[o.rowKey])), e = /* @__PURE__ */ new Map();
139
- for (const i of t) {
140
- const y = i[o.parentKey], f = y != null && l.has(y) ? y : null, ee = e.get(f) || [];
141
- ee.push(i), e.set(f, ee);
142
- }
143
- const a = [], n = /* @__PURE__ */ new Set(), d = (i, y) => {
144
- if (!n.has(i) && (n.add(i), a.push({ ...i, __pfDepth: y, __pfHasChildren: (e.get(i[o.rowKey]) || []).length > 0 }), J.value.includes(i[o.rowKey])))
145
- for (const f of e.get(i[o.rowKey]) || []) d(f, y + 1);
146
- };
147
- for (const i of e.get(null) || []) d(i, 0);
148
- for (const i of t) n.has(i) || d(i, 0);
149
- return a;
150
- }), be = b(() => o.serverMode ? Be.value : Be.value.slice((C.value - 1) * ne.value, C.value * ne.value)), Z = (t, l) => {
151
- const e = t[o.rowKey];
152
- return typeof e == "string" || typeof e == "number" ? e : l + (C.value - 1) * ne.value;
153
- };
154
- K(() => o.rows, (t) => {
155
- if (!o.serverMode) {
156
- const l = new Set(t.map((a, n) => {
157
- const d = a[o.rowKey];
158
- return typeof d == "string" || typeof d == "number" ? d : n;
159
- })), e = h.value.filter((a) => l.has(a));
160
- e.length !== h.value.length && (h.value = e, V("selectionChange", e));
154
+ }) : l;
155
+ }), Qe = c(
156
+ () => i.treeMode ? Oa(be.value, i.parentKey, ie.value) : be.value.map((e) => ({ ...e, depth: 0, hasChildren: !1 }))
157
+ ), We = c(
158
+ () => ne.value ? Math.max(
159
+ 0,
160
+ Math.floor(
161
+ Number.isFinite(De.value) ? De.value : ft.value.length
162
+ )
163
+ ) : Qe.value.length
164
+ ), Je = c(
165
+ () => i.loadRows && De.value === void 0 ? Number.MAX_SAFE_INTEGER : Math.max(1, Math.ceil(We.value / Q.value))
166
+ ), ue = c(() => ee.value.page), Xe = c(
167
+ () => ne.value ? Qe.value : Qe.value.slice(
168
+ (ue.value - 1) * Q.value,
169
+ ue.value * Q.value
170
+ )
171
+ ), It = c(() => be.value.map((e) => e.row)), we = () => le(ee.value);
172
+ function J(e) {
173
+ const a = le({ ...ee.value, ...e });
174
+ JSON.stringify(a) !== JSON.stringify(ee.value) && (i.query === void 0 && (P.value = a), x("update:query", le(a)));
175
+ }
176
+ function jt() {
177
+ J(dt());
178
+ }
179
+ function Ge() {
180
+ i.loadRows ? $t() : x("queryChange", we());
181
+ }
182
+ function Pt(e, a) {
183
+ J({ filters: { ...Ee.value, [e]: a }, page: 1 });
184
+ }
185
+ L(
186
+ [() => i.page, () => i.pageSize],
187
+ ([e, a], [t, l]) => {
188
+ const o = P.value;
189
+ P.value = le({
190
+ ...o,
191
+ page: e !== t ? e : a !== l ? 1 : o.page,
192
+ pageSize: a !== l ? a : o.pageSize
193
+ });
161
194
  }
195
+ ), L([Je, () => P.value.page], ([e]) => {
196
+ i.query === void 0 && P.value.page > e && (P.value = { ...P.value, page: e });
197
+ }), L(
198
+ () => JSON.stringify(ee.value),
199
+ () => {
200
+ W.value = null, i.scrollToTopOnQuery && ge.value && (ge.value.scrollTop = 0), x("queryChange", we());
201
+ },
202
+ { flush: "post" }
203
+ ), za(() => {
204
+ i.immediateQuery && x("queryChange", we());
162
205
  });
163
- const Te = b(() => o.columns.filter((t) => t.key !== o.rowKey)), nt = (t) => t == null || t === "" ? "(空)" : String(t), ot = (t) => JSON.stringify(t ?? null), st = b(() => {
164
- if (!G.value) return be.value.map((e, a) => ({ kind: "row", row: e, index: a, key: String(Z(e, a)) }));
206
+ let Ye = !1;
207
+ async function Qt(e) {
208
+ if (Ye) return;
209
+ const a = ue.value;
210
+ J({ page: Math.min(e, Je.value) }), await pe(), ue.value !== a && x("pageChange", ue.value);
211
+ }
212
+ async function Wt(e) {
213
+ const a = Q.value;
214
+ Ye = !0, J({ pageSize: e, page: 1 }), await pe(), Ye = !1, Q.value !== a && x("pageSizeChange", Q.value);
215
+ }
216
+ async function yt(e, a) {
217
+ if (e.sortable === !1) return;
218
+ const t = JSON.stringify(S.value), l = i.multiSort ? S.value.filter((o) => o.key !== e.key) : [];
219
+ a && l.push({ key: e.key, direction: a }), J({ sort: l, page: 1 }), await pe(), JSON.stringify(S.value) !== t && x("sortChange", S.value[0] ?? null);
220
+ }
221
+ function Jt(e) {
222
+ var t;
223
+ const a = (t = S.value.find(
224
+ (l) => l.key === e.key
225
+ )) == null ? void 0 : t.direction;
226
+ yt(
227
+ e,
228
+ a === "asc" ? "desc" : a === "desc" ? null : "asc"
229
+ );
230
+ }
231
+ function pt(e, a) {
232
+ var l;
233
+ const t = (l = S.value.find(
234
+ (o) => o.key === e.key
235
+ )) == null ? void 0 : l.direction;
236
+ yt(e, t === a ? null : a);
237
+ }
238
+ const Xt = c(
239
+ () => i.columns.filter((e) => e.key !== i.rowKey)
240
+ );
241
+ function Gt(e, a) {
242
+ try {
243
+ return "group:" + JSON.stringify(e ?? null);
244
+ } catch {
245
+ return "group:" + typeof e + ":" + a;
246
+ }
247
+ }
248
+ const Yt = c(() => {
249
+ const e = Xe.value.map((o, n) => ({
250
+ kind: "row",
251
+ key: "row:" + st(o.id),
252
+ item: o,
253
+ pageIndex: n
254
+ })), a = F.value.get(he.value);
255
+ if (!a) return e;
165
256
  const t = /* @__PURE__ */ new Map();
166
- be.value.forEach((e, a) => {
167
- const n = ot(e[G.value]);
168
- t.has(n) || t.set(n, { label: nt(e[G.value]), rows: [] }), t.get(n).rows.push({ row: e, index: a });
169
- });
257
+ for (const o of e) {
258
+ const n = me(o.item.row, a), r = n == null || n === "" ? "(空)" : String(n), f = Gt(n, r), k = t.get(f);
259
+ k ? k.rows.push(o) : t.set(f, { label: r, rows: [o] });
260
+ }
170
261
  const l = [];
171
- for (const [e, a] of t)
172
- if (l.push({ kind: "group", key: e, label: a.label, count: a.rows.length }), !j.value.includes(e)) for (const n of a.rows) l.push({ kind: "row", key: e + ":" + String(Z(n.row, n.index)), row: n.row, index: n.index });
262
+ for (const [o, n] of t)
263
+ l.push({
264
+ kind: "group",
265
+ key: o,
266
+ label: n.label,
267
+ count: n.rows.length
268
+ }), se.value.has(o) || l.push(...n.rows);
173
269
  return l;
174
270
  });
175
- function rt(t) {
176
- J.value = J.value.includes(t) ? J.value.filter((l) => l !== t) : [...J.value, t];
177
- }
178
- function it(t, l) {
179
- !o.editable || !l.editable || (Q.value = { id: Z(t, 0), key: l.key }, ge.value = oe(t, l.key));
180
- }
181
- function Ue(t, l) {
182
- Q.value && (V("cellEdit", { row: t, rowKey: Q.value.id, column: l.key, value: ge.value }), Q.value = null);
183
- }
184
- function ut() {
185
- !fe.value || !h.value.length || (V("batchEdit", { keys: [...h.value], column: fe.value, value: pe.value }), pe.value = "");
186
- }
187
- function dt(t) {
188
- j.value = j.value.includes(t) ? j.value.filter((l) => l !== t) : [...j.value, t];
189
- }
190
- K(G, () => j.value = []);
191
- const ct = (t) => {
192
- if (!t.summary) return "";
193
- const l = q.value.map((n) => n[t.key]).filter((n) => n != null && n !== "");
194
- if (t.summary === "count") return String(l.length);
195
- const e = l.map(Number).filter(Number.isFinite);
196
- if (!e.length) return "—";
197
- const a = t.summary === "sum" ? e.reduce((n, d) => n + d, 0) : t.summary === "avg" ? e.reduce((n, d) => n + d, 0) / e.length : t.summary === "min" ? Math.min(...e) : Math.max(...e);
198
- return new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 2 }).format(a);
199
- }, we = b(() => be.value.map((t, l) => Z(t, l))), $e = b(() => we.value.length > 0 && we.value.every((t) => h.value.includes(t))), ft = b(() => we.value.some((t) => h.value.includes(t)));
200
- function yt(t, l) {
201
- h.value = l ? [.../* @__PURE__ */ new Set([...h.value, t])] : h.value.filter((e) => e !== t), V("selectionChange", h.value);
202
- }
203
- function vt(t) {
204
- const l = new Set(we.value);
205
- h.value = t ? [.../* @__PURE__ */ new Set([...h.value, ...l])] : h.value.filter((e) => !l.has(e)), V("selectionChange", h.value);
206
- }
207
- function Fe(t, l) {
208
- if (t.sortable === !1) return;
209
- const e = l ? { key: t.key, direction: l } : null;
210
- o.multiSort ? (O.value = O.value.filter((a) => a.key !== t.key), e && (O.value = [...O.value, e]), te.value = O.value[0] ?? null) : (te.value = e, O.value = e ? [e] : []), V("sortChange", te.value);
211
- }
212
- function mt(t) {
213
- var e;
214
- const l = (e = x.value.find((a) => a.key === t.key)) == null ? void 0 : e.direction;
215
- Fe(t, l === "asc" ? "desc" : l === "desc" ? null : "asc");
271
+ function mt(e, a) {
272
+ const t = new Set(e);
273
+ return t.has(a) ? t.delete(a) : t.add(a), t;
274
+ }
275
+ function Zt(e) {
276
+ ie.value = mt(ie.value, e);
277
+ }
278
+ function _t(e) {
279
+ se.value = mt(se.value, e);
280
+ }
281
+ L(he, () => {
282
+ se.value = /* @__PURE__ */ new Set();
283
+ });
284
+ function ea(e, a) {
285
+ !i.editable || !a.editable || (W.value = { id: e.id, key: a.key }, Ke.value = re(e.row, a));
216
286
  }
217
- function He(t, l) {
287
+ function gt(e, a) {
288
+ var t, l;
289
+ ((t = W.value) == null ? void 0 : t.id) !== e.id || ((l = W.value) == null ? void 0 : l.key) !== a.key || (W.value = null, x("cellEdit", {
290
+ row: e.row,
291
+ rowKey: e.id,
292
+ column: a.key,
293
+ value: Ke.value
294
+ }));
295
+ }
296
+ function ta() {
297
+ !ke.value || !b.value.length || (x("batchEdit", {
298
+ keys: [...b.value],
299
+ column: ke.value,
300
+ value: Ae.value
301
+ }), Ae.value = "");
302
+ }
303
+ const aa = new Intl.NumberFormat("zh-CN", {
304
+ maximumFractionDigits: 2
305
+ });
306
+ function la(e) {
307
+ const a = It.value;
308
+ if (i.summaryMethod) return i.summaryMethod(e, a);
309
+ if (!e.summary) return "";
310
+ const t = a.map((r) => me(r, e)).filter((r) => r != null && r !== "");
311
+ if (e.summary === "count") return String(t.length);
312
+ const l = t.map(Number).filter(Number.isFinite);
313
+ if (!l.length) return "—";
314
+ const o = l.reduce((r, f) => r + f, 0), n = e.summary === "sum" ? o : e.summary === "avg" ? o / l.length : l.reduce(
315
+ (r, f) => e.summary === "min" ? Math.min(r, f) : Math.max(r, f)
316
+ );
317
+ return aa.format(n);
318
+ }
319
+ function Ze(e) {
320
+ const a = [...new Set(e.filter(Na))];
321
+ return i.selectionType === "radio" ? a.slice(0, 1) : a;
322
+ }
323
+ const ht = Me(
324
+ Ze(i.defaultSelectedRowKeys ?? [])
325
+ ), b = c(
326
+ () => Ze(i.selectedRowKeys ?? ht.value)
327
+ ), Le = c(() => new Set(b.value)), _e = c(
328
+ () => new Map(vt.value.map((e) => [e.id, e]))
329
+ ), Oe = (e) => {
218
330
  var a;
219
- const e = (a = x.value.find((n) => n.key === t.key)) == null ? void 0 : a.direction;
220
- Fe(t, e === l ? null : l);
331
+ return ((a = i.rowSelectable) == null ? void 0 : a.call(i, e.row, e.index)) !== !1;
332
+ }, Se = c(
333
+ () => Xe.value.filter(Oe).map((e) => e.id)
334
+ ), kt = c(
335
+ () => Se.value.length > 0 && Se.value.every((e) => Le.value.has(e))
336
+ ), oa = c(
337
+ () => Se.value.some((e) => Le.value.has(e))
338
+ ), bt = () => [...b.value];
339
+ function Ce(e) {
340
+ const a = Ze(e);
341
+ a.length === b.value.length && a.every((t, l) => t === b.value[l]) || (i.selectedRowKeys === void 0 && (ht.value = a), x("update:selectedRowKeys", [...a]));
342
+ }
343
+ L(
344
+ () => JSON.stringify(b.value),
345
+ () => x("selectionChange", bt())
346
+ ), L([_e, () => i.reserveSelection, ne], () => {
347
+ i.selectedRowKeys === void 0 && !(i.reserveSelection ?? ne.value) && Ce(b.value.filter((e) => _e.value.has(e)));
348
+ });
349
+ function et(e, a = !Le.value.has(e)) {
350
+ const t = _e.value.get(e);
351
+ !i.selectable || !t || !Oe(t) || Ce(
352
+ a ? i.selectionType === "radio" ? [e] : [...b.value, e] : b.value.filter((l) => l !== e)
353
+ );
354
+ }
355
+ function na() {
356
+ Ce([]);
357
+ }
358
+ function ia(e) {
359
+ if (i.selectionType === "radio") return;
360
+ const a = new Set(Se.value);
361
+ Ce(
362
+ e ? [...b.value, ...a] : b.value.filter((t) => !a.has(t))
363
+ );
364
+ }
365
+ function sa() {
366
+ if (!i.storageKey || typeof localStorage > "u") return {};
367
+ try {
368
+ const e = JSON.parse(
369
+ localStorage.getItem("hys-ui-grid:" + i.storageKey) || "{}"
370
+ );
371
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
372
+ } catch {
373
+ return {};
374
+ }
375
+ }
376
+ const X = sa(), E = w(
377
+ Array.isArray(X.order) ? X.order.filter((e) => typeof e == "string") : []
378
+ ), C = w(
379
+ Array.isArray(X.hidden) ? X.hidden.filter((e) => typeof e == "string") : []
380
+ ), K = w(
381
+ X.widths && typeof X.widths == "object" && !Array.isArray(X.widths) ? Object.fromEntries(
382
+ Object.entries(X.widths).filter(
383
+ ([, e]) => typeof e == "number" && Number.isFinite(e)
384
+ )
385
+ ) : {}
386
+ ), Ne = (e) => Te(e.minWidth, 80), tt = (e) => Math.max(Ne(e), Te(e.maxWidth, 800)), qe = (e, a) => Math.max(Ne(e), Math.min(tt(e), a)), Be = Me(), B = (e) => {
387
+ var a;
388
+ return ((a = Be.value) == null ? void 0 : a.key) === e.key ? Be.value.width : Object.hasOwn(K.value, e.key) ? K.value[e.key] : Te(e.width, 160);
389
+ };
390
+ L(
391
+ () => i.columns.map((e) => [
392
+ e.key,
393
+ e.hideable,
394
+ e.minWidth,
395
+ e.maxWidth
396
+ ]),
397
+ (e, a) => {
398
+ a && Y();
399
+ const t = F.value, l = [...t.keys()];
400
+ E.value = [
401
+ .../* @__PURE__ */ new Set([...E.value.filter((o) => t.has(o)), ...l])
402
+ ], C.value = [
403
+ ...new Set(
404
+ C.value.filter(
405
+ (o) => {
406
+ var n;
407
+ return t.has(o) && ((n = t.get(o)) == null ? void 0 : n.hideable) !== !1;
408
+ }
409
+ )
410
+ )
411
+ ], l.every((o) => C.value.includes(o)) && (C.value = []), K.value = Object.fromEntries(
412
+ Object.entries(K.value).flatMap(([o, n]) => {
413
+ const r = t.get(o);
414
+ return r ? [[o, qe(r, n)]] : [];
415
+ })
416
+ );
417
+ },
418
+ { immediate: !0 }
419
+ );
420
+ const A = c(
421
+ () => E.value.flatMap((e) => {
422
+ const a = F.value.get(e);
423
+ return a && !C.value.includes(e) ? [a] : [];
424
+ })
425
+ ), G = c(() => [
426
+ ...A.value.filter((e) => e.pinned === "left"),
427
+ ...A.value.filter((e) => !e.pinned),
428
+ ...A.value.filter((e) => e.pinned === "right")
429
+ ]), ra = c(
430
+ () => E.value.flatMap((e) => {
431
+ const a = F.value.get(e);
432
+ return a ? [{ id: e, label: a.label }] : [];
433
+ })
434
+ );
435
+ L([E, C, K], () => {
436
+ if (i.storageKey && typeof localStorage < "u")
437
+ try {
438
+ localStorage.setItem(
439
+ "hys-ui-grid:" + i.storageKey,
440
+ JSON.stringify({
441
+ order: E.value,
442
+ hidden: C.value,
443
+ widths: K.value
444
+ })
445
+ );
446
+ } catch {
447
+ }
448
+ x(
449
+ "columnsChange",
450
+ A.value.map((e) => e.key)
451
+ );
452
+ });
453
+ function ua(e) {
454
+ e.hideable !== !1 && (C.value.includes(e.key) ? C.value = C.value.filter((a) => a !== e.key) : A.value.length > 1 && (C.value = [...C.value, e.key]));
455
+ }
456
+ const da = c(
457
+ () => G.value.reduce(
458
+ (e, a) => e + B(a),
459
+ i.selectable ? 44 : 0
460
+ )
461
+ ), ca = c(() => {
462
+ const e = /* @__PURE__ */ new Map();
463
+ let a = i.selectable ? 44 : 0;
464
+ for (const l of G.value)
465
+ l.pinned === "left" && (e.set(l.key, { left: a + "px" }), a += B(l));
466
+ let t = 0;
467
+ for (const l of [...G.value].reverse())
468
+ l.pinned === "right" && (e.set(l.key, { right: t + "px" }), t += B(l));
469
+ return e;
470
+ }), He = (e, a = !1) => e.pinned ? {
471
+ position: "sticky",
472
+ ...ca.value.get(e.key),
473
+ zIndex: a ? 5 : 2
474
+ } : {};
475
+ async function wt(e = !0) {
476
+ var o, n;
477
+ if (j.value = !1, !e) return;
478
+ await pe();
479
+ const t = [
480
+ ...((o = te.value) == null ? void 0 : o.querySelectorAll(
481
+ "thead th[data-column-key]"
482
+ )) ?? []
483
+ ].find(
484
+ (r) => r.dataset.columnKey === ae.value
485
+ ), l = (t == null ? void 0 : t.querySelector(".hys-ui-pf-grid-filter")) ?? ((n = te.value) == null ? void 0 : n.querySelector(".hys-ui-pf-grid-filter"));
486
+ l == null || l.focus({ preventScroll: !0 });
487
+ }
488
+ async function fa(e) {
489
+ var t, l, o;
490
+ if (j.value && ae.value === e.key) {
491
+ await wt(!1);
492
+ return;
493
+ }
494
+ ae.value = e.key, j.value = !0, await pe(), (o = (l = [
495
+ ...((t = te.value) == null ? void 0 : t.querySelectorAll("[data-filter-key]")) ?? []
496
+ ].find((n) => n.dataset.filterKey === e.key)) == null ? void 0 : l.querySelector("input")) == null || o.focus({ preventScroll: !0 });
221
497
  }
222
- function gt(t) {
223
- C.value = Math.max(1, Math.min(t, Ee.value)), V("pageChange", C.value);
498
+ let p, xe = 0, St = 0;
499
+ function Ct(e) {
500
+ !p || e.pointerId !== p.pointer || (St = qe(
501
+ p.column,
502
+ p.width + e.clientX - p.start
503
+ ), !xe && (xe = requestAnimationFrame(() => {
504
+ xe = 0, p && (Be.value = { key: p.column.key, width: St });
505
+ })));
224
506
  }
225
- function pt(t) {
226
- me.value = t, C.value = 1, V("pageSizeChange", t);
507
+ function Y() {
508
+ p && (cancelAnimationFrame(xe), xe = 0, Be.value = void 0, document.body.style.cursor === "col-resize" && (document.body.style.cursor = p.cursor), p = void 0, window.removeEventListener("pointermove", Ct), window.removeEventListener("pointerup", Rt), window.removeEventListener("pointercancel", xt), window.removeEventListener("blur", Y), window.removeEventListener("keydown", zt, !0));
227
509
  }
228
- K([C, me, x, le, P], () => V("queryChange", { page: C.value, pageSize: ne.value, sort: [...x.value], search: le.value, filters: { ...P.value } }), { deep: !0 });
229
- function ht(t) {
230
- t.hideable !== !1 && (w.value.includes(t.key) ? w.value = w.value.filter((l) => l !== t.key) : R.value.length > 1 && (w.value = [...w.value, t.key]));
510
+ function xt(e) {
511
+ e.pointerId === (p == null ? void 0 : p.pointer) && Y();
231
512
  }
232
- let T = null;
233
- function Ne(t) {
234
- T && (p.value = { ...p.value, [T.key]: Math.max(T.min, Math.min(T.max, T.width + t.clientX - T.start)) });
513
+ function zt(e) {
514
+ e.key === "Escape" && p && (e.preventDefault(), e.stopPropagation(), Y());
235
515
  }
236
- function Ce() {
237
- T = null, window.removeEventListener("pointermove", Ne), window.removeEventListener("pointerup", Ce), document.body.style.cursor = "";
516
+ function Rt(e) {
517
+ if (!p || e.pointerId !== p.pointer) return;
518
+ const { column: a, start: t, width: l } = p, o = e.clientX - t, n = o === 0 ? l : qe(a, l + o);
519
+ Y(), n !== l && (K.value = { ...K.value, [a.key]: n });
238
520
  }
239
- function kt(t, l) {
240
- l.resizable !== !1 && (t.preventDefault(), t.stopPropagation(), T = { key: l.key, start: t.clientX, width: p.value[l.key] || l.width || 160, min: l.minWidth || 80, max: l.maxWidth || 800 }, document.body.style.cursor = "col-resize", window.addEventListener("pointermove", Ne), window.addEventListener("pointerup", Ce));
521
+ function va(e, a) {
522
+ a.resizable === !1 || e.button !== 0 || p || (e.preventDefault(), e.stopPropagation(), p = {
523
+ column: a,
524
+ pointer: e.pointerId,
525
+ start: e.clientX,
526
+ width: B(a),
527
+ cursor: document.body.style.cursor
528
+ }, document.body.style.cursor = "col-resize", window.addEventListener("pointermove", Ct), window.addEventListener("pointerup", Rt), window.addEventListener("pointercancel", xt), window.addEventListener("blur", Y), window.addEventListener("keydown", zt, !0));
241
529
  }
242
- const { effectiveMotion: xe } = Tt(), se = v(null), W = v(null);
243
- let U = 0, re = null, Ve = 0;
244
- const ye = /* @__PURE__ */ new Set();
245
- function ie() {
246
- Ve++;
247
- for (const t of ye) t.cancel();
248
- ye.clear();
530
+ function ya(e, a) {
531
+ const t = e.shiftKey ? 40 : 10, l = B(a), o = e.key === "ArrowLeft" ? l - t : e.key === "ArrowRight" ? l + t : e.key === "Home" ? Ne(a) : e.key === "End" ? tt(a) : void 0;
532
+ if (o === void 0) return;
533
+ e.preventDefault();
534
+ const n = qe(a, o);
535
+ n !== l && (K.value = { ...K.value, [a.key]: n });
249
536
  }
250
- K(xe, (t) => {
251
- t === "off" && ie();
537
+ const { effectiveMotion: Ue } = Fa(), de = w(null), Z = w(null);
538
+ let H = 0, ce = null, at = 0;
539
+ const ze = /* @__PURE__ */ new Set(), Mt = 160;
540
+ function Re() {
541
+ at++;
542
+ for (const e of ze) e.cancel();
543
+ ze.clear();
544
+ }
545
+ L(Ue, (e) => {
546
+ e === "off" && Re();
252
547
  });
253
- function _() {
254
- cancelAnimationFrame(U), U = 0, re = null, se.value = null, W.value = null;
548
+ function fe() {
549
+ cancelAnimationFrame(H), H = 0, ce = null, de.value = null, Z.value = null;
255
550
  }
256
- function bt(t, l) {
257
- if (T || l.reorderable === !1 || !t.dataTransfer) {
258
- t.preventDefault();
551
+ function pa(e, a) {
552
+ if (p || a.reorderable === !1 || !e.dataTransfer) {
553
+ e.preventDefault();
259
554
  return;
260
555
  }
261
- ie(), se.value = l.key, t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", l.key);
556
+ Re(), de.value = a.key, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", a.key);
262
557
  }
263
- function De(t) {
264
- const l = o.columns.find((e) => e.key === se.value);
265
- return !!l && l.key !== t.key && l.reorderable !== !1 && t.reorderable !== !1 && l.pinned === t.pinned;
558
+ function lt(e) {
559
+ const a = i.columns.find((t) => t.key === de.value);
560
+ return !!a && a.key !== e.key && a.reorderable !== !1 && e.reorderable !== !1 && a.pinned === e.pinned;
266
561
  }
267
- function Oe(t, l, e) {
268
- const a = e.getBoundingClientRect();
269
- return { key: t.key, position: l < a.left + a.width / 2 ? "before" : "after" };
562
+ function Tt(e, a, t) {
563
+ const l = t.getBoundingClientRect();
564
+ return {
565
+ key: e.key,
566
+ position: a < l.left + l.width / 2 ? "before" : "after"
567
+ };
270
568
  }
271
- function wt(t, l) {
272
- if (!De(l)) {
273
- cancelAnimationFrame(U), U = 0, re = null, W.value = null;
569
+ function ma(e, a) {
570
+ if (!lt(a)) {
571
+ cancelAnimationFrame(H), H = 0, ce = null, Z.value = null;
274
572
  return;
275
573
  }
276
- t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), re = { element: t.currentTarget, column: l, x: t.clientX }, !U && (U = requestAnimationFrame(() => {
277
- var n;
278
- U = 0;
279
- const e = re;
280
- if (re = null, !e || !De(e.column)) return;
281
- const a = Oe(e.column, e.x, e.element);
282
- (((n = W.value) == null ? void 0 : n.key) !== a.key || W.value.position !== a.position) && (W.value = a);
574
+ e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), ce = {
575
+ element: e.currentTarget,
576
+ column: a,
577
+ x: e.clientX
578
+ }, !H && (H = requestAnimationFrame(() => {
579
+ var o;
580
+ H = 0;
581
+ const t = ce;
582
+ if (ce = null, !t || !lt(t.column)) return;
583
+ const l = Tt(t.column, t.x, t.element);
584
+ (((o = Z.value) == null ? void 0 : o.key) !== l.key || Z.value.position !== l.position) && (Z.value = l);
283
585
  }));
284
586
  }
285
- function Ct(t) {
286
- t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame(U), U = 0, re = null, W.value = null);
587
+ function ga(e) {
588
+ e.relatedTarget instanceof Element && e.relatedTarget.closest("th[data-column-key]") && e.currentTarget.contains(e.relatedTarget) || (cancelAnimationFrame(H), H = 0, ce = null, Z.value = null);
287
589
  }
288
- function Pe() {
289
- var t;
290
- return new Map(Array.from(((t = he.value) == null ? void 0 : t.querySelectorAll("th[data-column-key]")) || []).map((l) => [
291
- l.dataset.columnKey,
292
- l.getBoundingClientRect()
293
- ]));
294
- }
295
- function xt(t) {
296
- var c;
297
- if (xe.value === "off") return;
298
- const l = (c = he.value) == null ? void 0 : c.querySelector(".hys-ui-pf-grid-scroll");
299
- if (!l) return;
300
- const e = l.getBoundingClientRect(), a = Math.max(0, e.top), n = Math.min(window.innerHeight, e.bottom), d = Math.max(0, e.left), i = Math.min(window.innerWidth, e.right);
301
- if (a >= n || d >= i) return;
302
- const y = /* @__PURE__ */ new Map();
303
- for (const [I, $] of Pe()) {
304
- const S = t.get(I);
305
- S && $.right > d && $.left < i && Math.abs(S.left - $.left) > 0.5 && y.set(I, S.left - $.left);
590
+ function Et() {
591
+ var e;
592
+ return new Map(
593
+ Array.from(
594
+ ((e = te.value) == null ? void 0 : e.querySelectorAll("th[data-column-key]")) || []
595
+ ).map((a) => [
596
+ a.dataset.columnKey,
597
+ a.getBoundingClientRect()
598
+ ])
599
+ );
600
+ }
601
+ function ha(e) {
602
+ var d;
603
+ if (Ue.value === "off") return;
604
+ const a = (d = te.value) == null ? void 0 : d.querySelector(
605
+ ".hys-ui-pf-grid-scroll"
606
+ );
607
+ if (!a) return;
608
+ const t = a.getBoundingClientRect(), l = Math.max(0, t.top), o = Math.min(window.innerHeight, t.bottom), n = Math.max(0, t.left), r = Math.min(window.innerWidth, t.right);
609
+ if (l >= o || n >= r) return;
610
+ const f = /* @__PURE__ */ new Map();
611
+ for (const [M, U] of Et()) {
612
+ const R = e.get(M);
613
+ R && U.right > n && U.left < r && Math.abs(R.left - U.left) > 0.5 && f.set(M, R.left - U.left);
306
614
  }
307
- const f = [];
308
- for (const I of Array.from(l.querySelectorAll("thead tr,tbody tr,tfoot tr"))) {
309
- const $ = I.getBoundingClientRect();
310
- if ($.top >= n) break;
311
- if (!($.bottom <= a)) {
312
- for (const S of Array.from(I.children))
313
- if (S instanceof HTMLElement && y.has(S.dataset.columnKey || "") && f.push(S), f.length >= Xe) break;
314
- if (f.length >= Xe) break;
615
+ const k = [];
616
+ for (const M of Array.from(
617
+ a.querySelectorAll("thead tr,tbody tr,tfoot tr")
618
+ )) {
619
+ const U = M.getBoundingClientRect();
620
+ if (U.top >= o) break;
621
+ if (!(U.bottom <= l)) {
622
+ for (const R of Array.from(M.children))
623
+ if (R instanceof HTMLElement && f.has(R.dataset.columnKey || "") && k.push(R), k.length >= Mt) break;
624
+ if (k.length >= Mt) break;
315
625
  }
316
626
  }
317
- const ee = xe.value === "full" ? 280 : 180;
318
- for (const I of f) {
319
- const $ = y.get(I.dataset.columnKey), S = I.animate([{ transform: "translateX(" + $ + "px)" }, { transform: "translateX(0)" }], { duration: ee, easing: "cubic-bezier(.2,.8,.2,1)" });
320
- ye.add(S), S.onfinish = () => ye.delete(S), S.oncancel = () => ye.delete(S);
627
+ const _ = Ue.value === "full" ? 280 : 180;
628
+ for (const M of k) {
629
+ const U = f.get(M.dataset.columnKey), R = M.animate(
630
+ [
631
+ { transform: "translateX(" + U + "px)" },
632
+ { transform: "translateX(0)" }
633
+ ],
634
+ { duration: _, easing: "cubic-bezier(.2,.8,.2,1)" }
635
+ );
636
+ ze.add(R), R.onfinish = () => ze.delete(R), R.oncancel = () => ze.delete(R);
321
637
  }
322
638
  }
323
- async function St(t, l) {
324
- if (!De(l)) {
325
- _();
639
+ async function ka(e, a) {
640
+ if (!lt(a)) {
641
+ fe();
326
642
  return;
327
643
  }
328
- t.preventDefault();
329
- const e = Oe(l, t.clientX, t.currentTarget), a = D.value.filter((y) => y !== se.value), n = a.indexOf(e.key);
330
- if (n < 0) {
331
- _();
644
+ e.preventDefault();
645
+ const t = Tt(
646
+ a,
647
+ e.clientX,
648
+ e.currentTarget
649
+ ), l = E.value.filter((f) => f !== de.value), o = l.indexOf(t.key);
650
+ if (o < 0) {
651
+ fe();
332
652
  return;
333
653
  }
334
- if (a.splice(n + (e.position === "after" ? 1 : 0), 0, se.value), _(), a.every((y, f) => y === D.value[f])) return;
335
- ie();
336
- const d = Ve, i = xe.value === "off" ? /* @__PURE__ */ new Map() : Pe();
337
- D.value = a, await Ke(), d === Ve && xt(i);
338
- }
339
- function je() {
340
- _(), ie(), D.value = o.columns.map((t) => t.key), w.value = [], p.value = {};
341
- }
342
- function zt() {
343
- const t = R.value, l = (d) => '"' + d.replace(/"/g, '""') + '"', e = "\uFEFF" + [t.map((d) => l(d.label)).join(","), ...q.value.map((d) => t.map((i) => l(oe(d, i.key))).join(","))].join(`\r
344
- `), a = URL.createObjectURL(new Blob([e], { type: "text/csv;charset=utf-8" })), n = document.createElement("a");
345
- n.href = a, n.download = "projectflow-table.csv", n.click(), setTimeout(() => URL.revokeObjectURL(a), 1e3);
346
- }
347
- function Se(t) {
348
- Me.value && !Me.value.contains(t.target) && (Y.value = !1);
349
- }
350
- return K(Y, async (t) => {
351
- t ? (await Ke(), document.addEventListener("pointerdown", Se)) : document.removeEventListener("pointerdown", Se);
352
- }), Vt(() => {
353
- _(), ie(), Ce(), Y.value = !1, document.removeEventListener("pointerdown", Se);
354
- }), Dt(() => {
355
- _(), ie(), Ce(), document.removeEventListener("pointerdown", Se);
356
- }), (t, l) => (s(), u("section", Kt(F(Qe), {
357
- class: ["hys-ui-pf-grid", "hys-ui-pf-grid--" + r.density],
654
+ if (l.splice(
655
+ o + (t.position === "after" ? 1 : 0),
656
+ 0,
657
+ de.value
658
+ ), fe(), l.every((f, k) => f === E.value[k])) return;
659
+ Re();
660
+ const n = at, r = Ue.value === "off" ? /* @__PURE__ */ new Map() : Et();
661
+ E.value = l, await pe(), n === at && ha(r);
662
+ }
663
+ function Kt() {
664
+ Y(), fe(), Re(), E.value = [...F.value.keys()], C.value = [], K.value = {};
665
+ }
666
+ function ba() {
667
+ const e = A.value, a = (n) => '"' + n.replace(/"/g, '""') + '"', t = [
668
+ e.map((n) => a(n.label)).join(","),
669
+ ...be.value.map(
670
+ ({ row: n }) => e.map((r) => a(re(n, r))).join(",")
671
+ )
672
+ ], l = URL.createObjectURL(
673
+ new Blob(["\uFEFF" + t.join(`\r
674
+ `)], {
675
+ type: "text/csv;charset=utf-8"
676
+ })
677
+ ), o = document.createElement("a");
678
+ o.href = l, o.download = "projectflow-table.csv", o.click(), setTimeout(() => URL.revokeObjectURL(l), 1e3);
679
+ }
680
+ const wa = c(
681
+ () => typeof i.maxHeight == "number" ? i.maxHeight > 0 && Number.isFinite(i.maxHeight) ? i.maxHeight + "px" : void 0 : i.maxHeight
682
+ );
683
+ function Sa(e) {
684
+ var a;
685
+ (a = ge.value) == null || a.scrollTo(e);
686
+ }
687
+ function Ca(e) {
688
+ var t;
689
+ const a = [
690
+ ...((t = ge.value) == null ? void 0 : t.querySelectorAll("[data-grid-row]")) ?? []
691
+ ].find((l) => l.dataset.gridRow === st(e));
692
+ return a == null || a.scrollIntoView({ block: "nearest", inline: "nearest" }), !!a;
693
+ }
694
+ Ot({
695
+ resetColumns: Kt,
696
+ getQuery: we,
697
+ setQuery: J,
698
+ resetQuery: jt,
699
+ reload: Ge,
700
+ getSelection: bt,
701
+ clearSelection: na,
702
+ toggleRowSelection: et,
703
+ scrollTo: Sa,
704
+ scrollToRow: Ca
705
+ });
706
+ function ot(e) {
707
+ je.value && !je.value.contains(e.target) && (I.value = !1);
708
+ }
709
+ L(I, (e) => {
710
+ e ? document.addEventListener("pointerdown", ot) : document.removeEventListener("pointerdown", ot);
711
+ });
712
+ function At() {
713
+ fe(), Re(), Y(), I.value = !1, document.removeEventListener("pointerdown", ot);
714
+ }
715
+ return Ra(At), Ma(At), (e, a) => (s(), u("section", Ta(m(qt), {
716
+ class: ["hys-ui-pf-grid", "hys-ui-pf-grid--" + v.density],
358
717
  "aria-label": "数据表格",
359
718
  ref_key: "tableRef",
360
- ref: he
719
+ ref: te,
720
+ "aria-busy": Fe.value || void 0
361
721
  }), [
362
- g("div", Ft, [
363
- g("label", Ht, [
364
- l[13] || (l[13] = g("span", null, "搜索", -1)),
365
- m(ze, {
366
- modelValue: le.value,
367
- "onUpdate:modelValue": l[0] || (l[0] = (e) => le.value = e),
722
+ y("div", Ia, [
723
+ y("label", ja, [
724
+ a[14] || (a[14] = y("span", null, "搜索", -1)),
725
+ g(Ie, {
726
+ size: "sm",
727
+ modelValue: Pe.value,
728
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => Pe.value = t),
368
729
  type: "search",
369
730
  placeholder: "搜索全部列…",
370
731
  "aria-label": "搜索表格",
371
732
  clearable: ""
372
733
  }, null, 8, ["modelValue"])
373
734
  ]),
374
- r.groupable ? (s(), u("label", Nt, [
375
- l[14] || (l[14] = H("分组 ", -1)),
376
- m(Ie, {
377
- modelValue: G.value,
378
- "onUpdate:modelValue": l[1] || (l[1] = (e) => G.value = e),
735
+ v.groupable ? (s(), u("label", Pa, [
736
+ a[15] || (a[15] = V("分组 ", -1)),
737
+ g(Lt, {
738
+ size: "sm",
739
+ modelValue: he.value,
740
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => he.value = t),
379
741
  "aria-label": "按列分组",
380
- options: [{ label: "不分组", value: "" }, ...Te.value.map((e) => ({ label: e.label, value: e.key }))]
742
+ options: [
743
+ { label: "不分组", value: "" },
744
+ ...Xt.value.map((t) => ({ label: t.label, value: t.key }))
745
+ ]
381
746
  }, null, 8, ["modelValue", "options"])
382
- ])) : k("", !0),
383
- r.editable && h.value.length ? (s(), u("div", Ot, [
384
- m(Ie, {
385
- modelValue: fe.value,
386
- "onUpdate:modelValue": l[2] || (l[2] = (e) => fe.value = e),
747
+ ])) : h("", !0),
748
+ v.editable && b.value.length ? (s(), u("div", Qa, [
749
+ g(Lt, {
750
+ size: "sm",
751
+ modelValue: ke.value,
752
+ "onUpdate:modelValue": a[2] || (a[2] = (t) => ke.value = t),
387
753
  "aria-label": "批量编辑字段",
388
- options: [{ label: "选择编辑列", value: "" }, ...r.columns.filter((e) => e.editable).map((e) => ({ label: e.label, value: e.key }))]
754
+ options: [
755
+ { label: "选择编辑列", value: "" },
756
+ ...v.columns.filter((t) => t.editable).map((t) => ({ label: t.label, value: t.key }))
757
+ ]
389
758
  }, null, 8, ["modelValue", "options"]),
390
- m(ze, {
391
- modelValue: pe.value,
392
- "onUpdate:modelValue": l[3] || (l[3] = (e) => pe.value = e),
759
+ g(Ie, {
760
+ size: "sm",
761
+ modelValue: Ae.value,
762
+ "onUpdate:modelValue": a[3] || (a[3] = (t) => Ae.value = t),
393
763
  "aria-label": "批量编辑值",
394
764
  placeholder: "新值"
395
765
  }, null, 8, ["modelValue"]),
396
- m(M, {
766
+ g(T, {
397
767
  variant: "ghost",
398
768
  size: "sm",
399
769
  type: "button",
400
- disabled: !fe.value,
401
- onClick: ut
770
+ disabled: !ke.value,
771
+ onClick: ta
402
772
  }, {
403
773
  default: z(() => [
404
- H("应用到 " + E(h.value.length) + " 行", 1)
774
+ V("应用到 " + O(b.value.length) + " 行", 1)
405
775
  ]),
406
776
  _: 1
407
777
  }, 8, ["disabled"])
408
- ])) : k("", !0),
409
- ae.value ? (s(), u(B, { key: 2 }, [
410
- m(M, {
411
- variant: "ghost",
412
- size: "sm",
413
- type: "button",
414
- onClick: l[4] || (l[4] = (e) => P.value = {})
415
- }, {
416
- default: z(() => [...l[15] || (l[15] = [
417
- H("清空筛选", -1)
418
- ])]),
419
- _: 1
420
- }),
421
- m(M, {
422
- variant: "ghost",
423
- size: "sm",
424
- type: "button",
425
- onClick: l[5] || (l[5] = (e) => ae.value = !1)
426
- }, {
427
- default: z(() => [...l[16] || (l[16] = [
428
- H("收起筛选", -1)
429
- ])]),
430
- _: 1
431
- })
432
- ], 64)) : k("", !0),
433
- g("span", Pt, E(r.serverMode ? r.totalRows ?? r.rows.length : q.value.length) + " 条记录 · 已选 " + E(h.value.length), 1),
434
- g("div", {
778
+ ])) : h("", !0),
779
+ j.value ? (s(), D(T, {
780
+ key: 2,
781
+ variant: "ghost",
782
+ size: "sm",
783
+ type: "button",
784
+ onClick: a[4] || (a[4] = (t) => J({ filters: {}, page: 1 }))
785
+ }, {
786
+ default: z(() => [...a[16] || (a[16] = [
787
+ V("清空筛选", -1)
788
+ ])]),
789
+ _: 1
790
+ })) : h("", !0),
791
+ y("span", Wa, O(We.value) + " 条记录 · 已选 " + O(b.value.length), 1),
792
+ y("div", {
435
793
  class: "hys-ui-pf-grid-menu",
436
794
  ref_key: "menuRef",
437
- ref: Me
795
+ ref: je
438
796
  }, [
439
- m(M, {
797
+ g(T, {
440
798
  variant: "ghost",
441
799
  size: "sm",
442
800
  type: "button",
443
- onClick: l[6] || (l[6] = (e) => Y.value = !Y.value),
444
- "aria-expanded": Y.value,
801
+ onClick: a[5] || (a[5] = (t) => I.value = !I.value),
802
+ "aria-expanded": I.value,
445
803
  "aria-label": "配置显示列"
446
804
  }, {
447
805
  default: z(() => [
448
- m(F(Lt), {
806
+ g(m(Ea), {
449
807
  size: 16,
450
808
  "aria-hidden": "true"
451
809
  }),
452
- l[17] || (l[17] = H(" 列设置", -1))
810
+ a[17] || (a[17] = V(" 列设置", -1))
453
811
  ]),
454
812
  _: 1
455
813
  }, 8, ["aria-expanded"]),
456
- Y.value ? (s(), u("div", jt, [
457
- l[19] || (l[19] = g("strong", null, "显示列与排序", -1)),
458
- m(Ut, {
459
- class: "hys-ui-pf-grid-settings-list",
460
- "model-value": tt.value,
461
- "onUpdate:modelValue": l[7] || (l[7] = (e) => D.value = e.map((a) => a.id))
462
- }, {
463
- item: z(({ item: e }) => {
464
- var a;
465
- return [
466
- m(Re, {
467
- "model-value": !w.value.includes(e.id),
468
- label: e.label,
469
- disabled: ((a = r.columns.find((n) => n.key === e.id)) == null ? void 0 : a.hideable) === !1 || !w.value.includes(e.id) && R.value.length === 1,
470
- "onUpdate:modelValue": (n) => ht(r.columns.find((d) => d.key === e.id))
471
- }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])
472
- ];
473
- }),
474
- _: 1
475
- }, 8, ["model-value"]),
476
- m(M, {
477
- variant: "ghost",
478
- size: "sm",
479
- type: "button",
480
- onClick: je
481
- }, {
482
- default: z(() => [...l[18] || (l[18] = [
483
- H("恢复默认列", -1)
484
- ])]),
485
- _: 1
486
- })
487
- ])) : k("", !0)
814
+ g(m(Da), {
815
+ "popup-transition": i.popupTransition,
816
+ "popup-transition-duration": i.popupTransitionDuration,
817
+ onInactive: a[7] || (a[7] = (t) => I.value = !1)
818
+ }, {
819
+ default: z(() => [
820
+ I.value ? (s(), u("div", Ja, [
821
+ a[19] || (a[19] = y("strong", null, "显示列与排序", -1)),
822
+ g(Ba, {
823
+ class: "hys-ui-pf-grid-settings-list",
824
+ "model-value": ra.value,
825
+ "onUpdate:modelValue": a[6] || (a[6] = (t) => E.value = t.map((l) => l.id))
826
+ }, {
827
+ item: z(({ item: t }) => {
828
+ var l;
829
+ return [
830
+ g(rt, {
831
+ "model-value": !C.value.includes(t.id),
832
+ label: t.label,
833
+ disabled: ((l = v.columns.find((o) => o.key === t.id)) == null ? void 0 : l.hideable) === !1 || !C.value.includes(t.id) && A.value.length === 1,
834
+ "onUpdate:modelValue": (o) => ua(
835
+ v.columns.find((n) => n.key === t.id)
836
+ )
837
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])
838
+ ];
839
+ }),
840
+ _: 1
841
+ }, 8, ["model-value"]),
842
+ g(T, {
843
+ variant: "ghost",
844
+ size: "sm",
845
+ type: "button",
846
+ onClick: Kt
847
+ }, {
848
+ default: z(() => [...a[18] || (a[18] = [
849
+ V("恢复默认列", -1)
850
+ ])]),
851
+ _: 1
852
+ })
853
+ ])) : h("", !0)
854
+ ]),
855
+ _: 1
856
+ }, 8, ["popup-transition", "popup-transition-duration"])
488
857
  ], 512),
489
- m(M, {
858
+ g(T, {
490
859
  variant: "ghost",
491
860
  size: "sm",
492
861
  type: "button",
493
- onClick: zt
862
+ onClick: ba
494
863
  }, {
495
- default: z(() => [...l[20] || (l[20] = [
496
- H("导出 CSV", -1)
864
+ default: z(() => [...a[20] || (a[20] = [
865
+ V("导出 CSV", -1)
497
866
  ])]),
498
867
  _: 1
499
868
  })
500
869
  ]),
501
- g("div", {
870
+ y("div", {
871
+ ref_key: "scrollRef",
872
+ ref: ge,
502
873
  class: "hys-ui-pf-grid-scroll",
503
- onDragleave: Ct
874
+ style: $({ maxHeight: wa.value }),
875
+ tabindex: "0",
876
+ role: "region",
877
+ "aria-label": "表格滚动区域",
878
+ onDragleave: ga
504
879
  }, [
505
- g("table", {
506
- class: ue({ "hys-ui-pf-grid-sticky-head": r.stickyHeader }),
507
- style: X({ minWidth: lt.value + "px" })
880
+ y("table", {
881
+ class: ve({ "hys-ui-pf-grid-sticky-head": v.stickyHeader }),
882
+ style: $({ minWidth: da.value + "px" })
508
883
  }, [
509
- g("colgroup", null, [
510
- r.selectable ? (s(), u("col", qt)) : k("", !0),
511
- (s(!0), u(B, null, de(L.value, (e) => (s(), u("col", {
512
- key: e.key,
513
- style: X({ width: (p.value[e.key] || e.width || 160) + "px" })
884
+ y("colgroup", null, [
885
+ v.selectable ? (s(), u("col", Xa)) : h("", !0),
886
+ (s(!0), u(N, null, ye(G.value, (t) => (s(), u("col", {
887
+ key: t.key,
888
+ style: $({ width: B(t) + "px" })
514
889
  }, null, 4))), 128))
515
890
  ]),
516
- g("thead", null, [
517
- g("tr", null, [
518
- r.selectable ? (s(), u("th", Wt, [
519
- m(Re, {
891
+ y("thead", null, [
892
+ y("tr", null, [
893
+ v.selectable ? (s(), u("th", Ga, [
894
+ v.selectionType !== "radio" ? (s(), D(rt, {
895
+ key: 0,
520
896
  "aria-label": "选择当前页全部行",
521
- "model-value": $e.value,
522
- indeterminate: ft.value && !$e.value,
523
- "onUpdate:modelValue": vt
524
- }, null, 8, ["model-value", "indeterminate"])
525
- ])) : k("", !0),
526
- (s(!0), u(B, null, de(L.value, (e) => {
527
- var a, n, d, i, y, f, ee;
897
+ "model-value": kt.value,
898
+ indeterminate: oa.value && !kt.value,
899
+ disabled: !Se.value.length || Fe.value || !!m(Ve),
900
+ "onUpdate:modelValue": ia
901
+ }, null, 8, ["model-value", "indeterminate", "disabled"])) : (s(), u("span", Ya, "选择"))
902
+ ])) : h("", !0),
903
+ (s(!0), u(N, null, ye(G.value, (t) => {
904
+ var l, o, n, r, f, k, _;
528
905
  return s(), u("th", {
529
- key: e.key,
906
+ key: t.key,
530
907
  scope: "col",
531
- "data-column-key": e.key,
532
- class: ue({ "hys-ui-is-column-dragging": se.value === e.key }),
533
- "data-drop-position": ((a = W.value) == null ? void 0 : a.key) === e.key ? W.value.position : void 0,
534
- draggable: e.reorderable !== !1,
535
- onDragstart: (c) => bt(c, e),
536
- onDragend: _,
537
- onDragover: (c) => wt(c, e),
538
- onDrop: (c) => St(c, e),
539
- "aria-sort": ((n = x.value.find((c) => c.key === e.key)) == null ? void 0 : n.direction) === "asc" ? "ascending" : ((d = x.value.find((c) => c.key === e.key)) == null ? void 0 : d.direction) === "desc" ? "descending" : "none",
540
- style: X({ ...ke(e), textAlign: e.align || "left" })
908
+ "data-column-key": t.key,
909
+ class: ve({ "hys-ui-is-column-dragging": de.value === t.key }),
910
+ "data-drop-position": ((l = Z.value) == null ? void 0 : l.key) === t.key ? Z.value.position : void 0,
911
+ draggable: t.reorderable !== !1,
912
+ onDragstart: (d) => pa(d, t),
913
+ onDragend: fe,
914
+ onDragover: (d) => ma(d, t),
915
+ onDrop: (d) => ka(d, t),
916
+ "aria-sort": ((o = S.value.find((d) => d.key === t.key)) == null ? void 0 : o.direction) === "asc" ? "ascending" : ((n = S.value.find((d) => d.key === t.key)) == null ? void 0 : n.direction) === "desc" ? "descending" : "none",
917
+ style: $({ ...He(t, !0), textAlign: t.align || "left" })
541
918
  }, [
542
- g("div", Xt, [
543
- g("div", Gt, [
544
- m(M, {
919
+ y("div", _a, [
920
+ y("div", el, [
921
+ g(T, {
545
922
  variant: "ghost",
546
923
  size: "sm",
547
924
  type: "button",
548
- class: ue(["hys-ui-pf-grid-sort", { "hys-ui-is-sorted": x.value.some((c) => c.key === e.key) }]),
549
- onClick: (c) => mt(e)
925
+ class: ve(["hys-ui-pf-grid-sort", {
926
+ "hys-ui-is-sorted": S.value.some(
927
+ (d) => d.key === t.key
928
+ )
929
+ }]),
930
+ onClick: (d) => Jt(t)
550
931
  }, {
551
932
  default: z(() => [
552
- g("span", Jt, E(e.label), 1)
933
+ y("span", tl, O(t.label), 1)
553
934
  ]),
554
935
  _: 2
555
936
  }, 1032, ["class", "onClick"]),
556
- e.sortable !== !1 ? (s(), u("span", {
937
+ t.sortable !== !1 ? (s(), u("span", {
557
938
  key: 0,
558
939
  class: "hys-ui-pf-grid-sort-controls",
559
940
  role: "group",
560
- "aria-label": e.label + "排序"
941
+ "aria-label": t.label + "排序"
561
942
  }, [
562
- m(M, {
943
+ g(T, {
563
944
  type: "button",
564
945
  variant: "ghost",
565
946
  size: "sm",
566
- class: ue(["hys-ui-pf-grid-sort-direction", { "hys-ui-is-active": ((i = x.value.find((c) => c.key === e.key)) == null ? void 0 : i.direction) === "asc" }]),
567
- "aria-label": e.label + "升序",
568
- "aria-pressed": ((y = x.value.find((c) => c.key === e.key)) == null ? void 0 : y.direction) === "asc",
569
- onClick: A((c) => He(e, "asc"), ["stop"])
947
+ class: ve(["hys-ui-pf-grid-sort-direction", {
948
+ "hys-ui-is-active": ((r = S.value.find((d) => d.key === t.key)) == null ? void 0 : r.direction) === "asc"
949
+ }]),
950
+ "aria-label": t.label + "升序",
951
+ "aria-pressed": ((f = S.value.find((d) => d.key === t.key)) == null ? void 0 : f.direction) === "asc",
952
+ onClick: q((d) => pt(t, "asc"), ["stop"])
570
953
  }, {
571
954
  default: z(() => [
572
- m(F(Et), {
955
+ g(m(Ka), {
573
956
  size: 11,
574
957
  "aria-hidden": "true"
575
958
  })
576
959
  ]),
577
960
  _: 1
578
961
  }, 8, ["class", "aria-label", "aria-pressed", "onClick"]),
579
- m(M, {
962
+ g(T, {
580
963
  type: "button",
581
964
  variant: "ghost",
582
965
  size: "sm",
583
- class: ue(["hys-ui-pf-grid-sort-direction", { "hys-ui-is-active": ((f = x.value.find((c) => c.key === e.key)) == null ? void 0 : f.direction) === "desc" }]),
584
- "aria-label": e.label + "降序",
585
- "aria-pressed": ((ee = x.value.find((c) => c.key === e.key)) == null ? void 0 : ee.direction) === "desc",
586
- onClick: A((c) => He(e, "desc"), ["stop"])
966
+ class: ve(["hys-ui-pf-grid-sort-direction", {
967
+ "hys-ui-is-active": ((k = S.value.find((d) => d.key === t.key)) == null ? void 0 : k.direction) === "desc"
968
+ }]),
969
+ "aria-label": t.label + "降序",
970
+ "aria-pressed": ((_ = S.value.find((d) => d.key === t.key)) == null ? void 0 : _.direction) === "desc",
971
+ onClick: q((d) => pt(t, "desc"), ["stop"])
587
972
  }, {
588
973
  default: z(() => [
589
- m(F(Ae), {
974
+ g(m(it), {
590
975
  size: 11,
591
976
  "aria-hidden": "true"
592
977
  })
593
978
  ]),
594
979
  _: 1
595
980
  }, 8, ["class", "aria-label", "aria-pressed", "onClick"])
596
- ], 8, Qt)) : k("", !0)
981
+ ], 8, al)) : h("", !0)
597
982
  ]),
598
- e.filterable !== !1 ? (s(), ce(M, {
983
+ t.filterable !== !1 ? (s(), D(T, {
599
984
  key: 0,
600
985
  variant: "ghost",
601
986
  size: "sm",
602
987
  type: "button",
603
- class: ue(["hys-ui-pf-grid-filter", { "hys-ui-is-filtered": !!P.value[e.key] }]),
604
- "aria-label": "筛选" + e.label,
605
- "aria-expanded": ae.value,
606
- onClick: (c) => et(e)
988
+ class: ve(["hys-ui-pf-grid-filter", {
989
+ "hys-ui-is-filtered": !!ct(t.key),
990
+ "hys-ui-is-filtering": j.value && ae.value === t.key
991
+ }]),
992
+ "aria-label": "筛选" + t.label,
993
+ "aria-expanded": j.value,
994
+ "aria-controls": m(ut),
995
+ title: j.value && ae.value === t.key ? "再次点击收起筛选(Esc)" : "筛选" + t.label,
996
+ onClick: (d) => fa(t)
607
997
  }, {
608
998
  default: z(() => [
609
- m(F(Bt), {
999
+ g(m(Aa), {
610
1000
  size: 13,
611
1001
  "aria-hidden": "true"
612
1002
  })
613
1003
  ]),
614
1004
  _: 1
615
- }, 8, ["aria-label", "class", "aria-expanded", "onClick"])) : k("", !0),
616
- e.resizable !== !1 ? (s(), u("span", {
1005
+ }, 8, ["aria-label", "aria-expanded", "aria-controls", "title", "class", "onClick"])) : h("", !0),
1006
+ t.resizable !== !1 ? (s(), u("span", {
617
1007
  key: 1,
618
1008
  class: "hys-ui-pf-grid-resize",
619
1009
  role: "separator",
620
1010
  tabindex: "0",
621
- "aria-label": "调整" + e.label + "列宽",
622
- onPointerdown: (c) => kt(c, e),
623
- onKeydown: [
624
- ve(A((c) => p.value = { ...p.value, [e.key]: Math.max(e.minWidth || 80, (p.value[e.key] || e.width || 160) - 10) }, ["prevent"]), ["left"]),
625
- ve(A((c) => p.value = { ...p.value, [e.key]: Math.min(e.maxWidth || 800, (p.value[e.key] || e.width || 160) + 10) }, ["prevent"]), ["right"])
626
- ]
627
- }, null, 40, Yt)) : k("", !0)
1011
+ "aria-label": "调整" + t.label + "列宽",
1012
+ onPointerdown: (d) => va(d, t),
1013
+ "aria-orientation": "vertical",
1014
+ "aria-valuemin": Math.min(Ne(t), B(t)),
1015
+ "aria-valuemax": Math.max(tt(t), B(t)),
1016
+ "aria-valuenow": B(t),
1017
+ onKeydown: (d) => ya(d, t)
1018
+ }, null, 40, ll)) : h("", !0)
628
1019
  ])
629
- ], 46, It);
1020
+ ], 46, Za);
630
1021
  }), 128))
631
1022
  ]),
632
- ae.value ? (s(), u("tr", {
1023
+ j.value ? (s(), u("tr", {
633
1024
  key: 0,
634
1025
  class: "hys-ui-pf-grid-filter-row",
635
- "aria-label": "列筛选",
636
- onKeydown: l[8] || (l[8] = ve(A((e) => ae.value = !1, ["stop"]), ["esc"]))
1026
+ id: m(ut),
1027
+ onKeydown: a[8] || (a[8] = nt(q((t) => wt(), ["stop", "prevent"]), ["esc"])),
1028
+ "aria-label": "列筛选"
637
1029
  }, [
638
- r.selectable ? (s(), u("td", Zt)) : k("", !0),
639
- (s(!0), u(B, null, de(L.value, (e) => (s(), u("td", {
640
- key: e.key,
641
- "data-filter-key": e.key,
642
- "data-column-key": e.key,
643
- style: X({ ...ke(e), background: "var(--hys-ui-surface-alt,var(--hys-ui-theme-surface-alt))" })
1030
+ v.selectable ? (s(), u("td", nl)) : h("", !0),
1031
+ (s(!0), u(N, null, ye(G.value, (t) => (s(), u("td", {
1032
+ key: t.key,
1033
+ "data-filter-key": t.key,
1034
+ "data-column-key": t.key,
1035
+ style: $(He(t))
644
1036
  }, [
645
- e.filterable !== !1 ? (s(), ce(ze, {
1037
+ t.filterable !== !1 ? (s(), D(Ie, {
646
1038
  key: 0,
647
- modelValue: P.value[e.key],
648
- "onUpdate:modelValue": (a) => P.value[e.key] = a,
649
- "aria-label": "过滤" + e.label,
1039
+ "model-value": ct(t.key),
1040
+ "onUpdate:modelValue": (l) => Pt(t.key, l),
1041
+ onFocus: (l) => ae.value = t.key,
1042
+ "aria-label": "过滤" + t.label,
650
1043
  placeholder: "筛选…",
651
1044
  clearable: ""
652
- }, null, 8, ["modelValue", "onUpdate:modelValue", "aria-label"])) : k("", !0)
653
- ], 12, _t))), 128))
654
- ], 32)) : k("", !0)
1045
+ }, null, 8, ["model-value", "onUpdate:modelValue", "onFocus", "aria-label"])) : h("", !0)
1046
+ ], 12, il))), 128))
1047
+ ], 40, ol)) : h("", !0)
655
1048
  ]),
656
- g("tbody", null, [
657
- r.loading ? (s(), u("tr", el, [
658
- g("td", {
659
- colspan: R.value.length + (r.selectable ? 1 : 0),
1049
+ y("tbody", null, [
1050
+ Fe.value ? (s(), u("tr", sl, [
1051
+ y("td", {
1052
+ colspan: Math.max(1, A.value.length + Number(v.selectable)),
660
1053
  class: "hys-ui-pf-grid-empty"
661
- }, "正在加载…", 8, tl)
662
- ])) : (s(), u(B, { key: 1 }, [
663
- (s(!0), u(B, null, de(st.value, (e) => (s(), u(B, {
664
- key: e.key
665
1054
  }, [
666
- e.kind === "group" ? (s(), u("tr", ll, [
667
- g("td", {
668
- colspan: R.value.length + (r.selectable ? 1 : 0)
1055
+ y("div", ul, [
1056
+ $e(e.$slots, "loading", {}, () => [
1057
+ a[21] || (a[21] = V("正在加载…", -1))
1058
+ ], !0)
1059
+ ])
1060
+ ], 8, rl)
1061
+ ])) : m(Ve) ? (s(), u("tr", dl, [
1062
+ y("td", {
1063
+ colspan: Math.max(1, A.value.length + Number(v.selectable)),
1064
+ class: "hys-ui-pf-grid-empty"
1065
+ }, [
1066
+ $e(e.$slots, "error", {
1067
+ error: m(Ve).error,
1068
+ retry: Ge
1069
+ }, () => [
1070
+ a[23] || (a[23] = y("span", { role: "status" }, "加载失败", -1)),
1071
+ g(T, {
1072
+ size: "sm",
1073
+ variant: "ghost",
1074
+ onClick: Ge
1075
+ }, {
1076
+ default: z(() => [...a[22] || (a[22] = [
1077
+ V("重试", -1)
1078
+ ])]),
1079
+ _: 1
1080
+ })
1081
+ ], !0)
1082
+ ], 8, cl)
1083
+ ])) : (s(), u(N, { key: 2 }, [
1084
+ (s(!0), u(N, null, ye(Yt.value, (t) => (s(), u(N, {
1085
+ key: t.key
1086
+ }, [
1087
+ t.kind === "group" ? (s(), u("tr", fl, [
1088
+ y("td", {
1089
+ colspan: A.value.length + Number(v.selectable)
669
1090
  }, [
670
- m(M, {
1091
+ g(T, {
671
1092
  variant: "ghost",
672
1093
  size: "sm",
673
- type: "button",
674
- "aria-expanded": !j.value.includes(e.key),
675
- onClick: (a) => dt(e.key)
1094
+ "aria-expanded": !se.value.has(t.key),
1095
+ onClick: (l) => _t(t.key)
676
1096
  }, {
677
1097
  default: z(() => {
678
- var a;
1098
+ var l;
679
1099
  return [
680
- (s(), ce(qe(j.value.includes(e.key) ? F(We) : F(Ae)), {
1100
+ (s(), D(Dt(
1101
+ se.value.has(t.key) ? m(Ft) : m(it)
1102
+ ), {
681
1103
  size: 15,
682
1104
  "aria-hidden": "true"
683
1105
  })),
684
- H(" " + E((a = Te.value.find((n) => n.key === G.value)) == null ? void 0 : a.label) + ":" + E(e.label) + " ", 1),
685
- g("span", null, "(" + E(e.count) + ")", 1)
1106
+ V(" " + O((l = F.value.get(he.value)) == null ? void 0 : l.label) + ":" + O(t.label) + " ", 1),
1107
+ y("span", null, "(" + O(t.count) + ")", 1)
686
1108
  ];
687
1109
  }),
688
1110
  _: 2
689
1111
  }, 1032, ["aria-expanded", "onClick"])
690
- ], 8, al)
691
- ])) : e.row ? (s(), u("tr", {
1112
+ ], 8, vl)
1113
+ ])) : (s(), u("tr", {
692
1114
  key: 1,
693
- onClick: (a) => V("rowClick", e.row)
1115
+ "data-grid-row": m(st)(t.item.id),
1116
+ onClick: (l) => x("rowClick", t.item.row)
694
1117
  }, [
695
- r.selectable ? (s(), u("td", ol, [
696
- m(Re, {
697
- "aria-label": "选择第" + ((e.index ?? 0) + 1) + "行",
698
- "model-value": h.value.includes(Z(e.row, e.index ?? 0)),
699
- onClick: l[9] || (l[9] = A(() => {
1118
+ v.selectable ? (s(), u("td", pl, [
1119
+ v.selectionType === "radio" ? (s(), D(Ha, {
1120
+ key: 0,
1121
+ name: m(Bt),
1122
+ "aria-label": "选择第" + (t.pageIndex + 1) + "行",
1123
+ "model-value": b.value[0] ?? null,
1124
+ value: t.item.id,
1125
+ disabled: !Oe(t.item),
1126
+ onClick: a[9] || (a[9] = q(() => {
700
1127
  }, ["stop"])),
701
- "onUpdate:modelValue": (a) => yt(Z(e.row, e.index ?? 0), a)
702
- }, null, 8, ["aria-label", "model-value", "onUpdate:modelValue"])
703
- ])) : k("", !0),
704
- (s(!0), u(B, null, de(L.value, (a) => {
705
- var n, d, i, y;
1128
+ "onUpdate:modelValue": (l) => et(t.item.id, !0)
1129
+ }, null, 8, ["name", "aria-label", "model-value", "value", "disabled", "onUpdate:modelValue"])) : (s(), D(rt, {
1130
+ key: 1,
1131
+ "aria-label": "选择第" + (t.pageIndex + 1) + "行",
1132
+ "model-value": Le.value.has(t.item.id),
1133
+ disabled: !Oe(t.item),
1134
+ onClick: a[10] || (a[10] = q(() => {
1135
+ }, ["stop"])),
1136
+ "onUpdate:modelValue": (l) => et(t.item.id, l)
1137
+ }, null, 8, ["aria-label", "model-value", "disabled", "onUpdate:modelValue"]))
1138
+ ])) : h("", !0),
1139
+ (s(!0), u(N, null, ye(G.value, (l, o) => {
1140
+ var n, r;
706
1141
  return s(), u("td", {
707
- key: a.key,
708
- "data-column-key": a.key,
709
- style: X({ ...ke(a), textAlign: a.align || "left" }),
710
- title: oe(e.row, a.key)
1142
+ key: l.key,
1143
+ "data-column-key": l.key,
1144
+ style: $({
1145
+ ...He(l),
1146
+ textAlign: l.align || "left"
1147
+ }),
1148
+ title: re(t.item.row, l)
711
1149
  }, [
712
- ((n = Q.value) == null ? void 0 : n.id) === Z(e.row, e.index ?? 0) && ((d = Q.value) == null ? void 0 : d.key) === a.key ? (s(), ce(ze, {
1150
+ ((n = W.value) == null ? void 0 : n.id) === t.item.id && ((r = W.value) == null ? void 0 : r.key) === l.key ? (s(), D(Ie, {
713
1151
  key: 0,
714
- modelValue: ge.value,
715
- "onUpdate:modelValue": l[10] || (l[10] = (f) => ge.value = f),
1152
+ modelValue: Ke.value,
1153
+ "onUpdate:modelValue": a[11] || (a[11] = (f) => Ke.value = f),
716
1154
  class: "hys-ui-pf-grid-edit",
717
- "aria-label": "编辑" + a.label,
718
- onClick: l[11] || (l[11] = A(() => {
1155
+ "aria-label": "编辑" + l.label,
1156
+ onClick: a[12] || (a[12] = q(() => {
719
1157
  }, ["stop"])),
720
1158
  onKeydown: [
721
- ve(A((f) => Ue(e.row, a), ["stop"]), ["enter"]),
722
- l[12] || (l[12] = ve(A((f) => Q.value = null, ["stop"]), ["esc"]))
1159
+ nt(q((f) => gt(t.item, l), ["stop"]), ["enter"]),
1160
+ a[13] || (a[13] = nt(q((f) => W.value = null, ["stop"]), ["esc"]))
723
1161
  ],
724
- onFocusout: (f) => Ue(e.row, a)
725
- }, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (s(), u(B, { key: 1 }, [
726
- r.treeMode && a.key === ((i = L.value[0]) == null ? void 0 : i.key) && e.row.__pfHasChildren ? (s(), ce(M, {
727
- key: 0,
728
- variant: "ghost",
729
- size: "sm",
730
- type: "button",
731
- class: "hys-ui-pf-grid-tree-toggle",
732
- style: X({ marginLeft: Number(e.row.__pfDepth || 0) * 16 + "px" }),
733
- "aria-expanded": J.value.includes(e.row[r.rowKey]),
734
- onClick: A((f) => rt(e.row[r.rowKey]), ["stop"])
735
- }, {
736
- default: z(() => [
737
- (s(), ce(qe(J.value.includes(e.row[r.rowKey]) ? F(Ae) : F(We)), {
738
- size: 15,
739
- "aria-hidden": "true"
740
- }))
741
- ]),
742
- _: 2
743
- }, 1032, ["style", "aria-expanded", "onClick"])) : r.treeMode && a.key === ((y = L.value[0]) == null ? void 0 : y.key) ? (s(), u("span", {
744
- key: 1,
745
- style: X({ display: "inline-block", width: Number(e.row.__pfDepth || 0) * 16 + 20 + "px" })
746
- }, null, 4)) : k("", !0),
747
- g("span", {
748
- onDblclick: A((f) => it(e.row, a), ["stop"])
1162
+ onFocusout: (f) => gt(t.item, l)
1163
+ }, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (s(), u(N, { key: 1 }, [
1164
+ v.treeMode && o === 0 ? (s(), u(N, { key: 0 }, [
1165
+ t.item.hasChildren ? (s(), D(T, {
1166
+ key: 0,
1167
+ variant: "ghost",
1168
+ size: "sm",
1169
+ class: "hys-ui-pf-grid-tree-toggle",
1170
+ style: $({ marginLeft: t.item.depth * 16 + "px" }),
1171
+ "aria-expanded": ie.value.has(t.item.id),
1172
+ "aria-label": ie.value.has(t.item.id) ? "折叠子行" : "展开子行",
1173
+ onClick: q((f) => Zt(t.item.id), ["stop"])
1174
+ }, {
1175
+ default: z(() => [
1176
+ (s(), D(Dt(
1177
+ ie.value.has(t.item.id) ? m(it) : m(Ft)
1178
+ ), {
1179
+ size: 15,
1180
+ "aria-hidden": "true"
1181
+ }))
1182
+ ]),
1183
+ _: 2
1184
+ }, 1032, ["style", "aria-expanded", "aria-label", "onClick"])) : (s(), u("span", {
1185
+ key: 1,
1186
+ style: $({
1187
+ display: "inline-block",
1188
+ width: t.item.depth * 16 + 20 + "px"
1189
+ })
1190
+ }, null, 4))
1191
+ ], 64)) : h("", !0),
1192
+ y("span", {
1193
+ onDblclick: q((f) => ea(t.item, l), ["stop"])
749
1194
  }, [
750
- At(t.$slots, a.key, {
751
- row: e.row,
752
- value: e.row[a.key]
1195
+ $e(e.$slots, l.key, {
1196
+ row: t.item.row,
1197
+ value: m(me)(t.item.row, l),
1198
+ index: t.item.index
753
1199
  }, () => [
754
- H(E(oe(e.row, a.key)), 1)
1200
+ V(O(re(t.item.row, l)), 1)
755
1201
  ], !0)
756
- ], 40, rl)
1202
+ ], 40, gl)
757
1203
  ], 64))
758
- ], 12, sl);
1204
+ ], 12, ml);
759
1205
  }), 128))
760
- ], 8, nl)) : k("", !0)
1206
+ ], 8, yl))
761
1207
  ], 64))), 128)),
762
- be.value.length ? k("", !0) : (s(), u("tr", il, [
763
- g("td", {
764
- colspan: R.value.length + (r.selectable ? 1 : 0),
1208
+ Xe.value.length ? h("", !0) : (s(), u("tr", hl, [
1209
+ y("td", {
1210
+ colspan: Math.max(1, A.value.length + Number(v.selectable)),
765
1211
  class: "hys-ui-pf-grid-empty"
766
- }, E(r.emptyText), 9, ul)
1212
+ }, [
1213
+ $e(e.$slots, "empty", {
1214
+ query: we()
1215
+ }, () => [
1216
+ V(O(v.emptyText), 1)
1217
+ ], !0)
1218
+ ], 8, kl)
767
1219
  ]))
768
1220
  ], 64))
769
1221
  ]),
770
- r.showSummary && !r.loading && q.value.length ? (s(), u("tfoot", dl, [
771
- g("tr", cl, [
772
- r.selectable ? (s(), u("td", fl, "合计")) : k("", !0),
773
- (s(!0), u(B, null, de(L.value, (e, a) => (s(), u("td", {
774
- key: e.key,
775
- "data-column-key": e.key,
776
- style: X({ ...ke(e), textAlign: e.align || "left" })
777
- }, E(e.summary ? ct(e) : !r.selectable && a === 0 ? "合计" : ""), 13, yl))), 128))
1222
+ v.showSummary && !Fe.value && !m(Ve) && be.value.length ? (s(), u("tfoot", bl, [
1223
+ y("tr", wl, [
1224
+ v.selectable ? (s(), u("td", Sl, "合计")) : h("", !0),
1225
+ (s(!0), u(N, null, ye(G.value, (t, l) => (s(), u("td", {
1226
+ key: t.key,
1227
+ "data-column-key": t.key,
1228
+ style: $({
1229
+ ...He(t),
1230
+ textAlign: t.align || "left"
1231
+ })
1232
+ }, O(t.summary || v.summaryMethod ? la(t) : !v.selectable && l === 0 ? "合计" : ""), 13, Cl))), 128))
778
1233
  ])
779
- ])) : k("", !0)
1234
+ ])) : h("", !0)
780
1235
  ], 6)
781
- ], 32),
782
- g("footer", vl, [
783
- m($t, {
784
- page: C.value,
785
- total: r.serverMode ? r.totalRows ?? r.rows.length : q.value.length,
786
- "page-size": ne.value,
787
- "show-size-changer": !0,
788
- "show-quick-jumper": !0,
789
- disabled: r.loading,
1236
+ ], 36),
1237
+ y("footer", xl, [
1238
+ !v.loadRows || m(De) !== void 0 ? (s(), D(Ua, {
1239
+ key: 0,
1240
+ page: ue.value,
1241
+ total: We.value,
1242
+ "page-size": Q.value,
1243
+ "show-size-changer": "",
1244
+ "show-quick-jumper": "",
1245
+ disabled: v.loading,
790
1246
  "page-size-options": [10, 12, 20, 50, 100],
791
- onChange: gt,
792
- onPageSizeChange: pt
793
- }, null, 8, ["page", "total", "page-size", "disabled"])
1247
+ onChange: Qt,
1248
+ "onUpdate:pageSize": Wt
1249
+ }, null, 8, ["page", "total", "page-size", "disabled"])) : h("", !0)
794
1250
  ])
795
- ], 16));
1251
+ ], 16, $a));
796
1252
  }
797
1253
  });
798
1254
  export {
799
- Ml as default
1255
+ Bl as default
800
1256
  };