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
@@ -0,0 +1,185 @@
1
+ import { inject as K, watch as U, onActivated as V, onDeactivated as G, onBeforeUnmount as J } from "vue";
2
+ import { useHysRootAttrs as Q } from "../config.js";
3
+ import { useMotion as X } from "../motion/useMotion.js";
4
+ import { overlayOwnerKey as Y } from "./overlayManager.js";
5
+ import { transferToken as T } from "./transfer.js";
6
+ const D = (x) => '[data-transfer-key="' + x.replace(
7
+ /["\\\n\r\f]/g,
8
+ (a) => "\\" + a.codePointAt(0).toString(16) + " "
9
+ ) + '"]';
10
+ function ne(x, a) {
11
+ const j = Q(), { effectiveMotion: P } = X(), w = K(Y, void 0), C = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Set();
12
+ let A, L = 0, F = !0, k, b;
13
+ const q = () => Number.isFinite(a.moveDuration) ? Math.max(0, Math.min(1500, a.moveDuration)) : 240, E = () => Number.isFinite(a.maxAnimatedItems) ? Math.max(0, Math.min(12, Math.floor(a.maxAnimatedItems))) : 6, z = () => {
14
+ var e;
15
+ return F && ((e = x.value) == null ? void 0 : e.isConnected) && (w == null ? void 0 : w.value) !== !1 && a.animated !== !1 && a.moveAnimation !== "none" && q() > 0 && P.value !== "off";
16
+ };
17
+ function o() {
18
+ L++, A !== void 0 && cancelAnimationFrame(A), A = void 0, clearTimeout(k), k = void 0, window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o), window.removeEventListener("focusin", o), window.removeEventListener("blur", o), window.removeEventListener("keydown", B);
19
+ for (const e of M)
20
+ e.animation.cancel(), e.restore(), e.node.remove();
21
+ M.clear();
22
+ for (const e of C) e.classList.remove("hys-ui-transfer-landed");
23
+ C.clear(), b == null || b.classList.remove("hys-ui-transfer-received"), b = void 0;
24
+ }
25
+ function B(e) {
26
+ e.key === "Escape" && o();
27
+ }
28
+ function O(e) {
29
+ var s;
30
+ return (s = x.value) == null ? void 0 : s.querySelector(
31
+ '.hys-ui-transfer-pane[data-side="' + e + '"]'
32
+ );
33
+ }
34
+ function I(e, s) {
35
+ var v, g;
36
+ if (o(), !z() || !s.length) return;
37
+ const d = (v = O(
38
+ e === "right" ? "left" : "right"
39
+ )) == null ? void 0 : v.querySelector(".hys-ui-pf-transfer-list"), i = {
40
+ generation: L,
41
+ direction: e,
42
+ count: s.length,
43
+ samples: []
44
+ };
45
+ if (!d || !E() || typeof HTMLElement.prototype.animate != "function")
46
+ return i;
47
+ const r = d.getBoundingClientRect(), u = Math.max(0, r.top), c = Math.min(window.innerHeight, r.bottom);
48
+ if (r.right <= 0 || r.left >= window.innerWidth || c <= u)
49
+ return i;
50
+ const l = new Set(s.map(T)), n = /* @__PURE__ */ new Set();
51
+ function y(t) {
52
+ var S;
53
+ if (!t || !d.contains(t) || i.samples.length >= E())
54
+ return;
55
+ const f = t.dataset.transferKey;
56
+ if (!l.has(f) || n.has(f)) return;
57
+ const m = t.getBoundingClientRect();
58
+ !m.width || !m.height || m.bottom <= u || m.top >= c || (n.add(f), i.samples.push({
59
+ token: f,
60
+ label: (((S = t.querySelector(".hys-ui-transfer-label")) == null ? void 0 : S.textContent) ?? t.textContent ?? "").trim().slice(0, 120),
61
+ box: m
62
+ }));
63
+ }
64
+ if (s.length <= E())
65
+ for (const t of s)
66
+ y(d.querySelector(D(T(t))));
67
+ else if (document.elementFromPoint) {
68
+ const t = Math.min(24, Math.max(1, Math.ceil((c - u) / 20))), f = Math.max(
69
+ 1,
70
+ Math.min(window.innerWidth - 1, r.left + r.width / 2)
71
+ );
72
+ for (let m = 0; m < t && i.samples.length < E(); m++)
73
+ y(
74
+ (g = document.elementFromPoint(f, u + (m + 0.5) * (c - u) / t)) == null ? void 0 : g.closest(".hys-ui-transfer-row")
75
+ );
76
+ }
77
+ return i;
78
+ }
79
+ function N(e) {
80
+ if (!e || e.generation !== L || !z()) return;
81
+ const s = O(e.direction), d = s == null ? void 0 : s.querySelector(".hys-ui-pf-transfer-list");
82
+ if (!s || !d) return;
83
+ const i = d.getBoundingClientRect();
84
+ if (i.right <= 0 || i.left >= window.innerWidth || i.bottom <= 0 || i.top >= window.innerHeight)
85
+ return;
86
+ b = s, s.classList.add("hys-ui-transfer-received");
87
+ const r = e.samples.length ? getComputedStyle(x.value) : void 0, u = (c) => {
88
+ c.restore(), c.node.remove(), M.delete(c);
89
+ };
90
+ for (const [c, l] of e.samples.entries()) {
91
+ const n = d.querySelector(D(l.token)), y = n == null ? void 0 : n.getBoundingClientRect(), v = !!y && y.bottom > Math.max(0, i.top) && y.top < Math.min(window.innerHeight, i.bottom), g = v ? y : {
92
+ left: Math.max(8, i.left + 8),
93
+ top: Math.max(
94
+ 8,
95
+ Math.min(
96
+ window.innerHeight - 44,
97
+ i.top + Math.min(i.height / 2, 80) + c * 4
98
+ )
99
+ ),
100
+ width: Math.max(40, i.width - 16),
101
+ height: l.box.height
102
+ }, t = document.createElement("div");
103
+ t.className = "hys-ui-transfer-flight";
104
+ for (const [p, h] of Object.entries(j.value))
105
+ t.setAttribute(p, h);
106
+ t.setAttribute("aria-hidden", "true"), t.inert = !0, t.textContent = l.label + (c === e.samples.length - 1 && e.count > e.samples.length ? " · +" + (e.count - e.samples.length) : ""), Object.assign(t.style, {
107
+ left: l.box.left + "px",
108
+ top: l.box.top + "px",
109
+ width: l.box.width + "px",
110
+ height: l.box.height + "px",
111
+ fontFamily: r == null ? void 0 : r.fontFamily,
112
+ fontSize: r == null ? void 0 : r.fontSize
113
+ });
114
+ for (const p of [
115
+ "--hys-ui-primary",
116
+ "--hys-ui-primary-soft",
117
+ "--hys-ui-border",
118
+ "--hys-ui-surface",
119
+ "--hys-ui-text",
120
+ "--hys-ui-muted"
121
+ ]) {
122
+ const h = r == null ? void 0 : r.getPropertyValue(p);
123
+ h && t.style.setProperty(p, h);
124
+ }
125
+ const f = (n == null ? void 0 : n.style.opacity) ?? "", m = (n == null ? void 0 : n.style.transition) ?? "";
126
+ let S = !1;
127
+ const R = () => {
128
+ S || (S = !0, n && v && (n.style.opacity = f, n.style.transition = m));
129
+ };
130
+ n && v && (n.style.transition = "none", n.style.opacity = "0"), document.body.append(t);
131
+ const H = "translate3d(" + (g.left - l.box.left) + "px," + (g.top - l.box.top) + "px,0) scale(" + g.width / l.box.width + "," + g.height / l.box.height + ")", W = a.moveAnimation === "fade" ? [
132
+ { transform: H, opacity: 0 },
133
+ { transform: H, opacity: 1 }
134
+ ] : [
135
+ { transform: "translate3d(0,0,0) scale(1)", opacity: 0.9 },
136
+ { transform: H, opacity: 1 }
137
+ ];
138
+ try {
139
+ const p = t.animate(W, {
140
+ duration: q(),
141
+ easing: "cubic-bezier(.22,1,.36,1)",
142
+ fill: "both"
143
+ }), h = { node: t, animation: p, restore: R };
144
+ M.add(h), p.finished.then(
145
+ () => {
146
+ u(h), n && v && n.isConnected && e.generation === L && z() && a.highlightOnArrival !== !1 && (n.classList.add("hys-ui-transfer-landed"), C.add(n));
147
+ },
148
+ () => u(h)
149
+ );
150
+ } catch {
151
+ R(), t.remove();
152
+ }
153
+ }
154
+ A = requestAnimationFrame(() => {
155
+ A = void 0, e.generation === L && window.addEventListener("scroll", o, !0);
156
+ }), window.addEventListener("resize", o), window.addEventListener("focusin", o), window.addEventListener("blur", o), window.addEventListener("keydown", B), k = setTimeout(o, q() + 440);
157
+ }
158
+ return U(
159
+ () => [
160
+ a.animated,
161
+ a.moveAnimation,
162
+ a.moveDuration,
163
+ a.maxAnimatedItems,
164
+ a.highlightOnArrival,
165
+ P.value,
166
+ w == null ? void 0 : w.value
167
+ ],
168
+ o,
169
+ { flush: "sync" }
170
+ ), V(() => {
171
+ F = !0;
172
+ }), G(() => {
173
+ F = !1, o();
174
+ }), J(o), {
175
+ capture: I,
176
+ play: N,
177
+ stop: o,
178
+ cancelPlaying: () => {
179
+ (M.size || b) && o();
180
+ }
181
+ };
182
+ }
183
+ export {
184
+ ne as useTransferMotion
185
+ };
@@ -0,0 +1,472 @@
1
+ import { ref as T, inject as me, computed as ee, shallowRef as ae, watch as K, onDeactivated as je, onBeforeUnmount as Ee, onActivated as Pe, nextTick as pe } from "vue";
2
+ import { fieldKey as qe, formKey as Ie, useHysControlState as Ke } from "./formContext.js";
3
+ import { useChoiceNativeReset as Ne } from "./choiceModel.js";
4
+ import { useUploadModel as We } from "./useUploadModel.js";
5
+ import { useUploadRequests as Ce } from "./useUploadRequests.js";
6
+ import { uploadLocale as Be, uploadUrl as R, uploadImage as N, uploadStatus as we, uploadFailure as Q, uploadPercent as He } from "./upload.js";
7
+ function Ye(i, d) {
8
+ const te = T(), ie = T(), U = T(), c = T(!0), F = T(!1), A = T(!1), S = T(""), w = me(qe, void 0), k = me(Ie, void 0), j = Ke(i), m = ee(
9
+ () => c.value && !j.disabled.value && !i.readonly && !i.loading
10
+ ), ge = ee(() => ({ ...Be, ...i.locale })), o = We(i, d, () => c.value), x = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Set(), z = ae(/* @__PURE__ */ new Set());
11
+ let P, D = 0, p = 0, g, b, M, O;
12
+ const L = ae(/* @__PURE__ */ new Map()), I = ae(), re = () => Number.isFinite(i.limit) && i.limit > 0 ? Math.floor(i.limit) : 1 / 0, y = (e) => c.value && !e.aborted && m.value;
13
+ function X(e) {
14
+ const a = Q(e).message;
15
+ S.value = a, d("error", a);
16
+ }
17
+ function C() {
18
+ i.validateEvent !== !1 && !(k != null && k.resetting.value) && pe(() => {
19
+ var e;
20
+ c.value && !(k != null && k.resetting.value) && ((e = w == null ? void 0 : w.validate) == null || e.call(w, "change"));
21
+ });
22
+ }
23
+ function q(e, a, t) {
24
+ c.value && (S.value = t, d("error", t), d("invalid", { file: e, reason: a, message: t, files: o.files.value }));
25
+ }
26
+ function be(e) {
27
+ return !i.accept || i.accept.split(",").some((a) => {
28
+ const t = a.trim().toLowerCase(), r = e.type.toLowerCase();
29
+ return t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? r.startsWith(t.slice(0, -1)) : r === t;
30
+ });
31
+ }
32
+ async function le(e, a) {
33
+ if (y(a)) {
34
+ if (!be(e)) {
35
+ q(e, "type", "文件类型不符合要求:" + e.name);
36
+ return;
37
+ }
38
+ if (Number.isFinite(i.maxSize) && i.maxSize > 0 && e.size > i.maxSize) {
39
+ q(e, "size", "文件超过大小限制:" + e.name);
40
+ return;
41
+ }
42
+ try {
43
+ const t = i.beforeUpload ? await i.beforeUpload(e, { signal: a, files: o.files.value }) : void 0;
44
+ if (!y(a) || t === !1) return;
45
+ const r = t instanceof Blob ? t : e;
46
+ if (Number.isFinite(i.maxSize) && i.maxSize > 0 && r.size > i.maxSize) {
47
+ q(e, "size", "处理后的文件超过大小限制:" + e.name);
48
+ return;
49
+ }
50
+ return r;
51
+ } catch (t) {
52
+ y(a) && q(e, "validation", Q(t).message);
53
+ }
54
+ }
55
+ }
56
+ async function ye(e, a, t) {
57
+ const r = await o.commit(
58
+ (l) => l.map(
59
+ (u) => e.has(u.uid) && (t == null ? void 0 : t(u.uid)) !== !1 ? { ...u, ...e.get(u.uid) } : u
60
+ ),
61
+ a,
62
+ { guard: () => c.value && (t == null ? void 0 : t()) !== !1 }
63
+ );
64
+ return r && ["success", "error", "retry"].includes(a) && C(), r;
65
+ }
66
+ const f = Ce({
67
+ props: i,
68
+ files: o.files,
69
+ available: m,
70
+ live: () => c.value,
71
+ emit: d,
72
+ patch: ye,
73
+ forget: (e) => x.delete(e),
74
+ prepare: async (e, a) => {
75
+ if (!e.raw) return;
76
+ const t = x.get(e.uid);
77
+ if ((t == null ? void 0 : t.raw) === e.raw) return t.body;
78
+ const r = await le(e.raw, a);
79
+ return r && y(a) && x.set(e.uid, { raw: e.raw, body: r }), r;
80
+ }
81
+ });
82
+ function Y() {
83
+ D++, P == null || P.abort(), P = void 0, F.value = !1, A.value = !1, p = 0, U.value && (U.value.value = "");
84
+ }
85
+ function Z(e) {
86
+ return typeof e == "string" ? e : e.uid;
87
+ }
88
+ async function $(e) {
89
+ if (!m.value || F.value) return [];
90
+ const a = i.multiple === !1 ? [...e].slice(0, 1) : [...e];
91
+ if (!a.length) return [];
92
+ if ((i.multiple === !1 ? 0 : o.files.value.length) + a.length > re())
93
+ return d("exceed", a), U.value && (U.value.value = ""), [];
94
+ const t = ++D, r = new AbortController();
95
+ P = r, F.value = !0, S.value = "";
96
+ const l = [], u = /* @__PURE__ */ new Map();
97
+ try {
98
+ for (const n of a) {
99
+ if (t !== D || !y(r.signal)) return [];
100
+ const G = await le(n, r.signal);
101
+ if (!G) continue;
102
+ if (t !== D || !y(r.signal)) return [];
103
+ const ve = crypto.randomUUID();
104
+ let h;
105
+ try {
106
+ const J = {
107
+ uid: ve,
108
+ name: n.name,
109
+ size: n.size,
110
+ raw: n,
111
+ status: "ready",
112
+ percentage: 0,
113
+ type: n.type,
114
+ ...n.webkitRelativePath ? { relativePath: n.webkitRelativePath } : {}
115
+ };
116
+ if (h = i.createFile ? { ...J, ...i.createFile(n, ve) } : J, !h.uid || typeof h.uid != "string" || typeof h.name != "string" || !h.raw || o.files.value.some((Ae) => Ae.uid === h.uid) || u.has(h.uid)) {
117
+ q(n, "identity", "文件标识无效或重复:" + n.name);
118
+ continue;
119
+ }
120
+ } catch (J) {
121
+ q(n, "identity", Q(J).message);
122
+ continue;
123
+ }
124
+ l.push(h), u.set(h.uid, { raw: h.raw, body: G });
125
+ }
126
+ if (!l.length || t !== D || !y(r.signal))
127
+ return [];
128
+ if (!await o.commit(
129
+ (n) => {
130
+ if ((i.multiple === !1 ? 0 : n.length) + l.length > re()) {
131
+ d("exceed", a);
132
+ return;
133
+ }
134
+ return i.multiple === !1 ? l : [...n, ...l];
135
+ },
136
+ "select",
137
+ {
138
+ guard: () => t === D && y(r.signal),
139
+ accepted: () => {
140
+ for (const [n, G] of u) x.set(n, G);
141
+ d(
142
+ "select",
143
+ l.map((n) => n.raw)
144
+ );
145
+ }
146
+ }
147
+ )) return [];
148
+ if (C(), i.autoUpload !== !1 && f.configured.value)
149
+ for (const n of l) f.submit(n.uid);
150
+ return l;
151
+ } finally {
152
+ t === D && (F.value = !1, P = void 0, U.value && (U.value.value = ""));
153
+ }
154
+ }
155
+ async function ue(e) {
156
+ if (!m.value) return !1;
157
+ const a = Z(e), t = o.files.value.find((l) => l.uid === a);
158
+ if (!t || v.has(a)) return !1;
159
+ const r = new AbortController();
160
+ v.set(a, r), E.set(a, t.raw), z.value = new Set(v.keys());
161
+ try {
162
+ if (i.beforeRemove && await i.beforeRemove(t, o.files.value, {
163
+ signal: r.signal,
164
+ files: o.files.value
165
+ }) === !1 || !y(r.signal) || !o.files.value.some(
166
+ (u) => u.uid === a && u.raw === t.raw
167
+ ))
168
+ return !1;
169
+ W.add(a);
170
+ const l = await o.commit(
171
+ (u) => u.some((s) => s.uid === a && s.raw === t.raw) ? u.filter((s) => s.uid !== a) : void 0,
172
+ "remove",
173
+ {
174
+ guard: () => y(r.signal),
175
+ accepted: () => d("remove", t)
176
+ }
177
+ );
178
+ return l && (S.value = "", C()), l;
179
+ } catch (l) {
180
+ return y(r.signal) && (X(l), d("removeError", Q(l), t)), !1;
181
+ } finally {
182
+ W.delete(a), v.get(a) === r && (v.delete(a), E.delete(a), z.value = new Set(v.keys()));
183
+ }
184
+ }
185
+ function ne(e) {
186
+ var r;
187
+ Y(), o.cancel();
188
+ const a = new Set(
189
+ o.files.value.filter((l) => !e || e.includes(we(l))).map((l) => l.uid)
190
+ );
191
+ for (const l of a)
192
+ f.abort(l, "clear", !1), (r = v.get(l)) == null || r.abort(), v.delete(l), E.delete(l), x.delete(l);
193
+ z.value = new Set(v.keys()), S.value = "";
194
+ const t = o.commit(
195
+ (l) => l.filter((u) => !a.has(u.uid)),
196
+ "clear",
197
+ { force: !0, allowInactive: !0 }
198
+ );
199
+ return t.then((l) => {
200
+ l && C();
201
+ }), t;
202
+ }
203
+ function B(e) {
204
+ var a;
205
+ return R(e.thumbUrl, !0) ?? (N(e) ? R(e.url, !0) : void 0) ?? ((a = L.value.get(e.uid)) == null ? void 0 : a.url);
206
+ }
207
+ function oe(e) {
208
+ const a = L.value.get(e.uid);
209
+ if (a && a.raw === e.raw) return a.url;
210
+ if (!(!e.raw || !N(e) || typeof URL.createObjectURL != "function"))
211
+ try {
212
+ const t = URL.createObjectURL(e.raw);
213
+ return a && URL.revokeObjectURL(a.url), L.value = new Map(L.value).set(e.uid, {
214
+ raw: e.raw,
215
+ url: t
216
+ }), t;
217
+ } catch {
218
+ }
219
+ }
220
+ function he() {
221
+ for (const e of L.value.values())
222
+ URL.revokeObjectURL(e.url);
223
+ L.value = /* @__PURE__ */ new Map();
224
+ }
225
+ function H() {
226
+ var l;
227
+ const e = c.value && i.showFileList !== !1 && i.listType !== "text", a = new Map(o.files.value.map((u) => [u.uid, u]));
228
+ let t = !1;
229
+ const r = new Map(L.value);
230
+ for (const [u, s] of r) {
231
+ const n = a.get(u);
232
+ (!n || n.raw !== s.raw || !e && ((l = I.value) == null ? void 0 : l.file.uid) !== u || R(n.thumbUrl, !0) || N(n) && R(n.url, !0)) && (URL.revokeObjectURL(s.url), r.delete(u), t = !0);
233
+ }
234
+ if (t && (L.value = r), e)
235
+ for (const u of o.files.value)
236
+ N(u) && !B(u) && oe(u);
237
+ }
238
+ function se() {
239
+ g == null || g.abort(), g = void 0, M = void 0, I.value = void 0, H();
240
+ }
241
+ async function ce(e) {
242
+ const a = o.files.value.find((r) => r.uid === Z(e));
243
+ if (!a || !c.value || j.disabled.value || i.loading)
244
+ return !1;
245
+ g == null || g.abort();
246
+ const t = new AbortController();
247
+ g = t, M = a;
248
+ try {
249
+ d("preview", a);
250
+ const r = i.previewFile ? await i.previewFile(a, {
251
+ signal: t.signal,
252
+ files: o.files.value
253
+ }) : void 0;
254
+ if (!c.value || t.signal.aborted || !o.files.value.some(
255
+ (u) => u.uid === a.uid && u.raw === a.raw
256
+ ) || r === !1)
257
+ return !1;
258
+ const l = typeof r == "string" ? R(r, !0) : B(a) ?? oe(a);
259
+ return l ? (I.value = { file: a, url: l }, !0) : !1;
260
+ } catch (r) {
261
+ return c.value && !t.signal.aborted && X(r), !1;
262
+ }
263
+ }
264
+ async function fe(e) {
265
+ const a = o.files.value.find((r) => r.uid === Z(e));
266
+ if (!a || !c.value || j.disabled.value || i.loading)
267
+ return !1;
268
+ b == null || b.abort();
269
+ const t = new AbortController();
270
+ b = t, O = a;
271
+ try {
272
+ d("download", a);
273
+ const r = i.downloadFile ? await i.downloadFile(a, {
274
+ signal: t.signal,
275
+ files: o.files.value
276
+ }) : void 0;
277
+ if (!c.value || t.signal.aborted || !o.files.value.some((n) => n.uid === a.uid && n.raw === a.raw))
278
+ return !1;
279
+ if (i.downloadFile && typeof r != "string")
280
+ return r !== !1;
281
+ let l;
282
+ const u = typeof r == "string" ? R(r) : R(a.url) ?? (a.raw && typeof URL.createObjectURL == "function" ? l = URL.createObjectURL(a.raw) : void 0);
283
+ if (!u) return !1;
284
+ const s = document.createElement("a");
285
+ return s.href = u, s.download = a.name, s.rel = "noopener noreferrer", s.target = "_blank", document.body.append(s), s.click(), s.remove(), l && setTimeout(() => URL.revokeObjectURL(l), 0), !0;
286
+ } catch (r) {
287
+ return c.value && !t.signal.aborted && X(r), !1;
288
+ }
289
+ }
290
+ function Ue(e) {
291
+ return i.showPreview !== !1 && (!!i.previewFile || N(e) && !!(e.raw || B(e)));
292
+ }
293
+ function ke(e) {
294
+ return i.showDownload !== !1 && !!(i.downloadFile || e.raw || R(e.url));
295
+ }
296
+ function Le(e) {
297
+ return {
298
+ file: e,
299
+ status: we(e),
300
+ percentage: He(e),
301
+ queued: f.queuedKeys.value.has(e.uid),
302
+ busy: f.activeKeys.value.has(e.uid) || z.value.has(e.uid),
303
+ thumbnail: B(e),
304
+ actions: {
305
+ preview: () => ce(e),
306
+ download: () => fe(e),
307
+ remove: () => ue(e),
308
+ retry: () => f.retry(e.uid),
309
+ abort: () => f.abort(e.uid)
310
+ }
311
+ };
312
+ }
313
+ function V(e) {
314
+ var a;
315
+ !m.value || F.value || (e == null || e.preventDefault(), e == null || e.stopPropagation(), (a = U.value) == null || a.click());
316
+ }
317
+ function Re(e) {
318
+ i.openFileDialogOnClick === !1 || e.defaultPrevented || e.target.closest(
319
+ "input,textarea,select,a[href],[data-upload-no-trigger]"
320
+ ) || V(e);
321
+ }
322
+ function Fe(e) {
323
+ e.target.closest(
324
+ 'button,a[href],input,textarea,select,[contenteditable="true"]'
325
+ ) || (e.key === "Enter" || e.key === " ") && i.openFileDialogOnClick !== !1 && V(e);
326
+ }
327
+ function Se(e) {
328
+ var t;
329
+ if (A.value = !1, p = 0, i.drag === !1 || !m.value) return;
330
+ const a = Array.from(((t = e.dataTransfer) == null ? void 0 : t.files) ?? []);
331
+ a.length && (e.preventDefault(), d("drop", e), $(a));
332
+ }
333
+ function xe(e) {
334
+ var a;
335
+ i.drag === !1 || !m.value || !Array.from(((a = e.dataTransfer) == null ? void 0 : a.types) ?? []).includes("Files") || (e.preventDefault(), p++, A.value = !0);
336
+ }
337
+ function ze(e) {
338
+ var a;
339
+ i.drag === !1 || !m.value || !Array.from(((a = e.dataTransfer) == null ? void 0 : a.types) ?? []).includes("Files") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"), A.value = !0);
340
+ }
341
+ function De() {
342
+ p = Math.max(0, p - 1), p || (A.value = !1);
343
+ }
344
+ function Me(e) {
345
+ var t;
346
+ if (!i.paste || !m.value) return;
347
+ const a = Array.from(((t = e.clipboardData) == null ? void 0 : t.files) ?? []);
348
+ a.length && (e.preventDefault(), d("paste", e), $(a));
349
+ }
350
+ function _(e = !0) {
351
+ Y(), o.cancel();
352
+ const a = new Set(f.tasks.value.keys());
353
+ f.cleanup();
354
+ for (const t of v.values()) t.abort();
355
+ v.clear(), E.clear(), W.clear(), z.value = /* @__PURE__ */ new Set(), g == null || g.abort(), b == null || b.abort(), M = O = void 0, I.value = void 0, he(), e && o.interrupt(a);
356
+ }
357
+ K(
358
+ m,
359
+ (e) => {
360
+ e || _();
361
+ },
362
+ { flush: "sync" }
363
+ ), K(
364
+ () => [
365
+ i.accept,
366
+ i.limit,
367
+ i.maxSize,
368
+ i.multiple,
369
+ i.beforeUpload
370
+ ],
371
+ () => {
372
+ Y();
373
+ for (const [e, a] of f.tasks.value)
374
+ a.phase === "preparing" && f.abort(e, "configuration");
375
+ }
376
+ ), K(
377
+ () => o.files.value.map((e) => [
378
+ e.uid,
379
+ e.raw,
380
+ e.url,
381
+ e.thumbUrl,
382
+ e.type,
383
+ e.name
384
+ ]),
385
+ () => {
386
+ var t, r, l, u;
387
+ const e = o.files.value, a = new Map(e.map((s) => [s.uid, s]));
388
+ for (const [s, n] of x)
389
+ ((t = a.get(s)) == null ? void 0 : t.raw) !== n.raw && x.delete(s);
390
+ for (const [s, n] of v)
391
+ (!a.has(s) && !W.has(s) || a.has(s) && ((r = a.get(s)) == null ? void 0 : r.raw) !== E.get(s)) && (n.abort(), v.delete(s), E.delete(s), z.value = new Set(v.keys()));
392
+ M && (!a.has(M.uid) || ((l = a.get(M.uid)) == null ? void 0 : l.raw) !== M.raw) && se(), O && (!a.has(O.uid) || ((u = a.get(O.uid)) == null ? void 0 : u.raw) !== O.raw) && (b == null || b.abort(), b = void 0, O = void 0), H();
393
+ },
394
+ { flush: "post" }
395
+ ), K(() => [i.listType, i.showFileList], H);
396
+ function de() {
397
+ _(!1), o.resetLocal(), S.value = "";
398
+ }
399
+ K(
400
+ () => k == null ? void 0 : k.resetting.value,
401
+ (e) => {
402
+ e && de();
403
+ },
404
+ { flush: "sync" }
405
+ ), Ne(U, de), je(() => {
406
+ c.value = !1, _();
407
+ }), Ee(() => {
408
+ c.value = !1, _();
409
+ }), Pe(() => {
410
+ c.value = !0, H();
411
+ });
412
+ const Oe = ee(() => ({
413
+ files: o.files.value,
414
+ busy: F.value,
415
+ disabled: !m.value,
416
+ uploading: f.uploading.value,
417
+ queued: f.queued.value,
418
+ open: V,
419
+ submit: () => f.submit(),
420
+ abort: () => f.abort(),
421
+ clear: () => ne()
422
+ }));
423
+ function Te(e) {
424
+ var a, t;
425
+ (a = te.value) != null && a.contains(e.relatedTarget) || i.validateEvent !== !1 && ((t = w == null ? void 0 : w.validate) == null || t.call(w, "blur"));
426
+ }
427
+ return {
428
+ element: te,
429
+ zone: ie,
430
+ input: U,
431
+ active: c,
432
+ available: m,
433
+ disabled: j.disabled,
434
+ size: j.size,
435
+ label: j.label,
436
+ field: w,
437
+ checking: F,
438
+ dragging: A,
439
+ lastError: S,
440
+ words: ge,
441
+ files: o.files,
442
+ requests: f,
443
+ removing: z,
444
+ preview: I,
445
+ closePreview: se,
446
+ context: Le,
447
+ scope: Oe,
448
+ canPreview: Ue,
449
+ canDownload: ke,
450
+ open: V,
451
+ click: Re,
452
+ keys: Fe,
453
+ drop: Se,
454
+ dragEnter: xe,
455
+ dragOver: ze,
456
+ dragLeave: De,
457
+ paste: Me,
458
+ blur: Te,
459
+ addFiles: $,
460
+ remove: ue,
461
+ clearFiles: ne,
462
+ previewFile: ce,
463
+ download: fe,
464
+ focus: () => {
465
+ var e;
466
+ m.value && ((e = ie.value) == null || e.focus());
467
+ }
468
+ };
469
+ }
470
+ export {
471
+ Ye as useUpload
472
+ };