@svgrid/grid-wc 2.6.2 → 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 (58) 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-xj_k_fnZ.js → SvField-ChCI-O2O.js} +44 -84
  5. package/dist/{SvGrid.helpers-CgUd39VT.js → SvGrid.helpers-BdVDtjUm.js} +37 -11
  6. package/dist/SvGridCellEditor-DvsQyE9a.js +550 -0
  7. package/dist/{SvGridChart-BztTavvw.js → SvGridChart-yK5Zv85y.js} +158 -158
  8. package/dist/{SvGridChartPanel-Ca5HWIZ3.js → SvGridChartPanel-B38_VjXM.js} +52 -52
  9. package/dist/{SvGridChartView-AcWj_tcs.js → SvGridChartView-ScXTF6t-.js} +4 -4
  10. package/dist/{SvGridDropdown-BXqvR1cs.js → SvGridDropdown-DnAESFDu.js} +29 -29
  11. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +358 -0
  12. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -0
  13. package/dist/angular/package.json +25 -0
  14. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +161 -0
  15. package/dist/{client-DoXxrq8q.js → client-DjwUji8D.js} +1 -1
  16. package/dist/column-resize-DvCRUrN3.js +101 -0
  17. package/dist/date-format-CPHqTHN6.js +1127 -0
  18. package/dist/dismissable-DvhBKm3q.js +41 -0
  19. package/dist/react/index.d.ts +313 -0
  20. package/dist/react/index.js +72 -0
  21. package/dist/{row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
  22. package/dist/row-resize-D-8s3cqT.js +94 -0
  23. package/dist/shadow/GridMenus-DpmS1pzo.js +1121 -0
  24. package/dist/shadow/SvDateRangeInput-u4ibte8S.js +196 -0
  25. package/dist/shadow/SvDateTimePicker-DVFiDxUq.js +765 -0
  26. package/dist/shadow/SvField-ChCI-O2O.js +146 -0
  27. package/dist/shadow/SvGrid.helpers-BdVDtjUm.js +135 -0
  28. package/dist/shadow/SvGridCellEditor-DvsQyE9a.js +550 -0
  29. package/dist/shadow/SvGridChart-yK5Zv85y.js +1199 -0
  30. package/dist/shadow/SvGridChartPanel-B38_VjXM.js +584 -0
  31. package/dist/shadow/SvGridChartView-ScXTF6t-.js +50 -0
  32. package/dist/shadow/SvGridDropdown-DnAESFDu.js +256 -0
  33. package/dist/shadow/cell-formatting-C0OsDmi_.js +86 -0
  34. package/dist/shadow/chart-uvs3sFJA.js +1220 -0
  35. package/dist/shadow/client-DjwUji8D.js +2960 -0
  36. package/dist/shadow/column-resize-DvCRUrN3.js +101 -0
  37. package/dist/shadow/date-format-CPHqTHN6.js +1127 -0
  38. package/dist/shadow/dismissable-DvhBKm3q.js +41 -0
  39. package/dist/shadow/editor-contract-peBDxir_.js +22 -0
  40. package/dist/shadow/editor-registry-DxGKqcvx.js +24 -0
  41. package/dist/shadow/export-format-C8kZGZfz.js +161 -0
  42. package/dist/shadow/popover-WsGlvtQv.js +69 -0
  43. package/dist/shadow/row-drag-touch-CycRR65n.js +93 -0
  44. package/dist/shadow/row-resize-D-8s3cqT.js +94 -0
  45. package/dist/shadow/sv-grid-shadow-element.d.ts +246 -0
  46. package/dist/shadow/sv-grid-shadow-element.js +10175 -0
  47. package/dist/{svelte-virtualizer.svelte-CFoYP2Ls.js → shadow/svelte-virtualizer.svelte-DZ9UcyfT.js} +35 -30
  48. package/dist/shadow/validate-CgmAtX1A.js +75 -0
  49. package/dist/sv-grid-element.d.ts +246 -0
  50. package/dist/sv-grid-element.js +3655 -2620
  51. package/dist/svelte-virtualizer.svelte-DZ9UcyfT.js +527 -0
  52. package/dist/validate-CgmAtX1A.js +75 -0
  53. package/dist/vue/index.d.ts +147 -0
  54. package/dist/vue/index.js +72 -0
  55. package/package.json +71 -6
  56. package/dist/GridMenus-CU_-Ks4f.js +0 -1001
  57. package/dist/SvDateTimePicker-Ch1Vug8H.js +0 -1885
  58. package/dist/SvGridCellEditor-CBJUbAsR.js +0 -523
@@ -0,0 +1,101 @@
1
+ //#region ../grid/dist/column-resize.js
2
+ var e = "sv-grid-resize-handle";
3
+ function t(t, n) {
4
+ let r = n, i = null, a = null, o = 0, s = () => r.min ?? 40;
5
+ function c(e) {
6
+ return e.closest("[data-svgrid-header-col]")?.dataset.svgridHeaderCol ?? null;
7
+ }
8
+ function l() {
9
+ i && r.onResize(i.columnId, o);
10
+ }
11
+ function u(e) {
12
+ i && (o = Math.max(s(), i.startWidth + (e.clientX - i.startX)), a === null && (a = requestAnimationFrame(() => {
13
+ a = null, l();
14
+ })));
15
+ }
16
+ function d(e) {
17
+ if (i) {
18
+ a !== null && (cancelAnimationFrame(a), a = null), o = Math.max(s(), i.startWidth + (e.clientX - i.startX)), l(), i.handle.classList.remove("is-resizing"), m(i.handle, i.columnId);
19
+ try {
20
+ i.handle.releasePointerCapture(e.pointerId);
21
+ } catch {}
22
+ i = null, window.removeEventListener("pointermove", u), window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", d), document.body.style.cursor = "";
23
+ }
24
+ }
25
+ function f(t) {
26
+ if (r.disabled) return;
27
+ let n = t.target;
28
+ if (!n?.classList.contains(e)) return;
29
+ let a = c(n);
30
+ if (!(!a || r.canResize?.(a) === !1)) {
31
+ t.preventDefault(), t.stopPropagation(), n.classList.add("is-resizing"), o = r.getWidth(a), i = {
32
+ columnId: a,
33
+ startX: t.clientX,
34
+ startWidth: o,
35
+ handle: n
36
+ };
37
+ try {
38
+ n.setPointerCapture(t.pointerId);
39
+ } catch {}
40
+ document.body.style.cursor = "col-resize", window.addEventListener("pointermove", u), window.addEventListener("pointerup", d), window.addEventListener("pointercancel", d);
41
+ }
42
+ }
43
+ function p(t) {
44
+ if (r.disabled) return;
45
+ let n = t.target;
46
+ if (!n?.classList.contains(e)) return;
47
+ let i = t.shiftKey ? 1 : 10, a = 0;
48
+ if (t.key === "ArrowLeft") a = -i;
49
+ else if (t.key === "ArrowRight") a = i;
50
+ else return;
51
+ let o = c(n);
52
+ if (!o || r.canResize?.(o) === !1) return;
53
+ t.preventDefault(), t.stopPropagation();
54
+ let l = Math.max(s(), Math.round(r.getWidth(o) + a));
55
+ r.onResize(o, l), m(n, o);
56
+ }
57
+ function m(e, t) {
58
+ let n = Math.round(r.getWidth(t));
59
+ e.setAttribute("aria-valuenow", String(n)), e.setAttribute("aria-valuemin", String(s())), e.setAttribute("aria-valuetext", `${n} pixels`);
60
+ }
61
+ function h() {
62
+ if (r.disabled) {
63
+ g();
64
+ return;
65
+ }
66
+ let n = t.querySelectorAll("th.sv-grid-column[data-svgrid-header-col]");
67
+ for (let t of n) {
68
+ if (t.classList.contains("sv-grid-column-spacer")) continue;
69
+ let n = t.dataset.svgridHeaderCol;
70
+ if (!n) continue;
71
+ if (r.canResize?.(n) === !1) {
72
+ t.querySelector(`:scope > .${e}`)?.remove();
73
+ continue;
74
+ }
75
+ if (t.querySelector(`:scope > .${e}`)) continue;
76
+ let i = document.createElement("div");
77
+ i.className = e, i.setAttribute("role", "separator"), i.setAttribute("aria-orientation", "vertical"), i.setAttribute("aria-label", `Resize ${r.label?.(n) ?? n}`), i.tabIndex = 0, m(i, n), i.addEventListener("dblclick", (e) => {
78
+ e.stopPropagation(), e.preventDefault(), !r.disabled && (r.onAutosize?.(n), m(i, n));
79
+ }), t.appendChild(i);
80
+ }
81
+ }
82
+ function g() {
83
+ t.querySelectorAll(`.${e}`).forEach((e) => e.remove());
84
+ }
85
+ t.addEventListener("pointerdown", f, { capture: !0 }), t.addEventListener("keydown", p, { capture: !0 });
86
+ let _ = new MutationObserver(() => h());
87
+ return _.observe(t, {
88
+ childList: !0,
89
+ subtree: !0
90
+ }), h(), {
91
+ update(e) {
92
+ let t = r.disabled;
93
+ r = e, t !== r.disabled && h();
94
+ },
95
+ destroy() {
96
+ t.removeEventListener("pointerdown", f, { capture: !0 }), t.removeEventListener("keydown", p, { capture: !0 }), window.removeEventListener("pointermove", u), window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", d), a !== null && cancelAnimationFrame(a), _.disconnect(), g();
97
+ }
98
+ };
99
+ }
100
+ //#endregion
101
+ export { t as columnResize };