@svgrid/enterprise 3.1.6 → 3.1.8

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.
@@ -81,6 +81,7 @@
81
81
  import { arrowHeadPath, dependencyArrows, type Arrow } from "./gantt/timeline-arrows";
82
82
  import { expandAssignments, resourceLoad, type SchedulerAssignment } from "./scheduler-assignments";
83
83
  import { columnSummaries } from "./scheduler-summary";
84
+ import { keepOnScreen } from "./keep-on-screen";
84
85
  import { buildAxis, timeToX, xToTime, resolveZoom, zoomPresets, type Axis, type ZoomLevel } from "./scheduler-axis";
85
86
  import { buildResourceRows, visibleResourceIds, type ResourceRow } from "./scheduler-resource-tree";
86
87
  import { heatCells, heatPeak, type HeatCell } from "./scheduler-heatmap";
@@ -2029,6 +2030,16 @@
2029
2030
  menuPos = { x: e.clientX, y: e.clientY };
2030
2031
  menuOpen = true;
2031
2032
  }
2033
+ // Keep the menu on screen (keep-on-screen.ts). It opens at the pointer, so a
2034
+ // right-click near the bottom or right edge put its lower items outside the
2035
+ // viewport, where they could not be clicked; e2e caught it once the demo
2036
+ // header grew a line.
2037
+ $effect(() => {
2038
+ if (!menuOpen || !menuPanel || typeof window === "undefined") return;
2039
+ const r = menuPanel.getBoundingClientRect();
2040
+ const fit = keepOnScreen(menuPos, r, { width: window.innerWidth, height: window.innerHeight });
2041
+ if (fit.x !== menuPos.x || fit.y !== menuPos.y) menuPos = fit;
2042
+ });
2032
2043
  $effect(() => {
2033
2044
  if (!menuOpen) return;
2034
2045
  const layer = createDismissableLayer({
@@ -2081,6 +2092,13 @@
2081
2092
  listOpen = false;
2082
2093
  openEvent(ev);
2083
2094
  }
2095
+ // The "+N more" list opens at the pointer too; same edge rule as the menu.
2096
+ $effect(() => {
2097
+ if (!listOpen || !listPanel || typeof window === "undefined") return;
2098
+ const r = listPanel.getBoundingClientRect();
2099
+ const fit = keepOnScreen(listPos, r, { width: window.innerWidth, height: window.innerHeight });
2100
+ if (fit.x !== listPos.x || fit.y !== listPos.y) listPos = fit;
2101
+ });
2084
2102
  $effect(() => {
2085
2103
  if (!listOpen) return;
2086
2104
  const layer = createDismissableLayer({