virtua 0.53.3 → 0.53.4
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 +586 -586
- package/lib/angular/index.js.map +1 -1
- package/lib/core/index.cjs +405 -404
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +416 -415
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +645 -645
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +639 -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 +672 -671
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +671 -671
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +165 -214
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/VGrid.svelte +15 -20
- package/lib/svelte/VGrid.type.d.ts +1 -1
- package/lib/svelte/VMasonry.svelte +10 -13
- package/lib/svelte/VMasonry.type.d.ts +1 -1
- package/lib/svelte/Virtualizer.svelte +8 -8
- package/lib/svelte/Virtualizer.type.d.ts +1 -1
- package/lib/svelte/WindowVirtualizer.svelte +5 -7
- 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 +800 -797
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +771 -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,234 @@ 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", $, {
|
|
342
346
|
passive: !0
|
|
343
|
-
}),
|
|
347
|
+
}), i.addEventListener("touchstart", R, {
|
|
344
348
|
passive: !0
|
|
345
|
-
}),
|
|
349
|
+
}), i.addEventListener("touchend", I, {
|
|
346
350
|
passive: !0
|
|
347
351
|
}), {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
p: b,
|
|
353
|
+
u: () => {
|
|
354
|
+
i.removeEventListener("scroll", b), i.removeEventListener("wheel", $), i.removeEventListener("touchstart", R),
|
|
355
|
+
i.removeEventListener("touchend", I), q(c);
|
|
352
356
|
},
|
|
353
|
-
|
|
354
|
-
const [t,
|
|
357
|
+
m: () => {
|
|
358
|
+
const [t, i] = e.i();
|
|
355
359
|
if (!t) return;
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
[
|
|
360
|
+
h && o && o(), h = !1;
|
|
361
|
+
const n = e.$getScrollOffset(), r = n + t, l = e.$getStartSpacerSize() + e.$getTotalSize() - e.$getViewportSize();
|
|
362
|
+
r <= 0 || r >= l || n >= l ? z(r) : s.scrollBy({
|
|
363
|
+
[S]: y(t),
|
|
360
364
|
behavior: "instant"
|
|
361
|
-
}),
|
|
365
|
+
}), i && (a && a(), e.$getViewportSize() > e.$getTotalSize() && e.$update(1, v()));
|
|
362
366
|
},
|
|
363
|
-
|
|
364
|
-
let
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
if (!
|
|
370
|
-
if (e.$getViewportSize() && (q(r), r = x(
|
|
371
|
-
for (let [
|
|
372
|
-
|
|
367
|
+
h: (i, s) => {
|
|
368
|
+
let n, r, o;
|
|
369
|
+
a && a();
|
|
370
|
+
const l = a = () => {
|
|
371
|
+
n = !0, q(r), o && o();
|
|
372
|
+
}, c = () => {
|
|
373
|
+
if (!n) {
|
|
374
|
+
if (e.$getViewportSize() && (q(r), r = x(l, 150)), s) {
|
|
375
|
+
for (let [i, s] = e.$getRange(0); i <= s; i++) if (t.$isSizeEqual(i)) return;
|
|
376
|
+
l();
|
|
373
377
|
}
|
|
374
|
-
e.$update(
|
|
378
|
+
e.$update(8), z(i(), s);
|
|
375
379
|
}
|
|
376
380
|
};
|
|
377
|
-
|
|
378
|
-
if (
|
|
381
|
+
s && e.$update(9, i()), (() => {
|
|
382
|
+
if (n) return;
|
|
379
383
|
let t;
|
|
380
|
-
|
|
384
|
+
o = e.$subscribe(2, () => {
|
|
381
385
|
t || (t = !0, F(() => {
|
|
382
|
-
t = !1,
|
|
386
|
+
t = !1, c();
|
|
383
387
|
}));
|
|
384
|
-
}),
|
|
388
|
+
}), c();
|
|
385
389
|
})();
|
|
386
390
|
}
|
|
387
391
|
};
|
|
388
|
-
},
|
|
389
|
-
let
|
|
390
|
-
const
|
|
391
|
-
const
|
|
392
|
-
for (const {target:
|
|
393
|
-
|
|
394
|
-
const e =
|
|
395
|
-
null != e
|
|
392
|
+
}, te = (e, t, i) => {
|
|
393
|
+
let s, n, r = k(), o = !0;
|
|
394
|
+
const l = /* @__PURE__ */ new WeakMap, a = Z(r => {
|
|
395
|
+
const a = [];
|
|
396
|
+
for (const {target: c, contentRect: {width: u, height: p}} of r) if (c === s) u || p ? (o || n.p(),
|
|
397
|
+
o = !0, e.$update(4, i ? u : p)) : o = !1; else if (c.offsetParent) {
|
|
398
|
+
const e = l.get(c);
|
|
399
|
+
if (null != e) {
|
|
400
|
+
const s = i ? u : p;
|
|
401
|
+
t.$isSizeEqual(e, s) || a.push([ e, s ]);
|
|
402
|
+
}
|
|
396
403
|
}
|
|
397
|
-
|
|
404
|
+
e.$update(3, a);
|
|
398
405
|
});
|
|
399
406
|
return {
|
|
400
|
-
$observe(
|
|
401
|
-
|
|
402
|
-
const e =
|
|
403
|
-
|
|
404
|
-
|
|
407
|
+
$observe(o, l = o.parentElement) {
|
|
408
|
+
a.o(s = l), n = ee(e, t, l, l, i, i && "rtl" === getComputedStyle(l).direction, () => {
|
|
409
|
+
const e = i ? "overflowX" : "overflowY", t = l.style, s = t[e];
|
|
410
|
+
t[e] = "hidden", x(() => {
|
|
411
|
+
t[e] = s;
|
|
405
412
|
});
|
|
406
413
|
}), r[1](!0);
|
|
407
414
|
},
|
|
408
415
|
$dispose() {
|
|
409
|
-
|
|
416
|
+
a.u(), n && n.u(), r[1](!1), r = k();
|
|
410
417
|
},
|
|
411
|
-
$observeItem: (e, t) => (
|
|
412
|
-
|
|
418
|
+
$observeItem: (e, t) => (l.set(e, t), a.o(e), () => {
|
|
419
|
+
l.delete(e), a.l(e);
|
|
413
420
|
}),
|
|
414
421
|
async $scroll(e, t) {
|
|
415
|
-
await r[0] &&
|
|
422
|
+
await r[0] && n.h(e, t);
|
|
416
423
|
},
|
|
417
424
|
$effect() {
|
|
418
|
-
|
|
425
|
+
n && n.m();
|
|
419
426
|
},
|
|
420
427
|
$getBaseOffset: e.$getStartSpacerSize
|
|
421
428
|
};
|
|
422
|
-
},
|
|
429
|
+
}, ie = (e, t) => {
|
|
423
430
|
e.$scroll(() => t);
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
},
|
|
427
|
-
if (
|
|
428
|
-
const e = t.$getItemOffset(
|
|
429
|
-
if (e < r)
|
|
430
|
-
if (!(e +
|
|
431
|
-
|
|
431
|
+
}, se = (e, t, i) => {
|
|
432
|
+
ie(e, i + t.$getScrollOffset());
|
|
433
|
+
}, ne = (e, t, i, s, {align: n, smooth: r, offset: o = 0} = {}) => {
|
|
434
|
+
if (s = I(s, 0, i.$getLength() - 1), "nearest" === n) {
|
|
435
|
+
const e = t.$getItemOffset(s), r = t.$getScrollOffset();
|
|
436
|
+
if (e < r) n = "start"; else {
|
|
437
|
+
if (!(e + i.$getItemSize(s) > r + t.$getViewportSize())) return;
|
|
438
|
+
n = "end";
|
|
432
439
|
}
|
|
433
440
|
}
|
|
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 ===
|
|
441
|
+
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);
|
|
442
|
+
}, re = (e, t, i, s, n, r, o) => {
|
|
443
|
+
const l = i.$getLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
|
|
444
|
+
n = I(n, 0, l - 1);
|
|
445
|
+
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);
|
|
446
|
+
if ("nearest" === r) {
|
|
447
|
+
if (n < a || n >= c) return;
|
|
448
|
+
const e = d(), s = t.$getScrollOffset() + e, o = t.$getViewportSize() - e - h(), l = i.$getItemSize(n);
|
|
449
|
+
let f = t.$getItemOffset(n);
|
|
450
|
+
if (m === n) {
|
|
444
451
|
const e = (p + 1 < u.length ? u[p + 1] : c) - 1;
|
|
445
|
-
|
|
452
|
+
f = b(f, w(s, t.$getItemOffset(e) + i.$getItemSize(e) - l));
|
|
446
453
|
}
|
|
447
|
-
if (
|
|
448
|
-
if (!(
|
|
449
|
-
|
|
454
|
+
if (f < s) r = "start"; else {
|
|
455
|
+
if (!(f + l > s + o)) return;
|
|
456
|
+
r = "end";
|
|
450
457
|
}
|
|
451
458
|
}
|
|
452
459
|
e.$scroll(o, () => {
|
|
453
|
-
const e = d(),
|
|
454
|
-
return t.$getItemOffset(
|
|
460
|
+
const e = d(), s = i.$getItemSize(n) - (t.$getViewportSize() - e - h());
|
|
461
|
+
return t.$getItemOffset(n) - e + ("end" === r ? s : "center" === r ? s / 2 : 0);
|
|
455
462
|
});
|
|
456
|
-
},
|
|
463
|
+
}, oe = class t {
|
|
457
464
|
index=h.required();
|
|
458
465
|
offset=h.required();
|
|
459
466
|
hide=h.required();
|
|
@@ -474,7 +481,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
474
481
|
return e && (s.display = "inline-flex"), s;
|
|
475
482
|
});
|
|
476
483
|
constructor() {
|
|
477
|
-
const e = d(
|
|
484
|
+
const e = d(n).nativeElement;
|
|
478
485
|
let t;
|
|
479
486
|
c({
|
|
480
487
|
read: () => {
|
|
@@ -565,9 +572,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
565
572
|
},
|
|
566
573
|
ngImport: e
|
|
567
574
|
});
|
|
568
|
-
},
|
|
575
|
+
}, le = (e, t) => "_" + t, ae = /*#__PURE__*/ new o("virtua-item-template"), ce = class i {
|
|
569
576
|
data=h.required();
|
|
570
|
-
getKey=h(
|
|
577
|
+
getKey=h(le);
|
|
571
578
|
itemProps=h();
|
|
572
579
|
bufferSize=h();
|
|
573
580
|
scrollRef=h();
|
|
@@ -584,48 +591,48 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
584
591
|
scrollEnded=f();
|
|
585
592
|
resized=f();
|
|
586
593
|
contentTemplate=p(l);
|
|
587
|
-
|
|
594
|
+
S=d(ae, {
|
|
588
595
|
optional: !0
|
|
589
596
|
});
|
|
590
|
-
template=u(() => this.
|
|
591
|
-
S;
|
|
597
|
+
template=u(() => this.S?.() ?? this.contentTemplate());
|
|
592
598
|
v;
|
|
599
|
+
N;
|
|
593
600
|
driver;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
601
|
+
$=d(n).nativeElement;
|
|
602
|
+
R=d(t);
|
|
603
|
+
I=g(void 0);
|
|
597
604
|
isSSR=g(!1);
|
|
598
605
|
P=u(() => {
|
|
599
|
-
this.
|
|
600
|
-
const e = this.data().length, [t, i] = this.
|
|
606
|
+
this.I();
|
|
607
|
+
const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
|
|
601
608
|
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
|
|
609
|
+
const r = new Set(s);
|
|
610
|
+
for (let e = t; e <= i; e++) r.add(e);
|
|
611
|
+
for (const t of P([ ...r ])) t < e && n.push(t);
|
|
612
|
+
} else for (let e = t; e <= i; e++) n.push(e);
|
|
613
|
+
return n;
|
|
607
614
|
});
|
|
608
615
|
items=u(() => {
|
|
609
|
-
this.
|
|
610
|
-
const e = this.
|
|
611
|
-
return this.P().map(
|
|
612
|
-
const
|
|
616
|
+
this.I();
|
|
617
|
+
const e = this.v, t = this.data(), i = this.getKey(), s = this.itemProps();
|
|
618
|
+
return this.P().map(n => {
|
|
619
|
+
const r = t[n];
|
|
613
620
|
return {
|
|
614
|
-
key: i(
|
|
615
|
-
index:
|
|
616
|
-
data:
|
|
617
|
-
offset: e.$getItemOffset(
|
|
618
|
-
hide:
|
|
621
|
+
key: i(r, n),
|
|
622
|
+
index: n,
|
|
623
|
+
data: r,
|
|
624
|
+
offset: e.$getItemOffset(n),
|
|
625
|
+
hide: this.N.$isSizeEqual(n),
|
|
619
626
|
attrs: s?.({
|
|
620
|
-
item:
|
|
621
|
-
index:
|
|
627
|
+
item: r,
|
|
628
|
+
index: n
|
|
622
629
|
})
|
|
623
630
|
};
|
|
624
631
|
});
|
|
625
632
|
});
|
|
626
633
|
containerStyle=u(() => {
|
|
627
|
-
this.
|
|
628
|
-
const e = this.horizontal(), t = this.
|
|
634
|
+
this.I();
|
|
635
|
+
const e = this.horizontal(), t = this.v.$getTotalSize();
|
|
629
636
|
return {
|
|
630
637
|
display: "block",
|
|
631
638
|
contain: "size style",
|
|
@@ -634,71 +641,71 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
634
641
|
position: "relative",
|
|
635
642
|
width: e ? t + "px" : "100%",
|
|
636
643
|
height: e ? "100%" : t + "px",
|
|
637
|
-
"pointer-events": this.
|
|
644
|
+
"pointer-events": this.v.$isScrolling() ? "none" : void 0
|
|
638
645
|
};
|
|
639
646
|
});
|
|
640
647
|
constructor() {
|
|
641
648
|
m(() => {
|
|
642
649
|
const e = this.data().length;
|
|
643
|
-
this.
|
|
650
|
+
this.v && this.v.$update(5, e, S(this.shift));
|
|
644
651
|
}), m(() => {
|
|
645
652
|
const e = this.startMargin();
|
|
646
|
-
this.
|
|
653
|
+
this.v && e !== this.v.$getStartSpacerSize() && this.v.$update(7, e);
|
|
647
654
|
}), a({
|
|
648
655
|
read: () => {
|
|
649
|
-
this.isSSR.set(!1), this.driver.$observe(this
|
|
656
|
+
this.isSSR.set(!1), this.driver.$observe(this.$, this.scrollRef());
|
|
650
657
|
}
|
|
651
658
|
}), c({
|
|
652
659
|
read: () => {
|
|
653
|
-
this.
|
|
660
|
+
this.I(), this.driver.$effect();
|
|
654
661
|
}
|
|
655
662
|
}), d(s).onDestroy(() => {
|
|
656
|
-
this.
|
|
663
|
+
this.v?.$dispose(), this.driver?.$dispose();
|
|
657
664
|
});
|
|
658
665
|
}
|
|
659
666
|
ngOnInit() {
|
|
660
667
|
const e = this.itemSize(), t = this.ssrCount();
|
|
661
668
|
this.isSSR.set(!!t);
|
|
662
|
-
const i = this.
|
|
663
|
-
this.driver =
|
|
664
|
-
this.
|
|
669
|
+
const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
|
|
670
|
+
this.driver = te(s, i, this.horizontal()), s.$subscribe(1, e => {
|
|
671
|
+
this.I.set(s.$getStateVersion()), e && this.R.tick();
|
|
665
672
|
}), s.$subscribe(4, () => {
|
|
666
673
|
this.scrolled.emit(s.$getScrollOffset());
|
|
667
674
|
}), s.$subscribe(8, () => {
|
|
668
675
|
this.scrollEnded.emit();
|
|
669
676
|
}), s.$subscribe(2, () => {
|
|
670
677
|
this.resized.emit();
|
|
671
|
-
}), this.
|
|
678
|
+
}), this.I.set(s.$getStateVersion());
|
|
672
679
|
}
|
|
673
680
|
get cache() {
|
|
674
|
-
return this.
|
|
681
|
+
return this.N.$snapshot();
|
|
675
682
|
}
|
|
676
683
|
get scrollOffset() {
|
|
677
|
-
return this.
|
|
684
|
+
return this.v.$getScrollOffset();
|
|
678
685
|
}
|
|
679
686
|
get scrollSize() {
|
|
680
|
-
return M(this.
|
|
687
|
+
return M(this.v);
|
|
681
688
|
}
|
|
682
689
|
get viewportSize() {
|
|
683
|
-
return this.
|
|
690
|
+
return this.v.$getViewportSize();
|
|
684
691
|
}
|
|
685
692
|
findItemIndex(e) {
|
|
686
|
-
return this.
|
|
693
|
+
return this.N.$findIndex(e - this.v.$getStartSpacerSize());
|
|
687
694
|
}
|
|
688
695
|
getItemOffset(e) {
|
|
689
|
-
return this.
|
|
696
|
+
return this.v.$getItemOffset(e);
|
|
690
697
|
}
|
|
691
698
|
getItemSize(e) {
|
|
692
|
-
return this.
|
|
699
|
+
return this.N.$getItemSize(e);
|
|
693
700
|
}
|
|
694
701
|
scrollToIndex(e, t) {
|
|
695
|
-
|
|
702
|
+
ne(this.driver, this.v, this.N, e, t);
|
|
696
703
|
}
|
|
697
704
|
scrollTo(e) {
|
|
698
|
-
|
|
705
|
+
ie(this.driver, e);
|
|
699
706
|
}
|
|
700
707
|
scrollBy(e) {
|
|
701
|
-
|
|
708
|
+
se(this.driver, this.v, e);
|
|
702
709
|
}
|
|
703
710
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
704
711
|
minVersion: "12.0.0",
|
|
@@ -823,7 +830,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
823
830
|
isInline: !0,
|
|
824
831
|
dependencies: [ {
|
|
825
832
|
kind: "directive",
|
|
826
|
-
type: e.forwardRef(() =>
|
|
833
|
+
type: e.forwardRef(() => oe),
|
|
827
834
|
selector: "div[virtuaListItem]",
|
|
828
835
|
inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
|
|
829
836
|
}, {
|
|
@@ -838,9 +845,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
|
|
|
838
845
|
|
|
839
846
|
i.OnPush;
|
|
840
847
|
|
|
841
|
-
var
|
|
848
|
+
var ue = class t {
|
|
842
849
|
data=h.required();
|
|
843
|
-
getKey=h(
|
|
850
|
+
getKey=h(le);
|
|
844
851
|
itemProps=h();
|
|
845
852
|
bufferSize=h();
|
|
846
853
|
itemSize=h();
|
|
@@ -855,10 +862,10 @@ var ce = class t {
|
|
|
855
862
|
scrollEnded=f();
|
|
856
863
|
resized=f();
|
|
857
864
|
template=p.required(l);
|
|
858
|
-
virtualizer=y.required(
|
|
859
|
-
|
|
865
|
+
virtualizer=y.required(ce);
|
|
866
|
+
$=d(n).nativeElement;
|
|
860
867
|
ngOnInit() {
|
|
861
|
-
const e = this.horizontal(), t = this
|
|
868
|
+
const e = this.horizontal(), t = this.$;
|
|
862
869
|
t.setAttribute("style", `display:block;${e ? "overflow-x" : "overflow-y"}:auto;contain:strict;width:100%;height:100%;` + (t.getAttribute("style") || ""));
|
|
863
870
|
}
|
|
864
871
|
get cache() {
|
|
@@ -993,7 +1000,7 @@ var ce = class t {
|
|
|
993
1000
|
viewQueries: [ {
|
|
994
1001
|
propertyName: "virtualizer",
|
|
995
1002
|
first: !0,
|
|
996
|
-
predicate:
|
|
1003
|
+
predicate: ce,
|
|
997
1004
|
emitDistinctChangesOnly: !1,
|
|
998
1005
|
descendants: !0,
|
|
999
1006
|
isSignal: !0
|
|
@@ -1003,13 +1010,13 @@ var ce = class t {
|
|
|
1003
1010
|
isInline: !0,
|
|
1004
1011
|
dependencies: [ {
|
|
1005
1012
|
kind: "directive",
|
|
1006
|
-
type: e.forwardRef(() =>
|
|
1013
|
+
type: e.forwardRef(() => ce),
|
|
1007
1014
|
selector: "virtua-virtualizer",
|
|
1008
1015
|
inputs: [ "data", "getKey", "itemProps", "bufferSize", "scrollRef", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "startMargin" ],
|
|
1009
1016
|
outputs: [ "scrolled", "scrollEnded", "resized" ]
|
|
1010
1017
|
} ],
|
|
1011
1018
|
viewProviders: [ {
|
|
1012
|
-
provide:
|
|
1019
|
+
provide: ae,
|
|
1013
1020
|
useFactory: () => d(t).template
|
|
1014
1021
|
} ],
|
|
1015
1022
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
@@ -1018,9 +1025,9 @@ var ce = class t {
|
|
|
1018
1025
|
|
|
1019
1026
|
i.OnPush;
|
|
1020
1027
|
|
|
1021
|
-
var
|
|
1028
|
+
var pe = class i {
|
|
1022
1029
|
data=h.required();
|
|
1023
|
-
getKey=h(
|
|
1030
|
+
getKey=h(le);
|
|
1024
1031
|
bufferSize=h();
|
|
1025
1032
|
itemSize=h();
|
|
1026
1033
|
ssrCount=h();
|
|
@@ -1033,31 +1040,31 @@ var ue = class i {
|
|
|
1033
1040
|
scrollEnded=f();
|
|
1034
1041
|
resized=f();
|
|
1035
1042
|
template=p.required(l);
|
|
1036
|
-
S;
|
|
1037
1043
|
v;
|
|
1044
|
+
N;
|
|
1038
1045
|
driver;
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1046
|
+
$=d(n).nativeElement;
|
|
1047
|
+
R=d(t);
|
|
1048
|
+
I=g(void 0);
|
|
1042
1049
|
isSSR=g(!1);
|
|
1043
1050
|
items=u(() => {
|
|
1044
|
-
this.
|
|
1045
|
-
const e = this.
|
|
1046
|
-
for (let o = s; o <=
|
|
1051
|
+
this.I();
|
|
1052
|
+
const e = this.v, t = this.data(), i = this.getKey(), [s, n] = e.$getRange(this.bufferSize()), r = [];
|
|
1053
|
+
for (let o = s; o <= n; o++) {
|
|
1047
1054
|
const s = t[o];
|
|
1048
|
-
|
|
1055
|
+
r.push({
|
|
1049
1056
|
key: i(s, o),
|
|
1050
1057
|
index: o,
|
|
1051
1058
|
data: s,
|
|
1052
1059
|
offset: e.$getItemOffset(o),
|
|
1053
|
-
hide:
|
|
1060
|
+
hide: this.N.$isSizeEqual(o)
|
|
1054
1061
|
});
|
|
1055
1062
|
}
|
|
1056
|
-
return
|
|
1063
|
+
return r;
|
|
1057
1064
|
});
|
|
1058
1065
|
containerStyle=u(() => {
|
|
1059
|
-
this.
|
|
1060
|
-
const e = this.horizontal(), t = this.
|
|
1066
|
+
this.I();
|
|
1067
|
+
const e = this.horizontal(), t = this.v.$getTotalSize();
|
|
1061
1068
|
return {
|
|
1062
1069
|
display: "block",
|
|
1063
1070
|
contain: "size style",
|
|
@@ -1066,95 +1073,98 @@ var ue = class i {
|
|
|
1066
1073
|
position: "relative",
|
|
1067
1074
|
width: e ? t + "px" : "100%",
|
|
1068
1075
|
height: e ? "100%" : t + "px",
|
|
1069
|
-
"pointer-events": this.
|
|
1076
|
+
"pointer-events": this.v.$isScrolling() ? "none" : void 0
|
|
1070
1077
|
};
|
|
1071
1078
|
});
|
|
1072
1079
|
constructor() {
|
|
1073
1080
|
m(() => {
|
|
1074
1081
|
const e = this.data().length;
|
|
1075
|
-
this.
|
|
1082
|
+
this.v && this.v.$update(5, e, S(this.shift));
|
|
1076
1083
|
}), a({
|
|
1077
1084
|
read: () => {
|
|
1078
|
-
this.isSSR.set(!1), this.driver.$observe(this
|
|
1085
|
+
this.isSSR.set(!1), this.driver.$observe(this.$);
|
|
1079
1086
|
}
|
|
1080
1087
|
}), c({
|
|
1081
1088
|
read: () => {
|
|
1082
|
-
this.
|
|
1089
|
+
this.I(), this.driver.$effect();
|
|
1083
1090
|
}
|
|
1084
1091
|
}), d(s).onDestroy(() => {
|
|
1085
|
-
this.
|
|
1092
|
+
this.v?.$dispose(), this.driver?.$dispose();
|
|
1086
1093
|
});
|
|
1087
1094
|
}
|
|
1088
1095
|
ngOnInit() {
|
|
1089
1096
|
const e = this.itemSize(), t = this.ssrCount();
|
|
1090
1097
|
this.isSSR.set(!!t);
|
|
1091
|
-
const i = this.
|
|
1092
|
-
this.driver = ((e, t) => {
|
|
1093
|
-
let
|
|
1094
|
-
const
|
|
1098
|
+
const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
|
|
1099
|
+
this.driver = ((e, t, i) => {
|
|
1100
|
+
let s, n, r, o, l, a = k();
|
|
1101
|
+
const c = /* @__PURE__ */ new WeakMap, u = Z(n => {
|
|
1095
1102
|
const r = [];
|
|
1096
|
-
for (const {target: e, contentRect: {width:
|
|
1097
|
-
const
|
|
1098
|
-
null !=
|
|
1103
|
+
for (const {target: e, contentRect: {width: o, height: a}} of n) if (e === s) l && l(); else if (e.offsetParent) {
|
|
1104
|
+
const s = c.get(e);
|
|
1105
|
+
if (null != s) {
|
|
1106
|
+
const e = i ? o : a;
|
|
1107
|
+
t.$isSizeEqual(s, e) || r.push([ s, e ]);
|
|
1108
|
+
}
|
|
1099
1109
|
}
|
|
1100
|
-
|
|
1110
|
+
e.$update(3, r);
|
|
1101
1111
|
});
|
|
1102
1112
|
return {
|
|
1103
|
-
$observe(
|
|
1104
|
-
const
|
|
1105
|
-
const
|
|
1106
|
-
return e !== i && l ?
|
|
1107
|
-
},
|
|
1108
|
-
e.$update(4,
|
|
1113
|
+
$observe(c) {
|
|
1114
|
+
const p = O(c), m = C(p), d = s = p.scrollingElement, h = i && "rtl" === getComputedStyle(d).direction, f = (e, t, i, s, n = 0) => {
|
|
1115
|
+
const r = s ? "offsetLeft" : "offsetTop", o = n + (h ? t.clientWidth - e[r] - e.offsetWidth : e[r]), l = e.offsetParent;
|
|
1116
|
+
return e !== i && l ? f(l, t, i, s, o) : o;
|
|
1117
|
+
}, g = o = () => f(c, d, p.body, i), S = l = () => {
|
|
1118
|
+
e.$update(4, d[i ? "clientWidth" : "clientHeight"]);
|
|
1109
1119
|
};
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
},
|
|
1120
|
+
m.addEventListener("resize", S), u.o(d), r = () => {
|
|
1121
|
+
m.removeEventListener("resize", S);
|
|
1122
|
+
}, n = ee(e, t, m, d, i, h, null, g), a[1](!0);
|
|
1113
1123
|
},
|
|
1114
1124
|
$dispose() {
|
|
1115
|
-
r && r(),
|
|
1125
|
+
r && r(), u.u(), n && n.u(), a[1](!1), a = k();
|
|
1116
1126
|
},
|
|
1117
|
-
$observeItem: (e, t) => (
|
|
1118
|
-
|
|
1127
|
+
$observeItem: (e, t) => (c.set(e, t), u.o(e), () => {
|
|
1128
|
+
c.delete(e), u.l(e);
|
|
1119
1129
|
}),
|
|
1120
1130
|
async $scroll(e, t) {
|
|
1121
|
-
await
|
|
1131
|
+
await a[0] && n.h(e, t);
|
|
1122
1132
|
},
|
|
1123
1133
|
$effect() {
|
|
1124
|
-
|
|
1134
|
+
n && n.m();
|
|
1125
1135
|
},
|
|
1126
|
-
$getBaseOffset: () =>
|
|
1136
|
+
$getBaseOffset: () => o()
|
|
1127
1137
|
};
|
|
1128
|
-
})(s, this.horizontal()), s.$subscribe(1, e => {
|
|
1129
|
-
this.
|
|
1138
|
+
})(s, i, this.horizontal()), s.$subscribe(1, e => {
|
|
1139
|
+
this.I.set(s.$getStateVersion()), e && this.R.tick();
|
|
1130
1140
|
}), s.$subscribe(4, () => {
|
|
1131
1141
|
this.scrolled.emit();
|
|
1132
1142
|
}), s.$subscribe(8, () => {
|
|
1133
1143
|
this.scrollEnded.emit();
|
|
1134
1144
|
}), s.$subscribe(2, () => {
|
|
1135
1145
|
this.resized.emit();
|
|
1136
|
-
}), this.
|
|
1146
|
+
}), this.I.set(s.$getStateVersion());
|
|
1137
1147
|
}
|
|
1138
1148
|
get cache() {
|
|
1139
|
-
return this.
|
|
1149
|
+
return this.N.$snapshot();
|
|
1140
1150
|
}
|
|
1141
1151
|
get scrollOffset() {
|
|
1142
|
-
return this.
|
|
1152
|
+
return this.v.$getScrollOffset();
|
|
1143
1153
|
}
|
|
1144
1154
|
get viewportSize() {
|
|
1145
|
-
return this.
|
|
1155
|
+
return this.v.$getViewportSize();
|
|
1146
1156
|
}
|
|
1147
1157
|
findItemIndex(e) {
|
|
1148
|
-
return this.
|
|
1158
|
+
return this.N.$findIndex(e - this.v.$getStartSpacerSize());
|
|
1149
1159
|
}
|
|
1150
1160
|
getItemOffset(e) {
|
|
1151
|
-
return this.
|
|
1161
|
+
return this.v.$getItemOffset(e);
|
|
1152
1162
|
}
|
|
1153
1163
|
getItemSize(e) {
|
|
1154
|
-
return this.
|
|
1164
|
+
return this.N.$getItemSize(e);
|
|
1155
1165
|
}
|
|
1156
1166
|
scrollToIndex(e, t) {
|
|
1157
|
-
|
|
1167
|
+
ne(this.driver, this.v, this.N, e, t);
|
|
1158
1168
|
}
|
|
1159
1169
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1160
1170
|
minVersion: "12.0.0",
|
|
@@ -1251,7 +1261,7 @@ var ue = class i {
|
|
|
1251
1261
|
isInline: !0,
|
|
1252
1262
|
dependencies: [ {
|
|
1253
1263
|
kind: "directive",
|
|
1254
|
-
type: e.forwardRef(() =>
|
|
1264
|
+
type: e.forwardRef(() => oe),
|
|
1255
1265
|
selector: "div[virtuaListItem]",
|
|
1256
1266
|
inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
|
|
1257
1267
|
}, {
|
|
@@ -1266,19 +1276,19 @@ var ue = class i {
|
|
|
1266
1276
|
|
|
1267
1277
|
i.OnPush;
|
|
1268
1278
|
|
|
1269
|
-
var
|
|
1279
|
+
var me = class t {
|
|
1270
1280
|
state=h.required();
|
|
1271
1281
|
resizer=h.required();
|
|
1272
1282
|
constructor() {
|
|
1273
|
-
const e = d(
|
|
1274
|
-
let
|
|
1283
|
+
const e = d(n).nativeElement, t = u(() => this.state().$measureRow), i = u(() => this.state().$measureCol);
|
|
1284
|
+
let r;
|
|
1275
1285
|
c({
|
|
1276
1286
|
read: () => {
|
|
1277
|
-
const s = t(),
|
|
1278
|
-
|
|
1287
|
+
const s = t(), n = i();
|
|
1288
|
+
r && r(), r = null == s && null == n ? void 0 : S(this.resizer)(e, s, n);
|
|
1279
1289
|
}
|
|
1280
1290
|
}), d(s).onDestroy(() => {
|
|
1281
|
-
|
|
1291
|
+
r && r();
|
|
1282
1292
|
});
|
|
1283
1293
|
}
|
|
1284
1294
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
@@ -1323,14 +1333,14 @@ var pe = class t {
|
|
|
1323
1333
|
},
|
|
1324
1334
|
ngImport: e
|
|
1325
1335
|
});
|
|
1326
|
-
},
|
|
1336
|
+
}, de = class t {
|
|
1327
1337
|
state=h.required();
|
|
1328
1338
|
template=h.required();
|
|
1329
1339
|
row=h.required();
|
|
1330
1340
|
cols=h.required();
|
|
1331
1341
|
resizer=h.required();
|
|
1332
1342
|
colItem(e) {
|
|
1333
|
-
return
|
|
1343
|
+
return G(this.cols(), e);
|
|
1334
1344
|
}
|
|
1335
1345
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1336
1346
|
minVersion: "12.0.0",
|
|
@@ -1397,7 +1407,7 @@ var pe = class t {
|
|
|
1397
1407
|
isInline: !0,
|
|
1398
1408
|
dependencies: [ {
|
|
1399
1409
|
kind: "directive",
|
|
1400
|
-
type: e.forwardRef(() =>
|
|
1410
|
+
type: e.forwardRef(() => me),
|
|
1401
1411
|
selector: "div[virtuaGridCell]",
|
|
1402
1412
|
inputs: [ "state", "resizer" ]
|
|
1403
1413
|
}, {
|
|
@@ -1408,14 +1418,14 @@ var pe = class t {
|
|
|
1408
1418
|
} ],
|
|
1409
1419
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
1410
1420
|
});
|
|
1411
|
-
},
|
|
1421
|
+
}, he = class t {
|
|
1412
1422
|
state=h.required();
|
|
1413
1423
|
template=h.required();
|
|
1414
1424
|
rows=h.required();
|
|
1415
1425
|
cols=h.required();
|
|
1416
1426
|
resizer=h.required();
|
|
1417
1427
|
rowItem(e) {
|
|
1418
|
-
return
|
|
1428
|
+
return G(this.rows(), e);
|
|
1419
1429
|
}
|
|
1420
1430
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1421
1431
|
minVersion: "12.0.0",
|
|
@@ -1481,13 +1491,13 @@ var pe = class t {
|
|
|
1481
1491
|
isInline: !0,
|
|
1482
1492
|
dependencies: [ {
|
|
1483
1493
|
kind: "directive",
|
|
1484
|
-
type: e.forwardRef(() =>
|
|
1494
|
+
type: e.forwardRef(() => de),
|
|
1485
1495
|
selector: "div[virtuaGridRow]",
|
|
1486
1496
|
inputs: [ "state", "template", "row", "cols", "resizer" ]
|
|
1487
1497
|
} ],
|
|
1488
1498
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
1489
1499
|
});
|
|
1490
|
-
},
|
|
1500
|
+
}, fe = class i {
|
|
1491
1501
|
rows=h.required();
|
|
1492
1502
|
cols=h.required();
|
|
1493
1503
|
rowHeight=h.required();
|
|
@@ -1508,25 +1518,25 @@ var pe = class t {
|
|
|
1508
1518
|
resized=f();
|
|
1509
1519
|
template=p.required(l);
|
|
1510
1520
|
container=y.required("container");
|
|
1511
|
-
I;
|
|
1512
1521
|
q;
|
|
1513
1522
|
F;
|
|
1514
1523
|
k;
|
|
1524
|
+
O;
|
|
1515
1525
|
driver;
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
ariaRowCount=d(new
|
|
1526
|
+
$=d(n).nativeElement;
|
|
1527
|
+
R=d(t);
|
|
1528
|
+
I=g(void 0);
|
|
1529
|
+
ariaRowCount=d(new r("aria-rowcount"), {
|
|
1520
1530
|
optional: !0
|
|
1521
1531
|
});
|
|
1522
|
-
ariaColCount=d(new
|
|
1532
|
+
ariaColCount=d(new r("aria-colcount"), {
|
|
1523
1533
|
optional: !0
|
|
1524
1534
|
});
|
|
1525
|
-
rowCount=u(() => this.
|
|
1526
|
-
colCount=u(() => this.
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1535
|
+
rowCount=u(() => this.I() && this.k.$getLength());
|
|
1536
|
+
colCount=u(() => this.I() && this.O.$getLength());
|
|
1537
|
+
C=u(() => this.k.$getSizes(this.rows(), this.rowHeight()));
|
|
1538
|
+
T=u(() => this.O.$getSizes(this.cols(), this.colWidth()));
|
|
1539
|
+
M=u(() => ((e = N) => {
|
|
1530
1540
|
const t = /* @__PURE__ */ new Map;
|
|
1531
1541
|
for (const i of e) {
|
|
1532
1542
|
const e = i.rowIndex + (i.rowSpan || 1);
|
|
@@ -1537,18 +1547,18 @@ var pe = class t {
|
|
|
1537
1547
|
}
|
|
1538
1548
|
return t;
|
|
1539
1549
|
})(this.spans()));
|
|
1540
|
-
plan=u(() => (this.
|
|
1550
|
+
plan=u(() => (this.I(), ((e, t, [i, s], [n, r], o, l = N, a = N, c) => {
|
|
1541
1551
|
const u = e.$getLength(), p = t.$getLength(), m = e.$getPinnedStart(), d = e.$getTrailStart(), h = t.$getPinnedStart(), f = t.$getTrailStart();
|
|
1542
|
-
i =
|
|
1543
|
-
const g =
|
|
1552
|
+
i = I(i, m, d), s = w(s, d - 1), n = I(n, h, f), r = w(r, f - 1);
|
|
1553
|
+
const g = H(l, m, d), S = b(h - 1, 0), y = [], v = [], z = [];
|
|
1544
1554
|
for (const e of a) e.rowIndex < u && e.colIndex < p && (z.push(e), y.push(e.rowIndex));
|
|
1545
|
-
const $ = z.length, R =
|
|
1555
|
+
const $ = z.length, R = j(g, i, d), x = R < 0 ? -1 : g[R];
|
|
1546
1556
|
x >= 0 && y.push(x);
|
|
1547
|
-
const q =
|
|
1557
|
+
const q = Q(P(y), u, m, i, s, d);
|
|
1548
1558
|
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 =
|
|
1559
|
+
const {rowIndex: o, colIndex: l} = t, a = J(t, u), c = X(t, p);
|
|
1550
1560
|
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,
|
|
1561
|
+
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
1562
|
for (let t = 0; !e && t < $; t++) {
|
|
1553
1563
|
const i = z[t];
|
|
1554
1564
|
e = i.rowIndex >= o && i.rowIndex < a && i.colIndex >= l && i.colIndex < c;
|
|
@@ -1557,57 +1567,57 @@ var pe = class t {
|
|
|
1557
1567
|
}
|
|
1558
1568
|
}
|
|
1559
1569
|
for (const {rowIndex: e, colIndex: t} of z) {
|
|
1560
|
-
const i =
|
|
1570
|
+
const i = j(g, e, d);
|
|
1561
1571
|
y.push(e), i >= 0 && y.push(g[i]), v.push(t);
|
|
1562
1572
|
}
|
|
1563
|
-
|
|
1564
|
-
const F =
|
|
1573
|
+
P(y), P(v);
|
|
1574
|
+
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
1575
|
for (const e of z) {
|
|
1566
|
-
const t =
|
|
1576
|
+
const t = J(e, u), i = X(e, p);
|
|
1567
1577
|
M.push(t), _.push(i);
|
|
1568
1578
|
const s = k.indexOf(e.colIndex);
|
|
1569
|
-
for (let
|
|
1570
|
-
const t = F[
|
|
1571
|
-
for (let
|
|
1579
|
+
for (let n = F.indexOf(e.rowIndex); n < O && F[n] < t; n++) {
|
|
1580
|
+
const t = F[n] * p;
|
|
1581
|
+
for (let n = s; n < C && k[n] < i; n++) T.set(t + k[n], e);
|
|
1572
1582
|
}
|
|
1573
1583
|
}
|
|
1574
1584
|
const V = [];
|
|
1575
1585
|
for (const e of k) V.push(!t.$isMeasurable(e) && null);
|
|
1576
|
-
const E = [],
|
|
1577
|
-
let D =
|
|
1578
|
-
const G =
|
|
1586
|
+
const E = [], K = e.$getItemOffset(m), L = [];
|
|
1587
|
+
let D = L;
|
|
1588
|
+
const G = B.get(e), W = /* @__PURE__ */ new Map;
|
|
1579
1589
|
for (const o of F) {
|
|
1580
|
-
const l = o < m, a = o >= d, y =
|
|
1590
|
+
const l = o < m, a = o >= d, y = j(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
|
|
1581
1591
|
if (o === v) {
|
|
1582
1592
|
const e = l ? m : a ? u : y + 1 < g.length ? g[y + 1] : d;
|
|
1583
1593
|
M.push(e);
|
|
1584
1594
|
const t = [];
|
|
1585
|
-
|
|
1595
|
+
L.push({
|
|
1586
1596
|
$key: l ? -1 : a ? -2 : -3 - v,
|
|
1587
1597
|
$rows: t,
|
|
1588
|
-
$style:
|
|
1598
|
+
$style: U(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
|
|
1589
1599
|
}), 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 ?
|
|
1600
|
+
} else v < 0 && (D = L);
|
|
1601
|
+
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
1602
|
let q = 0, F = !e.$isMeasurable(o) && null, O = o + 1, _ = !1;
|
|
1593
1603
|
for (let e = 0; e < C; e++) {
|
|
1594
|
-
const i = k[e], s = i < h, a = i >= f, m = s || a || i >=
|
|
1604
|
+
const i = k[e], s = i < h, a = i >= f, m = s || a || i >= n && i <= r, d = T.get($ + i);
|
|
1595
1605
|
if (d ? d.rowIndex === o && d.colIndex === i : N && m) {
|
|
1596
|
-
const
|
|
1606
|
+
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
1607
|
let v, N;
|
|
1598
|
-
O = b(O,
|
|
1599
|
-
const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(
|
|
1608
|
+
O = b(O, n);
|
|
1609
|
+
const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(r) : null;
|
|
1600
1610
|
!1 !== F || f || (v = o, F = !0), !1 !== V[e] || g || (N = i, V[e] = !0);
|
|
1601
1611
|
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
1612
|
let T;
|
|
1603
|
-
if (
|
|
1604
|
-
const e =
|
|
1605
|
-
for (;q < e &&
|
|
1606
|
-
q < e &&
|
|
1613
|
+
if (I) {
|
|
1614
|
+
const e = I.length;
|
|
1615
|
+
for (;q < e && I[q].$col < i; ) q++;
|
|
1616
|
+
q < e && I[q].$col === i && (T = I[q]);
|
|
1607
1617
|
}
|
|
1608
1618
|
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
1619
|
let e = "1/l" + i;
|
|
1610
|
-
y && (e += "/l" +
|
|
1620
|
+
y && (e += "/l" + n + "/l" + r);
|
|
1611
1621
|
const t = {
|
|
1612
1622
|
contain: "layout style",
|
|
1613
1623
|
display: "grid",
|
|
@@ -1628,31 +1638,31 @@ var pe = class t {
|
|
|
1628
1638
|
$end: $
|
|
1629
1639
|
}, _ = !0;
|
|
1630
1640
|
}
|
|
1631
|
-
|
|
1641
|
+
P.push(T);
|
|
1632
1642
|
}
|
|
1633
1643
|
}
|
|
1634
|
-
if (E.push(F),
|
|
1635
|
-
const e = R && !_ && R.$cells.length ===
|
|
1644
|
+
if (E.push(F), P.length) {
|
|
1645
|
+
const e = R && !_ && R.$cells.length === P.length && R.$top === w ? R : {
|
|
1636
1646
|
$row: o,
|
|
1637
|
-
$cells:
|
|
1638
|
-
$style:
|
|
1647
|
+
$cells: P,
|
|
1648
|
+
$style: U(o, O, w, "top", 3),
|
|
1639
1649
|
$top: w
|
|
1640
1650
|
};
|
|
1641
|
-
|
|
1651
|
+
W.set(o, e), D.push(e);
|
|
1642
1652
|
}
|
|
1643
1653
|
}
|
|
1644
|
-
return
|
|
1645
|
-
$rowTemplate:
|
|
1646
|
-
$colTemplate:
|
|
1647
|
-
$groups:
|
|
1654
|
+
return B.set(e, W), {
|
|
1655
|
+
$rowTemplate: Y(e, F, E, P(M), "max-content", u),
|
|
1656
|
+
$colTemplate: Y(t, k, V, P(_), "minmax(max-content,auto)", p),
|
|
1657
|
+
$groups: L
|
|
1648
1658
|
};
|
|
1649
|
-
})(this.
|
|
1659
|
+
})(this.k, this.O, this.q.$getRange(this.bufferSize()), this.F.$getRange(this.bufferSize()), this.M(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
|
|
1650
1660
|
rowItem(e) {
|
|
1651
|
-
return
|
|
1661
|
+
return G(this.rows(), e);
|
|
1652
1662
|
}
|
|
1653
1663
|
containerStyle=u(() => {
|
|
1654
|
-
this.
|
|
1655
|
-
const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.
|
|
1664
|
+
this.I();
|
|
1665
|
+
const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.q.$getItemOffset(0), s = this.F.$getItemOffset(0);
|
|
1656
1666
|
return {
|
|
1657
1667
|
contain: "size style",
|
|
1658
1668
|
"overflow-anchor": "none",
|
|
@@ -1663,20 +1673,19 @@ var pe = class t {
|
|
|
1663
1673
|
gap: this.gap() + "px",
|
|
1664
1674
|
"margin-top": i + "px",
|
|
1665
1675
|
"margin-inline-start": s + "px",
|
|
1666
|
-
height: M(this.
|
|
1667
|
-
"pointer-events": this.
|
|
1676
|
+
height: M(this.q) - i + "px",
|
|
1677
|
+
"pointer-events": this.q.$isScrolling() || this.F.$isScrolling() ? "none" : void 0
|
|
1668
1678
|
};
|
|
1669
1679
|
});
|
|
1670
1680
|
constructor() {
|
|
1671
1681
|
m(() => {
|
|
1672
|
-
const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(),
|
|
1673
|
-
if (!this.
|
|
1674
|
-
const o = this.
|
|
1682
|
+
const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), n = this.headerCols(), r = this.footerCols();
|
|
1683
|
+
if (!this.q) return;
|
|
1684
|
+
const o = this.C(), l = this.T();
|
|
1675
1685
|
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()));
|
|
1686
|
+
this.k.$setPinned(i, s), this.O.$setPinned(n, r);
|
|
1687
|
+
const a = D(e), c = D(t);
|
|
1688
|
+
this.q.$update(5, a), this.F.$update(5, c), _(this.q, this.k, o), _(this.F, this.O, l);
|
|
1680
1689
|
});
|
|
1681
1690
|
}), a({
|
|
1682
1691
|
read: () => {
|
|
@@ -1684,115 +1693,115 @@ var pe = class t {
|
|
|
1684
1693
|
}
|
|
1685
1694
|
}), c({
|
|
1686
1695
|
read: () => {
|
|
1687
|
-
this.
|
|
1696
|
+
this.I(), this.driver.$effect();
|
|
1688
1697
|
}
|
|
1689
1698
|
}), d(s).onDestroy(() => {
|
|
1690
|
-
this.
|
|
1699
|
+
this.q?.$dispose(), this.F?.$dispose(), this.driver?.$dispose();
|
|
1691
1700
|
});
|
|
1692
1701
|
}
|
|
1693
1702
|
ngOnInit() {
|
|
1694
|
-
const e = this
|
|
1703
|
+
const e = this.$;
|
|
1695
1704
|
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
|
|
1705
|
+
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);
|
|
1706
|
+
this.driver = ((e, t, i, s) => {
|
|
1707
|
+
let n, r, o, l = k(), a = !0;
|
|
1708
|
+
const c = /* @__PURE__ */ new WeakMap, u = /* @__PURE__ */ new WeakMap, p = Z(l => {
|
|
1709
|
+
const p = [], m = [];
|
|
1710
|
+
for (const {target: d, contentRect: {width: h, height: f}} of l) if (d === n) h || f ? (a || (r.p(),
|
|
1711
|
+
o.p()), a = !0, e.$update(4, f), t.$update(4, h)) : a = !1; else if (d.offsetParent) {
|
|
1712
|
+
const e = c.get(d), t = u.get(d);
|
|
1713
|
+
null == e || i.$isSizeEqual(e, f) || p.push([ e, f ]), null == t || s.$isSizeEqual(t, h) || m.push([ t, h ]);
|
|
1705
1714
|
}
|
|
1706
|
-
|
|
1715
|
+
e.$update(3, p), t.$update(3, m);
|
|
1707
1716
|
});
|
|
1708
1717
|
return {
|
|
1709
1718
|
async $scroll(e, t) {
|
|
1710
|
-
await
|
|
1719
|
+
await l[0] && (e ? o : r).h(t);
|
|
1711
1720
|
},
|
|
1712
|
-
$observe(
|
|
1713
|
-
|
|
1714
|
-
const
|
|
1715
|
-
const e =
|
|
1716
|
-
|
|
1717
|
-
|
|
1721
|
+
$observe(a, c = a.parentElement) {
|
|
1722
|
+
p.o(n = c);
|
|
1723
|
+
const u = (e, t, i) => ee(e, t, c, c, i, i && "rtl" === getComputedStyle(c).direction, () => {
|
|
1724
|
+
const e = i ? "overflowX" : "overflowY", t = c.style, s = t[e];
|
|
1725
|
+
t[e] = "hidden", x(() => {
|
|
1726
|
+
t[e] = s;
|
|
1718
1727
|
});
|
|
1719
1728
|
});
|
|
1720
|
-
|
|
1729
|
+
r = u(e, i, !1), o = u(t, s, !0), l[1](!0);
|
|
1721
1730
|
},
|
|
1722
1731
|
$dispose() {
|
|
1723
|
-
|
|
1732
|
+
p.u(), r && r.u(), o && o.u(), l[1](!1), l = k();
|
|
1724
1733
|
},
|
|
1725
|
-
$observeItem: (e, t, i) => (null != t &&
|
|
1726
|
-
|
|
1727
|
-
|
|
1734
|
+
$observeItem: (e, t, i) => (null != t && c.set(e, t), null != i && u.set(e, i),
|
|
1735
|
+
p.o(e), () => {
|
|
1736
|
+
c.delete(e), u.delete(e), p.l(e);
|
|
1728
1737
|
}),
|
|
1729
1738
|
$effect() {
|
|
1730
|
-
|
|
1739
|
+
r && r.m(), o && o.m();
|
|
1731
1740
|
}
|
|
1732
1741
|
};
|
|
1733
|
-
})(r,
|
|
1742
|
+
})(n, r, i, s);
|
|
1734
1743
|
const o = e => {
|
|
1735
|
-
this.
|
|
1744
|
+
this.I.set(n.$getStateVersion() + r.$getStateVersion()), e && this.R.tick();
|
|
1736
1745
|
};
|
|
1737
|
-
|
|
1746
|
+
n.$subscribe(1, o), r.$subscribe(1, o);
|
|
1738
1747
|
let l = !1;
|
|
1739
|
-
|
|
1740
|
-
l = !0, this.verticalScrolled.emit(
|
|
1741
|
-
}),
|
|
1742
|
-
l = !0, this.horizontalScrolled.emit(
|
|
1748
|
+
n.$subscribe(4, () => {
|
|
1749
|
+
l = !0, this.verticalScrolled.emit(n.$getScrollOffset());
|
|
1750
|
+
}), r.$subscribe(4, () => {
|
|
1751
|
+
l = !0, this.horizontalScrolled.emit(r.$getScrollOffset());
|
|
1743
1752
|
});
|
|
1744
1753
|
const a = () => {
|
|
1745
|
-
!l ||
|
|
1754
|
+
!l || n.$isScrolling() || r.$isScrolling() || (l = !1, this.scrollEnded.emit());
|
|
1746
1755
|
};
|
|
1747
1756
|
let c;
|
|
1748
|
-
|
|
1757
|
+
n.$subscribe(8, a), r.$subscribe(8, a);
|
|
1749
1758
|
const u = () => {
|
|
1750
1759
|
c || (c = !0, F(() => {
|
|
1751
1760
|
c = !1, this.resized.emit();
|
|
1752
1761
|
}));
|
|
1753
1762
|
};
|
|
1754
|
-
|
|
1763
|
+
n.$subscribe(2, u), r.$subscribe(2, u), o();
|
|
1755
1764
|
}
|
|
1756
1765
|
get verticalScrollOffset() {
|
|
1757
|
-
return this.
|
|
1766
|
+
return this.q.$getScrollOffset();
|
|
1758
1767
|
}
|
|
1759
1768
|
get horizontalScrollOffset() {
|
|
1760
|
-
return this.
|
|
1769
|
+
return this.F.$getScrollOffset();
|
|
1761
1770
|
}
|
|
1762
1771
|
get scrollHeight() {
|
|
1763
|
-
return M(this.
|
|
1772
|
+
return M(this.q);
|
|
1764
1773
|
}
|
|
1765
1774
|
get scrollWidth() {
|
|
1766
|
-
return M(this.
|
|
1775
|
+
return M(this.F);
|
|
1767
1776
|
}
|
|
1768
1777
|
get viewportHeight() {
|
|
1769
|
-
return this.
|
|
1778
|
+
return this.q.$getViewportSize();
|
|
1770
1779
|
}
|
|
1771
1780
|
get viewportWidth() {
|
|
1772
|
-
return this.
|
|
1781
|
+
return this.F.$getViewportSize();
|
|
1773
1782
|
}
|
|
1774
1783
|
findRowIndex(e) {
|
|
1775
|
-
return this.
|
|
1784
|
+
return this.k.$findIndex(e);
|
|
1776
1785
|
}
|
|
1777
1786
|
findColIndex(e) {
|
|
1778
|
-
return this.
|
|
1787
|
+
return this.O.$findIndex(e);
|
|
1779
1788
|
}
|
|
1780
1789
|
getRowOffset(e) {
|
|
1781
|
-
return this.
|
|
1790
|
+
return this.q.$getItemOffset(e);
|
|
1782
1791
|
}
|
|
1783
1792
|
getColOffset(e) {
|
|
1784
|
-
return this.
|
|
1793
|
+
return this.F.$getItemOffset(e);
|
|
1785
1794
|
}
|
|
1786
1795
|
getRowSize(e) {
|
|
1787
|
-
return this.
|
|
1796
|
+
return this.k.$getItemSize(e);
|
|
1788
1797
|
}
|
|
1789
1798
|
getColSize(e) {
|
|
1790
|
-
return this.
|
|
1799
|
+
return this.O.$getItemSize(e);
|
|
1791
1800
|
}
|
|
1792
1801
|
scrollToIndex(e) {
|
|
1793
|
-
((e, t, i, s,
|
|
1794
|
-
null != o && re(e, t, s,
|
|
1795
|
-
})(this.driver, this.
|
|
1802
|
+
((e, t, i, s, n, r = N, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
|
|
1803
|
+
null != o && re(e, t, s, r, o, a, !1), null != l && re(e, i, n, N, l, c, !0);
|
|
1804
|
+
})(this.driver, this.q, this.F, this.k, this.O, this.sectionRows(), e);
|
|
1796
1805
|
}
|
|
1797
1806
|
scrollTo({vertical: e, horizontal: t}) {
|
|
1798
1807
|
((e, t, i) => {
|
|
@@ -1800,16 +1809,16 @@ var pe = class t {
|
|
|
1800
1809
|
})(this.driver, e, t);
|
|
1801
1810
|
}
|
|
1802
1811
|
scrollBy({vertical: e, horizontal: t}) {
|
|
1803
|
-
((e, t, i, s,
|
|
1812
|
+
((e, t, i, s, n) => {
|
|
1804
1813
|
if (null != s) {
|
|
1805
1814
|
const i = s + t.$getScrollOffset();
|
|
1806
1815
|
e.$scroll(!1, () => i);
|
|
1807
1816
|
}
|
|
1808
|
-
if (null !=
|
|
1809
|
-
const t =
|
|
1817
|
+
if (null != n) {
|
|
1818
|
+
const t = n + i.$getScrollOffset();
|
|
1810
1819
|
e.$scroll(!0, () => t);
|
|
1811
1820
|
}
|
|
1812
|
-
})(this.driver, this.
|
|
1821
|
+
})(this.driver, this.q, this.F, e, t);
|
|
1813
1822
|
}
|
|
1814
1823
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1815
1824
|
minVersion: "12.0.0",
|
|
@@ -1961,12 +1970,12 @@ var pe = class t {
|
|
|
1961
1970
|
isInline: !0,
|
|
1962
1971
|
dependencies: [ {
|
|
1963
1972
|
kind: "directive",
|
|
1964
|
-
type: e.forwardRef(() =>
|
|
1973
|
+
type: e.forwardRef(() => he),
|
|
1965
1974
|
selector: "div[virtuaGridRowGroup]",
|
|
1966
1975
|
inputs: [ "state", "template", "rows", "cols", "resizer" ]
|
|
1967
1976
|
}, {
|
|
1968
1977
|
kind: "directive",
|
|
1969
|
-
type: e.forwardRef(() =>
|
|
1978
|
+
type: e.forwardRef(() => de),
|
|
1970
1979
|
selector: "div[virtuaGridRow]",
|
|
1971
1980
|
inputs: [ "state", "template", "row", "cols", "resizer" ]
|
|
1972
1981
|
} ],
|
|
@@ -1976,7 +1985,7 @@ var pe = class t {
|
|
|
1976
1985
|
|
|
1977
1986
|
i.OnPush, i.OnPush, i.OnPush;
|
|
1978
1987
|
|
|
1979
|
-
var
|
|
1988
|
+
var ge = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", Se = class t {
|
|
1980
1989
|
index=h.required();
|
|
1981
1990
|
offset=h.required();
|
|
1982
1991
|
crossOffset=h.required();
|
|
@@ -1992,7 +2001,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
1992
2001
|
visibility: this.hide() ? "hidden" : void 0
|
|
1993
2002
|
}));
|
|
1994
2003
|
constructor() {
|
|
1995
|
-
const e = d(
|
|
2004
|
+
const e = d(n).nativeElement;
|
|
1996
2005
|
let t;
|
|
1997
2006
|
c({
|
|
1998
2007
|
read: () => {
|
|
@@ -2068,9 +2077,9 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2068
2077
|
},
|
|
2069
2078
|
ngImport: e
|
|
2070
2079
|
});
|
|
2071
|
-
},
|
|
2080
|
+
}, ye = class i {
|
|
2072
2081
|
data=h.required();
|
|
2073
|
-
getKey=h(
|
|
2082
|
+
getKey=h(le);
|
|
2074
2083
|
lanes=h.required();
|
|
2075
2084
|
gap=h();
|
|
2076
2085
|
itemSize=h();
|
|
@@ -2084,25 +2093,25 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2084
2093
|
resized=f();
|
|
2085
2094
|
template=p.required(l);
|
|
2086
2095
|
container=y.required("container");
|
|
2087
|
-
S;
|
|
2088
2096
|
v;
|
|
2097
|
+
N;
|
|
2089
2098
|
driver;
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2099
|
+
$=d(n).nativeElement;
|
|
2100
|
+
R=d(t);
|
|
2101
|
+
I=g(void 0);
|
|
2093
2102
|
P=u(() => {
|
|
2094
|
-
this.
|
|
2095
|
-
const e = this.data().length, [t, i] = this.
|
|
2103
|
+
this.I();
|
|
2104
|
+
const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
|
|
2096
2105
|
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
|
|
2106
|
+
const r = new Set(s);
|
|
2107
|
+
for (let e = t; e <= i; e++) r.add(e);
|
|
2108
|
+
for (const t of P([ ...r ])) t < e && n.push(t);
|
|
2109
|
+
} else for (let e = t; e <= i; e++) n.push(e);
|
|
2110
|
+
return n;
|
|
2102
2111
|
});
|
|
2103
2112
|
items=u(() => {
|
|
2104
|
-
this.
|
|
2105
|
-
const e = this.
|
|
2113
|
+
this.I();
|
|
2114
|
+
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
2115
|
for (const a of this.P()) {
|
|
2107
2116
|
const c = i[a], u = t.$getItemLane(a);
|
|
2108
2117
|
l.push({
|
|
@@ -2110,32 +2119,32 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2110
2119
|
index: a,
|
|
2111
2120
|
data: c,
|
|
2112
2121
|
offset: e.$getItemOffset(a),
|
|
2113
|
-
crossOffset:
|
|
2122
|
+
crossOffset: ge(u / r, u * n / r),
|
|
2114
2123
|
crossSize: o,
|
|
2115
|
-
hide:
|
|
2124
|
+
hide: t.$isSizeEqual(a)
|
|
2116
2125
|
});
|
|
2117
2126
|
}
|
|
2118
2127
|
return l;
|
|
2119
2128
|
});
|
|
2120
|
-
containerStyle=u(() => (this.
|
|
2129
|
+
containerStyle=u(() => (this.I(), {
|
|
2121
2130
|
contain: "size style",
|
|
2122
2131
|
"overflow-anchor": "none",
|
|
2123
2132
|
flex: "none",
|
|
2124
2133
|
position: "relative",
|
|
2125
2134
|
width: "100%",
|
|
2126
|
-
height: this.
|
|
2127
|
-
"pointer-events": this.
|
|
2135
|
+
height: this.v.$getTotalSize() + "px",
|
|
2136
|
+
"pointer-events": this.v.$isScrolling() ? "none" : void 0
|
|
2128
2137
|
}));
|
|
2129
2138
|
constructor() {
|
|
2130
2139
|
m(() => {
|
|
2131
2140
|
const e = this.data();
|
|
2132
|
-
this.
|
|
2133
|
-
|
|
2141
|
+
this.v && S(() => {
|
|
2142
|
+
this.v.$update(5, e.length);
|
|
2134
2143
|
});
|
|
2135
2144
|
}), m(() => {
|
|
2136
2145
|
const e = this.lanes(), t = this.gap();
|
|
2137
|
-
this.
|
|
2138
|
-
this.
|
|
2146
|
+
this.v && S(() => {
|
|
2147
|
+
_(this.v, this.N, e, t);
|
|
2139
2148
|
});
|
|
2140
2149
|
}), a({
|
|
2141
2150
|
read: () => {
|
|
@@ -2143,125 +2152,116 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2143
2152
|
}
|
|
2144
2153
|
}), c({
|
|
2145
2154
|
read: () => {
|
|
2146
|
-
this.
|
|
2155
|
+
this.I(), this.driver.$effect();
|
|
2147
2156
|
}
|
|
2148
2157
|
}), d(s).onDestroy(() => {
|
|
2149
|
-
this.
|
|
2158
|
+
this.v?.$dispose(), this.driver?.$dispose();
|
|
2150
2159
|
});
|
|
2151
2160
|
}
|
|
2152
2161
|
ngOnInit() {
|
|
2153
|
-
const e = this
|
|
2162
|
+
const e = this.$;
|
|
2154
2163
|
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
|
-
|
|
2164
|
+
const t = this.N = ((e, t, i = 0, s, n) => {
|
|
2165
|
+
let r = b(t, 1), o = n && n[1] || s || 40, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, c = !s;
|
|
2166
|
+
const u = n ? n[0].slice(0, e) : [];
|
|
2167
|
+
E(u, e - u.length);
|
|
2168
|
+
const p = [], m = [], d = [ 0 ], h = e => {
|
|
2169
|
+
const t = u[e];
|
|
2159
2170
|
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
|
|
2171
|
+
}, f = () => {
|
|
2172
|
+
if (l >= e - 1) return;
|
|
2173
|
+
const t = [], s = [];
|
|
2174
|
+
for (let e = 0; e < r; e++) t.push(0), s.push(-1);
|
|
2175
|
+
for (let e = l, n = r; e >= 0 && n; e--) {
|
|
2176
|
+
const r = m[e];
|
|
2177
|
+
-1 === s[r] && (s[r] = e, t[r] = p[e] + h(e) + i, n--);
|
|
2167
2178
|
}
|
|
2168
|
-
for (;l <
|
|
2179
|
+
for (;l < e - 1; ) {
|
|
2169
2180
|
const e = ++l;
|
|
2170
|
-
let
|
|
2171
|
-
for (let e = 0; e <
|
|
2172
|
-
const
|
|
2173
|
-
(
|
|
2181
|
+
let n = 0, o = 1 / 0, a = 1 / 0;
|
|
2182
|
+
for (let e = 0; e < r; e++) {
|
|
2183
|
+
const i = t[e];
|
|
2184
|
+
(i < o || i === o && s[e] < a) && (n = e, o = i, a = s[e]);
|
|
2174
2185
|
}
|
|
2175
|
-
|
|
2186
|
+
const c = o + h(e);
|
|
2187
|
+
p[e] = o, m[e] = n, t[n] = c + i, s[n] = e, d[e + 1] = b(d[e], c);
|
|
2176
2188
|
}
|
|
2177
|
-
},
|
|
2178
|
-
if (!e) return 0;
|
|
2179
|
-
const i = E(y, e, t);
|
|
2180
|
-
return y(i) <= t ? i + 1 : i;
|
|
2181
|
-
};
|
|
2189
|
+
}, g = t => t >= e ? y() : (f(), p[t]), S = e => (f(), d[e]), y = () => S(e), v = t => K(S, e + 1, t);
|
|
2182
2190
|
return {
|
|
2183
2191
|
$getRange: (t, i) => {
|
|
2184
|
-
const s =
|
|
2185
|
-
return [ w(
|
|
2192
|
+
const s = K(g, e, i);
|
|
2193
|
+
return [ w(v(t), s), s ];
|
|
2186
2194
|
},
|
|
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) {
|
|
2195
|
+
$findIndex: v,
|
|
2196
|
+
$getItemOffset: g,
|
|
2197
|
+
$getItemSize: h,
|
|
2198
|
+
$isSizeEqual: (e, t = -1) => u[e] === t,
|
|
2199
|
+
$setItemSizes: (e, t) => {
|
|
2200
|
+
for (const [t, i] of e) u[t] = i, a && a.add(t), l = w(t - 1, l);
|
|
2201
|
+
if (a && t) {
|
|
2198
2202
|
const e = [];
|
|
2199
|
-
let
|
|
2200
|
-
if (a.forEach(
|
|
2201
|
-
const
|
|
2202
|
-
|
|
2203
|
-
}),
|
|
2204
|
-
|
|
2205
|
-
const t = e.length, i = t / 2 | 0
|
|
2206
|
-
o =
|
|
2203
|
+
let s = 0;
|
|
2204
|
+
if (a.forEach(t => {
|
|
2205
|
+
const n = u[t];
|
|
2206
|
+
-1 !== n && n && (e.push(n), s += n + i);
|
|
2207
|
+
}), s > t * r) {
|
|
2208
|
+
P(e);
|
|
2209
|
+
const t = e.length, i = t / 2 | 0;
|
|
2210
|
+
o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], l = -1, a = void 0, c = !1;
|
|
2207
2211
|
}
|
|
2208
2212
|
}
|
|
2209
|
-
return h;
|
|
2210
2213
|
},
|
|
2211
|
-
$getTotalSize:
|
|
2214
|
+
$getTotalSize: y,
|
|
2212
2215
|
$getLength: () => e,
|
|
2213
2216
|
$setLength: t => {
|
|
2214
2217
|
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;
|
|
2218
|
+
l = w(t - 1, l), e = t, i > 0 ? E(u, i) : u.splice(i);
|
|
2221
2219
|
},
|
|
2220
|
+
$relayout: (e, t = 0) => ((e = b(e, 1)) !== r || t !== i) && (r = e, i = t, l = -1,
|
|
2221
|
+
a = s ? void 0 : /* @__PURE__ */ new Set, !0),
|
|
2222
2222
|
$isEstimating: () => c,
|
|
2223
|
-
$snapshot: () => [
|
|
2224
|
-
$getLanes: () =>
|
|
2223
|
+
$snapshot: () => [ u.slice(), o ],
|
|
2224
|
+
$getLanes: () => r,
|
|
2225
2225
|
$getGap: () => i,
|
|
2226
|
-
$getItemLane: e => (
|
|
2226
|
+
$getItemLane: e => (f(), m[e])
|
|
2227
2227
|
};
|
|
2228
|
-
})(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.
|
|
2229
|
-
this.driver =
|
|
2230
|
-
this.
|
|
2228
|
+
})(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.v = V(t);
|
|
2229
|
+
this.driver = te(i, t, !1), i.$subscribe(1, e => {
|
|
2230
|
+
this.I.set(i.$getStateVersion()), e && this.R.tick();
|
|
2231
2231
|
}), i.$subscribe(4, () => {
|
|
2232
2232
|
this.scrolled.emit(i.$getScrollOffset());
|
|
2233
2233
|
}), i.$subscribe(8, () => {
|
|
2234
2234
|
this.scrollEnded.emit();
|
|
2235
2235
|
}), i.$subscribe(2, () => {
|
|
2236
2236
|
this.resized.emit();
|
|
2237
|
-
}), this.
|
|
2237
|
+
}), this.I.set(i.$getStateVersion());
|
|
2238
2238
|
}
|
|
2239
2239
|
get cache() {
|
|
2240
|
-
return this.
|
|
2240
|
+
return this.N.$snapshot();
|
|
2241
2241
|
}
|
|
2242
2242
|
get scrollOffset() {
|
|
2243
|
-
return this.
|
|
2243
|
+
return this.v.$getScrollOffset();
|
|
2244
2244
|
}
|
|
2245
2245
|
get scrollSize() {
|
|
2246
|
-
return M(this.
|
|
2246
|
+
return M(this.v);
|
|
2247
2247
|
}
|
|
2248
2248
|
get viewportSize() {
|
|
2249
|
-
return this.
|
|
2249
|
+
return this.v.$getViewportSize();
|
|
2250
2250
|
}
|
|
2251
2251
|
getItemOffset(e) {
|
|
2252
|
-
return this.
|
|
2252
|
+
return this.v.$getItemOffset(e);
|
|
2253
2253
|
}
|
|
2254
2254
|
getItemSize(e) {
|
|
2255
|
-
return this.
|
|
2255
|
+
return this.N.$getItemSize(e);
|
|
2256
2256
|
}
|
|
2257
2257
|
scrollToIndex(e, t) {
|
|
2258
|
-
|
|
2258
|
+
ne(this.driver, this.v, this.N, e, t);
|
|
2259
2259
|
}
|
|
2260
2260
|
scrollTo(e) {
|
|
2261
|
-
|
|
2261
|
+
ie(this.driver, e);
|
|
2262
2262
|
}
|
|
2263
2263
|
scrollBy(e) {
|
|
2264
|
-
|
|
2264
|
+
se(this.driver, this.v, e);
|
|
2265
2265
|
}
|
|
2266
2266
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
2267
2267
|
minVersion: "12.0.0",
|
|
@@ -2361,7 +2361,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2361
2361
|
isInline: !0,
|
|
2362
2362
|
dependencies: [ {
|
|
2363
2363
|
kind: "directive",
|
|
2364
|
-
type: e.forwardRef(() =>
|
|
2364
|
+
type: e.forwardRef(() => Se),
|
|
2365
2365
|
selector: "div[virtuaMasonryItem]",
|
|
2366
2366
|
inputs: [ "index", "offset", "crossOffset", "crossSize", "hide", "resizer" ]
|
|
2367
2367
|
}, {
|
|
@@ -2376,5 +2376,5 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
|
|
|
2376
2376
|
|
|
2377
2377
|
i.OnPush;
|
|
2378
2378
|
|
|
2379
|
-
export {
|
|
2379
|
+
export { fe as VGrid, ue as VList, ye as VMasonry, ce as Virtualizer, pe as WindowVirtualizer };
|
|
2380
2380
|
//# sourceMappingURL=index.js.map
|