virtua 0.53.3 → 0.53.5
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/README.md +37 -32
- package/lib/angular/VGrid.d.ts +1 -1
- package/lib/angular/VList.d.ts +1 -1
- package/lib/angular/VMasonry.d.ts +1 -1
- package/lib/angular/Virtualizer.d.ts +1 -1
- package/lib/angular/WindowVirtualizer.d.ts +1 -1
- package/lib/angular/index.js +588 -586
- package/lib/angular/index.js.map +1 -1
- package/lib/core/index.cjs +415 -412
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.js +426 -423
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +647 -645
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +641 -639
- package/lib/index.js.map +1 -1
- package/lib/react/VGrid.d.ts +1 -1
- package/lib/react/VMasonry.d.ts +1 -1
- package/lib/react/Virtualizer.d.ts +1 -1
- package/lib/react/WindowVirtualizer.d.ts +1 -1
- package/lib/solid/VGrid.d.ts +1 -1
- package/lib/solid/VMasonry.d.ts +1 -1
- package/lib/solid/Virtualizer.d.ts +1 -1
- package/lib/solid/WindowVirtualizer.d.ts +1 -1
- package/lib/solid/index.cjs +674 -671
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +673 -671
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +167 -216
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/GridRow.svelte +3 -1
- package/lib/svelte/GridRowGroup.svelte +3 -1
- package/lib/svelte/VGrid.svelte +18 -21
- package/lib/svelte/VGrid.type.d.ts +1 -1
- package/lib/svelte/VMasonry.svelte +13 -15
- package/lib/svelte/VMasonry.type.d.ts +1 -1
- package/lib/svelte/Virtualizer.svelte +12 -13
- package/lib/svelte/Virtualizer.type.d.ts +1 -1
- package/lib/svelte/WindowVirtualizer.svelte +11 -10
- package/lib/svelte/WindowVirtualizer.type.d.ts +1 -1
- package/lib/vue/VGrid.d.ts +1 -1
- package/lib/vue/VMasonry.d.ts +1 -1
- package/lib/vue/Virtualizer.d.ts +1 -1
- package/lib/vue/WindowVirtualizer.d.ts +1 -1
- package/lib/vue/index.cjs +802 -797
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +773 -768
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/core/observer.d.ts +0 -1
package/lib/angular/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as e from "@angular/core";
|
|
2
2
|
|
|
3
|
-
import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, ElementRef as
|
|
3
|
+
import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, ElementRef as n, HostAttributeToken as r, InjectionToken as o, TemplateRef as l, afterNextRender as a, afterRenderEffect as c, computed as u, contentChild as p, effect as m, inject as d, input as h, output as f, signal as g, untracked as S, viewChild as y } from "@angular/core";
|
|
4
4
|
|
|
5
5
|
import { NgTemplateOutlet as v } from "@angular/common";
|
|
6
6
|
|
|
7
|
-
var z, N = [], {min: w, max: b, abs: $, floor: R} = Math,
|
|
7
|
+
var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, I = (e, t, i) => w(i, b(t, e)), P = e => e.sort((e, t) => e - t), x = setTimeout, q = clearTimeout, F = "function" == typeof queueMicrotask ? queueMicrotask : e => {
|
|
8
8
|
Promise.resolve().then(e);
|
|
9
9
|
}, k = () => {
|
|
10
10
|
let e;
|
|
@@ -12,167 +12,177 @@ var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, P = (e, t, i) => w(i,
|
|
|
12
12
|
e = t;
|
|
13
13
|
}), e ];
|
|
14
14
|
}, O = e => e.ownerDocument, C = e => e.defaultView, T = () => (null == z && (z = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
|
|
15
|
-
z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = (
|
|
15
|
+
z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = (e, t, i, s) => {
|
|
16
|
+
const n = e.t(), r = t.$getItemOffset(n);
|
|
17
|
+
t.$relayout(i, s) && e.$update(6, t.$getItemOffset(n) - r);
|
|
18
|
+
}, V = ({$getRange: e, $findIndex: t, $getItemOffset: i, $getItemSize: s, $setItemSizes: n, $getTotalSize: r, $getLength: o, $setLength: l, $isEstimating: a}, c = 0) => {
|
|
16
19
|
let u = !!c, p = 1, m = 0, d = 0, h = 0, f = 0, g = 0, S = 0, y = 0, v = 0, z = null, N = [ 0, u ? b(c - 1, 0) : -1 ], R = !1;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return 1 !== y && 0 === v ? s + r <= t : s < t && s + r < t + m;
|
|
22
|
-
}, k = e => {
|
|
20
|
+
const I = /* @__PURE__ */ new Set, P = () => h - d, x = () => P() + g + f, q = (e, t) => {
|
|
21
|
+
const n = i(e), r = s(e);
|
|
22
|
+
return 1 !== y && 0 === v ? n + r <= t : n < t && n + r < t + m;
|
|
23
|
+
}, F = e => {
|
|
23
24
|
e && (T() && 0 !== y || z && 1 === v ? g += e : f += e);
|
|
25
|
+
}, k = () => {
|
|
26
|
+
const e = o();
|
|
27
|
+
if (2 === v) return e;
|
|
28
|
+
if (z && 1 === v) return w(z[0], e);
|
|
29
|
+
const i = x();
|
|
30
|
+
let s = t(i);
|
|
31
|
+
for (;s > 0 && !q(s - 1, i); ) s--;
|
|
32
|
+
for (;s < e && q(s, i); ) s++;
|
|
33
|
+
return s;
|
|
24
34
|
};
|
|
25
35
|
return {
|
|
26
36
|
$dispose: () => {
|
|
27
|
-
|
|
37
|
+
I.clear();
|
|
28
38
|
},
|
|
29
39
|
$getStateVersion: () => p,
|
|
30
40
|
$getRange: (t = 200) => {
|
|
31
41
|
if (!R || u) return N;
|
|
32
42
|
let i, s;
|
|
33
43
|
if (S) [i, s] = N; else {
|
|
34
|
-
let
|
|
35
|
-
|
|
44
|
+
let n = b(0, x()), r = n + m;
|
|
45
|
+
a() || (t = b(0, t), 1 !== y && (n -= t), 2 !== y && (r += t)), [i, s] = N = e(b(0, n), b(0, r)),
|
|
36
46
|
z && (i = w(i, z[0]), s = b(s, z[1]));
|
|
37
47
|
}
|
|
38
|
-
return [ b(i, 0), w(s,
|
|
48
|
+
return [ b(i, 0), w(s, o() - 1) ];
|
|
39
49
|
},
|
|
40
|
-
|
|
41
|
-
$getItemOffset:
|
|
42
|
-
$getItemSize: i,
|
|
43
|
-
$getItemsLength: n,
|
|
50
|
+
t: k,
|
|
51
|
+
$getItemOffset: e => i(e) - g,
|
|
44
52
|
$getScrollOffset: () => h,
|
|
45
|
-
$getVisibleOffset: x,
|
|
46
53
|
$isScrolling: () => 0 !== y,
|
|
47
54
|
$getViewportSize: () => m,
|
|
48
55
|
$getStartSpacerSize: () => d,
|
|
49
56
|
$getTotalSize: r,
|
|
50
|
-
|
|
57
|
+
i: () => (S = f, f = 0, [ S, 2 === v ]),
|
|
51
58
|
$subscribe: (e, t) => {
|
|
52
59
|
const i = [ e, t ];
|
|
53
|
-
return
|
|
54
|
-
|
|
60
|
+
return I.add(i), () => {
|
|
61
|
+
I.delete(i);
|
|
55
62
|
};
|
|
56
63
|
},
|
|
57
|
-
$update: (t,
|
|
58
|
-
let
|
|
64
|
+
$update: (t, s, a) => {
|
|
65
|
+
let c, N, w = 0;
|
|
59
66
|
switch (t) {
|
|
60
67
|
case 1:
|
|
61
68
|
{
|
|
62
|
-
if (
|
|
69
|
+
if (s === h && 0 === v) break;
|
|
63
70
|
const e = S;
|
|
64
71
|
S = 0;
|
|
65
|
-
const t =
|
|
66
|
-
e &&
|
|
67
|
-
const n =
|
|
68
|
-
n >= -m && n <= r() && (
|
|
72
|
+
const t = s - h, i = $(t);
|
|
73
|
+
e && i < $(e) + 1 || 0 !== v || (y = t < 0 ? 2 : 1), u && (u = !1), h = s, w = 4;
|
|
74
|
+
const n = P();
|
|
75
|
+
n >= -m && n <= r() && (w += 1, N = i > m);
|
|
69
76
|
break;
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
case 2:
|
|
73
|
-
|
|
80
|
+
w = 8, 0 !== y && (c = !0, w += 1), y = 0, v = 0, z = null;
|
|
74
81
|
break;
|
|
75
82
|
|
|
76
83
|
case 3:
|
|
77
|
-
{
|
|
78
|
-
const e =
|
|
79
|
-
|
|
80
|
-
k(a(e, F, x(), m)), c = 3, l = !0;
|
|
81
|
-
break;
|
|
84
|
+
if (s.length) {
|
|
85
|
+
const e = k(), t = i(e);
|
|
86
|
+
n(s, m), F(i(e) - t), w = 3, N = !0;
|
|
82
87
|
}
|
|
88
|
+
break;
|
|
83
89
|
|
|
84
90
|
case 4:
|
|
85
|
-
m !==
|
|
91
|
+
m !== s && (m || (R = N = !0), m = s, w = 3);
|
|
86
92
|
break;
|
|
87
93
|
|
|
88
94
|
case 5:
|
|
89
|
-
|
|
95
|
+
if (s !== o()) {
|
|
96
|
+
if (a) {
|
|
97
|
+
const e = r();
|
|
98
|
+
l(s, !0), F(r() - e), v = 2;
|
|
99
|
+
} else l(s);
|
|
100
|
+
w = 1;
|
|
101
|
+
}
|
|
90
102
|
break;
|
|
91
103
|
|
|
92
104
|
case 6:
|
|
93
|
-
|
|
105
|
+
F(s), w = 1;
|
|
94
106
|
break;
|
|
95
107
|
|
|
96
108
|
case 7:
|
|
97
|
-
|
|
109
|
+
d = s;
|
|
98
110
|
break;
|
|
99
111
|
|
|
100
|
-
case
|
|
101
|
-
|
|
112
|
+
case 8:
|
|
113
|
+
v = 1;
|
|
102
114
|
break;
|
|
103
115
|
|
|
104
|
-
case
|
|
105
|
-
z = e(
|
|
116
|
+
case 9:
|
|
117
|
+
z = e(s, s + m), w = 1;
|
|
106
118
|
}
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
w && (p = 1 + (2147483647 & p), c && g && (f += g, g = 0), I.forEach(([e, t]) => {
|
|
120
|
+
w & e && t(N);
|
|
109
121
|
}));
|
|
110
122
|
}
|
|
111
123
|
};
|
|
112
|
-
},
|
|
124
|
+
}, E = (e, t, i) => {
|
|
113
125
|
const s = i ? "unshift" : "push";
|
|
114
126
|
for (let i = 0; i < t; i++) e[s](-1);
|
|
115
127
|
return e;
|
|
116
|
-
},
|
|
117
|
-
let
|
|
118
|
-
for (;s <=
|
|
119
|
-
const t = R((s +
|
|
120
|
-
e(t) <= i ? (
|
|
128
|
+
}, K = (e, t, i, s = 0, n = t - 1) => {
|
|
129
|
+
let r = s;
|
|
130
|
+
for (;s <= n; ) {
|
|
131
|
+
const t = R((s + n) / 2);
|
|
132
|
+
e(t) <= i ? (r = t, s = t + 1) : n = t - 1;
|
|
121
133
|
}
|
|
122
|
-
return
|
|
134
|
+
return I(r, 0, t - 1);
|
|
123
135
|
}, L = (e, t, i) => {
|
|
124
|
-
let s = i && i[1] || t || 40,
|
|
125
|
-
const a = i
|
|
126
|
-
|
|
136
|
+
let s = i && i[1] || t || 40, n = -1, r = 0, o = !t, l = 0;
|
|
137
|
+
const a = i ? i[0].slice(0, e) : [];
|
|
138
|
+
E(a, e - a.length);
|
|
139
|
+
const c = E([], e + 1), u = e => {
|
|
140
|
+
const t = a[e];
|
|
127
141
|
return -1 === t ? s : t;
|
|
128
|
-
},
|
|
142
|
+
}, p = t => {
|
|
129
143
|
if (!e) return 0;
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
let i =
|
|
133
|
-
for (;i < t; ) s +=
|
|
134
|
-
return
|
|
144
|
+
if (n >= t) return c[t];
|
|
145
|
+
n < 0 && (c[0] = 0, n = 0);
|
|
146
|
+
let i = n, s = c[i];
|
|
147
|
+
for (;i < t; ) s += u(i), c[++i] = s;
|
|
148
|
+
return n = t, s;
|
|
135
149
|
};
|
|
136
150
|
return {
|
|
137
151
|
$getRange: (t, i) => {
|
|
138
|
-
let s,
|
|
139
|
-
return l = w(l, e - 1),
|
|
140
|
-
|
|
152
|
+
let s, n;
|
|
153
|
+
return l = w(l, e - 1), p(l) <= t ? (n = K(p, e, i, l), s = K(p, e, t, l, n)) : (s = K(p, e, t, void 0, l),
|
|
154
|
+
n = K(p, e, i, s)), l = s, [ s, n ];
|
|
141
155
|
},
|
|
142
|
-
$findIndex: t =>
|
|
143
|
-
$getItemOffset:
|
|
144
|
-
$getItemSize:
|
|
145
|
-
$isSizeEqual: (e, t = -1) =>
|
|
146
|
-
$
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const a = n.length, p = a / 2 | 0, d = a % 2 == 0 ? (n[p - 1] + n[p]) / 2 : n[p], h = s;
|
|
156
|
-
u += ((s = d) - h) * b(i - t, 0), o = !1;
|
|
156
|
+
$findIndex: t => K(p, e, t),
|
|
157
|
+
$getItemOffset: p,
|
|
158
|
+
$getItemSize: u,
|
|
159
|
+
$isSizeEqual: (e, t = -1) => a[e] === t,
|
|
160
|
+
$setItemSizes: (e, t) => {
|
|
161
|
+
for (const [t, i] of e) r += -1 === a[t] ? i : i - u(t), a[t] = i, n = w(t, n);
|
|
162
|
+
if (o && t && r > t) {
|
|
163
|
+
const e = [];
|
|
164
|
+
a.forEach(t => {
|
|
165
|
+
-1 !== t && t && e.push(t);
|
|
166
|
+
}), n = -1, P(e);
|
|
167
|
+
const t = e.length, i = t / 2 | 0;
|
|
168
|
+
s = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], o = !1;
|
|
157
169
|
}
|
|
158
|
-
return u;
|
|
159
170
|
},
|
|
160
|
-
$getTotalSize: () =>
|
|
171
|
+
$getTotalSize: () => p(e),
|
|
161
172
|
$getLength: () => e,
|
|
162
173
|
$setLength: (t, i) => {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
(i ? c.splice(0, -n) : c.splice(n)).reduce((e, t) => e - (-1 === t ? s : t), 0));
|
|
174
|
+
const s = t - e;
|
|
175
|
+
n = i ? -1 : w(t - 1, n), e = t, s > 0 ? (E(c, s), E(a, s, i)) : (c.splice(s), i ? a.splice(0, -s) : a.splice(s));
|
|
166
176
|
},
|
|
167
177
|
$isEstimating: () => o,
|
|
168
|
-
$snapshot: () => [
|
|
178
|
+
$snapshot: () => [ a.slice(), s ]
|
|
169
179
|
};
|
|
170
|
-
},
|
|
171
|
-
let s =
|
|
172
|
-
const
|
|
173
|
-
let o = (
|
|
174
|
-
const d = [], h = [], f = [], g = e =>
|
|
175
|
-
d.length ||
|
|
180
|
+
}, D = e => "number" == typeof e ? e : e.length, G = (e, t) => "number" == typeof e ? t : e[t], W = (e, t, i = 0) => {
|
|
181
|
+
let s = D(e);
|
|
182
|
+
const n = "number" == typeof t, r = "auto" === t;
|
|
183
|
+
let o = (n ? t : 40) + i, l = -1, a = 0, c = r, u = 0, p = 0, m = null;
|
|
184
|
+
const d = [], h = [], f = [], g = e => r || !!f[e], S = () => {
|
|
185
|
+
d.length || E(d, s);
|
|
176
186
|
}, y = e => {
|
|
177
187
|
const t = d[e];
|
|
178
188
|
return -1 === t ? o : t;
|
|
@@ -186,28 +196,25 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
186
196
|
return l = e, i;
|
|
187
197
|
}, z = (e, t) => {
|
|
188
198
|
d[e] = t, l = w(e, l);
|
|
189
|
-
}, N = e => d.length ?
|
|
199
|
+
}, N = e => d.length ? K(v, s, e) : o ? I(R(e / o), 0, s - 1) : 0, $ = () => w(u, s), x = () => b(s - p, $()), q = e => (d.length ? y(e) : o) - i;
|
|
190
200
|
return {
|
|
191
201
|
$getRange: (e, t) => {
|
|
192
|
-
const
|
|
193
|
-
return [ N(o), N(b(o, t - (
|
|
202
|
+
const n = v($()), r = v(s) - v(x()), o = e + (n ? n - i : 0);
|
|
203
|
+
return [ N(o), N(b(o, t - (r ? r - i : 0))) ];
|
|
194
204
|
},
|
|
195
205
|
$findIndex: N,
|
|
196
206
|
$getItemOffset: v,
|
|
197
207
|
$getItemSize: q,
|
|
198
|
-
$
|
|
199
|
-
let n = e.reduce((e, [i, s]) => g(i) && t(i) ? e + (s - q(i)) : e, 0);
|
|
208
|
+
$setItemSizes: (e, t) => {
|
|
200
209
|
for (const [t, s] of e) g(t) && (S(), a += -1 === d[t] ? s : s - q(t), z(t, s + i));
|
|
201
|
-
if (c &&
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
n += ((o = u) - p) * b(t - e, 0), c = !1;
|
|
210
|
+
if (c && t && a > t) {
|
|
211
|
+
const e = [];
|
|
212
|
+
d.forEach(t => {
|
|
213
|
+
-1 !== t && t && e.push(t);
|
|
214
|
+
}), l = -1, P(e);
|
|
215
|
+
const t = e.length, i = t / 2 | 0;
|
|
216
|
+
o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], c = !1;
|
|
209
217
|
}
|
|
210
|
-
return n;
|
|
211
218
|
},
|
|
212
219
|
$isSizeEqual: (e, t = -1) => {
|
|
213
220
|
const s = d.length ? d[e] : -1;
|
|
@@ -217,7 +224,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
217
224
|
$getLength: () => s,
|
|
218
225
|
$setLength: e => {
|
|
219
226
|
const t = e - s;
|
|
220
|
-
|
|
227
|
+
l = w(e - 1, l), s = e, d.length && (t > 0 ? E(d, t) : d.splice(t));
|
|
221
228
|
},
|
|
222
229
|
$isEstimating: () => c,
|
|
223
230
|
$isMeasurable: g,
|
|
@@ -226,234 +233,236 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
226
233
|
},
|
|
227
234
|
$getPinnedStart: $,
|
|
228
235
|
$getTrailStart: x,
|
|
229
|
-
$getSizes: (e, t) => "number" == typeof t ?
|
|
230
|
-
$relayout:
|
|
231
|
-
if (null == e) return;
|
|
236
|
+
$getSizes: (e, t) => "number" == typeof t ? n ? t : null : n || r || "auto" === t ? null : e.map(e => null != e ? e[t] : null),
|
|
237
|
+
$relayout: e => {
|
|
238
|
+
if (null == e) return !1;
|
|
232
239
|
if ("number" == typeof e) {
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const r = N(t) * (s - o);
|
|
236
|
-
return o = s, r;
|
|
240
|
+
const t = e + i;
|
|
241
|
+
return t !== o && (o = t, !0);
|
|
237
242
|
}
|
|
238
|
-
if (e === m && s === f.length) return;
|
|
243
|
+
if (e === m && s === f.length) return !1;
|
|
239
244
|
m = e, f.length = s, S();
|
|
240
|
-
|
|
241
|
-
let
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
f[t] = r;
|
|
245
|
+
let t = !1;
|
|
246
|
+
for (let n = 0; n < s; n++) {
|
|
247
|
+
const s = e[n], r = "number" != typeof s;
|
|
248
|
+
if (!r || !f[n]) {
|
|
249
|
+
f[n] = r;
|
|
246
250
|
const e = r ? -1 : s + i;
|
|
247
|
-
d[
|
|
251
|
+
d[n] !== e && (z(n, e), t = !0);
|
|
248
252
|
}
|
|
249
253
|
}
|
|
250
|
-
return
|
|
254
|
+
return t;
|
|
251
255
|
}
|
|
252
256
|
};
|
|
253
|
-
},
|
|
257
|
+
}, B = /*#__PURE__*/ new WeakMap, H = (e, t, i) => {
|
|
254
258
|
const s = [];
|
|
255
|
-
for (const
|
|
256
|
-
return
|
|
257
|
-
},
|
|
259
|
+
for (const n of e) n >= t && n < i && s.push(n);
|
|
260
|
+
return P(s);
|
|
261
|
+
}, j = (e, t, i) => {
|
|
258
262
|
if (t >= i) return -1;
|
|
259
|
-
let s = 0,
|
|
260
|
-
for (;s <
|
|
261
|
-
const i = s +
|
|
262
|
-
e[i] <= t ? s = i + 1 :
|
|
263
|
+
let s = 0, n = e.length;
|
|
264
|
+
for (;s < n; ) {
|
|
265
|
+
const i = s + n >> 1;
|
|
266
|
+
e[i] <= t ? s = i + 1 : n = i;
|
|
263
267
|
}
|
|
264
268
|
return s - 1;
|
|
265
|
-
},
|
|
266
|
-
const
|
|
267
|
-
for (;i <
|
|
269
|
+
}, A = (e, t, i, s, n) => {
|
|
270
|
+
const r = t.length;
|
|
271
|
+
for (;i < r && t[i] < s; i++) {
|
|
268
272
|
const s = t[i];
|
|
269
|
-
s >
|
|
273
|
+
s > n && (e.push(s), n = s);
|
|
270
274
|
}
|
|
271
275
|
return i;
|
|
272
|
-
},
|
|
276
|
+
}, Q = (e, t, i, s, n, r) => {
|
|
273
277
|
const o = [];
|
|
274
278
|
for (let e = 0; e < i; e++) o.push(e);
|
|
275
|
-
const l =
|
|
276
|
-
for (let e = s; e <=
|
|
277
|
-
|
|
278
|
-
for (let e =
|
|
279
|
+
const l = A(o, e, 0, s, i - 1);
|
|
280
|
+
for (let e = s; e <= n; e++) o.push(e);
|
|
281
|
+
A(o, e, l, r, n);
|
|
282
|
+
for (let e = r; e < t; e++) o.push(e);
|
|
279
283
|
return o;
|
|
280
|
-
},
|
|
284
|
+
}, J = (e, t) => w(e.rowIndex + (e.rowSpan || 1), t), X = (e, t) => w(e.colIndex + (e.colSpan || 1), t), Y = (e, t, i, s, n, r) => {
|
|
281
285
|
const o = t.length, l = s.length;
|
|
282
286
|
let a = "[l0]", c = 0, u = 0, p = 0;
|
|
283
|
-
for (;c <
|
|
287
|
+
for (;c < r; ) {
|
|
284
288
|
for (;p < l && s[p] <= c; ) p++;
|
|
285
|
-
const m = u < o ? t[u] :
|
|
289
|
+
const m = u < o ? t[u] : r;
|
|
286
290
|
let d, h;
|
|
287
291
|
if (m === c) {
|
|
288
292
|
d = c + 1;
|
|
289
293
|
const t = i[u];
|
|
290
|
-
h = null == t ? e.$getItemSize(c) + "px" : t ?
|
|
294
|
+
h = null == t ? e.$getItemSize(c) + "px" : t ? n : "minmax(" + e.$getItemSize(c) + "px,auto)",
|
|
291
295
|
u++;
|
|
292
|
-
} else d = w(m, p < l ? s[p] :
|
|
296
|
+
} else d = w(m, p < l ? s[p] : r), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
|
|
293
297
|
a += " " + h + " [l" + d + "]", c = d;
|
|
294
298
|
}
|
|
295
299
|
return a;
|
|
296
|
-
},
|
|
297
|
-
const
|
|
300
|
+
}, U = (e, t, i, s, n) => {
|
|
301
|
+
const r = {
|
|
298
302
|
display: "grid",
|
|
299
303
|
gridTemplateRows: "subgrid",
|
|
300
304
|
gridTemplateColumns: "subgrid",
|
|
301
305
|
gridColumn: "1/-1",
|
|
302
306
|
gridRow: "l" + e + "/l" + t
|
|
303
307
|
};
|
|
304
|
-
return null != i && (
|
|
305
|
-
},
|
|
308
|
+
return null != i && (r.position = "sticky", r[s] = i + "px", r.zIndex = n), r;
|
|
309
|
+
}, Z = e => {
|
|
306
310
|
let t;
|
|
307
311
|
return {
|
|
308
|
-
|
|
312
|
+
o(i) {
|
|
309
313
|
(t || (t = new (C(O(i)).ResizeObserver)(e))).observe(i);
|
|
310
314
|
},
|
|
311
|
-
|
|
315
|
+
l(e) {
|
|
312
316
|
t.unobserve(e);
|
|
313
317
|
},
|
|
314
|
-
|
|
318
|
+
u() {
|
|
315
319
|
t && t.disconnect();
|
|
316
320
|
}
|
|
317
321
|
};
|
|
318
|
-
},
|
|
319
|
-
let
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
[
|
|
322
|
+
}, ee = (e, t, i, s, n, r, o, l) => {
|
|
323
|
+
let a, c, u = 0, p = !1, m = !1, d = !1, h = !1;
|
|
324
|
+
const f = Date.now, g = n ? "scrollLeft" : "scrollTop", S = n ? "left" : "top", y = e => r ? -e : e, v = () => y(s[g]), z = (e, t) => {
|
|
325
|
+
s.scrollTo({
|
|
326
|
+
[S]: y(e),
|
|
323
327
|
behavior: t ? "smooth" : "instant"
|
|
324
328
|
});
|
|
325
|
-
}, z = () => {
|
|
326
|
-
if (u || p) return u = !1, void N();
|
|
327
|
-
m = !1, e.$update(2);
|
|
328
329
|
}, N = () => {
|
|
329
|
-
|
|
330
|
+
if (p || m) return p = !1, void w();
|
|
331
|
+
d = !1, e.$update(2);
|
|
330
332
|
}, w = () => {
|
|
331
|
-
c
|
|
332
|
-
}, b =
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
q(c), c = x(N, 150);
|
|
334
|
+
}, b = () => {
|
|
335
|
+
u = f(), d && (h = !0), l && e.$update(7, l()), e.$update(1, v()), w();
|
|
336
|
+
}, $ = t => {
|
|
337
|
+
if (p || !e.$isScrolling() || t.ctrlKey) return;
|
|
338
|
+
const i = f() - u;
|
|
339
|
+
150 > i && 50 < i && (n ? t.deltaX : t.deltaY) && (p = !0);
|
|
338
340
|
}, R = () => {
|
|
339
|
-
|
|
341
|
+
m = !0, d = h = !1;
|
|
342
|
+
}, I = () => {
|
|
343
|
+
m = !1, T() && (d = !0);
|
|
340
344
|
};
|
|
341
|
-
return
|
|
345
|
+
return i.addEventListener("scroll", b), i.addEventListener("wheel", $, {
|
|
346
|
+
passive: !0
|
|
347
|
+
}), i.addEventListener("touchstart", R, {
|
|
342
348
|
passive: !0
|
|
343
|
-
}),
|
|
349
|
+
}), i.addEventListener("touchend", I, {
|
|
344
350
|
passive: !0
|
|
345
|
-
}),
|
|
351
|
+
}), i.addEventListener("touchcancel", I, {
|
|
346
352
|
passive: !0
|
|
347
353
|
}), {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
354
|
+
p: b,
|
|
355
|
+
u: () => {
|
|
356
|
+
i.removeEventListener("scroll", b), i.removeEventListener("wheel", $), i.removeEventListener("touchstart", R),
|
|
357
|
+
i.removeEventListener("touchend", I), i.removeEventListener("touchcancel", I), q(c);
|
|
352
358
|
},
|
|
353
|
-
|
|
354
|
-
const [t,
|
|
359
|
+
m: () => {
|
|
360
|
+
const [t, i] = e.i();
|
|
355
361
|
if (!t) return;
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
[
|
|
362
|
+
h && o && o(), h = !1;
|
|
363
|
+
const n = e.$getScrollOffset(), r = n + t, l = e.$getStartSpacerSize() + e.$getTotalSize() - e.$getViewportSize();
|
|
364
|
+
r <= 0 || r >= l || n >= l ? z(r) : s.scrollBy({
|
|
365
|
+
[S]: y(t),
|
|
360
366
|
behavior: "instant"
|
|
361
|
-
}),
|
|
367
|
+
}), i && (a && a(), e.$getViewportSize() > e.$getTotalSize() && e.$update(1, v()));
|
|
362
368
|
},
|
|
363
|
-
|
|
364
|
-
let
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
if (!
|
|
370
|
-
if (e.$getViewportSize() && (q(r), r = x(
|
|
371
|
-
for (let [
|
|
372
|
-
|
|
369
|
+
h: (i, s) => {
|
|
370
|
+
let n, r, o;
|
|
371
|
+
a && a();
|
|
372
|
+
const l = a = () => {
|
|
373
|
+
n = !0, q(r), o && o();
|
|
374
|
+
}, c = () => {
|
|
375
|
+
if (!n) {
|
|
376
|
+
if (e.$getViewportSize() && (q(r), r = x(l, 150)), s) {
|
|
377
|
+
for (let [i, s] = e.$getRange(0); i <= s; i++) if (t.$isSizeEqual(i)) return;
|
|
378
|
+
l();
|
|
373
379
|
}
|
|
374
|
-
e.$update(
|
|
380
|
+
e.$update(8), z(i(), s);
|
|
375
381
|
}
|
|
376
382
|
};
|
|
377
|
-
|
|
378
|
-
if (
|
|
383
|
+
s && e.$update(9, i()), (() => {
|
|
384
|
+
if (n) return;
|
|
379
385
|
let t;
|
|
380
|
-
|
|
386
|
+
o = e.$subscribe(2, () => {
|
|
381
387
|
t || (t = !0, F(() => {
|
|
382
|
-
t = !1,
|
|
388
|
+
t = !1, c();
|
|
383
389
|
}));
|
|
384
|
-
}),
|
|
390
|
+
}), c();
|
|
385
391
|
})();
|
|
386
392
|
}
|
|
387
393
|
};
|
|
388
|
-
},
|
|
389
|
-
let
|
|
390
|
-
const
|
|
391
|
-
const
|
|
392
|
-
for (const {target:
|
|
393
|
-
|
|
394
|
-
const e =
|
|
395
|
-
null != e
|
|
394
|
+
}, te = (e, t, i) => {
|
|
395
|
+
let s, n, r = k(), o = !0;
|
|
396
|
+
const l = /* @__PURE__ */ new WeakMap, a = Z(r => {
|
|
397
|
+
const a = [];
|
|
398
|
+
for (const {target: c, contentRect: {width: u, height: p}} of r) if (c === s) u || p ? (o || n.p(),
|
|
399
|
+
o = !0, e.$update(4, i ? u : p)) : o = !1; else if (c.offsetParent) {
|
|
400
|
+
const e = l.get(c);
|
|
401
|
+
if (null != e) {
|
|
402
|
+
const s = i ? u : p;
|
|
403
|
+
t.$isSizeEqual(e, s) || a.push([ e, s ]);
|
|
404
|
+
}
|
|
396
405
|
}
|
|
397
|
-
|
|
406
|
+
e.$update(3, a);
|
|
398
407
|
});
|
|
399
408
|
return {
|
|
400
|
-
$observe(
|
|
401
|
-
|
|
402
|
-
const e =
|
|
403
|
-
|
|
404
|
-
|
|
409
|
+
$observe(o, l = o.parentElement) {
|
|
410
|
+
a.o(s = l), n = ee(e, t, l, l, i, i && "rtl" === getComputedStyle(l).direction, () => {
|
|
411
|
+
const e = i ? "overflowX" : "overflowY", t = l.style, s = t[e];
|
|
412
|
+
t[e] = "hidden", x(() => {
|
|
413
|
+
t[e] = s;
|
|
405
414
|
});
|
|
406
415
|
}), r[1](!0);
|
|
407
416
|
},
|
|
408
417
|
$dispose() {
|
|
409
|
-
|
|
418
|
+
a.u(), n && n.u(), r[1](!1), r = k();
|
|
410
419
|
},
|
|
411
|
-
$observeItem: (e, t) => (
|
|
412
|
-
|
|
420
|
+
$observeItem: (e, t) => (l.set(e, t), a.o(e), () => {
|
|
421
|
+
l.delete(e), a.l(e);
|
|
413
422
|
}),
|
|
414
423
|
async $scroll(e, t) {
|
|
415
|
-
await r[0] &&
|
|
424
|
+
await r[0] && n.h(e, t);
|
|
416
425
|
},
|
|
417
426
|
$effect() {
|
|
418
|
-
|
|
427
|
+
n && n.m();
|
|
419
428
|
},
|
|
420
429
|
$getBaseOffset: e.$getStartSpacerSize
|
|
421
430
|
};
|
|
422
|
-
},
|
|
431
|
+
}, ie = (e, t) => {
|
|
423
432
|
e.$scroll(() => t);
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
},
|
|
427
|
-
if (
|
|
428
|
-
const e = t.$getItemOffset(
|
|
429
|
-
if (e < r)
|
|
430
|
-
if (!(e +
|
|
431
|
-
|
|
433
|
+
}, se = (e, t, i) => {
|
|
434
|
+
ie(e, i + t.$getScrollOffset());
|
|
435
|
+
}, ne = (e, t, i, s, {align: n, smooth: r, offset: o = 0} = {}) => {
|
|
436
|
+
if (s = I(s, 0, i.$getLength() - 1), "nearest" === n) {
|
|
437
|
+
const e = t.$getItemOffset(s), r = t.$getScrollOffset();
|
|
438
|
+
if (e < r) n = "start"; else {
|
|
439
|
+
if (!(e + i.$getItemSize(s) > r + t.$getViewportSize())) return;
|
|
440
|
+
n = "end";
|
|
432
441
|
}
|
|
433
442
|
}
|
|
434
|
-
e.$scroll(() =>
|
|
435
|
-
}, re = (e, t, i, s,
|
|
436
|
-
const l =
|
|
437
|
-
|
|
438
|
-
const u =
|
|
439
|
-
if ("nearest" ===
|
|
440
|
-
if (
|
|
441
|
-
const e = d(),
|
|
442
|
-
let
|
|
443
|
-
if (m ===
|
|
443
|
+
e.$scroll(() => o + e.$getBaseOffset() + t.$getItemOffset(s) + ("end" === n ? i.$getItemSize(s) - t.$getViewportSize() : "center" === n ? (i.$getItemSize(s) - t.$getViewportSize()) / 2 : 0), r);
|
|
444
|
+
}, re = (e, t, i, s, n, r, o) => {
|
|
445
|
+
const l = i.$getLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
|
|
446
|
+
n = I(n, 0, l - 1);
|
|
447
|
+
const u = H(s, a, c), p = j(u, n, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === n ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
|
|
448
|
+
if ("nearest" === r) {
|
|
449
|
+
if (n < a || n >= c) return;
|
|
450
|
+
const e = d(), s = t.$getScrollOffset() + e, o = t.$getViewportSize() - e - h(), l = i.$getItemSize(n);
|
|
451
|
+
let f = t.$getItemOffset(n);
|
|
452
|
+
if (m === n) {
|
|
444
453
|
const e = (p + 1 < u.length ? u[p + 1] : c) - 1;
|
|
445
|
-
|
|
454
|
+
f = b(f, w(s, t.$getItemOffset(e) + i.$getItemSize(e) - l));
|
|
446
455
|
}
|
|
447
|
-
if (
|
|
448
|
-
if (!(
|
|
449
|
-
|
|
456
|
+
if (f < s) r = "start"; else {
|
|
457
|
+
if (!(f + l > s + o)) return;
|
|
458
|
+
r = "end";
|
|
450
459
|
}
|
|
451
460
|
}
|
|
452
461
|
e.$scroll(o, () => {
|
|
453
|
-
const e = d(),
|
|
454
|
-
return t.$getItemOffset(
|
|
462
|
+
const e = d(), s = i.$getItemSize(n) - (t.$getViewportSize() - e - h());
|
|
463
|
+
return t.$getItemOffset(n) - e + ("end" === r ? s : "center" === r ? s / 2 : 0);
|
|
455
464
|
});
|
|
456
|
-
},
|
|
465
|
+
}, oe = class t {
|
|
457
466
|
index=h.required();
|
|
458
467
|
offset=h.required();
|
|
459
468
|
hide=h.required();
|
|
@@ -474,7 +483,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
474
483
|
return e && (s.display = "inline-flex"), s;
|
|
475
484
|
});
|
|
476
485
|
constructor() {
|
|
477
|
-
const e = d(
|
|
486
|
+
const e = d(n).nativeElement;
|
|
478
487
|
let t;
|
|
479
488
|
c({
|
|
480
489
|
read: () => {
|
|
@@ -565,9 +574,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
565
574
|
},
|
|
566
575
|
ngImport: e
|
|
567
576
|
});
|
|
568
|
-
},
|
|
577
|
+
}, le = (e, t) => "_" + t, ae = /*#__PURE__*/ new o("virtua-item-template"), ce = class i {
|
|
569
578
|
data=h.required();
|
|
570
|
-
getKey=h(
|
|
579
|
+
getKey=h(le);
|
|
571
580
|
itemProps=h();
|
|
572
581
|
bufferSize=h();
|
|
573
582
|
scrollRef=h();
|
|
@@ -584,48 +593,48 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
584
593
|
scrollEnded=f();
|
|
585
594
|
resized=f();
|
|
586
595
|
contentTemplate=p(l);
|
|
587
|
-
|
|
596
|
+
S=d(ae, {
|
|
588
597
|
optional: !0
|
|
589
598
|
});
|
|
590
|
-
template=u(() => this.
|
|
591
|
-
S;
|
|
599
|
+
template=u(() => this.S?.() ?? this.contentTemplate());
|
|
592
600
|
v;
|
|
601
|
+
N;
|
|
593
602
|
driver;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
603
|
+
$=d(n).nativeElement;
|
|
604
|
+
R=d(t);
|
|
605
|
+
I=g(void 0);
|
|
597
606
|
isSSR=g(!1);
|
|
598
607
|
P=u(() => {
|
|
599
|
-
this.
|
|
600
|
-
const e = this.data().length, [t, i] = this.
|
|
608
|
+
this.I();
|
|
609
|
+
const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
|
|
601
610
|
if (s) {
|
|
602
|
-
const
|
|
603
|
-
for (let e = t; e <= i; e++)
|
|
604
|
-
for (const t of
|
|
605
|
-
} else for (let e = t; e <= i; e++)
|
|
606
|
-
return
|
|
611
|
+
const r = new Set(s);
|
|
612
|
+
for (let e = t; e <= i; e++) r.add(e);
|
|
613
|
+
for (const t of P([ ...r ])) t < e && n.push(t);
|
|
614
|
+
} else for (let e = t; e <= i; e++) n.push(e);
|
|
615
|
+
return n;
|
|
607
616
|
});
|
|
608
617
|
items=u(() => {
|
|
609
|
-
this.
|
|
610
|
-
const e = this.
|
|
611
|
-
return this.P().map(
|
|
612
|
-
const
|
|
618
|
+
this.I();
|
|
619
|
+
const e = this.v, t = this.data(), i = this.getKey(), s = this.itemProps();
|
|
620
|
+
return this.P().map(n => {
|
|
621
|
+
const r = t[n];
|
|
613
622
|
return {
|
|
614
|
-
key: i(
|
|
615
|
-
index:
|
|
616
|
-
data:
|
|
617
|
-
offset: e.$getItemOffset(
|
|
618
|
-
hide:
|
|
623
|
+
key: i(r, n),
|
|
624
|
+
index: n,
|
|
625
|
+
data: r,
|
|
626
|
+
offset: e.$getItemOffset(n),
|
|
627
|
+
hide: this.N.$isSizeEqual(n),
|
|
619
628
|
attrs: s?.({
|
|
620
|
-
item:
|
|
621
|
-
index:
|
|
629
|
+
item: r,
|
|
630
|
+
index: n
|
|
622
631
|
})
|
|
623
632
|
};
|
|
624
633
|
});
|
|
625
634
|
});
|
|
626
635
|
containerStyle=u(() => {
|
|
627
|
-
this.
|
|
628
|
-
const e = this.horizontal(), t = this.
|
|
636
|
+
this.I();
|
|
637
|
+
const e = this.horizontal(), t = this.v.$getTotalSize();
|
|
629
638
|
return {
|
|
630
639
|
display: "block",
|
|
631
640
|
contain: "size style",
|
|
@@ -634,71 +643,71 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
634
643
|
position: "relative",
|
|
635
644
|
width: e ? t + "px" : "100%",
|
|
636
645
|
height: e ? "100%" : t + "px",
|
|
637
|
-
"pointer-events": this.
|
|
646
|
+
"pointer-events": this.v.$isScrolling() ? "none" : void 0
|
|
638
647
|
};
|
|
639
648
|
});
|
|
640
649
|
constructor() {
|
|
641
650
|
m(() => {
|
|
642
651
|
const e = this.data().length;
|
|
643
|
-
this.
|
|
652
|
+
this.v && this.v.$update(5, e, S(this.shift));
|
|
644
653
|
}), m(() => {
|
|
645
654
|
const e = this.startMargin();
|
|
646
|
-
this.
|
|
655
|
+
this.v && this.v.$update(7, e);
|
|
647
656
|
}), a({
|
|
648
657
|
read: () => {
|
|
649
|
-
this.isSSR.set(!1), this.driver.$observe(this
|
|
658
|
+
this.isSSR.set(!1), this.driver.$observe(this.$, this.scrollRef());
|
|
650
659
|
}
|
|
651
660
|
}), c({
|
|
652
661
|
read: () => {
|
|
653
|
-
this.
|
|
662
|
+
this.I(), this.driver.$effect();
|
|
654
663
|
}
|
|
655
664
|
}), d(s).onDestroy(() => {
|
|
656
|
-
this.
|
|
665
|
+
this.v?.$dispose(), this.driver?.$dispose();
|
|
657
666
|
});
|
|
658
667
|
}
|
|
659
668
|
ngOnInit() {
|
|
660
669
|
const e = this.itemSize(), t = this.ssrCount();
|
|
661
670
|
this.isSSR.set(!!t);
|
|
662
|
-
const i = this.
|
|
663
|
-
this.driver =
|
|
664
|
-
this.
|
|
671
|
+
const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
|
|
672
|
+
this.driver = te(s, i, this.horizontal()), s.$subscribe(1, e => {
|
|
673
|
+
this.I.set(s.$getStateVersion()), e && this.R.tick();
|
|
665
674
|
}), s.$subscribe(4, () => {
|
|
666
675
|
this.scrolled.emit(s.$getScrollOffset());
|
|
667
676
|
}), s.$subscribe(8, () => {
|
|
668
677
|
this.scrollEnded.emit();
|
|
669
678
|
}), s.$subscribe(2, () => {
|
|
670
679
|
this.resized.emit();
|
|
671
|
-
}), this.
|
|
680
|
+
}), this.I.set(s.$getStateVersion());
|
|
672
681
|
}
|
|
673
682
|
get cache() {
|
|
674
|
-
return this.
|
|
683
|
+
return this.N.$snapshot();
|
|
675
684
|
}
|
|
676
685
|
get scrollOffset() {
|
|
677
|
-
return this.
|
|
686
|
+
return this.v.$getScrollOffset();
|
|
678
687
|
}
|
|
679
688
|
get scrollSize() {
|
|
680
|
-
return M(this.
|
|
689
|
+
return M(this.v);
|
|
681
690
|
}
|
|
682
691
|
get viewportSize() {
|
|
683
|
-
return this.
|
|
692
|
+
return this.v.$getViewportSize();
|
|
684
693
|
}
|
|
685
694
|
findItemIndex(e) {
|
|
686
|
-
return this.
|
|
695
|
+
return this.N.$findIndex(e - this.v.$getStartSpacerSize());
|
|
687
696
|
}
|
|
688
697
|
getItemOffset(e) {
|
|
689
|
-
return this.
|
|
698
|
+
return this.v.$getItemOffset(e);
|
|
690
699
|
}
|
|
691
700
|
getItemSize(e) {
|
|
692
|
-
return this.
|
|
701
|
+
return this.N.$getItemSize(e);
|
|
693
702
|
}
|
|
694
703
|
scrollToIndex(e, t) {
|
|
695
|
-
|
|
704
|
+
ne(this.driver, this.v, this.N, e, t);
|
|
696
705
|
}
|
|
697
706
|
scrollTo(e) {
|
|
698
|
-
|
|
707
|
+
ie(this.driver, e);
|
|
699
708
|
}
|
|
700
709
|
scrollBy(e) {
|
|
701
|
-
|
|
710
|
+
se(this.driver, this.v, e);
|
|
702
711
|
}
|
|
703
712
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
704
713
|
minVersion: "12.0.0",
|
|
@@ -823,7 +832,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
823
832
|
isInline: !0,
|
|
824
833
|
dependencies: [ {
|
|
825
834
|
kind: "directive",
|
|
826
|
-
type: e.forwardRef(() =>
|
|
835
|
+
type: e.forwardRef(() => oe),
|
|
827
836
|
selector: "div[virtuaListItem]",
|
|
828
837
|
inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
|
|
829
838
|
}, {
|
|
@@ -838,9 +847,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
838
847
|
|
|
839
848
|
i.OnPush;
|
|
840
849
|
|
|
841
|
-
var
|
|
850
|
+
var ue = class t {
|
|
842
851
|
data=h.required();
|
|
843
|
-
getKey=h(
|
|
852
|
+
getKey=h(le);
|
|
844
853
|
itemProps=h();
|
|
845
854
|
bufferSize=h();
|
|
846
855
|
itemSize=h();
|
|
@@ -855,10 +864,10 @@ var ce = class t {
|
|
|
855
864
|
scrollEnded=f();
|
|
856
865
|
resized=f();
|
|
857
866
|
template=p.required(l);
|
|
858
|
-
virtualizer=y.required(
|
|
859
|
-
|
|
867
|
+
virtualizer=y.required(ce);
|
|
868
|
+
$=d(n).nativeElement;
|
|
860
869
|
ngOnInit() {
|
|
861
|
-
const e = this.horizontal(), t = this
|
|
870
|
+
const e = this.horizontal(), t = this.$;
|
|
862
871
|
t.setAttribute("style", `display:block;${e ? "overflow-x" : "overflow-y"}:auto;contain:strict;width:100%;height:100%;` + (t.getAttribute("style") || ""));
|
|
863
872
|
}
|
|
864
873
|
get cache() {
|
|
@@ -993,7 +1002,7 @@ var ce = class t {
|
|
|
993
1002
|
viewQueries: [ {
|
|
994
1003
|
propertyName: "virtualizer",
|
|
995
1004
|
first: !0,
|
|
996
|
-
predicate:
|
|
1005
|
+
predicate: ce,
|
|
997
1006
|
emitDistinctChangesOnly: !1,
|
|
998
1007
|
descendants: !0,
|
|
999
1008
|
isSignal: !0
|
|
@@ -1003,13 +1012,13 @@ var ce = class t {
|
|
|
1003
1012
|
isInline: !0,
|
|
1004
1013
|
dependencies: [ {
|
|
1005
1014
|
kind: "directive",
|
|
1006
|
-
type: e.forwardRef(() =>
|
|
1015
|
+
type: e.forwardRef(() => ce),
|
|
1007
1016
|
selector: "virtua-virtualizer",
|
|
1008
1017
|
inputs: [ "data", "getKey", "itemProps", "bufferSize", "scrollRef", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "startMargin" ],
|
|
1009
1018
|
outputs: [ "scrolled", "scrollEnded", "resized" ]
|
|
1010
1019
|
} ],
|
|
1011
1020
|
viewProviders: [ {
|
|
1012
|
-
provide:
|
|
1021
|
+
provide: ae,
|
|
1013
1022
|
useFactory: () => d(t).template
|
|
1014
1023
|
} ],
|
|
1015
1024
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
@@ -1018,9 +1027,9 @@ var ce = class t {
|
|
|
1018
1027
|
|
|
1019
1028
|
i.OnPush;
|
|
1020
1029
|
|
|
1021
|
-
var
|
|
1030
|
+
var pe = class i {
|
|
1022
1031
|
data=h.required();
|
|
1023
|
-
getKey=h(
|
|
1032
|
+
getKey=h(le);
|
|
1024
1033
|
bufferSize=h();
|
|
1025
1034
|
itemSize=h();
|
|
1026
1035
|
ssrCount=h();
|
|
@@ -1033,31 +1042,31 @@ var ue = class i {
|
|
|
1033
1042
|
scrollEnded=f();
|
|
1034
1043
|
resized=f();
|
|
1035
1044
|
template=p.required(l);
|
|
1036
|
-
S;
|
|
1037
1045
|
v;
|
|
1046
|
+
N;
|
|
1038
1047
|
driver;
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1048
|
+
$=d(n).nativeElement;
|
|
1049
|
+
R=d(t);
|
|
1050
|
+
I=g(void 0);
|
|
1042
1051
|
isSSR=g(!1);
|
|
1043
1052
|
items=u(() => {
|
|
1044
|
-
this.
|
|
1045
|
-
const e = this.
|
|
1046
|
-
for (let o = s; o <=
|
|
1053
|
+
this.I();
|
|
1054
|
+
const e = this.v, t = this.data(), i = this.getKey(), [s, n] = e.$getRange(this.bufferSize()), r = [];
|
|
1055
|
+
for (let o = s; o <= n; o++) {
|
|
1047
1056
|
const s = t[o];
|
|
1048
|
-
|
|
1057
|
+
r.push({
|
|
1049
1058
|
key: i(s, o),
|
|
1050
1059
|
index: o,
|
|
1051
1060
|
data: s,
|
|
1052
1061
|
offset: e.$getItemOffset(o),
|
|
1053
|
-
hide:
|
|
1062
|
+
hide: this.N.$isSizeEqual(o)
|
|
1054
1063
|
});
|
|
1055
1064
|
}
|
|
1056
|
-
return
|
|
1065
|
+
return r;
|
|
1057
1066
|
});
|
|
1058
1067
|
containerStyle=u(() => {
|
|
1059
|
-
this.
|
|
1060
|
-
const e = this.horizontal(), t = this.
|
|
1068
|
+
this.I();
|
|
1069
|
+
const e = this.horizontal(), t = this.v.$getTotalSize();
|
|
1061
1070
|
return {
|
|
1062
1071
|
display: "block",
|
|
1063
1072
|
contain: "size style",
|
|
@@ -1066,95 +1075,98 @@ var ue = class i {
|
|
|
1066
1075
|
position: "relative",
|
|
1067
1076
|
width: e ? t + "px" : "100%",
|
|
1068
1077
|
height: e ? "100%" : t + "px",
|
|
1069
|
-
"pointer-events": this.
|
|
1078
|
+
"pointer-events": this.v.$isScrolling() ? "none" : void 0
|
|
1070
1079
|
};
|
|
1071
1080
|
});
|
|
1072
1081
|
constructor() {
|
|
1073
1082
|
m(() => {
|
|
1074
1083
|
const e = this.data().length;
|
|
1075
|
-
this.
|
|
1084
|
+
this.v && this.v.$update(5, e, S(this.shift));
|
|
1076
1085
|
}), a({
|
|
1077
1086
|
read: () => {
|
|
1078
|
-
this.isSSR.set(!1), this.driver.$observe(this
|
|
1087
|
+
this.isSSR.set(!1), this.driver.$observe(this.$);
|
|
1079
1088
|
}
|
|
1080
1089
|
}), c({
|
|
1081
1090
|
read: () => {
|
|
1082
|
-
this.
|
|
1091
|
+
this.I(), this.driver.$effect();
|
|
1083
1092
|
}
|
|
1084
1093
|
}), d(s).onDestroy(() => {
|
|
1085
|
-
this.
|
|
1094
|
+
this.v?.$dispose(), this.driver?.$dispose();
|
|
1086
1095
|
});
|
|
1087
1096
|
}
|
|
1088
1097
|
ngOnInit() {
|
|
1089
1098
|
const e = this.itemSize(), t = this.ssrCount();
|
|
1090
1099
|
this.isSSR.set(!!t);
|
|
1091
|
-
const i = this.
|
|
1092
|
-
this.driver = ((e, t) => {
|
|
1093
|
-
let
|
|
1094
|
-
const
|
|
1100
|
+
const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
|
|
1101
|
+
this.driver = ((e, t, i) => {
|
|
1102
|
+
let s, n, r, o, l, a = k();
|
|
1103
|
+
const c = /* @__PURE__ */ new WeakMap, u = Z(n => {
|
|
1095
1104
|
const r = [];
|
|
1096
|
-
for (const {target: e, contentRect: {width:
|
|
1097
|
-
const
|
|
1098
|
-
null !=
|
|
1105
|
+
for (const {target: e, contentRect: {width: o, height: a}} of n) if (e === s) l && l(); else if (e.offsetParent) {
|
|
1106
|
+
const s = c.get(e);
|
|
1107
|
+
if (null != s) {
|
|
1108
|
+
const e = i ? o : a;
|
|
1109
|
+
t.$isSizeEqual(s, e) || r.push([ s, e ]);
|
|
1110
|
+
}
|
|
1099
1111
|
}
|
|
1100
|
-
|
|
1112
|
+
e.$update(3, r);
|
|
1101
1113
|
});
|
|
1102
1114
|
return {
|
|
1103
|
-
$observe(
|
|
1104
|
-
const
|
|
1105
|
-
const
|
|
1106
|
-
return e !== i && l ?
|
|
1107
|
-
},
|
|
1108
|
-
e.$update(4,
|
|
1115
|
+
$observe(c) {
|
|
1116
|
+
const p = O(c), m = C(p), d = s = p.scrollingElement, h = i && "rtl" === getComputedStyle(d).direction, f = (e, t, i, s, n = 0) => {
|
|
1117
|
+
const r = s ? "offsetLeft" : "offsetTop", o = n + (h ? t.clientWidth - e[r] - e.offsetWidth : e[r]), l = e.offsetParent;
|
|
1118
|
+
return e !== i && l ? f(l, t, i, s, o) : o;
|
|
1119
|
+
}, g = o = () => f(c, d, p.body, i), S = l = () => {
|
|
1120
|
+
e.$update(4, d[i ? "clientWidth" : "clientHeight"]);
|
|
1109
1121
|
};
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
},
|
|
1122
|
+
m.addEventListener("resize", S), u.o(d), r = () => {
|
|
1123
|
+
m.removeEventListener("resize", S);
|
|
1124
|
+
}, n = ee(e, t, m, d, i, h, null, g), a[1](!0);
|
|
1113
1125
|
},
|
|
1114
1126
|
$dispose() {
|
|
1115
|
-
r && r(),
|
|
1127
|
+
r && r(), u.u(), n && n.u(), a[1](!1), a = k();
|
|
1116
1128
|
},
|
|
1117
|
-
$observeItem: (e, t) => (
|
|
1118
|
-
|
|
1129
|
+
$observeItem: (e, t) => (c.set(e, t), u.o(e), () => {
|
|
1130
|
+
c.delete(e), u.l(e);
|
|
1119
1131
|
}),
|
|
1120
1132
|
async $scroll(e, t) {
|
|
1121
|
-
await
|
|
1133
|
+
await a[0] && n.h(e, t);
|
|
1122
1134
|
},
|
|
1123
1135
|
$effect() {
|
|
1124
|
-
|
|
1136
|
+
n && n.m();
|
|
1125
1137
|
},
|
|
1126
|
-
$getBaseOffset: () =>
|
|
1138
|
+
$getBaseOffset: () => o()
|
|
1127
1139
|
};
|
|
1128
|
-
})(s, this.horizontal()), s.$subscribe(1, e => {
|
|
1129
|
-
this.
|
|
1140
|
+
})(s, i, this.horizontal()), s.$subscribe(1, e => {
|
|
1141
|
+
this.I.set(s.$getStateVersion()), e && this.R.tick();
|
|
1130
1142
|
}), s.$subscribe(4, () => {
|
|
1131
1143
|
this.scrolled.emit();
|
|
1132
1144
|
}), s.$subscribe(8, () => {
|
|
1133
1145
|
this.scrollEnded.emit();
|
|
1134
1146
|
}), s.$subscribe(2, () => {
|
|
1135
1147
|
this.resized.emit();
|
|
1136
|
-
}), this.
|
|
1148
|
+
}), this.I.set(s.$getStateVersion());
|
|
1137
1149
|
}
|
|
1138
1150
|
get cache() {
|
|
1139
|
-
return this.
|
|
1151
|
+
return this.N.$snapshot();
|
|
1140
1152
|
}
|
|
1141
1153
|
get scrollOffset() {
|
|
1142
|
-
return this.
|
|
1154
|
+
return this.v.$getScrollOffset();
|
|
1143
1155
|
}
|
|
1144
1156
|
get viewportSize() {
|
|
1145
|
-
return this.
|
|
1157
|
+
return this.v.$getViewportSize();
|
|
1146
1158
|
}
|
|
1147
1159
|
findItemIndex(e) {
|
|
1148
|
-
return this.
|
|
1160
|
+
return this.N.$findIndex(e - this.v.$getStartSpacerSize());
|
|
1149
1161
|
}
|
|
1150
1162
|
getItemOffset(e) {
|
|
1151
|
-
return this.
|
|
1163
|
+
return this.v.$getItemOffset(e);
|
|
1152
1164
|
}
|
|
1153
1165
|
getItemSize(e) {
|
|
1154
|
-
return this.
|
|
1166
|
+
return this.N.$getItemSize(e);
|
|
1155
1167
|
}
|
|
1156
1168
|
scrollToIndex(e, t) {
|
|
1157
|
-
|
|
1169
|
+
ne(this.driver, this.v, this.N, e, t);
|
|
1158
1170
|
}
|
|
1159
1171
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1160
1172
|
minVersion: "12.0.0",
|
|
@@ -1251,7 +1263,7 @@ var ue = class i {
|
|
|
1251
1263
|
isInline: !0,
|
|
1252
1264
|
dependencies: [ {
|
|
1253
1265
|
kind: "directive",
|
|
1254
|
-
type: e.forwardRef(() =>
|
|
1266
|
+
type: e.forwardRef(() => oe),
|
|
1255
1267
|
selector: "div[virtuaListItem]",
|
|
1256
1268
|
inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
|
|
1257
1269
|
}, {
|
|
@@ -1266,19 +1278,19 @@ var ue = class i {
|
|
|
1266
1278
|
|
|
1267
1279
|
i.OnPush;
|
|
1268
1280
|
|
|
1269
|
-
var
|
|
1281
|
+
var me = class t {
|
|
1270
1282
|
state=h.required();
|
|
1271
1283
|
resizer=h.required();
|
|
1272
1284
|
constructor() {
|
|
1273
|
-
const e = d(
|
|
1274
|
-
let
|
|
1285
|
+
const e = d(n).nativeElement, t = u(() => this.state().$measureRow), i = u(() => this.state().$measureCol);
|
|
1286
|
+
let r;
|
|
1275
1287
|
c({
|
|
1276
1288
|
read: () => {
|
|
1277
|
-
const s = t(),
|
|
1278
|
-
|
|
1289
|
+
const s = t(), n = i();
|
|
1290
|
+
r && r(), r = null == s && null == n ? void 0 : S(this.resizer)(e, s, n);
|
|
1279
1291
|
}
|
|
1280
1292
|
}), d(s).onDestroy(() => {
|
|
1281
|
-
|
|
1293
|
+
r && r();
|
|
1282
1294
|
});
|
|
1283
1295
|
}
|
|
1284
1296
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
@@ -1323,14 +1335,14 @@ var pe = class t {
|
|
|
1323
1335
|
},
|
|
1324
1336
|
ngImport: e
|
|
1325
1337
|
});
|
|
1326
|
-
},
|
|
1338
|
+
}, de = class t {
|
|
1327
1339
|
state=h.required();
|
|
1328
1340
|
template=h.required();
|
|
1329
1341
|
row=h.required();
|
|
1330
1342
|
cols=h.required();
|
|
1331
1343
|
resizer=h.required();
|
|
1332
1344
|
colItem(e) {
|
|
1333
|
-
return
|
|
1345
|
+
return G(this.cols(), e);
|
|
1334
1346
|
}
|
|
1335
1347
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1336
1348
|
minVersion: "12.0.0",
|
|
@@ -1397,7 +1409,7 @@ var pe = class t {
|
|
|
1397
1409
|
isInline: !0,
|
|
1398
1410
|
dependencies: [ {
|
|
1399
1411
|
kind: "directive",
|
|
1400
|
-
type: e.forwardRef(() =>
|
|
1412
|
+
type: e.forwardRef(() => me),
|
|
1401
1413
|
selector: "div[virtuaGridCell]",
|
|
1402
1414
|
inputs: [ "state", "resizer" ]
|
|
1403
1415
|
}, {
|
|
@@ -1408,14 +1420,14 @@ var pe = class t {
|
|
|
1408
1420
|
} ],
|
|
1409
1421
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
1410
1422
|
});
|
|
1411
|
-
},
|
|
1423
|
+
}, he = class t {
|
|
1412
1424
|
state=h.required();
|
|
1413
1425
|
template=h.required();
|
|
1414
1426
|
rows=h.required();
|
|
1415
1427
|
cols=h.required();
|
|
1416
1428
|
resizer=h.required();
|
|
1417
1429
|
rowItem(e) {
|
|
1418
|
-
return
|
|
1430
|
+
return G(this.rows(), e);
|
|
1419
1431
|
}
|
|
1420
1432
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1421
1433
|
minVersion: "12.0.0",
|
|
@@ -1481,13 +1493,13 @@ var pe = class t {
|
|
|
1481
1493
|
isInline: !0,
|
|
1482
1494
|
dependencies: [ {
|
|
1483
1495
|
kind: "directive",
|
|
1484
|
-
type: e.forwardRef(() =>
|
|
1496
|
+
type: e.forwardRef(() => de),
|
|
1485
1497
|
selector: "div[virtuaGridRow]",
|
|
1486
1498
|
inputs: [ "state", "template", "row", "cols", "resizer" ]
|
|
1487
1499
|
} ],
|
|
1488
1500
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
1489
1501
|
});
|
|
1490
|
-
},
|
|
1502
|
+
}, fe = class i {
|
|
1491
1503
|
rows=h.required();
|
|
1492
1504
|
cols=h.required();
|
|
1493
1505
|
rowHeight=h.required();
|
|
@@ -1508,25 +1520,25 @@ var pe = class t {
|
|
|
1508
1520
|
resized=f();
|
|
1509
1521
|
template=p.required(l);
|
|
1510
1522
|
container=y.required("container");
|
|
1511
|
-
I;
|
|
1512
1523
|
q;
|
|
1513
1524
|
F;
|
|
1514
1525
|
k;
|
|
1526
|
+
O;
|
|
1515
1527
|
driver;
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
ariaRowCount=d(new
|
|
1528
|
+
$=d(n).nativeElement;
|
|
1529
|
+
R=d(t);
|
|
1530
|
+
I=g(void 0);
|
|
1531
|
+
ariaRowCount=d(new r("aria-rowcount"), {
|
|
1520
1532
|
optional: !0
|
|
1521
1533
|
});
|
|
1522
|
-
ariaColCount=d(new
|
|
1534
|
+
ariaColCount=d(new r("aria-colcount"), {
|
|
1523
1535
|
optional: !0
|
|
1524
1536
|
});
|
|
1525
|
-
rowCount=u(() => this.
|
|
1526
|
-
colCount=u(() => this.
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1537
|
+
rowCount=u(() => this.I() && this.k.$getLength());
|
|
1538
|
+
colCount=u(() => this.I() && this.O.$getLength());
|
|
1539
|
+
C=u(() => this.k.$getSizes(this.rows(), this.rowHeight()));
|
|
1540
|
+
T=u(() => this.O.$getSizes(this.cols(), this.colWidth()));
|
|
1541
|
+
M=u(() => ((e = N) => {
|
|
1530
1542
|
const t = /* @__PURE__ */ new Map;
|
|
1531
1543
|
for (const i of e) {
|
|
1532
1544
|
const e = i.rowIndex + (i.rowSpan || 1);
|
|
@@ -1537,18 +1549,18 @@ var pe = class t {
|
|
|
1537
1549
|
}
|
|
1538
1550
|
return t;
|
|
1539
1551
|
})(this.spans()));
|
|
1540
|
-
plan=u(() => (this.
|
|
1552
|
+
plan=u(() => (this.I(), ((e, t, [i, s], [n, r], o, l = N, a = N, c) => {
|
|
1541
1553
|
const u = e.$getLength(), p = t.$getLength(), m = e.$getPinnedStart(), d = e.$getTrailStart(), h = t.$getPinnedStart(), f = t.$getTrailStart();
|
|
1542
|
-
i =
|
|
1543
|
-
const g =
|
|
1554
|
+
i = I(i, m, d), s = w(s, d - 1), n = I(n, h, f), r = w(r, f - 1);
|
|
1555
|
+
const g = H(l, m, d), S = b(h - 1, 0), y = [], v = [], z = [];
|
|
1544
1556
|
for (const e of a) e.rowIndex < u && e.colIndex < p && (z.push(e), y.push(e.rowIndex));
|
|
1545
|
-
const $ = z.length, R =
|
|
1557
|
+
const $ = z.length, R = j(g, i, d), x = R < 0 ? -1 : g[R];
|
|
1546
1558
|
x >= 0 && y.push(x);
|
|
1547
|
-
const q =
|
|
1559
|
+
const q = Q(P(y), u, m, i, s, d);
|
|
1548
1560
|
for (let e = 0; e < q.length; e++) for (const t of o.get(q[e]) || N) {
|
|
1549
|
-
const {rowIndex: o, colIndex: l} = t, a =
|
|
1561
|
+
const {rowIndex: o, colIndex: l} = t, a = J(t, u), c = X(t, p);
|
|
1550
1562
|
if ((e < 1 || q[e - 1] < o) && l < p && (a - o > 1 || c - l > 1)) {
|
|
1551
|
-
let e = (o < m || b(o, i) < w(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l,
|
|
1563
|
+
let e = (o < m || b(o, i) < w(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l, n) < w(c, r + 1) || f < c);
|
|
1552
1564
|
for (let t = 0; !e && t < $; t++) {
|
|
1553
1565
|
const i = z[t];
|
|
1554
1566
|
e = i.rowIndex >= o && i.rowIndex < a && i.colIndex >= l && i.colIndex < c;
|
|
@@ -1557,57 +1569,57 @@ var pe = class t {
|
|
|
1557
1569
|
}
|
|
1558
1570
|
}
|
|
1559
1571
|
for (const {rowIndex: e, colIndex: t} of z) {
|
|
1560
|
-
const i =
|
|
1572
|
+
const i = j(g, e, d);
|
|
1561
1573
|
y.push(e), i >= 0 && y.push(g[i]), v.push(t);
|
|
1562
1574
|
}
|
|
1563
|
-
|
|
1564
|
-
const F =
|
|
1575
|
+
P(y), P(v);
|
|
1576
|
+
const F = Q(y, u, m, i, s, d), k = Q(v, p, h, n, r, f), O = F.length, C = k.length, T = /* @__PURE__ */ new Map, M = [], _ = [];
|
|
1565
1577
|
for (const e of z) {
|
|
1566
|
-
const t =
|
|
1578
|
+
const t = J(e, u), i = X(e, p);
|
|
1567
1579
|
M.push(t), _.push(i);
|
|
1568
1580
|
const s = k.indexOf(e.colIndex);
|
|
1569
|
-
for (let
|
|
1570
|
-
const t = F[
|
|
1571
|
-
for (let
|
|
1581
|
+
for (let n = F.indexOf(e.rowIndex); n < O && F[n] < t; n++) {
|
|
1582
|
+
const t = F[n] * p;
|
|
1583
|
+
for (let n = s; n < C && k[n] < i; n++) T.set(t + k[n], e);
|
|
1572
1584
|
}
|
|
1573
1585
|
}
|
|
1574
1586
|
const V = [];
|
|
1575
1587
|
for (const e of k) V.push(!t.$isMeasurable(e) && null);
|
|
1576
|
-
const E = [],
|
|
1577
|
-
let D =
|
|
1578
|
-
const G =
|
|
1588
|
+
const E = [], K = e.$getItemOffset(m), L = [];
|
|
1589
|
+
let D = L;
|
|
1590
|
+
const G = B.get(e), W = /* @__PURE__ */ new Map;
|
|
1579
1591
|
for (const o of F) {
|
|
1580
|
-
const l = o < m, a = o >= d, y =
|
|
1592
|
+
const l = o < m, a = o >= d, y = j(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
|
|
1581
1593
|
if (o === v) {
|
|
1582
1594
|
const e = l ? m : a ? u : y + 1 < g.length ? g[y + 1] : d;
|
|
1583
1595
|
M.push(e);
|
|
1584
1596
|
const t = [];
|
|
1585
|
-
|
|
1597
|
+
L.push({
|
|
1586
1598
|
$key: l ? -1 : a ? -2 : -3 - v,
|
|
1587
1599
|
$rows: t,
|
|
1588
|
-
$style:
|
|
1600
|
+
$style: U(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
|
|
1589
1601
|
}), D = t;
|
|
1590
|
-
} else v < 0 && (D =
|
|
1591
|
-
const z = y >= 0 && o === v, N = l || a || o === x || o >= i && o <= s, w = z ?
|
|
1602
|
+
} else v < 0 && (D = L);
|
|
1603
|
+
const z = y >= 0 && o === v, N = l || a || o === x || o >= i && o <= s, w = z ? K : null, $ = o * p, R = G && G.get(o), I = R && R.$cells, P = [];
|
|
1592
1604
|
let q = 0, F = !e.$isMeasurable(o) && null, O = o + 1, _ = !1;
|
|
1593
1605
|
for (let e = 0; e < C; e++) {
|
|
1594
|
-
const i = k[e], s = i < h, a = i >= f, m = s || a || i >=
|
|
1606
|
+
const i = k[e], s = i < h, a = i >= f, m = s || a || i >= n && i <= r, d = T.get($ + i);
|
|
1595
1607
|
if (d ? d.rowIndex === o && d.colIndex === i : N && m) {
|
|
1596
|
-
const
|
|
1608
|
+
const n = d ? J(d, u) : o + 1, r = d ? X(d, p) : i + 1, m = n - o, h = r - i, f = m > 1, g = h > 1, y = f || g;
|
|
1597
1609
|
let v, N;
|
|
1598
|
-
O = b(O,
|
|
1599
|
-
const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(
|
|
1610
|
+
O = b(O, n);
|
|
1611
|
+
const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(r) : null;
|
|
1600
1612
|
!1 !== F || f || (v = o, F = !0), !1 !== V[e] || g || (N = i, V[e] = !0);
|
|
1601
1613
|
const R = l ? "columnheader" : i === S && (s || z) ? "rowheader" : "cell", x = y ? m : void 0, k = y ? h : void 0, C = "cell" !== R && c && c.rowIndex === o && c.colIndex === i ? c.order : void 0;
|
|
1602
1614
|
let T;
|
|
1603
|
-
if (
|
|
1604
|
-
const e =
|
|
1605
|
-
for (;q < e &&
|
|
1606
|
-
q < e &&
|
|
1615
|
+
if (I) {
|
|
1616
|
+
const e = I.length;
|
|
1617
|
+
for (;q < e && I[q].$col < i; ) q++;
|
|
1618
|
+
q < e && I[q].$col === i && (T = I[q]);
|
|
1607
1619
|
}
|
|
1608
1620
|
if (!T || T.$rowSpan !== x || T.$colSpan !== k || T.$start !== w || T.$end !== $ || T.$measureRow !== v || T.$measureCol !== N || T.$role !== R || T.$sort !== C) {
|
|
1609
1621
|
let e = "1/l" + i;
|
|
1610
|
-
y && (e += "/l" +
|
|
1622
|
+
y && (e += "/l" + n + "/l" + r);
|
|
1611
1623
|
const t = {
|
|
1612
1624
|
contain: "layout style",
|
|
1613
1625
|
display: "grid",
|
|
@@ -1628,31 +1640,31 @@ var pe = class t {
|
|
|
1628
1640
|
$end: $
|
|
1629
1641
|
}, _ = !0;
|
|
1630
1642
|
}
|
|
1631
|
-
|
|
1643
|
+
P.push(T);
|
|
1632
1644
|
}
|
|
1633
1645
|
}
|
|
1634
|
-
if (E.push(F),
|
|
1635
|
-
const e = R && !_ && R.$cells.length ===
|
|
1646
|
+
if (E.push(F), P.length) {
|
|
1647
|
+
const e = R && !_ && R.$cells.length === P.length && R.$top === w ? R : {
|
|
1636
1648
|
$row: o,
|
|
1637
|
-
$cells:
|
|
1638
|
-
$style:
|
|
1649
|
+
$cells: P,
|
|
1650
|
+
$style: U(o, O, w, "top", 3),
|
|
1639
1651
|
$top: w
|
|
1640
1652
|
};
|
|
1641
|
-
|
|
1653
|
+
W.set(o, e), D.push(e);
|
|
1642
1654
|
}
|
|
1643
1655
|
}
|
|
1644
|
-
return
|
|
1645
|
-
$rowTemplate:
|
|
1646
|
-
$colTemplate:
|
|
1647
|
-
$groups:
|
|
1656
|
+
return B.set(e, W), {
|
|
1657
|
+
$rowTemplate: Y(e, F, E, P(M), "max-content", u),
|
|
1658
|
+
$colTemplate: Y(t, k, V, P(_), "minmax(max-content,auto)", p),
|
|
1659
|
+
$groups: L
|
|
1648
1660
|
};
|
|
1649
|
-
})(this.
|
|
1661
|
+
})(this.k, this.O, this.q.$getRange(this.bufferSize()), this.F.$getRange(this.bufferSize()), this.M(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
|
|
1650
1662
|
rowItem(e) {
|
|
1651
|
-
return
|
|
1663
|
+
return G(this.rows(), e);
|
|
1652
1664
|
}
|
|
1653
1665
|
containerStyle=u(() => {
|
|
1654
|
-
this.
|
|
1655
|
-
const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.
|
|
1666
|
+
this.I();
|
|
1667
|
+
const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.q.$getItemOffset(0), s = this.F.$getItemOffset(0);
|
|
1656
1668
|
return {
|
|
1657
1669
|
contain: "size style",
|
|
1658
1670
|
"overflow-anchor": "none",
|
|
@@ -1663,20 +1675,19 @@ var pe = class t {
|
|
|
1663
1675
|
gap: this.gap() + "px",
|
|
1664
1676
|
"margin-top": i + "px",
|
|
1665
1677
|
"margin-inline-start": s + "px",
|
|
1666
|
-
height: M(this.
|
|
1667
|
-
"pointer-events": this.
|
|
1678
|
+
height: M(this.q) - i + "px",
|
|
1679
|
+
"pointer-events": this.q.$isScrolling() || this.F.$isScrolling() ? "none" : void 0
|
|
1668
1680
|
};
|
|
1669
1681
|
});
|
|
1670
1682
|
constructor() {
|
|
1671
1683
|
m(() => {
|
|
1672
|
-
const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(),
|
|
1673
|
-
if (!this.
|
|
1674
|
-
const o = this.
|
|
1684
|
+
const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), n = this.headerCols(), r = this.footerCols();
|
|
1685
|
+
if (!this.q) return;
|
|
1686
|
+
const o = this.C(), l = this.T();
|
|
1675
1687
|
S(() => {
|
|
1676
|
-
this.
|
|
1677
|
-
const a =
|
|
1678
|
-
|
|
1679
|
-
this.I.$update(9, this.F.$relayout(o, this.I.$getVisibleOffset())), this.q.$update(9, this.k.$relayout(l, this.q.$getVisibleOffset()));
|
|
1688
|
+
this.k.$setPinned(i, s), this.O.$setPinned(n, r);
|
|
1689
|
+
const a = D(e), c = D(t);
|
|
1690
|
+
this.q.$update(5, a), this.F.$update(5, c), _(this.q, this.k, o), _(this.F, this.O, l);
|
|
1680
1691
|
});
|
|
1681
1692
|
}), a({
|
|
1682
1693
|
read: () => {
|
|
@@ -1684,115 +1695,115 @@ var pe = class t {
|
|
|
1684
1695
|
}
|
|
1685
1696
|
}), c({
|
|
1686
1697
|
read: () => {
|
|
1687
|
-
this.
|
|
1698
|
+
this.I(), this.driver.$effect();
|
|
1688
1699
|
}
|
|
1689
1700
|
}), d(s).onDestroy(() => {
|
|
1690
|
-
this.
|
|
1701
|
+
this.q?.$dispose(), this.F?.$dispose(), this.driver?.$dispose();
|
|
1691
1702
|
});
|
|
1692
1703
|
}
|
|
1693
1704
|
ngOnInit() {
|
|
1694
|
-
const e = this
|
|
1705
|
+
const e = this.$;
|
|
1695
1706
|
e.setAttribute("style", "display:block;overflow:auto;contain:strict;width:100%;height:100%;" + (e.getAttribute("style") || ""));
|
|
1696
|
-
const t = this.gap(), i = this.
|
|
1697
|
-
this.driver = ((e, t) => {
|
|
1698
|
-
let
|
|
1699
|
-
const
|
|
1700
|
-
const
|
|
1701
|
-
for (const {target:
|
|
1702
|
-
|
|
1703
|
-
const e =
|
|
1704
|
-
null
|
|
1707
|
+
const t = this.gap(), i = this.k = W(this.rows(), this.rowHeight(), t), s = this.O = W(this.cols(), this.colWidth(), t), n = this.q = V(i), r = this.F = V(s);
|
|
1708
|
+
this.driver = ((e, t, i, s) => {
|
|
1709
|
+
let n, r, o, l = k(), a = !0;
|
|
1710
|
+
const c = /* @__PURE__ */ new WeakMap, u = /* @__PURE__ */ new WeakMap, p = Z(l => {
|
|
1711
|
+
const p = [], m = [];
|
|
1712
|
+
for (const {target: d, contentRect: {width: h, height: f}} of l) if (d === n) h || f ? (a || (r.p(),
|
|
1713
|
+
o.p()), a = !0, e.$update(4, f), t.$update(4, h)) : a = !1; else if (d.offsetParent) {
|
|
1714
|
+
const e = c.get(d), t = u.get(d);
|
|
1715
|
+
null == e || i.$isSizeEqual(e, f) || p.push([ e, f ]), null == t || s.$isSizeEqual(t, h) || m.push([ t, h ]);
|
|
1705
1716
|
}
|
|
1706
|
-
|
|
1717
|
+
e.$update(3, p), t.$update(3, m);
|
|
1707
1718
|
});
|
|
1708
1719
|
return {
|
|
1709
1720
|
async $scroll(e, t) {
|
|
1710
|
-
await
|
|
1721
|
+
await l[0] && (e ? o : r).h(t);
|
|
1711
1722
|
},
|
|
1712
|
-
$observe(
|
|
1713
|
-
|
|
1714
|
-
const
|
|
1715
|
-
const e =
|
|
1716
|
-
|
|
1717
|
-
|
|
1723
|
+
$observe(a, c = a.parentElement) {
|
|
1724
|
+
p.o(n = c);
|
|
1725
|
+
const u = (e, t, i) => ee(e, t, c, c, i, i && "rtl" === getComputedStyle(c).direction, () => {
|
|
1726
|
+
const e = i ? "overflowX" : "overflowY", t = c.style, s = t[e];
|
|
1727
|
+
t[e] = "hidden", x(() => {
|
|
1728
|
+
t[e] = s;
|
|
1718
1729
|
});
|
|
1719
1730
|
});
|
|
1720
|
-
|
|
1731
|
+
r = u(e, i, !1), o = u(t, s, !0), l[1](!0);
|
|
1721
1732
|
},
|
|
1722
1733
|
$dispose() {
|
|
1723
|
-
|
|
1734
|
+
p.u(), r && r.u(), o && o.u(), l[1](!1), l = k();
|
|
1724
1735
|
},
|
|
1725
|
-
$observeItem: (e, t, i) => (null != t &&
|
|
1726
|
-
|
|
1727
|
-
|
|
1736
|
+
$observeItem: (e, t, i) => (null != t && c.set(e, t), null != i && u.set(e, i),
|
|
1737
|
+
p.o(e), () => {
|
|
1738
|
+
c.delete(e), u.delete(e), p.l(e);
|
|
1728
1739
|
}),
|
|
1729
1740
|
$effect() {
|
|
1730
|
-
|
|
1741
|
+
r && r.m(), o && o.m();
|
|
1731
1742
|
}
|
|
1732
1743
|
};
|
|
1733
|
-
})(r,
|
|
1744
|
+
})(n, r, i, s);
|
|
1734
1745
|
const o = e => {
|
|
1735
|
-
this.
|
|
1746
|
+
this.I.set(n.$getStateVersion() + r.$getStateVersion()), e && this.R.tick();
|
|
1736
1747
|
};
|
|
1737
|
-
|
|
1748
|
+
n.$subscribe(1, o), r.$subscribe(1, o);
|
|
1738
1749
|
let l = !1;
|
|
1739
|
-
|
|
1740
|
-
l = !0, this.verticalScrolled.emit(
|
|
1741
|
-
}),
|
|
1742
|
-
l = !0, this.horizontalScrolled.emit(
|
|
1750
|
+
n.$subscribe(4, () => {
|
|
1751
|
+
l = !0, this.verticalScrolled.emit(n.$getScrollOffset());
|
|
1752
|
+
}), r.$subscribe(4, () => {
|
|
1753
|
+
l = !0, this.horizontalScrolled.emit(r.$getScrollOffset());
|
|
1743
1754
|
});
|
|
1744
1755
|
const a = () => {
|
|
1745
|
-
!l ||
|
|
1756
|
+
!l || n.$isScrolling() || r.$isScrolling() || (l = !1, this.scrollEnded.emit());
|
|
1746
1757
|
};
|
|
1747
1758
|
let c;
|
|
1748
|
-
|
|
1759
|
+
n.$subscribe(8, a), r.$subscribe(8, a);
|
|
1749
1760
|
const u = () => {
|
|
1750
1761
|
c || (c = !0, F(() => {
|
|
1751
1762
|
c = !1, this.resized.emit();
|
|
1752
1763
|
}));
|
|
1753
1764
|
};
|
|
1754
|
-
|
|
1765
|
+
n.$subscribe(2, u), r.$subscribe(2, u), o();
|
|
1755
1766
|
}
|
|
1756
1767
|
get verticalScrollOffset() {
|
|
1757
|
-
return this.
|
|
1768
|
+
return this.q.$getScrollOffset();
|
|
1758
1769
|
}
|
|
1759
1770
|
get horizontalScrollOffset() {
|
|
1760
|
-
return this.
|
|
1771
|
+
return this.F.$getScrollOffset();
|
|
1761
1772
|
}
|
|
1762
1773
|
get scrollHeight() {
|
|
1763
|
-
return M(this.
|
|
1774
|
+
return M(this.q);
|
|
1764
1775
|
}
|
|
1765
1776
|
get scrollWidth() {
|
|
1766
|
-
return M(this.
|
|
1777
|
+
return M(this.F);
|
|
1767
1778
|
}
|
|
1768
1779
|
get viewportHeight() {
|
|
1769
|
-
return this.
|
|
1780
|
+
return this.q.$getViewportSize();
|
|
1770
1781
|
}
|
|
1771
1782
|
get viewportWidth() {
|
|
1772
|
-
return this.
|
|
1783
|
+
return this.F.$getViewportSize();
|
|
1773
1784
|
}
|
|
1774
1785
|
findRowIndex(e) {
|
|
1775
|
-
return this.
|
|
1786
|
+
return this.k.$findIndex(e);
|
|
1776
1787
|
}
|
|
1777
1788
|
findColIndex(e) {
|
|
1778
|
-
return this.
|
|
1789
|
+
return this.O.$findIndex(e);
|
|
1779
1790
|
}
|
|
1780
1791
|
getRowOffset(e) {
|
|
1781
|
-
return this.
|
|
1792
|
+
return this.q.$getItemOffset(e);
|
|
1782
1793
|
}
|
|
1783
1794
|
getColOffset(e) {
|
|
1784
|
-
return this.
|
|
1795
|
+
return this.F.$getItemOffset(e);
|
|
1785
1796
|
}
|
|
1786
1797
|
getRowSize(e) {
|
|
1787
|
-
return this.
|
|
1798
|
+
return this.k.$getItemSize(e);
|
|
1788
1799
|
}
|
|
1789
1800
|
getColSize(e) {
|
|
1790
|
-
return this.
|
|
1801
|
+
return this.O.$getItemSize(e);
|
|
1791
1802
|
}
|
|
1792
1803
|
scrollToIndex(e) {
|
|
1793
|
-
((e, t, i, s,
|
|
1794
|
-
null != o && re(e, t, s,
|
|
1795
|
-
})(this.driver, this.
|
|
1804
|
+
((e, t, i, s, n, r = N, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
|
|
1805
|
+
null != o && re(e, t, s, r, o, a, !1), null != l && re(e, i, n, N, l, c, !0);
|
|
1806
|
+
})(this.driver, this.q, this.F, this.k, this.O, this.sectionRows(), e);
|
|
1796
1807
|
}
|
|
1797
1808
|
scrollTo({vertical: e, horizontal: t}) {
|
|
1798
1809
|
((e, t, i) => {
|
|
@@ -1800,16 +1811,16 @@ var pe = class t {
|
|
|
1800
1811
|
})(this.driver, e, t);
|
|
1801
1812
|
}
|
|
1802
1813
|
scrollBy({vertical: e, horizontal: t}) {
|
|
1803
|
-
((e, t, i, s,
|
|
1814
|
+
((e, t, i, s, n) => {
|
|
1804
1815
|
if (null != s) {
|
|
1805
1816
|
const i = s + t.$getScrollOffset();
|
|
1806
1817
|
e.$scroll(!1, () => i);
|
|
1807
1818
|
}
|
|
1808
|
-
if (null !=
|
|
1809
|
-
const t =
|
|
1819
|
+
if (null != n) {
|
|
1820
|
+
const t = n + i.$getScrollOffset();
|
|
1810
1821
|
e.$scroll(!0, () => t);
|
|
1811
1822
|
}
|
|
1812
|
-
})(this.driver, this.
|
|
1823
|
+
})(this.driver, this.q, this.F, e, t);
|
|
1813
1824
|
}
|
|
1814
1825
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1815
1826
|
minVersion: "12.0.0",
|
|
@@ -1961,12 +1972,12 @@ var pe = class t {
|
|
|
1961
1972
|
isInline: !0,
|
|
1962
1973
|
dependencies: [ {
|
|
1963
1974
|
kind: "directive",
|
|
1964
|
-
type: e.forwardRef(() =>
|
|
1975
|
+
type: e.forwardRef(() => he),
|
|
1965
1976
|
selector: "div[virtuaGridRowGroup]",
|
|
1966
1977
|
inputs: [ "state", "template", "rows", "cols", "resizer" ]
|
|
1967
1978
|
}, {
|
|
1968
1979
|
kind: "directive",
|
|
1969
|
-
type: e.forwardRef(() =>
|
|
1980
|
+
type: e.forwardRef(() => de),
|
|
1970
1981
|
selector: "div[virtuaGridRow]",
|
|
1971
1982
|
inputs: [ "state", "template", "row", "cols", "resizer" ]
|
|
1972
1983
|
} ],
|
|
@@ -1976,7 +1987,7 @@ var pe = class t {
|
|
|
1976
1987
|
|
|
1977
1988
|
i.OnPush, i.OnPush, i.OnPush;
|
|
1978
1989
|
|
|
1979
|
-
var
|
|
1990
|
+
var ge = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", Se = class t {
|
|
1980
1991
|
index=h.required();
|
|
1981
1992
|
offset=h.required();
|
|
1982
1993
|
crossOffset=h.required();
|
|
@@ -1992,7 +2003,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
1992
2003
|
visibility: this.hide() ? "hidden" : void 0
|
|
1993
2004
|
}));
|
|
1994
2005
|
constructor() {
|
|
1995
|
-
const e = d(
|
|
2006
|
+
const e = d(n).nativeElement;
|
|
1996
2007
|
let t;
|
|
1997
2008
|
c({
|
|
1998
2009
|
read: () => {
|
|
@@ -2068,9 +2079,9 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2068
2079
|
},
|
|
2069
2080
|
ngImport: e
|
|
2070
2081
|
});
|
|
2071
|
-
},
|
|
2082
|
+
}, ye = class i {
|
|
2072
2083
|
data=h.required();
|
|
2073
|
-
getKey=h(
|
|
2084
|
+
getKey=h(le);
|
|
2074
2085
|
lanes=h.required();
|
|
2075
2086
|
gap=h();
|
|
2076
2087
|
itemSize=h();
|
|
@@ -2084,25 +2095,25 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2084
2095
|
resized=f();
|
|
2085
2096
|
template=p.required(l);
|
|
2086
2097
|
container=y.required("container");
|
|
2087
|
-
S;
|
|
2088
2098
|
v;
|
|
2099
|
+
N;
|
|
2089
2100
|
driver;
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2101
|
+
$=d(n).nativeElement;
|
|
2102
|
+
R=d(t);
|
|
2103
|
+
I=g(void 0);
|
|
2093
2104
|
P=u(() => {
|
|
2094
|
-
this.
|
|
2095
|
-
const e = this.data().length, [t, i] = this.
|
|
2105
|
+
this.I();
|
|
2106
|
+
const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
|
|
2096
2107
|
if (s) {
|
|
2097
|
-
const
|
|
2098
|
-
for (let e = t; e <= i; e++)
|
|
2099
|
-
for (const t of
|
|
2100
|
-
} else for (let e = t; e <= i; e++)
|
|
2101
|
-
return
|
|
2108
|
+
const r = new Set(s);
|
|
2109
|
+
for (let e = t; e <= i; e++) r.add(e);
|
|
2110
|
+
for (const t of P([ ...r ])) t < e && n.push(t);
|
|
2111
|
+
} else for (let e = t; e <= i; e++) n.push(e);
|
|
2112
|
+
return n;
|
|
2102
2113
|
});
|
|
2103
2114
|
items=u(() => {
|
|
2104
|
-
this.
|
|
2105
|
-
const e = this.
|
|
2115
|
+
this.I();
|
|
2116
|
+
const e = this.v, t = this.N, i = this.data(), s = this.getKey(), n = t.$getGap(), r = t.$getLanes(), o = ge(1 / r, n / r - n), l = [];
|
|
2106
2117
|
for (const a of this.P()) {
|
|
2107
2118
|
const c = i[a], u = t.$getItemLane(a);
|
|
2108
2119
|
l.push({
|
|
@@ -2110,32 +2121,32 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2110
2121
|
index: a,
|
|
2111
2122
|
data: c,
|
|
2112
2123
|
offset: e.$getItemOffset(a),
|
|
2113
|
-
crossOffset:
|
|
2124
|
+
crossOffset: ge(u / r, u * n / r),
|
|
2114
2125
|
crossSize: o,
|
|
2115
|
-
hide:
|
|
2126
|
+
hide: t.$isSizeEqual(a)
|
|
2116
2127
|
});
|
|
2117
2128
|
}
|
|
2118
2129
|
return l;
|
|
2119
2130
|
});
|
|
2120
|
-
containerStyle=u(() => (this.
|
|
2131
|
+
containerStyle=u(() => (this.I(), {
|
|
2121
2132
|
contain: "size style",
|
|
2122
2133
|
"overflow-anchor": "none",
|
|
2123
2134
|
flex: "none",
|
|
2124
2135
|
position: "relative",
|
|
2125
2136
|
width: "100%",
|
|
2126
|
-
height: this.
|
|
2127
|
-
"pointer-events": this.
|
|
2137
|
+
height: this.v.$getTotalSize() + "px",
|
|
2138
|
+
"pointer-events": this.v.$isScrolling() ? "none" : void 0
|
|
2128
2139
|
}));
|
|
2129
2140
|
constructor() {
|
|
2130
2141
|
m(() => {
|
|
2131
2142
|
const e = this.data();
|
|
2132
|
-
this.
|
|
2133
|
-
|
|
2143
|
+
this.v && S(() => {
|
|
2144
|
+
this.v.$update(5, e.length);
|
|
2134
2145
|
});
|
|
2135
2146
|
}), m(() => {
|
|
2136
2147
|
const e = this.lanes(), t = this.gap();
|
|
2137
|
-
this.
|
|
2138
|
-
this.
|
|
2148
|
+
this.v && S(() => {
|
|
2149
|
+
_(this.v, this.N, e, t);
|
|
2139
2150
|
});
|
|
2140
2151
|
}), a({
|
|
2141
2152
|
read: () => {
|
|
@@ -2143,125 +2154,116 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2143
2154
|
}
|
|
2144
2155
|
}), c({
|
|
2145
2156
|
read: () => {
|
|
2146
|
-
this.
|
|
2157
|
+
this.I(), this.driver.$effect();
|
|
2147
2158
|
}
|
|
2148
2159
|
}), d(s).onDestroy(() => {
|
|
2149
|
-
this.
|
|
2160
|
+
this.v?.$dispose(), this.driver?.$dispose();
|
|
2150
2161
|
});
|
|
2151
2162
|
}
|
|
2152
2163
|
ngOnInit() {
|
|
2153
|
-
const e = this
|
|
2164
|
+
const e = this.$;
|
|
2154
2165
|
e.setAttribute("style", "display:block;overflow-y:auto;contain:strict;width:100%;height:100%;" + (e.getAttribute("style") || ""));
|
|
2155
|
-
const t = this.
|
|
2156
|
-
let
|
|
2157
|
-
const u =
|
|
2158
|
-
|
|
2166
|
+
const t = this.N = ((e, t, i = 0, s, n) => {
|
|
2167
|
+
let r = b(t, 1), o = n && n[1] || s || 40, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, c = !s;
|
|
2168
|
+
const u = n ? n[0].slice(0, e) : [];
|
|
2169
|
+
E(u, e - u.length);
|
|
2170
|
+
const p = [], m = [], d = [ 0 ], h = e => {
|
|
2171
|
+
const t = u[e];
|
|
2159
2172
|
return -1 === t ? o : t;
|
|
2160
|
-
},
|
|
2161
|
-
if (
|
|
2162
|
-
const
|
|
2163
|
-
for (let e = 0; e <
|
|
2164
|
-
for (let e = l,
|
|
2165
|
-
const
|
|
2166
|
-
-1 === r
|
|
2173
|
+
}, f = () => {
|
|
2174
|
+
if (l >= e - 1) return;
|
|
2175
|
+
const t = [], s = [];
|
|
2176
|
+
for (let e = 0; e < r; e++) t.push(0), s.push(-1);
|
|
2177
|
+
for (let e = l, n = r; e >= 0 && n; e--) {
|
|
2178
|
+
const r = m[e];
|
|
2179
|
+
-1 === s[r] && (s[r] = e, t[r] = p[e] + h(e) + i, n--);
|
|
2167
2180
|
}
|
|
2168
|
-
for (;l <
|
|
2181
|
+
for (;l < e - 1; ) {
|
|
2169
2182
|
const e = ++l;
|
|
2170
|
-
let
|
|
2171
|
-
for (let e = 0; e <
|
|
2172
|
-
const
|
|
2173
|
-
(
|
|
2183
|
+
let n = 0, o = 1 / 0, a = 1 / 0;
|
|
2184
|
+
for (let e = 0; e < r; e++) {
|
|
2185
|
+
const i = t[e];
|
|
2186
|
+
(i < o || i === o && s[e] < a) && (n = e, o = i, a = s[e]);
|
|
2174
2187
|
}
|
|
2175
|
-
|
|
2188
|
+
const c = o + h(e);
|
|
2189
|
+
p[e] = o, m[e] = n, t[n] = c + i, s[n] = e, d[e + 1] = b(d[e], c);
|
|
2176
2190
|
}
|
|
2177
|
-
},
|
|
2178
|
-
if (!e) return 0;
|
|
2179
|
-
const i = E(y, e, t);
|
|
2180
|
-
return y(i) <= t ? i + 1 : i;
|
|
2181
|
-
};
|
|
2191
|
+
}, g = t => t >= e ? y() : (f(), p[t]), S = e => (f(), d[e]), y = () => S(e), v = t => K(S, e + 1, t);
|
|
2182
2192
|
return {
|
|
2183
2193
|
$getRange: (t, i) => {
|
|
2184
|
-
const s =
|
|
2185
|
-
return [ w(
|
|
2194
|
+
const s = K(g, e, i);
|
|
2195
|
+
return [ w(v(t), s), s ];
|
|
2186
2196
|
},
|
|
2187
|
-
$
|
|
2188
|
-
$
|
|
2189
|
-
$
|
|
2190
|
-
$
|
|
2191
|
-
|
|
2192
|
-
for (
|
|
2193
|
-
|
|
2194
|
-
const d = S(m);
|
|
2195
|
-
for (const [e, i] of t) p[e] = i, a && a.add(e), l = w(e - 1, l);
|
|
2196
|
-
let h = S(m) - d;
|
|
2197
|
-
if (a && u) {
|
|
2197
|
+
$findIndex: v,
|
|
2198
|
+
$getItemOffset: g,
|
|
2199
|
+
$getItemSize: h,
|
|
2200
|
+
$isSizeEqual: (e, t = -1) => u[e] === t,
|
|
2201
|
+
$setItemSizes: (e, t) => {
|
|
2202
|
+
for (const [t, i] of e) u[t] = i, a && a.add(t), l = w(t - 1, l);
|
|
2203
|
+
if (a && t) {
|
|
2198
2204
|
const e = [];
|
|
2199
|
-
let
|
|
2200
|
-
if (a.forEach(
|
|
2201
|
-
const
|
|
2202
|
-
|
|
2203
|
-
}),
|
|
2204
|
-
|
|
2205
|
-
const t = e.length, i = t / 2 | 0
|
|
2206
|
-
o =
|
|
2205
|
+
let s = 0;
|
|
2206
|
+
if (a.forEach(t => {
|
|
2207
|
+
const n = u[t];
|
|
2208
|
+
-1 !== n && n && (e.push(n), s += n + i);
|
|
2209
|
+
}), s > t * r) {
|
|
2210
|
+
P(e);
|
|
2211
|
+
const t = e.length, i = t / 2 | 0;
|
|
2212
|
+
o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], l = -1, a = void 0, c = !1;
|
|
2207
2213
|
}
|
|
2208
2214
|
}
|
|
2209
|
-
return h;
|
|
2210
2215
|
},
|
|
2211
|
-
$getTotalSize:
|
|
2216
|
+
$getTotalSize: y,
|
|
2212
2217
|
$getLength: () => e,
|
|
2213
2218
|
$setLength: t => {
|
|
2214
2219
|
const i = t - e;
|
|
2215
|
-
|
|
2216
|
-
},
|
|
2217
|
-
$relayout: (e, t = 0, r) => {
|
|
2218
|
-
if ((e = b(e, 1)) === n && t === i) return;
|
|
2219
|
-
const o = z(r), c = S(o);
|
|
2220
|
-
return n = e, i = t, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, S(o) - c;
|
|
2220
|
+
l = w(t - 1, l), e = t, i > 0 ? E(u, i) : u.splice(i);
|
|
2221
2221
|
},
|
|
2222
|
+
$relayout: (e, t = 0) => ((e = b(e, 1)) !== r || t !== i) && (r = e, i = t, l = -1,
|
|
2223
|
+
a = s ? void 0 : /* @__PURE__ */ new Set, !0),
|
|
2222
2224
|
$isEstimating: () => c,
|
|
2223
|
-
$snapshot: () => [
|
|
2224
|
-
$getLanes: () =>
|
|
2225
|
+
$snapshot: () => [ u.slice(), o ],
|
|
2226
|
+
$getLanes: () => r,
|
|
2225
2227
|
$getGap: () => i,
|
|
2226
|
-
$getItemLane: e => (
|
|
2228
|
+
$getItemLane: e => (f(), m[e])
|
|
2227
2229
|
};
|
|
2228
|
-
})(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.
|
|
2229
|
-
this.driver =
|
|
2230
|
-
this.
|
|
2230
|
+
})(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.v = V(t);
|
|
2231
|
+
this.driver = te(i, t, !1), i.$subscribe(1, e => {
|
|
2232
|
+
this.I.set(i.$getStateVersion()), e && this.R.tick();
|
|
2231
2233
|
}), i.$subscribe(4, () => {
|
|
2232
2234
|
this.scrolled.emit(i.$getScrollOffset());
|
|
2233
2235
|
}), i.$subscribe(8, () => {
|
|
2234
2236
|
this.scrollEnded.emit();
|
|
2235
2237
|
}), i.$subscribe(2, () => {
|
|
2236
2238
|
this.resized.emit();
|
|
2237
|
-
}), this.
|
|
2239
|
+
}), this.I.set(i.$getStateVersion());
|
|
2238
2240
|
}
|
|
2239
2241
|
get cache() {
|
|
2240
|
-
return this.
|
|
2242
|
+
return this.N.$snapshot();
|
|
2241
2243
|
}
|
|
2242
2244
|
get scrollOffset() {
|
|
2243
|
-
return this.
|
|
2245
|
+
return this.v.$getScrollOffset();
|
|
2244
2246
|
}
|
|
2245
2247
|
get scrollSize() {
|
|
2246
|
-
return M(this.
|
|
2248
|
+
return M(this.v);
|
|
2247
2249
|
}
|
|
2248
2250
|
get viewportSize() {
|
|
2249
|
-
return this.
|
|
2251
|
+
return this.v.$getViewportSize();
|
|
2250
2252
|
}
|
|
2251
2253
|
getItemOffset(e) {
|
|
2252
|
-
return this.
|
|
2254
|
+
return this.v.$getItemOffset(e);
|
|
2253
2255
|
}
|
|
2254
2256
|
getItemSize(e) {
|
|
2255
|
-
return this.
|
|
2257
|
+
return this.N.$getItemSize(e);
|
|
2256
2258
|
}
|
|
2257
2259
|
scrollToIndex(e, t) {
|
|
2258
|
-
|
|
2260
|
+
ne(this.driver, this.v, this.N, e, t);
|
|
2259
2261
|
}
|
|
2260
2262
|
scrollTo(e) {
|
|
2261
|
-
|
|
2263
|
+
ie(this.driver, e);
|
|
2262
2264
|
}
|
|
2263
2265
|
scrollBy(e) {
|
|
2264
|
-
|
|
2266
|
+
se(this.driver, this.v, e);
|
|
2265
2267
|
}
|
|
2266
2268
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
2267
2269
|
minVersion: "12.0.0",
|
|
@@ -2361,7 +2363,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2361
2363
|
isInline: !0,
|
|
2362
2364
|
dependencies: [ {
|
|
2363
2365
|
kind: "directive",
|
|
2364
|
-
type: e.forwardRef(() =>
|
|
2366
|
+
type: e.forwardRef(() => Se),
|
|
2365
2367
|
selector: "div[virtuaMasonryItem]",
|
|
2366
2368
|
inputs: [ "index", "offset", "crossOffset", "crossSize", "hide", "resizer" ]
|
|
2367
2369
|
}, {
|
|
@@ -2376,5 +2378,5 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2376
2378
|
|
|
2377
2379
|
i.OnPush;
|
|
2378
2380
|
|
|
2379
|
-
export {
|
|
2381
|
+
export { fe as VGrid, ue as VList, ye as VMasonry, ce as Virtualizer, pe as WindowVirtualizer };
|
|
2380
2382
|
//# sourceMappingURL=index.js.map
|