@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
@@ -1,9 +1,9 @@
1
- import { $ as e, A as t, D as n, E as r, F as i, I as a, J as o, K as s, O as c, R as l, V as u, f as d, it as f, j as p, k as m, n as h, nt as g, q as _, tt as v, v as ee, w as te, y } from "./client-DoXxrq8q.js";
1
+ import { $ as e, A as t, D as n, E as r, F as i, I as a, J as o, K as s, O as c, R as l, V as u, et as d, f, j as p, k as m, n as h, q as g, rt as _, tt as v, v as ee, w as te, y } from "./client-DjwUji8D.js";
2
2
  import { n as b, r as x } from "./editor-contract-peBDxir_.js";
3
3
  //#region ../grid/dist/SvField.svelte
4
- var S = p("<span class=\"sv-field__req svelte-xtfnp5\" aria-hidden=\"true\">*</span>"), C = p("<label class=\"sv-field__label svelte-xtfnp5\"> <!></label>"), w = p("<span class=\"sv-field__spinner svelte-xtfnp5\" role=\"status\" aria-label=\"Loading\"></span>"), T = p("<span class=\"sv-field__labelrow svelte-xtfnp5\"><!> <!></span>"), ne = p("<span class=\"sv-field__req svelte-xtfnp5\" aria-hidden=\"true\">*</span>"), re = p("<label class=\"sv-field__float-label svelte-xtfnp5\"> <!></label>"), ie = p("<span class=\"sv-field__adorn sv-field__adorn--lead svelte-xtfnp5\"><!></span>"), ae = p("<span class=\"sv-field__affix sv-field__affix--pre svelte-xtfnp5\"> </span>"), oe = p("<span class=\"sv-field__affix sv-field__affix--suf svelte-xtfnp5\"> </span>"), E = p("<span class=\"sv-field__adorn sv-field__adorn--trail svelte-xtfnp5\"><!></span>"), D = p("<span class=\"sv-field__action-txt svelte-xtfnp5\"> </span>"), O = p("<button class=\"sv-field__action svelte-xtfnp5\" type=\"button\" tabindex=\"-1\"><!></button>"), k = p("<button class=\"sv-field__clear svelte-xtfnp5\" type=\"button\" tabindex=\"-1\">&times;</button>"), A = p("<div><!> <!> <!> <span class=\"sv-field__slot svelte-xtfnp5\"><!></span> <!> <!> <!> <!></div>"), j = p("<span class=\"sv-field__error svelte-xtfnp5\" role=\"alert\"> </span>"), M = p("<span class=\"sv-field__hint svelte-xtfnp5\"> </span>"), N = p("<div><!> <!> <!></div>");
4
+ var S = p("<span class=\"sv-field__req svelte-xtfnp5\" aria-hidden=\"true\">*</span>"), C = p("<label class=\"sv-field__label svelte-xtfnp5\"> <!></label>"), w = p("<span class=\"sv-field__spinner svelte-xtfnp5\" role=\"status\" aria-label=\"Loading\"></span>"), T = p("<span class=\"sv-field__labelrow svelte-xtfnp5\"><!> <!></span>"), ne = p("<span class=\"sv-field__req svelte-xtfnp5\" aria-hidden=\"true\">*</span>"), re = p("<label class=\"sv-field__float-label svelte-xtfnp5\"> <!></label>"), ie = p("<span class=\"sv-field__adorn sv-field__adorn--lead svelte-xtfnp5\"><!></span>"), E = p("<span class=\"sv-field__affix sv-field__affix--pre svelte-xtfnp5\"> </span>"), D = p("<span class=\"sv-field__affix sv-field__affix--suf svelte-xtfnp5\"> </span>"), O = p("<span class=\"sv-field__adorn sv-field__adorn--trail svelte-xtfnp5\"><!></span>"), k = p("<span class=\"sv-field__action-txt svelte-xtfnp5\"> </span>"), A = p("<button class=\"sv-field__action svelte-xtfnp5\" type=\"button\" tabindex=\"-1\"><!></button>"), ae = p("<button class=\"sv-field__clear svelte-xtfnp5\" type=\"button\" tabindex=\"-1\">&times;</button>"), oe = p("<div><!> <!> <!> <span class=\"sv-field__slot svelte-xtfnp5\"><!></span> <!> <!> <!> <!></div>"), j = p("<span class=\"sv-field__error svelte-xtfnp5\" role=\"alert\"> </span>"), M = p("<span class=\"sv-field__hint svelte-xtfnp5\"> </span>"), N = p("<div><!> <!> <!></div>");
5
5
  function P(i, p) {
6
- g(p, !0);
6
+ v(p, !0);
7
7
  let P = h(p, "required", 3, !1), F = h(p, "block", 3, !1), I = h(p, "loading", 3, !1), L = h(p, "frame", 3, !1), R = h(p, "invalid", 3, !1), z = h(p, "size", 3, "md"), B = h(p, "disabled", 3, !1), V = h(p, "readonly", 3, !1), H = h(p, "clearable", 3, !1), U = h(p, "showClear", 3, !1), W = h(p, "clearLabel", 3, "Clear"), G = h(p, "labelMode", 3, "static"), K = h(p, "filled", 3, !1), se = e(() => p.width == null ? void 0 : typeof p.width == "number" ? `${p.width}px` : p.width), q = e(() => G() === "floating" && L() && !!p.label), J = e(() => p.dir === "ltr" || p.dir === "rtl" ? p.dir : void 0);
8
8
  var Y = N();
9
9
  let X;
@@ -15,27 +15,27 @@ function P(i, p) {
15
15
  };
16
16
  r(i, (e) => {
17
17
  P() && e(a);
18
- }), f(t), u(() => {
19
- d(t, "for", p.id), c(n, p.label);
18
+ }), _(t), u(() => {
19
+ f(t, "for", p.id), c(n, p.label);
20
20
  }), m(e, t);
21
21
  };
22
22
  r(n, (e) => {
23
23
  p.label && !l(q) && e(i);
24
24
  });
25
- var a = o(n, 2), h = (e) => {
25
+ var a = o(n, 2), d = (e) => {
26
26
  var t = w();
27
27
  m(e, t);
28
28
  };
29
29
  r(a, (e) => {
30
- I() && e(h);
31
- }), f(t), m(e, t);
30
+ I() && e(d);
31
+ }), _(t), m(e, t);
32
32
  };
33
33
  r(Z, (e) => {
34
34
  (p.label && !l(q) || I()) && e(ce);
35
35
  });
36
36
  var Q = o(Z, 2), le = (e) => {
37
- var i = A();
38
- let h, g;
37
+ var i = oe();
38
+ let d, h;
39
39
  var v = s(i), b = (e) => {
40
40
  var t = re(), n = s(t, !0), i = o(n), a = (e) => {
41
41
  var t = ne();
@@ -43,8 +43,8 @@ function P(i, p) {
43
43
  };
44
44
  r(i, (e) => {
45
45
  P() && e(a);
46
- }), f(t), u(() => {
47
- d(t, "for", p.id), c(n, p.label);
46
+ }), _(t), u(() => {
47
+ f(t, "for", p.id), c(n, p.label);
48
48
  }), m(e, t);
49
49
  };
50
50
  r(v, (e) => {
@@ -52,48 +52,48 @@ function P(i, p) {
52
52
  });
53
53
  var x = o(v, 2), S = (e) => {
54
54
  var t = ie(), r = s(t);
55
- n(r, () => p.leading), f(t), m(e, t);
55
+ n(r, () => p.leading), _(t), m(e, t);
56
56
  };
57
57
  r(x, (e) => {
58
58
  p.leading && e(S);
59
59
  });
60
60
  var C = o(x, 2), w = (e) => {
61
- var t = ae(), n = s(t, !0);
62
- f(t), u(() => c(n, p.prefix)), m(e, t);
61
+ var t = E(), n = s(t, !0);
62
+ _(t), u(() => c(n, p.prefix)), m(e, t);
63
63
  };
64
64
  r(C, (e) => {
65
65
  p.prefix && e(w);
66
66
  });
67
67
  var T = o(C, 2), j = s(T);
68
- n(j, () => p.children), f(T);
68
+ n(j, () => p.children), _(T);
69
69
  var M = o(T, 2), N = (e) => {
70
- var t = oe(), n = s(t, !0);
71
- f(t), u(() => c(n, p.suffix)), m(e, t);
70
+ var t = D(), n = s(t, !0);
71
+ _(t), u(() => c(n, p.suffix)), m(e, t);
72
72
  };
73
73
  r(M, (e) => {
74
74
  p.suffix && e(N);
75
75
  });
76
76
  var I = o(M, 2), L = (e) => {
77
- var t = E(), r = s(t);
78
- n(r, () => p.trailing), f(t), m(e, t);
77
+ var t = O(), r = s(t);
78
+ n(r, () => p.trailing), _(t), m(e, t);
79
79
  };
80
80
  r(I, (e) => {
81
81
  p.trailing && e(L);
82
82
  });
83
83
  var G = o(I, 2), J = (e) => {
84
- var i = t(), o = _(i);
84
+ var i = t(), o = g(i);
85
85
  te(o, 17, () => p.actions, (e) => e.label, (e, i) => {
86
- var o = O(), p = s(o), h = (e) => {
87
- var r = t(), a = _(r);
86
+ var o = A(), d = s(o), p = (e) => {
87
+ var r = t(), a = g(r);
88
88
  n(a, () => l(i).icon), m(e, r);
89
- }, g = (e) => {
90
- var t = D(), n = s(t, !0);
91
- f(t), u(() => c(n, l(i).label)), m(e, t);
89
+ }, h = (e) => {
90
+ var t = k(), n = s(t, !0);
91
+ _(t), u(() => c(n, l(i).label)), m(e, t);
92
92
  };
93
- r(p, (e) => {
94
- l(i).icon ? e(h) : e(g, -1);
95
- }), f(o), u(() => {
96
- d(o, "aria-label", l(i).label), d(o, "title", l(i).label), o.disabled = B() || l(i).disabled;
93
+ r(d, (e) => {
94
+ l(i).icon ? e(p) : e(h, -1);
95
+ }), _(o), u(() => {
96
+ f(o, "aria-label", l(i).label), f(o, "title", l(i).label), o.disabled = B() || l(i).disabled;
97
97
  }), a("click", o, () => l(i).onClick()), m(e, o);
98
98
  }), m(e, i);
99
99
  };
@@ -101,21 +101,21 @@ function P(i, p) {
101
101
  p.actions?.length && e(J);
102
102
  });
103
103
  var Y = o(G, 2), X = (e) => {
104
- var t = k();
105
- u(() => d(t, "aria-label", W())), a("click", t, () => p.onclear?.()), m(e, t);
104
+ var t = ae();
105
+ u(() => f(t, "aria-label", W())), a("click", t, () => p.onclear?.()), m(e, t);
106
106
  };
107
107
  r(Y, (e) => {
108
108
  H() && U() && !B() && !V() && e(X);
109
- }), f(i), u(() => {
110
- h = y(i, 1, `sv-field__control sv-field--${z() ?? ""}`, "svelte-xtfnp5", h, {
109
+ }), _(i), u(() => {
110
+ d = y(i, 1, `sv-field__control sv-field--${z() ?? ""}`, "svelte-xtfnp5", d, {
111
111
  "is-invalid": R(),
112
112
  "is-disabled": B(),
113
113
  "is-readonly": V(),
114
114
  "is-filled": K()
115
- }), g = ee(i, "", g, { width: F() ? void 0 : l(se) });
115
+ }), h = ee(i, "", h, { width: F() ? void 0 : l(se) });
116
116
  }), m(e, i);
117
117
  }, $ = (e) => {
118
- var r = t(), i = _(r);
118
+ var r = t(), i = g(r);
119
119
  n(i, () => p.children), m(e, r);
120
120
  };
121
121
  r(Q, (e) => {
@@ -123,64 +123,24 @@ function P(i, p) {
123
123
  });
124
124
  var ue = o(Q, 2), de = (e) => {
125
125
  var t = j(), n = s(t, !0);
126
- f(t), u((e) => {
127
- d(t, "id", e), c(n, p.error);
126
+ _(t), u((e) => {
127
+ f(t, "id", e), c(n, p.error);
128
128
  }, [() => b(p.id)]), m(e, t);
129
129
  }, fe = (e) => {
130
130
  var t = M(), n = s(t, !0);
131
- f(t), u((e) => {
132
- d(t, "id", e), c(n, p.hint);
131
+ _(t), u((e) => {
132
+ f(t, "id", e), c(n, p.hint);
133
133
  }, [() => x(p.id)]), m(e, t);
134
134
  };
135
135
  r(ue, (e) => {
136
136
  p.error ? e(de) : p.hint && e(fe, 1);
137
- }), f(Y), u(() => {
137
+ }), _(Y), u(() => {
138
138
  X = y(Y, 1, "sv-field svelte-xtfnp5", null, X, {
139
139
  "sv-field--block": F(),
140
140
  "sv-field--floating": l(q)
141
- }), d(Y, "dir", l(J)), Y.dir = Y.dir;
142
- }), m(i, Y), v();
141
+ }), f(Y, "dir", l(J)), Y.dir = Y.dir;
142
+ }), m(i, Y), d();
143
143
  }
144
144
  i(["click"]);
145
145
  //#endregion
146
- //#region ../grid/dist/a11y/dismissable.js
147
- function F(e, t) {
148
- return t ? (Array.isArray(e) ? e : [e]).some((e) => e != null && e.contains(t)) : !1;
149
- }
150
- var I = [], L = !1;
151
- function R() {
152
- L || typeof document > "u" || (L = !0, document.addEventListener("keydown", (e) => {
153
- if (e.key !== "Escape") return;
154
- let t = I[I.length - 1];
155
- t?.closeOnEscape && (e.stopPropagation(), t.onDismiss("escape"));
156
- }, !0), document.addEventListener("pointerdown", (e) => {
157
- let t = I[I.length - 1];
158
- t?.closeOnOutside && (F(t.element(), e.target) || t.onDismiss("outside"));
159
- }, !0));
160
- }
161
- function z(e) {
162
- let t = {
163
- element: e.element,
164
- onDismiss: e.onDismiss,
165
- closeOnEscape: e.closeOnEscape ?? !0,
166
- closeOnOutside: e.closeOnOutside ?? !0
167
- };
168
- return {
169
- activate() {
170
- R(), I.includes(t) || I.push(t);
171
- },
172
- release() {
173
- let e = I.indexOf(t);
174
- e >= 0 && I.splice(e, 1);
175
- }
176
- };
177
- }
178
- function B(e, t) {
179
- if (typeof window > "u") return () => {};
180
- let n = (n) => {
181
- F(e(), n.target) || t();
182
- };
183
- return window.addEventListener("scroll", n, !0), () => window.removeEventListener("scroll", n, !0);
184
- }
185
- //#endregion
186
- export { B as n, P as r, z as t };
146
+ export { P as t };
@@ -58,34 +58,60 @@ function u(e) {
58
58
  return t === "number" ? "number" : t === "date" ? "date" : t === "datetime" ? "datetime-local" : t === "time" ? "time" : t === "password" ? "password" : t === "color" ? "color" : "text";
59
59
  }
60
60
  function d(e) {
61
+ if (!e || Number.isNaN(e.getTime())) return "";
62
+ let t = (e) => String(e).padStart(2, "0");
63
+ return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
64
+ }
65
+ function f(e) {
66
+ if (!e) return null;
67
+ let t = /^(\d{4})-(\d{2})-(\d{2})/.exec(e);
68
+ if (!t) {
69
+ let t = new Date(e);
70
+ return Number.isNaN(t.getTime()) ? null : t;
71
+ }
72
+ let n = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
73
+ return Number.isNaN(n.getTime()) ? null : n;
74
+ }
75
+ function p(e) {
76
+ if (!e || String(e).endsWith("-native")) return !1;
77
+ let t = o(e);
78
+ return t === "date" || t === "datetime" || t === "time";
79
+ }
80
+ function m(e) {
81
+ return o(e) === "number" ? "text" : u(e);
82
+ }
83
+ function h(e) {
84
+ return /^-?(\d*\.?\d*)(e-?\d*)?$/i.test(e);
85
+ }
86
+ function g(e) {
61
87
  return e == null || e === "" ? [] : Array.isArray(e) ? e.filter((e) => e != null && e !== "") : [e];
62
88
  }
63
- function f(e, t) {
89
+ function _(e, t) {
64
90
  let n = e.find((e) => e.value === t || String(e.value) === String(t));
65
91
  return n ? n.label : String(t ?? "");
66
92
  }
67
- function p(e, t) {
93
+ function v(e, t) {
68
94
  return e.find((e) => e.value === t || String(e.value) === String(t))?.color;
69
95
  }
70
- function m(e) {
96
+ function y(e) {
71
97
  return e ? `background: color-mix(in srgb, ${e} 22%, transparent);border-color: color-mix(in srgb, ${e} 45%, transparent);color: color-mix(in srgb, ${e} 80%, var(--sg-fg, #0f172a));` : "";
72
98
  }
73
- function h(e) {
99
+ function b(e) {
74
100
  let t = o(e);
75
101
  return t === "number" ? "sv-grid-cell-editor sv-grid-cell-editor-number" : t === "date" ? "sv-grid-cell-editor sv-grid-cell-editor-date" : t === "datetime" ? "sv-grid-cell-editor sv-grid-cell-editor-datetime" : t === "color" ? "sv-grid-cell-editor sv-grid-cell-editor-color" : "sv-grid-cell-editor";
76
102
  }
77
- function g(e) {
103
+ function x(e) {
78
104
  if (e == null || e === "") return null;
79
105
  let t = e instanceof Date ? e : new Date(e);
80
106
  return Number.isNaN(t.getTime()) ? null : t;
81
107
  }
82
- function _(e, t) {
108
+ function S(e, t) {
83
109
  return Math.max(8, Math.min(e, window.innerWidth - t - 8));
84
110
  }
85
- function v(e) {
111
+ function C(e) {
86
112
  return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/"/g, "\\\"");
87
113
  }
88
- function y(e, t) {
114
+ function w(e, t) {
89
115
  if (e == null || e === "") return NaN;
90
116
  if (t) {
91
117
  let t = (e instanceof Date ? e : new Date(String(e))).getTime();
@@ -94,11 +120,11 @@ function y(e, t) {
94
120
  let n = typeof e == "number" ? e : Number(e);
95
121
  return Number.isFinite(n) ? n : NaN;
96
122
  }
97
- function b(e) {
123
+ function T(e) {
98
124
  let t = Math.abs(e), n = t >= 1e3 ? 0 : t >= 100 ? 1 : t >= 1 ? 2 : 4;
99
125
  return e.toLocaleString(void 0, { maximumFractionDigits: n });
100
126
  }
101
- function x(e) {
127
+ function E(e) {
102
128
  return new Date(e).toLocaleDateString(void 0, {
103
129
  year: "numeric",
104
130
  month: "short",
@@ -106,4 +132,4 @@ function x(e) {
106
132
  });
107
133
  }
108
134
  //#endregion
109
- export { r as _, v as a, x as c, l as d, h as f, y as g, f as h, m as i, b as l, p as m, e as n, c as o, u as p, _ as r, t as s, g as t, n as u, s as v, d as y };
135
+ export { g as C, d as S, _, C as a, r as b, E as c, m as d, n as f, v as g, u as h, y as i, T as l, b as m, e as n, c as o, l as p, S as r, t as s, x as t, f as u, h as v, p as w, s as x, w as y };