hys-ui 0.2.0 → 0.4.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 (261) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +68 -59
  3. package/dist/components/HysAlert/HysAlert.vue.js +5 -54
  4. package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
  5. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
  6. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
  7. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
  8. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
  9. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
  10. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
  11. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
  12. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
  13. package/dist/components/HysButton/HysButton.vue.js +2 -2
  14. package/dist/components/HysButton/HysButton2.vue.js +227 -60
  15. package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
  16. package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
  17. package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
  18. package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
  19. package/dist/components/HysCascader/HysCascader.vue.js +2 -2
  20. package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
  21. package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
  22. package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
  23. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  24. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
  25. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
  26. package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
  27. package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
  28. package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
  29. package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
  30. package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
  31. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  32. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
  33. package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
  34. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
  35. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
  36. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
  37. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  38. package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
  39. package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
  40. package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
  41. package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
  42. package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
  43. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  44. package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
  45. package/dist/components/HysMention/HysMention.vue.js +1 -1
  46. package/dist/components/HysMention/HysMention2.vue.js +1092 -142
  47. package/dist/components/HysModal/HysModal.vue.js +2 -2
  48. package/dist/components/HysModal/HysModal2.vue.js +491 -85
  49. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  50. package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
  51. package/dist/components/HysPopover/HysPopover.vue.js +5 -91
  52. package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
  53. package/dist/components/HysProgress/HysProgress.vue.js +2 -2
  54. package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
  55. package/dist/components/HysSearch/HysSearch.vue.js +5 -82
  56. package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
  57. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  58. package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
  59. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  60. package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
  61. package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
  62. package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
  63. package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
  64. package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
  65. package/dist/components/HysTable/HysTable.vue.js +2 -2
  66. package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
  67. package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
  68. package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
  69. package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
  70. package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
  71. package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
  72. package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
  73. package/dist/components/HysTour/HysTour.vue.js +291 -63
  74. package/dist/components/HysTour/HysTour3.vue.js +5 -0
  75. package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
  76. package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
  77. package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
  78. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
  79. package/dist/components/HysTree/HysTree.vue.js +2 -2
  80. package/dist/components/HysTree/HysTree2.vue.js +195 -184
  81. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
  82. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
  83. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  84. package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
  85. package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
  86. package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
  87. package/dist/composables/buttonGroup.js +12 -0
  88. package/dist/composables/color.js +97 -0
  89. package/dist/composables/dataGrid.js +68 -0
  90. package/dist/composables/drawer.js +17 -0
  91. package/dist/composables/feedback.js +14 -0
  92. package/dist/composables/floatingPosition.js +18 -0
  93. package/dist/composables/mentionDocument.js +79 -0
  94. package/dist/composables/mentionEditor.js +58 -0
  95. package/dist/composables/menu.js +96 -0
  96. package/dist/composables/modal.js +14 -0
  97. package/dist/composables/overlayManager.js +48 -18
  98. package/dist/composables/progress.js +94 -0
  99. package/dist/composables/selectOptions.js +44 -38
  100. package/dist/composables/splitPaneSizes.js +58 -0
  101. package/dist/composables/table.js +128 -105
  102. package/dist/composables/tagInput.js +16 -0
  103. package/dist/composables/timeline.js +19 -0
  104. package/dist/composables/transfer.js +19 -17
  105. package/dist/composables/upload.js +55 -0
  106. package/dist/composables/uploadRequest.js +58 -0
  107. package/dist/composables/useAlert.js +124 -0
  108. package/dist/composables/useColorPicker.js +402 -0
  109. package/dist/composables/useContextMenu.js +514 -0
  110. package/dist/composables/useDataGridRemote.js +67 -0
  111. package/dist/composables/useDialog.js +86 -43
  112. package/dist/composables/useDrawerPush.js +33 -0
  113. package/dist/composables/useDrawerResize.js +221 -0
  114. package/dist/composables/useFloating.js +118 -80
  115. package/dist/composables/useHysModal.js +185 -0
  116. package/dist/composables/useMentionCaret.js +81 -0
  117. package/dist/composables/useMentionList.js +81 -0
  118. package/dist/composables/useMentionModel.js +90 -0
  119. package/dist/composables/useMentionOptions.js +421 -0
  120. package/dist/composables/useModal.js +295 -0
  121. package/dist/composables/useModalInteraction.js +394 -0
  122. package/dist/composables/usePopupSurface.js +458 -0
  123. package/dist/composables/useSplitPaneDrag.js +52 -0
  124. package/dist/composables/useSplitPaneStorage.js +38 -0
  125. package/dist/composables/useTable.js +344 -312
  126. package/dist/composables/useTableSticky.js +79 -0
  127. package/dist/composables/useTagInput.js +313 -0
  128. package/dist/composables/useTourLayout.js +129 -0
  129. package/dist/composables/useTransferMotion.js +185 -0
  130. package/dist/composables/useUpload.js +472 -0
  131. package/dist/composables/useUploadModel.js +65 -0
  132. package/dist/composables/useUploadRequests.js +266 -0
  133. package/dist/composables/useVirtualTableLayout.js +277 -0
  134. package/dist/composables/virtualTable.js +43 -0
  135. package/dist/config.js +11 -11
  136. package/dist/index.js +175 -153
  137. package/dist/internal/MultiSplitPane.vue.js +305 -0
  138. package/dist/internal/MultiSplitPane2.vue.js +4 -0
  139. package/dist/internal/PopupReference.js +39 -0
  140. package/dist/internal/PopupSurfacePanel.vue.js +7 -0
  141. package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
  142. package/dist/motion/PopupMotion.js +105 -0
  143. package/dist/motion/popup.js +10 -0
  144. package/dist/style.css +1 -1
  145. package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
  146. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
  147. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
  148. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
  149. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
  150. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
  151. package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
  152. package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
  153. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
  154. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
  155. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
  156. package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
  157. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
  158. package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
  159. package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
  160. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
  161. package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
  162. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
  163. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +3 -3
  164. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
  165. package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
  166. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  167. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
  168. package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
  169. package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
  170. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  171. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
  172. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
  173. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
  174. package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
  175. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
  176. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
  177. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
  178. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
  179. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
  180. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
  181. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  182. package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
  183. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
  184. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
  185. package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
  186. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
  187. package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
  188. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
  189. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
  190. package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
  191. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
  192. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
  193. package/dist/types/composables/autocomplete.d.ts +3 -0
  194. package/dist/types/composables/avatar.d.ts +3 -0
  195. package/dist/types/composables/buttonGroup.d.ts +9 -0
  196. package/dist/types/composables/cascader.d.ts +3 -0
  197. package/dist/types/composables/color.d.ts +97 -0
  198. package/dist/types/composables/dataGrid.d.ts +100 -0
  199. package/dist/types/composables/datePicker.d.ts +3 -0
  200. package/dist/types/composables/drawer.d.ts +102 -0
  201. package/dist/types/composables/feedback.d.ts +98 -0
  202. package/dist/types/composables/floatingPosition.d.ts +14 -0
  203. package/dist/types/composables/formContext.d.ts +2 -0
  204. package/dist/types/composables/mention.d.ts +284 -0
  205. package/dist/types/composables/mentionDocument.d.ts +15 -0
  206. package/dist/types/composables/mentionEditor.d.ts +7 -0
  207. package/dist/types/composables/menu.d.ts +183 -0
  208. package/dist/types/composables/modal.d.ts +185 -0
  209. package/dist/types/composables/overlayManager.d.ts +7 -3
  210. package/dist/types/composables/popupSurface.d.ts +83 -0
  211. package/dist/types/composables/progress.d.ts +92 -0
  212. package/dist/types/composables/selectOptions.d.ts +7 -0
  213. package/dist/types/composables/splitPaneSizes.d.ts +11 -0
  214. package/dist/types/composables/table.d.ts +119 -6
  215. package/dist/types/composables/tagInput.d.ts +96 -0
  216. package/dist/types/composables/timeline.d.ts +82 -0
  217. package/dist/types/composables/tour.d.ts +68 -0
  218. package/dist/types/composables/transfer.d.ts +7 -0
  219. package/dist/types/composables/tree.d.ts +3 -0
  220. package/dist/types/composables/treeSelect.d.ts +3 -0
  221. package/dist/types/composables/upload.d.ts +202 -0
  222. package/dist/types/composables/uploadRequest.d.ts +3 -0
  223. package/dist/types/composables/useAlert.d.ts +21 -0
  224. package/dist/types/composables/useCascader.d.ts +1 -1
  225. package/dist/types/composables/useColorPicker.d.ts +101 -0
  226. package/dist/types/composables/useContextMenu.d.ts +81 -0
  227. package/dist/types/composables/useDataGridRemote.d.ts +15 -0
  228. package/dist/types/composables/useDialog.d.ts +16 -3
  229. package/dist/types/composables/useDrawerPush.d.ts +6 -0
  230. package/dist/types/composables/useDrawerResize.d.ts +27 -0
  231. package/dist/types/composables/useFloating.d.ts +22 -3
  232. package/dist/types/composables/useHysModal.d.ts +44 -0
  233. package/dist/types/composables/useMentionCaret.d.ts +6 -0
  234. package/dist/types/composables/useMentionList.d.ts +23 -0
  235. package/dist/types/composables/useMentionModel.d.ts +14 -0
  236. package/dist/types/composables/useMentionOptions.d.ts +26 -0
  237. package/dist/types/composables/useModal.d.ts +62 -0
  238. package/dist/types/composables/useModalInteraction.d.ts +27 -0
  239. package/dist/types/composables/usePopupSurface.d.ts +3341 -0
  240. package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
  241. package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
  242. package/dist/types/composables/useTable.d.ts +7 -3
  243. package/dist/types/composables/useTableSticky.d.ts +22 -0
  244. package/dist/types/composables/useTagInput.d.ts +66 -0
  245. package/dist/types/composables/useTourLayout.d.ts +33 -0
  246. package/dist/types/composables/useTransferMotion.d.ts +36 -0
  247. package/dist/types/composables/useUpload.d.ts +94 -0
  248. package/dist/types/composables/useUploadModel.d.ts +14 -0
  249. package/dist/types/composables/useUploadRequests.d.ts +38 -0
  250. package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
  251. package/dist/types/composables/virtualTable.d.ts +126 -0
  252. package/dist/types/config.d.ts +1 -0
  253. package/dist/types/index.d.ts +53 -3
  254. package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
  255. package/dist/types/internal/PopupReference.d.ts +18 -0
  256. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
  257. package/dist/types/motion/PopupMotion.d.ts +59 -0
  258. package/dist/types/motion/popup.d.ts +12 -0
  259. package/package.json +3 -2
  260. package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
  261. package/dist/components/HysTour/HysTour2.vue.js +0 -4
@@ -1,71 +1,328 @@
1
- import { defineComponent as g, ref as M, computed as v, watch as z, onDeactivated as B, onBeforeUnmount as P, openBlock as V, createElementBlock as C, mergeProps as D, unref as I, createElementVNode as h, renderSlot as w } from "vue";
2
- import { useHysRootAttrs as N } from "../../config.js";
3
- const R = { class: "hys-ui-ent-split-first" }, F = ["tabindex", "aria-disabled", "aria-orientation", "aria-valuenow", "aria-valuemin", "aria-valuemax"], H = { class: "hys-ui-ent-split-second" }, K = /* @__PURE__ */ g({
1
+ import { defineComponent as ze, useId as he, ref as b, computed as d, watch as B, onMounted as Pe, onActivated as ke, onDeactivated as we, onBeforeUnmount as Se, openBlock as h, createBlock as J, mergeProps as oe, createSlots as Ce, withCtx as Q, renderSlot as y, normalizeProps as g, guardReactiveProps as z, createElementBlock as j, unref as X, createElementVNode as A, resolveDynamicComponent as re, createCommentVNode as Y, nextTick as Z } from "vue";
2
+ import { ChevronUp as Re, ChevronRight as ue, ChevronLeft as de, ChevronDown as xe } from "lucide-vue-next";
3
+ import { useHysRootAttrs as Ve } from "../../config.js";
4
+ import { useSplitPaneDrag as Ae } from "../../composables/useSplitPaneDrag.js";
5
+ import { useSplitPaneStorage as $e } from "../../composables/useSplitPaneStorage.js";
6
+ import Ee from "../../internal/MultiSplitPane.vue.js";
7
+ const Le = ["inert"], Me = ["tabindex", "aria-label", "aria-controls", "aria-disabled", "aria-orientation", "aria-valuenow", "aria-valuemin", "aria-valuemax", "data-resizing", "aria-keyshortcuts"], Be = {
8
+ class: "hys-ui-splitter-grip",
9
+ "aria-hidden": "true"
10
+ }, De = ["aria-label", "aria-expanded", "data-collapsed", "disabled"], Ne = ["aria-label", "aria-expanded", "data-collapsed", "disabled"], Fe = ["inert"], He = {
11
+ key: 0,
12
+ class: "hys-ui-splitter-preview",
13
+ "aria-hidden": "true"
14
+ }, Te = /* @__PURE__ */ ze({
4
15
  __name: "HysSplitPane",
5
16
  props: {
6
- modelValue: { default: 40 },
17
+ modelValue: {},
18
+ defaultValue: { default: 40 },
7
19
  min: { default: 15 },
8
20
  max: { default: 85 },
9
- vertical: { type: Boolean, default: !1 },
21
+ vertical: { type: Boolean },
22
+ layout: {},
10
23
  disabled: { type: Boolean },
11
- step: { default: 2 }
24
+ step: { default: 2 },
25
+ lazy: { type: Boolean },
26
+ firstPanel: {},
27
+ secondPanel: {},
28
+ panels: {},
29
+ sizes: {},
30
+ storageKey: {},
31
+ dividerSize: {},
32
+ doubleClickAction: {},
33
+ ariaLabel: { default: "调整面板比例" },
34
+ firstLabel: { default: "前面板" },
35
+ secondLabel: { default: "后面板" }
12
36
  },
13
- emits: ["update:modelValue", "resizeStart", "resizeEnd"],
14
- setup(l, { emit: E }) {
15
- const a = l, d = E, x = N(), c = M(), s = v(() => Math.max(0, Math.min(100, Number.isFinite(a.min) ? a.min : 0))), m = v(() => Math.max(s.value, Math.min(100, Number.isFinite(a.max) ? a.max : 100))), p = (e) => Math.max(s.value, Math.min(m.value, Number.isFinite(e) ? e : s.value)), u = v(() => p(a.modelValue));
16
- let r = () => {
17
- };
18
- z(() => [a.disabled, a.vertical, a.min, a.max], () => r()), B(() => r()), P(() => r());
19
- function L(e) {
20
- if (r(), !c.value || a.disabled || e.button !== 0) return;
21
- const t = e.currentTarget, n = c.value.getBoundingClientRect(), f = a.vertical, y = f ? n.height : n.width;
22
- if (!y) return;
23
- e.preventDefault(), t.setPointerCapture(e.pointerId), d("resizeStart");
24
- const b = (o) => {
25
- if (a.disabled || o.pointerId !== e.pointerId) return;
26
- const A = (f ? o.clientY - n.top : o.clientX - n.left) / y * 100;
27
- d("update:modelValue", Math.round(p(A)));
28
- }, i = () => {
29
- var o;
30
- r = () => {
31
- }, t.removeEventListener("pointermove", b), t.removeEventListener("pointerup", i), t.removeEventListener("pointercancel", i), t.removeEventListener("lostpointercapture", i), (o = t.hasPointerCapture) != null && o.call(t, e.pointerId) && t.releasePointerCapture(e.pointerId), d("resizeEnd", u.value);
32
- };
33
- r = i, t.addEventListener("pointermove", b), t.addEventListener("pointerup", i), t.addEventListener("pointercancel", i), t.addEventListener("lostpointercapture", i);
37
+ emits: ["update:modelValue", "resizeStart", "resize", "resizeEnd", "collapse", "update:sizes", "panelResizeStart", "panelResize", "panelResizeEnd", "panelCollapse"],
38
+ setup(t, { expose: ce, emit: ve }) {
39
+ const a = t, u = ve, fe = Ve(), _ = he(), O = _ + "-first", T = _ + "-second", $ = b(), P = b(), k = b(), E = b(0), w = b(!1), L = b(), D = b(), N = b(!1), F = d(() => Number.isFinite(a.dividerSize) ? Math.max(1, Math.min(48, a.dividerSize)) : 6);
40
+ $e(
41
+ () => a.panels === void 0 && a.modelValue === void 0 && a.storageKey ? a.storageKey + ":ratio" : void 0,
42
+ D,
43
+ (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0
44
+ );
45
+ const r = d(() => a.layout ? a.layout === "vertical" : a.vertical), S = d(() => {
46
+ var e, l;
47
+ return !a.disabled && ((e = a.firstPanel) == null ? void 0 : e.resizable) !== !1 && ((l = a.secondPanel) == null ? void 0 : l.resizable) !== !1;
48
+ }), H = (e, l) => Number.isFinite(e) ? Math.min(100, Math.max(0, e)) : l;
49
+ function K(e, l) {
50
+ if (e === void 0) return l;
51
+ const i = typeof e == "number" ? e : Number.parseFloat(e);
52
+ return typeof e == "string" && e.endsWith("%") ? H(i, l) : E.value > 0 ? H(i / E.value * 100, l) : l;
53
+ }
54
+ const C = d(() => {
55
+ var e, l;
56
+ return Math.max(
57
+ K((e = a.firstPanel) == null ? void 0 : e.min, H(a.min, 0)),
58
+ 100 - K((l = a.secondPanel) == null ? void 0 : l.max, 100)
59
+ );
60
+ }), I = d(() => {
61
+ var e, l;
62
+ return Math.max(C.value, Math.min(
63
+ K((e = a.firstPanel) == null ? void 0 : e.max, H(a.max, 100)),
64
+ 100 - K((l = a.secondPanel) == null ? void 0 : l.min, 0)
65
+ ));
66
+ });
67
+ function R(e) {
68
+ return Math.min(I.value, Math.max(C.value, Number.isFinite(e) ? e : C.value));
69
+ }
70
+ const o = d(() => {
71
+ var l, i;
72
+ const e = a.modelValue ?? D.value ?? a.defaultValue;
73
+ return e === 0 && ((l = a.firstPanel) != null && l.collapsible) || e === 100 && ((i = a.secondPanel) != null && i.collapsible) ? e : R(e);
74
+ }), x = d(
75
+ () => o.value === 0 ? "first" : o.value === 100 ? "second" : void 0
76
+ );
77
+ let ee = o.value > 0 && o.value < 100 ? o.value : R(a.defaultValue);
78
+ B(o, (e) => {
79
+ e > 0 && e < 100 && (ee = e);
80
+ }, { flush: "sync" }), B(x, (e, l) => {
81
+ a.panels === void 0 && (l && u("collapse", l, !1), e && u("collapse", e, !0));
82
+ });
83
+ function U(e) {
84
+ e !== o.value && (a.modelValue === void 0 && (D.value = e), u("update:modelValue", e));
85
+ }
86
+ async function V(e) {
87
+ if (a.panels !== void 0) return !1;
88
+ const l = e === "first" ? a.firstPanel : a.secondPanel;
89
+ if (a.disabled || !(l != null && l.collapsible)) return !1;
90
+ const i = x.value, n = i === e ? R(ee) : e === "first" ? 0 : 100;
91
+ return c.finish(!0), U(n), await Z(), i !== x.value;
92
+ }
93
+ const v = d(() => ({
94
+ collapsed: x.value === "first",
95
+ toggle: () => V("first")
96
+ })), f = d(() => ({
97
+ collapsed: x.value === "second",
98
+ toggle: () => V("second")
99
+ })), le = d(() => r.value ? Re : w.value ? ue : de), ae = d(() => r.value ? xe : w.value ? de : ue), pe = d(() => ({
100
+ separator: 0,
101
+ before: "first",
102
+ after: "second",
103
+ vertical: r.value,
104
+ disabled: !S.value,
105
+ resizing: N.value
106
+ }));
107
+ async function ie() {
108
+ var i, n, m;
109
+ if (a.disabled) return !1;
110
+ if (a.panels !== void 0) return ((i = k.value) == null ? void 0 : i.resetSizes()) ?? !1;
111
+ c.finish(!0);
112
+ const e = a.defaultValue, l = e === 0 && ((n = a.firstPanel) != null && n.collapsible) || e === 100 && ((m = a.secondPanel) != null && m.collapsible) ? e : R(e);
113
+ return a.modelValue === void 0 && (D.value = void 0), a.modelValue !== l && u("update:modelValue", l), await Z(), o.value === l;
114
+ }
115
+ function te() {
116
+ var l, i, n;
117
+ const e = x.value;
118
+ if (e && ((l = e === "first" ? a.firstPanel : a.secondPanel) != null && l.collapsible))
119
+ return V(e);
120
+ if ((i = a.firstPanel) != null && i.collapsible) return V("first");
121
+ if ((n = a.secondPanel) != null && n.collapsible) return V("second");
34
122
  }
35
- function k(e) {
36
- if (a.disabled || !["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Home", "End"].includes(e.key)) return;
123
+ function me() {
124
+ a.doubleClickAction === "reset" ? ie() : a.doubleClickAction === "collapse" && te();
125
+ }
126
+ let p;
127
+ function W() {
128
+ if (!$.value || !P.value) return;
129
+ const e = $.value, l = e.getBoundingClientRect(), i = r.value ? e.clientHeight || l.height : e.clientWidth || l.width, n = r.value ? P.value.offsetHeight : P.value.offsetWidth;
130
+ E.value = Math.max(0, i - (n || F.value)), w.value = getComputedStyle(e).direction === "rtl";
131
+ }
132
+ function q() {
133
+ p || !$.value || !P.value || (W(), typeof ResizeObserver == "function" && (p = new ResizeObserver(W), p.observe($.value), p.observe(P.value)));
134
+ }
135
+ const c = Ae(
136
+ (e) => {
137
+ a.lazy ? L.value = e : U(e), u("resize", e);
138
+ },
139
+ (e, l, i) => {
140
+ N.value = !1, !l && a.lazy && U(e), L.value = void 0, i && Z(() => u("resizeEnd", o.value, { cancelled: l }));
141
+ }
142
+ );
143
+ function be(e) {
144
+ !S.value || c.active() || e.button !== 0 || (W(), c.start(e, {
145
+ vertical: r.value,
146
+ direction: !r.value && w.value ? -1 : 1,
147
+ available: E.value,
148
+ initial: o.value,
149
+ constrain: (l) => R(Math.round(l))
150
+ }) && (N.value = !0, a.lazy && (L.value = o.value), u("resizeStart")));
151
+ }
152
+ function ye(e) {
153
+ var m, M;
154
+ if (e.key === "Enter" && !a.disabled && !c.active() && ((m = a.firstPanel) != null && m.collapsible || (M = a.secondPanel) != null && M.collapsible)) {
155
+ e.preventDefault(), te();
156
+ return;
157
+ }
158
+ if (!S.value || c.active() || !["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Home", "End"].includes(e.key)) return;
37
159
  e.preventDefault();
38
- const t = (Number.isFinite(a.step) && a.step > 0 ? a.step : 2) * (e.shiftKey ? 5 : 1), n = e.key === "Home" ? s.value : e.key === "End" ? m.value : u.value + (["ArrowRight", "ArrowDown"].includes(e.key) ? t : -t);
39
- d("update:modelValue", p(n));
160
+ const l = (Number.isFinite(a.step) && a.step > 0 ? a.step : 2) * (e.shiftKey ? 5 : 1), i = e.key === "ArrowDown" || e.key === (w.value && !r.value ? "ArrowLeft" : "ArrowRight"), n = e.key === "Home" ? C.value : e.key === "End" ? I.value : R(o.value + (i ? l : -l));
161
+ U(n);
162
+ }
163
+ function G() {
164
+ c.finish(!0, !1), p == null || p.disconnect(), p = void 0;
40
165
  }
41
- return (e, t) => (V(), C("div", D(I(x), {
42
- ref_key: "host",
43
- ref: c,
44
- class: ["hys-ui-ent-split", { "hys-ui-vertical": l.vertical }],
45
- style: { "--hys-ui-split": u.value + "%" }
46
- }), [
47
- h("div", R, [
48
- w(e.$slots, "first")
49
- ]),
50
- h("div", {
51
- class: "hys-ui-ent-split-handle",
52
- role: "separator",
53
- tabindex: l.disabled ? -1 : 0,
54
- "aria-label": "调整面板比例",
55
- "aria-disabled": l.disabled || void 0,
56
- "aria-orientation": l.vertical ? "horizontal" : "vertical",
57
- "aria-valuenow": u.value,
58
- "aria-valuemin": s.value,
59
- "aria-valuemax": m.value,
60
- onPointerdown: L,
61
- onKeydown: k
62
- }, null, 40, F),
63
- h("div", H, [
64
- w(e.$slots, "second")
65
- ])
66
- ], 16));
166
+ return B(
167
+ [S, r, C, I, E, w, () => a.lazy],
168
+ () => c.finish(!0),
169
+ { flush: "sync" }
170
+ ), B([r, F], W, { flush: "post" }), B(() => a.panels !== void 0, (e) => {
171
+ e ? G() : q();
172
+ }, { flush: "post" }), Pe(q), ke(q), we(G), Se(G), ce({
173
+ togglePanel: V,
174
+ togglePane: (e, l) => {
175
+ var i;
176
+ return ((i = k.value) == null ? void 0 : i.togglePane(e, l)) ?? Promise.resolve(!1);
177
+ },
178
+ getPanelSizes: () => {
179
+ var e;
180
+ return ((e = k.value) == null ? void 0 : e.getPanelSizes()) ?? {};
181
+ },
182
+ getPaneElement: (e) => {
183
+ var l;
184
+ return (l = k.value) == null ? void 0 : l.getPaneElement(e);
185
+ },
186
+ resizePane: (e, l, i) => {
187
+ var n;
188
+ return ((n = k.value) == null ? void 0 : n.resizePane(e, l, i)) ?? Promise.resolve(!1);
189
+ },
190
+ resetSizes: ie
191
+ }), (e, l) => {
192
+ var i, n, m, M, se, ne;
193
+ return t.panels !== void 0 ? (h(), J(Ee, oe({
194
+ key: 0,
195
+ ref_key: "multi",
196
+ ref: k,
197
+ panels: t.panels,
198
+ sizes: t.sizes,
199
+ vertical: r.value,
200
+ disabled: t.disabled,
201
+ lazy: t.lazy,
202
+ step: t.step,
203
+ "storage-key": t.storageKey,
204
+ "divider-size": F.value,
205
+ "double-click-action": t.doubleClickAction
206
+ }, { ariaLabel: t.ariaLabel }, {
207
+ "onUpdate:sizes": l[0] || (l[0] = (s) => u("update:sizes", s)),
208
+ onPanelResizeStart: l[1] || (l[1] = (s) => u("panelResizeStart", s)),
209
+ onPanelResize: l[2] || (l[2] = (s) => u("panelResize", s)),
210
+ onPanelResizeEnd: l[3] || (l[3] = (s) => u("panelResizeEnd", s)),
211
+ onPanelCollapse: l[4] || (l[4] = (s, ge) => u("panelCollapse", s, ge))
212
+ }), Ce({ _: 2 }, [
213
+ e.$slots.panel ? {
214
+ name: "panel",
215
+ fn: Q((s) => [
216
+ y(e.$slots, "panel", g(z(s)))
217
+ ]),
218
+ key: "0"
219
+ } : void 0,
220
+ e.$slots["panel-collapse"] ? {
221
+ name: "panel-collapse",
222
+ fn: Q((s) => [
223
+ y(e.$slots, "panel-collapse", g(z(s)))
224
+ ]),
225
+ key: "1"
226
+ } : void 0,
227
+ e.$slots.handle ? {
228
+ name: "handle",
229
+ fn: Q((s) => [
230
+ y(e.$slots, "handle", g(z(s)))
231
+ ]),
232
+ key: "2"
233
+ } : void 0
234
+ ]), 1040, ["panels", "sizes", "vertical", "disabled", "lazy", "step", "storage-key", "divider-size", "double-click-action"])) : (h(), j("div", oe({ key: 1 }, X(fe), {
235
+ ref_key: "host",
236
+ ref: $,
237
+ class: ["hys-ui-ent-split", { "hys-ui-vertical": r.value }],
238
+ style: {
239
+ "--hys-ui-splitter-size": F.value + "px",
240
+ "--hys-ui-split-ratio": o.value / 100,
241
+ "--hys-ui-split-preview": (L.value ?? 0) / 100
242
+ }
243
+ }), [
244
+ A("div", {
245
+ id: O,
246
+ class: "hys-ui-ent-split-first",
247
+ inert: v.value.collapsed
248
+ }, [
249
+ y(e.$slots, "first", g(z(v.value)))
250
+ ], 8, Le),
251
+ A("div", {
252
+ ref_key: "bar",
253
+ ref: P,
254
+ class: "hys-ui-splitter-bar"
255
+ }, [
256
+ A("div", {
257
+ class: "hys-ui-ent-split-handle",
258
+ role: "separator",
259
+ tabindex: S.value ? 0 : -1,
260
+ "aria-label": t.ariaLabel,
261
+ "aria-controls": `${O} ${T}`,
262
+ "aria-disabled": !S.value || void 0,
263
+ "aria-orientation": r.value ? "horizontal" : "vertical",
264
+ "aria-valuenow": o.value,
265
+ "aria-valuemin": (i = t.firstPanel) != null && i.collapsible ? 0 : C.value,
266
+ "aria-valuemax": (n = t.secondPanel) != null && n.collapsible ? 100 : I.value,
267
+ "data-resizing": N.value || void 0,
268
+ "aria-keyshortcuts": (m = t.firstPanel) != null && m.collapsible || (M = t.secondPanel) != null && M.collapsible ? "Enter" : void 0,
269
+ onPointerdown: be,
270
+ onLostpointercapture: l[5] || (l[5] = //@ts-ignore
271
+ (...s) => X(c).cancel && X(c).cancel(...s)),
272
+ onKeydown: ye,
273
+ onDblclick: me
274
+ }, [
275
+ A("span", Be, [
276
+ y(e.$slots, "handle", g(z(pe.value)), () => [
277
+ l[8] || (l[8] = A("span", { class: "hys-ui-splitter-dots" }, null, -1))
278
+ ])
279
+ ])
280
+ ], 40, Me),
281
+ (se = t.firstPanel) != null && se.collapsible ? (h(), j("button", {
282
+ key: 0,
283
+ class: "hys-ui-splitter-toggle hys-ui-splitter-toggle-first",
284
+ type: "button",
285
+ "aria-label": (v.value.collapsed ? "展开" : "折叠") + t.firstLabel,
286
+ "aria-controls": O,
287
+ "aria-expanded": !v.value.collapsed,
288
+ "data-collapsed": v.value.collapsed || void 0,
289
+ disabled: t.disabled,
290
+ onClick: l[6] || (l[6] = //@ts-ignore
291
+ (...s) => v.value.toggle && v.value.toggle(...s))
292
+ }, [
293
+ y(e.$slots, "first-collapse", g(z(v.value)), () => [
294
+ (h(), J(re(v.value.collapsed ? ae.value : le.value), { size: 13 }))
295
+ ])
296
+ ], 8, De)) : Y("", !0),
297
+ (ne = t.secondPanel) != null && ne.collapsible ? (h(), j("button", {
298
+ key: 1,
299
+ class: "hys-ui-splitter-toggle hys-ui-splitter-toggle-second",
300
+ type: "button",
301
+ "aria-label": (f.value.collapsed ? "展开" : "折叠") + t.secondLabel,
302
+ "aria-controls": T,
303
+ "aria-expanded": !f.value.collapsed,
304
+ "data-collapsed": f.value.collapsed || void 0,
305
+ disabled: t.disabled,
306
+ onClick: l[7] || (l[7] = //@ts-ignore
307
+ (...s) => f.value.toggle && f.value.toggle(...s))
308
+ }, [
309
+ y(e.$slots, "second-collapse", g(z(f.value)), () => [
310
+ (h(), J(re(f.value.collapsed ? le.value : ae.value), { size: 13 }))
311
+ ])
312
+ ], 8, Ne)) : Y("", !0)
313
+ ], 512),
314
+ A("div", {
315
+ id: T,
316
+ class: "hys-ui-ent-split-second",
317
+ inert: f.value.collapsed
318
+ }, [
319
+ y(e.$slots, "second", g(z(f.value)))
320
+ ], 8, Fe),
321
+ L.value !== void 0 ? (h(), j("div", He)) : Y("", !0)
322
+ ], 16));
323
+ };
67
324
  }
68
325
  });
69
326
  export {
70
- K as default
327
+ Te as default
71
328
  };
@@ -0,0 +1,5 @@
1
+ import o from "./HysSplitPane.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./HysTable2.vue.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-68f5fb01"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0fbf300e"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };