@svgrid/grid-wc 3.0.8 → 3.0.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.
Files changed (52) hide show
  1. package/dist/GridMenus-BsOHO9kc.js +1086 -0
  2. package/dist/{SvChartMenu-DkSyLWYH.js → SvChartMenu-CwWtjXsG.js} +153 -153
  3. package/dist/{shadow/SvDateRangeInput-BrYTQEMM.js → SvDateRangeInput-DtKZ07aC.js} +88 -88
  4. package/dist/SvDateTimePicker-C37mOYov.js +766 -0
  5. package/dist/{SvField-Bmzp3ObZ.js → SvField-CpglDJLn.js} +107 -107
  6. package/dist/SvGridCellEditor-C2t-q8n3.js +560 -0
  7. package/dist/{SvGridChart-BSNYAW_W.js → SvGridChart-Bj2Pr2u9.js} +1522 -1522
  8. package/dist/{SvGridChartBuilder-DDl_Bv8k.js → SvGridChartBuilder-Dpw2X4pR.js} +418 -418
  9. package/dist/{shadow/SvGridChartPanel-DkIR-3rA.js → SvGridChartPanel-Ce78cR3g.js} +642 -642
  10. package/dist/{SvGridChartView-B4pqLWnm.js → SvGridChartView-CTfjtiXs.js} +11 -11
  11. package/dist/SvGridDropdown-CfA5Jfe5.js +257 -0
  12. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +4 -2
  13. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
  14. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +2 -1
  15. package/dist/{chart-export-pdf-hJVuR7_z.js → chart-export-pdf-Bc0Rz4kB.js} +1 -1
  16. package/dist/{shadow/client-DEF0GRjE.js → client-wYhMjrKG.js} +172 -161
  17. package/dist/{date-format-DMTwV8NC.js → date-format-SCGd8EWh.js} +363 -363
  18. package/dist/react/index.d.ts +2 -0
  19. package/dist/react/index.js +1 -1
  20. package/dist/shadow/GridMenus-BsOHO9kc.js +1086 -0
  21. package/dist/shadow/{SvChartMenu-DkSyLWYH.js → SvChartMenu-CwWtjXsG.js} +153 -153
  22. package/dist/{SvDateRangeInput-BrYTQEMM.js → shadow/SvDateRangeInput-DtKZ07aC.js} +88 -88
  23. package/dist/shadow/SvDateTimePicker-C37mOYov.js +766 -0
  24. package/dist/shadow/{SvField-Bmzp3ObZ.js → SvField-CpglDJLn.js} +107 -107
  25. package/dist/shadow/SvGridCellEditor-C2t-q8n3.js +560 -0
  26. package/dist/shadow/{SvGridChart-BSNYAW_W.js → SvGridChart-Bj2Pr2u9.js} +1522 -1522
  27. package/dist/shadow/{SvGridChartBuilder-DDl_Bv8k.js → SvGridChartBuilder-Dpw2X4pR.js} +418 -418
  28. package/dist/{SvGridChartPanel-DkIR-3rA.js → shadow/SvGridChartPanel-Ce78cR3g.js} +642 -642
  29. package/dist/shadow/{SvGridChartView-B4pqLWnm.js → SvGridChartView-CTfjtiXs.js} +11 -11
  30. package/dist/shadow/SvGridDropdown-CfA5Jfe5.js +257 -0
  31. package/dist/shadow/{chart-export-pdf-hJVuR7_z.js → chart-export-pdf-Bc0Rz4kB.js} +1 -1
  32. package/dist/{client-DEF0GRjE.js → shadow/client-wYhMjrKG.js} +172 -161
  33. package/dist/shadow/{date-format-DMTwV8NC.js → date-format-SCGd8EWh.js} +363 -363
  34. package/dist/shadow/sv-grid-shadow-element.d.ts +2 -0
  35. package/dist/shadow/sv-grid-shadow-element.js +4429 -3986
  36. package/dist/shadow/{svelte-virtualizer.svelte-CMX34S17.js → svelte-virtualizer.svelte-BGip4kwG.js} +106 -59
  37. package/dist/shadow/{validate-JAuMsk6Z.js → validate-43C03DLP.js} +1 -1
  38. package/dist/sv-grid-element.d.ts +2 -0
  39. package/dist/sv-grid-element.js +4414 -3971
  40. package/dist/{svelte-virtualizer.svelte-CMX34S17.js → svelte-virtualizer.svelte-BGip4kwG.js} +106 -59
  41. package/dist/{validate-JAuMsk6Z.js → validate-43C03DLP.js} +1 -1
  42. package/dist/vue/index.d.ts +2 -1
  43. package/dist/vue/index.js +1 -1
  44. package/package.json +3 -3
  45. package/dist/GridMenus-Nf04Zcl5.js +0 -1086
  46. package/dist/SvDateTimePicker-Czin1Ead.js +0 -766
  47. package/dist/SvGridCellEditor-BTbDEgpe.js +0 -560
  48. package/dist/SvGridDropdown-BwPpGwLz.js +0 -257
  49. package/dist/shadow/GridMenus-Nf04Zcl5.js +0 -1086
  50. package/dist/shadow/SvDateTimePicker-Czin1Ead.js +0 -766
  51. package/dist/shadow/SvGridCellEditor-BTbDEgpe.js +0 -560
  52. package/dist/shadow/SvGridDropdown-BwPpGwLz.js +0 -257
@@ -1,4 +1,4 @@
1
- import { Q as e, R as t, Z as n } from "./client-DEF0GRjE.js";
1
+ import { $ as e, Q as t, z as n } from "./client-wYhMjrKG.js";
2
2
  //#region ../grid/dist/sv-grid-scrollbar.js
3
3
  var r = 16, i = 280, a = 50, o = "http://www.w3.org/2000/svg";
4
4
  function s() {
@@ -277,15 +277,28 @@ function _(e) {
277
277
  trailing: s()
278
278
  };
279
279
  }
280
- function v(e, t) {
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) {
281
294
  let n = t?.locale, r = (e) => f(String(e ?? ""), n), i = r(e.value);
282
295
  switch (e.operator) {
283
- case "contains": return (e) => r(e).includes(i);
284
- case "notContains": return i === "" ? () => !0 : (e) => !r(e).includes(i);
285
- case "equals": return (e) => r(e) === i;
286
- case "notEquals": return i === "" ? () => !0 : (e) => r(e) !== i;
287
- case "startsWith": return (e) => r(e).startsWith(i);
288
- case "endsWith": return (e) => r(e).endsWith(i);
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));
289
302
  case "regex": {
290
303
  let t = String(e.value ?? "");
291
304
  if (!t) return () => !0;
@@ -333,13 +346,13 @@ function v(e, t) {
333
346
  }
334
347
  //#endregion
335
348
  //#region ../grid/dist/virtualization/virtualizer.js
336
- function y(e, t, n) {
349
+ function x(e, t, n) {
337
350
  return Math.min(Math.max(e, t), n);
338
351
  }
339
- function b(e, t) {
340
- return e.count === t.count && e.estimateSize === t.estimateSize && (e.overscan ?? 6) === (t.overscan ?? 6) && e.viewportHeight === t.viewportHeight && (e.scrollOffset ?? 0) === (t.scrollOffset ?? 0);
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);
341
354
  }
342
- function x(e, t) {
355
+ function C(e, t) {
343
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;
344
357
  for (let n = 0; n < e.items.length; n += 1) {
345
358
  let r = e.items[n], i = t.items[n];
@@ -347,10 +360,10 @@ function x(e, t) {
347
360
  }
348
361
  return !0;
349
362
  }
350
- function S(e, t) {
363
+ function w(e, t) {
351
364
  return `virtual_slot_${e % t}`;
352
365
  }
353
- function C(e, t, n) {
366
+ function T(e, t, n) {
354
367
  let r = [], i = t - e + 1;
355
368
  for (let a = e; a <= t; a += 1) {
356
369
  let e = a * n;
@@ -359,17 +372,17 @@ function C(e, t, n) {
359
372
  start: e,
360
373
  size: n,
361
374
  end: e + n,
362
- key: S(a, i)
375
+ key: w(a, i)
363
376
  });
364
377
  }
365
378
  return r;
366
379
  }
367
- function w(e, t, n, r) {
380
+ function E(e, t, n, r) {
368
381
  if (e <= 0) return [];
369
382
  let i = Math.max(t, 1), a = Math.ceil(Math.max(n, 0) / i);
370
- return C(0, Math.max(Math.min(a + Math.max(r, 0), e - 1), 0), i);
383
+ return T(0, Math.max(Math.min(a + Math.max(r, 0), e - 1), 0), i);
371
384
  }
372
- function T(e, t, n) {
385
+ function D(e, t, n) {
373
386
  let r = [], i = t - e + 1;
374
387
  for (let a = e; a <= t; a += 1) {
375
388
  let e = n[a] ?? 0, t = n[a + 1] ?? e;
@@ -378,45 +391,57 @@ function T(e, t, n) {
378
391
  start: e,
379
392
  size: t - e,
380
393
  end: t,
381
- key: S(a, i)
394
+ key: w(a, i)
382
395
  });
383
396
  }
384
397
  return r;
385
398
  }
386
- function E(e, t) {
387
- let n = Math.max(e.count, 0), r = Math.max(e.overscan ?? 6, 0), i = Math.max(e.viewportHeight, 0);
399
+ function O(e, t) {
400
+ let n = Math.max(e.count, 0), r = Math.max(e.viewportHeight, 0);
388
401
  if (typeof e.estimateSize == "function" && t) {
389
- let a = t[n] ?? 0, o = Math.max(a - i, 0), s = y(e.scrollOffset ?? 0, 0, o), c = 0, l = n;
390
- for (; c < l;) {
391
- let e = c + l >>> 1;
392
- (t[e + 1] ?? 0) <= s ? c = e + 1 : l = e;
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;
393
406
  }
394
- let u = c, d = s + i;
395
- for (c = u, l = n; c < l;) {
396
- let e = c + l >>> 1;
397
- (t[e] ?? 0) < d ? c = e + 1 : l = e;
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;
398
411
  }
399
- let f = Math.max(c - 1, u), p = n === 0 ? 0 : y(u - r, 0, n - 1), m = n === 0 ? -1 : y(f + r, 0, n - 1);
400
412
  return {
401
- items: m >= p ? T(p, m, t) : [],
402
- totalSize: a,
403
- startIndex: p,
404
- endIndex: m,
405
- scrollOffset: s,
406
- viewportHeight: i
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
407
420
  };
408
421
  }
409
- let a = Math.max(typeof e.estimateSize == "number" ? e.estimateSize : 1, 1), o = n * a, s = Math.max(o - i, 0), c = y(e.scrollOffset ?? 0, 0, s), l = Math.floor(c / a), u = Math.ceil(i / a), d = Math.min(l + u, Math.max(n - 1, 0)), f = n === 0 ? 0 : y(l - r, 0, n - 1), p = n === 0 ? -1 : y(d + r, 0, n - 1);
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);
410
423
  return {
411
- items: p >= f ? C(f, p, a) : [],
412
- totalSize: o,
413
- startIndex: f,
414
- endIndex: p,
415
- scrollOffset: c,
416
- viewportHeight: i
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
417
431
  };
418
432
  }
419
- function D(e) {
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) {
420
445
  let t = e, n = null;
421
446
  function r() {
422
447
  if (typeof t.estimateSize != "function") return null;
@@ -431,13 +456,30 @@ function D(e) {
431
456
  offsets: i
432
457
  }, i;
433
458
  }
434
- let i = E(t, r()), a = /* @__PURE__ */ new Set();
459
+ let i = k(t, r()), a = /* @__PURE__ */ new Set();
435
460
  function o() {
436
461
  a.forEach((e) => e());
437
462
  }
438
- function s() {
439
- let e = E(t, r());
440
- x(i, e) || (i = e, o());
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";
441
483
  }
442
484
  return {
443
485
  setOptions(e) {
@@ -445,16 +487,21 @@ function D(e) {
445
487
  ...t,
446
488
  ...e
447
489
  }, i = typeof e.estimateSize == "function";
448
- !i && b(t, r) || (t = r, i && (n = null), s());
490
+ !i && S(t, r) || (t = r, i && (n = null), s());
449
491
  },
450
492
  measure() {
451
493
  n = null, s();
452
494
  },
453
495
  setScrollOffset(e) {
454
- (t.scrollOffset ?? 0) !== e && (t = {
496
+ let n = t.scrollOffset ?? 0;
497
+ if (n === e) return;
498
+ t = {
455
499
  ...t,
456
- scrollOffset: e
457
- }, s());
500
+ scrollOffset: e,
501
+ scrollDirection: e > n ? 1 : -1
502
+ };
503
+ let r = c();
504
+ r !== "hold" && s(r === "move");
458
505
  },
459
506
  setViewportHeight(e) {
460
507
  t.viewportHeight !== e && (t = {
@@ -463,7 +510,7 @@ function D(e) {
463
510
  }, s());
464
511
  },
465
512
  scrollToIndex(e) {
466
- let n = y(e, 0, Math.max(t.count - 1, 0)), a = i.totalSize, o;
513
+ let n = x(e, 0, Math.max(t.count - 1, 0)), a = i.totalSize, o;
467
514
  if (typeof t.estimateSize == "function") {
468
515
  let e = r();
469
516
  if (e) o = e[n] ?? 0;
@@ -473,7 +520,7 @@ function D(e) {
473
520
  o = e;
474
521
  }
475
522
  } else o = n * Math.max(t.estimateSize, 1);
476
- let c = Math.max(a - t.viewportHeight, 0), l = y(o, 0, c);
523
+ let c = Math.max(a - t.viewportHeight, 0), l = x(o, 0, c);
477
524
  (t.scrollOffset ?? 0) !== l && (t = {
478
525
  ...t,
479
526
  scrollOffset: l
@@ -510,13 +557,13 @@ function D(e) {
510
557
  }
511
558
  //#endregion
512
559
  //#region ../grid/dist/virtualization/svelte-virtualizer.svelte.js
513
- function O(r) {
514
- let i = D(r), a = e(0);
560
+ function j(r) {
561
+ let i = A(r), a = e(0);
515
562
  return i.subscribe(() => {
516
- n(a, t(a) + 1);
563
+ t(a, n(a) + 1);
517
564
  }), {
518
565
  get version() {
519
- return t(a);
566
+ return n(a);
520
567
  },
521
568
  setOptions: i.setOptions,
522
569
  measure: i.measure,
@@ -531,4 +578,4 @@ function O(r) {
531
578
  };
532
579
  }
533
580
  //#endregion
534
- export { h as a, g as c, v as i, w as n, f as o, D as r, m as s, O as t };
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 };
@@ -59,7 +59,7 @@ function o(e) {
59
59
  let r = e.treeData.idField;
60
60
  r && !t.has(r) && o.push(`[svgrid] \`treeData.idField\` is "${r}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`);
61
61
  }
62
- return e.gantt && e.treeData && o.push("[svgrid] `gantt` and `treeData` are both set. The Gantt builds its own work-breakdown tree from `gantt.parentField` and needs every descendant row, but `treeData` hides collapsed children from the view, so summary bars will under-report. Remove `treeData` and set `gantt.parentField` instead."), (e.initialColumnPinning?.left?.length ?? 0) + (e.initialColumnPinning?.right?.length ?? 0) > 0 && e.columnVirtualization !== !1 && o.push("[svgrid] `initialColumnPinning` is set while column virtualization is on (its default), so the pinned columns will not stick - the virtualizer recycles column nodes. Add `columnVirtualization={false}`."), e.externalPagination === !0 && e.rowCount === void 0 && o.push("[svgrid] `externalPagination` is on but `rowCount` is not set, so the pager cannot know how many pages exist. Pass the server total as `rowCount`."), e.externalSort === !0 && !e.onSortingChange && o.push("[svgrid] `externalSort` is on but there is no `onSortingChange` handler, so clicking a header changes nothing - the grid stopped sorting and nobody is listening. Add `onSortingChange` and re-fetch in your handler."), e.externalFilter === !0 && !e.onFiltersChange && o.push("[svgrid] `externalFilter` is on but there is no `onFiltersChange` handler, so filtering the grid changes nothing. Add `onFiltersChange` and re-fetch in your handler."), o;
62
+ return e.gantt && e.treeData && o.push("[svgrid] `gantt` and `treeData` are both set. The Gantt builds its own work-breakdown tree from `gantt.parentField` and needs every descendant row, but `treeData` hides collapsed children from the view, so summary bars will under-report. Remove `treeData` and set `gantt.parentField` instead."), e.externalPagination === !0 && e.rowCount === void 0 && o.push("[svgrid] `externalPagination` is on but `rowCount` is not set, so the pager cannot know how many pages exist. Pass the server total as `rowCount`."), e.externalSort === !0 && !e.onSortingChange && o.push("[svgrid] `externalSort` is on but there is no `onSortingChange` handler, so clicking a header changes nothing - the grid stopped sorting and nobody is listening. Add `onSortingChange` and re-fetch in your handler."), e.externalFilter === !0 && !e.onFiltersChange && o.push("[svgrid] `externalFilter` is on but there is no `onFiltersChange` handler, so filtering the grid changes nothing. Add `onFiltersChange` and re-fetch in your handler."), o;
63
63
  }
64
64
  function s(e, t) {
65
65
  let n, r = Infinity;
@@ -226,6 +226,8 @@ export interface SvGridElement extends HTMLElement {
226
226
  stickyGroupRows: boolean
227
227
  /** property only - an attribute cannot hold this */
228
228
  mergedCells: readonly unknown[]
229
+ /** attribute `row-layout` */
230
+ rowLayout: "flex" | "table"
229
231
  /** property only - an attribute cannot hold this */
230
232
  pinnedBottomRows: readonly unknown[]
231
233
  /** attribute `enable-column-reorder` */