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