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.
- package/CHANGELOG.md +27 -0
- package/README.md +68 -73
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +467 -2
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
- package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
- package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
- package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
- package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
- package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
- package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
- package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
- package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
- package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
- package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
- package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
- package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +327 -274
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -154
- package/dist/components/HysModal/HysModal.vue.js +3 -3
- package/dist/components/HysModal/HysModal2.vue.js +81 -80
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- package/dist/components/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +472 -443
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1418 -1150
- package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
- package/dist/components/HysTour/HysTour.vue.js +291 -67
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/composables/animatedNumberDigits.js +106 -0
- package/dist/composables/animatedNumberFormat.js +222 -0
- package/dist/composables/animatedNumberTiming.js +66 -0
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/numberAnimation.js +72 -0
- package/dist/composables/numberAnimationCatalog.js +301 -0
- package/dist/composables/numberAnimationSequence.js +45 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/textInput.js +23 -14
- package/dist/composables/useDialog.js +50 -50
- package/dist/composables/useFloating.js +107 -103
- package/dist/composables/useHysAnimatedNumber.js +264 -0
- package/dist/composables/useHysNumberAnimationGroup.js +23 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -0
- package/dist/composables/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTextareaSize.js +62 -46
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/config.js +11 -11
- package/dist/index.js +183 -152
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +99 -6
- package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
- package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
- package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
- package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
- package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
- package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
- package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
- package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
- package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +12 -3
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +3 -3
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +3 -3
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +2 -2
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +6 -6
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +2 -2
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
- package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -40
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
- package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +46 -8
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +6 -1
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1740 -3
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
- package/dist/types/components/HysToast/HysToast.vue.d.ts +1 -1
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -9
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +3 -3
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +2 -2
- package/dist/types/composables/animatedNumber.d.ts +220 -0
- package/dist/types/composables/animatedNumberDigits.d.ts +32 -0
- package/dist/types/composables/animatedNumberFormat.d.ts +16 -0
- package/dist/types/composables/animatedNumberTiming.d.ts +21 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/drawer.d.ts +1 -1
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/modal.d.ts +2 -0
- package/dist/types/composables/numberAnimation.d.ts +29 -0
- package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
- package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
- package/dist/types/composables/selectOptions.d.ts +5 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +116 -6
- package/dist/types/composables/textInput.d.ts +39 -4
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/useFloating.d.ts +1 -1
- package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
- package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTextareaSize.d.ts +5 -2
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +46 -1
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- package/package.json +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { useHysControlState as
|
|
3
|
-
import { popupSize as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
})
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
45
|
+
O += window.scrollX, M += window.scrollY;
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
...
|
|
45
|
-
position:
|
|
46
|
-
left: `${Math.round(
|
|
47
|
-
top: `${Math.round(
|
|
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
|
|
57
|
-
cancelAnimationFrame(
|
|
60
|
+
function s() {
|
|
61
|
+
cancelAnimationFrame($), $ = requestAnimationFrame(F);
|
|
58
62
|
}
|
|
59
|
-
function
|
|
60
|
-
var
|
|
61
|
-
!(
|
|
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
|
|
64
|
-
var
|
|
65
|
-
if (!(!
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
else if (
|
|
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 ((
|
|
71
|
-
|
|
74
|
+
if ((a = v.value) != null && a.contains(l)) {
|
|
75
|
+
u();
|
|
72
76
|
return;
|
|
73
77
|
}
|
|
74
|
-
if ((i =
|
|
75
|
-
const
|
|
76
|
-
|
|
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
|
-
(!
|
|
86
|
+
(!o.length || l === (t.shiftKey ? o[0] : o.at(-1))) && u(!0);
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
|
-
function
|
|
88
|
-
var
|
|
89
|
-
document.removeEventListener("pointerdown",
|
|
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
|
|
95
|
+
function u(t = !1, a = !1) {
|
|
92
96
|
var i, l;
|
|
93
|
-
if (!(!
|
|
94
|
-
|
|
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
|
-
|
|
100
|
+
v.value.focus();
|
|
97
101
|
} finally {
|
|
98
|
-
|
|
102
|
+
p.value = !1;
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
}
|
|
102
|
-
async function
|
|
103
|
-
var l,
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
106
|
-
|
|
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 (!
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
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
|
|
117
|
-
const i =
|
|
120
|
+
}, await G(), a !== y || !c.value) return;
|
|
121
|
+
const i = ee(
|
|
118
122
|
"floating",
|
|
119
|
-
() =>
|
|
120
|
-
|
|
123
|
+
() => u(!0),
|
|
124
|
+
e.zIndex
|
|
121
125
|
);
|
|
122
|
-
|
|
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
|
|
125
|
-
return
|
|
128
|
+
function K() {
|
|
129
|
+
return c.value ? u() : N();
|
|
126
130
|
}
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
(
|
|
130
|
-
|
|
131
|
+
return D(
|
|
132
|
+
k,
|
|
133
|
+
(t) => {
|
|
134
|
+
t && u(!1, !0);
|
|
131
135
|
},
|
|
132
136
|
{ flush: "sync" }
|
|
133
|
-
),
|
|
134
|
-
() =>
|
|
135
|
-
(
|
|
136
|
-
|
|
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
|
-
),
|
|
140
|
-
|
|
143
|
+
), V(() => {
|
|
144
|
+
y++, B();
|
|
141
145
|
}), {
|
|
142
|
-
open:
|
|
143
|
-
style:
|
|
144
|
-
var
|
|
146
|
+
open: c,
|
|
147
|
+
style: X(() => {
|
|
148
|
+
var t;
|
|
145
149
|
return {
|
|
146
|
-
...
|
|
147
|
-
zIndex: String(((
|
|
150
|
+
...L.value,
|
|
151
|
+
zIndex: String(((t = W.value) == null ? void 0 : t.zIndex.value) ?? 1200)
|
|
148
152
|
};
|
|
149
153
|
}),
|
|
150
|
-
placement:
|
|
151
|
-
update:
|
|
152
|
-
show:
|
|
153
|
-
close:
|
|
154
|
-
toggle:
|
|
155
|
-
restoringFocus:
|
|
156
|
-
schedule:
|
|
157
|
-
isTop: () => (
|
|
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
|
-
|
|
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
|
+
};
|