@svgrid/grid-wc 3.0.13 → 3.0.15

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 (38) hide show
  1. package/dist/GridFooter-DaqpUo5H.js +145 -0
  2. package/dist/GridMenus-BXla2VNU.js +1367 -0
  3. package/dist/PinSplitter-Qd1_-3pw.js +130 -0
  4. package/dist/{shadow/SvGrid.helpers-zBkDTryR.js → SvGrid.helpers-B2GEKrxS.js} +84 -36
  5. package/dist/{shadow/SvGridCellEditor-C2t-q8n3.js → SvGridCellEditor-DdqVsNeJ.js} +20 -9
  6. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +37 -3
  7. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
  8. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +15 -1
  9. package/dist/conditional-formatting-LFQdw2jz.js +180 -0
  10. package/dist/{shadow/export-format-DQtIyOvV.js → export-format-DIcJWdKl.js} +1 -1
  11. package/dist/grid-extension.svelte-6IzZ_3Cv.js +20 -0
  12. package/dist/react/index.d.ts +34 -0
  13. package/dist/react/index.js +7 -1
  14. package/dist/shadow/GridFooter-BBBUK5Ry.js +145 -0
  15. package/dist/shadow/GridMenus-DGiPj4-r.js +1367 -0
  16. package/dist/shadow/PinSplitter-Qd1_-3pw.js +130 -0
  17. package/dist/{SvGrid.helpers-zBkDTryR.js → shadow/SvGrid.helpers-B2GEKrxS.js} +84 -36
  18. package/dist/{SvGridCellEditor-C2t-q8n3.js → shadow/SvGridCellEditor-DdqVsNeJ.js} +20 -9
  19. package/dist/shadow/conditional-formatting-LFQdw2jz.js +180 -0
  20. package/dist/{export-format-CXEUNl8j.js → shadow/export-format-DIcJWdKl.js} +1 -1
  21. package/dist/shadow/grid-extension.svelte-6IzZ_3Cv.js +20 -0
  22. package/dist/shadow/sparkline-DWRBQubt.js +86 -0
  23. package/dist/shadow/sv-grid-shadow-element.d.ts +22 -0
  24. package/dist/shadow/sv-grid-shadow-element.js +3623 -3711
  25. package/dist/shadow/svelte-virtualizer.svelte-Bftvroa6.js +360 -0
  26. package/dist/shadow/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
  27. package/dist/sparkline-DWRBQubt.js +86 -0
  28. package/dist/sv-grid-element.d.ts +22 -0
  29. package/dist/sv-grid-element.js +3281 -3369
  30. package/dist/svelte-virtualizer.svelte-Bftvroa6.js +360 -0
  31. package/dist/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
  32. package/dist/vue/index.d.ts +16 -2
  33. package/dist/vue/index.js +1 -1
  34. package/package.json +3 -3
  35. package/dist/GridMenus-BsOHO9kc.js +0 -1086
  36. package/dist/shadow/GridMenus-BsOHO9kc.js +0 -1086
  37. package/dist/shadow/svelte-virtualizer.svelte-BGip4kwG.js +0 -581
  38. package/dist/svelte-virtualizer.svelte-BGip4kwG.js +0 -581
@@ -0,0 +1,86 @@
1
+ //#region ../grid/dist/sparkline.js
2
+ var e = {
3
+ width: 88,
4
+ height: 22,
5
+ color: "var(--sg-accent, #2563eb)",
6
+ negativeColor: "#ef4444",
7
+ lineWidth: 1.5
8
+ };
9
+ function t(e) {
10
+ return Array.isArray(e) ? e.map((e) => Number(e)).filter((e) => Number.isFinite(e)) : typeof e == "string" && e.trim() ? e.split(/[,\s]+/).map((e) => Number(e)).filter((e) => Number.isFinite(e)) : [];
11
+ }
12
+ function n(t, n = {}) {
13
+ if (!t.length) return null;
14
+ let i = n.width ?? e.width, a = n.height ?? e.height, o = n.type ?? "line", s = n.color ?? e.color, c = n.negativeColor ?? e.negativeColor, l = n.lineWidth ?? e.lineWidth, u = Math.ceil(l) + 1, d = Math.max(1, i - u * 2), f = Math.max(1, a - u * 2), p = {
15
+ width: i,
16
+ height: a,
17
+ type: o,
18
+ color: s,
19
+ negativeColor: c,
20
+ lineWidth: l
21
+ };
22
+ if (o === "winloss") {
23
+ let e = t.length, n = e > 1 ? Math.min(2, d / e / 3) : 0, r = d / e, i = Math.max(1, r - n), o = a / 2, s = f / 2, c = [];
24
+ return t.forEach((e, t) => {
25
+ let n = u + t * r + (r - i) / 2;
26
+ e > 0 ? c.push({
27
+ x: n,
28
+ y: o - s,
29
+ w: i,
30
+ h: s,
31
+ negative: !1
32
+ }) : e < 0 && c.push({
33
+ x: n,
34
+ y: o,
35
+ w: i,
36
+ h: s,
37
+ negative: !0
38
+ });
39
+ }), {
40
+ ...p,
41
+ linePath: "",
42
+ areaPath: "",
43
+ bars: c,
44
+ lastPoint: null
45
+ };
46
+ }
47
+ let m = n.min ?? Math.min(...t), h = n.max ?? Math.max(...t), g = h - m || 1;
48
+ if (o === "bar") {
49
+ let e = t.length, n = e > 1 ? Math.min(2, d / e / 3) : 0, r = d / e, i = Math.max(1, r - n), a = m < 0 && h > 0 ? 0 : m, o = u + f - (a - m) / g * f, s = t.map((e, t) => {
50
+ let n = u + t * r + (r - i) / 2, s = u + f - (e - m) / g * f, c = Math.min(s, o), l = Math.max(1, Math.abs(s - o));
51
+ return {
52
+ x: n,
53
+ y: c,
54
+ w: i,
55
+ h: l,
56
+ negative: e < a
57
+ };
58
+ });
59
+ return {
60
+ ...p,
61
+ linePath: "",
62
+ areaPath: "",
63
+ bars: s,
64
+ lastPoint: null
65
+ };
66
+ }
67
+ let _ = t.length, v = _ > 1 ? d / (_ - 1) : 0, y = t.map((e, t) => ({
68
+ x: _ === 1 ? u + d / 2 : u + t * v,
69
+ y: u + f - (e - m) / g * f
70
+ })), b = _ === 1 ? `M${r(y[0].x - 1)},${r(y[0].y)} L${r(y[0].x + 1)},${r(y[0].y)}` : y.map((e, t) => `${t === 0 ? "M" : "L"}${r(e.x)},${r(e.y)}`).join(" "), x = y[0], S = y[y.length - 1], C = u + f, w = o === "area" ? `${b} L${r(S.x)},${r(C)} L${r(x.x)},${r(C)} Z` : "";
71
+ return {
72
+ ...p,
73
+ linePath: b,
74
+ areaPath: w,
75
+ bars: [],
76
+ lastPoint: n.lastPoint === !1 ? null : {
77
+ x: S.x,
78
+ y: S.y
79
+ }
80
+ };
81
+ }
82
+ function r(e) {
83
+ return Math.round(e * 100) / 100;
84
+ }
85
+ //#endregion
86
+ export { n as buildSparkline, t as toSparklineValues };
@@ -19,6 +19,8 @@ export interface SvGridElement extends HTMLElement {
19
19
  /** property only - an attribute cannot hold this */
20
20
  board: unknown
21
21
  /** property only - an attribute cannot hold this */
22
+ gallery: unknown
23
+ /** property only - an attribute cannot hold this */
22
24
  scheduler: unknown
23
25
  /** property only - an attribute cannot hold this */
24
26
  gantt: unknown
@@ -32,6 +34,20 @@ export interface SvGridElement extends HTMLElement {
32
34
  contextMenu: boolean
33
35
  /** attribute `selection-bar` */
34
36
  selectionBar: boolean
37
+ /** attribute `row-adder` */
38
+ rowAdder: boolean
39
+ /** property only - an attribute cannot hold this */
40
+ rowColor: unknown
41
+ /** attribute `column-adder` */
42
+ columnAdder: boolean
43
+ /** attribute `field-menu` */
44
+ fieldMenu: boolean
45
+ /** attribute `expand-rows` */
46
+ expandRows: boolean
47
+ /** attribute `pin-splitter` */
48
+ pinSplitter: boolean
49
+ /** attribute `primary-field` */
50
+ primaryField: string
35
51
  /** property only - an attribute cannot hold this */
36
52
  features: unknown
37
53
  /** attribute `sortable` */
@@ -257,6 +273,12 @@ declare global {
257
273
 
258
274
  interface HTMLElementEventMap {
259
275
  pivotmodechange: CustomEvent<unknown>
276
+ rowadd: CustomEvent<unknown>
277
+ columnadd: CustomEvent<unknown>
278
+ columnchange: CustomEvent<unknown>
279
+ columnremove: CustomEvent<unknown>
280
+ rowsdelete: CustomEvent<unknown>
281
+ rowcolorchange: CustomEvent<unknown>
260
282
  expandedchange: CustomEvent<unknown>
261
283
  paginationchange: CustomEvent<unknown>
262
284
  columnresize: CustomEvent<unknown>