@king-one/antdv 1.0.57 → 1.0.60
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 +18 -0
- package/dist/es/components/form/component/form-item.vue.mjs +4 -0
- package/dist/es/components/form/component/form-item.vue2.mjs +56 -0
- package/dist/es/components/form/component/form.mjs +8 -6
- package/dist/es/components/form/component/form.vue2.mjs +16 -14
- package/dist/es/components/form/content/form-content.mjs +13 -0
- package/dist/es/components/form/index.mjs +10 -6
- package/dist/es/components/index.mjs +16 -13
- package/dist/es/components/pro-modal/index.mjs +8 -7
- package/dist/es/components/pro-modal/src/ProModal.vue.mjs +4 -0
- package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +82 -0
- package/dist/es/components/pro-modal/src/types.mjs +4 -0
- package/dist/es/components/pro-signature/index.mjs +10 -0
- package/dist/es/components/pro-signature/src/ProSignature.vue.mjs +4 -0
- package/dist/es/components/pro-signature/src/ProSignature.vue2.mjs +145 -0
- package/dist/es/components/pro-signature/src/types.mjs +40 -0
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +32 -26
- package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +35 -35
- package/dist/es/components/scroll-bar/index.mjs +6 -5
- package/dist/es/components/scroll-bar/src/scroll-bar.mjs +163 -156
- package/dist/es/components/scroll-bar/src/types.mjs +4 -3
- package/dist/es/components/scroll-bar/style/index.mjs +2 -0
- package/dist/es/components/utils/install.mjs +4 -2
- package/dist/es/index.mjs +48 -42
- package/dist/lib/components/form/component/form-item.vue.js +1 -0
- package/dist/lib/components/form/component/form-item.vue2.js +1 -0
- package/dist/lib/components/form/component/form.js +1 -1
- package/dist/lib/components/form/component/form.vue2.js +1 -1
- package/dist/lib/components/form/content/form-content.js +1 -0
- package/dist/lib/components/form/index.js +1 -1
- package/dist/lib/components/index.js +1 -1
- package/dist/lib/components/pro-modal/index.js +1 -1
- package/dist/lib/components/pro-modal/src/ProModal.vue.js +1 -0
- package/dist/lib/components/pro-modal/src/ProModal.vue2.js +1 -0
- package/dist/lib/components/pro-modal/src/types.js +1 -1
- package/dist/lib/components/pro-signature/index.js +1 -0
- package/dist/lib/components/pro-signature/src/ProSignature.vue.js +1 -0
- package/dist/lib/components/pro-signature/src/ProSignature.vue2.js +1 -0
- package/dist/lib/components/pro-signature/src/types.js +1 -0
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +1 -1
- package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +1 -1
- package/dist/lib/components/scroll-bar/index.js +1 -1
- package/dist/lib/components/scroll-bar/src/scroll-bar.js +1 -1
- package/dist/lib/components/scroll-bar/src/types.js +1 -1
- package/dist/lib/components/scroll-bar/style/index.js +1 -0
- package/dist/lib/components/utils/install.js +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/pro-modal.css +1 -1
- package/dist/theme-chalk/scale-virtual-list.css +1 -1
- package/dist/types/components/form/component/form-item.vue.d.ts +30 -0
- package/dist/types/components/form/component/form.d.ts +11 -6
- package/dist/types/components/form/component/form.vue.d.ts +2 -17
- package/dist/types/components/form/content/form-content.d.ts +8 -0
- package/dist/types/components/form/index.d.ts +31 -18
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/pro-modal/index.d.ts +81 -13
- package/dist/types/components/pro-modal/src/Modal.d.ts +12 -4
- package/dist/types/components/pro-modal/src/ProModal.vue.d.ts +52 -0
- package/dist/types/components/pro-modal/src/types.d.ts +5 -1
- package/dist/types/components/pro-signature/index.d.ts +95 -0
- package/dist/types/components/pro-signature/src/ProSignature.vue.d.ts +95 -0
- package/dist/types/components/pro-signature/src/types.d.ts +37 -0
- package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +3 -1
- package/dist/types/components/scale-virtual-list/hooks/useVirtualList.d.ts +1 -1
- package/dist/types/components/scroll-bar/index.d.ts +7 -3
- package/dist/types/components/scroll-bar/src/scroll-bar.d.ts +7 -3
- package/dist/types/components/scroll-bar/src/types.d.ts +1 -0
- package/dist/types/components/utils/install.d.ts +2 -1
- package/global.d.ts +1 -0
- package/package.json +1 -3
- package/dist/es/components/pro-modal/src/Modal.mjs +0 -44
- package/dist/lib/components/pro-modal/src/Modal.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createEventHook as $ } from "@vueuse/shared";
|
|
2
|
-
import { ref as z, shallowRef as F, watch as M, computed as y } from "vue
|
|
3
|
-
import { useElementSize as
|
|
2
|
+
import { ref as z, shallowRef as F, watch as M, computed as y } from "vue";
|
|
3
|
+
import { useElementSize as X } from "@vueuse/core";
|
|
4
4
|
function I(r, t) {
|
|
5
|
-
const { containerStyle: a, wrapperProps:
|
|
5
|
+
const { containerStyle: a, wrapperProps: n, scrollTo: c, calculateRange: e, currentList: o, containerRef: l, scaleTo: u, state: s, onUpdate: f } = "itemHeight" in t ? Y(t, r) : S(t, r);
|
|
6
6
|
return {
|
|
7
7
|
onUpdate: f,
|
|
8
8
|
state: s,
|
|
9
9
|
scaleTo: u,
|
|
10
|
-
list:
|
|
10
|
+
list: o,
|
|
11
11
|
scrollTo: c,
|
|
12
12
|
containerProps: {
|
|
13
13
|
ref: l,
|
|
@@ -16,54 +16,54 @@ function I(r, t) {
|
|
|
16
16
|
},
|
|
17
17
|
style: a
|
|
18
18
|
},
|
|
19
|
-
wrapperProps:
|
|
19
|
+
wrapperProps: n
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function O(r) {
|
|
23
|
-
const t = z(null), a =
|
|
24
|
-
return { state: z({ start: 0, end: 10, current: 0, scale: 1 }), source: c, currentList:
|
|
23
|
+
const t = z(null), a = X(t), n = z([]), c = F(r);
|
|
24
|
+
return { state: z({ start: 0, end: 10, current: 0, scale: 1 }), source: c, currentList: n, size: a, containerRef: t };
|
|
25
25
|
}
|
|
26
26
|
function P(r, t, a) {
|
|
27
|
-
return (
|
|
27
|
+
return (n) => {
|
|
28
28
|
const { start: c = 0, scale: e = 1 } = r.value;
|
|
29
29
|
if (typeof a == "number")
|
|
30
|
-
return Math.ceil(
|
|
31
|
-
let
|
|
30
|
+
return Math.ceil(n / (a * e));
|
|
31
|
+
let o = 0, l = 0;
|
|
32
32
|
for (let u = c; u < t.value.length; u++) {
|
|
33
33
|
const s = a(u) * e;
|
|
34
|
-
if (
|
|
34
|
+
if (o += s, l = u, o > n)
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
return l - c;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
function W(r, t, a) {
|
|
41
|
-
return (
|
|
41
|
+
return (n) => {
|
|
42
42
|
const { scale: c = 1 } = a.value;
|
|
43
43
|
if (typeof t == "number")
|
|
44
|
-
return Math.floor(
|
|
45
|
-
let e = 0,
|
|
44
|
+
return Math.floor(n / (t * c)) + 1;
|
|
45
|
+
let e = 0, o = 0;
|
|
46
46
|
for (let l = 0; l < r.value.length; l++) {
|
|
47
47
|
const u = t(l) * c;
|
|
48
|
-
if (e += u, e >=
|
|
49
|
-
|
|
48
|
+
if (e += u, e >= n) {
|
|
49
|
+
o = l;
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return o + 1;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function k(r, t, a,
|
|
56
|
+
function k(r, t, a, n, { containerRef: c, state: e, currentList: o, source: l }, u) {
|
|
57
57
|
return () => {
|
|
58
58
|
const s = c.value;
|
|
59
59
|
if (s) {
|
|
60
|
-
const f = a(r === "vertical" ? s.scrollTop : s.scrollLeft), i =
|
|
60
|
+
const f = a(r === "vertical" ? s.scrollTop : s.scrollLeft), i = n(r === "vertical" ? s.clientHeight : s.clientWidth), p = f - t, g = f + i + t;
|
|
61
61
|
e.value = {
|
|
62
62
|
start: p < 0 ? 0 : p,
|
|
63
63
|
end: g > l.value.length ? l.value.length : g,
|
|
64
64
|
current: f,
|
|
65
65
|
scale: e.value.scale
|
|
66
|
-
},
|
|
66
|
+
}, o.value = l.value.slice(e.value.start, e.value.end).map((h, v) => ({
|
|
67
67
|
data: h,
|
|
68
68
|
index: v + e.value.start
|
|
69
69
|
})), u(e.value);
|
|
@@ -71,33 +71,33 @@ function k(r, t, a, o, { containerRef: c, state: e, currentList: n, source: l },
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
function D(r, t, a) {
|
|
74
|
-
return (
|
|
74
|
+
return (n) => {
|
|
75
75
|
const { scale: c = 1 } = a.value;
|
|
76
|
-
return typeof r == "number" ?
|
|
76
|
+
return typeof r == "number" ? n * (r * c) : t.value.slice(0, n).reduce((o, l, u) => o + r(u) * c, 0);
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function E(r, t, a,
|
|
79
|
+
function E(r, t, a, n) {
|
|
80
80
|
M([r.width, r.height, t, a], () => {
|
|
81
|
-
|
|
81
|
+
n();
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function G(r, t, a) {
|
|
85
85
|
return y(() => {
|
|
86
|
-
const { scale:
|
|
87
|
-
return typeof r == "number" ? t.value.length * r *
|
|
86
|
+
const { scale: n = 1 } = a.value;
|
|
87
|
+
return typeof r == "number" ? t.value.length * r * n : t.value.reduce((c, e, o) => c + r(o) * n, 0);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const K = {
|
|
91
91
|
horizontal: "scrollLeft",
|
|
92
92
|
vertical: "scrollTop"
|
|
93
93
|
};
|
|
94
|
-
function U(r, t, a,
|
|
94
|
+
function U(r, t, a, n) {
|
|
95
95
|
return (c) => {
|
|
96
|
-
|
|
96
|
+
n.value && (n.value[K[r]] = a(c), t());
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const { on: a, trigger:
|
|
99
|
+
function S(r, t) {
|
|
100
|
+
const { on: a, trigger: n } = $(), c = O(t), { state: e, source: o, currentList: l, size: u, containerRef: s } = c, f = { overflowX: "auto" }, { itemWidth: i, overscan: p = 5 } = r, g = P(e, o, i), h = W(o, i, e), v = k("horizontal", p, h, g, c, n), m = D(i, o, e), d = y(() => m(e.value.start)), R = G(i, o, e);
|
|
101
101
|
E(u, t, s, v);
|
|
102
102
|
const V = U("horizontal", v, m, s), b = (T) => {
|
|
103
103
|
e.value.scale = T;
|
|
@@ -108,7 +108,7 @@ function X(r, t) {
|
|
|
108
108
|
marginLeft: `${d.value}px`,
|
|
109
109
|
display: "flex",
|
|
110
110
|
transform: `scale(${e.value.scale})`,
|
|
111
|
-
transformOrigin: "
|
|
111
|
+
transformOrigin: "0% 0%"
|
|
112
112
|
// position: 'absolute',
|
|
113
113
|
// left: '50%'
|
|
114
114
|
}
|
|
@@ -126,20 +126,20 @@ function X(r, t) {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
function Y(r, t) {
|
|
129
|
-
const { on: a, trigger:
|
|
129
|
+
const { on: a, trigger: n } = $(), c = O(t), { state: e, source: o, currentList: l, size: u, containerRef: s } = c, f = { overflowY: "auto" }, { itemHeight: i, overscan: p = 5 } = r, g = P(e, o, i), h = W(o, i, e), v = k("vertical", p, h, g, c, n), m = D(i, o, e), d = y(() => m(e.value.start)), R = G(i, o, e);
|
|
130
130
|
E(u, t, s, v);
|
|
131
131
|
const V = U("vertical", v, m, s), b = (T) => {
|
|
132
132
|
const w = s.value;
|
|
133
133
|
if (w) {
|
|
134
134
|
const { current: C } = e.value;
|
|
135
135
|
let L = 0;
|
|
136
|
-
typeof i == "number" ? L = C * (T * i - e.value.scale * i) : L =
|
|
136
|
+
typeof i == "number" ? L = C * (T * i - e.value.scale * i) : L = o.value.slice(0, C).reduce((_, j, H) => _ + T * i(H) - e.value.scale * i(H), 0), w.scrollTop = w.scrollTop + L >= 0 ? w.scrollTop + L : 0, e.value.scale = T;
|
|
137
137
|
}
|
|
138
138
|
}, x = y(() => ({
|
|
139
139
|
style: {
|
|
140
140
|
height: `${R.value - d.value}px`,
|
|
141
141
|
marginTop: `${d.value}px`,
|
|
142
|
-
transform: `scale(${e.value.scale})`,
|
|
142
|
+
transform: `translateX(-50%) scale(${e.value.scale})`,
|
|
143
143
|
transformOrigin: "50% 0%"
|
|
144
144
|
}
|
|
145
145
|
}));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { withInstall as r } from "../utils/install.mjs";
|
|
2
2
|
import o from "./src/scroll-bar.mjs";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import "./style/index.mjs";
|
|
4
|
+
import { scrollbarProps as c } from "./src/types.mjs";
|
|
5
|
+
const m = r(o);
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
m as KScrollBar,
|
|
8
|
+
m as default,
|
|
9
|
+
c as scrollbarProps
|
|
9
10
|
};
|
|
@@ -1,257 +1,264 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { off as
|
|
4
|
-
import { defaultNamespace as
|
|
5
|
-
import { scrollbarProps as
|
|
6
|
-
|
|
7
|
-
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !ie(o);
|
|
8
|
-
}
|
|
9
|
-
const we = /* @__PURE__ */ ce({
|
|
1
|
+
import { defineComponent as ue, onMounted as se, ref as l, computed as r, createVNode as h, mergeProps as fe } from "vue";
|
|
2
|
+
import { useResizeObserver as k } from "@vueuse/core";
|
|
3
|
+
import { off as T, on as X } from "evtd";
|
|
4
|
+
import { defaultNamespace as s } from "../../../hooks/use-namespace/index.mjs";
|
|
5
|
+
import { scrollbarProps as de } from "./types.mjs";
|
|
6
|
+
const Me = /* @__PURE__ */ ue({
|
|
10
7
|
name: "KScrollbar",
|
|
11
|
-
props:
|
|
8
|
+
props: de,
|
|
12
9
|
inheritAttrs: !1,
|
|
13
10
|
setup(o) {
|
|
14
11
|
se(() => {
|
|
15
|
-
o.container ||
|
|
12
|
+
o.container || v();
|
|
16
13
|
});
|
|
17
|
-
const d = () => {
|
|
18
|
-
R();
|
|
19
|
-
}, b = () => {
|
|
20
|
-
R();
|
|
21
|
-
}, p = a(null), x = a(null), m = a(null), P = a(null), s = a(null), h = a(null), v = a(null), S = a(null), T = a(null), X = a(null), q = i(() => {
|
|
14
|
+
const R = l(null), m = l(null), x = l(null), Y = l(null), d = l(null), f = l(null), u = l(null), S = l(null), b = l(null), L = l(null), q = r(() => {
|
|
22
15
|
var e;
|
|
23
|
-
return ((e = o.content) == null ? void 0 : e.call(o)) ||
|
|
24
|
-
}),
|
|
16
|
+
return ((e = o.content) == null ? void 0 : e.call(o)) || R.value;
|
|
17
|
+
}), g = r(() => {
|
|
25
18
|
var e;
|
|
26
|
-
return ((e = o.container) == null ? void 0 : e.call(o)) ||
|
|
27
|
-
}),
|
|
19
|
+
return ((e = o.container) == null ? void 0 : e.call(o)) || m.value;
|
|
20
|
+
}), H = l(0), W = l(0);
|
|
21
|
+
k(R, () => {
|
|
22
|
+
v();
|
|
23
|
+
}), k(m, () => {
|
|
24
|
+
v();
|
|
25
|
+
});
|
|
26
|
+
const F = r(() => {
|
|
28
27
|
const {
|
|
29
28
|
value: e
|
|
30
|
-
} =
|
|
29
|
+
} = u, {
|
|
31
30
|
value: n
|
|
32
|
-
} =
|
|
31
|
+
} = d;
|
|
33
32
|
return e !== null && n !== null && n > e;
|
|
34
|
-
}),
|
|
33
|
+
}), w = l(!1), G = r(() => {
|
|
34
|
+
const {
|
|
35
|
+
trigger: e
|
|
36
|
+
} = o;
|
|
37
|
+
return e === "none" || w.value;
|
|
38
|
+
}), $ = r(() => {
|
|
35
39
|
const {
|
|
36
40
|
value: e
|
|
37
|
-
} =
|
|
41
|
+
} = u, {
|
|
38
42
|
value: n
|
|
39
|
-
} =
|
|
43
|
+
} = d, {
|
|
40
44
|
value: t
|
|
41
|
-
} =
|
|
45
|
+
} = b;
|
|
42
46
|
return e === null || n === null || t === null ? 0 : Math.min(e, t * e / n + 5 * 1.5);
|
|
43
|
-
}),
|
|
47
|
+
}), J = r(() => `${$.value}px`), Q = r(() => {
|
|
44
48
|
const {
|
|
45
49
|
value: e
|
|
46
|
-
} =
|
|
50
|
+
} = u, {
|
|
47
51
|
value: n
|
|
48
|
-
} =
|
|
52
|
+
} = H, {
|
|
49
53
|
value: t
|
|
50
|
-
} =
|
|
51
|
-
value:
|
|
52
|
-
} =
|
|
53
|
-
if (e === null || t === null ||
|
|
54
|
+
} = d, {
|
|
55
|
+
value: c
|
|
56
|
+
} = b;
|
|
57
|
+
if (e === null || t === null || c === null)
|
|
54
58
|
return 0;
|
|
55
59
|
{
|
|
56
|
-
const
|
|
57
|
-
return
|
|
60
|
+
const a = t - e;
|
|
61
|
+
return a ? n / a * (c - $.value) : 0;
|
|
58
62
|
}
|
|
59
|
-
}),
|
|
60
|
-
let
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
63
|
-
z !== void 0 && window.clearTimeout(z),
|
|
63
|
+
}), Z = r(() => `${Q.value}px`);
|
|
64
|
+
let p = !1, N = 0, U = 0, y, z;
|
|
65
|
+
const _ = (e) => {
|
|
66
|
+
if (!p) return;
|
|
67
|
+
z !== void 0 && window.clearTimeout(z), y !== void 0 && window.clearTimeout(y);
|
|
64
68
|
const {
|
|
65
69
|
value: n
|
|
66
|
-
} =
|
|
70
|
+
} = u, {
|
|
67
71
|
value: t
|
|
68
|
-
} =
|
|
69
|
-
value:
|
|
70
|
-
} =
|
|
72
|
+
} = d, {
|
|
73
|
+
value: c
|
|
74
|
+
} = $;
|
|
71
75
|
if (n === null || t === null) return;
|
|
72
|
-
const
|
|
73
|
-
let
|
|
74
|
-
|
|
76
|
+
const C = (e.clientY - U) * (t - n) / (n - c), E = t - n;
|
|
77
|
+
let i = N + C;
|
|
78
|
+
i = Math.min(E, i), i = Math.max(i, 0);
|
|
75
79
|
const {
|
|
76
|
-
value:
|
|
77
|
-
} =
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
e.preventDefault(), e.stopPropagation(),
|
|
81
|
-
},
|
|
82
|
-
e.preventDefault(), e.stopPropagation(),
|
|
80
|
+
value: M
|
|
81
|
+
} = g;
|
|
82
|
+
M && (M.scrollTop = i);
|
|
83
|
+
}, V = (e) => {
|
|
84
|
+
e.preventDefault(), e.stopPropagation(), T("mousemove", window, _, !0), T("mouseup", window, V, !0), p = !1, w.value = !1, v();
|
|
85
|
+
}, ee = (e) => {
|
|
86
|
+
e.preventDefault(), e.stopPropagation(), X("mousemove", window, _, !0), X("mouseup", window, V, !0), N = H.value, U = e.clientY, p = !0, w.value = !0;
|
|
83
87
|
};
|
|
84
|
-
function
|
|
88
|
+
function ne(e) {
|
|
85
89
|
const {
|
|
86
90
|
onScroll: n
|
|
87
91
|
} = o;
|
|
88
|
-
n && n(e),
|
|
92
|
+
n && n(e), j();
|
|
89
93
|
}
|
|
90
|
-
const
|
|
94
|
+
const te = r(() => {
|
|
91
95
|
const {
|
|
92
96
|
value: e
|
|
93
97
|
} = S, {
|
|
94
98
|
value: n
|
|
95
|
-
} =
|
|
99
|
+
} = f;
|
|
96
100
|
return e !== null && n !== null && n > e;
|
|
97
|
-
}),
|
|
101
|
+
}), B = l(!1), oe = r(() => {
|
|
102
|
+
const {
|
|
103
|
+
trigger: e
|
|
104
|
+
} = o;
|
|
105
|
+
return e === "none" || B.value;
|
|
106
|
+
}), D = r(() => {
|
|
98
107
|
const {
|
|
99
108
|
value: e
|
|
100
109
|
} = S, {
|
|
101
110
|
value: n
|
|
102
|
-
} =
|
|
111
|
+
} = f, {
|
|
103
112
|
value: t
|
|
104
|
-
} =
|
|
113
|
+
} = L;
|
|
105
114
|
return e === null || n === null || t === null ? 0 : t * e / n + 5 * 1.5;
|
|
106
|
-
}),
|
|
115
|
+
}), le = r(() => `${D.value}px`), re = r(() => {
|
|
107
116
|
const {
|
|
108
117
|
value: e
|
|
109
118
|
} = S, {
|
|
110
119
|
value: n
|
|
111
|
-
} =
|
|
120
|
+
} = W, {
|
|
112
121
|
value: t
|
|
113
|
-
} =
|
|
114
|
-
value:
|
|
115
|
-
} =
|
|
116
|
-
if (e === null || t === null ||
|
|
122
|
+
} = f, {
|
|
123
|
+
value: c
|
|
124
|
+
} = L;
|
|
125
|
+
if (e === null || t === null || c === null)
|
|
117
126
|
return 0;
|
|
118
127
|
{
|
|
119
|
-
const
|
|
120
|
-
return
|
|
128
|
+
const a = t - e;
|
|
129
|
+
return a ? n / a * (c - D.value) : 0;
|
|
121
130
|
}
|
|
122
|
-
}),
|
|
123
|
-
let
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
z !== void 0 && window.clearTimeout(z),
|
|
131
|
+
}), ae = r(() => `${re.value}px`);
|
|
132
|
+
let P = !1, I = 0, A = 0;
|
|
133
|
+
const K = (e) => {
|
|
134
|
+
if (!P) return;
|
|
135
|
+
z !== void 0 && window.clearTimeout(z), y !== void 0 && window.clearTimeout(y);
|
|
127
136
|
const {
|
|
128
137
|
value: n
|
|
129
138
|
} = S, {
|
|
130
139
|
value: t
|
|
131
|
-
} =
|
|
132
|
-
value:
|
|
133
|
-
} =
|
|
140
|
+
} = f, {
|
|
141
|
+
value: c
|
|
142
|
+
} = D;
|
|
134
143
|
if (n === null || t === null) return;
|
|
135
|
-
const
|
|
136
|
-
let
|
|
137
|
-
|
|
144
|
+
const C = (e.clientX - A) * (t - n) / (n - c), E = t - n;
|
|
145
|
+
let i = I + C;
|
|
146
|
+
i = Math.min(E, i), i = Math.max(i, 0);
|
|
138
147
|
const {
|
|
139
|
-
value:
|
|
140
|
-
} =
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
e.preventDefault(), e.stopPropagation(),
|
|
148
|
+
value: M
|
|
149
|
+
} = g;
|
|
150
|
+
M && (M.scrollLeft = i);
|
|
151
|
+
}, O = (e) => {
|
|
152
|
+
e.preventDefault(), e.stopPropagation(), T("mousemove", window, K, !0), T("mouseup", window, O, !0), B.value = !1, P = !1, v();
|
|
144
153
|
};
|
|
145
|
-
function
|
|
146
|
-
e.preventDefault(), e.stopPropagation(),
|
|
154
|
+
function ce(e) {
|
|
155
|
+
e.preventDefault(), e.stopPropagation(), P = !0, B.value = !0, X("mousemove", window, K, !0), X("mouseup", window, O, !0), I = W.value, A = e.clientX;
|
|
147
156
|
}
|
|
148
|
-
function
|
|
157
|
+
function j() {
|
|
149
158
|
const {
|
|
150
159
|
value: e
|
|
151
|
-
} =
|
|
152
|
-
e && (
|
|
160
|
+
} = g;
|
|
161
|
+
e && (H.value = e.scrollTop, W.value = e.scrollLeft);
|
|
153
162
|
}
|
|
154
|
-
const
|
|
163
|
+
const ie = () => {
|
|
155
164
|
const {
|
|
156
165
|
value: e
|
|
157
166
|
} = q;
|
|
158
167
|
if (e) {
|
|
159
|
-
const
|
|
160
|
-
|
|
168
|
+
const a = e.getBoundingClientRect();
|
|
169
|
+
d.value = a.height, f.value = a.width;
|
|
161
170
|
}
|
|
162
171
|
const {
|
|
163
172
|
value: n
|
|
164
|
-
} =
|
|
173
|
+
} = g;
|
|
165
174
|
if (n) {
|
|
166
|
-
const
|
|
167
|
-
|
|
175
|
+
const a = n.getBoundingClientRect();
|
|
176
|
+
u.value = a.height, S.value = a.width;
|
|
168
177
|
}
|
|
169
178
|
const {
|
|
170
179
|
value: t
|
|
171
|
-
} =
|
|
172
|
-
t && (
|
|
180
|
+
} = x;
|
|
181
|
+
t && (b.value = t.offsetHeight);
|
|
173
182
|
const {
|
|
174
|
-
value:
|
|
175
|
-
} =
|
|
176
|
-
|
|
183
|
+
value: c
|
|
184
|
+
} = Y;
|
|
185
|
+
c && (L.value = c.offsetWidth);
|
|
177
186
|
};
|
|
178
|
-
function
|
|
179
|
-
|
|
187
|
+
function v() {
|
|
188
|
+
ie(), j();
|
|
180
189
|
}
|
|
181
190
|
return {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
+
showYBarRef: G,
|
|
192
|
+
showXBarRef: oe,
|
|
193
|
+
sync: v,
|
|
194
|
+
handleMouseEnter: () => {
|
|
195
|
+
w.value = !0, B.value = !0;
|
|
196
|
+
},
|
|
197
|
+
handleMouseLeave: () => {
|
|
198
|
+
p || (w.value = !1), P || (B.value = !1);
|
|
199
|
+
},
|
|
200
|
+
// handleContentResize,
|
|
201
|
+
// handleContainerResize,
|
|
202
|
+
contentRef: R,
|
|
203
|
+
yRailRef: x,
|
|
204
|
+
xRailRef: Y,
|
|
205
|
+
containerRef: m,
|
|
206
|
+
contentHeightRef: d,
|
|
207
|
+
containerHeightRef: u,
|
|
191
208
|
needYBarRef: F,
|
|
192
|
-
needXBarRef:
|
|
193
|
-
yBarSizePxRef:
|
|
194
|
-
handleYScrollMouseDown:
|
|
195
|
-
handleXScrollMouseDown:
|
|
196
|
-
yBarTopPxRef:
|
|
197
|
-
handleScroll:
|
|
198
|
-
xBarSizePxRef:
|
|
199
|
-
xBarLeftPxRef:
|
|
209
|
+
needXBarRef: te,
|
|
210
|
+
yBarSizePxRef: J,
|
|
211
|
+
handleYScrollMouseDown: ee,
|
|
212
|
+
handleXScrollMouseDown: ce,
|
|
213
|
+
yBarTopPxRef: Z,
|
|
214
|
+
handleScroll: ne,
|
|
215
|
+
xBarSizePxRef: le,
|
|
216
|
+
xBarLeftPxRef: ae
|
|
200
217
|
};
|
|
201
218
|
},
|
|
202
219
|
render() {
|
|
203
|
-
let o;
|
|
204
220
|
const {
|
|
205
|
-
$slots:
|
|
206
|
-
xScrollable:
|
|
207
|
-
} = this,
|
|
208
|
-
class: `${
|
|
221
|
+
$slots: o,
|
|
222
|
+
xScrollable: R
|
|
223
|
+
} = this, m = () => h("div", {
|
|
224
|
+
class: `${s}-scrollbar-rail ${s}-scrollbar-rail--horizontal`,
|
|
209
225
|
ref: "xRailRef"
|
|
210
|
-
}, [this.needXBarRef &&
|
|
211
|
-
class: `${
|
|
226
|
+
}, [this.needXBarRef && this.showXBarRef && h("div", {
|
|
227
|
+
class: `${s}-scrollbar-rail__scrollbar--horizontal`,
|
|
212
228
|
style: {
|
|
213
229
|
width: this.xBarSizePxRef,
|
|
214
230
|
left: this.xBarLeftPxRef
|
|
215
231
|
},
|
|
216
232
|
onMousedown: this.handleXScrollMouseDown
|
|
217
|
-
}, null, 44, ["onMousedown"])], 512), x = () =>
|
|
218
|
-
class: `${
|
|
233
|
+
}, null, 44, ["onMousedown"])], 512), x = () => h("div", {
|
|
234
|
+
class: `${s}-scrollbar-rail ${s}-scrollbar-rail--vertical`,
|
|
219
235
|
ref: "yRailRef"
|
|
220
|
-
}, [this.needYBarRef &&
|
|
221
|
-
class: `${
|
|
236
|
+
}, [this.needYBarRef && this.showYBarRef && h("div", {
|
|
237
|
+
class: `${s}-scrollbar-rail__scrollbar--vertical`,
|
|
222
238
|
style: {
|
|
223
239
|
height: this.yBarSizePxRef,
|
|
224
240
|
top: this.yBarTopPxRef
|
|
225
241
|
},
|
|
226
242
|
onMousedown: this.handleYScrollMouseDown
|
|
227
|
-
}, null, 44, ["onMousedown"])], 512)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
243
|
+
}, null, 44, ["onMousedown"])], 512);
|
|
244
|
+
return (() => {
|
|
245
|
+
var f, u;
|
|
246
|
+
return h("div", fe({
|
|
247
|
+
class: `${s}-scrollbar`
|
|
248
|
+
}, this.$attrs, {
|
|
249
|
+
onMouseenter: this.handleMouseEnter,
|
|
250
|
+
onMouseleave: this.handleMouseLeave
|
|
251
|
+
}), [this.container ? (f = o.default) == null ? void 0 : f.call(o) : h("div", {
|
|
252
|
+
class: `${s}-scrollbar-container`,
|
|
233
253
|
onScroll: this.handleScroll,
|
|
234
254
|
ref: "containerRef"
|
|
235
|
-
}, [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
return [u("div", {
|
|
241
|
-
ref: "contentRef",
|
|
242
|
-
class: `${f}-scrollbar-content`
|
|
243
|
-
}, [(h = d.default) == null ? void 0 : h.call(d)], 512)];
|
|
244
|
-
}
|
|
245
|
-
}, 8, ["onResize"])], 40, ["onScroll"]), x(), b && p()], 16);
|
|
246
|
-
};
|
|
247
|
-
return this.container ? m() : u(k, {
|
|
248
|
-
onResize: this.handleContainerResize
|
|
249
|
-
}, de(o = m()) ? o : {
|
|
250
|
-
default: () => [o],
|
|
251
|
-
_: 1
|
|
252
|
-
}, 8, ["onResize"]);
|
|
255
|
+
}, [h("div", {
|
|
256
|
+
ref: "contentRef",
|
|
257
|
+
class: `${s}-scrollbar-content`
|
|
258
|
+
}, [(u = o.default) == null ? void 0 : u.call(o)], 512)], 40, ["onScroll"]), x(), R && m()], 16, ["onMouseenter", "onMouseleave"]);
|
|
259
|
+
})();
|
|
253
260
|
}
|
|
254
261
|
});
|
|
255
262
|
export {
|
|
256
|
-
|
|
263
|
+
Me as default
|
|
257
264
|
};
|
|
@@ -5,7 +5,7 @@ function c(t) {
|
|
|
5
5
|
n.component(i + e.name, e);
|
|
6
6
|
}, t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function o(t, n) {
|
|
9
9
|
return {
|
|
10
10
|
install: (e) => {
|
|
11
11
|
e.directive(n, t);
|
|
@@ -13,7 +13,9 @@ function l(t, n) {
|
|
|
13
13
|
directive: t
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
const r = (t) => t;
|
|
16
17
|
export {
|
|
18
|
+
r as definePropType,
|
|
17
19
|
c as withInstall,
|
|
18
|
-
|
|
20
|
+
o as withInstallDirectives
|
|
19
21
|
};
|