@pequity/squirrel 8.4.2 → 8.4.3
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.
|
@@ -9,7 +9,7 @@ const usePTableRowVirtualizer = (options) => {
|
|
|
9
9
|
virtualRows: vue.ref([{ key: 0, index: 0 }]),
|
|
10
10
|
paddingTop: vue.ref(0),
|
|
11
11
|
paddingBottom: vue.ref(0),
|
|
12
|
-
measureElement: () =>
|
|
12
|
+
measureElement: () => void 0
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
const virtualizer = vueVirtual.useVirtualizer(options);
|
|
@@ -18,13 +18,16 @@ const usePTableRowVirtualizer = (options) => {
|
|
|
18
18
|
const paddingBottom = vue.computed(
|
|
19
19
|
() => virtualRows.value.length > 0 ? virtualizer?.value.getTotalSize() - virtualRows.value[virtualRows.value.length - 1].end : 0
|
|
20
20
|
);
|
|
21
|
-
const measureElement = (
|
|
22
|
-
|
|
21
|
+
const measureElement = (el) => {
|
|
22
|
+
if (!el) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const element = el instanceof Element ? el : el.$el;
|
|
23
26
|
vue.nextTick(() => {
|
|
24
|
-
if (!
|
|
27
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
25
28
|
return;
|
|
26
29
|
}
|
|
27
|
-
virtualizer.value.measureElement(
|
|
30
|
+
virtualizer.value.measureElement(element);
|
|
28
31
|
});
|
|
29
32
|
return void 0;
|
|
30
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
2
|
-
import { ref, computed,
|
|
2
|
+
import { ref, computed, nextTick } from "vue";
|
|
3
3
|
const usePTableRowVirtualizer = (options) => {
|
|
4
4
|
if (!options.value) {
|
|
5
5
|
return {
|
|
@@ -7,7 +7,7 @@ const usePTableRowVirtualizer = (options) => {
|
|
|
7
7
|
virtualRows: ref([{ key: 0, index: 0 }]),
|
|
8
8
|
paddingTop: ref(0),
|
|
9
9
|
paddingBottom: ref(0),
|
|
10
|
-
measureElement: () =>
|
|
10
|
+
measureElement: () => void 0
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
const virtualizer = useVirtualizer(options);
|
|
@@ -16,13 +16,16 @@ const usePTableRowVirtualizer = (options) => {
|
|
|
16
16
|
const paddingBottom = computed(
|
|
17
17
|
() => virtualRows.value.length > 0 ? virtualizer?.value.getTotalSize() - virtualRows.value[virtualRows.value.length - 1].end : 0
|
|
18
18
|
);
|
|
19
|
-
const measureElement = (
|
|
20
|
-
|
|
19
|
+
const measureElement = (el) => {
|
|
20
|
+
if (!el) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const element = el instanceof Element ? el : el.$el;
|
|
21
24
|
nextTick(() => {
|
|
22
|
-
if (!
|
|
25
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
25
|
-
virtualizer.value.measureElement(
|
|
28
|
+
virtualizer.value.measureElement(element);
|
|
26
29
|
});
|
|
27
30
|
return void 0;
|
|
28
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPublicInstance, type ComputedRef
|
|
1
|
+
import { type ComponentPublicInstance, type ComputedRef } from 'vue';
|
|
2
2
|
type Options = ComputedRef<{
|
|
3
3
|
count: number;
|
|
4
4
|
getScrollElement: () => HTMLElement | null;
|
|
@@ -8,7 +8,7 @@ type Options = ComputedRef<{
|
|
|
8
8
|
}>;
|
|
9
9
|
export declare const usePTableRowVirtualizer: (options: Options) => {
|
|
10
10
|
virtualizer: null;
|
|
11
|
-
virtualRows: Ref<{
|
|
11
|
+
virtualRows: import("vue").Ref<{
|
|
12
12
|
key: number;
|
|
13
13
|
index: number;
|
|
14
14
|
}[], {
|
|
@@ -18,14 +18,14 @@ export declare const usePTableRowVirtualizer: (options: Options) => {
|
|
|
18
18
|
key: number;
|
|
19
19
|
index: number;
|
|
20
20
|
}[]>;
|
|
21
|
-
paddingTop: Ref<number, number>;
|
|
22
|
-
paddingBottom: Ref<number, number>;
|
|
23
|
-
measureElement: () =>
|
|
21
|
+
paddingTop: import("vue").Ref<number, number>;
|
|
22
|
+
paddingBottom: import("vue").Ref<number, number>;
|
|
23
|
+
measureElement: () => undefined;
|
|
24
24
|
} | {
|
|
25
|
-
virtualizer: Ref<import("@tanstack/vue-virtual").Virtualizer<HTMLElement, Element>, import("@tanstack/vue-virtual").Virtualizer<HTMLElement, Element>>;
|
|
25
|
+
virtualizer: import("vue").Ref<import("@tanstack/vue-virtual").Virtualizer<HTMLElement, Element>, import("@tanstack/vue-virtual").Virtualizer<HTMLElement, Element>>;
|
|
26
26
|
virtualRows: ComputedRef<import("@tanstack/vue-virtual").VirtualItem[]>;
|
|
27
27
|
paddingTop: ComputedRef<number>;
|
|
28
28
|
paddingBottom: ComputedRef<number>;
|
|
29
|
-
measureElement: (
|
|
29
|
+
measureElement: (el: Element | ComponentPublicInstance | null) => undefined;
|
|
30
30
|
};
|
|
31
31
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pequity/squirrel",
|
|
3
3
|
"description": "Squirrel component library",
|
|
4
|
-
"version": "8.4.
|
|
4
|
+
"version": "8.4.3",
|
|
5
5
|
"packageManager": "pnpm@10.12.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"vue-currency-input": "3.2.1",
|
|
99
99
|
"vue-router": "4.5.1",
|
|
100
100
|
"vue-toastification": "2.0.0-rc.5",
|
|
101
|
-
"vue-tsc": "3.0.
|
|
101
|
+
"vue-tsc": "3.0.1"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"tailwind-variants": "^1.0.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useVirtualizer } from '@tanstack/vue-virtual';
|
|
2
|
-
import { type ComponentPublicInstance, computed, type ComputedRef,
|
|
2
|
+
import { type ComponentPublicInstance, computed, type ComputedRef, nextTick, ref } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Options = ComputedRef<{
|
|
5
5
|
count: number;
|
|
@@ -16,7 +16,7 @@ export const usePTableRowVirtualizer = (options: Options) => {
|
|
|
16
16
|
virtualRows: ref([{ key: 0, index: 0 }]),
|
|
17
17
|
paddingTop: ref(0),
|
|
18
18
|
paddingBottom: ref(0),
|
|
19
|
-
measureElement: () =>
|
|
19
|
+
measureElement: () => undefined,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -32,15 +32,19 @@ export const usePTableRowVirtualizer = (options: Options) => {
|
|
|
32
32
|
: 0
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
const measureElement = (
|
|
36
|
-
|
|
35
|
+
const measureElement = (el: Element | ComponentPublicInstance | null) => {
|
|
36
|
+
if (!el) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const element = el instanceof Element ? el : el.$el;
|
|
37
41
|
|
|
38
42
|
nextTick(() => {
|
|
39
|
-
if (!
|
|
43
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
40
44
|
return;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
virtualizer.value.measureElement(
|
|
47
|
+
virtualizer.value.measureElement(element);
|
|
44
48
|
});
|
|
45
49
|
|
|
46
50
|
return undefined;
|