@svgrid/grid-wc 3.0.1 → 3.0.2

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 (92) hide show
  1. package/README.md +20 -0
  2. package/dist/GridMenus-B1mC1aPp.js +1077 -0
  3. package/dist/SvChartMenu-CBMKm7Xb.js +413 -0
  4. package/dist/SvDateRangeInput-BrYTQEMM.js +197 -0
  5. package/dist/SvDateTimePicker-CnLlqNDQ.js +766 -0
  6. package/dist/SvField-Bmzp3ObZ.js +147 -0
  7. package/dist/SvGridCellEditor-B005dmV1.js +560 -0
  8. package/dist/SvGridChart-4TcL9Rj2.js +3702 -0
  9. package/dist/SvGridChartBuilder-C4OL4XYx.js +1165 -0
  10. package/dist/SvGridChartPanel-CfHA8Ioq.js +1743 -0
  11. package/dist/SvGridChartView-Ci-9_EJ0.js +45 -0
  12. package/dist/SvGridDropdown-BlA6iw9m.js +257 -0
  13. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +178 -7
  14. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
  15. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +77 -2
  16. package/dist/chart/SvChartMenu-C-sbGNk8.js +586 -0
  17. package/dist/chart/chart-export-BHGuh_kZ.js +127 -0
  18. package/dist/chart/chart-export-pdf-BjkkIEkE.js +104 -0
  19. package/dist/chart/chart-summary-B86RFA3M.js +137 -0
  20. package/dist/chart/chart-trend-DP6DSsBa.js +56 -0
  21. package/dist/chart/chart-validate-CD6ptiwg.js +180 -0
  22. package/dist/chart/client-BuB0wIgc.js +2757 -0
  23. package/dist/chart/sv-chart-element.d.ts +98 -0
  24. package/dist/chart/sv-chart-element.js +7282 -0
  25. package/dist/chart-DoqdUoGg.js +4398 -0
  26. package/dist/chart-export-pdf-BirUdchl.js +104 -0
  27. package/dist/chart-summary-BP9i-v8M.js +137 -0
  28. package/dist/chart-validate-CD6ptiwg.js +180 -0
  29. package/dist/{shadow/client-DjwUji8D.js → client-DEF0GRjE.js} +1 -1
  30. package/dist/{column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
  31. package/dist/date-format-DMTwV8NC.js +1128 -0
  32. package/dist/focus-trap-DvlOlOGM.js +65 -0
  33. package/dist/list-option-DrRyivWp.js +82 -0
  34. package/dist/react/chart.d.ts +99 -0
  35. package/dist/react/chart.js +49 -0
  36. package/dist/react/index.d.ts +28 -0
  37. package/dist/react/index.js +4 -1
  38. package/dist/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
  39. package/dist/shadow/GridMenus-B1mC1aPp.js +1077 -0
  40. package/dist/shadow/SvChartMenu-CBMKm7Xb.js +413 -0
  41. package/dist/shadow/SvDateRangeInput-BrYTQEMM.js +197 -0
  42. package/dist/shadow/SvDateTimePicker-CnLlqNDQ.js +766 -0
  43. package/dist/shadow/SvField-Bmzp3ObZ.js +147 -0
  44. package/dist/shadow/SvGridCellEditor-B005dmV1.js +560 -0
  45. package/dist/shadow/SvGridChart-4TcL9Rj2.js +3702 -0
  46. package/dist/shadow/SvGridChartBuilder-C4OL4XYx.js +1165 -0
  47. package/dist/shadow/SvGridChartPanel-CfHA8Ioq.js +1743 -0
  48. package/dist/shadow/SvGridChartView-Ci-9_EJ0.js +45 -0
  49. package/dist/shadow/SvGridDropdown-BlA6iw9m.js +257 -0
  50. package/dist/shadow/chart-DoqdUoGg.js +4398 -0
  51. package/dist/shadow/chart-export-pdf-BirUdchl.js +104 -0
  52. package/dist/shadow/chart-summary-BP9i-v8M.js +137 -0
  53. package/dist/shadow/chart-validate-CD6ptiwg.js +180 -0
  54. package/dist/{client-DjwUji8D.js → shadow/client-DEF0GRjE.js} +1 -1
  55. package/dist/shadow/{column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
  56. package/dist/shadow/date-format-DMTwV8NC.js +1128 -0
  57. package/dist/shadow/focus-trap-DvlOlOGM.js +65 -0
  58. package/dist/shadow/list-option-DrRyivWp.js +82 -0
  59. package/dist/shadow/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
  60. package/dist/shadow/sv-grid-shadow-element.d.ts +15 -0
  61. package/dist/shadow/sv-grid-shadow-element.js +4688 -3621
  62. package/dist/shadow/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  63. package/dist/sv-grid-element.d.ts +15 -0
  64. package/dist/sv-grid-element.js +4646 -3609
  65. package/dist/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  66. package/dist/vue/chart.d.ts +64 -0
  67. package/dist/vue/chart.js +41 -0
  68. package/dist/vue/index.d.ts +11 -2
  69. package/dist/vue/index.js +4 -1
  70. package/package.json +18 -5
  71. package/dist/GridMenus-YwTw9Upd.js +0 -1123
  72. package/dist/SvDateRangeInput-CrxeppBV.js +0 -196
  73. package/dist/SvDateTimePicker-xAO-Pb4S.js +0 -765
  74. package/dist/SvField-CE345DyF.js +0 -146
  75. package/dist/SvGridCellEditor-D7SyHtff.js +0 -550
  76. package/dist/SvGridChart-CMaVmlso.js +0 -1477
  77. package/dist/SvGridChartPanel-Pc_IW0eA.js +0 -833
  78. package/dist/SvGridChartView-DLhhzmFy.js +0 -52
  79. package/dist/SvGridDropdown-DUncHqM-.js +0 -256
  80. package/dist/chart-GRBAgN1M.js +0 -1658
  81. package/dist/date-format-D_oQ5Yw0.js +0 -1127
  82. package/dist/shadow/GridMenus-YwTw9Upd.js +0 -1123
  83. package/dist/shadow/SvDateRangeInput-CrxeppBV.js +0 -196
  84. package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +0 -765
  85. package/dist/shadow/SvField-CE345DyF.js +0 -146
  86. package/dist/shadow/SvGridCellEditor-D7SyHtff.js +0 -550
  87. package/dist/shadow/SvGridChart-CMaVmlso.js +0 -1477
  88. package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +0 -833
  89. package/dist/shadow/SvGridChartView-DLhhzmFy.js +0 -52
  90. package/dist/shadow/SvGridDropdown-DUncHqM-.js +0 -256
  91. package/dist/shadow/chart-GRBAgN1M.js +0 -1658
  92. package/dist/shadow/date-format-D_oQ5Yw0.js +0 -1127
@@ -0,0 +1,65 @@
1
+ //#region ../grid/dist/a11y/focus-trap.js
2
+ var e = [
3
+ "a[href]",
4
+ "area[href]",
5
+ "button:not([disabled])",
6
+ "input:not([disabled])",
7
+ "select:not([disabled])",
8
+ "textarea:not([disabled])",
9
+ "iframe",
10
+ "audio[controls]",
11
+ "video[controls]",
12
+ "[contenteditable]:not([contenteditable=\"false\"])",
13
+ "[tabindex]"
14
+ ].join(",");
15
+ function t(e) {
16
+ if (e.hasAttribute("disabled") || e.getAttribute("aria-hidden") === "true" || e.hidden || e.closest("[hidden]")) return !1;
17
+ let t = e.style;
18
+ return !(t.display === "none" || t.visibility === "hidden" || typeof e.getClientRects == "function" && e.getClientRects().length === 0 && document.body.getClientRects().length > 0);
19
+ }
20
+ function n(n) {
21
+ return Array.from(n.querySelectorAll(e)).filter((e) => {
22
+ let n = e.getAttribute("tabindex");
23
+ return n !== null && Number(n) < 0 ? !1 : t(e);
24
+ });
25
+ }
26
+ function r(e, t = {}) {
27
+ let { initialFocus: r = "first", returnFocus: i = !0 } = t, a = null, o = !1;
28
+ function s() {
29
+ let t = r;
30
+ return t === "container" ? e : t === "first" ? n(e)[0] ?? e : typeof t == "function" ? t() : t;
31
+ }
32
+ function c(r) {
33
+ if (!o) return;
34
+ if (r.key === "Escape" && t.onEscape) {
35
+ t.onEscape(r);
36
+ return;
37
+ }
38
+ if (r.key !== "Tab") return;
39
+ let i = n(e);
40
+ if (!i.length) {
41
+ r.preventDefault(), e.focus();
42
+ return;
43
+ }
44
+ let a = i[0], s = i[i.length - 1], c = document.activeElement;
45
+ if (!e.contains(c)) {
46
+ r.preventDefault(), a.focus();
47
+ return;
48
+ }
49
+ r.shiftKey && c === a ? (r.preventDefault(), s.focus()) : !r.shiftKey && c === s && (r.preventDefault(), a.focus());
50
+ }
51
+ function l() {
52
+ o || (o = !0, a = document.activeElement, e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), document.addEventListener("keydown", c, !0), queueMicrotask(() => {
53
+ o && s()?.focus();
54
+ }));
55
+ }
56
+ function u() {
57
+ o && (o = !1, document.removeEventListener("keydown", c, !0), i && a?.focus?.(), a = null);
58
+ }
59
+ return {
60
+ activate: l,
61
+ release: u
62
+ };
63
+ }
64
+ //#endregion
65
+ export { r as t };
@@ -0,0 +1,82 @@
1
+ //#region ../grid/dist/list-option.js
2
+ function e(e) {
3
+ return e ? e.map((e) => {
4
+ if (typeof e == "object" && e) {
5
+ let t = e, n = t.value ?? t.label ?? "";
6
+ return {
7
+ ...t,
8
+ value: n,
9
+ label: t.label ?? String(n)
10
+ };
11
+ }
12
+ return {
13
+ value: e,
14
+ label: String(e)
15
+ };
16
+ }) : [];
17
+ }
18
+ function t(e) {
19
+ let t = [], n = /* @__PURE__ */ new Map();
20
+ return e.forEach((e, r) => {
21
+ let i = e.group ?? null, a = n.get(i);
22
+ a || (a = {
23
+ group: i,
24
+ options: []
25
+ }, n.set(i, a), t.push(a)), a.options.push({
26
+ ...e,
27
+ index: r
28
+ });
29
+ }), t;
30
+ }
31
+ function n(e, n) {
32
+ let r = Math.max(1, n.groupHeaderHeight ?? 28), i = n.rowHeight, a = (e) => Math.max(1, typeof i == "function" ? i(e, e.index) : i), o = [], s = Array(e.length), c = !1;
33
+ for (let n of t(e)) {
34
+ n.group != null && (c = !0, o.push({
35
+ type: "group",
36
+ label: n.group,
37
+ size: r
38
+ }));
39
+ for (let e of n.options) s[e.index] = o.length, o.push({
40
+ type: "option",
41
+ opt: e,
42
+ size: a(e)
43
+ });
44
+ }
45
+ return {
46
+ entries: o,
47
+ hasGroups: c,
48
+ sizeAt: (e) => o[e]?.size ?? 0,
49
+ optionFlatIndex: s
50
+ };
51
+ }
52
+ function r(e, t, n) {
53
+ let r = t.trim().toLowerCase();
54
+ if (!r || !e.length) return -1;
55
+ let i = e.length;
56
+ for (let t = 1; t <= i; t++) {
57
+ let a = (n + t) % i, o = e[a];
58
+ if (o && !o.disabled && o.label.toLowerCase().startsWith(r)) return a;
59
+ }
60
+ return -1;
61
+ }
62
+ function i(e = 600) {
63
+ let t = "", n;
64
+ return {
65
+ get value() {
66
+ return t;
67
+ },
68
+ push(r) {
69
+ return t += r, n && clearTimeout(n), n = setTimeout(() => {
70
+ t = "";
71
+ }, e), t;
72
+ },
73
+ clear() {
74
+ t = "", n && clearTimeout(n);
75
+ }
76
+ };
77
+ }
78
+ function a(e) {
79
+ return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && e.key !== " ";
80
+ }
81
+ //#endregion
82
+ export { r as a, a as i, n, e as o, t as r, i as t };
@@ -1,65 +1,73 @@
1
1
  //#region ../grid/dist/row-resize.js
2
2
  var e = "sv-grid-row-resize-handle";
3
3
  function t(t, n) {
4
- let r = n, i = null;
5
- function a(e) {
4
+ let r = n, i = null, a = null;
5
+ function o(e) {
6
6
  let t = e.querySelector("[data-svgrid-row]")?.dataset.svgridRow;
7
7
  return t == null ? NaN : Number(t);
8
8
  }
9
- function o(e) {
9
+ function s(e) {
10
10
  if (!i) return;
11
11
  let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
12
12
  i.trEl.style.height = `${Math.round(a)}px`, r.onResizeMove?.(i.rowIndex, Math.round(a));
13
13
  }
14
- function s(e) {
14
+ function c(e) {
15
15
  if (!i) return;
16
16
  let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
17
17
  r.onResize(i.rowIndex, Math.round(a)), i.strip.classList.remove("is-resizing");
18
18
  try {
19
19
  i.trEl.releasePointerCapture(e.pointerId);
20
20
  } catch {}
21
- i = null, window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), document.body.style.cursor = "";
21
+ i = null, window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c), document.body.style.cursor = "";
22
22
  }
23
- function c(t) {
23
+ function l(t) {
24
24
  if (r.disabled) return;
25
25
  let n = t.target;
26
26
  if (!n?.classList.contains(e)) return;
27
- let i = t.shiftKey ? 1 : 10, o = 0;
28
- if (t.key === "ArrowUp") o = -i;
29
- else if (t.key === "ArrowDown") o = i;
27
+ let i = t.shiftKey ? 1 : 10, a = 0;
28
+ if (t.key === "ArrowUp") a = -i;
29
+ else if (t.key === "ArrowDown") a = i;
30
30
  else return;
31
31
  let s = n.closest("tr.sv-grid-row");
32
32
  if (!s) return;
33
- let c = a(s);
33
+ let c = o(s);
34
34
  if (!Number.isFinite(c)) return;
35
35
  t.preventDefault(), t.stopPropagation();
36
- let l = r.min ?? 20, u = r.max ?? 320, d = Math.round(Math.max(l, Math.min(u, s.getBoundingClientRect().height + o)));
36
+ let l = r.min ?? 20, u = r.max ?? 320, d = Math.round(Math.max(l, Math.min(u, s.getBoundingClientRect().height + a)));
37
37
  s.style.height = `${d}px`, r.onResizeMove?.(c, d), r.onResize(c, d);
38
38
  }
39
- function l(t) {
39
+ function u(t) {
40
40
  if (r.disabled) return;
41
41
  let n = t.target;
42
42
  if (!n?.classList.contains(e)) return;
43
- let c = n.closest("tr.sv-grid-row");
44
- if (!c) return;
45
- let l = a(c);
46
- if (Number.isFinite(l)) {
47
- t.preventDefault(), t.stopPropagation(), n.classList.add("is-resizing"), i = {
48
- rowIndex: l,
49
- startY: t.clientY,
50
- startHeight: c.getBoundingClientRect().height,
51
- trEl: c,
52
- strip: n
53
- };
54
- try {
55
- c.setPointerCapture(t.pointerId);
56
- } catch {}
57
- document.body.style.cursor = "row-resize", window.addEventListener("pointermove", o), window.addEventListener("pointerup", s);
43
+ let l = n.closest("tr.sv-grid-row");
44
+ if (!l) return;
45
+ let u = o(l);
46
+ if (!Number.isFinite(u)) return;
47
+ t.preventDefault(), t.stopPropagation();
48
+ let d = t.timeStamp, f = a !== null && a.rowIndex === u && d - a.at < 400;
49
+ if (a = {
50
+ rowIndex: u,
51
+ at: d
52
+ }, f && r.onAutosize) {
53
+ a = null, r.onAutosize(u);
54
+ return;
58
55
  }
56
+ n.classList.add("is-resizing"), i = {
57
+ rowIndex: u,
58
+ startY: t.clientY,
59
+ startHeight: l.getBoundingClientRect().height,
60
+ trEl: l,
61
+ strip: n
62
+ };
63
+ try {
64
+ l.setPointerCapture(t.pointerId);
65
+ } catch {}
66
+ document.body.style.cursor = "row-resize", window.addEventListener("pointermove", s), window.addEventListener("pointerup", c);
59
67
  }
60
- function u() {
68
+ function d() {
61
69
  if (r.disabled) {
62
- d();
70
+ f();
63
71
  return;
64
72
  }
65
73
  let n = t.querySelectorAll("tr.sv-grid-row");
@@ -72,21 +80,21 @@ function t(t, n) {
72
80
  i.className = e, i.setAttribute("role", "separator"), i.setAttribute("aria-orientation", "horizontal"), i.setAttribute("aria-label", "Resize row"), i.tabIndex = 0, i.style.cssText = "position:absolute;left:0;right:0;bottom:0;height:5px;cursor:row-resize;user-select:none;z-index:60;pointer-events:auto;", n.appendChild(i);
73
81
  }
74
82
  }
75
- function d() {
83
+ function f() {
76
84
  t.querySelectorAll(`.${e}`).forEach((e) => e.remove());
77
85
  }
78
- t.addEventListener("pointerdown", l, { capture: !0 }), t.addEventListener("keydown", c, { capture: !0 });
79
- let f = new MutationObserver(() => u());
80
- return f.observe(t, {
86
+ t.addEventListener("pointerdown", u, { capture: !0 }), t.addEventListener("keydown", l, { capture: !0 });
87
+ let p = new MutationObserver(() => d());
88
+ return p.observe(t, {
81
89
  childList: !0,
82
90
  subtree: !0
83
- }), u(), {
91
+ }), d(), {
84
92
  update(e) {
85
93
  let t = r.disabled;
86
- r = e, t !== r.disabled && u();
94
+ r = e, t !== r.disabled && d();
87
95
  },
88
96
  destroy() {
89
- t.removeEventListener("pointerdown", l, { capture: !0 }), t.removeEventListener("keydown", c, { capture: !0 }), window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), f.disconnect(), d();
97
+ t.removeEventListener("pointerdown", u, { capture: !0 }), t.removeEventListener("keydown", l, { capture: !0 }), window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c), p.disconnect(), f();
90
98
  }
91
99
  };
92
100
  }
@@ -135,9 +135,17 @@ export interface SvGridElement extends HTMLElement {
135
135
  /** attribute `copy-headers-to-clipboard` */
136
136
  copyHeadersToClipboard: boolean
137
137
  /** property only - an attribute cannot hold this */
138
+ processCellForFill: unknown
139
+ /** property only - an attribute cannot hold this */
138
140
  processCellForClipboard: unknown
141
+ /** property only - an attribute cannot hold this */
142
+ clipboardHtml: unknown
143
+ /** property only - an attribute cannot hold this */
144
+ processCellFromClipboard: unknown
139
145
  /** attribute `enable-inline-editing` */
140
146
  enableInlineEditing: boolean
147
+ /** attribute `edit-on-second-click` */
148
+ editOnSecondClick: boolean
141
149
  /** attribute `full-row-editing` */
142
150
  fullRowEditing: boolean
143
151
  /** attribute `enable-row-summaries` */
@@ -192,6 +200,10 @@ export interface SvGridElement extends HTMLElement {
192
200
  serverFilterValues: unknown
193
201
  /** property only - an attribute cannot hold this */
194
202
  pinnedTopRows: readonly unknown[]
203
+ /** attribute `frozen-rows` */
204
+ frozenRows: number
205
+ /** property only - an attribute cannot hold this */
206
+ mergedCells: readonly unknown[]
195
207
  /** property only - an attribute cannot hold this */
196
208
  pinnedBottomRows: readonly unknown[]
197
209
  /** attribute `enable-column-reorder` */
@@ -223,6 +235,9 @@ declare global {
223
235
  pivotmodechange: CustomEvent<unknown>
224
236
  expandedchange: CustomEvent<unknown>
225
237
  paginationchange: CustomEvent<unknown>
238
+ columnresize: CustomEvent<unknown>
239
+ rowresize: CustomEvent<unknown>
240
+ pasteclipboard: CustomEvent<unknown>
226
241
  apiready: CustomEvent<unknown>
227
242
  rowselectionchange: CustomEvent<unknown>
228
243
  cellselectionchange: CustomEvent<unknown>