@toolbox-web/grid 0.4.2 → 0.6.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 (123) hide show
  1. package/README.md +2 -3
  2. package/all.js +1063 -1024
  3. package/all.js.map +1 -1
  4. package/index.js +1078 -912
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +28 -0
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/dom-builder.d.ts +2 -0
  9. package/lib/core/internal/dom-builder.d.ts.map +1 -1
  10. package/lib/core/internal/event-delegation.d.ts +21 -0
  11. package/lib/core/internal/event-delegation.d.ts.map +1 -1
  12. package/lib/core/internal/header.d.ts.map +1 -1
  13. package/lib/core/internal/resize.d.ts.map +1 -1
  14. package/lib/core/internal/rows.d.ts +1 -1
  15. package/lib/core/internal/rows.d.ts.map +1 -1
  16. package/lib/core/internal/shell.d.ts +19 -13
  17. package/lib/core/internal/shell.d.ts.map +1 -1
  18. package/lib/core/plugin/base-plugin.d.ts +13 -2
  19. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  20. package/lib/core/plugin/expander-column.d.ts.map +1 -1
  21. package/lib/core/plugin/plugin-manager.d.ts +6 -2
  22. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  23. package/lib/core/types.d.ts +41 -3
  24. package/lib/core/types.d.ts.map +1 -1
  25. package/lib/plugins/clipboard/index.js +22 -11
  26. package/lib/plugins/clipboard/index.js.map +1 -1
  27. package/lib/plugins/column-virtualization/index.js +59 -48
  28. package/lib/plugins/column-virtualization/index.js.map +1 -1
  29. package/lib/plugins/context-menu/index.js +71 -60
  30. package/lib/plugins/context-menu/index.js.map +1 -1
  31. package/lib/plugins/editing/EditingPlugin.d.ts +1 -0
  32. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  33. package/lib/plugins/editing/index.js +93 -80
  34. package/lib/plugins/editing/index.js.map +1 -1
  35. package/lib/plugins/export/index.js +29 -18
  36. package/lib/plugins/export/index.js.map +1 -1
  37. package/lib/plugins/filtering/FilteringPlugin.d.ts +9 -1
  38. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  39. package/lib/plugins/filtering/index.js +199 -165
  40. package/lib/plugins/filtering/index.js.map +1 -1
  41. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +1 -0
  42. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  43. package/lib/plugins/grouping-columns/index.js +79 -49
  44. package/lib/plugins/grouping-columns/index.js.map +1 -1
  45. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  46. package/lib/plugins/grouping-rows/index.js +98 -87
  47. package/lib/plugins/grouping-rows/index.js.map +1 -1
  48. package/lib/plugins/master-detail/index.js +70 -57
  49. package/lib/plugins/master-detail/index.js.map +1 -1
  50. package/lib/plugins/multi-sort/index.js +48 -37
  51. package/lib/plugins/multi-sort/index.js.map +1 -1
  52. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  53. package/lib/plugins/pinned-columns/index.js +71 -66
  54. package/lib/plugins/pinned-columns/index.js.map +1 -1
  55. package/lib/plugins/pinned-columns/pinned-columns.d.ts +2 -2
  56. package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -1
  57. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  58. package/lib/plugins/pinned-rows/index.js +63 -52
  59. package/lib/plugins/pinned-rows/index.js.map +1 -1
  60. package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
  61. package/lib/plugins/pivot/index.js +310 -299
  62. package/lib/plugins/pivot/index.js.map +1 -1
  63. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  64. package/lib/plugins/reorder/index.d.ts +1 -1
  65. package/lib/plugins/reorder/index.d.ts.map +1 -1
  66. package/lib/plugins/reorder/index.js +79 -68
  67. package/lib/plugins/reorder/index.js.map +1 -1
  68. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  69. package/lib/plugins/selection/index.js +115 -105
  70. package/lib/plugins/selection/index.js.map +1 -1
  71. package/lib/plugins/server-side/index.js +15 -4
  72. package/lib/plugins/server-side/index.js.map +1 -1
  73. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  74. package/lib/plugins/tree/index.js +41 -30
  75. package/lib/plugins/tree/index.js.map +1 -1
  76. package/lib/plugins/undo-redo/index.js +29 -18
  77. package/lib/plugins/undo-redo/index.js.map +1 -1
  78. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
  79. package/lib/plugins/visibility/index.js +59 -47
  80. package/lib/plugins/visibility/index.js.map +1 -1
  81. package/package.json +6 -6
  82. package/public.d.ts +42 -0
  83. package/public.d.ts.map +1 -1
  84. package/themes/dg-theme-bootstrap.css +55 -53
  85. package/themes/dg-theme-contrast.css +42 -40
  86. package/themes/dg-theme-large.css +38 -37
  87. package/themes/dg-theme-material.css +54 -52
  88. package/themes/dg-theme-standard.css +19 -17
  89. package/themes/dg-theme-vibrant.css +16 -14
  90. package/umd/grid.all.umd.js +23 -22
  91. package/umd/grid.all.umd.js.map +1 -1
  92. package/umd/grid.umd.js +15 -14
  93. package/umd/grid.umd.js.map +1 -1
  94. package/umd/plugins/column-virtualization.umd.js +1 -1
  95. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  96. package/umd/plugins/context-menu.umd.js +1 -1
  97. package/umd/plugins/context-menu.umd.js.map +1 -1
  98. package/umd/plugins/editing.umd.js +1 -1
  99. package/umd/plugins/editing.umd.js.map +1 -1
  100. package/umd/plugins/filtering.umd.js +1 -1
  101. package/umd/plugins/filtering.umd.js.map +1 -1
  102. package/umd/plugins/grouping-columns.umd.js +1 -1
  103. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  104. package/umd/plugins/grouping-rows.umd.js +1 -1
  105. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  106. package/umd/plugins/master-detail.umd.js +1 -1
  107. package/umd/plugins/master-detail.umd.js.map +1 -1
  108. package/umd/plugins/multi-sort.umd.js +1 -1
  109. package/umd/plugins/multi-sort.umd.js.map +1 -1
  110. package/umd/plugins/pinned-columns.umd.js +1 -1
  111. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  112. package/umd/plugins/pinned-rows.umd.js +1 -1
  113. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  114. package/umd/plugins/pivot.umd.js +1 -1
  115. package/umd/plugins/pivot.umd.js.map +1 -1
  116. package/umd/plugins/reorder.umd.js +1 -1
  117. package/umd/plugins/reorder.umd.js.map +1 -1
  118. package/umd/plugins/selection.umd.js +1 -1
  119. package/umd/plugins/selection.umd.js.map +1 -1
  120. package/umd/plugins/tree.umd.js +1 -1
  121. package/umd/plugins/tree.umd.js.map +1 -1
  122. package/umd/plugins/visibility.umd.js +1 -1
  123. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -185,10 +185,21 @@ class I {
185
185
  return this.grid;
186
186
  }
187
187
  /**
188
- * Get the shadow root of the grid.
188
+ * Get the render root of the grid for DOM queries.
189
+ * @deprecated Use `gridElement` instead. This getter exists only for backward compatibility.
190
+ *
191
+ * With Shadow DOM removed, the grid element itself is the render root.
192
+ * All new code should use `this.gridElement` for DOM queries.
193
+ *
194
+ * @example
195
+ * // OLD (deprecated)
196
+ * const rows = this.shadowRoot?.querySelector('.rows');
197
+ *
198
+ * // NEW (preferred)
199
+ * const rows = this.gridElement.querySelector('.rows');
189
200
  */
190
201
  get shadowRoot() {
191
- return this.grid?.shadowRoot ?? null;
202
+ return this.gridElement;
192
203
  }
193
204
  /**
194
205
  * Get the disconnect signal for event listener cleanup.
@@ -239,7 +250,7 @@ class I {
239
250
  const e = this.grid?.effectiveConfig?.animation?.mode ?? "reduced-motion";
240
251
  if (e === !1 || e === "off") return !1;
241
252
  if (e === !0 || e === "on") return !0;
242
- const t = this.shadowRoot?.host;
253
+ const t = this.gridElement;
243
254
  return t ? getComputedStyle(t).getPropertyValue("--tbw-animation-enabled").trim() !== "0" : !0;
244
255
  }
245
256
  /**
@@ -255,7 +266,7 @@ class I {
255
266
  * ```
256
267
  */
257
268
  get animationDuration() {
258
- const e = this.shadowRoot?.host;
269
+ const e = this.gridElement;
259
270
  if (e) {
260
271
  const t = getComputedStyle(e).getPropertyValue("--tbw-animation-duration").trim(), n = parseInt(t, 10);
261
272
  if (!isNaN(n)) return n;
@@ -292,81 +303,81 @@ class I {
292
303
  }
293
304
  // #endregion
294
305
  }
295
- const g = ".tbw-context-menu{position:fixed;background:light-dark(#f5f5f5,#2a2a2a);color:light-dark(#222,#eee);border:1px solid light-dark(#d0d0d4,#454545);border-radius:4px;box-shadow:0 2px 10px #00000026;min-width:160px;padding:4px 0;z-index:10000;font-size:13px;font-family:system-ui,sans-serif}.tbw-context-menu-item{display:flex;align-items:center;padding:6px 12px;cursor:pointer;gap:8px}.tbw-context-menu-item:hover:not(.disabled){background:light-dark(#e8e8e8,#3a3a3a)}.tbw-context-menu-item.disabled{opacity:.5;cursor:default}.tbw-context-menu-item.danger{color:light-dark(#c00,#f66)}.tbw-context-menu-icon{width:16px;text-align:center}.tbw-context-menu-label{flex:1}.tbw-context-menu-shortcut{color:light-dark(#888,#888);font-size:11px}.tbw-context-menu-arrow{font-size:10px;color:light-dark(#888,#888)}.tbw-context-menu-separator{height:1px;background:light-dark(#d0d0d4,#454545);margin:4px 0}";
296
- function w(s, e) {
297
- return (typeof s == "function" ? s(e) : s).filter((n) => !(n.hidden === !0 || typeof n.hidden == "function" && n.hidden(e)));
306
+ const g = "@layer tbw-plugins{.tbw-context-menu{position:fixed;background:var(--tbw-context-menu-bg, var(--tbw-color-panel-bg, light-dark(#f5f5f5, #2a2a2a)));color:var(--tbw-context-menu-fg, var(--tbw-color-fg, light-dark(#222, #eee)));border:1px solid var(--tbw-context-menu-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-border-radius, .25rem);box-shadow:0 2px 10px var(--tbw-color-shadow, rgba(0, 0, 0, .15));min-width:var(--tbw-menu-min-width, 10rem);padding:var(--tbw-spacing-xs, .25rem) 0;z-index:10000;font-size:var(--tbw-font-size-sm, .8125rem);font-family:var(--tbw-font-family, system-ui, sans-serif)}.tbw-context-menu-item{display:flex;align-items:center;padding:var(--tbw-menu-item-padding, .375rem .75rem);cursor:pointer;gap:var(--tbw-menu-item-gap, .5rem)}.tbw-context-menu-item:hover:not(.disabled){background:var(--tbw-context-menu-hover, var(--tbw-color-row-hover, light-dark(#e8e8e8, #3a3a3a)))}.tbw-context-menu-item.disabled{opacity:.5;cursor:default}.tbw-context-menu-item.danger{color:light-dark(#c00,#f66)}.tbw-context-menu-icon{width:var(--tbw-icon-size, 1rem);text-align:center}.tbw-context-menu-label{flex:1}.tbw-context-menu-shortcut{color:var(--tbw-color-fg-muted, light-dark(#888, #888));font-size:var(--tbw-font-size-xs, .6875rem)}.tbw-context-menu-arrow{font-size:var(--tbw-font-size-2xs, .625rem);color:var(--tbw-color-fg-muted, light-dark(#888, #888))}.tbw-context-menu-separator{height:1px;background:var(--tbw-context-menu-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));margin:var(--tbw-spacing-xs, .25rem) 0}}";
307
+ function v(r, e) {
308
+ return (typeof r == "function" ? r(e) : r).filter((n) => !(n.hidden === !0 || typeof n.hidden == "function" && n.hidden(e)));
298
309
  }
299
- function M(s, e) {
300
- return s.disabled === !0 ? !0 : typeof s.disabled == "function" ? s.disabled(e) : !1;
310
+ function M(r, e) {
311
+ return r.disabled === !0 ? !0 : typeof r.disabled == "function" ? r.disabled(e) : !1;
301
312
  }
302
- function v(s, e, t, n = C.submenuArrow) {
313
+ function x(r, e, t, n = C.submenuArrow) {
303
314
  const l = document.createElement("div");
304
315
  l.className = "tbw-context-menu", l.setAttribute("role", "menu");
305
- for (const o of s) {
316
+ for (const o of r) {
306
317
  if (o.separator) {
307
- const r = document.createElement("div");
308
- r.className = "tbw-context-menu-separator", r.setAttribute("role", "separator"), l.appendChild(r);
318
+ const s = document.createElement("div");
319
+ s.className = "tbw-context-menu-separator", s.setAttribute("role", "separator"), l.appendChild(s);
309
320
  continue;
310
321
  }
311
322
  const i = document.createElement("div");
312
323
  i.className = "tbw-context-menu-item", o.cssClass && i.classList.add(o.cssClass), i.setAttribute("role", "menuitem"), i.setAttribute("data-id", o.id);
313
- const a = M(o, e);
314
- if (a && (i.classList.add("disabled"), i.setAttribute("aria-disabled", "true")), o.icon) {
315
- const r = document.createElement("span");
316
- r.className = "tbw-context-menu-icon", r.innerHTML = o.icon, i.appendChild(r);
324
+ const d = M(o, e);
325
+ if (d && (i.classList.add("disabled"), i.setAttribute("aria-disabled", "true")), o.icon) {
326
+ const s = document.createElement("span");
327
+ s.className = "tbw-context-menu-icon", s.innerHTML = o.icon, i.appendChild(s);
317
328
  }
318
- const d = document.createElement("span");
319
- if (d.className = "tbw-context-menu-label", d.textContent = o.name, i.appendChild(d), o.shortcut) {
320
- const r = document.createElement("span");
321
- r.className = "tbw-context-menu-shortcut", r.textContent = o.shortcut, i.appendChild(r);
329
+ const a = document.createElement("span");
330
+ if (a.className = "tbw-context-menu-label", a.textContent = o.name, i.appendChild(a), o.shortcut) {
331
+ const s = document.createElement("span");
332
+ s.className = "tbw-context-menu-shortcut", s.textContent = o.shortcut, i.appendChild(s);
322
333
  }
323
334
  if (o.subMenu?.length) {
324
- const r = document.createElement("span");
325
- r.className = "tbw-context-menu-arrow", typeof n == "string" ? r.innerHTML = n : n instanceof HTMLElement && r.appendChild(n.cloneNode(!0)), i.appendChild(r), i.addEventListener("mouseenter", () => {
335
+ const s = document.createElement("span");
336
+ s.className = "tbw-context-menu-arrow", typeof n == "string" ? s.innerHTML = n : n instanceof HTMLElement && s.appendChild(n.cloneNode(!0)), i.appendChild(s), i.addEventListener("mouseenter", () => {
326
337
  if (i.querySelector(".tbw-context-menu") || !o.subMenu) return;
327
- const h = w(o.subMenu, e), c = v(h, e, t, n);
338
+ const h = v(o.subMenu, e), c = x(h, e, t, n);
328
339
  c.classList.add("tbw-context-submenu"), c.style.position = "absolute", c.style.left = "100%", c.style.top = "0", i.style.position = "relative", i.appendChild(c);
329
340
  }), i.addEventListener("mouseleave", () => {
330
341
  const u = i.querySelector(".tbw-context-menu");
331
342
  u && u.remove();
332
343
  });
333
344
  }
334
- !a && o.action && !o.subMenu && i.addEventListener("click", (r) => {
335
- r.stopPropagation(), t(o);
345
+ !d && o.action && !o.subMenu && i.addEventListener("click", (s) => {
346
+ s.stopPropagation(), t(o);
336
347
  }), l.appendChild(i);
337
348
  }
338
349
  return l;
339
350
  }
340
- function y(s, e, t) {
341
- s.style.position = "fixed", s.style.left = `${e}px`, s.style.top = `${t}px`, s.style.visibility = "hidden", s.style.zIndex = "10000";
342
- const n = s.getBoundingClientRect(), l = window.innerWidth, o = window.innerHeight;
343
- let i = e, a = t;
344
- e + n.width > l && (i = e - n.width), t + n.height > o && (a = t - n.height), i = Math.max(0, i), a = Math.max(0, a), s.style.left = `${i}px`, s.style.top = `${a}px`, s.style.visibility = "visible";
351
+ function y(r, e, t) {
352
+ r.style.position = "fixed", r.style.left = `${e}px`, r.style.top = `${t}px`, r.style.visibility = "hidden", r.style.zIndex = "10000";
353
+ const n = r.getBoundingClientRect(), l = window.innerWidth, o = window.innerHeight;
354
+ let i = e, d = t;
355
+ e + n.width > l && (i = e - n.width), t + n.height > o && (d = t - n.height), i = Math.max(0, i), d = Math.max(0, d), r.style.left = `${i}px`, r.style.top = `${d}px`, r.style.visibility = "visible";
345
356
  }
346
- let f = null, p = null, m = null, b = 0;
347
- const x = [
357
+ let f = null, b = null, m = null, p = 0;
358
+ const w = [
348
359
  {
349
360
  id: "copy",
350
361
  name: "Copy",
351
362
  shortcut: "Ctrl+C",
352
- action: (s) => {
353
- s.grid?.plugins?.clipboard?.copy?.();
363
+ action: (r) => {
364
+ r.grid?.plugins?.clipboard?.copy?.();
354
365
  }
355
366
  },
356
367
  { separator: !0, id: "sep1", name: "" },
357
368
  {
358
369
  id: "export-csv",
359
370
  name: "Export CSV",
360
- action: (s) => {
361
- s.grid?.plugins?.export?.exportCsv?.();
371
+ action: (r) => {
372
+ r.grid?.plugins?.export?.exportCsv?.();
362
373
  }
363
374
  }
364
375
  ];
365
- class R extends I {
376
+ class H extends I {
366
377
  name = "contextMenu";
367
378
  get defaultConfig() {
368
379
  return {
369
- items: x
380
+ items: w
370
381
  };
371
382
  }
372
383
  // #region Internal State
@@ -377,7 +388,7 @@ class R extends I {
377
388
  // #endregion
378
389
  // #region Lifecycle
379
390
  attach(e) {
380
- super.attach(e), this.installGlobalHandlers(), b++;
391
+ super.attach(e), this.installGlobalHandlers(), p++;
381
392
  }
382
393
  detach() {
383
394
  this.menuElement && (this.menuElement.remove(), this.menuElement = null), this.isOpen = !1, this.params = null, this.uninstallGlobalHandlers();
@@ -387,31 +398,31 @@ class R extends I {
387
398
  installGlobalHandlers() {
388
399
  !m && typeof document < "u" && typeof g == "string" && g && (m = document.createElement("style"), m.id = "tbw-context-menu-styles", m.textContent = g, document.head.appendChild(m)), f || (f = () => {
389
400
  document.querySelectorAll(".tbw-context-menu").forEach((t) => t.remove());
390
- }, document.addEventListener("click", f)), p || (p = (e) => {
401
+ }, document.addEventListener("click", f)), b || (b = (e) => {
391
402
  e.key === "Escape" && document.querySelectorAll(".tbw-context-menu").forEach((n) => n.remove());
392
- }, document.addEventListener("keydown", p));
403
+ }, document.addEventListener("keydown", b));
393
404
  }
394
405
  /**
395
406
  * Clean up global handlers when the last instance detaches.
396
407
  * Uses reference counting to ensure handlers persist while any grid uses the plugin.
397
408
  */
398
409
  uninstallGlobalHandlers() {
399
- b--, !(b > 0) && (f && (document.removeEventListener("click", f), f = null), p && (document.removeEventListener("keydown", p), p = null), m && (m.remove(), m = null));
410
+ p--, !(p > 0) && (f && (document.removeEventListener("click", f), f = null), b && (document.removeEventListener("keydown", b), b = null), m && (m.remove(), m = null));
400
411
  }
401
412
  // #endregion
402
413
  // #region Hooks
403
414
  afterRender() {
404
- const e = this.shadowRoot;
415
+ const e = this.gridElement;
405
416
  if (!e) return;
406
417
  const t = e.children[0];
407
418
  t && t.getAttribute("data-context-menu-bound") !== "true" && (t.setAttribute("data-context-menu-bound", "true"), t.addEventListener("contextmenu", (n) => {
408
419
  const l = n;
409
420
  l.preventDefault();
410
- const o = l.target, i = o.closest("[data-row][data-col]"), a = o.closest(".header-cell");
411
- let d;
421
+ const o = l.target, i = o.closest("[data-row][data-col]"), d = o.closest(".header-cell");
422
+ let a;
412
423
  if (i) {
413
424
  const u = parseInt(i.getAttribute("data-row") ?? "-1", 10), h = parseInt(i.getAttribute("data-col") ?? "-1", 10), c = this.columns[h], E = this.rows[u];
414
- d = {
425
+ a = {
415
426
  row: E,
416
427
  rowIndex: u,
417
428
  column: c,
@@ -421,9 +432,9 @@ class R extends I {
421
432
  isHeader: !1,
422
433
  event: l
423
434
  };
424
- } else if (a) {
425
- const u = parseInt(a.getAttribute("data-col") ?? "-1", 10), h = this.columns[u];
426
- d = {
435
+ } else if (d) {
436
+ const u = parseInt(d.getAttribute("data-col") ?? "-1", 10), h = this.columns[u];
437
+ a = {
427
438
  row: null,
428
439
  rowIndex: -1,
429
440
  column: h,
@@ -435,16 +446,16 @@ class R extends I {
435
446
  };
436
447
  } else
437
448
  return;
438
- this.params = d, this.position = { x: l.clientX, y: l.clientY };
439
- const r = w(this.config.items ?? x, d);
440
- r.length && (this.menuElement && this.menuElement.remove(), this.menuElement = v(
441
- r,
442
- d,
449
+ this.params = a, this.position = { x: l.clientX, y: l.clientY };
450
+ const s = v(this.config.items ?? w, a);
451
+ s.length && (this.menuElement && this.menuElement.remove(), this.menuElement = x(
452
+ s,
453
+ a,
443
454
  (u) => {
444
- u.action && u.action(d), this.menuElement?.remove(), this.menuElement = null, this.isOpen = !1;
455
+ u.action && u.action(a), this.menuElement?.remove(), this.menuElement = null, this.isOpen = !1;
445
456
  },
446
457
  this.gridIcons.submenuArrow
447
- ), document.body.appendChild(this.menuElement), y(this.menuElement, l.clientX, l.clientY), this.isOpen = !0, this.emit("context-menu-open", { params: d, items: r }));
458
+ ), document.body.appendChild(this.menuElement), y(this.menuElement, l.clientX, l.clientY), this.isOpen = !0, this.emit("context-menu-open", { params: a, items: s }));
448
459
  }));
449
460
  }
450
461
  // #endregion
@@ -465,8 +476,8 @@ class R extends I {
465
476
  value: n.value ?? null,
466
477
  isHeader: n.isHeader ?? !1,
467
478
  event: n.event ?? new MouseEvent("contextmenu")
468
- }, o = w(this.config.items ?? x, l);
469
- this.menuElement && this.menuElement.remove(), this.menuElement = v(
479
+ }, o = v(this.config.items ?? w, l);
480
+ this.menuElement && this.menuElement.remove(), this.menuElement = x(
470
481
  o,
471
482
  l,
472
483
  (i) => {
@@ -492,6 +503,6 @@ class R extends I {
492
503
  // Styles are injected globally via installGlobalHandlers() since menu renders in document.body
493
504
  }
494
505
  export {
495
- R as ContextMenuPlugin
506
+ H as ContextMenuPlugin
496
507
  };
497
508
  //# sourceMappingURL=index.js.map