virtua 0.49.0 → 0.49.2

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/lib/vue/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as e, ref as t, computed as r, watch as o, createVNode as n, mergeProps as s, isVNode as i, onMounted as l, onUnmounted as c } from "vue";
2
2
 
3
- const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r, f(t, e)), h = e => [ ...e ].sort(((e, t) => e - t)), _ = "function" == typeof queueMicrotask ? queueMicrotask : e => {
3
+ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r, f(t, e)), h = e => [ ...e ].sort((e, t) => e - t), _ = "function" == typeof queueMicrotask ? queueMicrotask : e => {
4
4
  Promise.resolve().then(e);
5
5
  }, b = () => {
6
6
  let e;
7
- return [ new Promise((t => {
7
+ return [ new Promise(t => {
8
8
  e = t;
9
- })), e ];
9
+ }), e ];
10
10
  }, g = e => {
11
11
  let t;
12
12
  return () => (e && (t = e(), e = void 0), t);
@@ -37,8 +37,8 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
37
37
  }, $ = (e, t, r) => {
38
38
  const o = t - e.l;
39
39
  return e.i = r ? -1 : u(t - 1, e.i), e.l = t, o > 0 ? (v(e.u, o), v(e.t, o, r),
40
- e.o * o) : (e.u.splice(o), (r ? e.t.splice(0, -o) : e.t.splice(o)).reduce(((t, r) => t - (-1 === r ? e.o : r)), 0));
41
- }, w = e => e.documentElement, I = e => e.ownerDocument, O = e => e.defaultView, k = /*#__PURE__*/ g((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0)), j = /*#__PURE__*/ g((() => "scrollBehavior" in w(document).style)), N = (e, t = 40, r = 0, o, n = !1) => {
40
+ e.o * o) : (e.u.splice(o), (r ? e.t.splice(0, -o) : e.t.splice(o)).reduce((t, r) => t - (-1 === r ? e.o : r), 0));
41
+ }, w = e => e.documentElement, I = e => e.ownerDocument, O = e => e.defaultView, k = /*#__PURE__*/ g(() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0), j = /*#__PURE__*/ g(() => "scrollBehavior" in w(document).style), N = (e, t = 40, r = 0, o, n = !1) => {
42
42
  let s = !!r, i = 1, l = 0, c = 0, p = 0, m = 0, _ = 0, b = 0, g = 0, w = 0, I = a, O = [ 0, s ? f(r - 1, 0) : -1 ], j = 0, N = !1;
43
43
  const B = ((e, t, r) => ({
44
44
  o: t,
@@ -115,16 +115,16 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
115
115
 
116
116
  case 3:
117
117
  {
118
- const e = t.filter((([e, t]) => !C(e, t)));
118
+ const e = t.filter(([e, t]) => !C(e, t));
119
119
  if (!e.length) break;
120
- H(e.reduce(((e, [t, r]) => {
120
+ H(e.reduce((e, [t, r]) => {
121
121
  let o;
122
122
  if (2 === w) o = !0; else if (I && 1 === w) o = t < I[0]; else {
123
123
  const e = q(), r = R(t), n = A(t);
124
- o = 1 !== g && 0 === w ? r + n < e : r < e && r + n < e + l;
124
+ o = 1 !== g && 0 === w ? r + n <= e : r < e && r + n < e + l;
125
125
  }
126
126
  return o && (e += r - A(t)), e;
127
- }), 0));
127
+ }, 0));
128
128
  for (const [t, r] of e) {
129
129
  const e = A(t), o = S(B, t, r);
130
130
  n && (j += o ? r : r - e);
@@ -132,9 +132,9 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
132
132
  n && l && j > l && (H(((e, t) => {
133
133
  let r = 0;
134
134
  const o = [];
135
- e.t.forEach(((e, n) => {
135
+ e.t.forEach((e, n) => {
136
136
  -1 !== e && (o.push(e), n < t && r++);
137
- })), e.i = -1;
137
+ }), e.i = -1;
138
138
  const n = h(o), s = n.length, i = s / 2 | 0, l = s % 2 == 0 ? (n[i - 1] + n[i]) / 2 : n[i], c = e.o;
139
139
  return ((e.o = l) - c) * f(t - r, 0);
140
140
  })(B, x(B, M()))), n = !1), u = 3, o = !0;
@@ -160,9 +160,9 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
160
160
  case 8:
161
161
  I = E(t, t + l), u = 1;
162
162
  }
163
- u && (i = 1 + (2147483647 & i), r && _ && (m += _, _ = 0), T.forEach((([e, t]) => {
163
+ u && (i = 1 + (2147483647 & i), r && _ && (m += _, _ = 0), T.forEach(([e, t]) => {
164
164
  u & e && t(o);
165
- })));
165
+ }));
166
166
  }
167
167
  };
168
168
  }, B = setTimeout, T = (e, t) => t ? -e : e, q = (e, t, r, o, n, s) => {
@@ -173,12 +173,12 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
173
173
  const r = () => {
174
174
  t != a && clearTimeout(t);
175
175
  }, o = () => {
176
- r(), t = B((() => {
176
+ r(), t = B(() => {
177
177
  t = a, (() => {
178
178
  if (c || u) return c = !1, void p();
179
179
  f = !1, e.A(2);
180
180
  })();
181
- }), 150);
181
+ }, 150);
182
182
  };
183
183
  return o.C = r, o;
184
184
  })(), m = () => {
@@ -217,11 +217,11 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
217
217
  const [t, r] = b();
218
218
  return o = () => {
219
219
  r(!1);
220
- }, e.T() && B(o, 150), [ t, e.R(2, (() => {
220
+ }, e.T() && B(o, 150), [ t, e.R(2, () => {
221
221
  r(!0);
222
- })) ];
222
+ }) ];
223
223
  };
224
- if (s && j()) e.A(8, n()), _((async () => {
224
+ if (s && j()) e.A(8, n()), _(async () => {
225
225
  for (;;) {
226
226
  let t = !0;
227
227
  for (let [r, o] = e.v(); r <= o; r++) if (e.I(r)) {
@@ -237,7 +237,7 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
237
237
  }
238
238
  }
239
239
  e.A(7), r(n(), s);
240
- })); else for (;;) {
240
+ }); else for (;;) {
241
241
  const [t, o] = i();
242
242
  try {
243
243
  if (e.A(7), r(n()), !await t) return;
@@ -299,10 +299,10 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
299
299
  ee: Object
300
300
  },
301
301
  setup(e) {
302
- const l = t(), c = r((() => e.L.value && e.W.O(e.D, e.K))), a = r((() => e.L.value && e.W.I(e.D)));
303
- return o((() => l.value && e.D), ((t, r, o) => {
302
+ const l = t(), c = r(() => e.L.value && e.W.O(e.D, e.K)), a = r(() => e.L.value && e.W.I(e.D));
303
+ return o(() => l.value && e.D, (t, r, o) => {
304
304
  o(e.Y(l.value, e.D));
305
- }), {
305
+ }, {
306
306
  flush: "post"
307
307
  }), () => {
308
308
  const {X: t, U: r, G: o, Z: u} = e, f = a.value, {style: d, ...p} = e.ee ?? {}, m = {
@@ -363,14 +363,14 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
363
363
  let p = !!e.ssrCount;
364
364
  const _ = e.horizontal, g = t(), v = N(e.data.length, e.itemSize, e.ssrCount, e.cache, !e.itemSize), y = ((e, t) => {
365
365
  let r;
366
- const o = t ? "width" : "height", n = new WeakMap, s = E((t => {
366
+ const o = t ? "width" : "height", n = new WeakMap, s = E(t => {
367
367
  const s = [];
368
368
  for (const {target: i, contentRect: l} of t) if (i.offsetParent) if (i === r) e.A(4, l[o]); else {
369
369
  const e = n.get(i);
370
370
  e != a && s.push([ e, l[o] ]);
371
371
  }
372
372
  s.length && e.A(3, s);
373
- }));
373
+ });
374
374
  return {
375
375
  te(e) {
376
376
  s.F(r = e);
@@ -382,33 +382,33 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
382
382
  };
383
383
  })(v, _), S = ((e, t) => {
384
384
  let r, o, n = b(), s = !1;
385
- const i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [c, a] = M(e, (() => n[0]), ((e, o) => {
385
+ const i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [c, a] = M(e, () => n[0], (e, o) => {
386
386
  e = T(e, s), o ? r.scrollTo({
387
387
  [t ? "left" : "top"]: e,
388
388
  behavior: "smooth"
389
389
  }) : r[i] = e;
390
- }));
390
+ });
391
391
  return {
392
392
  oe(c, u) {
393
- r = u, t && (s = "rtl" === getComputedStyle(u).direction), o = q(e, u, t, (() => T(u[i], s)), ((t, r, o) => {
393
+ r = u, t && (s = "rtl" === getComputedStyle(u).direction), o = q(e, u, t, () => T(u[i], s), (t, r, o) => {
394
394
  if (o) {
395
395
  const e = u.style, t = e[l];
396
- e[l] = "hidden", B((() => {
396
+ e[l] = "hidden", B(() => {
397
397
  e[l] = t;
398
- }));
398
+ });
399
399
  }
400
400
  u[i] = T(e.N() + t, s), r && a();
401
- })), n[1](!0);
401
+ }), n[1](!0);
402
402
  },
403
403
  p() {
404
404
  o && o.H(), n[1](!1), n = b();
405
405
  },
406
406
  ne: () => s,
407
407
  se(e) {
408
- c((() => e));
408
+ c(() => e);
409
409
  },
410
410
  ie(t) {
411
- t += e.N(), c((() => t));
411
+ t += e.N(), c(() => t);
412
412
  },
413
413
  le(t, {align: r, smooth: o, offset: n = 0} = {}) {
414
414
  if (t = m(t, 0, e.j() - 1), "nearest" === r) {
@@ -418,47 +418,47 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
418
418
  r = "end";
419
419
  }
420
420
  }
421
- c((() => n + e.q() + e.O(t) + ("end" === r ? e.k(t) - e.T() : "center" === r ? (e.k(t) - e.T()) / 2 : 0)), o);
421
+ c(() => n + e.q() + e.O(t) + ("end" === r ? e.k(t) - e.T() : "center" === r ? (e.k(t) - e.T()) / 2 : 0), o);
422
422
  },
423
423
  ce: () => {
424
424
  o && o.V();
425
425
  }
426
426
  };
427
427
  })(v, _), z = t(v.m());
428
- v.R(1, (() => {
428
+ v.R(1, () => {
429
429
  z.value = v.m();
430
- })), v.R(4, (() => {
430
+ }), v.R(4, () => {
431
431
  s("scroll", v.N());
432
- })), v.R(8, (() => {
432
+ }), v.R(8, () => {
433
433
  s("scrollEnd");
434
- }));
435
- const x = r((t => {
434
+ });
435
+ const x = r(t => {
436
436
  z.value;
437
437
  const r = v.v(e.bufferSize);
438
438
  return t && A(t, r) ? t : r;
439
- })), $ = r((() => z.value && v.B())), w = r((() => z.value && v.M()));
440
- return l((() => {
439
+ }), $ = r(() => z.value && v.B()), w = r(() => z.value && v.M());
440
+ return l(() => {
441
441
  p = !1;
442
- const t = g.value, r = requestAnimationFrame((() => {
442
+ const t = g.value, r = requestAnimationFrame(() => {
443
443
  const r = e => {
444
444
  y.te(e), S.oe(t, e);
445
445
  };
446
446
  e.scrollRef ? r(e.scrollRef) : r(t.parentElement);
447
- }));
448
- c((() => {
447
+ });
448
+ c(() => {
449
449
  cancelAnimationFrame(r);
450
- }));
451
- })), c((() => {
450
+ });
451
+ }), c(() => {
452
452
  v.p(), y.p(), S.p();
453
- })), o((() => e.data.length), (t => {
453
+ }), o(() => e.data.length, t => {
454
454
  v.A(5, [ t, e.shift ]);
455
- })), o((() => e.startMargin), (e => {
455
+ }), o(() => e.startMargin, e => {
456
456
  v.A(6, e);
457
- }), {
457
+ }, {
458
458
  immediate: !0
459
- }), o([ z ], (() => {
459
+ }), o([ z ], () => {
460
460
  S.ce();
461
- }), {
461
+ }, {
462
462
  flush: "post"
463
463
  }), u({
464
464
  get cache() {
@@ -505,9 +505,9 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
505
505
  if (e.keepMounted) {
506
506
  const t = new Set(e.keepMounted);
507
507
  for (let [e, r] = x.value; e <= r; e++) t.add(e);
508
- h([ ...t ]).forEach((e => {
508
+ h([ ...t ]).forEach(e => {
509
509
  l.push(c(e));
510
- }));
510
+ });
511
511
  } else for (let [e, t] = x.value; e <= t; e++) l.push(c(e));
512
512
  return n(t, {
513
513
  ref: g,
@@ -620,7 +620,7 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
620
620
  emits: [ "scroll", "scrollEnd" ],
621
621
  setup(e, {emit: s, slots: u, expose: f}) {
622
622
  const d = e.horizontal, p = t(), h = N(e.data.length, e.itemSize, void 0, e.cache, !e.itemSize), g = ((e, t) => {
623
- const r = t ? "width" : "height", o = t ? "innerWidth" : "innerHeight", n = new WeakMap, s = E((t => {
623
+ const r = t ? "width" : "height", o = t ? "innerWidth" : "innerHeight", n = new WeakMap, s = E(t => {
624
624
  const o = [];
625
625
  for (const {target: e, contentRect: s} of t) {
626
626
  if (!e.offsetParent) continue;
@@ -628,7 +628,7 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
628
628
  t != a && o.push([ t, s[r] ]);
629
629
  }
630
630
  o.length && e.A(3, o);
631
- }));
631
+ });
632
632
  let i;
633
633
  return {
634
634
  te(t) {
@@ -648,7 +648,7 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
648
648
  };
649
649
  })(h, d), v = ((e, t) => {
650
650
  let r, o, n = b(), s = !1;
651
- const i = t ? "left" : "top", [l] = M(e, (() => n[0]), ((e, t) => {
651
+ const i = t ? "left" : "top", [l] = M(e, () => n[0], (e, t) => {
652
652
  e = T(e, s);
653
653
  const o = O(I(r));
654
654
  t ? o.scroll({
@@ -657,7 +657,7 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
657
657
  }) : o.scroll({
658
658
  [i]: e
659
659
  });
660
- })), c = (e, t, r, o, n = 0) => {
660
+ }), c = (e, t, r, o, n = 0) => {
661
661
  const i = o ? "offsetLeft" : "offsetTop", l = n + (o && s ? r.innerWidth - e[i] - e.offsetWidth : e[i]), a = e.offsetParent;
662
662
  return e !== t && a ? c(a, t, r, o, l) : l;
663
663
  };
@@ -665,13 +665,13 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
665
665
  oe(l) {
666
666
  r = l;
667
667
  const a = t ? "scrollX" : "scrollY", u = I(l), f = O(u);
668
- t && (s = "rtl" === getComputedStyle(w(u)).direction), o = q(e, f, t, (() => T(f[a], s)), ((t, r) => {
668
+ t && (s = "rtl" === getComputedStyle(w(u)).direction), o = q(e, f, t, () => T(f[a], s), (t, r) => {
669
669
  r ? f.scroll({
670
670
  [i]: T(e.N() + t, s)
671
671
  }) : f.scrollBy({
672
672
  [i]: T(t, s)
673
673
  });
674
- }), (() => c(l, u.body, f, t))), n[1](!0);
674
+ }, () => c(l, u.body, f, t)), n[1](!0);
675
675
  },
676
676
  p() {
677
677
  o && o.H(), r = void 0, n[1](!1), n = b();
@@ -690,32 +690,32 @@ const a = null, {min: u, max: f, abs: d, floor: p} = Math, m = (e, t, r) => u(r,
690
690
  }
691
691
  }
692
692
  const a = I(r), u = O(a), f = w(a), d = () => e.T() - (t ? f.clientWidth : f.clientHeight);
693
- l((() => i + c(r, a.body, u, t) + e.O(o) + ("end" === n ? e.k(o) - (e.T() - d()) : "center" === n ? (e.k(o) - (e.T() - d())) / 2 : 0)), s);
693
+ l(() => i + c(r, a.body, u, t) + e.O(o) + ("end" === n ? e.k(o) - (e.T() - d()) : "center" === n ? (e.k(o) - (e.T() - d())) / 2 : 0), s);
694
694
  }
695
695
  };
696
696
  })(h, d), y = t(h.m());
697
- h.R(1, (() => {
697
+ h.R(1, () => {
698
698
  y.value = h.m();
699
- })), h.R(4, (() => {
699
+ }), h.R(4, () => {
700
700
  s("scroll");
701
- })), h.R(8, (() => {
701
+ }), h.R(8, () => {
702
702
  s("scrollEnd");
703
- }));
704
- const S = r((t => {
703
+ });
704
+ const S = r(t => {
705
705
  y.value;
706
706
  const r = h.v(e.bufferSize);
707
707
  return t && A(t, r) ? t : r;
708
- })), z = r((() => y.value && h.B())), x = r((() => y.value && h.M()));
709
- return l((() => {
708
+ }), z = r(() => y.value && h.B()), x = r(() => y.value && h.M());
709
+ return l(() => {
710
710
  const e = p.value;
711
711
  e && (g.te(e), v.oe(e));
712
- })), c((() => {
712
+ }), c(() => {
713
713
  h.p(), g.p(), v.p();
714
- })), o((() => e.data.length), (t => {
714
+ }), o(() => e.data.length, t => {
715
715
  h.A(5, [ t, e.shift ]);
716
- })), o([ y ], (() => {
716
+ }), o([ y ], () => {
717
717
  v.ce();
718
- }), {
718
+ }, {
719
719
  flush: "post"
720
720
  }), f({
721
721
  get cache() {