hys-ui 0.3.0 → 0.5.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 (168) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +68 -73
  3. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
  4. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +467 -2
  5. package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
  6. package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
  7. package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
  8. package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
  9. package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
  10. package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
  11. package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
  12. package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
  13. package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
  14. package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
  15. package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
  16. package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
  17. package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
  18. package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
  19. package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
  20. package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
  21. package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
  22. package/dist/components/HysButton/HysButton.vue.js +2 -2
  23. package/dist/components/HysButton/HysButton2.vue.js +227 -60
  24. package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
  25. package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
  26. package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
  27. package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
  28. package/dist/components/HysInput/HysInput.vue.js +2 -2
  29. package/dist/components/HysInput/HysInput2.vue.js +327 -274
  30. package/dist/components/HysMention/HysMention.vue.js +1 -1
  31. package/dist/components/HysMention/HysMention2.vue.js +1092 -154
  32. package/dist/components/HysModal/HysModal.vue.js +3 -3
  33. package/dist/components/HysModal/HysModal2.vue.js +81 -80
  34. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  35. package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
  36. package/dist/components/HysSearch/HysSearch.vue.js +5 -82
  37. package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
  38. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  39. package/dist/components/HysSelect/HysSelect2.vue.js +472 -443
  40. package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
  41. package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
  42. package/dist/components/HysTable/HysTable.vue.js +2 -2
  43. package/dist/components/HysTable/HysTable2.vue.js +1418 -1150
  44. package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
  45. package/dist/components/HysTour/HysTour.vue.js +291 -67
  46. package/dist/components/HysTour/HysTour3.vue.js +5 -0
  47. package/dist/composables/animatedNumberDigits.js +106 -0
  48. package/dist/composables/animatedNumberFormat.js +222 -0
  49. package/dist/composables/animatedNumberTiming.js +66 -0
  50. package/dist/composables/buttonGroup.js +12 -0
  51. package/dist/composables/floatingPosition.js +18 -0
  52. package/dist/composables/mentionDocument.js +79 -0
  53. package/dist/composables/mentionEditor.js +58 -0
  54. package/dist/composables/numberAnimation.js +72 -0
  55. package/dist/composables/numberAnimationCatalog.js +301 -0
  56. package/dist/composables/numberAnimationSequence.js +45 -0
  57. package/dist/composables/selectOptions.js +44 -38
  58. package/dist/composables/splitPaneSizes.js +58 -0
  59. package/dist/composables/table.js +128 -105
  60. package/dist/composables/textInput.js +23 -14
  61. package/dist/composables/useDialog.js +50 -50
  62. package/dist/composables/useFloating.js +107 -103
  63. package/dist/composables/useHysAnimatedNumber.js +264 -0
  64. package/dist/composables/useHysNumberAnimationGroup.js +23 -0
  65. package/dist/composables/useMentionCaret.js +81 -0
  66. package/dist/composables/useMentionList.js +81 -0
  67. package/dist/composables/useMentionModel.js +90 -0
  68. package/dist/composables/useMentionOptions.js +421 -0
  69. package/dist/composables/useSplitPaneDrag.js +52 -0
  70. package/dist/composables/useSplitPaneStorage.js +38 -0
  71. package/dist/composables/useTable.js +344 -312
  72. package/dist/composables/useTableSticky.js +79 -0
  73. package/dist/composables/useTextareaSize.js +62 -46
  74. package/dist/composables/useTourLayout.js +129 -0
  75. package/dist/config.js +11 -11
  76. package/dist/index.js +183 -152
  77. package/dist/internal/MultiSplitPane.vue.js +305 -0
  78. package/dist/internal/MultiSplitPane2.vue.js +4 -0
  79. package/dist/style.css +1 -1
  80. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +99 -6
  81. package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
  82. package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
  83. package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
  84. package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
  85. package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
  86. package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
  87. package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
  88. package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
  89. package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
  90. package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
  91. package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
  92. package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
  93. package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
  94. package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
  95. package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
  96. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +12 -3
  97. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
  98. package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
  99. package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
  100. package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
  101. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
  102. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +3 -3
  103. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +3 -3
  104. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +2 -2
  105. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
  106. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +6 -6
  107. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
  108. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +2 -2
  109. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
  110. package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
  111. package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -40
  112. package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
  113. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  114. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
  115. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
  116. package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
  117. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +46 -8
  118. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +6 -1
  119. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
  120. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
  121. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  122. package/dist/types/components/HysTable/HysTable.vue.d.ts +1740 -3
  123. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
  124. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
  125. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
  126. package/dist/types/components/HysToast/HysToast.vue.d.ts +1 -1
  127. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
  128. package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -9
  129. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +3 -3
  130. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +2 -2
  131. package/dist/types/composables/animatedNumber.d.ts +220 -0
  132. package/dist/types/composables/animatedNumberDigits.d.ts +32 -0
  133. package/dist/types/composables/animatedNumberFormat.d.ts +16 -0
  134. package/dist/types/composables/animatedNumberTiming.d.ts +21 -0
  135. package/dist/types/composables/buttonGroup.d.ts +9 -0
  136. package/dist/types/composables/drawer.d.ts +1 -1
  137. package/dist/types/composables/floatingPosition.d.ts +14 -0
  138. package/dist/types/composables/mention.d.ts +284 -0
  139. package/dist/types/composables/mentionDocument.d.ts +15 -0
  140. package/dist/types/composables/mentionEditor.d.ts +7 -0
  141. package/dist/types/composables/modal.d.ts +2 -0
  142. package/dist/types/composables/numberAnimation.d.ts +29 -0
  143. package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
  144. package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
  145. package/dist/types/composables/selectOptions.d.ts +5 -0
  146. package/dist/types/composables/splitPaneSizes.d.ts +11 -0
  147. package/dist/types/composables/table.d.ts +116 -6
  148. package/dist/types/composables/textInput.d.ts +39 -4
  149. package/dist/types/composables/tour.d.ts +68 -0
  150. package/dist/types/composables/useFloating.d.ts +1 -1
  151. package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
  152. package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
  153. package/dist/types/composables/useMentionCaret.d.ts +6 -0
  154. package/dist/types/composables/useMentionList.d.ts +23 -0
  155. package/dist/types/composables/useMentionModel.d.ts +14 -0
  156. package/dist/types/composables/useMentionOptions.d.ts +26 -0
  157. package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
  158. package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
  159. package/dist/types/composables/useTable.d.ts +7 -3
  160. package/dist/types/composables/useTableSticky.d.ts +22 -0
  161. package/dist/types/composables/useTextareaSize.d.ts +5 -2
  162. package/dist/types/composables/useTourLayout.d.ts +33 -0
  163. package/dist/types/config.d.ts +1 -0
  164. package/dist/types/index.d.ts +46 -1
  165. package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
  166. package/package.json +3 -2
  167. package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
  168. package/dist/components/HysTour/HysTour2.vue.js +0 -4
@@ -1,50 +1,54 @@
1
- import { inject as G, ref as z, shallowRef as J, watch as V, onDeactivated as Q, onBeforeUnmount as Z, computed as _, nextTick as ee } from "vue";
2
- import { useHysControlState as te } from "./formContext.js";
3
- import { popupSize as ie } from "../motion/popup.js";
4
- import { overlayOwnerKey as ae, registerOverlay as ne } from "./overlayManager.js";
5
- function de(g, r, t = {}) {
6
- const { disabled: B } = te({}), y = G(ae, void 0), o = z(!1), F = J(), O = z(!1), k = z({
1
+ import { inject as T, ref as E, shallowRef as Y, watch as D, onDeactivated as U, onBeforeUnmount as V, computed as X, nextTick as G } from "vue";
2
+ import { useHysControlState as J } from "./formContext.js";
3
+ import { popupSize as Q } from "../motion/popup.js";
4
+ import { positionFloating as Z } from "./floatingPosition.js";
5
+ import { overlayOwnerKey as _, registerOverlay as ee } from "./overlayManager.js";
6
+ function re(v, n, e = {}) {
7
+ const { disabled: k } = J({}), m = T(_, void 0), c = E(!1), W = Y(), p = E(!1), L = E({
7
8
  position: "fixed",
8
9
  top: "0px",
9
10
  left: "0px",
10
11
  visibility: "hidden"
11
- }), N = z(t.placement ?? "bottom-start");
12
- let A = 0, W, u, E = 0;
13
- function C() {
14
- var K, T, Y;
15
- if (!o.value || !g.value || !r.value) return;
16
- const e = g.value.getBoundingClientRect();
17
- if (!e.width && !e.height) {
18
- s();
12
+ });
13
+ function A() {
14
+ return typeof e.placement == "function" ? e.placement() : e.placement ?? "bottom-start";
15
+ }
16
+ const C = E(A());
17
+ let $ = 0, w, r, y = 0;
18
+ function F() {
19
+ var R, S, H;
20
+ if (!c.value || !v.value || !n.value) return;
21
+ const t = v.value.getBoundingClientRect();
22
+ if (!t.width && !t.height) {
23
+ u();
19
24
  return;
20
25
  }
21
- const n = Number.isFinite(t.gap) ? t.gap : 8, i = Number.isFinite(t.padding) ? Math.max(0, t.padding) : 10, l = document.documentElement.clientWidth, f = document.documentElement.clientHeight, d = Math.min(e.width, Math.max(0, l - 2 * i)), M = typeof t.matchWidth == "function" ? t.matchWidth() : t.matchWidth, b = (K = t.maxWidth) == null ? void 0 : K.call(t), P = b !== void 0 && (typeof b != "number" || Number.isFinite(b)) ? `min(${typeof b == "number" ? Math.max(0, b) + "px" : b},calc(100vw - ${i * 2}px))` : `calc(100vw - ${i * 2}px)`, L = (T = t.width) == null ? void 0 : T.call(t), p = typeof L == "number" ? Number.isFinite(L) ? Math.max(0, L) + "px" : void 0 : L;
22
- p !== void 0 ? (r.value.style.width = p, r.value.style.minWidth = "0", r.value.style.maxWidth = P) : M === !0 && (r.value.style.width = `${d}px`, r.value.style.minWidth = "0", r.value.style.maxWidth = `${d}px`), p === void 0 && M === "min" && (r.value.style.width = "max-content", r.value.style.minWidth = `${d}px`, r.value.style.maxWidth = `calc(100vw - ${i * 2}px)`);
23
- const D = ie(r.value), h = Math.min(D.width, Math.max(0, l - 2 * i)), v = Math.min(D.height, Math.max(0, f - 2 * i));
24
- let a = t.placement ?? "bottom-start";
25
- const I = f - e.bottom - n, q = e.top - n, $ = t.autoAdjustOverflow !== !1;
26
- $ && a.startsWith("bottom") && I < v && q > I ? a = a.replace("bottom", "top") : $ && a.startsWith("top") && q < v && I > q ? a = a.replace("top", "bottom") : $ && a.startsWith("right") && l - e.right - n < h && e.left > l - e.right ? a = a.replace("right", "left") : $ && a.startsWith("left") && e.left - n < h && l - e.right > e.left && (a = a.replace("left", "right"));
27
- let w = a.endsWith("end") ? e.right - h : a.endsWith("start") ? e.left : e.left + (e.width - h) / 2, x = a.startsWith("top") ? e.top - v - n : e.bottom + n;
28
- if ((a.startsWith("right") || a.startsWith("left")) && (w = a.startsWith("right") ? e.right + n : e.left - h - n, x = a.endsWith("start") ? e.top : a.endsWith("end") ? e.bottom - v : e.top + (e.height - v) / 2), w = Math.max(i, Math.min(w, l - h - i)), x = Math.max(i, Math.min(x, f - v - i)), N.value = a, (Y = t.onPosition) == null || Y.call(t, {
29
- anchor: e,
30
- width: h,
31
- height: v,
32
- x: w,
33
- y: x,
34
- placement: a
35
- }), t.strategy === "absolute") {
36
- const m = r.value.offsetParent;
37
- if (m && m !== document.body && m !== document.documentElement) {
38
- const U = m.getBoundingClientRect();
39
- w += m.scrollLeft - U.left - m.clientLeft, x += m.scrollTop - U.top - m.clientTop;
26
+ const a = Number.isFinite(e.gap) ? e.gap : 8, i = Number.isFinite(e.padding) ? Math.max(0, e.padding) : 10, l = document.documentElement.clientWidth, o = document.documentElement.clientHeight, d = Math.min(t.width, Math.max(0, l - 2 * i)), g = typeof e.matchWidth == "function" ? e.matchWidth() : e.matchWidth, h = (R = e.maxWidth) == null ? void 0 : R.call(e), P = h !== void 0 && (typeof h != "number" || Number.isFinite(h)) ? `min(${typeof h == "number" ? Math.max(0, h) + "px" : h},calc(100vw - ${i * 2}px))` : `calc(100vw - ${i * 2}px)`, b = (S = e.width) == null ? void 0 : S.call(e), x = typeof b == "number" ? Number.isFinite(b) ? Math.max(0, b) + "px" : void 0 : b;
27
+ x !== void 0 ? (n.value.style.width = x, n.value.style.minWidth = "0", n.value.style.maxWidth = P) : g === !0 && (n.value.style.width = `${d}px`, n.value.style.minWidth = "0", n.value.style.maxWidth = `${d}px`), x === void 0 && g === "min" && (n.value.style.width = "max-content", n.value.style.minWidth = `${d}px`, n.value.style.maxWidth = `calc(100vw - ${i * 2}px)`);
28
+ const z = Z(
29
+ t,
30
+ Q(n.value),
31
+ { width: l, height: o },
32
+ A(),
33
+ a,
34
+ i,
35
+ e.autoAdjustOverflow !== !1
36
+ );
37
+ let { x: O, y: M } = z;
38
+ if (C.value = z.placement, (H = e.onPosition) == null || H.call(e, { anchor: t, ...z }), e.strategy === "absolute") {
39
+ n.value.style.position = "absolute";
40
+ const f = n.value.offsetParent;
41
+ if (f && f !== document.body && f !== document.documentElement) {
42
+ const j = f.getBoundingClientRect();
43
+ O += f.scrollLeft - j.left - f.clientLeft, M += f.scrollTop - j.top - f.clientTop;
40
44
  } else
41
- w += window.scrollX, x += window.scrollY;
45
+ O += window.scrollX, M += window.scrollY;
42
46
  }
43
- k.value = {
44
- ...p !== void 0 ? { width: p, minWidth: "0" } : M === !0 ? { width: `${d}px`, minWidth: "0" } : M === "min" ? { width: "max-content", minWidth: `${d}px` } : {},
45
- position: t.strategy ?? "fixed",
46
- left: `${Math.round(w)}px`,
47
- top: `${Math.round(x)}px`,
47
+ L.value = {
48
+ ...x !== void 0 ? { width: x, minWidth: "0" } : g === !0 ? { width: `${d}px`, minWidth: "0" } : g === "min" ? { width: "max-content", minWidth: `${d}px` } : {},
49
+ position: e.strategy ?? "fixed",
50
+ left: `${Math.round(O)}px`,
51
+ top: `${Math.round(M)}px`,
48
52
  visibility: "visible",
49
53
  zIndex: "1200",
50
54
  maxWidth: P,
@@ -53,110 +57,110 @@ function de(g, r, t = {}) {
53
57
  overscrollBehavior: "contain"
54
58
  };
55
59
  }
56
- function c() {
57
- cancelAnimationFrame(A), A = requestAnimationFrame(C);
60
+ function s() {
61
+ cancelAnimationFrame($), $ = requestAnimationFrame(F);
58
62
  }
59
- function R(e) {
60
- var n, i;
61
- !(u != null && u()) || t.closeOnOutside === !1 || !((n = g.value) != null && n.contains(e.target)) && !((i = r.value) != null && i.contains(e.target)) && s();
63
+ function I(t) {
64
+ var a, i;
65
+ !(r != null && r()) || e.closeOnOutside === !1 || !((a = v.value) != null && a.contains(t.target)) && !((i = n.value) != null && i.contains(t.target)) && u();
62
66
  }
63
- function S(e) {
64
- var n, i;
65
- if (!(!o.value || !(u != null && u()))) {
66
- if (e.key === "Escape" && t.closeOnEscape !== !1)
67
- e.preventDefault(), e.stopImmediatePropagation(), s(!0);
68
- else if (e.key === "Tab" && t.closeOnTab !== !1) {
67
+ function q(t) {
68
+ var a, i;
69
+ if (!(!c.value || !(r != null && r()))) {
70
+ if (t.key === "Escape" && e.closeOnEscape !== !1)
71
+ t.preventDefault(), t.stopImmediatePropagation(), u(!0);
72
+ else if (t.key === "Tab" && e.closeOnTab !== !1) {
69
73
  const l = document.activeElement;
70
- if ((n = g.value) != null && n.contains(l)) {
71
- s();
74
+ if ((a = v.value) != null && a.contains(l)) {
75
+ u();
72
76
  return;
73
77
  }
74
- if ((i = r.value) != null && i.contains(l)) {
75
- const f = Array.from(
76
- r.value.querySelectorAll(
78
+ if ((i = n.value) != null && i.contains(l)) {
79
+ const o = Array.from(
80
+ n.value.querySelectorAll(
77
81
  'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])'
78
82
  )
79
83
  ).filter(
80
84
  (d) => d.getClientRects().length && !d.closest("[inert]")
81
85
  );
82
- (!f.length || l === (e.shiftKey ? f[0] : f.at(-1))) && s(!0);
86
+ (!o.length || l === (t.shiftKey ? o[0] : o.at(-1))) && u(!0);
83
87
  }
84
88
  }
85
89
  }
86
90
  }
87
- function j() {
88
- var e, n;
89
- document.removeEventListener("pointerdown", R, !0), document.removeEventListener("keydown", S, !0), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0), (e = window.visualViewport) == null || e.removeEventListener("resize", c), (n = window.visualViewport) == null || n.removeEventListener("scroll", c), cancelAnimationFrame(A), W == null || W(), W = void 0, F.value = void 0, u = void 0;
91
+ function B() {
92
+ var t, a;
93
+ document.removeEventListener("pointerdown", I, !0), document.removeEventListener("keydown", q, !0), window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0), (t = window.visualViewport) == null || t.removeEventListener("resize", s), (a = window.visualViewport) == null || a.removeEventListener("scroll", s), cancelAnimationFrame($), w == null || w(), w = void 0, W.value = void 0, r = void 0;
90
94
  }
91
- function s(e = !1, n = !1) {
95
+ function u(t = !1, a = !1) {
92
96
  var i, l;
93
- if (!(!n && o.value && ((i = t.requestOpen) == null ? void 0 : i.call(t, !1, e)) === !1) && (E++, !!o.value && (o.value = !1, j(), e && ((l = g.value) != null && l.isConnected)))) {
94
- O.value = !0;
97
+ if (!(!a && c.value && ((i = e.requestOpen) == null ? void 0 : i.call(e, !1, t)) === !1) && (y++, !!c.value && (c.value = !1, B(), t && ((l = v.value) != null && l.isConnected)))) {
98
+ p.value = !0;
95
99
  try {
96
- g.value.focus();
100
+ v.value.focus();
97
101
  } finally {
98
- O.value = !1;
102
+ p.value = !1;
99
103
  }
100
104
  }
101
105
  }
102
- async function H(e = !1) {
103
- var l, f, d;
104
- if (B.value || (y == null ? void 0 : y.value) === !1) return;
105
- if (o.value) {
106
- c();
106
+ async function N(t = !1) {
107
+ var l, o, d;
108
+ if (k.value || (m == null ? void 0 : m.value) === !1) return;
109
+ if (c.value) {
110
+ s();
107
111
  return;
108
112
  }
109
- if (!e && ((l = t.requestOpen) == null ? void 0 : l.call(t, !0)) === !1) return;
110
- const n = ++E;
111
- if (o.value = !0, k.value = {
113
+ if (!t && ((l = e.requestOpen) == null ? void 0 : l.call(e, !0)) === !1) return;
114
+ const a = ++y;
115
+ if (c.value = !0, L.value = {
112
116
  position: "fixed",
113
117
  top: "0px",
114
118
  left: "0px",
115
119
  visibility: "hidden"
116
- }, await ee(), n !== E || !o.value) return;
117
- const i = ne(
120
+ }, await G(), a !== y || !c.value) return;
121
+ const i = ee(
118
122
  "floating",
119
- () => s(!0),
120
- t.zIndex
123
+ () => u(!0),
124
+ e.zIndex
121
125
  );
122
- F.value = i, W = i.unregister, u = i.isTop, C(), document.addEventListener("pointerdown", R, !0), document.addEventListener("keydown", S, !0), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), (f = window.visualViewport) == null || f.addEventListener("resize", c), (d = window.visualViewport) == null || d.addEventListener("scroll", c);
126
+ W.value = i, w = i.unregister, r = i.isTop, F(), document.addEventListener("pointerdown", I, !0), document.addEventListener("keydown", q, !0), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), (o = window.visualViewport) == null || o.addEventListener("resize", s), (d = window.visualViewport) == null || d.addEventListener("scroll", s);
123
127
  }
124
- function X() {
125
- return o.value ? s() : H();
128
+ function K() {
129
+ return c.value ? u() : N();
126
130
  }
127
- return V(
128
- B,
129
- (e) => {
130
- e && s(!1, !0);
131
+ return D(
132
+ k,
133
+ (t) => {
134
+ t && u(!1, !0);
131
135
  },
132
136
  { flush: "sync" }
133
- ), Q(() => s(!1, !0)), V(
134
- () => y == null ? void 0 : y.value,
135
- (e) => {
136
- e === !1 && s(!1, !0);
137
+ ), U(() => u(!1, !0)), D(
138
+ () => m == null ? void 0 : m.value,
139
+ (t) => {
140
+ t === !1 && u(!1, !0);
137
141
  },
138
142
  { flush: "sync" }
139
- ), Z(() => {
140
- E++, j();
143
+ ), V(() => {
144
+ y++, B();
141
145
  }), {
142
- open: o,
143
- style: _(() => {
144
- var e;
146
+ open: c,
147
+ style: X(() => {
148
+ var t;
145
149
  return {
146
- ...k.value,
147
- zIndex: String(((e = F.value) == null ? void 0 : e.zIndex.value) ?? 1200)
150
+ ...L.value,
151
+ zIndex: String(((t = W.value) == null ? void 0 : t.zIndex.value) ?? 1200)
148
152
  };
149
153
  }),
150
- placement: N,
151
- update: C,
152
- show: H,
153
- close: s,
154
- toggle: X,
155
- restoringFocus: O,
156
- schedule: c,
157
- isTop: () => (u == null ? void 0 : u()) ?? !1
154
+ placement: C,
155
+ update: F,
156
+ show: N,
157
+ close: u,
158
+ toggle: K,
159
+ restoringFocus: p,
160
+ schedule: s,
161
+ isTop: () => (r == null ? void 0 : r()) ?? !1
158
162
  };
159
163
  }
160
164
  export {
161
- de as useFloating
165
+ re as useFloating
162
166
  };
@@ -0,0 +1,264 @@
1
+ import { shallowRef as ue, watch as w, onMounted as le, onActivated as re, onDeactivated as fe, onBeforeUnmount as de, computed as ce, readonly as pe, toValue as me } from "vue";
2
+ import { useMotion as ve } from "../motion/useMotion.js";
3
+ import { listenVisibility as ye, unlistenVisibility as ge, unsubscribe as he, subscribe as be, makeEasing as Ae } from "./animatedNumberTiming.js";
4
+ import { numberDirection as D, numberValue as y, bounded as d, createNumberInterpolator as Me } from "./animatedNumberFormat.js";
5
+ function Pe(Q = {}, S) {
6
+ const i = () => me(Q), r = () => y(i().value), Y = () => y(i().from ?? r()), { effectiveMotion: Z } = ve(), g = () => i().disabled || Z.value === "off" || !_(), _ = () => d(i().duration ?? 650, 0, 0, Number.MAX_SAFE_INTEGER), N = Y(), a = ue({
7
+ value: N,
8
+ from: N,
9
+ to: r(),
10
+ progress: 0,
11
+ easedProgress: 0,
12
+ direction: D(N, r()),
13
+ status: "idle",
14
+ iteration: 1
15
+ });
16
+ let n, c = [N, r()], f = c, p = [], k = !1, A = !1, W = !1, l = !1, T, E = 0, B = -1 / 0, R, F;
17
+ const U = () => !A || W || i().pauseWhenHidden !== !1 && document.hidden, m = (e) => S == null ? void 0 : S(e, { ...a.value });
18
+ function v() {
19
+ he(C), T = void 0, E = 0;
20
+ }
21
+ function V() {
22
+ !n || l || U() || be(C);
23
+ }
24
+ function $(e, t, o) {
25
+ let s = t;
26
+ if (t > 0 && t < 1)
27
+ try {
28
+ s = d(e.easing(t), t, -4, 5);
29
+ } catch {
30
+ e.easing = (u) => u;
31
+ }
32
+ a.value = {
33
+ ...a.value,
34
+ status: o,
35
+ progress: t,
36
+ easedProgress: s,
37
+ value: t === 0 ? e.from : t === 1 ? e.to : e.interpolate(t, s)
38
+ };
39
+ }
40
+ function h() {
41
+ p = [], R = void 0, clearTimeout(F), F = void 0;
42
+ }
43
+ function L() {
44
+ const e = !!n;
45
+ n = void 0, l = !1, v(), e && (a.value = { ...a.value, status: "stopped" }, m("cancel"));
46
+ }
47
+ function q(e, t, o, s, u, P) {
48
+ return {
49
+ from: e,
50
+ to: t,
51
+ iteration: o,
52
+ loops: s,
53
+ duration: u,
54
+ elapsed: -P,
55
+ interpolate: Me(e, t, i().interpolate),
56
+ easing: Ae(i().easing),
57
+ alternate: i().alternate ?? !1,
58
+ started: !1
59
+ };
60
+ }
61
+ function x(e) {
62
+ n = e, a.value = {
63
+ from: e.from,
64
+ to: e.to,
65
+ value: e.from,
66
+ progress: 0,
67
+ easedProgress: 0,
68
+ direction: D(e.from, e.to),
69
+ status: e.elapsed < 0 ? "delayed" : "playing",
70
+ iteration: e.iteration
71
+ };
72
+ }
73
+ function j(e) {
74
+ e.started || (e.started = !0, m("start"));
75
+ }
76
+ function G(e, t, o) {
77
+ $(e, t, o), m("update"), n === e && m("progress");
78
+ }
79
+ function z(e, t = !1) {
80
+ if (n === e) {
81
+ if (!t && e.iteration < e.loops) {
82
+ const [o, s] = e.alternate ? [e.to, e.from] : c;
83
+ x(
84
+ q(
85
+ o,
86
+ s,
87
+ e.iteration + 1,
88
+ e.loops,
89
+ e.duration,
90
+ 0
91
+ )
92
+ ), m("loop");
93
+ return;
94
+ }
95
+ if (n = void 0, l = !1, v(), a.value = { ...a.value, status: "finished" }, m("end"), !n && p.length) {
96
+ const o = p.shift();
97
+ M(a.value.value, o);
98
+ }
99
+ }
100
+ }
101
+ function I() {
102
+ if (!n) return;
103
+ const e = n;
104
+ j(e), n === e && (G(e, 1, "playing"), z(e, !0));
105
+ }
106
+ function M(e, t, o = {}) {
107
+ if (L(), n) return;
108
+ c = [e, t], f = o.endpoints ?? c;
109
+ const s = i().loop, u = s === !0 ? 1 / 0 : Math.floor(
110
+ d(
111
+ typeof s == "number" ? s : void 0,
112
+ 1,
113
+ 1,
114
+ Number.MAX_SAFE_INTEGER
115
+ )
116
+ ), P = q(
117
+ e,
118
+ t,
119
+ 1,
120
+ u,
121
+ _(),
122
+ o.delay ?? d(i().delay, 0, 0, Number.MAX_SAFE_INTEGER)
123
+ );
124
+ x(P), o.immediate || g() || !P.duration || a.value.direction === "none" && e !== t ? I() : V();
125
+ }
126
+ function C(e) {
127
+ const t = n;
128
+ if (!t || l || U()) {
129
+ v();
130
+ return;
131
+ }
132
+ if (g() || !t.duration) {
133
+ I();
134
+ return;
135
+ }
136
+ const o = d(i().speed, 1, 0.01, 100);
137
+ if (t.elapsed += (T === void 0 ? 0 : e - T) * o, T = e, t.elapsed < 0 || (j(t), n !== t || l)) return;
138
+ const s = Math.min(1, t.elapsed / t.duration), u = i().fps;
139
+ s < 1 && E && u !== void 0 && e - E < 1e3 / d(u, 60, 1, 120) - 1 || (E = e, G(t, s, "playing"), s === 1 && !l && z(t));
140
+ }
141
+ function J(e) {
142
+ const t = y(e), o = i().interrupt ?? "retarget";
143
+ if (o === "queue" && n && !g()) {
144
+ (p.at(-1) ?? n.to) !== t && p.push(t);
145
+ const s = Math.floor(d(i().queueLimit, 32, 1, 256));
146
+ p.length > s && p.splice(0, p.length - s);
147
+ return;
148
+ }
149
+ h(), !(t === a.value.value && !n) && (B = performance.now(), M(
150
+ o === "restart" ? y(i().from ?? c[0]) : a.value.value,
151
+ t,
152
+ { immediate: o === "snap" }
153
+ ));
154
+ }
155
+ function K(e) {
156
+ if (!k) return;
157
+ const t = i().interrupt ?? "retarget", o = d(i().updateInterval, 0, 0, 6e4), s = B + o - performance.now();
158
+ (t === "retarget" || t === "restart") && s > 0 && !g() ? (R = e, F ?? (F = setTimeout(() => {
159
+ const u = R;
160
+ u !== void 0 && J(u);
161
+ }, s))) : J(e);
162
+ }
163
+ function H() {
164
+ h(), M(y(i().from ?? f[0]), r());
165
+ }
166
+ function ee() {
167
+ if (n) {
168
+ O();
169
+ return;
170
+ }
171
+ a.value.to !== r() || a.value.status === "stopped" ? (h(), M(a.value.value, r())) : H();
172
+ }
173
+ function te() {
174
+ !n || l || (l = !0, v(), a.value = { ...a.value, status: "paused" }, m("pause"));
175
+ }
176
+ function O() {
177
+ !n || !l || (l = !1, a.value = {
178
+ ...a.value,
179
+ status: n.elapsed < 0 ? "delayed" : "playing"
180
+ }, m("resume"), V());
181
+ }
182
+ function X() {
183
+ h(), L();
184
+ }
185
+ function ne() {
186
+ if (X(), n) return;
187
+ const e = y(i().from ?? f[0]), t = r();
188
+ c = f = [e, t], a.value = {
189
+ from: e,
190
+ to: t,
191
+ value: e,
192
+ progress: 0,
193
+ easedProgress: 0,
194
+ status: "idle",
195
+ direction: D(e, t),
196
+ iteration: 1
197
+ };
198
+ }
199
+ function ie() {
200
+ if (X(), n) return;
201
+ const e = r();
202
+ c = f = [y(i().from ?? e), e], a.value = {
203
+ from: e,
204
+ to: e,
205
+ value: e,
206
+ direction: "none",
207
+ progress: 1,
208
+ easedProgress: 1,
209
+ status: "idle",
210
+ iteration: 1
211
+ };
212
+ }
213
+ function ae() {
214
+ h();
215
+ const e = a.value.to === f[0] ? f[1] : f[0], t = a.value.value;
216
+ M(t, e, { delay: 0, endpoints: f });
217
+ }
218
+ function oe(e) {
219
+ if (!Number.isFinite(e)) return;
220
+ if (!n) {
221
+ const [s, u] = c;
222
+ x(q(s, u, 1, 1, _(), 0)), l = !0;
223
+ }
224
+ const t = n, o = d(e, 0, 0, 1);
225
+ t.elapsed = o * t.duration, G(t, o, l ? "paused" : "playing");
226
+ }
227
+ function b() {
228
+ U() ? v() : V();
229
+ }
230
+ function se(e) {
231
+ W = e, b();
232
+ }
233
+ return w(r, (e) => {
234
+ i().autoUpdate !== !1 && K(e);
235
+ }), w(g, (e) => {
236
+ e && I();
237
+ }), w(() => i().pauseWhenHidden, b), le(() => {
238
+ k = A = !0, ye(b), i().autoPlay ?? i().from !== void 0 ? H() : b();
239
+ }), re(() => {
240
+ A = !0, b();
241
+ }), fe(() => {
242
+ A = !1, v();
243
+ }), de(() => {
244
+ k = A = !1, h(), v(), n = void 0, ge(b);
245
+ }), {
246
+ frame: pe(a),
247
+ motionEnabled: ce(() => !g()),
248
+ play: ee,
249
+ pause: te,
250
+ resume: O,
251
+ stop: X,
252
+ restart: H,
253
+ reset: ne,
254
+ reverse: ae,
255
+ seek: oe,
256
+ finishAnimation: I,
257
+ updateTarget: K,
258
+ sync: ie,
259
+ hold: se
260
+ };
261
+ }
262
+ export {
263
+ Pe as useHysAnimatedNumber
264
+ };
@@ -0,0 +1,23 @@
1
+ import { toValue as n } from "vue";
2
+ function u(r) {
3
+ const o = () => new Set(n(r));
4
+ function e(t) {
5
+ for (const s of o()) s == null || s[t]();
6
+ }
7
+ return {
8
+ play: () => e("play"),
9
+ pause: () => e("pause"),
10
+ resume: () => e("resume"),
11
+ stop: () => e("stop"),
12
+ restart: () => e("restart"),
13
+ reset: () => e("reset"),
14
+ reverse: () => e("reverse"),
15
+ finishAnimation: () => e("finishAnimation"),
16
+ seek: (t) => {
17
+ for (const s of o()) s == null || s.seek(t);
18
+ }
19
+ };
20
+ }
21
+ export {
22
+ u as useHysNumberAnimationGroup
23
+ };
@@ -0,0 +1,81 @@
1
+ import { computed as x, onBeforeUnmount as y, onDeactivated as C } from "vue";
2
+ function L(r, a, p) {
3
+ let e;
4
+ function d() {
5
+ e == null || e.remove(), e = void 0;
6
+ }
7
+ function f() {
8
+ const t = r.value, o = t.getBoundingClientRect();
9
+ if (!o.width && !o.height) return o;
10
+ const n = getComputedStyle(t);
11
+ e || (e = document.createElement("div"), e.setAttribute("aria-hidden", "true"), document.body.append(e));
12
+ for (const l of [
13
+ "direction",
14
+ "font",
15
+ "font-family",
16
+ "font-size",
17
+ "font-weight",
18
+ "font-style",
19
+ "font-variant",
20
+ "letter-spacing",
21
+ "word-spacing",
22
+ "text-transform",
23
+ "text-indent",
24
+ "text-align",
25
+ "line-height",
26
+ "padding-top",
27
+ "padding-right",
28
+ "padding-bottom",
29
+ "padding-left",
30
+ "border-top-width",
31
+ "border-right-width",
32
+ "border-bottom-width",
33
+ "border-left-width",
34
+ "border-style",
35
+ "box-sizing",
36
+ "tab-size"
37
+ ])
38
+ e.style.setProperty(l, n.getPropertyValue(l));
39
+ const s = parseFloat(n.borderLeftWidth) || 0, g = parseFloat(n.borderRightWidth) || 0, u = parseFloat(n.borderTopWidth) || 0, b = t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement && t.wrap === "off";
40
+ Object.assign(e.style, {
41
+ position: "fixed",
42
+ top: "0px",
43
+ left: "-10000px",
44
+ visibility: "hidden",
45
+ pointerEvents: "none",
46
+ height: "auto",
47
+ overflow: "hidden",
48
+ whiteSpace: b ? "pre" : "pre-wrap",
49
+ overflowWrap: "break-word",
50
+ wordBreak: n.wordBreak,
51
+ width: (t.clientWidth ? t.clientWidth + s + g : o.width) + "px"
52
+ });
53
+ const c = p();
54
+ e.textContent = a.value.slice(0, c);
55
+ const i = document.createElement("span");
56
+ i.textContent = a.value.slice(c) || "​", e.append(i);
57
+ const w = parseFloat(n.lineHeight) || (parseFloat(n.fontSize) || 14) * 1.6, m = o.left + i.offsetLeft + s - t.scrollLeft, v = o.top + i.offsetTop + u - t.scrollTop;
58
+ return new window.DOMRect(m, v, 1, w);
59
+ }
60
+ const h = x(
61
+ () => r.value ? {
62
+ getBoundingClientRect: f,
63
+ contains: (t) => {
64
+ var o;
65
+ return !!((o = r.value) != null && o.contains(t));
66
+ },
67
+ focus: () => {
68
+ var t;
69
+ return (t = r.value) == null ? void 0 : t.focus();
70
+ },
71
+ get isConnected() {
72
+ var t;
73
+ return !!((t = r.value) != null && t.isConnected);
74
+ }
75
+ } : void 0
76
+ );
77
+ return y(d), C(d), { anchor: h, removeMirror: d };
78
+ }
79
+ export {
80
+ L as useMentionCaret
81
+ };