@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.
- package/dist/core/src/components/VirtualList/VirtualList.d.ts +3 -3
- package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/VirtualList.mjs +183 -177
- package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts +2 -2
- package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +12 -12
- package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts +1 -1
- package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useGetSize.mjs +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts +2 -2
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +36 -36
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.mjs +11 -11
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts +2 -0
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts.map +1 -0
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts +1 -1
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.mjs +30 -30
- package/dist/index.d.ts +0 -28
- package/dist/index.full.mjs +2441 -2428
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +112 -113
- package/dist/table/src/components/VTableSummary.d.ts +15 -75
- package/dist/table/src/components/VTableSummary.d.ts.map +1 -1
- package/dist/table/src/components/VTableSummary.mjs +7 -7
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +2 -3
- package/dist/table/src/composables/useExpand.d.ts.map +1 -1
- package/dist/table/src/composables/useExpand.mjs +28 -30
- package/dist/table/src/composables/useSelection.d.ts.map +1 -1
- package/dist/table/src/composables/useSelection.mjs +136 -126
- package/dist/table/src/index.d.ts +8 -87
- package/dist/table/src/index.d.ts.map +1 -1
- package/dist/table/src/index.mjs +12 -12
- package/dist/vtable-guild/src/augment.d.ts +15 -0
- package/dist/vtable-guild/src/augment.d.ts.map +1 -0
- package/dist/vtable-guild/src/index.d.ts +1 -0
- package/dist/vtable-guild/src/index.d.ts.map +1 -1
- 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,CAAA;AACvC,OAAO,EAAwB,GAAG,EAAE,MAAM,KAAK,CAAA;AA+B/C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,
|
|
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,CAAA;AACvC,OAAO,EAAwB,GAAG,EAAE,MAAM,KAAK,CAAA;AA+B/C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,EAC1C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAClC,QAAQ,CAAC,EAAE,MAAM,OAAO,GACvB;IACD,cAAc,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,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
|
|
3
|
-
function
|
|
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
|
|
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,
|
|
15
|
-
const
|
|
16
|
-
|
|
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
|
|
19
|
-
|
|
18
|
+
function b() {
|
|
19
|
+
f.value += 1;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const { marginTop:
|
|
30
|
-
|
|
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
|
-
}),
|
|
32
|
+
}), r && (w.value += 1);
|
|
33
33
|
};
|
|
34
|
-
if (
|
|
35
|
-
|
|
34
|
+
if (g)
|
|
35
|
+
n();
|
|
36
36
|
else {
|
|
37
|
-
|
|
38
|
-
const
|
|
37
|
+
f.value += 1;
|
|
38
|
+
const r = f.value;
|
|
39
39
|
Promise.resolve().then(() => {
|
|
40
|
-
|
|
40
|
+
r === f.value && n();
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
46
|
-
const t = e(
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
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
|
-
|
|
54
|
+
a.value.delete(t);
|
|
55
55
|
}
|
|
56
56
|
return z(() => {
|
|
57
|
-
|
|
58
|
-
}), [
|
|
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,
|
|
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
|
|
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
|
|
5
|
-
let o = null, t = 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 (
|
|
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 =
|
|
16
|
-
(!h(a,
|
|
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
|
-
|
|
22
|
+
s.value = !1, v();
|
|
23
23
|
}, M = (e) => {
|
|
24
|
-
v(), e.touches.length === 1 && !
|
|
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
|
-
|
|
26
|
+
l && (l.removeEventListener("touchstart", M), l = null);
|
|
27
27
|
}, p = () => {
|
|
28
28
|
Y(), v(), t && (clearInterval(t), t = null);
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
S(p), b(
|
|
31
31
|
[I, X],
|
|
32
32
|
([e, n]) => {
|
|
33
|
-
e && n ? (
|
|
33
|
+
e && n ? (l = n, n.addEventListener("touchstart", M, { passive: !0 })) : p();
|
|
34
34
|
},
|
|
35
35
|
{ immediate: !0 }
|
|
36
36
|
);
|
|
@@ -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,
|
|
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,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,EAC1C,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,GAC1B,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,KAAK,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(
|
|
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
|
|
5
|
+
if (H()) return s.value.length * (m.value ?? 0);
|
|
6
6
|
let e = 0;
|
|
7
|
-
for (let l = 0; l <
|
|
8
|
-
const a =
|
|
9
|
-
e += o === void 0 ?
|
|
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 (!
|
|
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 =
|
|
23
|
-
let
|
|
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,
|
|
27
|
-
const b = Math.min(
|
|
26
|
+
let f = 0, r = 0;
|
|
27
|
+
const b = Math.min(s.value.length - 1, a);
|
|
28
28
|
if (H()) {
|
|
29
|
-
const
|
|
30
|
-
f = b *
|
|
29
|
+
const n = m.value ?? 0;
|
|
30
|
+
f = b * n, r = f + n;
|
|
31
31
|
} else {
|
|
32
|
-
let
|
|
33
|
-
for (let
|
|
34
|
-
const x =
|
|
35
|
-
f =
|
|
36
|
-
const
|
|
37
|
-
|
|
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
|
|
40
|
-
for (let
|
|
41
|
-
const x =
|
|
42
|
-
if (
|
|
43
|
-
|
|
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 (
|
|
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 =
|
|
54
|
+
c = r - u + o;
|
|
55
55
|
break;
|
|
56
56
|
default: {
|
|
57
|
-
const { scrollTop:
|
|
58
|
-
f <
|
|
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 && (
|
|
61
|
+
c !== null && A(c), c !== t.value.lastTop && (v = !0);
|
|
62
62
|
}
|
|
63
|
-
|
|
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 =
|
|
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
|
-
}
|