virtua 0.52.2 → 0.52.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 +1 -1
- package/lib/angular/index.js +113 -124
- package/lib/angular/index.js.map +1 -1
- package/lib/core/index.cjs +112 -123
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +90 -101
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +155 -166
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +167 -178
- package/lib/index.js.map +1 -1
- package/lib/solid/index.cjs +173 -184
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +181 -192
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +32 -53
- package/lib/solid/index.jsx.map +1 -1
- package/lib/vue/index.cjs +101 -112
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +101 -112
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> A zero-config, fast and small virtual list and grid component for [React](https://github.com/facebook/react), [Vue](https://vuejs.org/), [Solid](https://www.solidjs.com/), [Svelte](https://svelte.dev/) and [Angular](https://angular.dev/).
|
|
6
6
|
|
|
7
|
-

|
|
7
|
+
 
|
|
8
8
|
|
|
9
9
|
If you want to check the difference with the alternatives right away, [see comparison section](#comparison).
|
|
10
10
|
|
package/lib/angular/index.js
CHANGED
|
@@ -245,11 +245,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
245
245
|
t.$setPinned(r, n), l !== e.$getItemsLength() && e.$update(5, [ l ]);
|
|
246
246
|
const a = t.$setAxis(i, s, e.$getScrollOffset() - e.$getItemOffset(0), o);
|
|
247
247
|
null != a && e.$update(9, a);
|
|
248
|
-
}, H = /*#__PURE__*/ new WeakMap, A = (e, t, i, s, r, n,
|
|
249
|
-
if (t < s || b(t, r) < $(i, n + 1) || o < i) return !0;
|
|
250
|
-
for (const s of e) if (s >= t && s < i) return !0;
|
|
251
|
-
return !1;
|
|
252
|
-
}, B = (e, t, i) => {
|
|
248
|
+
}, H = /*#__PURE__*/ new WeakMap, A = (e, t, i, s, r, n) => e < i || b(e, s) < $(t, r + 1) || n < t, B = (e, t, i) => {
|
|
253
249
|
const s = [];
|
|
254
250
|
for (const r of e) r >= t && r < i && s.push(r);
|
|
255
251
|
return P(s);
|
|
@@ -261,25 +257,22 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
261
257
|
e[i] <= t ? s = i + 1 : r = i;
|
|
262
258
|
}
|
|
263
259
|
return s - 1;
|
|
264
|
-
}, J = (e, t, i, s) => {
|
|
265
|
-
const r = j(t, i, s);
|
|
266
|
-
r >= 0 && e.push(t[r]);
|
|
267
|
-
}, Q = (e, t, i, s, r) => {
|
|
260
|
+
}, J = (e, t, i, s, r) => {
|
|
268
261
|
const n = t.length;
|
|
269
262
|
for (;i < n && t[i] < s; i++) {
|
|
270
263
|
const s = t[i];
|
|
271
264
|
s > r && (e.push(s), r = s);
|
|
272
265
|
}
|
|
273
266
|
return i;
|
|
274
|
-
},
|
|
267
|
+
}, Q = (e, t, i, s, r, n) => {
|
|
275
268
|
const o = [];
|
|
276
269
|
for (let e = 0; e < i; e++) o.push(e);
|
|
277
|
-
const l =
|
|
270
|
+
const l = J(o, e, 0, s, i - 1);
|
|
278
271
|
for (let e = s; e <= r; e++) o.push(e);
|
|
279
|
-
|
|
272
|
+
J(o, e, l, n, r);
|
|
280
273
|
for (let e = n; e < t; e++) o.push(e);
|
|
281
274
|
return o;
|
|
282
|
-
},
|
|
275
|
+
}, X = (e, t) => $(e.rowIndex + (e.rowSpan || 1), t), Y = (e, t) => $(e.colIndex + (e.colSpan || 1), t), U = (e, t, i, s, r, n) => {
|
|
283
276
|
const o = t.length, l = s.length;
|
|
284
277
|
let a = "[l0]", c = 0, u = 0, p = 0;
|
|
285
278
|
for (;c < n; ) {
|
|
@@ -295,7 +288,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
295
288
|
a += " " + h + " [l" + d + "]", c = d;
|
|
296
289
|
}
|
|
297
290
|
return a;
|
|
298
|
-
},
|
|
291
|
+
}, Z = (e, t, i, s, r) => {
|
|
299
292
|
const n = {
|
|
300
293
|
display: "grid",
|
|
301
294
|
gridTemplateRows: "subgrid",
|
|
@@ -304,7 +297,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
304
297
|
gridRow: "l" + e + "/l" + t
|
|
305
298
|
};
|
|
306
299
|
return null != i && (n.position = "sticky", n[s] = i + "px", n.zIndex = r), n;
|
|
307
|
-
},
|
|
300
|
+
}, ee = e => {
|
|
308
301
|
let t;
|
|
309
302
|
return {
|
|
310
303
|
i(i) {
|
|
@@ -317,7 +310,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
317
310
|
t && t.disconnect();
|
|
318
311
|
}
|
|
319
312
|
};
|
|
320
|
-
},
|
|
313
|
+
}, te = (e, t, i, s, r, n, o) => {
|
|
321
314
|
let l, a, c = 0, u = !1, p = !1, m = !1, d = !1;
|
|
322
315
|
const h = Date.now, f = s ? "scrollLeft" : "scrollTop", g = s ? "left" : "top", S = e => r ? -e : e, y = () => S(i[f]), v = (e, t) => {
|
|
323
316
|
i.scrollTo({
|
|
@@ -386,9 +379,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
386
379
|
i ? (e.$update(8, t()), F(c)) : c();
|
|
387
380
|
}
|
|
388
381
|
};
|
|
389
|
-
},
|
|
382
|
+
}, ie = (e, t) => {
|
|
390
383
|
e.$scroll(() => t);
|
|
391
|
-
},
|
|
384
|
+
}, se = (e, t, i, {align: s, smooth: r, offset: n = 0} = {}) => {
|
|
392
385
|
if (i = I(i, 0, t.$getItemsLength() - 1), "nearest" === s) {
|
|
393
386
|
const e = t.$getItemOffset(i), r = t.$getScrollOffset();
|
|
394
387
|
if (e < r) s = "start"; else {
|
|
@@ -397,10 +390,10 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
397
390
|
}
|
|
398
391
|
}
|
|
399
392
|
e.$scroll(() => n + e.$getBaseOffset() + t.$getItemOffset(i) + ("end" === s ? t.$getItemSize(i) - t.$getViewportSize() : "center" === s ? (t.$getItemSize(i) - t.$getViewportSize()) / 2 : 0), r);
|
|
400
|
-
},
|
|
393
|
+
}, re = (e, t, i, s, r, n, o) => {
|
|
401
394
|
const l = t.$getItemsLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
|
|
402
395
|
r = I(r, 0, l - 1);
|
|
403
|
-
const u = B(s, a, c), p = j(u, r, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === r ? 0 :
|
|
396
|
+
const u = B(s, a, c), p = j(u, r, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === r ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
|
|
404
397
|
if ("nearest" === n) {
|
|
405
398
|
if (r < a || r >= c) return;
|
|
406
399
|
const e = d(), i = t.$getScrollOffset() + e, s = t.$getViewportSize() - e - h(), o = t.$getItemSize(r);
|
|
@@ -418,7 +411,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
418
411
|
const e = d(), i = t.$getItemSize(r) - (t.$getViewportSize() - e - h());
|
|
419
412
|
return t.$getItemOffset(r) - e + ("end" === n ? i : "center" === n ? i / 2 : 0);
|
|
420
413
|
});
|
|
421
|
-
},
|
|
414
|
+
}, ne = class t {
|
|
422
415
|
index=h.required();
|
|
423
416
|
offset=h.required();
|
|
424
417
|
hide=h.required();
|
|
@@ -530,9 +523,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
530
523
|
},
|
|
531
524
|
ngImport: e
|
|
532
525
|
});
|
|
533
|
-
},
|
|
526
|
+
}, oe = (e, t) => "_" + t, le = /*#__PURE__*/ new o("virtua-item-template"), ae = class i {
|
|
534
527
|
data=h.required();
|
|
535
|
-
getKey=h(
|
|
528
|
+
getKey=h(oe);
|
|
536
529
|
itemProps=h();
|
|
537
530
|
bufferSize=h();
|
|
538
531
|
scrollRef=h();
|
|
@@ -548,7 +541,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
548
541
|
scrolled=f();
|
|
549
542
|
scrollEnded=f();
|
|
550
543
|
contentTemplate=p(l);
|
|
551
|
-
m=d(
|
|
544
|
+
m=d(le, {
|
|
552
545
|
optional: !0
|
|
553
546
|
});
|
|
554
547
|
template=u(() => this.m?.() ?? this.contentTemplate());
|
|
@@ -626,7 +619,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
626
619
|
const i = this.S = L(this.data().length, e, this.cacheProp()), s = this.h = _(i, t);
|
|
627
620
|
this.driver = ((e, t) => {
|
|
628
621
|
let i, s, r = k();
|
|
629
|
-
const n = /* @__PURE__ */ new WeakMap, o =
|
|
622
|
+
const n = /* @__PURE__ */ new WeakMap, o = ee(s => {
|
|
630
623
|
const r = [];
|
|
631
624
|
for (const {target: o, contentRect: {width: l, height: a}} of s) if (o === i) (l || a) && e.$update(4, t ? l : a); else if (o.offsetParent) {
|
|
632
625
|
const e = n.get(o);
|
|
@@ -636,7 +629,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
636
629
|
});
|
|
637
630
|
return {
|
|
638
631
|
$observe(n, l = n.parentElement) {
|
|
639
|
-
o.i(i = l), s =
|
|
632
|
+
o.i(i = l), s = te(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
|
|
640
633
|
const e = t ? "overflowX" : "overflowY", i = l.style, s = i[e];
|
|
641
634
|
i[e] = "hidden", x(() => {
|
|
642
635
|
i[e] = s;
|
|
@@ -687,14 +680,14 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
687
680
|
return this.h.$getItemSize(e);
|
|
688
681
|
}
|
|
689
682
|
scrollToIndex(e, t) {
|
|
690
|
-
|
|
683
|
+
se(this.driver, this.h, e, t);
|
|
691
684
|
}
|
|
692
685
|
scrollTo(e) {
|
|
693
|
-
|
|
686
|
+
ie(this.driver, e);
|
|
694
687
|
}
|
|
695
688
|
scrollBy(e) {
|
|
696
689
|
((e, t, i) => {
|
|
697
|
-
|
|
690
|
+
ie(e, i + t.$getScrollOffset());
|
|
698
691
|
})(this.driver, this.h, e);
|
|
699
692
|
}
|
|
700
693
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
@@ -819,7 +812,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
819
812
|
isInline: !0,
|
|
820
813
|
dependencies: [ {
|
|
821
814
|
kind: "directive",
|
|
822
|
-
type: e.forwardRef(() =>
|
|
815
|
+
type: e.forwardRef(() => ne),
|
|
823
816
|
selector: "div[virtuaListItem]",
|
|
824
817
|
inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
|
|
825
818
|
}, {
|
|
@@ -834,9 +827,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
|
|
|
834
827
|
|
|
835
828
|
i.OnPush;
|
|
836
829
|
|
|
837
|
-
var
|
|
830
|
+
var ce = class t {
|
|
838
831
|
data=h.required();
|
|
839
|
-
getKey=h(
|
|
832
|
+
getKey=h(oe);
|
|
840
833
|
itemProps=h();
|
|
841
834
|
bufferSize=h();
|
|
842
835
|
itemSize=h();
|
|
@@ -850,7 +843,7 @@ var ue = class t {
|
|
|
850
843
|
scrolled=f();
|
|
851
844
|
scrollEnded=f();
|
|
852
845
|
template=p.required(l);
|
|
853
|
-
virtualizer=y.required(
|
|
846
|
+
virtualizer=y.required(ae);
|
|
854
847
|
v=d(r).nativeElement;
|
|
855
848
|
ngOnInit() {
|
|
856
849
|
const e = this.horizontal(), t = this.v;
|
|
@@ -987,7 +980,7 @@ var ue = class t {
|
|
|
987
980
|
viewQueries: [ {
|
|
988
981
|
propertyName: "virtualizer",
|
|
989
982
|
first: !0,
|
|
990
|
-
predicate:
|
|
983
|
+
predicate: ae,
|
|
991
984
|
emitDistinctChangesOnly: !1,
|
|
992
985
|
descendants: !0,
|
|
993
986
|
isSignal: !0
|
|
@@ -997,13 +990,13 @@ var ue = class t {
|
|
|
997
990
|
isInline: !0,
|
|
998
991
|
dependencies: [ {
|
|
999
992
|
kind: "directive",
|
|
1000
|
-
type: e.forwardRef(() =>
|
|
993
|
+
type: e.forwardRef(() => ae),
|
|
1001
994
|
selector: "virtua-virtualizer",
|
|
1002
995
|
inputs: [ "data", "getKey", "itemProps", "bufferSize", "scrollRef", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "startMargin" ],
|
|
1003
996
|
outputs: [ "scrolled", "scrollEnded" ]
|
|
1004
997
|
} ],
|
|
1005
998
|
viewProviders: [ {
|
|
1006
|
-
provide:
|
|
999
|
+
provide: le,
|
|
1007
1000
|
useFactory: () => d(t).template
|
|
1008
1001
|
} ],
|
|
1009
1002
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
@@ -1012,9 +1005,9 @@ var ue = class t {
|
|
|
1012
1005
|
|
|
1013
1006
|
i.OnPush;
|
|
1014
1007
|
|
|
1015
|
-
var
|
|
1008
|
+
var ue = class i {
|
|
1016
1009
|
data=h.required();
|
|
1017
|
-
getKey=h(
|
|
1010
|
+
getKey=h(oe);
|
|
1018
1011
|
bufferSize=h();
|
|
1019
1012
|
itemSize=h();
|
|
1020
1013
|
ssrCount=h();
|
|
@@ -1084,7 +1077,7 @@ var pe = class i {
|
|
|
1084
1077
|
const i = this.S = L(this.data().length, e, this.cacheProp()), s = this.h = _(i, t);
|
|
1085
1078
|
this.driver = ((e, t) => {
|
|
1086
1079
|
let i, s, r, n, o, l = k();
|
|
1087
|
-
const a = /* @__PURE__ */ new WeakMap, c =
|
|
1080
|
+
const a = /* @__PURE__ */ new WeakMap, c = ee(s => {
|
|
1088
1081
|
const r = [];
|
|
1089
1082
|
for (const {target: e, contentRect: {width: n, height: l}} of s) if (e === i) o && o(); else if (e.offsetParent) {
|
|
1090
1083
|
const i = a.get(e);
|
|
@@ -1102,7 +1095,7 @@ var pe = class i {
|
|
|
1102
1095
|
};
|
|
1103
1096
|
p.addEventListener("resize", g), c.i(m), r = () => {
|
|
1104
1097
|
p.removeEventListener("resize", g);
|
|
1105
|
-
}, s =
|
|
1098
|
+
}, s = te(e, p, m, t, d, null, f), l[1](!0);
|
|
1106
1099
|
},
|
|
1107
1100
|
$dispose() {
|
|
1108
1101
|
r && r(), c.l(), s && s.l(), l[1](!1), l = k();
|
|
@@ -1145,7 +1138,7 @@ var pe = class i {
|
|
|
1145
1138
|
return this.h.$getItemSize(e);
|
|
1146
1139
|
}
|
|
1147
1140
|
scrollToIndex(e, t) {
|
|
1148
|
-
|
|
1141
|
+
se(this.driver, this.h, e, t);
|
|
1149
1142
|
}
|
|
1150
1143
|
static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
|
|
1151
1144
|
minVersion: "12.0.0",
|
|
@@ -1241,7 +1234,7 @@ var pe = class i {
|
|
|
1241
1234
|
isInline: !0,
|
|
1242
1235
|
dependencies: [ {
|
|
1243
1236
|
kind: "directive",
|
|
1244
|
-
type: e.forwardRef(() =>
|
|
1237
|
+
type: e.forwardRef(() => ne),
|
|
1245
1238
|
selector: "div[virtuaListItem]",
|
|
1246
1239
|
inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
|
|
1247
1240
|
}, {
|
|
@@ -1256,7 +1249,7 @@ var pe = class i {
|
|
|
1256
1249
|
|
|
1257
1250
|
i.OnPush;
|
|
1258
1251
|
|
|
1259
|
-
var
|
|
1252
|
+
var pe = class t {
|
|
1260
1253
|
state=h.required();
|
|
1261
1254
|
resizer=h.required();
|
|
1262
1255
|
constructor() {
|
|
@@ -1313,7 +1306,7 @@ var me = class t {
|
|
|
1313
1306
|
},
|
|
1314
1307
|
ngImport: e
|
|
1315
1308
|
});
|
|
1316
|
-
},
|
|
1309
|
+
}, me = class t {
|
|
1317
1310
|
state=h.required();
|
|
1318
1311
|
template=h.required();
|
|
1319
1312
|
row=h.required();
|
|
@@ -1387,7 +1380,7 @@ var me = class t {
|
|
|
1387
1380
|
isInline: !0,
|
|
1388
1381
|
dependencies: [ {
|
|
1389
1382
|
kind: "directive",
|
|
1390
|
-
type: e.forwardRef(() =>
|
|
1383
|
+
type: e.forwardRef(() => pe),
|
|
1391
1384
|
selector: "div[virtuaGridCell]",
|
|
1392
1385
|
inputs: [ "state", "resizer" ]
|
|
1393
1386
|
}, {
|
|
@@ -1398,7 +1391,7 @@ var me = class t {
|
|
|
1398
1391
|
} ],
|
|
1399
1392
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
1400
1393
|
});
|
|
1401
|
-
},
|
|
1394
|
+
}, de = class t {
|
|
1402
1395
|
state=h.required();
|
|
1403
1396
|
template=h.required();
|
|
1404
1397
|
rows=h.required();
|
|
@@ -1471,13 +1464,13 @@ var me = class t {
|
|
|
1471
1464
|
isInline: !0,
|
|
1472
1465
|
dependencies: [ {
|
|
1473
1466
|
kind: "directive",
|
|
1474
|
-
type: e.forwardRef(() =>
|
|
1467
|
+
type: e.forwardRef(() => me),
|
|
1475
1468
|
selector: "div[virtuaGridRow]",
|
|
1476
1469
|
inputs: [ "state", "template", "row", "cols", "resizer" ]
|
|
1477
1470
|
} ],
|
|
1478
1471
|
changeDetection: e.ChangeDetectionStrategy.OnPush
|
|
1479
1472
|
});
|
|
1480
|
-
},
|
|
1473
|
+
}, he = class i {
|
|
1481
1474
|
rows=h.required();
|
|
1482
1475
|
cols=h.required();
|
|
1483
1476
|
rowHeight=h.required();
|
|
@@ -1516,112 +1509,108 @@ var me = class t {
|
|
|
1516
1509
|
plan=u(() => (this.N(), ((e, t, i, s, r = z, n = z, o = z, l) => {
|
|
1517
1510
|
const a = e.$getLength(), c = t.$getLength(), u = e.$getPinnedStart(), p = e.$getTrailStart(), m = t.$getPinnedStart(), d = t.$getTrailStart(), h = I(i[0], u, p), f = $(i[1], p - 1), g = I(s[0], m, d), S = $(s[1], d - 1), y = B(r, u, p), v = b(m - 1, 0), w = [], N = [], R = [];
|
|
1518
1511
|
for (const e of o) e.rowIndex < a && e.colIndex < c && R.push(e);
|
|
1519
|
-
const x = y.length;
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
for (const t of q) {
|
|
1529
|
-
const i = t.rowIndex, s = t.colIndex, r = Y(t, a), n = U(t, c);
|
|
1530
|
-
if (i < a && s < c && (r - i > 1 || n - s > 1)) {
|
|
1531
|
-
const o = A(w, i, r, u, h, f, p);
|
|
1532
|
-
if (o && A(N, s, n, m, g, S, d)) R.push(t); else if (o) {
|
|
1533
|
-
const s = j(y, r - 1, p);
|
|
1534
|
-
(i < u || s >= 0 && y[s] >= i) && e.push(t);
|
|
1535
|
-
} else s < m && e.push(t);
|
|
1512
|
+
const x = R.length, q = y.length, F = j(y, h, p), k = F < 0 ? -1 : y[F];
|
|
1513
|
+
k >= 0 && w.push(k);
|
|
1514
|
+
for (const e of n) {
|
|
1515
|
+
const t = e.rowIndex, i = e.colIndex, s = X(e, a), r = Y(e, c);
|
|
1516
|
+
if (t < a && i < c && (s - t > 1 || r - i > 1)) {
|
|
1517
|
+
let n = (A(t, s, u, h, f, p) || k >= t && k < s) && A(i, r, m, g, S, d);
|
|
1518
|
+
for (let e = 0; !n && e < x; e++) {
|
|
1519
|
+
const {rowIndex: o, colIndex: l} = R[e];
|
|
1520
|
+
n = o >= t && o < s && l >= i && l < r;
|
|
1536
1521
|
}
|
|
1522
|
+
n && R.push(e);
|
|
1537
1523
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1524
|
+
}
|
|
1525
|
+
for (const {rowIndex: e, colIndex: t} of R) {
|
|
1526
|
+
const i = j(y, e, p);
|
|
1527
|
+
w.push(e), i >= 0 && w.push(y[i]), N.push(t);
|
|
1528
|
+
}
|
|
1540
1529
|
P(w), P(N);
|
|
1541
|
-
const
|
|
1530
|
+
const C = Q(w, a, u, h, f, p), O = Q(N, c, m, g, S, d), T = C.length, M = O.length, _ = /* @__PURE__ */ new Map, V = [], E = [];
|
|
1542
1531
|
for (const e of R) {
|
|
1543
|
-
const t =
|
|
1544
|
-
|
|
1545
|
-
const s =
|
|
1546
|
-
for (let r =
|
|
1547
|
-
const t =
|
|
1548
|
-
for (let r = s; r <
|
|
1532
|
+
const t = X(e, a), i = Y(e, c);
|
|
1533
|
+
V.push(t), E.push(i);
|
|
1534
|
+
const s = O.indexOf(e.colIndex);
|
|
1535
|
+
for (let r = C.indexOf(e.rowIndex); r < T && C[r] < t; r++) {
|
|
1536
|
+
const t = C[r] * c;
|
|
1537
|
+
for (let r = s; r < M && O[r] < i; r++) _.set(t + O[r], e);
|
|
1549
1538
|
}
|
|
1550
1539
|
}
|
|
1551
|
-
const
|
|
1552
|
-
for (const e of
|
|
1553
|
-
const
|
|
1554
|
-
let
|
|
1555
|
-
const
|
|
1556
|
-
for (const i of
|
|
1557
|
-
const s = i < u, r = i >= p, n =
|
|
1558
|
-
if (i ===
|
|
1559
|
-
const e = s ? u : r ? a :
|
|
1560
|
-
|
|
1540
|
+
const L = [];
|
|
1541
|
+
for (const e of O) L.push(!t.$isMeasurable(e) && null);
|
|
1542
|
+
const D = [], K = e.$getItemOffset(u), G = [];
|
|
1543
|
+
let W = G;
|
|
1544
|
+
const J = H.get(e), ee = /* @__PURE__ */ new Map;
|
|
1545
|
+
for (const i of C) {
|
|
1546
|
+
const s = i < u, r = i >= p, n = j(y, i, p), o = s ? 0 : r ? p : n < 0 ? -1 : y[n];
|
|
1547
|
+
if (i === o) {
|
|
1548
|
+
const e = s ? u : r ? a : n + 1 < q ? y[n + 1] : p;
|
|
1549
|
+
V.push(e);
|
|
1561
1550
|
const t = [];
|
|
1562
|
-
|
|
1563
|
-
$key: s ? -1 : r ? -2 : -3 -
|
|
1551
|
+
G.push({
|
|
1552
|
+
$key: s ? -1 : r ? -2 : -3 - o,
|
|
1564
1553
|
$rows: t,
|
|
1565
|
-
$style:
|
|
1566
|
-
}),
|
|
1567
|
-
} else
|
|
1568
|
-
const
|
|
1569
|
-
let
|
|
1570
|
-
for (let e = 0; e <
|
|
1571
|
-
const r =
|
|
1572
|
-
if (
|
|
1573
|
-
const
|
|
1574
|
-
let y,
|
|
1575
|
-
|
|
1576
|
-
const $ =
|
|
1577
|
-
!1 !== F || f || (y = i, F = !0), !1 !==
|
|
1578
|
-
const R = s ? "columnheader" : r === v && (
|
|
1554
|
+
$style: Z(o, e, s || r ? 0 : null, r ? "bottom" : "top", 4)
|
|
1555
|
+
}), W = t;
|
|
1556
|
+
} else o < 0 && (W = G);
|
|
1557
|
+
const w = n >= 0 && i === o, z = s || r || i === k || i >= h && i <= f, $ = w ? K : null, N = i * c, R = J && J.get(i), I = R && R.$cells, P = [];
|
|
1558
|
+
let x = 0, F = !e.$isMeasurable(i) && null, C = i + 1, T = !1;
|
|
1559
|
+
for (let e = 0; e < M; e++) {
|
|
1560
|
+
const r = O[e], n = r < m, o = r >= d, u = n || o || r >= g && r <= S, p = _.get(N + r);
|
|
1561
|
+
if (p ? p.rowIndex === i && p.colIndex === r : z && u) {
|
|
1562
|
+
const u = p ? X(p, a) : i + 1, m = p ? Y(p, c) : r + 1, d = u - i, h = m - r, f = d > 1, g = h > 1, S = f || g;
|
|
1563
|
+
let y, z;
|
|
1564
|
+
C = b(C, u);
|
|
1565
|
+
const $ = n ? t.$getItemOffset(r) : null, N = o ? t.$getTotalSize() - t.$getItemOffset(m - 1) - t.$getItemSize(m - 1) : null;
|
|
1566
|
+
!1 !== F || f || (y = i, F = !0), !1 !== L[e] || g || (z = r, L[e] = !0);
|
|
1567
|
+
const R = s ? "columnheader" : r === v && (n || w) ? "rowheader" : "cell", q = S ? d : void 0, k = S ? h : void 0, O = "cell" !== R && l && l.rowIndex === i && l.colIndex === r ? l.order : void 0;
|
|
1579
1568
|
let M;
|
|
1580
1569
|
if (I) {
|
|
1581
1570
|
const e = I.length;
|
|
1582
|
-
for (;
|
|
1583
|
-
|
|
1571
|
+
for (;x < e && I[x].$col < r; ) x++;
|
|
1572
|
+
x < e && I[x].$col === r && (M = I[x]);
|
|
1584
1573
|
}
|
|
1585
|
-
if (!M || M.$rowSpan !==
|
|
1574
|
+
if (!M || M.$rowSpan !== q || M.$colSpan !== k || M.$start !== $ || M.$end !== N || M.$measureRow !== y || M.$measureCol !== z || M.$role !== R || M.$sort !== O) {
|
|
1586
1575
|
let e = "1/l" + r;
|
|
1587
|
-
S && (e += "/l" +
|
|
1576
|
+
S && (e += "/l" + u + "/l" + m);
|
|
1588
1577
|
const t = {
|
|
1589
1578
|
contain: "layout style",
|
|
1590
1579
|
display: "grid",
|
|
1591
1580
|
gridArea: e
|
|
1592
1581
|
};
|
|
1593
1582
|
f && (t.height = "0px", t.minHeight = "100%", t.zIndex = 1), g && (t.width = "0px",
|
|
1594
|
-
t.minWidth = "100%"), (
|
|
1583
|
+
t.minWidth = "100%"), (n || o) && (t[n ? "insetInlineStart" : "insetInlineEnd"] = (n ? $ : N) + "px",
|
|
1595
1584
|
t.position = "sticky", t.zIndex = 2), M = {
|
|
1596
1585
|
$col: r,
|
|
1597
|
-
$rowSpan:
|
|
1598
|
-
$colSpan:
|
|
1586
|
+
$rowSpan: q,
|
|
1587
|
+
$colSpan: k,
|
|
1599
1588
|
$measureRow: y,
|
|
1600
|
-
$measureCol:
|
|
1589
|
+
$measureCol: z,
|
|
1601
1590
|
$role: R,
|
|
1602
|
-
$sort:
|
|
1591
|
+
$sort: O,
|
|
1603
1592
|
$style: t,
|
|
1604
1593
|
$start: $,
|
|
1605
1594
|
$end: N
|
|
1606
|
-
},
|
|
1595
|
+
}, T = !0;
|
|
1607
1596
|
}
|
|
1608
1597
|
P.push(M);
|
|
1609
1598
|
}
|
|
1610
1599
|
}
|
|
1611
|
-
if (
|
|
1612
|
-
const e = R && !
|
|
1600
|
+
if (D.push(F), P.length) {
|
|
1601
|
+
const e = R && !T && R.$cells.length === P.length && R.$top === $ ? R : {
|
|
1613
1602
|
$row: i,
|
|
1614
1603
|
$cells: P,
|
|
1615
|
-
$style:
|
|
1604
|
+
$style: Z(i, C, $, "top", 3),
|
|
1616
1605
|
$top: $
|
|
1617
1606
|
};
|
|
1618
|
-
|
|
1607
|
+
ee.set(i, e), W.push(e);
|
|
1619
1608
|
}
|
|
1620
1609
|
}
|
|
1621
|
-
return H.set(e,
|
|
1622
|
-
$rowTemplate:
|
|
1623
|
-
$colTemplate:
|
|
1624
|
-
$groups:
|
|
1610
|
+
return H.set(e, ee), {
|
|
1611
|
+
$rowTemplate: U(e, C, D, P(V), "max-content", a),
|
|
1612
|
+
$colTemplate: U(t, O, L, P(E), "minmax(max-content,auto)", c),
|
|
1613
|
+
$groups: G
|
|
1625
1614
|
};
|
|
1626
1615
|
})(this.q, this.F, this.I.$getRange(this.bufferSize()), this.P.$getRange(this.bufferSize()), this.sectionRows(), this.spans(), this.keepMounted(), this.ariaSort())));
|
|
1627
1616
|
rowItem(e) {
|
|
@@ -1668,7 +1657,7 @@ var me = class t {
|
|
|
1668
1657
|
const t = this.gap(), i = this.q = G(this.rows(), this.rowHeight(), t), s = this.F = G(this.cols(), this.colWidth(), t), r = this.I = _(i), n = this.P = _(s);
|
|
1669
1658
|
this.driver = ((e, t) => {
|
|
1670
1659
|
let i, s, r, n = k();
|
|
1671
|
-
const o = /* @__PURE__ */ new WeakMap, l = /* @__PURE__ */ new WeakMap, a =
|
|
1660
|
+
const o = /* @__PURE__ */ new WeakMap, l = /* @__PURE__ */ new WeakMap, a = ee(s => {
|
|
1672
1661
|
const r = [], n = [];
|
|
1673
1662
|
for (const {target: a, contentRect: {width: c, height: u}} of s) if (a === i) (c || u) && (e.$update(4, u),
|
|
1674
1663
|
t.$update(4, c)); else if (a.offsetParent) {
|
|
@@ -1684,7 +1673,7 @@ var me = class t {
|
|
|
1684
1673
|
$observe(o) {
|
|
1685
1674
|
const l = i = o.parentElement;
|
|
1686
1675
|
a.i(l);
|
|
1687
|
-
const c = (e, t) =>
|
|
1676
|
+
const c = (e, t) => te(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
|
|
1688
1677
|
const e = t ? "overflowX" : "overflowY", i = l.style, s = i[e];
|
|
1689
1678
|
i[e] = "hidden", x(() => {
|
|
1690
1679
|
i[e] = s;
|
|
@@ -1757,7 +1746,7 @@ var me = class t {
|
|
|
1757
1746
|
}
|
|
1758
1747
|
scrollToIndex(e) {
|
|
1759
1748
|
((e, t, i, s, r, n = z, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
|
|
1760
|
-
null != o &&
|
|
1749
|
+
null != o && re(e, t, s, n, o, a, !1), null != l && re(e, i, r, z, l, c, !0);
|
|
1761
1750
|
})(this.driver, this.I, this.P, this.q, this.F, this.sectionRows(), e);
|
|
1762
1751
|
}
|
|
1763
1752
|
scrollTo({vertical: e, horizontal: t}) {
|
|
@@ -1926,12 +1915,12 @@ var me = class t {
|
|
|
1926
1915
|
isInline: !0,
|
|
1927
1916
|
dependencies: [ {
|
|
1928
1917
|
kind: "directive",
|
|
1929
|
-
type: e.forwardRef(() =>
|
|
1918
|
+
type: e.forwardRef(() => de),
|
|
1930
1919
|
selector: "div[virtuaGridRowGroup]",
|
|
1931
1920
|
inputs: [ "state", "template", "rows", "cols", "resizer" ]
|
|
1932
1921
|
}, {
|
|
1933
1922
|
kind: "directive",
|
|
1934
|
-
type: e.forwardRef(() =>
|
|
1923
|
+
type: e.forwardRef(() => me),
|
|
1935
1924
|
selector: "div[virtuaGridRow]",
|
|
1936
1925
|
inputs: [ "state", "template", "row", "cols", "resizer" ]
|
|
1937
1926
|
} ],
|
|
@@ -1941,5 +1930,5 @@ var me = class t {
|
|
|
1941
1930
|
|
|
1942
1931
|
i.OnPush, i.OnPush, i.OnPush;
|
|
1943
1932
|
|
|
1944
|
-
export {
|
|
1933
|
+
export { he as VGrid, ce as VList, ae as Virtualizer, ue as WindowVirtualizer };
|
|
1945
1934
|
//# sourceMappingURL=index.js.map
|