@vtable-guild/vtable-guild 2.8.0 → 2.8.1

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 (40) hide show
  1. package/dist/core/src/components/VirtualList/VirtualList.d.ts +3 -3
  2. package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
  3. package/dist/core/src/components/VirtualList/VirtualList.mjs +183 -177
  4. package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts +2 -2
  5. package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts.map +1 -1
  6. package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +12 -12
  7. package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts +1 -1
  8. package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts.map +1 -1
  9. package/dist/core/src/components/VirtualList/hooks/useGetSize.mjs +1 -1
  10. package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts +2 -2
  11. package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
  12. package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +36 -36
  13. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.d.ts.map +1 -1
  14. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.mjs +11 -11
  15. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts +2 -0
  16. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts.map +1 -0
  17. package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts +1 -1
  18. package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts.map +1 -1
  19. package/dist/core/src/components/VirtualList/hooks/useScrollTo.mjs +30 -30
  20. package/dist/index.d.ts +0 -28
  21. package/dist/index.full.mjs +2441 -2428
  22. package/dist/table/src/components/Table.d.ts.map +1 -1
  23. package/dist/table/src/components/Table.mjs +112 -113
  24. package/dist/table/src/components/VTableSummary.d.ts +15 -75
  25. package/dist/table/src/components/VTableSummary.d.ts.map +1 -1
  26. package/dist/table/src/components/VTableSummary.mjs +7 -7
  27. package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
  28. package/dist/table/src/components/VirtualTableBody.mjs +2 -3
  29. package/dist/table/src/composables/useExpand.d.ts.map +1 -1
  30. package/dist/table/src/composables/useExpand.mjs +28 -30
  31. package/dist/table/src/composables/useSelection.d.ts.map +1 -1
  32. package/dist/table/src/composables/useSelection.mjs +136 -126
  33. package/dist/table/src/index.d.ts +8 -87
  34. package/dist/table/src/index.d.ts.map +1 -1
  35. package/dist/table/src/index.mjs +12 -12
  36. package/dist/vtable-guild/src/augment.d.ts +15 -0
  37. package/dist/vtable-guild/src/augment.d.ts.map +1 -0
  38. package/dist/vtable-guild/src/index.d.ts +1 -0
  39. package/dist/vtable-guild/src/index.d.ts.map +1 -1
  40. package/package.json +4 -3
@@ -7,8 +7,8 @@ import { ref } from 'vue';
7
7
  * 于是 `heights.id` 恒为 0,VirtualList 的可视区计算永远走 O(1) 的估算分支,
8
8
  * 不再每次滚动重建整表前缀和。代价是行高必须真的等于声明值(调用方负责校验)。
9
9
  */
10
- export default function useHeights(getKey: (item: any) => Key, onItemAdd?: (item: any) => void, onItemRemove?: (item: any) => void, disabled?: () => boolean): [
11
- setInstanceRef: (item: any, instance: HTMLElement | null) => void,
10
+ export default function useHeights(getKey: (item: any, index?: number) => Key, onItemAdd?: (item: any) => void, onItemRemove?: (item: any) => void, disabled?: () => boolean): [
11
+ setInstanceRef: (item: any, instance: HTMLElement | null, index?: number) => void,
12
12
  collectHeight: (sync?: boolean) => void,
13
13
  heights: CacheMap,
14
14
  updatedMark: ReturnType<typeof ref<number>>
@@ -1 +1 @@
1
- {"version":3,"file":"useHeights.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useHeights.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc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E,MAAM,KAAK,IAAI;IACjF,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI;IACvC,OAAO,EAAE,QAAQ;IACjB,WAAW,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5C,CAoGA"}
@@ -1,61 +1,61 @@
1
1
  import O from "../utils/CacheMap.mjs";
2
- import { ref as v, markRaw as y, onUnmounted as z } from "vue";
3
- function b(e) {
2
+ import { ref as p, markRaw as y, onUnmounted as z } from "vue";
3
+ function R(e) {
4
4
  const s = parseFloat(e);
5
5
  return isNaN(s) ? 0 : s;
6
6
  }
7
- function R(e) {
7
+ function H(e) {
8
8
  return e instanceof HTMLElement ? e : e?.$el instanceof HTMLElement ? e.$el : null;
9
9
  }
10
10
  function B(e) {
11
11
  const s = e.getBoundingClientRect();
12
12
  return Math.abs(s.width - e.offsetWidth) > 1 ? e.offsetHeight : s.height;
13
13
  }
14
- function P(e, s, H, M) {
15
- const h = v(0), c = v(/* @__PURE__ */ new Map()), u = y(new O()), a = v(0), f = /* @__PURE__ */ new Map(), l = () => M?.() === !0, r = !l() && typeof window < "u" && "ResizeObserver" in window ? new window.ResizeObserver(() => {
16
- m();
14
+ function P(e, s, M, E) {
15
+ const w = p(0), a = p(/* @__PURE__ */ new Map()), l = y(new O()), f = p(0), u = /* @__PURE__ */ new Map(), m = () => E?.() === !0, c = !m() && typeof window < "u" && "ResizeObserver" in window ? new window.ResizeObserver(() => {
16
+ d();
17
17
  }) : null;
18
- function p() {
19
- a.value += 1;
18
+ function b() {
19
+ f.value += 1;
20
20
  }
21
- function m(d = !1) {
22
- if (l()) return;
23
- p();
24
- const o = () => {
25
- let t = !1;
26
- c.value.forEach((w, i) => {
27
- const n = R(w);
28
- if (n && n.offsetParent) {
29
- const { marginTop: N, marginBottom: T } = getComputedStyle(n), C = b(N), I = b(T), g = B(n) + C + I;
30
- g > 0 && u.get(i) !== g && (u.set(i, g), t = !0);
21
+ function d(g = !1) {
22
+ if (m()) return;
23
+ b();
24
+ const n = () => {
25
+ let r = !1;
26
+ a.value.forEach((t, v) => {
27
+ const o = H(t);
28
+ if (o && o.offsetParent) {
29
+ const { marginTop: i, marginBottom: T } = getComputedStyle(o), C = R(i), I = R(T), h = B(o) + C + I;
30
+ h > 0 && l.get(v) !== h && (l.set(v, h), r = !0);
31
31
  }
32
- }), t && (h.value += 1);
32
+ }), r && (w.value += 1);
33
33
  };
34
- if (d)
35
- o();
34
+ if (g)
35
+ n();
36
36
  else {
37
- a.value += 1;
38
- const t = a.value;
37
+ f.value += 1;
38
+ const r = f.value;
39
39
  Promise.resolve().then(() => {
40
- t === a.value && o();
40
+ r === f.value && n();
41
41
  });
42
42
  }
43
43
  }
44
- function E(d, o) {
45
- if (l()) return;
46
- const t = e(d);
47
- if (c.value.get(t) === o) return;
48
- const i = f.get(t);
49
- if (i && r && (r.unobserve(i), f.delete(t)), o) {
50
- c.value.set(t, o), m();
51
- const n = R(o);
52
- n && n.nodeType === 1 && r && (r.observe(n), f.set(t, n));
44
+ function N(g, n, r) {
45
+ if (m()) return;
46
+ const t = e(g, r);
47
+ if (a.value.get(t) === n) return;
48
+ const o = u.get(t);
49
+ if (o && c && (c.unobserve(o), u.delete(t)), n) {
50
+ a.value.set(t, n), d();
51
+ const i = H(n);
52
+ i && i.nodeType === 1 && c && (c.observe(i), u.set(t, i));
53
53
  } else
54
- c.value.delete(t);
54
+ a.value.delete(t);
55
55
  }
56
56
  return z(() => {
57
- p(), r?.disconnect?.(), f.clear();
58
- }), [E, m, u, h];
57
+ b(), c?.disconnect?.(), u.clear();
58
+ }), [N, d, l, w];
59
59
  }
60
60
  export {
61
61
  P as default
@@ -1 +1 @@
1
- {"version":3,"file":"useMobileTouchMove.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useMobileTouchMove.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI3C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,EAC/B,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EACrC,QAAQ,EAAE,CACR,YAAY,EAAE,OAAO,EACrB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,CAAC,CAAC,EAAE,UAAU,KACX,OAAO,QA+Fb"}
1
+ {"version":3,"file":"useMobileTouchMove.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useMobileTouchMove.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI3C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,EAC/B,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EACrC,QAAQ,EAAE,CACR,YAAY,EAAE,OAAO,EACrB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,CAAC,CAAC,EAAE,UAAU,KACX,OAAO,QAqGb"}
@@ -1,10 +1,10 @@
1
- import { ref as f, onUnmounted as R, watch as S } from "vue";
1
+ import { ref as f, onUnmounted as S, watch as b } from "vue";
2
2
  const g = 14 / 15;
3
3
  function H(I, X, h) {
4
- const l = f(!1), r = f(0), i = f(0);
5
- let o = null, t = null, s = null;
4
+ const s = f(!1), r = f(0), i = f(0);
5
+ let o = null, t = null, l = null;
6
6
  const d = (e) => {
7
- if (l.value) {
7
+ if (s.value) {
8
8
  const n = Math.ceil(e.touches[0].pageX), E = Math.ceil(e.touches[0].pageY);
9
9
  let u = r.value - n, c = i.value - E;
10
10
  const a = Math.abs(u) > Math.abs(c);
@@ -12,25 +12,25 @@ function H(I, X, h) {
12
12
  const L = h(a, a ? u : c, !1, e);
13
13
  L && e.preventDefault(), t && clearInterval(t), L && (t = setInterval(() => {
14
14
  a ? u *= g : c *= g;
15
- const T = Math.floor(a ? u : c);
16
- (!h(a, T, !0) || Math.abs(T) <= 0.1) && t && clearInterval(t);
15
+ const T = a ? u : c, R = Math.floor(T);
16
+ (!h(a, R, !0) || Math.abs(T) <= 0.1) && t && clearInterval(t);
17
17
  }, 16));
18
18
  }
19
19
  }, v = () => {
20
20
  o && (o.removeEventListener("touchmove", d), o.removeEventListener("touchend", m), o = null);
21
21
  }, m = () => {
22
- l.value = !1, v();
22
+ s.value = !1, v();
23
23
  }, M = (e) => {
24
- v(), e.touches.length === 1 && !l.value && (l.value = !0, r.value = Math.ceil(e.touches[0].pageX), i.value = Math.ceil(e.touches[0].pageY), o = e.target, o.addEventListener("touchmove", d, { passive: !1 }), o.addEventListener("touchend", m, { passive: !0 }));
24
+ v(), e.touches.length === 1 && !s.value && (s.value = !0, r.value = Math.ceil(e.touches[0].pageX), i.value = Math.ceil(e.touches[0].pageY), o = e.target, o.addEventListener("touchmove", d, { passive: !1 }), o.addEventListener("touchend", m, { passive: !0 }));
25
25
  }, Y = () => {
26
- s && (s.removeEventListener("touchstart", M), s = null);
26
+ l && (l.removeEventListener("touchstart", M), l = null);
27
27
  }, p = () => {
28
28
  Y(), v(), t && (clearInterval(t), t = null);
29
29
  };
30
- R(p), S(
30
+ S(p), b(
31
31
  [I, X],
32
32
  ([e, n]) => {
33
- e && n ? (s = n, n.addEventListener("touchstart", M, { passive: !0 })) : p();
33
+ e && n ? (l = n, n.addEventListener("touchstart", M, { passive: !0 })) : p();
34
34
  },
35
35
  { immediate: !0 }
36
36
  );
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useMobileTouchMove.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMobileTouchMove.test.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useMobileTouchMove.test.ts"],"names":[],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import { ComputedRef, Ref } from 'vue';
2
2
  import { default as CacheMap } from '../utils/CacheMap';
3
3
  import { Key } from '../interface';
4
- export default function useScrollTo(containerRef: Ref<HTMLElement | undefined>, data: Ref<any[]>, heights: CacheMap, itemHeight: ComputedRef<number | undefined>, getKey: (item: any) => Key, collectHeight: () => void, syncScrollTop: (top: number) => void, triggerFlash: () => void,
4
+ export default function useScrollTo(containerRef: Ref<HTMLElement | undefined>, data: Ref<any[]>, heights: CacheMap, itemHeight: ComputedRef<number | undefined>, getKey: (item: any, index?: number) => Key, collectHeight: () => void, syncScrollTop: (top: number) => void, triggerFlash: () => void,
5
5
  /** 定高快路径:高度不测量,总高与任意行的位置都可以直接算出来,无需逐行累加。 */
6
6
  fixedHeight?: () => boolean): [scrollTo: (arg?: number | ScrollConfig | null) => void, getTotalHeight: () => number];
7
7
  export interface ScrollConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollTo.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useScrollTo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAIvC,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,YAAY,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EAC1C,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAChB,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,EAC3C,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,EAC1B,aAAa,EAAE,MAAM,IAAI,EACzB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EACpC,YAAY,EAAE,MAAM,IAAI;AACxB,4CAA4C;AAC5C,WAAW,CAAC,EAAE,MAAM,OAAO,GA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IAAI,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC,CA2IxF;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;CACb"}
@@ -1,12 +1,12 @@
1
1
  import { shallowRef as S, watch as j } from "vue";
2
2
  const C = 10;
3
- function L(g, n, T, h, m, y, A, M, B) {
3
+ function L(T, s, d, m, p, y, A, M, B) {
4
4
  const t = S(null), H = () => B?.() === !0, I = () => {
5
- if (H()) return n.value.length * (h.value ?? 0);
5
+ if (H()) return s.value.length * (m.value ?? 0);
6
6
  let e = 0;
7
- for (let l = 0; l < n.value.length; l += 1) {
8
- const a = m(n.value[l]), o = T.get(a);
9
- e += o === void 0 ? h.value ?? 0 : o;
7
+ for (let l = 0; l < s.value.length; l += 1) {
8
+ const a = p(s.value[l], l), o = d.get(a);
9
+ e += o === void 0 ? m.value ?? 0 : o;
10
10
  }
11
11
  return e;
12
12
  };
@@ -14,36 +14,36 @@ function L(g, n, T, h, m, y, A, M, B) {
14
14
  t,
15
15
  () => {
16
16
  if (t.value && t.value.times < C) {
17
- if (!g.value) {
17
+ if (!T.value) {
18
18
  t.value = { ...t.value };
19
19
  return;
20
20
  }
21
21
  y();
22
- const { targetAlign: e, originAlign: l, index: a, offset: o } = t.value, u = g.value.clientHeight;
23
- let d = !1, k = e ?? null, c = null;
22
+ const { targetAlign: e, originAlign: l, index: a, offset: o } = t.value, u = T.value.clientHeight;
23
+ let v = !1, k = e ?? null, c = null;
24
24
  if (u) {
25
25
  const w = e || l;
26
- let f = 0, v = 0;
27
- const b = Math.min(n.value.length - 1, a);
26
+ let f = 0, r = 0;
27
+ const b = Math.min(s.value.length - 1, a);
28
28
  if (H()) {
29
- const i = h.value ?? 0;
30
- f = b * i, v = f + i;
29
+ const n = m.value ?? 0;
30
+ f = b * n, r = f + n;
31
31
  } else {
32
- let i = 0;
33
- for (let s = 0; s <= b; s += 1) {
34
- const x = m(n.value[s]);
35
- f = i;
36
- const r = T.get(x);
37
- v = f + (r === void 0 ? h.value ?? 0 : r), i = v;
32
+ let n = 0;
33
+ for (let i = 0; i <= b; i += 1) {
34
+ const x = p(s.value[i], i);
35
+ f = n;
36
+ const h = d.get(x);
37
+ r = f + (h === void 0 ? m.value ?? 0 : h), n = r;
38
38
  }
39
- let p = w === "top" ? o : u - o;
40
- for (let s = b; s >= 0; s -= 1) {
41
- const x = m(n.value[s]), r = T.get(x);
42
- if (r === void 0) {
43
- d = !0;
39
+ let g = w === "top" ? o : u - o;
40
+ for (let i = b; i >= 0; i -= 1) {
41
+ const x = p(s.value[i], i), h = d.get(x);
42
+ if (h === void 0) {
43
+ v = !0;
44
44
  break;
45
45
  }
46
- if (p -= r, p <= 0) break;
46
+ if (g -= h, g <= 0) break;
47
47
  }
48
48
  }
49
49
  switch (w) {
@@ -51,16 +51,16 @@ function L(g, n, T, h, m, y, A, M, B) {
51
51
  c = f - o;
52
52
  break;
53
53
  case "bottom":
54
- c = v - u + o;
54
+ c = r - u + o;
55
55
  break;
56
56
  default: {
57
- const { scrollTop: i } = g.value, p = i + u;
58
- f < i ? k = "top" : v > p && (k = "bottom");
57
+ const { scrollTop: n } = T.value, g = n + u;
58
+ f < n ? k = "top" : r > g && (k = "bottom");
59
59
  }
60
60
  }
61
- c !== null && A(c), c !== t.value.lastTop && (d = !0);
61
+ c !== null && A(c), c !== t.value.lastTop && (v = !0);
62
62
  }
63
- d && (t.value = {
63
+ v && (t.value = {
64
64
  ...t.value,
65
65
  times: t.value.times + 1,
66
66
  targetAlign: k,
@@ -79,7 +79,7 @@ function L(g, n, T, h, m, y, A, M, B) {
79
79
  else if (e && typeof e == "object") {
80
80
  let l;
81
81
  const { align: a } = e;
82
- "index" in e ? l = e.index : l = n.value.findIndex((u) => m(u) === e.key);
82
+ "index" in e ? l = e.index : l = s.value.findIndex((u, v) => p(u, v) === e.key);
83
83
  const { offset: o = 0 } = e;
84
84
  t.value = {
85
85
  times: 0,
package/dist/index.d.ts CHANGED
@@ -1,30 +1,2 @@
1
1
  export * from './vtable-guild/src/index'
2
2
  export {}
3
-
4
- // Module augmentation for @vtable-guild/core
5
- // This file ensures type hints work correctly when importing from @vtable-guild/vtable-guild
6
-
7
- import type { ThemeOverrideConfig } from '@vtable-guild/core'
8
- import type {
9
- TableThemeConfig,
10
- ButtonThemeConfig,
11
- CheckboxThemeConfig,
12
- RadioThemeConfig,
13
- InputThemeConfig,
14
- TooltipThemeConfig,
15
- ScrollbarThemeConfig,
16
- PaginationThemeConfig,
17
- } from '@vtable-guild/theme'
18
-
19
- declare module '@vtable-guild/core' {
20
- interface VTableGuildThemeOverridesMap {
21
- table: ThemeOverrideConfig<TableThemeConfig>
22
- button: ThemeOverrideConfig<ButtonThemeConfig>
23
- checkbox: ThemeOverrideConfig<CheckboxThemeConfig>
24
- radio: ThemeOverrideConfig<RadioThemeConfig>
25
- input: ThemeOverrideConfig<InputThemeConfig>
26
- tooltip: ThemeOverrideConfig<TooltipThemeConfig>
27
- scrollbar: ThemeOverrideConfig<ScrollbarThemeConfig>
28
- pagination: ThemeOverrideConfig<PaginationThemeConfig>
29
- }
30
- }