virtua 0.48.6 → 0.48.8

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.cjs CHANGED
@@ -38,15 +38,15 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
38
38
  const n = t - e.l;
39
39
  return e.i = o ? -1 : r(t - 1, e.i), e.l = t, n > 0 ? (f(e.u, n), f(e.t, n, o),
40
40
  e.o * n) : (e.u.splice(n), (o ? e.t.splice(0, -n) : e.t.splice(n)).reduce(((t, r) => t - (-1 === r ? e.o : r)), 0));
41
- }, b = e => e.documentElement, v = e => e.ownerDocument, g = e => e.defaultView, y = /*#__PURE__*/ u((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0)), S = /*#__PURE__*/ u((() => "scrollBehavior" in b(document).style)), z = (e, s = 40, i = 0, c, a = !1) => {
42
- let u = !!i, b = 1, v = 0, g = 0, S = 0, z = 0, x = 0, $ = 0, w = 0, I = 0, O = t, k = [ 0, u ? o(i - 1, 0) : -1 ], j = 0, N = !1;
41
+ }, b = e => e.documentElement, g = e => e.ownerDocument, v = e => e.defaultView, y = /*#__PURE__*/ u((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0)), S = /*#__PURE__*/ u((() => "scrollBehavior" in b(document).style)), z = (e, s = 40, i = 0, c, a = !1) => {
42
+ let u = !!i, b = 1, g = 0, v = 0, S = 0, z = 0, x = 0, $ = 0, w = 0, I = 0, O = t, k = [ 0, u ? o(i - 1, 0) : -1 ], j = 0, N = !1;
43
43
  const q = ((e, t, n) => ({
44
44
  o: t,
45
45
  t: n ? f(n.slice(0, r(e, n.length)), o(0, e - n.length)) : f([], e),
46
46
  l: e,
47
47
  i: -1,
48
48
  u: f([], e + 1)
49
- }))(e, c ? c[1] : s, c && c[0]), B = new Set, T = () => S - g, M = () => T() + x + z, E = (e, t) => ((e, t, o, n) => {
49
+ }))(e, c ? c[1] : s, c && c[0]), B = new Set, T = () => S - v, M = () => T() + x + z, E = (e, t) => ((e, t, o, n) => {
50
50
  if (n = r(n, e.l - 1), m(e, n) <= t) {
51
51
  const r = h(e, o, n);
52
52
  return [ h(e, t, n, r), r ];
@@ -71,21 +71,21 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
71
71
  if (!N || u) return k;
72
72
  let t, n;
73
73
  if ($) [t, n] = k; else {
74
- let s = o(0, M()), i = s + v;
74
+ let s = o(0, M()), i = s + g;
75
75
  a || (e = o(0, e), 1 !== w && (s -= e), 2 !== w && (i += e)), [t, n] = k = E(o(0, s), o(0, i)),
76
76
  O && (t = r(t, O[0]), n = o(n, O[1]));
77
77
  }
78
78
  return [ o(t, 0), r(n, q.l - 1) ];
79
79
  },
80
- S: e => h(q, e - g),
80
+ S: e => h(q, e - v),
81
81
  I: C,
82
82
  O: R,
83
83
  k: A,
84
84
  j: () => q.l,
85
85
  N: () => S,
86
86
  q: () => 0 !== w,
87
- B: () => v,
88
- T: () => g,
87
+ B: () => g,
88
+ T: () => v,
89
89
  M: P,
90
90
  P: () => ($ = z, z = 0, [ $, 2 === I ]),
91
91
  R: (e, t) => {
@@ -105,7 +105,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
105
105
  const t = r - S, o = n(t);
106
106
  e && o < n(e) + 1 || 0 !== I || (w = t < 0 ? 2 : 1), u && (u = !1), S = r, c = 4;
107
107
  const s = T();
108
- s >= -v && s <= P() && (c += 1, i = o > v);
108
+ s >= -g && s <= P() && (c += 1, i = o > g);
109
109
  break;
110
110
  }
111
111
 
@@ -117,13 +117,19 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
117
117
  {
118
118
  const e = r.filter((([e, t]) => !C(e, t)));
119
119
  if (!e.length) break;
120
- H(e.reduce(((e, [t, r]) => ((2 === I || (O && 1 === I ? t < O[0] : R(t + (0 === w && 0 === I ? 1 : 0)) < T())) && (e += r - A(t)),
121
- e)), 0));
120
+ H(e.reduce(((e, [t, r]) => {
121
+ let o;
122
+ if (2 === I) o = !0; else if (O && 1 === I) o = t < O[0]; else {
123
+ const e = T(), r = R(t), n = A(t);
124
+ o = 1 !== w && 0 === I ? r + n < e : r < e && r + n < e + g;
125
+ }
126
+ return o && (e += r - A(t)), e;
127
+ }), 0));
122
128
  for (const [t, r] of e) {
123
129
  const e = A(t), o = p(q, t, r);
124
130
  a && (j += o ? r : r - e);
125
131
  }
126
- a && v && j > v && (H(((e, t) => {
132
+ a && g && j > g && (H(((e, t) => {
127
133
  let r = 0;
128
134
  const n = [];
129
135
  e.t.forEach(((e, o) => {
@@ -136,7 +142,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
136
142
  }
137
143
 
138
144
  case 4:
139
- v !== r && (v || (N = i = !0), v = r, c = 3);
145
+ g !== r && (g || (N = i = !0), g = r, c = 3);
140
146
  break;
141
147
 
142
148
  case 5:
@@ -144,7 +150,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
144
150
  break;
145
151
 
146
152
  case 6:
147
- g = r;
153
+ v = r;
148
154
  break;
149
155
 
150
156
  case 7:
@@ -152,7 +158,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
152
158
  break;
153
159
 
154
160
  case 8:
155
- O = E(r, r + v), c = 1;
161
+ O = E(r, r + g), c = 1;
156
162
  }
157
163
  c && (b = 1 + (2147483647 & b), s && x && (z += x, x = 0), B.forEach((([e, t]) => {
158
164
  c & e && t(i);
@@ -246,7 +252,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
246
252
  let t;
247
253
  return {
248
254
  F(r) {
249
- (t || (t = new (g(v(r)).ResizeObserver)(e))).observe(r);
255
+ (t || (t = new (v(g(r)).ResizeObserver)(e))).observe(r);
250
256
  },
251
257
  J(e) {
252
258
  t.unobserve(e);
@@ -299,24 +305,23 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
299
305
  }), {
300
306
  flush: "post"
301
307
  }), () => {
302
- var s;
303
- const {X: i, U: l, G: c, Z: a} = t, u = n.value, {style: f, ...d} = null !== (s = t.ee) && void 0 !== s ? s : {}, p = {
308
+ const {X: s, U: i, G: l, Z: c} = t, a = n.value, {style: u, ...f} = t.ee ?? {}, d = {
304
309
  contain: "layout style",
305
- position: u && c ? void 0 : "absolute",
306
- [l ? "height" : "width"]: "100%",
307
- [l ? "top" : "left"]: "0px",
308
- [l ? "left" : "top"]: o.value + "px",
309
- visibility: !u || c ? void 0 : "hidden",
310
- ...f
310
+ position: a && l ? void 0 : "absolute",
311
+ [i ? "height" : "width"]: "100%",
312
+ [i ? "top" : "left"]: "0px",
313
+ [i ? "left" : "top"]: o.value + "px",
314
+ visibility: !a || l ? void 0 : "hidden",
315
+ ...u
311
316
  };
312
- return l && (p.display = "inline-flex"), e.createVNode(a, e.mergeProps({
317
+ return i && (d.display = "inline-flex"), e.createVNode(c, e.mergeProps({
313
318
  ref: r,
314
- style: p
315
- }, d), "function" == typeof (m = i) || "[object Object]" === Object.prototype.toString.call(m) && !e.isVNode(m) ? i : {
316
- default: () => [ i ],
319
+ style: d
320
+ }, f), "function" == typeof (p = s) || "[object Object]" === Object.prototype.toString.call(p) && !e.isVNode(p) ? s : {
321
+ default: () => [ s ],
317
322
  _: 2
318
323
  }, 16, [ "style" ]);
319
- var m;
324
+ var p;
320
325
  };
321
326
  }
322
327
  }), j = (e, t) => {
@@ -431,7 +436,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
431
436
  _.value;
432
437
  const t = p.v(r.bufferSize);
433
438
  return e && N(e, t) ? e : t;
434
- })), v = e.computed((() => _.value && p.q())), g = e.computed((() => _.value && p.M()));
439
+ })), g = e.computed((() => _.value && p.q())), v = e.computed((() => _.value && p.M()));
435
440
  return e.onMounted((() => {
436
441
  u = !1;
437
442
  const t = d.value, o = requestAnimationFrame((() => {
@@ -475,24 +480,23 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
475
480
  scrollTo: h.se,
476
481
  scrollBy: h.ie
477
482
  }), () => {
478
- const t = r.as, o = r.item, n = g.value, s = h.ne(), i = [], a = t => {
479
- var n;
480
- const i = c.default({
483
+ const t = r.as, o = r.item, n = v.value, s = h.ne(), i = [], a = t => {
484
+ const n = c.default({
481
485
  item: r.data[t],
482
486
  index: t
483
487
  });
484
488
  return e.createVNode(k, {
485
- key: j(i, t),
489
+ key: j(n, t),
486
490
  L: _,
487
491
  W: p,
488
492
  Y: m.re,
489
493
  D: t,
490
- X: i,
494
+ X: n,
491
495
  U: f,
492
496
  K: s,
493
497
  G: u,
494
498
  Z: o,
495
- ee: null === (n = r.itemProps) || void 0 === n ? void 0 : n.call(r, {
499
+ ee: r.itemProps?.({
496
500
  item: r.data[t],
497
501
  index: t
498
502
  })
@@ -514,7 +518,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
514
518
  position: "relative",
515
519
  width: f ? n + "px" : "100%",
516
520
  height: f ? "100%" : n + "px",
517
- pointerEvents: v.value ? "none" : void 0
521
+ pointerEvents: g.value ? "none" : void 0
518
522
  }
519
523
  }, "function" == typeof (y = i) || "[object Object]" === Object.prototype.toString.call(y) && !e.isVNode(y) ? i : {
520
524
  default: () => [ i ],
@@ -628,7 +632,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
628
632
  let l;
629
633
  return {
630
634
  te(t) {
631
- const r = g(v(t)), o = () => {
635
+ const r = v(g(t)), o = () => {
632
636
  e.A(4, r[n]);
633
637
  };
634
638
  r.addEventListener("resize", o), c(o), l = () => {
@@ -646,7 +650,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
646
650
  let r, o, n = a(), s = !1;
647
651
  const l = t ? "left" : "top", [c] = I(e, (() => n[0]), ((e, t) => {
648
652
  e = $(e, s);
649
- const o = g(v(r));
653
+ const o = v(g(r));
650
654
  t ? o.scroll({
651
655
  [l]: e,
652
656
  behavior: "smooth"
@@ -660,7 +664,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
660
664
  return {
661
665
  oe(i) {
662
666
  r = i;
663
- const c = t ? "scrollX" : "scrollY", a = v(i), f = g(a);
667
+ const c = t ? "scrollX" : "scrollY", a = g(i), f = v(a);
664
668
  t && (s = "rtl" === getComputedStyle(b(a)).direction), o = w(e, f, t, (() => $(f[c], s)), ((t, r) => {
665
669
  r ? f.scroll({
666
670
  [l]: $(e.N() + t, s)
@@ -685,7 +689,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
685
689
  n = "end";
686
690
  }
687
691
  }
688
- const a = v(r), f = g(a), d = b(a), p = () => e.B() - (t ? d.clientWidth : d.clientHeight);
692
+ const a = g(r), f = v(a), d = b(a), p = () => e.B() - (t ? d.clientWidth : d.clientHeight);
689
693
  c((() => l + u(r, a.body, f, t) + e.O(o) + ("end" === n ? e.k(o) - (e.B() - p()) : "center" === n ? (e.k(o) - (e.B() - p())) / 2 : 0)), s);
690
694
  }
691
695
  };