virtua 0.52.9 → 0.52.10

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.
@@ -116,12 +116,13 @@ t), m = (t, e, o) => {
116
116
  }), e.addEventListener("touchend", R, {
117
117
  passive: !0
118
118
  }), {
119
+ i: z,
119
120
  l: () => {
120
121
  e.removeEventListener("scroll", z), e.removeEventListener("wheel", M), e.removeEventListener("touchstart", T),
121
122
  e.removeEventListener("touchend", R), f(a);
122
123
  },
123
- i: () => {
124
- const [e, n] = t.u();
124
+ u: () => {
125
+ const [e, n] = t.$();
125
126
  if (!e) return;
126
127
  x && s && s(), x = !1;
127
128
  const r = t.$getScrollOffset(), l = r + e, i = t.$getStartSpacerSize() + t.$getTotalSize() - t.$getViewportSize();
@@ -130,7 +131,7 @@ t), m = (t, e, o) => {
130
131
  behavior: "instant"
131
132
  }), n && (c && c(), t.$getViewportSize() > t.$getTotalSize() && t.$update(1, v()));
132
133
  },
133
- $: (e, o) => {
134
+ p: (e, o) => {
134
135
  let n, r, s;
135
136
  c && c();
136
137
  const l = c = () => {
@@ -183,73 +184,74 @@ t), m = (t, e, o) => {
183
184
  exports.ACTION_ITEMS_LENGTH_CHANGE = 5, exports.ACTION_RELAYOUT = 9, exports.ACTION_START_OFFSET_CHANGE = 6,
184
185
  exports.UPDATE_SCROLL_END_EVENT = 8, exports.UPDATE_SCROLL_EVENT = 4, exports.UPDATE_VIRTUAL_STATE = 1,
185
186
  exports.createContainerDriver = (t, e) => {
186
- let o, n, r = a();
187
- const s = /* @__PURE__ */ new WeakMap, l = T(n => {
188
- const r = [];
189
- for (const {target: l, contentRect: {width: c, height: i}} of n) if (l === o) (c || i) && t.$update(4, e ? c : i); else if (l.offsetParent) {
190
- const t = s.get(l);
191
- null != t && r.push([ t, e ? c : i ]);
187
+ let o, n, r = a(), s = !0;
188
+ const l = /* @__PURE__ */ new WeakMap, c = T(r => {
189
+ const c = [];
190
+ for (const {target: i, contentRect: {width: f, height: u}} of r) if (i === o) f || u ? (s || n.i(),
191
+ s = !0, t.$update(4, e ? f : u)) : s = !1; else if (i.offsetParent) {
192
+ const t = l.get(i);
193
+ null != t && c.push([ t, e ? f : u ]);
192
194
  }
193
- r.length && t.$update(3, r);
195
+ c.length && t.$update(3, c);
194
196
  });
195
197
  return {
196
- $observe(s, c = s.parentElement) {
197
- l.t(o = c), n = R(t, c, c, e, e && "rtl" === getComputedStyle(c).direction, () => {
198
- const t = e ? "overflowX" : "overflowY", o = c.style, n = o[t];
198
+ $observe(s, l = s.parentElement) {
199
+ c.t(o = l), n = R(t, l, l, e, e && "rtl" === getComputedStyle(l).direction, () => {
200
+ const t = e ? "overflowX" : "overflowY", o = l.style, n = o[t];
199
201
  o[t] = "hidden", i(() => {
200
202
  o[t] = n;
201
203
  });
202
204
  }), r[1](!0);
203
205
  },
204
206
  $dispose() {
205
- l.l(), n && n.l(), r[1](!1), r = a();
207
+ c.l(), n && n.l(), r[1](!1), r = a();
206
208
  },
207
- $observeItem: (t, e) => (s.set(t, e), l.t(t), () => {
208
- s.delete(t), l.o(t);
209
+ $observeItem: (t, e) => (l.set(t, e), c.t(t), () => {
210
+ l.delete(t), c.o(t);
209
211
  }),
210
212
  async $scroll(t, e) {
211
- await r[0] && n.$(t, e);
213
+ await r[0] && n.p(t, e);
212
214
  },
213
215
  $effect() {
214
- n && n.i();
216
+ n && n.u();
215
217
  },
216
218
  $getBaseOffset: t.$getStartSpacerSize
217
219
  };
218
220
  }, exports.createContainerGridDriver = (t, e) => {
219
- let o, n, r, s = a();
220
- const l = /* @__PURE__ */ new WeakMap, c = /* @__PURE__ */ new WeakMap, f = T(n => {
221
- const r = [], s = [];
222
- for (const {target: i, contentRect: {width: f, height: u}} of n) if (i === o) (f || u) && (t.$update(4, u),
223
- e.$update(4, f)); else if (i.offsetParent) {
224
- const t = l.get(i), e = c.get(i);
225
- null != t && r.push([ t, u ]), null != e && s.push([ e, f ]);
221
+ let o, n, r, s = a(), l = !0;
222
+ const c = /* @__PURE__ */ new WeakMap, f = /* @__PURE__ */ new WeakMap, u = T(s => {
223
+ const i = [], u = [];
224
+ for (const {target: a, contentRect: {width: $, height: p}} of s) if (a === o) $ || p ? (l || (n.i(),
225
+ r.i()), l = !0, t.$update(4, p), e.$update(4, $)) : l = !1; else if (a.offsetParent) {
226
+ const t = c.get(a), e = f.get(a);
227
+ null != t && i.push([ t, p ]), null != e && u.push([ e, $ ]);
226
228
  }
227
- r.length && t.$update(3, r), s.length && e.$update(3, s);
229
+ i.length && t.$update(3, i), u.length && e.$update(3, u);
228
230
  });
229
231
  return {
230
232
  async $scroll(t, e) {
231
- await s[0] && (t ? r : n).$(e);
233
+ await s[0] && (t ? r : n).p(e);
232
234
  },
233
235
  $observe(l) {
234
236
  const c = o = l.parentElement;
235
- f.t(c);
236
- const u = (t, e) => R(t, c, c, e, e && "rtl" === getComputedStyle(c).direction, () => {
237
+ u.t(c);
238
+ const f = (t, e) => R(t, c, c, e, e && "rtl" === getComputedStyle(c).direction, () => {
237
239
  const t = e ? "overflowX" : "overflowY", o = c.style, n = o[t];
238
240
  o[t] = "hidden", i(() => {
239
241
  o[t] = n;
240
242
  });
241
243
  });
242
- n = u(t, !1), r = u(e, !0), s[1](!0);
244
+ n = f(t, !1), r = f(e, !0), s[1](!0);
243
245
  },
244
246
  $dispose() {
245
- f.l(), n && n.l(), r && r.l(), s[1](!1), s = a();
247
+ u.l(), n && n.l(), r && r.l(), s[1](!1), s = a();
246
248
  },
247
- $observeItem: (t, e, o) => (null != e && l.set(t, e), null != o && c.set(t, o),
248
- f.t(t), () => {
249
- l.delete(t), c.delete(t), f.o(t);
249
+ $observeItem: (t, e, o) => (null != e && c.set(t, e), null != o && f.set(t, o),
250
+ u.t(t), () => {
251
+ c.delete(t), f.delete(t), u.o(t);
250
252
  }),
251
253
  $effect() {
252
- n && n.i(), r && r.i();
254
+ n && n.u(), r && r.u();
253
255
  }
254
256
  };
255
257
  }, exports.createGridLayout = (t, e, r = 0) => {
@@ -536,7 +538,7 @@ exports.createContainerDriver = (t, e) => {
536
538
  $getViewportSize: () => w,
537
539
  $getStartSpacerSize: () => h,
538
540
  $getTotalSize: i,
539
- u: () => (y = S, S = 0, [ y, 2 === k ]),
541
+ $: () => (y = S, S = 0, [ y, 2 === k ]),
540
542
  $subscribe: (t, e) => {
541
543
  const o = [ t, e ];
542
544
  return R.add(o), () => {
@@ -630,10 +632,10 @@ exports.createContainerDriver = (t, e) => {
630
632
  i.delete(t), f.o(t);
631
633
  }),
632
634
  async $scroll(t, e) {
633
- await c[0] && n.$(t, e);
635
+ await c[0] && n.p(t, e);
634
636
  },
635
637
  $effect() {
636
- n && n.i();
638
+ n && n.u();
637
639
  },
638
640
  $getBaseOffset: () => s()
639
641
  };