virtua 0.52.6 → 0.52.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/README.md +1 -1
- package/lib/angular/index.js +289 -280
- package/lib/angular/index.js.map +1 -1
- package/lib/core/index.cjs +482 -476
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.js +478 -472
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +470 -462
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +453 -445
- package/lib/index.js.map +1 -1
- package/lib/solid/index.cjs +423 -417
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +493 -487
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +213 -158
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/VGrid.svelte +14 -5
- package/lib/vue/index.cjs +432 -426
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +441 -435
- package/lib/vue/index.js.map +1 -1
- package/package.json +22 -22
package/lib/core/index.cjs
CHANGED
|
@@ -2,663 +2,669 @@ Object.defineProperty(exports, Symbol.toStringTag, {
|
|
|
2
2
|
value: "Module"
|
|
3
3
|
});
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
Promise.resolve().then(
|
|
7
|
-
},
|
|
8
|
-
let
|
|
9
|
-
return [ new Promise(
|
|
10
|
-
|
|
11
|
-
}),
|
|
12
|
-
}, $ = "undefined" != typeof window, p =
|
|
13
|
-
|
|
14
|
-
let i = n;
|
|
15
|
-
for (;n <= s; ) {
|
|
16
|
-
const t = r((n + s) / 2);
|
|
17
|
-
e(t) <= o ? (i = t, n = t + 1) : s = t - 1;
|
|
18
|
-
}
|
|
19
|
-
return l(i, 0, t - 1);
|
|
20
|
-
}, x = (e, t, o) => {
|
|
5
|
+
var t, e = [], {min: o, max: n, abs: r, floor: s} = Math, l = (t, e, r) => o(r, n(e, t)), c = t => t.sort((t, e) => t - e), i = setTimeout, f = clearTimeout, u = "function" == typeof queueMicrotask ? queueMicrotask : t => {
|
|
6
|
+
Promise.resolve().then(t);
|
|
7
|
+
}, a = () => {
|
|
8
|
+
let t;
|
|
9
|
+
return [ new Promise(e => {
|
|
10
|
+
t = e;
|
|
11
|
+
}), t ];
|
|
12
|
+
}, $ = "undefined" != typeof window, p = t => t.ownerDocument, g = t => t.defaultView, d = () => (null == t && (t = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
|
|
13
|
+
t), m = (t, e, o) => {
|
|
21
14
|
const n = o ? "unshift" : "push";
|
|
22
|
-
for (let o = 0; o <
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
l < 0 && (u[0] = 0, l = 0);
|
|
33
|
-
let o = l, n = u[o];
|
|
34
|
-
for (;o < t; ) n += $(o), u[++o] = n;
|
|
35
|
-
return l = t, n;
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
$getRange: (t, n) => {
|
|
39
|
-
let s, r;
|
|
40
|
-
return c = o(c, e - 1), p(c) <= t ? (r = m(p, e, n, c), s = m(p, e, t, c, r)) : (s = m(p, e, t, void 0, c),
|
|
41
|
-
r = m(p, e, n, s)), c = s, [ s, r ];
|
|
42
|
-
},
|
|
43
|
-
$findIndex: t => m(p, e, t),
|
|
44
|
-
$getItemOffset: p,
|
|
45
|
-
$getItemSize: $,
|
|
46
|
-
$setItemSize: (e, t) => {
|
|
47
|
-
const n = -1 === a[e];
|
|
48
|
-
return a[e] = t, l = o(e, l), n;
|
|
49
|
-
},
|
|
50
|
-
$isSizeEqual: (e, t = -1) => a[e] === t,
|
|
51
|
-
$getTotalSize: () => p(e),
|
|
52
|
-
$getLength: () => e,
|
|
53
|
-
$setLength: (t, n) => {
|
|
54
|
-
const s = t - e;
|
|
55
|
-
return l = n ? -1 : o(t - 1, l), e = t, s > 0 ? (x(u, s), x(a, s, n), r * s) : (u.splice(s),
|
|
56
|
-
(n ? a.splice(0, -s) : a.splice(s)).reduce((e, t) => e - (-1 === t ? r : t), 0));
|
|
57
|
-
},
|
|
58
|
-
$estimateDefaultSize: t ? void 0 : e => {
|
|
59
|
-
let t = 0;
|
|
60
|
-
const o = [];
|
|
61
|
-
a.forEach((n, s) => {
|
|
62
|
-
-1 !== n && (n && o.push(n), s < e && t++);
|
|
63
|
-
}), l = -1, i(o);
|
|
64
|
-
const s = o.length, c = s / 2 | 0, f = s % 2 == 0 ? (o[c - 1] + o[c]) / 2 : o[c], u = r;
|
|
65
|
-
return ((r = f) - u) * n(e - t, 0);
|
|
66
|
-
},
|
|
67
|
-
$snapshot: () => [ a.slice(), r ]
|
|
68
|
-
};
|
|
69
|
-
}, h = e => "number" == typeof e ? e : e.length, w = /*#__PURE__*/ new WeakMap, b = (e, t, o) => {
|
|
15
|
+
for (let o = 0; o < e; o++) t[n](-1);
|
|
16
|
+
return t;
|
|
17
|
+
}, x = (t, e, o, n = 0, r = e - 1) => {
|
|
18
|
+
let c = n;
|
|
19
|
+
for (;n <= r; ) {
|
|
20
|
+
const e = s((n + r) / 2);
|
|
21
|
+
t(e) <= o ? (c = e, n = e + 1) : r = e - 1;
|
|
22
|
+
}
|
|
23
|
+
return l(c, 0, e - 1);
|
|
24
|
+
}, w = t => "number" == typeof t ? t : t.length, h = /*#__PURE__*/ new WeakMap, b = (t, e, o) => {
|
|
70
25
|
const n = [];
|
|
71
|
-
for (const
|
|
72
|
-
return
|
|
73
|
-
},
|
|
74
|
-
if (
|
|
75
|
-
let n = 0,
|
|
76
|
-
for (;n <
|
|
77
|
-
const o = n +
|
|
78
|
-
|
|
26
|
+
for (const r of t) r >= e && r < o && n.push(r);
|
|
27
|
+
return c(n);
|
|
28
|
+
}, S = (t, e, o) => {
|
|
29
|
+
if (e >= o) return -1;
|
|
30
|
+
let n = 0, r = t.length;
|
|
31
|
+
for (;n < r; ) {
|
|
32
|
+
const o = n + r >> 1;
|
|
33
|
+
t[o] <= e ? n = o + 1 : r = o;
|
|
79
34
|
}
|
|
80
35
|
return n - 1;
|
|
81
|
-
}, v = (
|
|
82
|
-
const
|
|
83
|
-
for (;o <
|
|
84
|
-
const n =
|
|
85
|
-
n >
|
|
36
|
+
}, v = (t, e, o, n, r) => {
|
|
37
|
+
const s = e.length;
|
|
38
|
+
for (;o < s && e[o] < n; o++) {
|
|
39
|
+
const n = e[o];
|
|
40
|
+
n > r && (t.push(n), r = n);
|
|
86
41
|
}
|
|
87
42
|
return o;
|
|
88
|
-
},
|
|
43
|
+
}, y = (t, e, o, n, r, s) => {
|
|
89
44
|
const l = [];
|
|
90
|
-
for (let
|
|
91
|
-
const
|
|
92
|
-
for (let
|
|
93
|
-
v(l,
|
|
94
|
-
for (let
|
|
45
|
+
for (let t = 0; t < o; t++) l.push(t);
|
|
46
|
+
const c = v(l, t, 0, n, o - 1);
|
|
47
|
+
for (let t = n; t <= r; t++) l.push(t);
|
|
48
|
+
v(l, t, c, s, r);
|
|
49
|
+
for (let t = s; t < e; t++) l.push(t);
|
|
95
50
|
return l;
|
|
96
|
-
},
|
|
97
|
-
const
|
|
98
|
-
let f = "[l0]",
|
|
99
|
-
for (;
|
|
100
|
-
for (;$ <
|
|
101
|
-
const p =
|
|
51
|
+
}, I = (t, e) => o(t.rowIndex + (t.rowSpan || 1), e), k = (t, e) => o(t.colIndex + (t.colSpan || 1), e), z = (t, e, n, r, s, l) => {
|
|
52
|
+
const c = e.length, i = r.length;
|
|
53
|
+
let f = "[l0]", u = 0, a = 0, $ = 0;
|
|
54
|
+
for (;u < l; ) {
|
|
55
|
+
for (;$ < i && r[$] <= u; ) $++;
|
|
56
|
+
const p = a < c ? e[a] : l;
|
|
102
57
|
let g, d;
|
|
103
|
-
if (p ===
|
|
104
|
-
g =
|
|
105
|
-
const
|
|
106
|
-
d = null ==
|
|
107
|
-
|
|
108
|
-
} else g = o(p, $ <
|
|
109
|
-
f += " " + d + " [l" + g + "]",
|
|
58
|
+
if (p === u) {
|
|
59
|
+
g = u + 1;
|
|
60
|
+
const e = n[a];
|
|
61
|
+
d = null == e ? t.$getItemSize(u) + "px" : e ? s : "minmax(" + t.$getItemSize(u) + "px,auto)",
|
|
62
|
+
a++;
|
|
63
|
+
} else g = o(p, $ < i ? r[$] : l), d = "minmax(" + (t.$getItemOffset(g - 1) + t.$getItemSize(g - 1) - t.$getItemOffset(u)) + "px,auto)";
|
|
64
|
+
f += " " + d + " [l" + g + "]", u = g;
|
|
110
65
|
}
|
|
111
66
|
return f;
|
|
112
|
-
},
|
|
113
|
-
const
|
|
67
|
+
}, M = (t, e, o, n, r) => {
|
|
68
|
+
const s = {
|
|
114
69
|
display: "grid",
|
|
115
70
|
gridTemplateRows: "subgrid",
|
|
116
71
|
gridTemplateColumns: "subgrid",
|
|
117
72
|
gridColumn: "1/-1",
|
|
118
|
-
gridRow: "l" +
|
|
73
|
+
gridRow: "l" + t + "/l" + e
|
|
119
74
|
};
|
|
120
|
-
return null != o && (
|
|
121
|
-
},
|
|
122
|
-
let
|
|
75
|
+
return null != o && (s.position = "sticky", s[n] = o + "px", s.zIndex = r), s;
|
|
76
|
+
}, T = t => {
|
|
77
|
+
let e;
|
|
123
78
|
return {
|
|
124
79
|
t(o) {
|
|
125
|
-
(
|
|
80
|
+
(e || (e = new (g(p(o)).ResizeObserver)(t))).observe(o);
|
|
126
81
|
},
|
|
127
|
-
o(
|
|
128
|
-
|
|
82
|
+
o(t) {
|
|
83
|
+
e.unobserve(t);
|
|
129
84
|
},
|
|
130
85
|
l() {
|
|
131
|
-
|
|
86
|
+
e && e.disconnect();
|
|
132
87
|
}
|
|
133
88
|
};
|
|
134
|
-
}, R = (
|
|
135
|
-
let
|
|
136
|
-
const
|
|
89
|
+
}, R = (t, e, o, n, r, s, l) => {
|
|
90
|
+
let c, a, $ = 0, p = !1, g = !1, m = !1, x = !1;
|
|
91
|
+
const w = Date.now, h = n ? "scrollLeft" : "scrollTop", b = n ? "left" : "top", S = t => r ? -t : t, v = () => S(o[h]), y = (t, e) => {
|
|
137
92
|
o.scrollTo({
|
|
138
|
-
[
|
|
139
|
-
behavior:
|
|
93
|
+
[b]: S(t),
|
|
94
|
+
behavior: e ? "smooth" : "instant"
|
|
140
95
|
});
|
|
141
|
-
},
|
|
142
|
-
if (p || g) return p = !1, void
|
|
143
|
-
m = !1,
|
|
144
|
-
}, y = () => {
|
|
145
|
-
f(u), u = c(z, 150);
|
|
96
|
+
}, I = () => {
|
|
97
|
+
if (p || g) return p = !1, void k();
|
|
98
|
+
m = !1, t.$update(2);
|
|
146
99
|
}, k = () => {
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
100
|
+
f(a), a = i(I, 150);
|
|
101
|
+
}, z = () => {
|
|
102
|
+
$ = w(), m && (x = !0), l && t.$update(6, l()), t.$update(1, v()), k();
|
|
103
|
+
}, M = e => {
|
|
104
|
+
if (p || !t.$isScrolling() || e.ctrlKey) return;
|
|
105
|
+
const o = w() - $;
|
|
106
|
+
150 > o && 50 < o && (n ? e.deltaX : e.deltaY) && (p = !0);
|
|
152
107
|
}, T = () => {
|
|
153
108
|
g = !0, m = x = !1;
|
|
154
|
-
},
|
|
109
|
+
}, R = () => {
|
|
155
110
|
g = !1, d() && (m = !0);
|
|
156
111
|
};
|
|
157
|
-
return
|
|
112
|
+
return e.addEventListener("scroll", z), e.addEventListener("wheel", M, {
|
|
158
113
|
passive: !0
|
|
159
|
-
}),
|
|
114
|
+
}), e.addEventListener("touchstart", T, {
|
|
160
115
|
passive: !0
|
|
161
|
-
}),
|
|
116
|
+
}), e.addEventListener("touchend", R, {
|
|
162
117
|
passive: !0
|
|
163
118
|
}), {
|
|
164
119
|
l: () => {
|
|
165
|
-
|
|
166
|
-
|
|
120
|
+
e.removeEventListener("scroll", z), e.removeEventListener("wheel", M), e.removeEventListener("touchstart", T),
|
|
121
|
+
e.removeEventListener("touchend", R), f(a);
|
|
167
122
|
},
|
|
168
123
|
i: () => {
|
|
169
|
-
const [
|
|
170
|
-
if (!
|
|
171
|
-
x &&
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
[
|
|
124
|
+
const [e, n] = t.u();
|
|
125
|
+
if (!e) return;
|
|
126
|
+
x && s && s(), x = !1;
|
|
127
|
+
const r = t.$getScrollOffset(), l = r + e, i = t.$getStartSpacerSize() + t.$getTotalSize() - t.$getViewportSize();
|
|
128
|
+
l <= 0 || l >= i || r >= i ? y(l) : o.scrollBy({
|
|
129
|
+
[b]: S(e),
|
|
175
130
|
behavior: "instant"
|
|
176
|
-
}), n && (
|
|
131
|
+
}), n && (c && c(), t.$getViewportSize() > t.$getTotalSize() && t.$update(1, v()));
|
|
177
132
|
},
|
|
178
|
-
$: (
|
|
179
|
-
let n,
|
|
180
|
-
|
|
181
|
-
const l =
|
|
182
|
-
n = !0, f(
|
|
183
|
-
},
|
|
133
|
+
$: (e, o) => {
|
|
134
|
+
let n, r, s;
|
|
135
|
+
c && c();
|
|
136
|
+
const l = c = () => {
|
|
137
|
+
n = !0, f(r), s && s();
|
|
138
|
+
}, a = () => {
|
|
184
139
|
if (!n) {
|
|
185
|
-
if (
|
|
186
|
-
for (let [
|
|
140
|
+
if (t.$getViewportSize() && (f(r), r = i(l, 150)), o) {
|
|
141
|
+
for (let [e, o] = t.$getRange(0); e <= o; e++) if (t.$isUnmeasuredItem(e)) return;
|
|
187
142
|
l();
|
|
188
143
|
}
|
|
189
|
-
|
|
144
|
+
t.$update(7), y(e(), o);
|
|
190
145
|
}
|
|
191
146
|
}, $ = () => {
|
|
192
147
|
if (n) return;
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
148
|
+
let e;
|
|
149
|
+
s = t.$subscribe(2, () => {
|
|
150
|
+
e || (e = !0, u(() => {
|
|
151
|
+
e = !1, a();
|
|
197
152
|
}));
|
|
198
|
-
}),
|
|
153
|
+
}), a();
|
|
199
154
|
};
|
|
200
|
-
o ? (
|
|
155
|
+
o ? (t.$update(8, e()), u($)) : $();
|
|
201
156
|
}
|
|
202
157
|
};
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
const p = b(
|
|
209
|
-
if ("nearest" ===
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
let f =
|
|
213
|
-
if (d ===
|
|
214
|
-
const
|
|
215
|
-
f = n(f, o(
|
|
158
|
+
}, L = (t, e) => {
|
|
159
|
+
t.$scroll(() => e);
|
|
160
|
+
}, O = (t, e, r, s, c, i, f) => {
|
|
161
|
+
const u = e.$getItemsLength(), a = r.$getPinnedStart(), $ = r.$getTrailStart();
|
|
162
|
+
c = l(c, 0, u - 1);
|
|
163
|
+
const p = b(s, a, $), g = S(p, c, $), d = g < 0 ? -1 : p[g], m = () => r.$getItemOffset(a) + (d < 0 || d === c ? 0 : r.$getItemOffset(d + 1) - r.$getItemOffset(d)), x = () => r.$getItemOffset(u) - r.$getItemOffset($);
|
|
164
|
+
if ("nearest" === i) {
|
|
165
|
+
if (c < a || c >= $) return;
|
|
166
|
+
const t = m(), r = e.$getScrollOffset() + t, s = e.$getViewportSize() - t - x(), l = e.$getItemSize(c);
|
|
167
|
+
let f = e.$getItemOffset(c);
|
|
168
|
+
if (d === c) {
|
|
169
|
+
const t = (g + 1 < p.length ? p[g + 1] : $) - 1;
|
|
170
|
+
f = n(f, o(r, e.$getItemOffset(t) + e.$getItemSize(t) - l));
|
|
216
171
|
}
|
|
217
|
-
if (f <
|
|
218
|
-
if (!(f + l >
|
|
219
|
-
|
|
172
|
+
if (f < r) i = "start"; else {
|
|
173
|
+
if (!(f + l > r + s)) return;
|
|
174
|
+
i = "end";
|
|
220
175
|
}
|
|
221
176
|
}
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
return
|
|
177
|
+
t.$scroll(f, () => {
|
|
178
|
+
const t = m(), o = e.$getItemSize(c) - (e.$getViewportSize() - t - x());
|
|
179
|
+
return e.$getItemOffset(c) - t + ("end" === i ? o : "center" === i ? o / 2 : 0);
|
|
225
180
|
});
|
|
226
181
|
};
|
|
227
182
|
|
|
228
|
-
exports.ACTION_ITEMS_LENGTH_CHANGE = 5, exports.ACTION_START_OFFSET_CHANGE = 6,
|
|
183
|
+
exports.ACTION_ITEMS_LENGTH_CHANGE = 5, exports.ACTION_RELAYOUT = 9, exports.ACTION_START_OFFSET_CHANGE = 6,
|
|
229
184
|
exports.UPDATE_SCROLL_END_EVENT = 8, exports.UPDATE_SCROLL_EVENT = 4, exports.UPDATE_VIRTUAL_STATE = 1,
|
|
230
|
-
exports.createContainerDriver = (
|
|
231
|
-
let o, n,
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
for (const {target: l, contentRect: {width:
|
|
235
|
-
const
|
|
236
|
-
null !=
|
|
185
|
+
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 ]);
|
|
237
192
|
}
|
|
238
|
-
|
|
193
|
+
r.length && t.$update(3, r);
|
|
239
194
|
});
|
|
240
195
|
return {
|
|
241
|
-
$observe(
|
|
242
|
-
l.t(o =
|
|
243
|
-
const
|
|
244
|
-
o[
|
|
245
|
-
o[
|
|
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];
|
|
199
|
+
o[t] = "hidden", i(() => {
|
|
200
|
+
o[t] = n;
|
|
246
201
|
});
|
|
247
|
-
}),
|
|
202
|
+
}), r[1](!0);
|
|
248
203
|
},
|
|
249
204
|
$dispose() {
|
|
250
|
-
l.l(), n && n.l(),
|
|
205
|
+
l.l(), n && n.l(), r[1](!1), r = a();
|
|
251
206
|
},
|
|
252
|
-
$observeItem: (
|
|
253
|
-
|
|
207
|
+
$observeItem: (t, e) => (s.set(t, e), l.t(t), () => {
|
|
208
|
+
s.delete(t), l.o(t);
|
|
254
209
|
}),
|
|
255
|
-
async $scroll(
|
|
256
|
-
await
|
|
210
|
+
async $scroll(t, e) {
|
|
211
|
+
await r[0] && n.$(t, e);
|
|
257
212
|
},
|
|
258
213
|
$effect() {
|
|
259
214
|
n && n.i();
|
|
260
215
|
},
|
|
261
|
-
$getBaseOffset:
|
|
216
|
+
$getBaseOffset: t.$getStartSpacerSize
|
|
262
217
|
};
|
|
263
|
-
}, exports.createContainerGridDriver = (
|
|
264
|
-
let o, n,
|
|
265
|
-
const l = /* @__PURE__ */ new WeakMap,
|
|
266
|
-
const
|
|
267
|
-
for (const {target:
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
null !=
|
|
218
|
+
}, 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 ]);
|
|
271
226
|
}
|
|
272
|
-
|
|
227
|
+
r.length && t.$update(3, r), s.length && e.$update(3, s);
|
|
273
228
|
});
|
|
274
229
|
return {
|
|
275
|
-
async $scroll(
|
|
276
|
-
await
|
|
230
|
+
async $scroll(t, e) {
|
|
231
|
+
await s[0] && (t ? r : n).$(e);
|
|
277
232
|
},
|
|
278
233
|
$observe(l) {
|
|
279
|
-
const
|
|
280
|
-
f.t(
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
o[
|
|
284
|
-
o[
|
|
234
|
+
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
|
+
const t = e ? "overflowX" : "overflowY", o = c.style, n = o[t];
|
|
238
|
+
o[t] = "hidden", i(() => {
|
|
239
|
+
o[t] = n;
|
|
285
240
|
});
|
|
286
241
|
});
|
|
287
|
-
n =
|
|
242
|
+
n = u(t, !1), r = u(e, !0), s[1](!0);
|
|
288
243
|
},
|
|
289
244
|
$dispose() {
|
|
290
|
-
f.l(), n && n.l(),
|
|
245
|
+
f.l(), n && n.l(), r && r.l(), s[1](!1), s = a();
|
|
291
246
|
},
|
|
292
|
-
$observeItem: (
|
|
293
|
-
f.t(
|
|
294
|
-
l.delete(
|
|
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);
|
|
295
250
|
}),
|
|
296
251
|
$effect() {
|
|
297
|
-
n && n.i(),
|
|
252
|
+
n && n.i(), r && r.i();
|
|
298
253
|
}
|
|
299
254
|
};
|
|
300
|
-
}, exports.createGridLayout = (
|
|
301
|
-
let i =
|
|
302
|
-
const f =
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
$setLength: e => (o = e, 0),
|
|
321
|
-
$isMeasurable: () => !1,
|
|
322
|
-
$setPinned: f,
|
|
323
|
-
$getPinnedStart: () => a(o),
|
|
324
|
-
$getTrailStart: () => u(o),
|
|
325
|
-
$getSizes: (e, t) => "number" == typeof t ? t : null,
|
|
326
|
-
$setAxis: (e, t) => {
|
|
327
|
-
if (null == e || e === n) return;
|
|
328
|
-
const o = i(t) * (e - n);
|
|
329
|
-
return n = e, o;
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
const p = "auto" === t;
|
|
334
|
-
let g = null;
|
|
335
|
-
const d = [], m = S(h(e), void 0, [ [], 40 + s ]), x = e => p || !!d[e];
|
|
255
|
+
}, exports.createGridLayout = (t, e, r = 0) => {
|
|
256
|
+
let i = w(t);
|
|
257
|
+
const f = "number" == typeof e, u = "auto" === e;
|
|
258
|
+
let a = (f ? e : 40) + r, $ = -1, p = 0, g = u, d = 0, h = 0, b = null;
|
|
259
|
+
const S = [], v = [], y = [], I = t => u || !!y[t], k = () => {
|
|
260
|
+
S.length || m(S, i);
|
|
261
|
+
}, z = t => {
|
|
262
|
+
const e = S[t];
|
|
263
|
+
return -1 === e ? a : e;
|
|
264
|
+
}, M = t => {
|
|
265
|
+
if (!i) return 0;
|
|
266
|
+
if (!S.length) return t * a;
|
|
267
|
+
if ($ >= t) return v[t];
|
|
268
|
+
$ < 0 && (v[0] = 0, $ = 0);
|
|
269
|
+
let e = $, o = v[e];
|
|
270
|
+
for (;e < t; ) o += z(e), v[++e] = o;
|
|
271
|
+
return $ = t, o;
|
|
272
|
+
}, T = (t, e) => {
|
|
273
|
+
S[t] = e, $ = o(t, $);
|
|
274
|
+
}, R = t => S.length ? x(M, i, t) : a ? l(s(t / a), 0, i - 1) : 0, L = () => o(d, i), O = () => n(i - h, L()), _ = t => (S.length ? z(t) : a) - r;
|
|
336
275
|
return {
|
|
337
|
-
$getRange: (
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
$
|
|
342
|
-
$
|
|
343
|
-
$
|
|
344
|
-
$
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
276
|
+
$getRange: (t, e) => {
|
|
277
|
+
const o = M(L()), s = M(i) - M(O()), l = t + (o ? o - r : 0);
|
|
278
|
+
return [ R(l), R(n(l, e - (s ? s - r : 0))) ];
|
|
279
|
+
},
|
|
280
|
+
$findIndex: R,
|
|
281
|
+
$getItemOffset: M,
|
|
282
|
+
$getItemSize: _,
|
|
283
|
+
$resize: (t, e, o, s) => {
|
|
284
|
+
let l = t.reduce((t, [o, n]) => I(o) && e(o) ? t + (n - _(o)) : t, 0);
|
|
285
|
+
for (const [e, o] of t) I(e) && (k(), p += -1 === S[e] ? o : o - _(e), T(e, o + r));
|
|
286
|
+
if (g && s && p > s) {
|
|
287
|
+
let t = 0;
|
|
288
|
+
const e = R(o + l), r = [];
|
|
289
|
+
S.forEach((o, n) => {
|
|
290
|
+
-1 !== o && (o && r.push(o), n < e && t++);
|
|
291
|
+
}), $ = -1, c(r);
|
|
292
|
+
const s = r.length, i = s / 2 | 0, f = s % 2 == 0 ? (r[i - 1] + r[i]) / 2 : r[i], u = a;
|
|
293
|
+
l += ((a = f) - u) * n(e - t, 0), g = !1;
|
|
294
|
+
}
|
|
295
|
+
return l;
|
|
296
|
+
},
|
|
297
|
+
$isSizeEqual: (t, e = -1) => {
|
|
298
|
+
const o = S.length ? S[t] : -1;
|
|
299
|
+
return -1 === e ? I(t) && -1 === o : o === e + r;
|
|
300
|
+
},
|
|
301
|
+
$getTotalSize: () => i ? M(i) - r : 0,
|
|
302
|
+
$getLength: () => i,
|
|
303
|
+
$setLength: t => {
|
|
304
|
+
const e = t - i;
|
|
305
|
+
return $ = o(t - 1, $), i = t, S.length && (e > 0 ? m(S, e) : S.splice(e)), 0;
|
|
306
|
+
},
|
|
307
|
+
$isEstimating: () => g,
|
|
308
|
+
$isMeasurable: I,
|
|
309
|
+
$setPinned: (t = 0, e = 0) => {
|
|
310
|
+
d = t, h = e;
|
|
311
|
+
},
|
|
312
|
+
$getPinnedStart: L,
|
|
313
|
+
$getTrailStart: O,
|
|
314
|
+
$getSizes: (t, e) => "number" == typeof e ? f ? e : null : f || u || "auto" === e ? null : t.map(t => null != t ? t[e] : null),
|
|
315
|
+
$relayout: (t, e) => {
|
|
316
|
+
if (null == t) return;
|
|
317
|
+
if ("number" == typeof t) {
|
|
318
|
+
const o = t + r;
|
|
319
|
+
if (o === a) return;
|
|
320
|
+
const n = R(e) * (o - a);
|
|
321
|
+
return a = o, n;
|
|
322
|
+
}
|
|
323
|
+
if (t === b && i === y.length) return;
|
|
324
|
+
b = t, y.length = i, k();
|
|
325
|
+
const o = R(e), n = M(o);
|
|
326
|
+
let s;
|
|
327
|
+
for (let e = 0; e < i; e++) {
|
|
328
|
+
const o = t[e], n = "number" != typeof o;
|
|
329
|
+
if (!n || !y[e]) {
|
|
330
|
+
y[e] = n;
|
|
331
|
+
const t = n ? -1 : o + r;
|
|
332
|
+
S[e] !== t && (T(e, t), s = !0);
|
|
365
333
|
}
|
|
366
334
|
}
|
|
367
|
-
return
|
|
335
|
+
return s ? M(o) - n : void 0;
|
|
368
336
|
}
|
|
369
337
|
};
|
|
370
|
-
}, exports.createGridPlan = (
|
|
371
|
-
const d =
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
for (const
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
const W =
|
|
378
|
-
for (let
|
|
379
|
-
const {rowIndex:
|
|
380
|
-
if ((
|
|
381
|
-
let
|
|
382
|
-
for (let o = 0; !
|
|
383
|
-
const n =
|
|
384
|
-
|
|
338
|
+
}, exports.createGridPlan = (t, r, [s, i], [f, u], a, $ = e, p = e, g) => {
|
|
339
|
+
const d = t.$getLength(), m = r.$getLength(), x = t.$getPinnedStart(), w = t.$getTrailStart(), v = r.$getPinnedStart(), T = r.$getTrailStart();
|
|
340
|
+
s = l(s, x, w), i = o(i, w - 1), f = l(f, v, T), u = o(u, T - 1);
|
|
341
|
+
const R = b($, x, w), L = n(v - 1, 0), O = [], _ = [], C = [];
|
|
342
|
+
for (const t of p) t.rowIndex < d && t.colIndex < m && (C.push(t), O.push(t.rowIndex));
|
|
343
|
+
const E = C.length, q = S(R, s, w), P = q < 0 ? -1 : R[q];
|
|
344
|
+
P >= 0 && O.push(P);
|
|
345
|
+
const W = y(c(O), d, x, s, i, w);
|
|
346
|
+
for (let t = 0; t < W.length; t++) for (const r of a.get(W[t]) || e) {
|
|
347
|
+
const {rowIndex: e, colIndex: l} = r, c = I(r, d), a = k(r, m);
|
|
348
|
+
if ((t < 1 || W[t - 1] < e) && l < m && (c - e > 1 || a - l > 1)) {
|
|
349
|
+
let t = (e < x || n(e, s) < o(c, i + 1) || w < c || P >= e && P < c) && (l < v || n(l, f) < o(a, u + 1) || T < a);
|
|
350
|
+
for (let o = 0; !t && o < E; o++) {
|
|
351
|
+
const n = C[o];
|
|
352
|
+
t = n.rowIndex >= e && n.rowIndex < c && n.colIndex >= l && n.colIndex < a;
|
|
385
353
|
}
|
|
386
|
-
|
|
354
|
+
t && C.push(r);
|
|
387
355
|
}
|
|
388
356
|
}
|
|
389
|
-
for (const {rowIndex:
|
|
390
|
-
const o =
|
|
391
|
-
O.push(
|
|
357
|
+
for (const {rowIndex: t, colIndex: e} of C) {
|
|
358
|
+
const o = S(R, t, w);
|
|
359
|
+
O.push(t), o >= 0 && O.push(R[o]), _.push(e);
|
|
392
360
|
}
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
for (const
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
const n =
|
|
399
|
-
for (let
|
|
400
|
-
const
|
|
401
|
-
for (let
|
|
361
|
+
c(O), c(_);
|
|
362
|
+
const A = y(O, d, x, s, i, w), B = y(_, m, v, f, u, T), J = A.length, V = B.length, X = /* @__PURE__ */ new Map, Y = [], j = [];
|
|
363
|
+
for (const t of C) {
|
|
364
|
+
const e = I(t, d), o = k(t, m);
|
|
365
|
+
Y.push(e), j.push(o);
|
|
366
|
+
const n = B.indexOf(t.colIndex);
|
|
367
|
+
for (let r = A.indexOf(t.rowIndex); r < J && A[r] < e; r++) {
|
|
368
|
+
const e = A[r] * m;
|
|
369
|
+
for (let r = n; r < V && B[r] < o; r++) X.set(e + B[r], t);
|
|
402
370
|
}
|
|
403
371
|
}
|
|
404
|
-
const
|
|
405
|
-
for (const
|
|
406
|
-
const U = [], Z =
|
|
372
|
+
const D = [];
|
|
373
|
+
for (const t of B) D.push(!r.$isMeasurable(t) && null);
|
|
374
|
+
const U = [], Z = t.$getItemOffset(x), F = [];
|
|
407
375
|
let G = F;
|
|
408
|
-
const H =
|
|
409
|
-
for (const
|
|
410
|
-
const o =
|
|
411
|
-
if (
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
const
|
|
376
|
+
const H = h.get(t), K = /* @__PURE__ */ new Map;
|
|
377
|
+
for (const e of A) {
|
|
378
|
+
const o = e < x, l = e >= w, c = S(R, e, w), a = o ? 0 : l ? w : c < 0 ? -1 : R[c];
|
|
379
|
+
if (e === a) {
|
|
380
|
+
const t = o ? x : l ? d : c + 1 < R.length ? R[c + 1] : w;
|
|
381
|
+
Y.push(t);
|
|
382
|
+
const e = [];
|
|
415
383
|
F.push({
|
|
416
|
-
$key: o ? -1 : l ? -2 : -3 -
|
|
417
|
-
$rows:
|
|
418
|
-
$style:
|
|
419
|
-
}), G =
|
|
420
|
-
} else
|
|
421
|
-
const $ =
|
|
422
|
-
let
|
|
423
|
-
for (let
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
const
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
!1 !==
|
|
431
|
-
const
|
|
384
|
+
$key: o ? -1 : l ? -2 : -3 - a,
|
|
385
|
+
$rows: e,
|
|
386
|
+
$style: M(a, t, o || l ? 0 : null, l ? "bottom" : "top", 4)
|
|
387
|
+
}), G = e;
|
|
388
|
+
} else a < 0 && (G = F);
|
|
389
|
+
const $ = c >= 0 && e === a, p = o || l || e === P || e >= s && e <= i, h = $ ? Z : null, b = e * m, y = H && H.get(e), z = y && y.$cells, O = [];
|
|
390
|
+
let _ = 0, C = !t.$isMeasurable(e) && null, E = e + 1, q = !1;
|
|
391
|
+
for (let t = 0; t < V; t++) {
|
|
392
|
+
const s = B[t], l = s < v, c = s >= T, i = l || c || s >= f && s <= u, a = X.get(b + s);
|
|
393
|
+
if (a ? a.rowIndex === e && a.colIndex === s : p && i) {
|
|
394
|
+
const i = a ? I(a, d) : e + 1, f = a ? k(a, m) : s + 1, u = i - e, p = f - s, x = u > 1, w = p > 1, h = x || w;
|
|
395
|
+
let b, S;
|
|
396
|
+
E = n(E, i);
|
|
397
|
+
const v = l ? r.$getItemOffset(s) : null, y = c ? r.$getItemOffset(m) - r.$getItemOffset(f) : null;
|
|
398
|
+
!1 !== C || x || (b = e, C = !0), !1 !== D[t] || w || (S = s, D[t] = !0);
|
|
399
|
+
const M = o ? "columnheader" : s === L && (l || $) ? "rowheader" : "cell", T = h ? u : void 0, R = h ? p : void 0, P = "cell" !== M && g && g.rowIndex === e && g.colIndex === s ? g.order : void 0;
|
|
432
400
|
let W;
|
|
433
|
-
if (
|
|
434
|
-
const
|
|
435
|
-
for (;
|
|
436
|
-
|
|
401
|
+
if (z) {
|
|
402
|
+
const t = z.length;
|
|
403
|
+
for (;_ < t && z[_].$col < s; ) _++;
|
|
404
|
+
_ < t && z[_].$col === s && (W = z[_]);
|
|
437
405
|
}
|
|
438
|
-
if (!W || W.$rowSpan !== T || W.$colSpan !==
|
|
439
|
-
let
|
|
440
|
-
h && (
|
|
441
|
-
const
|
|
406
|
+
if (!W || W.$rowSpan !== T || W.$colSpan !== R || W.$start !== v || W.$end !== y || W.$measureRow !== b || W.$measureCol !== S || W.$role !== M || W.$sort !== P) {
|
|
407
|
+
let t = "1/l" + s;
|
|
408
|
+
h && (t += "/l" + i + "/l" + f);
|
|
409
|
+
const e = {
|
|
442
410
|
contain: "layout style",
|
|
443
411
|
display: "grid",
|
|
444
|
-
gridArea:
|
|
412
|
+
gridArea: t
|
|
445
413
|
};
|
|
446
|
-
x && (
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
$col:
|
|
414
|
+
x && (e.height = "0px", e.minHeight = "100%", e.zIndex = 1), w && (e.width = "0px",
|
|
415
|
+
e.minWidth = "100%"), (l || c) && (e[l ? "insetInlineStart" : "insetInlineEnd"] = (l ? v : y) + "px",
|
|
416
|
+
e.position = "sticky", e.zIndex = 2), W = {
|
|
417
|
+
$col: s,
|
|
450
418
|
$rowSpan: T,
|
|
451
|
-
$colSpan:
|
|
452
|
-
$measureRow:
|
|
453
|
-
$measureCol:
|
|
454
|
-
$role:
|
|
455
|
-
$sort:
|
|
456
|
-
$style:
|
|
457
|
-
$start:
|
|
458
|
-
$end:
|
|
459
|
-
},
|
|
419
|
+
$colSpan: R,
|
|
420
|
+
$measureRow: b,
|
|
421
|
+
$measureCol: S,
|
|
422
|
+
$role: M,
|
|
423
|
+
$sort: P,
|
|
424
|
+
$style: e,
|
|
425
|
+
$start: v,
|
|
426
|
+
$end: y
|
|
427
|
+
}, q = !0;
|
|
460
428
|
}
|
|
461
429
|
O.push(W);
|
|
462
430
|
}
|
|
463
431
|
}
|
|
464
|
-
if (U.push(
|
|
465
|
-
const
|
|
466
|
-
$row:
|
|
432
|
+
if (U.push(C), O.length) {
|
|
433
|
+
const t = y && !q && y.$cells.length === O.length && y.$top === h ? y : {
|
|
434
|
+
$row: e,
|
|
467
435
|
$cells: O,
|
|
468
|
-
$style:
|
|
469
|
-
$top:
|
|
436
|
+
$style: M(e, E, h, "top", 3),
|
|
437
|
+
$top: h
|
|
470
438
|
};
|
|
471
|
-
K.set(
|
|
439
|
+
K.set(e, t), G.push(t);
|
|
472
440
|
}
|
|
473
441
|
}
|
|
474
|
-
return
|
|
475
|
-
$rowTemplate:
|
|
476
|
-
$colTemplate:
|
|
442
|
+
return h.set(t, K), {
|
|
443
|
+
$rowTemplate: z(t, A, U, c(Y), "max-content", d),
|
|
444
|
+
$colTemplate: z(r, B, D, c(j), "minmax(max-content,auto)", m),
|
|
477
445
|
$groups: F
|
|
478
446
|
};
|
|
479
|
-
}, exports.createGridSpanIndex = (
|
|
447
|
+
}, exports.createGridSpanIndex = (t = e) => {
|
|
480
448
|
const o = /* @__PURE__ */ new Map;
|
|
481
|
-
for (const
|
|
482
|
-
const
|
|
483
|
-
for (let n =
|
|
484
|
-
const
|
|
485
|
-
|
|
449
|
+
for (const e of t) {
|
|
450
|
+
const t = e.rowIndex + (e.rowSpan || 1);
|
|
451
|
+
for (let n = e.rowIndex; n < t; n++) {
|
|
452
|
+
const t = o.get(n);
|
|
453
|
+
t ? t.push(e) : o.set(n, [ e ]);
|
|
486
454
|
}
|
|
487
455
|
}
|
|
488
456
|
return o;
|
|
489
|
-
}, exports.createListLayout =
|
|
490
|
-
let
|
|
491
|
-
const
|
|
492
|
-
|
|
457
|
+
}, exports.createListLayout = (t, e, r) => {
|
|
458
|
+
let s = r && r[1] || e || 40, l = -1, i = 0, f = !e, u = 0;
|
|
459
|
+
const a = r && r[0], $ = a ? m(a.slice(0, o(t, a.length)), n(0, t - a.length)) : m([], t), p = m([], t + 1), g = t => {
|
|
460
|
+
const e = $[t];
|
|
461
|
+
return -1 === e ? s : e;
|
|
462
|
+
}, d = e => {
|
|
463
|
+
if (!t) return 0;
|
|
464
|
+
if (l >= e) return p[e];
|
|
465
|
+
l < 0 && (p[0] = 0, l = 0);
|
|
466
|
+
let o = l, n = p[o];
|
|
467
|
+
for (;o < e; ) n += g(o), p[++o] = n;
|
|
468
|
+
return l = e, n;
|
|
469
|
+
};
|
|
470
|
+
return {
|
|
471
|
+
$getRange: (e, n) => {
|
|
472
|
+
let r, s;
|
|
473
|
+
return u = o(u, t - 1), d(u) <= e ? (s = x(d, t, n, u), r = x(d, t, e, u, s)) : (r = x(d, t, e, void 0, u),
|
|
474
|
+
s = x(d, t, n, r)), u = r, [ r, s ];
|
|
475
|
+
},
|
|
476
|
+
$findIndex: e => x(d, t, e),
|
|
477
|
+
$getItemOffset: d,
|
|
478
|
+
$getItemSize: g,
|
|
479
|
+
$isSizeEqual: (t, e = -1) => $[t] === e,
|
|
480
|
+
$resize: (e, r, u, a) => {
|
|
481
|
+
let p = e.reduce((t, [e, o]) => r(e) ? t + (o - g(e)) : t, 0);
|
|
482
|
+
for (const [t, n] of e) i += -1 === $[t] ? n : n - g(t), $[t] = n, l = o(t, l);
|
|
483
|
+
if (f && a && i > a) {
|
|
484
|
+
let e = 0;
|
|
485
|
+
const o = x(d, t, u + p), r = [];
|
|
486
|
+
$.forEach((t, n) => {
|
|
487
|
+
-1 !== t && (t && r.push(t), n < o && e++);
|
|
488
|
+
}), l = -1, c(r);
|
|
489
|
+
const i = r.length, a = i / 2 | 0, g = i % 2 == 0 ? (r[a - 1] + r[a]) / 2 : r[a], m = s;
|
|
490
|
+
p += ((s = g) - m) * n(o - e, 0), f = !1;
|
|
491
|
+
}
|
|
492
|
+
return p;
|
|
493
|
+
},
|
|
494
|
+
$getTotalSize: () => d(t),
|
|
495
|
+
$getLength: () => t,
|
|
496
|
+
$setLength: (e, n) => {
|
|
497
|
+
const r = e - t;
|
|
498
|
+
return l = n ? -1 : o(e - 1, l), t = e, r > 0 ? (m(p, r), m($, r, n), s * r) : (p.splice(r),
|
|
499
|
+
(n ? $.splice(0, -r) : $.splice(r)).reduce((t, e) => t - (-1 === e ? s : e), 0));
|
|
500
|
+
},
|
|
501
|
+
$isEstimating: () => f,
|
|
502
|
+
$snapshot: () => [ $.slice(), s ]
|
|
503
|
+
};
|
|
504
|
+
}, exports.createVirtualStore = ({$getRange: t, $findIndex: e, $getItemOffset: s, $getItemSize: l, $isSizeEqual: c, $getTotalSize: i, $getLength: f, $setLength: u, $isEstimating: a, $resize: $, $relayout: p}, g = 0) => {
|
|
505
|
+
let m = !!g, x = 1, w = 0, h = 0, b = 0, S = 0, v = 0, y = 0, I = 0, k = 0, z = null, M = [ 0, m ? n(g - 1, 0) : -1 ], T = !1;
|
|
506
|
+
const R = /* @__PURE__ */ new Set, L = () => b - h, O = () => L() + v + S, _ = t => s(t) - v, C = t => {
|
|
507
|
+
if (2 === k) return !0;
|
|
508
|
+
if (z && 1 === k) return t < z[0];
|
|
509
|
+
const e = L(), o = _(t), n = l(t);
|
|
510
|
+
return 1 !== I && 0 === k ? o + n <= e : o < e && o + n < e + w;
|
|
511
|
+
}, E = t => {
|
|
512
|
+
t && (d() && 0 !== I || z && 1 === k ? v += t : S += t);
|
|
493
513
|
};
|
|
494
514
|
return {
|
|
495
515
|
$dispose: () => {
|
|
496
516
|
R.clear();
|
|
497
517
|
},
|
|
498
518
|
$getStateVersion: () => x,
|
|
499
|
-
$getRange: (
|
|
500
|
-
if (!
|
|
501
|
-
let
|
|
502
|
-
if (
|
|
503
|
-
let l = n(0,
|
|
504
|
-
|
|
505
|
-
|
|
519
|
+
$getRange: (e = 200) => {
|
|
520
|
+
if (!T || m) return M;
|
|
521
|
+
let r, s;
|
|
522
|
+
if (y) [r, s] = M; else {
|
|
523
|
+
let l = n(0, O()), c = l + w;
|
|
524
|
+
a() || (e = n(0, e), 1 !== I && (l -= e), 2 !== I && (c += e)), [r, s] = M = t(n(0, l), n(0, c)),
|
|
525
|
+
z && (r = o(r, z[0]), s = n(s, z[1]));
|
|
506
526
|
}
|
|
507
|
-
return [ n(
|
|
527
|
+
return [ n(r, 0), o(s, f() - 1) ];
|
|
508
528
|
},
|
|
509
|
-
$findItemIndex:
|
|
529
|
+
$findItemIndex: t => e(t - h),
|
|
510
530
|
$isUnmeasuredItem: c,
|
|
511
531
|
$getItemOffset: _,
|
|
512
532
|
$getItemSize: l,
|
|
513
|
-
$getItemsLength:
|
|
514
|
-
$getScrollOffset: () =>
|
|
515
|
-
$isScrolling: () => 0 !==
|
|
516
|
-
$getViewportSize: () =>
|
|
533
|
+
$getItemsLength: f,
|
|
534
|
+
$getScrollOffset: () => b,
|
|
535
|
+
$isScrolling: () => 0 !== I,
|
|
536
|
+
$getViewportSize: () => w,
|
|
517
537
|
$getStartSpacerSize: () => h,
|
|
518
|
-
$getTotalSize:
|
|
519
|
-
u: () => (
|
|
520
|
-
$subscribe: (
|
|
521
|
-
const o = [
|
|
538
|
+
$getTotalSize: i,
|
|
539
|
+
u: () => (y = S, S = 0, [ y, 2 === k ]),
|
|
540
|
+
$subscribe: (t, e) => {
|
|
541
|
+
const o = [ t, e ];
|
|
522
542
|
return R.add(o), () => {
|
|
523
543
|
R.delete(o);
|
|
524
544
|
};
|
|
525
545
|
},
|
|
526
|
-
$update: (
|
|
527
|
-
let
|
|
528
|
-
switch (
|
|
546
|
+
$update: (e, o) => {
|
|
547
|
+
let n, s, l = 0;
|
|
548
|
+
switch (e) {
|
|
529
549
|
case 1:
|
|
530
550
|
{
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
|
|
551
|
+
if (o === b && 0 === k) break;
|
|
552
|
+
const t = y;
|
|
553
|
+
y = 0;
|
|
554
|
+
const e = o - b, n = r(e);
|
|
555
|
+
t && n < r(t) + 1 || 0 !== k || (I = e < 0 ? 2 : 1), m && (m = !1), b = o, l = 4;
|
|
556
|
+
const c = L();
|
|
557
|
+
c >= -w && c <= i() && (l += 1, s = n > w);
|
|
538
558
|
break;
|
|
539
559
|
}
|
|
540
560
|
|
|
541
561
|
case 2:
|
|
542
|
-
|
|
562
|
+
l = 8, 0 !== I && (n = !0, l += 1), I = 0, k = 0, z = null;
|
|
543
563
|
break;
|
|
544
564
|
|
|
545
565
|
case 3:
|
|
546
566
|
{
|
|
547
|
-
const
|
|
548
|
-
if (!
|
|
549
|
-
|
|
550
|
-
let n;
|
|
551
|
-
if (2 === y) n = !0; else if (k && 1 === y) n = t < k[0]; else {
|
|
552
|
-
const e = O(), o = _(t), s = l(t);
|
|
553
|
-
n = 1 !== z && 0 === y ? o + s <= e : o < e && o + s < e + S;
|
|
554
|
-
}
|
|
555
|
-
return n && (e += o - l(t)), e;
|
|
556
|
-
}, 0));
|
|
557
|
-
for (const [t, o] of e) {
|
|
558
|
-
const e = l(t), n = i(t, o);
|
|
559
|
-
g && (T += n ? o : o - e);
|
|
560
|
-
}
|
|
561
|
-
g && S && T > S && (q($(t(P()))), g = !1), p = 3, a = !0;
|
|
567
|
+
const t = o.filter(([t, e]) => !c(t, e));
|
|
568
|
+
if (!t.length) break;
|
|
569
|
+
E($(t, C, O(), w)), l = 3, s = !0;
|
|
562
570
|
break;
|
|
563
571
|
}
|
|
564
572
|
|
|
565
573
|
case 4:
|
|
566
|
-
|
|
574
|
+
w !== o && (w || (T = s = !0), w = o, l = 3);
|
|
567
575
|
break;
|
|
568
576
|
|
|
569
577
|
case 5:
|
|
570
|
-
|
|
578
|
+
o[1] ? (E(u(o[0], !0)), k = 2, l = 1) : (u(o[0]), l = 1);
|
|
571
579
|
break;
|
|
572
580
|
|
|
573
581
|
case 6:
|
|
574
|
-
h =
|
|
582
|
+
h = o;
|
|
575
583
|
break;
|
|
576
584
|
|
|
577
585
|
case 7:
|
|
578
|
-
|
|
586
|
+
k = 1;
|
|
579
587
|
break;
|
|
580
588
|
|
|
581
589
|
case 9:
|
|
582
|
-
|
|
583
|
-
|
|
590
|
+
{
|
|
591
|
+
const t = p(o, O());
|
|
592
|
+
null != t && (E(t), l = 3);
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
584
595
|
|
|
585
596
|
case 8:
|
|
586
|
-
|
|
597
|
+
z = t(o, o + w), l = 1;
|
|
587
598
|
}
|
|
588
|
-
|
|
589
|
-
|
|
599
|
+
l && (x = 1 + (2147483647 & x), n && v && (S += v, v = 0), R.forEach(([t, e]) => {
|
|
600
|
+
l & t && e(s);
|
|
590
601
|
}));
|
|
591
602
|
}
|
|
592
603
|
};
|
|
593
|
-
}, exports.createWindowDriver = (
|
|
594
|
-
let o, n,
|
|
595
|
-
const
|
|
596
|
-
const
|
|
597
|
-
for (const {target:
|
|
598
|
-
const o =
|
|
599
|
-
null != o &&
|
|
604
|
+
}, exports.createWindowDriver = (t, e) => {
|
|
605
|
+
let o, n, r, s, l, c = a();
|
|
606
|
+
const i = /* @__PURE__ */ new WeakMap, f = T(n => {
|
|
607
|
+
const r = [];
|
|
608
|
+
for (const {target: t, contentRect: {width: s, height: c}} of n) if (t === o) l && l(); else if (t.offsetParent) {
|
|
609
|
+
const o = i.get(t);
|
|
610
|
+
null != o && r.push([ o, e ? s : c ]);
|
|
600
611
|
}
|
|
601
|
-
|
|
612
|
+
r.length && t.$update(3, r);
|
|
602
613
|
});
|
|
603
614
|
return {
|
|
604
|
-
$observe(
|
|
605
|
-
const
|
|
606
|
-
const
|
|
607
|
-
return
|
|
608
|
-
}, x =
|
|
609
|
-
|
|
615
|
+
$observe(i) {
|
|
616
|
+
const u = p(i), a = g(u), $ = o = u.scrollingElement, d = e && "rtl" === getComputedStyle($).direction, m = (t, e, o, n, r = 0) => {
|
|
617
|
+
const s = n ? "offsetLeft" : "offsetTop", l = r + (d ? e.clientWidth - t[s] - t.offsetWidth : t[s]), c = t.offsetParent;
|
|
618
|
+
return t !== o && c ? m(c, e, o, n, l) : l;
|
|
619
|
+
}, x = s = () => m(i, $, u.body, e), w = l = () => {
|
|
620
|
+
t.$update(4, $[e ? "clientWidth" : "clientHeight"]);
|
|
610
621
|
};
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
}, n = R(
|
|
622
|
+
a.addEventListener("resize", w), f.t($), r = () => {
|
|
623
|
+
a.removeEventListener("resize", w);
|
|
624
|
+
}, n = R(t, a, $, e, d, null, x), c[1](!0);
|
|
614
625
|
},
|
|
615
626
|
$dispose() {
|
|
616
|
-
|
|
627
|
+
r && r(), f.l(), n && n.l(), c[1](!1), c = a();
|
|
617
628
|
},
|
|
618
|
-
$observeItem: (
|
|
619
|
-
|
|
629
|
+
$observeItem: (t, e) => (i.set(t, e), f.t(t), () => {
|
|
630
|
+
i.delete(t), f.o(t);
|
|
620
631
|
}),
|
|
621
|
-
async $scroll(
|
|
622
|
-
await
|
|
632
|
+
async $scroll(t, e) {
|
|
633
|
+
await c[0] && n.$(t, e);
|
|
623
634
|
},
|
|
624
635
|
$effect() {
|
|
625
636
|
n && n.i();
|
|
626
637
|
},
|
|
627
|
-
$getBaseOffset: () =>
|
|
638
|
+
$getBaseOffset: () => s()
|
|
628
639
|
};
|
|
629
|
-
}, exports.getAxisItem = (
|
|
630
|
-
exports.getScrollSize =
|
|
640
|
+
}, exports.getAxisItem = (t, e) => "number" == typeof t ? e : t[e], exports.getAxisLength = w,
|
|
641
|
+
exports.getScrollSize = t => n(t.$getTotalSize(), t.$getViewportSize()), exports.gridScrollBy = (t, e, o, n, r) => {
|
|
631
642
|
if (null != n) {
|
|
632
|
-
const o = n +
|
|
633
|
-
|
|
643
|
+
const o = n + e.$getScrollOffset();
|
|
644
|
+
t.$scroll(!1, () => o);
|
|
634
645
|
}
|
|
635
|
-
if (null !=
|
|
636
|
-
const
|
|
637
|
-
|
|
646
|
+
if (null != r) {
|
|
647
|
+
const e = r + o.$getScrollOffset();
|
|
648
|
+
t.$scroll(!0, () => e);
|
|
638
649
|
}
|
|
639
|
-
}, exports.gridScrollTo = (
|
|
640
|
-
null !=
|
|
641
|
-
}, exports.gridScrollToIndex = (
|
|
642
|
-
null !=
|
|
643
|
-
}, exports.gridStyleToString =
|
|
644
|
-
let
|
|
645
|
-
for (const o in
|
|
646
|
-
return
|
|
647
|
-
}, exports.isBrowser = $, exports.microtask =
|
|
648
|
-
|
|
649
|
-
}, exports.scrollTo =
|
|
650
|
-
if (o = l(o, 0,
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
if (!(
|
|
650
|
+
}, exports.gridScrollTo = (t, e, o) => {
|
|
651
|
+
null != e && t.$scroll(!1, () => e), null != o && t.$scroll(!0, () => o);
|
|
652
|
+
}, exports.gridScrollToIndex = (t, o, n, r, s, l = e, {rowIndex: c, colIndex: i, rowAlign: f, colAlign: u}) => {
|
|
653
|
+
null != c && O(t, o, r, l, c, f, !1), null != i && O(t, n, s, e, i, u, !0);
|
|
654
|
+
}, exports.gridStyleToString = t => {
|
|
655
|
+
let e = "";
|
|
656
|
+
for (const o in t) e += o.replace(/[A-Z]/g, t => "-" + t.toLowerCase()) + ":" + t[o] + ";";
|
|
657
|
+
return e;
|
|
658
|
+
}, exports.isBrowser = $, exports.microtask = u, exports.scrollBy = (t, e, o) => {
|
|
659
|
+
L(t, o + e.$getScrollOffset());
|
|
660
|
+
}, exports.scrollTo = L, exports.scrollToIndex = (t, e, o, {align: n, smooth: r, offset: s = 0} = {}) => {
|
|
661
|
+
if (o = l(o, 0, e.$getItemsLength() - 1), "nearest" === n) {
|
|
662
|
+
const t = e.$getItemOffset(o), r = e.$getScrollOffset();
|
|
663
|
+
if (t < r) n = "start"; else {
|
|
664
|
+
if (!(t + e.$getItemSize(o) > r + e.$getViewportSize())) return;
|
|
654
665
|
n = "end";
|
|
655
666
|
}
|
|
656
667
|
}
|
|
657
|
-
|
|
658
|
-
}, exports.sort =
|
|
659
|
-
const l = h(o);
|
|
660
|
-
t.$setPinned(s, r), l !== e.$getItemsLength() && e.$update(5, [ l ]);
|
|
661
|
-
const i = t.$setAxis(n, e.$getScrollOffset() - e.$getItemOffset(0));
|
|
662
|
-
null != i && e.$update(9, i);
|
|
663
|
-
};
|
|
668
|
+
t.$scroll(() => s + t.$getBaseOffset() + e.$getItemOffset(o) + ("end" === n ? e.$getItemSize(o) - e.$getViewportSize() : "center" === n ? (e.$getItemSize(o) - e.$getViewportSize()) / 2 : 0), r);
|
|
669
|
+
}, exports.sort = c;
|
|
664
670
|
//# sourceMappingURL=index.cjs.map
|