@svgrid/grid-wc 2.7.0 → 3.0.0

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 (27) hide show
  1. package/dist/GridMenus-DpmS1pzo.js +1121 -0
  2. package/dist/SvDateRangeInput-u4ibte8S.js +196 -0
  3. package/dist/SvDateTimePicker-DVFiDxUq.js +765 -0
  4. package/dist/{dismissable-Nx79OIVg.js → SvField-ChCI-O2O.js} +9 -49
  5. package/dist/{SvGrid.helpers-BZPDBcza.js → SvGrid.helpers-BdVDtjUm.js} +24 -14
  6. package/dist/SvGridCellEditor-DvsQyE9a.js +550 -0
  7. package/dist/date-format-CPHqTHN6.js +1127 -0
  8. package/dist/dismissable-DvhBKm3q.js +41 -0
  9. package/dist/{row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
  10. package/dist/shadow/GridMenus-DpmS1pzo.js +1121 -0
  11. package/dist/shadow/SvDateRangeInput-u4ibte8S.js +196 -0
  12. package/dist/shadow/SvDateTimePicker-DVFiDxUq.js +765 -0
  13. package/dist/shadow/{dismissable-Nx79OIVg.js → SvField-ChCI-O2O.js} +9 -49
  14. package/dist/shadow/{SvGrid.helpers-BZPDBcza.js → SvGrid.helpers-BdVDtjUm.js} +24 -14
  15. package/dist/shadow/SvGridCellEditor-DvsQyE9a.js +550 -0
  16. package/dist/shadow/date-format-CPHqTHN6.js +1127 -0
  17. package/dist/shadow/dismissable-DvhBKm3q.js +41 -0
  18. package/dist/shadow/{row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
  19. package/dist/shadow/sv-grid-shadow-element.js +2718 -2610
  20. package/dist/sv-grid-element.js +2716 -2608
  21. package/package.json +3 -3
  22. package/dist/GridMenus-DE0zNY_3.js +0 -1022
  23. package/dist/SvDateTimePicker-BpeEupA2.js +0 -1885
  24. package/dist/SvGridCellEditor-_rqEaig7.js +0 -531
  25. package/dist/shadow/GridMenus-DE0zNY_3.js +0 -1022
  26. package/dist/shadow/SvDateTimePicker-BpeEupA2.js +0 -1885
  27. package/dist/shadow/SvGridCellEditor-_rqEaig7.js +0 -531
@@ -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 };
@@ -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);