@svgrid/grid-wc 3.0.12 → 3.0.14

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.
Files changed (38) hide show
  1. package/dist/GridFooter-DaqpUo5H.js +145 -0
  2. package/dist/GridMenus-BXla2VNU.js +1367 -0
  3. package/dist/PinSplitter-Qd1_-3pw.js +130 -0
  4. package/dist/{shadow/SvGrid.helpers-zBkDTryR.js → SvGrid.helpers-B2GEKrxS.js} +84 -36
  5. package/dist/{shadow/SvGridCellEditor-C2t-q8n3.js → SvGridCellEditor-DdqVsNeJ.js} +20 -9
  6. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +37 -3
  7. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
  8. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +15 -1
  9. package/dist/conditional-formatting-LFQdw2jz.js +180 -0
  10. package/dist/{shadow/export-format-DQtIyOvV.js → export-format-DIcJWdKl.js} +1 -1
  11. package/dist/grid-extension.svelte-6IzZ_3Cv.js +20 -0
  12. package/dist/react/index.d.ts +34 -0
  13. package/dist/react/index.js +7 -1
  14. package/dist/shadow/GridFooter-BBBUK5Ry.js +145 -0
  15. package/dist/shadow/GridMenus-DGiPj4-r.js +1367 -0
  16. package/dist/shadow/PinSplitter-Qd1_-3pw.js +130 -0
  17. package/dist/{SvGrid.helpers-zBkDTryR.js → shadow/SvGrid.helpers-B2GEKrxS.js} +84 -36
  18. package/dist/{SvGridCellEditor-C2t-q8n3.js → shadow/SvGridCellEditor-DdqVsNeJ.js} +20 -9
  19. package/dist/shadow/conditional-formatting-LFQdw2jz.js +180 -0
  20. package/dist/{export-format-CXEUNl8j.js → shadow/export-format-DIcJWdKl.js} +1 -1
  21. package/dist/shadow/grid-extension.svelte-6IzZ_3Cv.js +20 -0
  22. package/dist/shadow/sparkline-DWRBQubt.js +86 -0
  23. package/dist/shadow/sv-grid-shadow-element.d.ts +22 -0
  24. package/dist/shadow/sv-grid-shadow-element.js +3626 -3710
  25. package/dist/shadow/svelte-virtualizer.svelte-Bftvroa6.js +360 -0
  26. package/dist/shadow/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
  27. package/dist/sparkline-DWRBQubt.js +86 -0
  28. package/dist/sv-grid-element.d.ts +22 -0
  29. package/dist/sv-grid-element.js +3284 -3368
  30. package/dist/svelte-virtualizer.svelte-Bftvroa6.js +360 -0
  31. package/dist/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
  32. package/dist/vue/index.d.ts +16 -2
  33. package/dist/vue/index.js +1 -1
  34. package/package.json +3 -3
  35. package/dist/GridMenus-BsOHO9kc.js +0 -1086
  36. package/dist/shadow/GridMenus-BsOHO9kc.js +0 -1086
  37. package/dist/shadow/svelte-virtualizer.svelte-BGip4kwG.js +0 -581
  38. package/dist/svelte-virtualizer.svelte-BGip4kwG.js +0 -581
@@ -1,581 +0,0 @@
1
- import { $ as e, Q as t, z as n } from "./client-wYhMjrKG.js";
2
- //#region ../grid/dist/sv-grid-scrollbar.js
3
- var r = 16, i = 280, a = 50, o = "http://www.w3.org/2000/svg";
4
- function s() {
5
- let e = document.createElementNS(o, "svg");
6
- e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "3"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round");
7
- let t = document.createElementNS(o, "path");
8
- return t.setAttribute("d", "M6 9l6 6 6-6"), e.appendChild(t), e;
9
- }
10
- var c = `
11
- :host {
12
- display: flex;
13
- user-select: none;
14
- background: var(--sg-scrollbar-bg, #eef2f8);
15
- /* The 1px separator is drawn on the INNER edge only (the edge facing
16
- the grid body) via the orientation rules below. A full inset box
17
- here doubled up with the grid's own frame border on the outer edge,
18
- reading as a 2px border - most visible in dense-gridline themes
19
- like Excel, which should show a single 1px line. */
20
- /* Start hidden + non-interactive - viewport/content sizes are 0 until
21
- after the first layout pass, so without this default the scrollbar
22
- paints visible for one frame and then JS hides it on mount. That
23
- flicker is what shows up as a "flashing horizontal scrollbar"
24
- every time a demo first renders. updateGeometry() switches us to
25
- opacity 1 the moment the grid genuinely has overflow. */
26
- opacity: 0;
27
- pointer-events: none;
28
- transition: opacity 120ms ease;
29
- }
30
- :host([orientation="vertical"]) {
31
- flex-direction: column;
32
- width: ${r}px;
33
- /* LTR: vertical scrollbar sits at the right, inner edge is the left. */
34
- box-shadow: inset 1px 0 0 0 var(--sg-scrollbar-border, rgba(15, 23, 42, 0.04));
35
- }
36
- :host([orientation="vertical"]:dir(rtl)) {
37
- /* RTL flips the scrollbar to the left, so the inner edge is the right. */
38
- box-shadow: inset -1px 0 0 0 var(--sg-scrollbar-border, rgba(15, 23, 42, 0.04));
39
- }
40
- :host([orientation="horizontal"]) {
41
- flex-direction: row;
42
- height: ${r}px;
43
- /* Horizontal scrollbar sits at the bottom, inner edge is the top. */
44
- box-shadow: inset 0 1px 0 0 var(--sg-scrollbar-border, rgba(15, 23, 42, 0.04));
45
- }
46
- .arrow {
47
- flex: none;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- width: ${r}px;
52
- height: ${r}px;
53
- margin: 0;
54
- padding: 0;
55
- border: 0;
56
- border-radius: 3px;
57
- background: transparent;
58
- color: var(--sg-scrollbar-arrow, #64748b);
59
- cursor: pointer;
60
- transition: background-color 100ms ease, color 100ms ease;
61
- }
62
- .arrow:hover {
63
- background: var(--sg-scrollbar-arrow-hover-bg, #dde4ee);
64
- color: var(--sg-scrollbar-arrow-hover, #1f2937);
65
- }
66
- .arrow:active {
67
- background: var(--sg-scrollbar-arrow-active-bg, #c7d1df);
68
- color: var(--sg-scrollbar-arrow-active, #0f172a);
69
- }
70
- .arrow:disabled {
71
- color: var(--sg-scrollbar-arrow-disabled, #cbd5e1);
72
- cursor: default;
73
- }
74
- .arrow:disabled:hover {
75
- background: transparent;
76
- }
77
- .arrow svg {
78
- width: 10px;
79
- height: 10px;
80
- display: block;
81
- }
82
- :host([orientation="vertical"]) .arrow-start svg {
83
- transform: rotate(180deg);
84
- }
85
- :host([orientation="horizontal"]) .arrow-start svg {
86
- transform: rotate(90deg);
87
- }
88
- :host([orientation="horizontal"]) .arrow-end svg {
89
- transform: rotate(-90deg);
90
- }
91
- .track {
92
- position: relative;
93
- flex: 1 1 0;
94
- min-width: 0;
95
- min-height: 0;
96
- }
97
- .thumb {
98
- position: absolute;
99
- border-radius: var(--sg-scrollbar-thumb-radius, 6px);
100
- background: var(--sg-scrollbar-thumb, #b1bccd);
101
- cursor: pointer;
102
- transition: background-color 100ms ease;
103
- }
104
- .thumb:hover {
105
- background: var(--sg-scrollbar-thumb-hover, #8693a7);
106
- }
107
- .thumb:active {
108
- background: var(--sg-scrollbar-thumb-active, #64748b);
109
- }
110
- :host([orientation="vertical"]) .thumb {
111
- left: 3px;
112
- right: 3px;
113
- }
114
- :host([orientation="horizontal"]) .thumb {
115
- top: 3px;
116
- bottom: 3px;
117
- }
118
- `, l = typeof HTMLElement < "u" ? HTMLElement : class {}, u = class extends l {
119
- constructor() {
120
- super(...arguments), this.dragging = !1, this.dragStart = 0, this.valueStart = 0, this.holdTimer = null, this.resizeObserver = null, this.resizeFrame = 0, this.onArrowStartPointerDown = (e) => {
121
- e.preventDefault(), this.startHold(-1);
122
- }, this.onArrowEndPointerDown = (e) => {
123
- e.preventDefault(), this.startHold(1);
124
- }, this.stopHold = () => {
125
- this.holdTimer !== null && (clearTimeout(this.holdTimer), clearInterval(this.holdTimer), this.holdTimer = null);
126
- }, this.onThumbPointerDown = (e) => {
127
- e.preventDefault(), this.dragging = !0, this.dragStart = this.orientation === "vertical" ? e.clientY : e.clientX, this.valueStart = this.value, document.addEventListener("pointermove", this.onPointerMove), document.addEventListener("pointerup", this.onPointerUp);
128
- }, this.onTrackPointerDown = (e) => {
129
- if (e.target === this.thumb) return;
130
- let t = this.track.getBoundingClientRect(), n = this.orientation === "vertical" ? e.clientY - t.top : e.clientX - t.left, r = this.orientation === "vertical" ? t.height : t.width, i = this.computeThumbSize(r), a = Math.max(r - i, 1), o = Math.min(Math.max(n - i / 2, 0), a);
131
- this.emitScroll(o / a * this.maxValue);
132
- }, this.onPointerMove = (e) => {
133
- if (!this.dragging) return;
134
- let t = (this.orientation === "vertical" ? e.clientY : e.clientX) - this.dragStart, n = this.track.getBoundingClientRect(), r = this.orientation === "vertical" ? n.height : n.width, i = this.computeThumbSize(r), a = Math.max(r - i, 1);
135
- this.emitScroll(this.valueStart + t / a * this.maxValue);
136
- }, this.onPointerUp = () => {
137
- this.dragging = !1, document.removeEventListener("pointermove", this.onPointerMove), document.removeEventListener("pointerup", this.onPointerUp);
138
- };
139
- }
140
- static get observedAttributes() {
141
- return [
142
- "orientation",
143
- "viewport-size",
144
- "content-size",
145
- "value",
146
- "step"
147
- ];
148
- }
149
- connectedCallback() {
150
- if (this.shadowRoot) return;
151
- let e = this.attachShadow({ mode: "open" }), t = document.createElement("style");
152
- t.textContent = c, this.startArrow = this.createArrow("start"), this.endArrow = this.createArrow("end"), this.track = document.createElement("div"), this.track.className = "track", this.thumb = document.createElement("div"), this.thumb.className = "thumb", this.track.appendChild(this.thumb), e.append(t, this.startArrow, this.track, this.endArrow), this.thumb.addEventListener("pointerdown", this.onThumbPointerDown), this.track.addEventListener("pointerdown", this.onTrackPointerDown), this.startArrow.addEventListener("pointerdown", this.onArrowStartPointerDown), this.endArrow.addEventListener("pointerdown", this.onArrowEndPointerDown);
153
- for (let e of [this.startArrow, this.endArrow]) e.addEventListener("pointerup", this.stopHold), e.addEventListener("pointerleave", this.stopHold), e.addEventListener("pointercancel", this.stopHold);
154
- this.resizeObserver = new ResizeObserver(() => {
155
- this.resizeFrame ||= requestAnimationFrame(() => {
156
- this.resizeFrame = 0, this.render();
157
- });
158
- }), this.resizeObserver.observe(this), this.render();
159
- }
160
- disconnectedCallback() {
161
- this.stopHold(), this.resizeFrame && cancelAnimationFrame(this.resizeFrame), this.resizeFrame = 0, this.resizeObserver?.disconnect(), this.resizeObserver = null, document.removeEventListener("pointermove", this.onPointerMove), document.removeEventListener("pointerup", this.onPointerUp);
162
- }
163
- attributeChangedCallback() {
164
- this.render();
165
- }
166
- get orientation() {
167
- return this.getAttribute("orientation") === "horizontal" ? "horizontal" : "vertical";
168
- }
169
- get viewportSize() {
170
- return Number(this.getAttribute("viewport-size") || "0");
171
- }
172
- get contentSize() {
173
- return Number(this.getAttribute("content-size") || "0");
174
- }
175
- get value() {
176
- return Number(this.getAttribute("value") || "0");
177
- }
178
- get step() {
179
- let e = Number(this.getAttribute("step") || "40");
180
- return e > 0 ? e : 40;
181
- }
182
- get maxValue() {
183
- return Math.max(this.contentSize - this.viewportSize, 0);
184
- }
185
- getTrackLength() {
186
- let e = this.track.getBoundingClientRect(), t = this.orientation === "vertical" ? e.height : e.width;
187
- return t > 0 ? t : Math.max(this.viewportSize - 32, 1);
188
- }
189
- computeThumbSize(e) {
190
- if (this.contentSize <= 0 || this.viewportSize <= 0 || e <= 0) return 0;
191
- let t = Math.min(this.viewportSize / this.contentSize, 1);
192
- return Math.max(20, t * e);
193
- }
194
- createArrow(e) {
195
- let t = document.createElement("button");
196
- return t.type = "button", t.className = `arrow arrow-${e}`, t.setAttribute("aria-label", e === "start" ? "Scroll back" : "Scroll forward"), t.appendChild(s()), t;
197
- }
198
- startHold(e) {
199
- this.stopHold();
200
- let t = () => this.emitScroll(this.value + e * this.step);
201
- t(), this.holdTimer = setTimeout(() => {
202
- this.holdTimer = setInterval(t, a);
203
- }, i);
204
- }
205
- emitScroll(e) {
206
- let t = Math.min(Math.max(e, 0), this.maxValue);
207
- this.dispatchEvent(new CustomEvent("scroll-change", {
208
- detail: { value: t },
209
- bubbles: !0,
210
- composed: !0
211
- }));
212
- }
213
- render() {
214
- if (!this.shadowRoot) return;
215
- let e = this.viewportSize, t = this.contentSize <= e || e <= 0;
216
- this.style.opacity = t ? "0" : "1", this.style.pointerEvents = t ? "none" : "auto";
217
- let n = this.getTrackLength(), r = this.computeThumbSize(n), i = this.maxValue, a = (i > 0 ? this.value / i : 0) * Math.max(n - r, 0);
218
- this.orientation === "vertical" ? (this.thumb.style.height = `${r}px`, this.thumb.style.transform = `translateY(${a}px)`) : (this.thumb.style.width = `${r}px`, this.thumb.style.transform = `translateX(${a}px)`), this.startArrow.disabled = t || this.value <= 0, this.endArrow.disabled = t || this.value >= i;
219
- }
220
- };
221
- typeof window < "u" && !customElements.get("sv-grid-scrollbar") && customElements.define("sv-grid-scrollbar", u);
222
- //#endregion
223
- //#region ../grid/dist/filtering/excel-filters.js
224
- var d = /[̀-ͯ]/g;
225
- function f(e, t) {
226
- if (!e) return "";
227
- if (p(e)) return t ? e.toLocaleLowerCase(t) : e.toLowerCase();
228
- let n = e.normalize("NFD").replace(d, "");
229
- return t ? n.toLocaleLowerCase(t) : n.toLowerCase();
230
- }
231
- function p(e) {
232
- for (let t = 0; t < e.length; t++) if (e.charCodeAt(t) > 127) return !1;
233
- return !0;
234
- }
235
- function m(e) {
236
- let { tokens: t, trailing: n } = _(e);
237
- return n && t.push(n), t;
238
- }
239
- function h(e) {
240
- return e.map((e) => e.trim()).filter((e) => e.length > 0).map((e) => /["\n,]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e).join(", ");
241
- }
242
- function g(e) {
243
- return _(e).trailing;
244
- }
245
- function _(e) {
246
- let t = String(e ?? ""), n = [], r = "", i = !1, a = !1, o = !1, s = () => {
247
- let e = a ? r : r.trim();
248
- return r = "", a = !1, o = !1, e;
249
- };
250
- for (let e = 0; e < t.length; e += 1) {
251
- let c = t[e];
252
- if (i) {
253
- if (c !== "\"") {
254
- r += c;
255
- continue;
256
- }
257
- if (t[e + 1] === "\"") {
258
- r += "\"", e += 1;
259
- continue;
260
- }
261
- i = !1, o = !0;
262
- continue;
263
- }
264
- if (c === "," || c === "\n") {
265
- let e = s();
266
- e.length && n.push(e);
267
- continue;
268
- }
269
- if (c === "\"" && !o && !r.trim()) {
270
- i = !0, a = !0, r = "";
271
- continue;
272
- }
273
- r += c;
274
- }
275
- return {
276
- tokens: n,
277
- trailing: s()
278
- };
279
- }
280
- var v = 16384;
281
- function y(e) {
282
- let t = /* @__PURE__ */ new Map(), n = 0, r = 0;
283
- return (i) => {
284
- let a = typeof i == "string" ? i : String(i ?? "");
285
- if (t === null) return e(a);
286
- n++;
287
- let o = t.get(a);
288
- if (o !== void 0) return r++, o;
289
- let s = e(a);
290
- return t.size < v && t.set(a, s), n >= 2048 && r * 2 < n && (t = null), s;
291
- };
292
- }
293
- function b(e, t) {
294
- let n = t?.locale, r = (e) => f(String(e ?? ""), n), i = r(e.value);
295
- switch (e.operator) {
296
- case "contains": return y((e) => r(e).includes(i));
297
- case "notContains": return i === "" ? () => !0 : y((e) => !r(e).includes(i));
298
- case "equals": return y((e) => r(e) === i);
299
- case "notEquals": return i === "" ? () => !0 : y((e) => r(e) !== i);
300
- case "startsWith": return y((e) => r(e).startsWith(i));
301
- case "endsWith": return y((e) => r(e).endsWith(i));
302
- case "regex": {
303
- let t = String(e.value ?? "");
304
- if (!t) return () => !0;
305
- let n;
306
- try {
307
- n = new RegExp(t, "i");
308
- } catch {
309
- return () => !1;
310
- }
311
- return (e) => n.test(String(e ?? ""));
312
- }
313
- case "in":
314
- case "notIn": {
315
- let t = m(e.value);
316
- if (t.length === 0) return () => !0;
317
- let i = new Set(t.map((e) => f(e, n)));
318
- return e.operator === "in" ? (e) => i.has(r(e)) : (e) => !i.has(r(e));
319
- }
320
- case "greaterThan": {
321
- let t = Number(e.value), n = Number.isFinite(t), r = String(e.value ?? "");
322
- return (e) => {
323
- let i = Number(e);
324
- return n && Number.isFinite(i) ? i > t : String(e ?? "") > r;
325
- };
326
- }
327
- case "lessThan": {
328
- let t = Number(e.value), n = Number.isFinite(t), r = String(e.value ?? "");
329
- return (e) => {
330
- let i = Number(e);
331
- return n && Number.isFinite(i) ? i < t : String(e ?? "") < r;
332
- };
333
- }
334
- case "between": {
335
- let t = e.value == null ? 0 : Number(e.value), n = e.valueTo == null ? 0 : Number(e.valueTo), r = Number.isFinite(t) && Number.isFinite(n), i = String(e.value ?? ""), a = String(e.valueTo ?? "");
336
- return (e) => {
337
- let o = Number(e ?? 0);
338
- if (r && Number.isFinite(o)) return o >= t && o <= n;
339
- let s = String(e ?? "");
340
- return s >= i && s <= a;
341
- };
342
- }
343
- case "isBlank": return (e) => String(e ?? "").trim().length === 0;
344
- case "isNotBlank": return (e) => String(e ?? "").trim().length > 0;
345
- }
346
- }
347
- //#endregion
348
- //#region ../grid/dist/virtualization/virtualizer.js
349
- function x(e, t, n) {
350
- return Math.min(Math.max(e, t), n);
351
- }
352
- function S(e, t) {
353
- return e.count === t.count && e.estimateSize === t.estimateSize && (e.overscan ?? 6) === (t.overscan ?? 6) && e.overscanBehind === t.overscanBehind && e.overscanMin === t.overscanMin && e.viewportHeight === t.viewportHeight && (e.scrollOffset ?? 0) === (t.scrollOffset ?? 0);
354
- }
355
- function C(e, t) {
356
- if (e.totalSize !== t.totalSize || e.startIndex !== t.startIndex || e.endIndex !== t.endIndex || e.viewportHeight !== t.viewportHeight || e.items.length !== t.items.length) return !1;
357
- for (let n = 0; n < e.items.length; n += 1) {
358
- let r = e.items[n], i = t.items[n];
359
- if (r.index !== i.index || r.start !== i.start || r.size !== i.size || r.key !== i.key) return !1;
360
- }
361
- return !0;
362
- }
363
- function w(e, t) {
364
- return `virtual_slot_${e % t}`;
365
- }
366
- function T(e, t, n) {
367
- let r = [], i = t - e + 1;
368
- for (let a = e; a <= t; a += 1) {
369
- let e = a * n;
370
- r.push({
371
- index: a,
372
- start: e,
373
- size: n,
374
- end: e + n,
375
- key: w(a, i)
376
- });
377
- }
378
- return r;
379
- }
380
- function E(e, t, n, r) {
381
- if (e <= 0) return [];
382
- let i = Math.max(t, 1), a = Math.ceil(Math.max(n, 0) / i);
383
- return T(0, Math.max(Math.min(a + Math.max(r, 0), e - 1), 0), i);
384
- }
385
- function D(e, t, n) {
386
- let r = [], i = t - e + 1;
387
- for (let a = e; a <= t; a += 1) {
388
- let e = n[a] ?? 0, t = n[a + 1] ?? e;
389
- r.push({
390
- index: a,
391
- start: e,
392
- size: t - e,
393
- end: t,
394
- key: w(a, i)
395
- });
396
- }
397
- return r;
398
- }
399
- function O(e, t) {
400
- let n = Math.max(e.count, 0), r = Math.max(e.viewportHeight, 0);
401
- if (typeof e.estimateSize == "function" && t) {
402
- let i = t[n] ?? 0, a = Math.max(i - r, 0), o = x(e.scrollOffset ?? 0, 0, a), s = 0, c = n;
403
- for (; s < c;) {
404
- let e = s + c >>> 1;
405
- (t[e + 1] ?? 0) <= o ? s = e + 1 : c = e;
406
- }
407
- let l = s, u = o + r;
408
- for (s = l, c = n; s < c;) {
409
- let e = s + c >>> 1;
410
- (t[e] ?? 0) < u ? s = e + 1 : c = e;
411
- }
412
- return {
413
- count: n,
414
- viewportHeight: r,
415
- totalSize: i,
416
- scrollOffset: o,
417
- visibleStart: l,
418
- visibleEnd: Math.max(s - 1, l),
419
- uniformSize: 0
420
- };
421
- }
422
- let i = Math.max(typeof e.estimateSize == "number" ? e.estimateSize : 1, 1), a = n * i, o = Math.max(a - r, 0), s = x(e.scrollOffset ?? 0, 0, o), c = Math.floor(s / i), l = Math.ceil(r / i);
423
- return {
424
- count: n,
425
- viewportHeight: r,
426
- totalSize: a,
427
- scrollOffset: s,
428
- visibleStart: c,
429
- visibleEnd: Math.min(c + l, Math.max(n - 1, 0)),
430
- uniformSize: i
431
- };
432
- }
433
- function k(e, t, n = !1) {
434
- let r = Math.max(e.overscan ?? 6, 0), i = e.overscanMin === void 0 || n ? r : x(e.overscanMin, 0, r), a = Math.min(Math.max(e.overscanBehind ?? r, 0), i), o = e.scrollDirection ?? 0, s = o > 0 ? a : i, c = o < 0 ? a : i, { count: l, viewportHeight: u, totalSize: d, scrollOffset: f, visibleStart: p, visibleEnd: m, uniformSize: h } = O(e, t), g = l === 0 ? 0 : x(p - s, 0, l - 1), _ = l === 0 ? -1 : x(m + c, 0, l - 1), v = [];
435
- return _ >= g && (v = h > 0 ? T(g, _, h) : D(g, _, t)), {
436
- items: v,
437
- totalSize: d,
438
- startIndex: g,
439
- endIndex: _,
440
- scrollOffset: f,
441
- viewportHeight: u
442
- };
443
- }
444
- function A(e) {
445
- let t = e, n = null;
446
- function r() {
447
- if (typeof t.estimateSize != "function") return null;
448
- let e = Math.max(t.count, 0);
449
- if (n && n.fn === t.estimateSize && n.count === e) return n.offsets;
450
- let r = t.estimateSize, i = Array(e + 1);
451
- i[0] = 0;
452
- for (let t = 0; t < e; t += 1) i[t + 1] = i[t] + Math.max(r(t), 0);
453
- return n = {
454
- fn: r,
455
- count: e,
456
- offsets: i
457
- }, i;
458
- }
459
- let i = k(t, r()), a = /* @__PURE__ */ new Set();
460
- function o() {
461
- a.forEach((e) => e());
462
- }
463
- function s(e = !1) {
464
- let n = k(t, r(), e);
465
- if (!C(i, n)) {
466
- if (i.items.length > 0 && n.items.length > 0) {
467
- let e = i.items[0].index, t = n.items;
468
- for (let n = 0; n < t.length; n += 1) {
469
- let r = t[n], a = i.items[r.index - e];
470
- a && a.index === r.index && a.start === r.start && a.size === r.size && a.key === r.key && (t[n] = a);
471
- }
472
- }
473
- i = n, o();
474
- }
475
- }
476
- function c() {
477
- let e = t.overscanMin;
478
- if (e === void 0 || i.items.length === 0) return "move";
479
- let n = x(e, 0, Math.max(t.overscan ?? 6, 0)), { count: a, viewportHeight: o, totalSize: s, visibleStart: c, visibleEnd: l } = O(t, r());
480
- if (a === 0 || o !== i.viewportHeight || s !== i.totalSize || c > i.endIndex || l < i.startIndex) return "jump";
481
- let u = t.scrollDirection ?? 0, d = Math.max(c - (u < 0 ? n : 0), 0), f = Math.min(l + (u > 0 ? n : 0), a - 1);
482
- return i.startIndex <= d && i.endIndex >= f ? "hold" : "move";
483
- }
484
- return {
485
- setOptions(e) {
486
- let r = {
487
- ...t,
488
- ...e
489
- }, i = typeof e.estimateSize == "function";
490
- !i && S(t, r) || (t = r, i && (n = null), s());
491
- },
492
- measure() {
493
- n = null, s();
494
- },
495
- setScrollOffset(e) {
496
- let n = t.scrollOffset ?? 0;
497
- if (n === e) return;
498
- t = {
499
- ...t,
500
- scrollOffset: e,
501
- scrollDirection: e > n ? 1 : -1
502
- };
503
- let r = c();
504
- r !== "hold" && s(r === "move");
505
- },
506
- setViewportHeight(e) {
507
- t.viewportHeight !== e && (t = {
508
- ...t,
509
- viewportHeight: e
510
- }, s());
511
- },
512
- scrollToIndex(e) {
513
- let n = x(e, 0, Math.max(t.count - 1, 0)), a = i.totalSize, o;
514
- if (typeof t.estimateSize == "function") {
515
- let e = r();
516
- if (e) o = e[n] ?? 0;
517
- else {
518
- let e = 0, r = t.estimateSize;
519
- for (let t = 0; t < n; t += 1) e += Math.max(r(t), 1);
520
- o = e;
521
- }
522
- } else o = n * Math.max(t.estimateSize, 1);
523
- let c = Math.max(a - t.viewportHeight, 0), l = x(o, 0, c);
524
- (t.scrollOffset ?? 0) !== l && (t = {
525
- ...t,
526
- scrollOffset: l
527
- }, s());
528
- },
529
- getVirtualItems() {
530
- return i.items;
531
- },
532
- getTotalSize() {
533
- return i.totalSize;
534
- },
535
- getOffsetForIndex(e) {
536
- if (e <= 0) return 0;
537
- let n = Math.max(t.count, 0), i = Math.min(e, n);
538
- if (typeof t.estimateSize == "function") {
539
- let e = r();
540
- if (e) return e[i] ?? 0;
541
- let n = 0, a = t.estimateSize;
542
- for (let e = 0; e < i; e += 1) n += Math.max(a(e), 1);
543
- return n;
544
- }
545
- return i * Math.max(t.estimateSize, 1);
546
- },
547
- getSizeForIndex(e) {
548
- return e < 0 || e >= t.count ? 0 : typeof t.estimateSize == "function" ? Math.max(t.estimateSize(e), 1) : Math.max(t.estimateSize, 1);
549
- },
550
- getState() {
551
- return i;
552
- },
553
- subscribe(e) {
554
- return a.add(e), () => a.delete(e);
555
- }
556
- };
557
- }
558
- //#endregion
559
- //#region ../grid/dist/virtualization/svelte-virtualizer.svelte.js
560
- function j(r) {
561
- let i = A(r), a = e(0);
562
- return i.subscribe(() => {
563
- t(a, n(a) + 1);
564
- }), {
565
- get version() {
566
- return n(a);
567
- },
568
- setOptions: i.setOptions,
569
- measure: i.measure,
570
- setScrollOffset: i.setScrollOffset,
571
- setViewportHeight: i.setViewportHeight,
572
- scrollToIndex: i.scrollToIndex,
573
- getVirtualItems: i.getVirtualItems,
574
- getTotalSize: i.getTotalSize,
575
- getOffsetForIndex: i.getOffsetForIndex,
576
- getSizeForIndex: i.getSizeForIndex,
577
- getState: i.getState
578
- };
579
- }
580
- //#endregion
581
- export { h as a, g as c, b as i, E as n, f as o, A as r, m as s, j as t };