gantt-lib 0.72.1 → 0.72.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
@@ -7150,8 +7150,13 @@ var TaskList = ({
7150
7150
  };
7151
7151
 
7152
7152
  // src/components/GanttChart/print.ts
7153
- function getPrintDocumentTitle({ header, title, fileName }) {
7154
- return header?.projectName || title || header?.serviceName || fileName || "Gantt chart";
7153
+ function getPrintDocumentTitle({
7154
+ header,
7155
+ documentTitle,
7156
+ title,
7157
+ fileName
7158
+ }) {
7159
+ return documentTitle || fileName || title || header?.projectName || header?.serviceName || "Gantt chart";
7155
7160
  }
7156
7161
  function formatHeaderExportDate(exportDate) {
7157
7162
  if (!exportDate) return null;
@@ -7446,6 +7451,7 @@ async function printGanttChart({
7446
7451
  sourceContainer,
7447
7452
  printContent,
7448
7453
  header,
7454
+ documentTitle,
7449
7455
  title,
7450
7456
  fileName,
7451
7457
  orientation
@@ -7457,7 +7463,7 @@ async function printGanttChart({
7457
7463
  if (!printWindow || !printDocument) {
7458
7464
  throw new Error("Unable to create print frame");
7459
7465
  }
7460
- const printTitle = getPrintDocumentTitle({ header, title, fileName });
7466
+ const printTitle = getPrintDocumentTitle({ header, documentTitle, title, fileName });
7461
7467
  printDocument.open();
7462
7468
  printDocument.write('<!doctype html><html><head><meta charset="utf-8" /></head><body></body></html>');
7463
7469
  printDocument.close();
@@ -7825,6 +7831,7 @@ function GanttChartInner(props, ref) {
7825
7831
  }
7826
7832
  if (includeChart) {
7827
7833
  chartClone?.classList.remove("gantt-chart-hidden");
7834
+ if (chartClone) chartClone.style.display = "";
7828
7835
  } else {
7829
7836
  chartClone?.remove();
7830
7837
  }
@@ -7833,6 +7840,7 @@ function GanttChartInner(props, ref) {
7833
7840
  sourceContainer,
7834
7841
  printContent,
7835
7842
  header: options?.header,
7843
+ documentTitle: options?.documentTitle,
7836
7844
  title: options?.title,
7837
7845
  fileName: options?.fileName,
7838
7846
  orientation: options?.orientation
@@ -8020,100 +8028,107 @@ function GanttChartInner(props, ref) {
8020
8028
  additionalColumns
8021
8029
  }
8022
8030
  ),
8023
- /* @__PURE__ */ jsxs12("div", { className: showChart ? "gantt-chartSurface" : "gantt-chartSurface gantt-chart-hidden", style: { minWidth: `${gridWidth}px`, flex: 1 }, children: [
8024
- /* @__PURE__ */ jsx15("div", { className: "gantt-stickyHeader", style: { width: `${gridWidth}px` }, children: /* @__PURE__ */ jsx15(
8025
- TimeScaleHeader_default,
8026
- {
8027
- days: dateRange,
8028
- dayWidth,
8029
- headerHeight,
8030
- viewMode,
8031
- isCustomWeekend
8032
- }
8033
- ) }),
8034
- /* @__PURE__ */ jsxs12(
8035
- "div",
8036
- {
8037
- className: "gantt-taskArea",
8038
- style: {
8039
- position: "relative",
8040
- width: `${gridWidth}px`
8041
- },
8042
- children: [
8043
- /* @__PURE__ */ jsx15(
8044
- GridBackground_default,
8045
- {
8046
- dateRange,
8047
- dayWidth,
8048
- totalHeight: totalGridHeight,
8049
- viewMode,
8050
- isCustomWeekend
8051
- }
8052
- ),
8053
- todayInRange && /* @__PURE__ */ jsx15(TodayIndicator_default, { monthStart, dayWidth }),
8054
- /* @__PURE__ */ jsx15(
8055
- DependencyLines_default,
8056
- {
8057
- tasks: previewVisibleTasks,
8058
- allTasks: previewNormalizedTasks,
8059
- collapsedParentIds,
8060
- monthStart,
8061
- dayWidth,
8062
- rowHeight,
8063
- gridWidth,
8064
- dragOverrides: dependencyOverrides,
8065
- selectedDep: selectedChip,
8066
- businessDays,
8067
- weekendPredicate: isCustomWeekend
8068
- }
8069
- ),
8070
- dragGuideLines && /* @__PURE__ */ jsx15(
8071
- DragGuideLines_default,
8072
- {
8073
- isDragging: dragGuideLines.isDragging,
8074
- dragMode: dragGuideLines.dragMode,
8075
- left: dragGuideLines.left,
8076
- width: dragGuideLines.width,
8077
- totalHeight: totalGridHeight
8078
- }
8079
- ),
8080
- visibleTasks.map((task, index) => /* @__PURE__ */ jsx15(
8081
- TaskRow_default,
8082
- {
8083
- task,
8084
- monthStart,
8085
- dayWidth,
8086
- rowHeight,
8087
- onTasksChange: handleTaskChange,
8088
- onDragStateChange: (state) => {
8089
- if (state.isDragging) {
8090
- setDragGuideLines(state);
8091
- setDraggedTaskOverride({ taskId: task.id, left: state.left, width: state.width });
8092
- } else {
8093
- setDragGuideLines(null);
8094
- setDraggedTaskOverride(null);
8095
- }
8096
- },
8097
- rowIndex: index,
8098
- allTasks: normalizedTasks,
8099
- enableAutoSchedule: enableAutoSchedule ?? false,
8100
- disableConstraints: disableConstraints ?? false,
8101
- overridePosition: cascadeOverrides.get(task.id),
8102
- onCascadeProgress: handleCascadeProgress,
8103
- onCascade: handleCascade,
8104
- highlightExpiredTasks,
8105
- isFilterMatch: filterMode === "highlight" ? matchedTaskIds.has(task.id) : false,
8106
- businessDays,
8107
- customDays,
8108
- isWeekend: isWeekend3,
8109
- disableTaskDrag
8031
+ /* @__PURE__ */ jsxs12(
8032
+ "div",
8033
+ {
8034
+ className: showChart ? "gantt-chartSurface" : "gantt-chartSurface gantt-chart-hidden",
8035
+ style: { minWidth: `${gridWidth}px`, flex: 1, display: showChart ? void 0 : "none" },
8036
+ children: [
8037
+ /* @__PURE__ */ jsx15("div", { className: "gantt-stickyHeader", style: { width: `${gridWidth}px` }, children: /* @__PURE__ */ jsx15(
8038
+ TimeScaleHeader_default,
8039
+ {
8040
+ days: dateRange,
8041
+ dayWidth,
8042
+ headerHeight,
8043
+ viewMode,
8044
+ isCustomWeekend
8045
+ }
8046
+ ) }),
8047
+ /* @__PURE__ */ jsxs12(
8048
+ "div",
8049
+ {
8050
+ className: "gantt-taskArea",
8051
+ style: {
8052
+ position: "relative",
8053
+ width: `${gridWidth}px`
8110
8054
  },
8111
- task.id
8112
- ))
8113
- ]
8114
- }
8115
- )
8116
- ] })
8055
+ children: [
8056
+ /* @__PURE__ */ jsx15(
8057
+ GridBackground_default,
8058
+ {
8059
+ dateRange,
8060
+ dayWidth,
8061
+ totalHeight: totalGridHeight,
8062
+ viewMode,
8063
+ isCustomWeekend
8064
+ }
8065
+ ),
8066
+ todayInRange && /* @__PURE__ */ jsx15(TodayIndicator_default, { monthStart, dayWidth }),
8067
+ /* @__PURE__ */ jsx15(
8068
+ DependencyLines_default,
8069
+ {
8070
+ tasks: previewVisibleTasks,
8071
+ allTasks: previewNormalizedTasks,
8072
+ collapsedParentIds,
8073
+ monthStart,
8074
+ dayWidth,
8075
+ rowHeight,
8076
+ gridWidth,
8077
+ dragOverrides: dependencyOverrides,
8078
+ selectedDep: selectedChip,
8079
+ businessDays,
8080
+ weekendPredicate: isCustomWeekend
8081
+ }
8082
+ ),
8083
+ dragGuideLines && /* @__PURE__ */ jsx15(
8084
+ DragGuideLines_default,
8085
+ {
8086
+ isDragging: dragGuideLines.isDragging,
8087
+ dragMode: dragGuideLines.dragMode,
8088
+ left: dragGuideLines.left,
8089
+ width: dragGuideLines.width,
8090
+ totalHeight: totalGridHeight
8091
+ }
8092
+ ),
8093
+ visibleTasks.map((task, index) => /* @__PURE__ */ jsx15(
8094
+ TaskRow_default,
8095
+ {
8096
+ task,
8097
+ monthStart,
8098
+ dayWidth,
8099
+ rowHeight,
8100
+ onTasksChange: handleTaskChange,
8101
+ onDragStateChange: (state) => {
8102
+ if (state.isDragging) {
8103
+ setDragGuideLines(state);
8104
+ setDraggedTaskOverride({ taskId: task.id, left: state.left, width: state.width });
8105
+ } else {
8106
+ setDragGuideLines(null);
8107
+ setDraggedTaskOverride(null);
8108
+ }
8109
+ },
8110
+ rowIndex: index,
8111
+ allTasks: normalizedTasks,
8112
+ enableAutoSchedule: enableAutoSchedule ?? false,
8113
+ disableConstraints: disableConstraints ?? false,
8114
+ overridePosition: cascadeOverrides.get(task.id),
8115
+ onCascadeProgress: handleCascadeProgress,
8116
+ onCascade: handleCascade,
8117
+ highlightExpiredTasks,
8118
+ isFilterMatch: filterMode === "highlight" ? matchedTaskIds.has(task.id) : false,
8119
+ businessDays,
8120
+ customDays,
8121
+ isWeekend: isWeekend3,
8122
+ disableTaskDrag
8123
+ },
8124
+ task.id
8125
+ ))
8126
+ ]
8127
+ }
8128
+ )
8129
+ ]
8130
+ }
8131
+ )
8117
8132
  ] })
8118
8133
  }
8119
8134
  ) });