@svgrid/grid 2.6.22 → 2.6.23

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 (115) hide show
  1. package/dist/GridMenus.svelte +184 -6
  2. package/dist/SvAutoComplete.svelte +4 -0
  3. package/dist/SvComboBox.svelte +5 -1
  4. package/dist/SvDateRangeInput.svelte +25 -3
  5. package/dist/SvDropDownList.svelte +4 -0
  6. package/dist/SvForm.svelte +8 -8
  7. package/dist/SvGrid.controller.svelte.d.ts +48 -1
  8. package/dist/SvGrid.controller.svelte.js +214 -52
  9. package/dist/SvGrid.css +221 -0
  10. package/dist/SvGrid.helpers.d.ts +55 -0
  11. package/dist/SvGrid.helpers.js +83 -0
  12. package/dist/SvGrid.svelte +145 -0
  13. package/dist/SvGrid.types.d.ts +105 -0
  14. package/dist/SvGridCellEditor.svelte +99 -17
  15. package/dist/SvGridSelect.svelte +6 -2
  16. package/dist/SvGridSelect.svelte.d.ts +1 -1
  17. package/dist/SvListBox.svelte +8 -0
  18. package/dist/SvMultiSelect.svelte +6 -2
  19. package/dist/SvMultiSelect.svelte.d.ts +1 -1
  20. package/dist/SvNumberInput.svelte +4 -0
  21. package/dist/SvRichCell.svelte +125 -0
  22. package/dist/SvRichCell.svelte.d.ts +15 -0
  23. package/dist/SvTextArea.svelte +5 -1
  24. package/dist/SvTreeSelect.svelte +6 -2
  25. package/dist/SvTreeSelect.svelte.d.ts +1 -1
  26. package/dist/builtin-editors.d.ts +2 -2
  27. package/dist/builtin-editors.js +19 -3
  28. package/dist/cdn/GridMenus-BzWXQjv3.js +600 -0
  29. package/dist/cdn/GridMenus-xr_rHx8F.js +601 -0
  30. package/dist/cdn/SvDateRangeInput-CaOuMs8O.js +198 -0
  31. package/dist/cdn/SvDateRangeInput-DMLKmGEc.js +199 -0
  32. package/dist/cdn/SvDateTimePicker-CCbDZNZB.js +816 -0
  33. package/dist/cdn/SvDateTimePicker-sonaH0oh.js +812 -0
  34. package/dist/cdn/SvGridCellEditor-BAPSC7EL.js +550 -0
  35. package/dist/cdn/SvGridCellEditor-BwzmUWtL.js +549 -0
  36. package/dist/cdn/date-format-BNii4zeD.js +1393 -0
  37. package/dist/cdn/date-format-BnnHlqGw.js +1395 -0
  38. package/dist/cdn/{editor-registry-CiI0xlKg.js → editor-registry-BhgE3S84.js} +51 -25
  39. package/dist/cdn/{src-D1lXwq1l.js → src-DGo7IHug.js} +5730 -5198
  40. package/dist/cdn/{src-C9Hihx1W.js → src-skQN5eqh.js} +7216 -6684
  41. package/dist/cdn/svgrid.js +14 -12
  42. package/dist/cdn/svgrid.svelte-external.js +14 -12
  43. package/dist/cell-values.d.ts +16 -0
  44. package/dist/cell-values.js +28 -0
  45. package/dist/clipboard.d.ts +22 -0
  46. package/dist/clipboard.js +405 -27
  47. package/dist/editing.js +12 -7
  48. package/dist/editors/cell-editors.d.ts +11 -0
  49. package/dist/editors/cell-editors.js +18 -1
  50. package/dist/grid-messages.d.ts +15 -0
  51. package/dist/grid-messages.js +15 -0
  52. package/dist/index.d.ts +4 -0
  53. package/dist/index.js +4 -0
  54. package/dist/list-option.d.ts +6 -0
  55. package/dist/menus.js +40 -7
  56. package/dist/sanitize-html.d.ts +37 -0
  57. package/dist/sanitize-html.js +234 -0
  58. package/dist/selection-bar-view.svelte.d.ts +25 -0
  59. package/dist/selection-bar-view.svelte.js +13 -0
  60. package/dist/selection.d.ts +2 -1
  61. package/dist/selection.js +129 -13
  62. package/package.json +1 -1
  63. package/src/GridMenus.svelte +184 -6
  64. package/src/SvAutoComplete.svelte +4 -0
  65. package/src/SvComboBox.svelte +5 -1
  66. package/src/SvDateRangeInput.svelte +25 -3
  67. package/src/SvDropDownList.svelte +4 -0
  68. package/src/SvForm.svelte +8 -8
  69. package/src/SvGrid.controller.svelte.ts +251 -61
  70. package/src/SvGrid.css +221 -0
  71. package/src/SvGrid.helpers.ts +87 -0
  72. package/src/SvGrid.svelte +145 -0
  73. package/src/SvGrid.types.ts +112 -0
  74. package/src/SvGridCellEditor.svelte +99 -17
  75. package/src/SvGridSelect.svelte +6 -2
  76. package/src/SvListBox.svelte +8 -0
  77. package/src/SvMultiSelect.svelte +6 -2
  78. package/src/SvNumberInput.svelte +4 -0
  79. package/src/SvRichCell.svelte +125 -0
  80. package/src/SvTextArea.svelte +5 -1
  81. package/src/SvTreeSelect.svelte +6 -2
  82. package/src/builtin-editors.test.ts +18 -1
  83. package/src/builtin-editors.ts +19 -3
  84. package/src/cell-values.ts +30 -0
  85. package/src/clipboard.test.ts +93 -20
  86. package/src/clipboard.ts +433 -33
  87. package/src/date-string-column.test.ts +87 -0
  88. package/src/editing.test.ts +25 -0
  89. package/src/editing.ts +12 -9
  90. package/src/editor-block-prop.test.ts +132 -0
  91. package/src/editors/cell-editors.ts +27 -1
  92. package/src/grid-messages.ts +34 -0
  93. package/src/index.ts +13 -0
  94. package/src/list-option.ts +6 -0
  95. package/src/menus.test.ts +43 -0
  96. package/src/menus.ts +37 -7
  97. package/src/move-cells.test.ts +850 -0
  98. package/src/number-editor-literal.test.ts +84 -0
  99. package/src/number-editor.grid.test.ts +160 -0
  100. package/src/sanitize-html.test.ts +182 -0
  101. package/src/sanitize-html.ts +235 -0
  102. package/src/selection-bar-view.svelte.ts +36 -0
  103. package/src/selection.test.ts +157 -0
  104. package/src/selection.ts +131 -13
  105. package/src/svgrid.filter-menu-listbox.svelte.test.ts +56 -10
  106. package/src/svgrid.in-suggest-snapshot.svelte.test.ts +91 -0
  107. package/src/svgrid.menu-scroll-close.test.ts +204 -0
  108. package/src/svgrid.selection-bar-seam.test.ts +185 -0
  109. package/src/svgrid.upsell-license.test.ts +117 -0
  110. package/dist/cdn/GridMenus-BuoBPqxx.js +0 -493
  111. package/dist/cdn/GridMenus-n4llxoOI.js +0 -494
  112. package/dist/cdn/SvDateTimePicker-CHnUkWcH.js +0 -2206
  113. package/dist/cdn/SvDateTimePicker-CRQH_U7E.js +0 -2201
  114. package/dist/cdn/SvGridCellEditor-BGUCzuPB.js +0 -523
  115. package/dist/cdn/SvGridCellEditor-G8IMWIws.js +0 -522
@@ -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",
@@ -107,23 +133,23 @@ function x(e) {
107
133
  }
108
134
  //#endregion
109
135
  //#region src/editor-registry.ts
110
- var S = /* @__PURE__ */ new Map();
111
- function C(e, t) {
112
- S.set(e, typeof t == "function" ? { component: t } : t);
136
+ var D = /* @__PURE__ */ new Map();
137
+ function O(e, t) {
138
+ D.set(e, typeof t == "function" ? { component: t } : t);
113
139
  }
114
- function w(e) {
115
- return S.get(e);
140
+ function k(e) {
141
+ return D.get(e);
116
142
  }
117
- function T(e) {
118
- return S.has(e);
143
+ function A(e) {
144
+ return D.has(e);
119
145
  }
120
- function E(e) {
121
- S.delete(e);
146
+ function j(e) {
147
+ D.delete(e);
122
148
  }
123
- function D() {
124
- return [...S.keys()];
149
+ function M() {
150
+ return [...D.keys()];
125
151
  }
126
- function O(e) {
152
+ function N(e) {
127
153
  return {
128
154
  value: e.value,
129
155
  onChange: e.onChange,
@@ -134,8 +160,8 @@ function O(e) {
134
160
  inCell: e.inCell
135
161
  };
136
162
  }
137
- function k(e, t) {
138
- return e.props ? e.props(t) : O(t);
163
+ function P(e, t) {
164
+ return e.props ? e.props(t) : N(t);
139
165
  }
140
166
  //#endregion
141
- export { y as C, d as E, f as S, s as T, n as _, D as a, u as b, g as c, m as d, v as f, b as g, x as h, C as i, e as l, t as m, w as n, k as o, c as p, T as r, E as s, O as t, _ as u, l as v, r as w, p as x, h as y };
167
+ export { g as A, v as C, r as D, w as E, s as O, u as S, h as T, f as _, M as a, l as b, x as c, y as d, C as f, T as g, E as h, O as i, p as j, d as k, e as l, t as m, k as n, P as o, c as p, A as r, j as s, N as t, S as u, m as v, _ as w, b as x, n as y };