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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ref as U, shallowRef as G, onMounted as I, onActivated as J, onDeactivated as K, onBeforeUnmount as P, onUpdated as Q, watch as j } from "vue";
|
|
2
|
+
const x = 16, H = (o) => o !== void 0 && Number.isFinite(o) ? Math.max(0, o) : 0;
|
|
3
|
+
function Z(o, k, v) {
|
|
4
|
+
const L = U(0), p = U(), a = G();
|
|
5
|
+
let f = 0, w = !1, i = !1, m, s;
|
|
6
|
+
function b() {
|
|
7
|
+
const t = p.value, c = o.value;
|
|
8
|
+
!t || !c || t.scrollLeft === c.scrollLeft || (t.scrollLeft = c.scrollLeft, m = t.scrollLeft);
|
|
9
|
+
}
|
|
10
|
+
function q(t) {
|
|
11
|
+
if (!i || !o.value) return;
|
|
12
|
+
const c = t.currentTarget.scrollLeft, e = c === m;
|
|
13
|
+
m = void 0, !e && c !== o.value.scrollLeft && (o.value.scrollLeft = c);
|
|
14
|
+
}
|
|
15
|
+
function D() {
|
|
16
|
+
var F, O;
|
|
17
|
+
f = 0;
|
|
18
|
+
const t = o.value;
|
|
19
|
+
if (!i || !(t != null && t.isConnected)) return;
|
|
20
|
+
const c = v(), e = typeof c == "object" ? c : void 0, y = (F = e == null ? void 0 : e.getContainer) == null ? void 0 : F.call(e), S = document.documentElement.clientWidth, T = document.documentElement.clientHeight, n = y instanceof HTMLElement ? y.getBoundingClientRect() : void 0, z = Math.max(0, (n == null ? void 0 : n.top) ?? 0), N = Math.min(T, (n == null ? void 0 : n.bottom) ?? T), d = t.getBoundingClientRect(), B = ((O = k.value) == null ? void 0 : O.getBoundingClientRect().height) ?? 0, V = Math.max(0, t.clientHeight - B);
|
|
21
|
+
L.value = Math.min(
|
|
22
|
+
V,
|
|
23
|
+
Math.max(0, z + H(e == null ? void 0 : e.offsetHeader) - d.top)
|
|
24
|
+
);
|
|
25
|
+
const g = t.scrollWidth - t.clientWidth, u = N - H(e == null ? void 0 : e.offsetScroll) - x, M = Math.max(
|
|
26
|
+
0,
|
|
27
|
+
(n == null ? void 0 : n.left) ?? 0,
|
|
28
|
+
d.left + t.clientLeft
|
|
29
|
+
), h = Math.min(
|
|
30
|
+
S,
|
|
31
|
+
(n == null ? void 0 : n.right) ?? S,
|
|
32
|
+
d.left + t.clientLeft + t.clientWidth
|
|
33
|
+
) - M;
|
|
34
|
+
if (g <= 1 || h <= 0 || d.bottom <= u + x || u <= d.top || u <= z + H(e == null ? void 0 : e.offsetHeader) + B) {
|
|
35
|
+
a.value = void 0;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const A = getComputedStyle(t).direction === "rtl" ? "rtl" : "ltr", r = a.value;
|
|
39
|
+
((r == null ? void 0 : r.top) !== u || r.left !== M || r.width !== h || r.contentWidth !== g + h || r.direction !== A) && (a.value = {
|
|
40
|
+
top: u,
|
|
41
|
+
left: M,
|
|
42
|
+
width: h,
|
|
43
|
+
contentWidth: g + h,
|
|
44
|
+
direction: A
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function l() {
|
|
48
|
+
i && !f && (f = requestAnimationFrame(D));
|
|
49
|
+
}
|
|
50
|
+
function E() {
|
|
51
|
+
i && (i = !1, cancelAnimationFrame(f), f = 0, window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l), s == null || s.disconnect(), L.value = 0, a.value = void 0);
|
|
52
|
+
}
|
|
53
|
+
function R() {
|
|
54
|
+
!w || !v() || i || !o.value || (i = !0, window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), typeof ResizeObserver < "u" && (s = new ResizeObserver(l), s.observe(o.value)), l());
|
|
55
|
+
}
|
|
56
|
+
function W() {
|
|
57
|
+
w = !0, R();
|
|
58
|
+
}
|
|
59
|
+
function C() {
|
|
60
|
+
w = !1, E();
|
|
61
|
+
}
|
|
62
|
+
return I(W), J(W), K(C), P(C), Q(l), j(v, (t) => t ? R() : E(), { flush: "post" }), j(
|
|
63
|
+
p,
|
|
64
|
+
() => {
|
|
65
|
+
m = void 0, b();
|
|
66
|
+
},
|
|
67
|
+
{ flush: "post" }
|
|
68
|
+
), {
|
|
69
|
+
headerTop: L,
|
|
70
|
+
bar: a,
|
|
71
|
+
scrollbar: p,
|
|
72
|
+
syncScrollbar: b,
|
|
73
|
+
scrollViewport: q,
|
|
74
|
+
scrollbarHeight: x
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
Z as useTableSticky
|
|
79
|
+
};
|
|
@@ -1,72 +1,88 @@
|
|
|
1
|
-
import { watch as
|
|
2
|
-
function
|
|
3
|
-
let
|
|
4
|
-
const h = () => {
|
|
1
|
+
import { shallowRef as H, watch as z, nextTick as l, onMounted as L, onActivated as N, onDeactivated as O, onBeforeUnmount as C } from "vue";
|
|
2
|
+
function j(v, i, T, E) {
|
|
3
|
+
let d = !0, o, t, f = -1;
|
|
4
|
+
const n = H({}), h = () => {
|
|
5
5
|
var e;
|
|
6
6
|
return ((e = v.value) == null ? void 0 : e.tagName) === "TEXTAREA" ? v.value : void 0;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
a = void 0;
|
|
8
|
+
function R() {
|
|
10
9
|
const e = h();
|
|
11
|
-
if (!
|
|
12
|
-
if (!
|
|
13
|
-
|
|
10
|
+
if (!d || !e) return;
|
|
11
|
+
if (!i.autosize) {
|
|
12
|
+
n.value.height && (n.value = {});
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
if (!e.getBoundingClientRect().width) return;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
e.style.height = "0px";
|
|
23
|
-
const b = e.scrollHeight + l, g = Math.min(
|
|
24
|
-
A * c + w + l,
|
|
25
|
-
Math.max(R * c + w + l, b)
|
|
16
|
+
const w = e.style.height, c = e.style.overflowY, s = typeof i.autosize == "object" ? i.autosize : {}, r = getComputedStyle(e), g = parseFloat(r.lineHeight) || parseFloat(r.fontSize) * 1.5 || 21, x = (parseFloat(r.paddingTop) || 0) + (parseFloat(r.paddingBottom) || 0), u = (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0), M = Number.isFinite(s.minRows) ? Math.max(1, Math.min(1e4, Math.floor(s.minRows))) : 1, B = Number.isFinite(s.maxRows) ? Math.max(M, Math.min(1e4, Math.floor(s.maxRows))) : 1 / 0;
|
|
17
|
+
e.style.height = "0px", e.style.overflowY = "hidden";
|
|
18
|
+
const p = e.scrollHeight + u, y = Math.min(
|
|
19
|
+
B * g + x + u,
|
|
20
|
+
Math.max(M * g + x + u, p)
|
|
26
21
|
);
|
|
27
|
-
e.style.height =
|
|
22
|
+
e.style.height = w, e.style.overflowY = c;
|
|
23
|
+
const A = (r.boxSizing === "border-box" ? y : Math.max(g, y - x - u)) + "px", S = p > y + 1 ? "auto" : "hidden";
|
|
24
|
+
(n.value.height !== A || n.value.overflowY !== S) && (n.value = { height: A, overflowY: S });
|
|
28
25
|
}
|
|
29
|
-
async function
|
|
30
|
-
await
|
|
26
|
+
async function Y() {
|
|
27
|
+
await l(), o !== void 0 && cancelAnimationFrame(o), o = void 0, R(), await l();
|
|
28
|
+
}
|
|
29
|
+
async function a() {
|
|
30
|
+
await l(), !(!d || !h() || o !== void 0) && (o = requestAnimationFrame(() => {
|
|
31
|
+
o = void 0, R();
|
|
32
|
+
}));
|
|
31
33
|
}
|
|
32
34
|
function m() {
|
|
33
|
-
|
|
35
|
+
t == null || t.disconnect(), t = void 0, f = -1, window.removeEventListener("resize", a);
|
|
34
36
|
const e = h();
|
|
35
|
-
if (!(!
|
|
36
|
-
if (!
|
|
37
|
-
|
|
37
|
+
if (!(!d || !e)) {
|
|
38
|
+
if (!i.autosize) {
|
|
39
|
+
n.value = {};
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
40
|
-
window.addEventListener("resize",
|
|
41
|
-
var
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
}),
|
|
42
|
+
window.addEventListener("resize", a), typeof ResizeObserver < "u" && (t = new ResizeObserver((w) => {
|
|
43
|
+
var s;
|
|
44
|
+
const c = (s = w[0]) == null ? void 0 : s.contentRect.width;
|
|
45
|
+
c !== void 0 && Math.abs(c - f) > 0.5 && (f = c, a());
|
|
46
|
+
}), t.observe(e)), a();
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
+
function b() {
|
|
50
|
+
d = !0, l(m);
|
|
49
51
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
+
function F() {
|
|
53
|
+
d = !1, t == null || t.disconnect(), t = void 0, o !== void 0 && cancelAnimationFrame(o), o = void 0, window.removeEventListener("resize", a);
|
|
52
54
|
}
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
return z(
|
|
56
|
+
[
|
|
57
|
+
E,
|
|
58
|
+
T,
|
|
59
|
+
() => i.rows,
|
|
60
|
+
() => i.autosize,
|
|
61
|
+
() => i.inputStyle,
|
|
62
|
+
() => {
|
|
63
|
+
var e;
|
|
64
|
+
return (e = i.inputProps) == null ? void 0 : e.style;
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
a,
|
|
68
|
+
{
|
|
69
|
+
deep: !0
|
|
70
|
+
}
|
|
71
|
+
), z(v, () => {
|
|
72
|
+
n.value = {}, l(m);
|
|
73
|
+
}), z(
|
|
74
|
+
() => i.autosize,
|
|
59
75
|
() => {
|
|
60
|
-
|
|
76
|
+
l(m);
|
|
61
77
|
},
|
|
62
78
|
{ deep: !0 }
|
|
63
|
-
),
|
|
79
|
+
), L(() => {
|
|
64
80
|
var e;
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
b(), (e = document.fonts) == null || e.ready.then(() => {
|
|
82
|
+
d && a();
|
|
67
83
|
});
|
|
68
|
-
}),
|
|
84
|
+
}), N(b), O(F), C(F), { resize: Y, textareaStyle: n };
|
|
69
85
|
}
|
|
70
86
|
export {
|
|
71
|
-
|
|
87
|
+
j as useTextareaSize
|
|
72
88
|
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { ref as S, shallowRef as E, computed as O, watch as H, onMounted as j, onActivated as k, onDeactivated as D, onBeforeUnmount as q } from "vue";
|
|
2
|
+
import { popupSize as X } from "../motion/popup.js";
|
|
3
|
+
import { positionFloating as Y } from "./floatingPosition.js";
|
|
4
|
+
function R(t) {
|
|
5
|
+
try {
|
|
6
|
+
const s = typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : t;
|
|
7
|
+
return s instanceof HTMLElement && s.isConnected ? s : void 0;
|
|
8
|
+
} catch {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function F() {
|
|
13
|
+
return {
|
|
14
|
+
width: document.documentElement.clientWidth || window.innerWidth,
|
|
15
|
+
height: document.documentElement.clientHeight || window.innerHeight
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function B(t, s) {
|
|
19
|
+
const n = t.getBoundingClientRect();
|
|
20
|
+
let l = Math.max(0, n.left), i = Math.max(0, n.top), e = Math.min(s.width, n.right), o = Math.min(s.height, n.bottom);
|
|
21
|
+
if (!(!t.getClientRects().length || getComputedStyle(t).visibility !== "visible")) {
|
|
22
|
+
for (let c = t.parentElement; c && c !== document.body; c = c.parentElement) {
|
|
23
|
+
const { overflowX: w, overflowY: M } = getComputedStyle(c), f = /^(auto|scroll|hidden|clip|overlay)$/.test(w), r = /^(auto|scroll|hidden|clip|overlay)$/.test(M);
|
|
24
|
+
if (!f && !r) continue;
|
|
25
|
+
const $ = c.getBoundingClientRect();
|
|
26
|
+
f && (l = Math.max(l, $.left + c.clientLeft), e = Math.min(e, $.left + c.clientLeft + c.clientWidth)), r && (i = Math.max(i, $.top + c.clientTop), o = Math.min(o, $.top + c.clientTop + c.clientHeight));
|
|
27
|
+
}
|
|
28
|
+
return e > l && o > i ? new window.DOMRect(l, i, e - l, o - i) : void 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const V = (t, s) => Number.isFinite(t) ? Math.max(0, t) : s;
|
|
32
|
+
function Z(t, s, n) {
|
|
33
|
+
const [l, i] = Array.isArray(n) ? n : [n, n], e = V(l, 6), o = V(i, 6), c = Math.max(0, t.left - e), w = Math.max(0, t.top - o);
|
|
34
|
+
return new window.DOMRect(
|
|
35
|
+
c,
|
|
36
|
+
w,
|
|
37
|
+
Math.min(s.width, t.right + e) - c,
|
|
38
|
+
Math.min(s.height, t.bottom + o) - w
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
function N(t, s) {
|
|
42
|
+
const { left: n, top: l, right: i, bottom: e } = t, o = Math.min(s, t.width / 2, t.height / 2);
|
|
43
|
+
return [
|
|
44
|
+
`M ${n + o} ${l} H ${i - o} Q ${i} ${l} ${i} ${l + o}`,
|
|
45
|
+
`V ${e - o} Q ${i} ${e} ${i - o} ${e}`,
|
|
46
|
+
`H ${n + o} Q ${n} ${e} ${n} ${e - o}`,
|
|
47
|
+
`V ${l + o} Q ${n} ${l} ${n + o} ${l} Z`
|
|
48
|
+
].join(" ");
|
|
49
|
+
}
|
|
50
|
+
function G(t, s, n, l) {
|
|
51
|
+
const i = S(!1), e = E(), o = E(), c = E({ width: 0, height: 0 }), w = E(), M = E();
|
|
52
|
+
let f, r;
|
|
53
|
+
const $ = O(() => i.value && t.value ? R(l.value) : void 0), T = O(() => {
|
|
54
|
+
var p;
|
|
55
|
+
const { width: a, height: u } = c.value;
|
|
56
|
+
if (!a || !u) return "";
|
|
57
|
+
const d = `M 0 0 H ${a} V ${u} H 0 Z`;
|
|
58
|
+
return o.value ? d + " " + N(o.value, V((p = n.value.gap) == null ? void 0 : p.radius, 4)) : d;
|
|
59
|
+
});
|
|
60
|
+
function A() {
|
|
61
|
+
var L;
|
|
62
|
+
const a = F();
|
|
63
|
+
c.value = a;
|
|
64
|
+
const u = e.value && B(e.value, a), d = s.value;
|
|
65
|
+
if (!u || !d) {
|
|
66
|
+
o.value = void 0, w.value = void 0, M.value = void 0;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const p = n.value, b = Z(u, a, (L = p.gap) == null ? void 0 : L.offset);
|
|
70
|
+
o.value = b;
|
|
71
|
+
const v = Y(
|
|
72
|
+
p.mask === !1 ? u : b,
|
|
73
|
+
X(d),
|
|
74
|
+
a,
|
|
75
|
+
p.placement ?? "bottom",
|
|
76
|
+
9,
|
|
77
|
+
12,
|
|
78
|
+
!0
|
|
79
|
+
);
|
|
80
|
+
w.value = v;
|
|
81
|
+
const y = p.arrow, x = typeof y == "object" && y.pointAtCenter === !1, g = x && v.placement.endsWith("start") ? 0 : x && v.placement.endsWith("end") ? 1 : 0.5, m = (W, Q) => Math.max(12, Math.min(W, Q - 12));
|
|
82
|
+
M.value = {
|
|
83
|
+
x: m(u.left + u.width * g - v.x, v.width),
|
|
84
|
+
y: m(u.top + u.height * g - v.y, v.height)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function h() {
|
|
88
|
+
f === void 0 && (f = requestAnimationFrame(() => {
|
|
89
|
+
f = void 0, A();
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
function C(a) {
|
|
93
|
+
var u;
|
|
94
|
+
if (e.value !== a) {
|
|
95
|
+
if (e.value && (r == null || r.unobserve(e.value)), e.value = a, a) {
|
|
96
|
+
r == null || r.observe(a);
|
|
97
|
+
const d = n.value.scrollIntoViewOptions, p = a.getBoundingClientRect(), b = F(), v = B(a, b);
|
|
98
|
+
d !== !1 && (!v || v.width < p.width || v.height < p.height) && ((u = a.scrollIntoView) == null || u.call(a, typeof d == "object" ? { block: "center", inline: "nearest", ...d } : { block: "center", inline: "nearest" }));
|
|
99
|
+
}
|
|
100
|
+
h();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return H($, C, { flush: "post" }), H(n, () => {
|
|
104
|
+
i.value && t.value && h();
|
|
105
|
+
}, { flush: "post" }), H([i, t, s], ([a, u, d], p, b) => {
|
|
106
|
+
var y, x;
|
|
107
|
+
if (!a || !u || !d) return;
|
|
108
|
+
r = typeof ResizeObserver == "function" ? new ResizeObserver(h) : void 0, r == null || r.observe(d), e.value && (r == null || r.observe(e.value)), C(R(l.value)), A();
|
|
109
|
+
const v = new MutationObserver((g) => {
|
|
110
|
+
var m;
|
|
111
|
+
l.value && ((m = e.value) != null && m.isConnected ? g.some((L) => !d.contains(L.target)) && h() : C(R(l.value)));
|
|
112
|
+
});
|
|
113
|
+
v.observe(document.body, { childList: !0, subtree: !0 }), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), (y = window.visualViewport) == null || y.addEventListener("resize", h), (x = window.visualViewport) == null || x.addEventListener("scroll", h), b(() => {
|
|
114
|
+
var g, m;
|
|
115
|
+
f !== void 0 && cancelAnimationFrame(f), f = void 0, r == null || r.disconnect(), r = void 0, v.disconnect(), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0), (g = window.visualViewport) == null || g.removeEventListener("resize", h), (m = window.visualViewport) == null || m.removeEventListener("scroll", h), e.value = void 0, w.value = void 0, o.value = void 0;
|
|
116
|
+
});
|
|
117
|
+
}, { flush: "post" }), j(() => {
|
|
118
|
+
i.value = !0;
|
|
119
|
+
}), k(() => {
|
|
120
|
+
i.value = !0;
|
|
121
|
+
}), D(() => {
|
|
122
|
+
i.value = !1;
|
|
123
|
+
}), q(() => {
|
|
124
|
+
f !== void 0 && cancelAnimationFrame(f);
|
|
125
|
+
}), { view: c, bounds: o, card: w, arrow: M, path: T };
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
G as useTourLayout
|
|
129
|
+
};
|
package/dist/config.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { computed as a, toValue as s,
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const e = c(), n = { theme: t.theme ?? e.theme, motion: t.motion ?? e.motion };
|
|
5
|
-
|
|
6
|
-
const o =
|
|
1
|
+
import { computed as a, toValue as s, getCurrentInstance as u, inject as m, provide as l } from "vue";
|
|
2
|
+
const i = Symbol("hys-ui-config"), r = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function p(t) {
|
|
4
|
+
const e = c(), n = { theme: t.theme ?? e.theme, motion: t.motion ?? e.motion, buttonAutoInsertSpace: t.buttonAutoInsertSpace ?? e.buttonAutoInsertSpace };
|
|
5
|
+
l(i, n);
|
|
6
|
+
const o = u();
|
|
7
7
|
o && r.set(o, n);
|
|
8
8
|
}
|
|
9
9
|
function c() {
|
|
10
|
-
const t =
|
|
11
|
-
return t && r.get(t) ||
|
|
10
|
+
const t = u();
|
|
11
|
+
return t && r.get(t) || m(i, {});
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function h() {
|
|
14
14
|
const t = c();
|
|
15
15
|
return a(() => {
|
|
16
16
|
const e = s(t.theme), n = s(t.motion);
|
|
@@ -18,7 +18,7 @@ function d() {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
p as provideHysConfig,
|
|
22
22
|
c as useHysConfig,
|
|
23
|
-
|
|
23
|
+
h as useHysRootAttrs
|
|
24
24
|
};
|