gantt-lib 0.121.1 → 0.121.2

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.
package/dist/index.mjs CHANGED
@@ -12018,6 +12018,7 @@ var TASK_ROW_OVERSCAN = 8;
12018
12018
  var PLAN_FACT_COLUMN_OVERSCAN = 24;
12019
12019
  var PLAN_FACT_COLUMN_WINDOW_STEP = 14;
12020
12020
  var DEFAULT_INITIAL_VIEWPORT_HEIGHT = 768;
12021
+ var DEFAULT_PLAN_FACT_COLUMN_WINDOW = PLAN_FACT_COLUMN_OVERSCAN + PLAN_FACT_COLUMN_WINDOW_STEP;
12021
12022
  function getInitialScrollViewportHeight(containerHeight, headerHeight) {
12022
12023
  if (containerHeight === void 0) {
12023
12024
  return 0;
@@ -12230,7 +12231,7 @@ function TaskGanttChartInner(props, ref) {
12230
12231
  viewportHeight: getInitialScrollViewportHeight(containerHeight, headerHeight + 1)
12231
12232
  }));
12232
12233
  const [forceFullRenderForPrint, setForceFullRenderForPrint] = useState11(false);
12233
- const [planFactDateWindow, setPlanFactDateWindow] = useState11(null);
12234
+ const [planFactDateWindow, setPlanFactDateWindow] = useState11({ start: 0, end: 0 });
12234
12235
  const [selectedChip, setSelectedChip] = useState11(null);
12235
12236
  const [activeTimelineTooltip, setActiveTimelineTooltip] = useState11(null);
12236
12237
  const [internalCollapsedParentIds, setInternalCollapsedParentIds] = useState11(/* @__PURE__ */ new Set());
@@ -12381,7 +12382,7 @@ function TaskGanttChartInner(props, ref) {
12381
12382
  );
12382
12383
  setPlanFactDateWindow((previous) => {
12383
12384
  if (!isPlanFactMode || dateRange.length === 0 || nextViewportWidth <= 0) {
12384
- return previous === null ? previous : null;
12385
+ return previous;
12385
12386
  }
12386
12387
  const firstVisibleColumn = Math.max(0, Math.floor(nextChartScrollLeft / dayWidth));
12387
12388
  const visibleColumnCount = Math.max(1, Math.ceil(nextViewportWidth / dayWidth));
@@ -12671,12 +12672,13 @@ function TaskGanttChartInner(props, ref) {
12671
12672
  if (forceFullRenderForPrint) {
12672
12673
  return void 0;
12673
12674
  }
12674
- if (!isPlanFactMode || dateRange.length === 0 || !planFactDateWindow) {
12675
+ if (!isPlanFactMode || dateRange.length === 0) {
12675
12676
  return void 0;
12676
12677
  }
12678
+ const window2 = planFactDateWindow;
12677
12679
  return Array.from(
12678
- { length: planFactDateWindow.end - planFactDateWindow.start + 1 },
12679
- (_, index) => planFactDateWindow.start + index
12680
+ { length: window2.end - window2.start + 1 },
12681
+ (_, index) => window2.start + index
12680
12682
  );
12681
12683
  }, [dateRange.length, forceFullRenderForPrint, isPlanFactMode, planFactDateWindow]);
12682
12684
  const renderedChartTasks = useMemo13(