@svgrid/grid-wc 3.0.1 → 3.0.3

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 (104) hide show
  1. package/README.md +24 -1
  2. package/dist/GridMenus-DMkf7UMn.js +1086 -0
  3. package/dist/SvChartMenu-DkSyLWYH.js +413 -0
  4. package/dist/SvDateRangeInput-BrYTQEMM.js +197 -0
  5. package/dist/SvDateTimePicker-Czin1Ead.js +766 -0
  6. package/dist/SvField-Bmzp3ObZ.js +147 -0
  7. package/dist/SvGridCellEditor-DhXEIlyE.js +560 -0
  8. package/dist/SvGridChart-BMdCbrqb.js +3702 -0
  9. package/dist/SvGridChartBuilder-Chp_MD1B.js +1166 -0
  10. package/dist/SvGridChartPanel-BIV2O2Lp.js +1743 -0
  11. package/dist/SvGridChartView-DyhkumD-.js +45 -0
  12. package/dist/SvGridDropdown-BwPpGwLz.js +257 -0
  13. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +212 -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 +92 -2
  16. package/dist/{cell-formatting-Eypm-id0.js → cell-formatting-CBfgahv1.js} +1 -1
  17. package/dist/chart/SvChartMenu-DslxOgPN.js +590 -0
  18. package/dist/chart/chart-export-BHGuh_kZ.js +127 -0
  19. package/dist/chart/chart-export-pdf-BjkkIEkE.js +104 -0
  20. package/dist/chart/chart-summary-6Xu2JoNC.js +137 -0
  21. package/dist/chart/chart-trend-7fxtAqEl.js +56 -0
  22. package/dist/chart/chart-validate-CD6ptiwg.js +180 -0
  23. package/dist/chart/client-BuB0wIgc.js +2757 -0
  24. package/dist/chart/sv-chart-element.d.ts +98 -0
  25. package/dist/chart/sv-chart-element.js +7282 -0
  26. package/dist/chart-D_LKA1fr.js +4398 -0
  27. package/dist/chart-export-pdf-9OCvhzr0.js +104 -0
  28. package/dist/chart-summary-v3Lhe8YD.js +137 -0
  29. package/dist/chart-validate-CD6ptiwg.js +180 -0
  30. package/dist/{shadow/client-DjwUji8D.js → client-DEF0GRjE.js} +1 -1
  31. package/dist/{shadow/column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
  32. package/dist/date-format-DMTwV8NC.js +1128 -0
  33. package/dist/{shadow/dismissable-DvhBKm3q.js → dismissable-CQ6XFXsk.js} +5 -1
  34. package/dist/{export-format-uGayRKWM.js → export-format-CAi1mp-1.js} +1 -1
  35. package/dist/focus-trap-Dbb2tJxb.js +65 -0
  36. package/dist/list-option-DrRyivWp.js +82 -0
  37. package/dist/react/chart.d.ts +99 -0
  38. package/dist/react/chart.js +49 -0
  39. package/dist/react/index.d.ts +72 -0
  40. package/dist/react/index.js +8 -1
  41. package/dist/row-resize-limG_N1z.js +111 -0
  42. package/dist/shadow/GridMenus-DMkf7UMn.js +1086 -0
  43. package/dist/shadow/SvChartMenu-DkSyLWYH.js +413 -0
  44. package/dist/shadow/SvDateRangeInput-BrYTQEMM.js +197 -0
  45. package/dist/shadow/SvDateTimePicker-Czin1Ead.js +766 -0
  46. package/dist/shadow/SvField-Bmzp3ObZ.js +147 -0
  47. package/dist/shadow/SvGridCellEditor-DhXEIlyE.js +560 -0
  48. package/dist/shadow/SvGridChart-BMdCbrqb.js +3702 -0
  49. package/dist/shadow/SvGridChartBuilder-Chp_MD1B.js +1166 -0
  50. package/dist/shadow/SvGridChartPanel-BIV2O2Lp.js +1743 -0
  51. package/dist/shadow/SvGridChartView-DyhkumD-.js +45 -0
  52. package/dist/shadow/SvGridDropdown-BwPpGwLz.js +257 -0
  53. package/dist/shadow/{cell-formatting-Eypm-id0.js → cell-formatting-CBfgahv1.js} +1 -1
  54. package/dist/shadow/chart-D_LKA1fr.js +4398 -0
  55. package/dist/shadow/chart-export-pdf-9OCvhzr0.js +104 -0
  56. package/dist/shadow/chart-summary-v3Lhe8YD.js +137 -0
  57. package/dist/shadow/chart-validate-CD6ptiwg.js +180 -0
  58. package/dist/{client-DjwUji8D.js → shadow/client-DEF0GRjE.js} +1 -1
  59. package/dist/{column-resize-DvCRUrN3.js → shadow/column-resize-DUPgynvc.js} +3 -3
  60. package/dist/shadow/date-format-DMTwV8NC.js +1128 -0
  61. package/dist/{dismissable-DvhBKm3q.js → shadow/dismissable-CQ6XFXsk.js} +5 -1
  62. package/dist/shadow/{export-format-DhdZREP1.js → export-format-mnW_rVBZ.js} +1 -1
  63. package/dist/shadow/focus-trap-Dbb2tJxb.js +65 -0
  64. package/dist/shadow/list-option-DrRyivWp.js +82 -0
  65. package/dist/shadow/row-resize-limG_N1z.js +111 -0
  66. package/dist/shadow/sv-grid-shadow-element.d.ts +41 -0
  67. package/dist/shadow/sv-grid-shadow-element.js +5905 -3986
  68. package/dist/shadow/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  69. package/dist/shadow/validate-BqDthkNr.js +88 -0
  70. package/dist/sv-grid-element.d.ts +41 -0
  71. package/dist/sv-grid-element.js +5874 -3985
  72. package/dist/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  73. package/dist/validate-BqDthkNr.js +88 -0
  74. package/dist/vue/chart.d.ts +64 -0
  75. package/dist/vue/chart.js +41 -0
  76. package/dist/vue/index.d.ts +26 -2
  77. package/dist/vue/index.js +1 -22
  78. package/package.json +18 -5
  79. package/dist/GridMenus-YwTw9Upd.js +0 -1123
  80. package/dist/SvDateRangeInput-CrxeppBV.js +0 -196
  81. package/dist/SvDateTimePicker-xAO-Pb4S.js +0 -765
  82. package/dist/SvField-CE345DyF.js +0 -146
  83. package/dist/SvGridCellEditor-D7SyHtff.js +0 -550
  84. package/dist/SvGridChart-CMaVmlso.js +0 -1477
  85. package/dist/SvGridChartPanel-Pc_IW0eA.js +0 -833
  86. package/dist/SvGridChartView-DLhhzmFy.js +0 -52
  87. package/dist/SvGridDropdown-DUncHqM-.js +0 -256
  88. package/dist/chart-GRBAgN1M.js +0 -1658
  89. package/dist/date-format-D_oQ5Yw0.js +0 -1127
  90. package/dist/row-resize-D-8s3cqT.js +0 -94
  91. package/dist/shadow/GridMenus-YwTw9Upd.js +0 -1123
  92. package/dist/shadow/SvDateRangeInput-CrxeppBV.js +0 -196
  93. package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +0 -765
  94. package/dist/shadow/SvField-CE345DyF.js +0 -146
  95. package/dist/shadow/SvGridCellEditor-D7SyHtff.js +0 -550
  96. package/dist/shadow/SvGridChart-CMaVmlso.js +0 -1477
  97. package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +0 -833
  98. package/dist/shadow/SvGridChartView-DLhhzmFy.js +0 -52
  99. package/dist/shadow/SvGridDropdown-DUncHqM-.js +0 -256
  100. package/dist/shadow/chart-GRBAgN1M.js +0 -1658
  101. package/dist/shadow/date-format-D_oQ5Yw0.js +0 -1127
  102. package/dist/shadow/row-resize-D-8s3cqT.js +0 -94
  103. package/dist/shadow/validate-CgmAtX1A.js +0 -75
  104. package/dist/validate-CgmAtX1A.js +0 -75
@@ -0,0 +1,590 @@
1
+ (function(){try{var c=".sv-menu__list.svelte-tumeci{flex-direction:column;min-width:180px;padding:4px;display:flex}.sv-menu__sep.svelte-tumeci{background:var(--sg-border,#e2e8f0);height:1px;margin:4px 6px}.sv-menu__itemwrap.svelte-tumeci{position:relative}.sv-menu__item.svelte-tumeci{box-sizing:border-box;cursor:pointer;width:100%;font:inherit;color:var(--sg-fg,#0f172a);text-align:start;background:0 0;border:0;border-radius:6px;align-items:center;gap:9px;padding:7px 10px;font-size:13px;transition:background .1s;display:flex}.sv-menu__item.is-active.svelte-tumeci:not([disabled]),.sv-menu__item.svelte-tumeci:hover:not([disabled]){background:var(--sg-row-hover-bg,#f1f5f9)}.sv-menu__item.svelte-tumeci:focus-visible{outline:2px solid var(--sg-focus-ring,var(--sg-accent,#2563eb));outline-offset:-2px}.sv-menu__item[disabled].svelte-tumeci{opacity:.45;cursor:default}.sv-menu__icon.svelte-tumeci{width:16px;color:var(--sg-muted,#64748b);flex:none;display:inline-flex}.sv-menu__icon.svelte-tumeci:empty{width:0}.sv-menu__label.svelte-tumeci{white-space:nowrap;flex:1}.sv-menu__shortcut.svelte-tumeci{color:var(--sg-muted,#94a3b8);margin-inline-start:12px;font-size:11.5px}.sv-menu__chev.svelte-tumeci{color:var(--sg-muted,#94a3b8);flex:none}.sv-menu[dir=rtl].svelte-tumeci .sv-menu__chev:where(.svelte-tumeci),.sv-menu__list.is-submenu.svelte-tumeci .sv-menu__chev:where(.svelte-tumeci){transform:scaleX(-1)}.sv-menu__flyout.svelte-tumeci{z-index:1;background:var(--sg-bg,#fff);border:1px solid var(--sg-border,#e2e8f0);border-radius:10px;position:absolute;top:-5px;left:100%;box-shadow:0 16px 40px -12px #0f172a52}.sv-grid-chart-menu{z-index:2147483646;background:var(--sg-bg,#fff);min-width:220px;color:var(--sg-fg,#0f172a);border:1px solid var(--sg-border,#e2e8f0);border-radius:10px;font-size:13px;box-shadow:0 16px 48px -12px #0f172a59}\n";if(typeof globalThis!=='undefined'){var f=globalThis.__SVGRID_WC_ADD_CSS__;if(typeof f==='function')f(c);else(globalThis.__SVGRID_WC_CSS_CHUNKS__=globalThis.__SVGRID_WC_CSS_CHUNKS__||[]).push(c);}if(typeof document==='undefined')return;if(document.querySelector('style[data-svgrid-grid-wc-chunk="SvChartMenu"]'))return;var s=document.createElement('style');s.setAttribute('data-svgrid-grid-wc-chunk',"SvChartMenu");s.textContent=c;document.head.appendChild(s);}catch(e){}})();
2
+ import { B as e, C as t, F as n, G as r, H as i, I as a, L as o, N as s, P as c, S as l, U as u, V as d, _ as f, a as p, b as m, c as h, d as g, f as _, g as v, k as y, l as b, m as x, n as S, v as C, w, x as T, y as E, z as D } from "./client-BuB0wIgc.js";
3
+ //#region ../grid/dist/popover.js
4
+ var O = [
5
+ "--sg-accent",
6
+ "--sg-on-accent",
7
+ "--sg-bg",
8
+ "--sg-fg",
9
+ "--sg-muted",
10
+ "--sg-border",
11
+ "--sg-header-bg",
12
+ "--sg-header-fg",
13
+ "--sg-row-hover-bg",
14
+ "--sg-row-alt-bg",
15
+ "--sg-selection-bg",
16
+ "--sg-selection-fg",
17
+ "--sg-input-bg",
18
+ "--sg-input-border",
19
+ "--sg-danger",
20
+ "--sg-focus-ring",
21
+ "--sg-radius",
22
+ "--sg-font",
23
+ "--sg-invalid-bg",
24
+ "--sg-invalid-border",
25
+ "--sg-invalid-fg",
26
+ "--sg-rating-on",
27
+ "--sg-rating-empty",
28
+ "--sg-rating-hover"
29
+ ];
30
+ function k(e, t = O) {
31
+ let n = getComputedStyle(e);
32
+ for (let r of t) {
33
+ let t = n.getPropertyValue(r).trim();
34
+ t && e.style.setProperty(r, t);
35
+ }
36
+ return document.body.appendChild(e), { destroy() {
37
+ e.parentNode === document.body && document.body.removeChild(e);
38
+ } };
39
+ }
40
+ function A(e, t = {}) {
41
+ if (typeof e.animate != "function" || typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) return;
42
+ let n = t.up ? 6 : -6, r = t.scale ?? .97;
43
+ return e.animate([{
44
+ opacity: 0,
45
+ transform: `translateY(${n}px) scale(${r})`
46
+ }, {
47
+ opacity: 1,
48
+ transform: "translateY(0) scale(1)"
49
+ }], {
50
+ duration: t.duration ?? 140,
51
+ easing: "cubic-bezier(0.16, 1, 0.3, 1)"
52
+ }), {};
53
+ }
54
+ //#endregion
55
+ //#region ../grid/dist/a11y/dismissable.js
56
+ function j(e, t) {
57
+ return t ? (Array.isArray(e) ? e : [e]).some((e) => e != null && e.contains(t)) : !1;
58
+ }
59
+ var M = [], N = !1;
60
+ function P() {
61
+ N || typeof document > "u" || (N = !0, document.addEventListener("keydown", (e) => {
62
+ if (e.key !== "Escape") return;
63
+ let t = M[M.length - 1];
64
+ t?.closeOnEscape && (e.stopPropagation(), t.onDismiss("escape"));
65
+ }, !0), document.addEventListener("pointerdown", (e) => {
66
+ let t = M[M.length - 1];
67
+ t?.closeOnOutside && (j(t.element(), e.target) || t.onDismiss("outside"));
68
+ }, !0));
69
+ }
70
+ function F(e) {
71
+ let t = {
72
+ element: e.element,
73
+ onDismiss: e.onDismiss,
74
+ closeOnEscape: e.closeOnEscape ?? !0,
75
+ closeOnOutside: e.closeOnOutside ?? !0
76
+ };
77
+ return {
78
+ activate() {
79
+ P(), M.includes(t) || M.push(t);
80
+ },
81
+ release() {
82
+ let e = M.indexOf(t);
83
+ e >= 0 && M.splice(e, 1);
84
+ }
85
+ };
86
+ }
87
+ function I(e, t) {
88
+ if (typeof window > "u") return () => {};
89
+ let n = (n) => {
90
+ j(e(), n.target) || t();
91
+ }, r = !1, i = requestAnimationFrame(() => {
92
+ i = null, r = !0, window.addEventListener("scroll", n, !0);
93
+ });
94
+ return () => {
95
+ i !== null && cancelAnimationFrame(i), i = null, r && window.removeEventListener("scroll", n, !0), r = !1;
96
+ };
97
+ }
98
+ //#endregion
99
+ //#region ../grid/dist/a11y/focus-trap.js
100
+ var L = [
101
+ "a[href]",
102
+ "area[href]",
103
+ "button:not([disabled])",
104
+ "input:not([disabled])",
105
+ "select:not([disabled])",
106
+ "textarea:not([disabled])",
107
+ "iframe",
108
+ "audio[controls]",
109
+ "video[controls]",
110
+ "[contenteditable]:not([contenteditable=\"false\"])",
111
+ "[tabindex]"
112
+ ].join(",");
113
+ function R(e) {
114
+ if (e.hasAttribute("disabled") || e.getAttribute("aria-hidden") === "true" || e.hidden || e.closest("[hidden]")) return !1;
115
+ let t = e.style;
116
+ return !(t.display === "none" || t.visibility === "hidden" || typeof e.getClientRects == "function" && e.getClientRects().length === 0 && document.body.getClientRects().length > 0);
117
+ }
118
+ function z(e) {
119
+ return Array.from(e.querySelectorAll(L)).filter((e) => {
120
+ let t = e.getAttribute("tabindex");
121
+ return t !== null && Number(t) < 0 ? !1 : R(e);
122
+ });
123
+ }
124
+ function B(e, t = {}) {
125
+ let { initialFocus: n = "first", returnFocus: r = !0 } = t, i = null, a = !1;
126
+ function o() {
127
+ let t = n;
128
+ return t === "container" ? e : t === "first" ? z(e)[0] ?? e : typeof t == "function" ? t() : t;
129
+ }
130
+ function s(n) {
131
+ if (!a) return;
132
+ if (n.key === "Escape" && t.onEscape) {
133
+ t.onEscape(n);
134
+ return;
135
+ }
136
+ if (n.key !== "Tab") return;
137
+ let r = z(e);
138
+ if (!r.length) {
139
+ n.preventDefault(), e.focus();
140
+ return;
141
+ }
142
+ let i = r[0], o = r[r.length - 1], s = document.activeElement;
143
+ if (!e.contains(s)) {
144
+ n.preventDefault(), i.focus();
145
+ return;
146
+ }
147
+ n.shiftKey && s === i ? (n.preventDefault(), o.focus()) : !n.shiftKey && s === o && (n.preventDefault(), i.focus());
148
+ }
149
+ function c() {
150
+ a || (a = !0, i = document.activeElement, e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), document.addEventListener("keydown", s, !0), queueMicrotask(() => {
151
+ a && o()?.focus();
152
+ }));
153
+ }
154
+ function l() {
155
+ a && (a = !1, document.removeEventListener("keydown", s, !0), r && i?.focus?.(), i = null);
156
+ }
157
+ return {
158
+ activate: c,
159
+ release: l
160
+ };
161
+ }
162
+ //#endregion
163
+ //#region ../grid/dist/list-option.js
164
+ function V(e = 600) {
165
+ let t = "", n;
166
+ return {
167
+ get value() {
168
+ return t;
169
+ },
170
+ push(r) {
171
+ return t += r, n && clearTimeout(n), n = setTimeout(() => {
172
+ t = "";
173
+ }, e), t;
174
+ },
175
+ clear() {
176
+ t = "", n && clearTimeout(n);
177
+ }
178
+ };
179
+ }
180
+ function H(e) {
181
+ return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && e.key !== " ";
182
+ }
183
+ //#endregion
184
+ //#region ../grid/dist/list-nav.js
185
+ function U(e, t) {
186
+ let n = [];
187
+ for (let r = 0; r < e; r++) t?.(r) || n.push(r);
188
+ return n;
189
+ }
190
+ function W(e, t, n) {
191
+ let r = e.length;
192
+ return r === 0 ? -1 : e[(e.indexOf(t) + n + r) % r];
193
+ }
194
+ //#endregion
195
+ //#region ../grid/dist/createMenu.svelte.js
196
+ function G(t) {
197
+ let n = () => t.items(), r = () => t.submenu?.() ?? !1, i = () => (t.dir?.() ?? "ltr") === "rtl", a = e(-1), o = e(-1), s = V();
198
+ function c(e) {
199
+ let t = e.trim().toLowerCase();
200
+ if (!t) return -1;
201
+ let r = n(), i = r.length;
202
+ for (let e = 1; e <= i; e++) {
203
+ let n = (y(a) + e + i) % i, o = r[n];
204
+ if (o && !o.disabled && !o.separator && (o.label ?? "").toLowerCase().startsWith(t)) return n;
205
+ }
206
+ return -1;
207
+ }
208
+ let l = d(() => U(n().length, (e) => {
209
+ let t = n()[e];
210
+ return !t || t.separator === !0 || t.disabled === !0;
211
+ }));
212
+ function u(e) {
213
+ D(a, e, !0), D(o, -1), t.focusItem?.(e);
214
+ }
215
+ function f(e) {
216
+ let t = W(y(l), y(a), e);
217
+ t >= 0 && u(t);
218
+ }
219
+ function p() {
220
+ let e = y(l)[0];
221
+ e != null && u(e);
222
+ }
223
+ function m() {
224
+ let e = y(l).at(-1);
225
+ e != null && u(e);
226
+ }
227
+ function h(e) {
228
+ let t = n()[e];
229
+ !t || t.disabled || t.separator || (D(a, e, !0), D(o, t.children?.length ? e : -1, !0));
230
+ }
231
+ function g(e) {
232
+ if (!(e.disabled || e.separator)) {
233
+ if (e.children?.length) {
234
+ D(o, n().indexOf(e), !0);
235
+ return;
236
+ }
237
+ e.onSelect?.(), t.onSelect(e), t.onClose();
238
+ }
239
+ }
240
+ function _(e, a) {
241
+ let l = n()[a], d = () => {
242
+ l?.children?.length && (e.preventDefault(), D(o, a, !0));
243
+ }, h = () => {
244
+ r() && (e.preventDefault(), t.onCollapse?.());
245
+ };
246
+ switch (e.key) {
247
+ case "ArrowDown":
248
+ e.preventDefault(), f(1);
249
+ break;
250
+ case "ArrowUp":
251
+ e.preventDefault(), f(-1);
252
+ break;
253
+ case "Home":
254
+ e.preventDefault(), p();
255
+ break;
256
+ case "End":
257
+ e.preventDefault(), m();
258
+ break;
259
+ case "ArrowRight":
260
+ (i() ? h : d)();
261
+ break;
262
+ case "ArrowLeft":
263
+ (i() ? d : h)();
264
+ break;
265
+ case "Enter":
266
+ case " ":
267
+ e.preventDefault(), l && g(l);
268
+ break;
269
+ case "Escape":
270
+ e.preventDefault(), t.onClose();
271
+ break;
272
+ case "Tab":
273
+ t.onClose();
274
+ break;
275
+ default: if (H(e)) {
276
+ let t = c(s.push(e.key));
277
+ t >= 0 && (e.preventDefault(), u(t));
278
+ }
279
+ }
280
+ }
281
+ function v(e) {
282
+ return y(a) === e || y(a) === -1 && e === y(l)[0] ? 0 : -1;
283
+ }
284
+ return {
285
+ get active() {
286
+ return y(a);
287
+ },
288
+ get openSub() {
289
+ return y(o);
290
+ },
291
+ get focusables() {
292
+ return y(l);
293
+ },
294
+ isActive: (e) => e === y(a),
295
+ isSubOpen: (e) => e === y(o),
296
+ itemTabIndex: v,
297
+ move: f,
298
+ first: p,
299
+ last: m,
300
+ focus: u,
301
+ hover: h,
302
+ choose: g,
303
+ onItemKeydown: _,
304
+ listProps: () => ({ role: "menu" }),
305
+ itemProps: (e) => {
306
+ let t = n()[e], r = !!t?.children?.length;
307
+ return {
308
+ role: "menuitem",
309
+ "data-mi": e,
310
+ tabindex: v(e),
311
+ "aria-haspopup": r ? "menu" : void 0,
312
+ "aria-expanded": r ? y(o) === e : void 0,
313
+ "aria-disabled": t?.disabled ? !0 : void 0,
314
+ disabled: t?.disabled,
315
+ onkeydown: (t) => _(t, e),
316
+ onpointerenter: () => h(e),
317
+ onclick: () => {
318
+ t && g(t);
319
+ }
320
+ };
321
+ }
322
+ };
323
+ }
324
+ //#endregion
325
+ //#region ../grid/dist/positioning.js
326
+ var K = {
327
+ top: "bottom",
328
+ bottom: "top",
329
+ left: "right",
330
+ right: "left"
331
+ };
332
+ function q(e) {
333
+ let [t, n] = e.split("-");
334
+ return {
335
+ side: t,
336
+ align: n ?? "center"
337
+ };
338
+ }
339
+ function J(e) {
340
+ let { side: t, align: n } = q(e);
341
+ return n === "center" ? K[t] : `${K[t]}-${n}`;
342
+ }
343
+ function Y(e, t, n) {
344
+ return n < t || e < t ? t : e > n ? n : e;
345
+ }
346
+ function X(e, t, n, r, i) {
347
+ if (e === "top" || e === "bottom") {
348
+ let a = e === "top" ? n.y - r.height - i : n.y + n.height + i;
349
+ return {
350
+ x: t === "start" ? n.x : t === "end" ? n.x + n.width - r.width : n.x + n.width / 2 - r.width / 2,
351
+ y: a
352
+ };
353
+ }
354
+ return {
355
+ x: e === "left" ? n.x - r.width - i : n.x + n.width + i,
356
+ y: t === "start" ? n.y : t === "end" ? n.y + n.height - r.height : n.y + n.height / 2 - r.height / 2
357
+ };
358
+ }
359
+ function Z(e, t, n, r, i, a) {
360
+ switch (e) {
361
+ case "top": return a - n;
362
+ case "bottom": return n + r.height - (i.height - a);
363
+ case "left": return a - t;
364
+ default: return t + r.width - (i.width - a);
365
+ }
366
+ }
367
+ function Q(e) {
368
+ return e || (typeof window < "u" ? {
369
+ width: window.innerWidth,
370
+ height: window.innerHeight
371
+ } : {
372
+ width: 0,
373
+ height: 0
374
+ });
375
+ }
376
+ function ee(e, t, n = {}) {
377
+ let r = n.offset ?? 6, i = n.padding ?? 8, a = n.flip !== !1, o = n.shift !== !1, s = Q(n.viewport), c = n.placement ?? "bottom-start", l = [c];
378
+ if (a) {
379
+ l.push(J(c));
380
+ for (let e of n.fallbackPlacements ?? []) l.push(e);
381
+ }
382
+ let u = c, d = Infinity;
383
+ for (let n of l) {
384
+ let { side: a, align: o } = q(n), { x: c, y: l } = X(a, o, e, t, r), f = Z(a, c, l, t, s, i);
385
+ if (f <= 0) {
386
+ u = n, d = f;
387
+ break;
388
+ }
389
+ f < d && (d = f, u = n);
390
+ }
391
+ let { side: f, align: p } = q(u), { x: m, y: h } = X(f, p, e, t, r);
392
+ o && (f === "top" || f === "bottom" ? m = Y(m, i, s.width - i - t.width) : h = Y(h, i, s.height - i - t.height));
393
+ let g = n.minMainAxis ?? 0, _, v;
394
+ if (f === "top" || f === "bottom") {
395
+ let t = f === "top" ? e.y - r - i : s.height - i - (e.y + e.height + r);
396
+ v = Math.max(g, Math.floor(t)), _ = Math.max(0, s.width - 2 * i);
397
+ } else {
398
+ let t = f === "left" ? e.x - r - i : s.width - i - (e.x + e.width + r);
399
+ _ = Math.max(g, Math.floor(t)), v = Math.max(0, s.height - 2 * i);
400
+ }
401
+ let y = {
402
+ x: m,
403
+ y: h,
404
+ placement: u,
405
+ side: f,
406
+ align: p,
407
+ maxWidth: _,
408
+ maxHeight: v
409
+ };
410
+ if (n.arrow) {
411
+ let r = n.arrow.size;
412
+ y.arrow = f === "top" || f === "bottom" ? { x: Y(e.x + e.width / 2 - m - r / 2, i, t.width - r - i) } : { y: Y(e.y + e.height / 2 - h - r / 2, i, t.height - r - i) };
413
+ }
414
+ return y;
415
+ }
416
+ function te(e) {
417
+ let t = [], n = e.parentElement;
418
+ for (; n;) {
419
+ let e = getComputedStyle(n);
420
+ /(auto|scroll|overlay|hidden)/.test(e.overflow + e.overflowY + e.overflowX) && t.push(n), n = n.parentElement;
421
+ }
422
+ return t;
423
+ }
424
+ function ne(e, t, n) {
425
+ if (typeof window > "u") return () => {};
426
+ let r = te(e);
427
+ for (let e of r) e.addEventListener("scroll", n, { passive: !0 });
428
+ window.addEventListener("scroll", n, { passive: !0 }), window.addEventListener("resize", n);
429
+ let i;
430
+ return typeof ResizeObserver == "function" && (i = new ResizeObserver(n), i.observe(e), i.observe(t)), n(), () => {
431
+ for (let e of r) e.removeEventListener("scroll", n);
432
+ window.removeEventListener("scroll", n), window.removeEventListener("resize", n), i?.disconnect();
433
+ };
434
+ }
435
+ //#endregion
436
+ //#region ../grid/dist/SvMenuList.svelte
437
+ var re = t("<div class=\"sv-menu__sep svelte-tumeci\" role=\"separator\"></div>"), ie = t("<span class=\"sv-menu__shortcut svelte-tumeci\"> </span>"), ae = w("<svg class=\"sv-menu__chev svelte-tumeci\" viewBox=\"0 0 24 24\" width=\"13\" height=\"13\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m9 18 6-6-6-6\"></path></svg>"), oe = t("<div class=\"sv-menu__flyout svelte-tumeci\"><!></div>"), se = t("<div class=\"sv-menu__itemwrap svelte-tumeci\"><button><span class=\"sv-menu__icon svelte-tumeci\"><!></span> <span class=\"sv-menu__label svelte-tumeci\"> </span> <!> <!></button> <!></div>"), ce = t("<div></div>");
438
+ function $(t, c) {
439
+ u(c, !0);
440
+ let g = S(c, "submenu", 3, !1), _ = e(null), w = G({
441
+ items: () => c.items,
442
+ onSelect: (e) => c.onselect(e),
443
+ onClose: () => c.onclose(),
444
+ submenu: () => g(),
445
+ onCollapse: () => c.oncollapse?.(),
446
+ dir: () => c.dir,
447
+ focusItem: (e) => queueMicrotask(() => y(_)?.querySelector(`[data-mi="${e}"]`)?.focus())
448
+ }), O = c.dir === "rtl" ? "left-start" : "right-start";
449
+ function k(e) {
450
+ let t = e.parentElement, n = t?.querySelector(":scope > .sv-menu__item") ?? null, r = () => {
451
+ if (!n || !t) return;
452
+ let r = n.getBoundingClientRect(), i = t.getBoundingClientRect(), a = {
453
+ width: e.offsetWidth || 200,
454
+ height: e.offsetHeight || 120
455
+ }, o = ee({
456
+ x: r.left,
457
+ y: r.top,
458
+ width: r.width,
459
+ height: r.height
460
+ }, a, {
461
+ placement: O,
462
+ offset: 2,
463
+ padding: 8
464
+ });
465
+ e.style.left = `${o.x - i.left}px`, e.style.top = `${o.y - i.top}px`;
466
+ };
467
+ if (!n) return r(), {};
468
+ let i = ne(n, e, r);
469
+ return { destroy() {
470
+ i();
471
+ } };
472
+ }
473
+ var A = ce();
474
+ b(A, (e) => ({
475
+ class: "sv-menu__list",
476
+ ...e,
477
+ [h]: { "is-submenu": g() }
478
+ }), [() => w.listProps()], void 0, void 0, "svelte-tumeci"), v(A, 21, () => c.items, f, (e, t, i) => {
479
+ var u = l(), f = a(u), p = (e) => {
480
+ var t = re();
481
+ T(e, t);
482
+ }, g = (e) => {
483
+ var u = se(), f = n(u);
484
+ b(f, (e, t) => ({
485
+ type: "button",
486
+ class: "sv-menu__item",
487
+ ...e,
488
+ [h]: t
489
+ }), [() => w.itemProps(i), () => ({ "is-active": w.isActive(i) })], void 0, void 0, "svelte-tumeci");
490
+ var p = n(f), g = n(p), _ = (e) => {
491
+ var n = l(), r = a(n);
492
+ E(r, () => y(t).icon), T(e, n);
493
+ };
494
+ C(g, (e) => {
495
+ y(t).icon && e(_);
496
+ }), r(p);
497
+ var v = o(p, 2), S = n(v, !0);
498
+ r(v);
499
+ var D = o(v, 2), O = (e) => {
500
+ var i = ie(), a = n(i, !0);
501
+ r(i), s(() => m(a, y(t).shortcut)), T(e, i);
502
+ };
503
+ C(D, (e) => {
504
+ y(t).shortcut && e(O);
505
+ });
506
+ var A = o(D, 2), j = (e) => {
507
+ var t = ae();
508
+ T(e, t);
509
+ };
510
+ C(A, (e) => {
511
+ y(t).children?.length && e(j);
512
+ }), r(f);
513
+ var M = o(f, 2), N = (e) => {
514
+ var a = oe();
515
+ $(n(a), {
516
+ get items() {
517
+ return y(t).children;
518
+ },
519
+ get onclose() {
520
+ return c.onclose;
521
+ },
522
+ get onselect() {
523
+ return c.onselect;
524
+ },
525
+ oncollapse: () => w.focus(i),
526
+ get dir() {
527
+ return c.dir;
528
+ },
529
+ submenu: !0
530
+ }), r(a), x(a, (e) => k?.(e)), T(e, a);
531
+ }, P = d(() => y(t).children?.length && w.isSubOpen(i));
532
+ C(M, (e) => {
533
+ y(P) && e(N);
534
+ }), r(u), s(() => m(S, y(t).label)), T(e, u);
535
+ };
536
+ C(f, (e) => {
537
+ y(t).separator ? e(p) : e(g, -1);
538
+ }), T(e, u);
539
+ }), r(A), p(A, (e) => D(_, e), () => y(_)), T(t, A), i();
540
+ }
541
+ //#endregion
542
+ //#region ../grid/dist/SvChartMenu.svelte
543
+ var le = t("<div class=\"sv-ctx sv-grid-chart-menu\"><!></div>");
544
+ function ue(t, a) {
545
+ u(a, !0);
546
+ let o = S(a, "ariaLabel", 3, "Chart menu"), l = e(null), f = d(() => {
547
+ if (typeof window > "u") return {
548
+ x: a.x,
549
+ y: a.y
550
+ };
551
+ let e = Math.min(a.items.length, 12) * 34 + 8;
552
+ return {
553
+ x: Math.max(6, Math.min(a.x, window.innerWidth - 220 - 6)),
554
+ y: Math.max(6, Math.min(a.y, window.innerHeight - e - 6))
555
+ };
556
+ });
557
+ c(() => {
558
+ if (!y(l)) return;
559
+ let e = B(y(l), { initialFocus: () => y(l)?.querySelector("[role=\"menuitem\"]:not([disabled])") ?? null });
560
+ e.activate();
561
+ let t = F({
562
+ element: () => y(l),
563
+ onDismiss: a.onClose
564
+ });
565
+ t.activate();
566
+ let n = I(() => y(l), a.onClose);
567
+ return () => {
568
+ t.release(), e.release(), n();
569
+ };
570
+ });
571
+ var m = le();
572
+ let h;
573
+ $(n(m), {
574
+ get items() {
575
+ return a.items;
576
+ },
577
+ get onclose() {
578
+ return a.onClose;
579
+ },
580
+ onselect: () => a.onClose()
581
+ }), r(m), p(m, (e) => D(l, e), () => y(l)), x(m, (e) => k?.(e)), x(m, (e, t) => A?.(e, t), () => ({})), s(() => {
582
+ g(m, "aria-label", o()), h = _(m, "", h, {
583
+ position: "fixed",
584
+ top: `${y(f).y}px`,
585
+ left: `${y(f).x}px`
586
+ });
587
+ }), T(t, m), i();
588
+ }
589
+ //#endregion
590
+ export { ue as default };