@svgrid/grid-wc 2.7.0 → 3.0.1

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 (48) hide show
  1. package/README.md +110 -110
  2. package/dist/GridMenus-YwTw9Upd.js +1123 -0
  3. package/dist/SvDateRangeInput-CrxeppBV.js +196 -0
  4. package/dist/SvDateTimePicker-xAO-Pb4S.js +765 -0
  5. package/dist/{dismissable-Nx79OIVg.js → SvField-CE345DyF.js} +11 -51
  6. package/dist/{shadow/SvGrid.helpers-BZPDBcza.js → SvGrid.helpers-BdVDtjUm.js} +24 -14
  7. package/dist/SvGridCellEditor-D7SyHtff.js +550 -0
  8. package/dist/SvGridChart-CMaVmlso.js +1477 -0
  9. package/dist/SvGridChartPanel-Pc_IW0eA.js +833 -0
  10. package/dist/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
  11. package/dist/{SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
  12. package/dist/{shadow/cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
  13. package/dist/chart-GRBAgN1M.js +1658 -0
  14. package/dist/date-format-D_oQ5Yw0.js +1127 -0
  15. package/dist/dismissable-DvhBKm3q.js +41 -0
  16. package/dist/{export-format-B6FUgOll.js → export-format-uGayRKWM.js} +3 -3
  17. package/dist/{shadow/row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
  18. package/dist/shadow/GridMenus-YwTw9Upd.js +1123 -0
  19. package/dist/shadow/SvDateRangeInput-CrxeppBV.js +196 -0
  20. package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +765 -0
  21. package/dist/shadow/{dismissable-Nx79OIVg.js → SvField-CE345DyF.js} +11 -51
  22. package/dist/{SvGrid.helpers-BZPDBcza.js → shadow/SvGrid.helpers-BdVDtjUm.js} +24 -14
  23. package/dist/shadow/SvGridCellEditor-D7SyHtff.js +550 -0
  24. package/dist/shadow/SvGridChart-CMaVmlso.js +1477 -0
  25. package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +833 -0
  26. package/dist/shadow/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
  27. package/dist/shadow/{SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
  28. package/dist/{cell-formatting-C0OsDmi_.js → shadow/cell-formatting-Eypm-id0.js} +1 -1
  29. package/dist/shadow/chart-GRBAgN1M.js +1658 -0
  30. package/dist/shadow/date-format-D_oQ5Yw0.js +1127 -0
  31. package/dist/shadow/dismissable-DvhBKm3q.js +41 -0
  32. package/dist/shadow/{export-format-C8kZGZfz.js → export-format-DhdZREP1.js} +3 -3
  33. package/dist/{row-drag-touch-Ddaa-QeB.js → shadow/row-drag-touch-CycRR65n.js} +12 -10
  34. package/dist/shadow/sv-grid-shadow-element.js +2896 -2628
  35. package/dist/sv-grid-element.js +2894 -2626
  36. package/package.json +3 -3
  37. package/dist/GridMenus-DE0zNY_3.js +0 -1022
  38. package/dist/SvDateTimePicker-BpeEupA2.js +0 -1885
  39. package/dist/SvGridCellEditor-_rqEaig7.js +0 -531
  40. package/dist/SvGridChart-yK5Zv85y.js +0 -1199
  41. package/dist/SvGridChartPanel-B38_VjXM.js +0 -584
  42. package/dist/chart-uvs3sFJA.js +0 -1220
  43. package/dist/shadow/GridMenus-DE0zNY_3.js +0 -1022
  44. package/dist/shadow/SvDateTimePicker-BpeEupA2.js +0 -1885
  45. package/dist/shadow/SvGridCellEditor-_rqEaig7.js +0 -531
  46. package/dist/shadow/SvGridChart-yK5Zv85y.js +0 -1199
  47. package/dist/shadow/SvGridChartPanel-B38_VjXM.js +0 -584
  48. package/dist/shadow/chart-uvs3sFJA.js +0 -1220
@@ -0,0 +1,41 @@
1
+ //#region ../grid/dist/a11y/dismissable.js
2
+ function e(e, t) {
3
+ return t ? (Array.isArray(e) ? e : [e]).some((e) => e != null && e.contains(t)) : !1;
4
+ }
5
+ var t = [], n = !1;
6
+ function r() {
7
+ n || typeof document > "u" || (n = !0, document.addEventListener("keydown", (e) => {
8
+ if (e.key !== "Escape") return;
9
+ let n = t[t.length - 1];
10
+ n?.closeOnEscape && (e.stopPropagation(), n.onDismiss("escape"));
11
+ }, !0), document.addEventListener("pointerdown", (n) => {
12
+ let r = t[t.length - 1];
13
+ r?.closeOnOutside && (e(r.element(), n.target) || r.onDismiss("outside"));
14
+ }, !0));
15
+ }
16
+ function i(e) {
17
+ let n = {
18
+ element: e.element,
19
+ onDismiss: e.onDismiss,
20
+ closeOnEscape: e.closeOnEscape ?? !0,
21
+ closeOnOutside: e.closeOnOutside ?? !0
22
+ };
23
+ return {
24
+ activate() {
25
+ r(), t.includes(n) || t.push(n);
26
+ },
27
+ release() {
28
+ let e = t.indexOf(n);
29
+ e >= 0 && t.splice(e, 1);
30
+ }
31
+ };
32
+ }
33
+ function a(t, n) {
34
+ if (typeof window > "u") return () => {};
35
+ let r = (r) => {
36
+ e(t(), r.target) || n();
37
+ };
38
+ return window.addEventListener("scroll", r, !0), () => window.removeEventListener("scroll", r, !0);
39
+ }
40
+ //#endregion
41
+ export { a as n, i as t };
@@ -1,4 +1,4 @@
1
- import { n as e, r as t, t as n } from "./cell-formatting-C0OsDmi_.js";
1
+ import { i as e, n as t, t as n } from "./cell-formatting-Eypm-id0.js";
2
2
  import "./sv-grid-element.js";
3
3
  //#region ../grid/dist/export-format.js
4
4
  function r(e) {
@@ -26,7 +26,7 @@ function i(i, a) {
26
26
  if (a.type === "date" || a.type === "datetime") {
27
27
  let n = r(i);
28
28
  if (n) {
29
- let r = t(a.pattern, a.type), i = r || a.options ? {
29
+ let r = e(a.pattern, a.type), i = r || a.options ? {
30
30
  ...r,
31
31
  ...a.options
32
32
  } : a.type === "date" ? {
@@ -40,7 +40,7 @@ function i(i, a) {
40
40
  hour: "2-digit",
41
41
  minute: "2-digit"
42
42
  };
43
- return e(a.locales, i).format(n);
43
+ return t(a.locales, i).format(n);
44
44
  }
45
45
  }
46
46
  return String(i);
@@ -57,11 +57,11 @@ function e(e) {
57
57
  !n || e.pointerId !== n.pointerId || c(!1);
58
58
  }
59
59
  return {
60
- start(r, i) {
60
+ start(r, i, a) {
61
61
  if (!e.managed() || n) return;
62
- let a = e.originalAt(i);
63
- if (a == null) return;
64
- let s = r.currentTarget;
62
+ let s = e.originalAt(i);
63
+ if (s == null) return;
64
+ let c = r.currentTarget;
65
65
  n = {
66
66
  pointerId: r.pointerId,
67
67
  rowIndex: i,
@@ -70,17 +70,19 @@ function e(e) {
70
70
  started: !1,
71
71
  timer: null,
72
72
  scrollFrame: null,
73
- scroller: s?.closest?.(".sv-grid-container") ?? null,
74
- root: s?.closest?.(".sv-grid-root") ?? null
75
- }, window.addEventListener("pointermove", l, { passive: !1 }), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", d), window.addEventListener("touchmove", o, { passive: !1 }), n.timer = setTimeout(() => {
73
+ scroller: c?.closest?.(".sv-grid-container") ?? null,
74
+ root: c?.closest?.(".sv-grid-root") ?? null
75
+ }, window.addEventListener("pointermove", l, { passive: !1 }), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", d), window.addEventListener("touchmove", o, { passive: !1 });
76
+ let f = a == null ? 0 : Math.max(0, performance.now() - a);
77
+ n.timer = setTimeout(() => {
76
78
  if (n) {
77
79
  n.started = !0, n.timer = null, n.root?.classList.add("sv-grid-row-drag-active");
78
80
  try {
79
- s?.setPointerCapture?.(r.pointerId);
81
+ c?.setPointerCapture?.(r.pointerId);
80
82
  } catch {}
81
- e.openBus(a), t.rowDragActive = !0, t.rowDropIndex = i, t.rowDropSide = "before";
83
+ e.openBus(s), t.rowDragActive = !0, t.rowDropIndex = i, t.rowDropSide = "before";
82
84
  }
83
- }, 350);
85
+ }, Math.max(0, 350 - f));
84
86
  },
85
87
  destroy() {
86
88
  c(!1);