gantt-task-react-v 1.1.17 → 1.1.19

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.
@@ -30,6 +30,10 @@ export interface TaskGanttContentProps extends GanttTaskBarActions {
30
30
  selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
31
31
  selectedIdsMirror: Readonly<Record<string, true>>;
32
32
  onTooltipTask: (task: Task | null, element: Element | null) => void;
33
+ /**
34
+ * When true, disable interactive behaviors for task bars (drag, click, relations)
35
+ */
36
+ isLoading?: boolean;
33
37
  startColumnIndex: number;
34
38
  taskYOffset: number;
35
39
  visibleTasksMirror: Readonly<Record<string, true>>;
@@ -38,6 +38,10 @@ export type TaskListProps = {
38
38
  taskListContainerRef: RefObject<HTMLDivElement>;
39
39
  taskListRef: RefObject<HTMLDivElement>;
40
40
  tasks: readonly RenderTask[];
41
+ /**
42
+ * When true, disable user interactions on the task list (clicks, context menu)
43
+ */
44
+ isLoading?: boolean;
41
45
  onResizeColumn?: OnResizeColumn;
42
46
  tableBottom?: TableRenderBottomProps;
43
47
  };
@@ -10700,6 +10700,7 @@ const TaskListInner = ({
10700
10700
  taskListHorizontalScrollRef,
10701
10701
  taskListRef,
10702
10702
  tasks,
10703
+ isLoading = false,
10703
10704
  onResizeColumn,
10704
10705
  canReorderTasks,
10705
10706
  tableBottom
@@ -10755,7 +10756,8 @@ const TaskListInner = ({
10755
10756
  onClick,
10756
10757
  onExpanderClick,
10757
10758
  scrollToTask,
10758
- selectTaskOnMouseDown,
10759
+ selectTaskOnMouseDown: isLoading ? () => {
10760
+ } : selectTaskOnMouseDown,
10759
10761
  task,
10760
10762
  depth
10761
10763
  };
@@ -10780,6 +10782,7 @@ const TaskListInner = ({
10780
10782
  onExpanderClick,
10781
10783
  scrollToTask,
10782
10784
  selectTaskOnMouseDown,
10785
+ isLoading,
10783
10786
  selectedIdsMirror
10784
10787
  ]
10785
10788
  );
@@ -10850,7 +10853,8 @@ const TaskListInner = ({
10850
10853
  handleMoveTaskBefore,
10851
10854
  handleMoveTaskAfter,
10852
10855
  handleMoveTasksInside,
10853
- handleOpenContextMenu,
10856
+ handleOpenContextMenu: isLoading ? () => {
10857
+ } : handleOpenContextMenu,
10854
10858
  icons,
10855
10859
  isShowTaskNumbers,
10856
10860
  mapTaskToNestedIndex,
@@ -12970,6 +12974,7 @@ const TaskGanttContentInner = (props) => {
12970
12974
  selectTaskOnMouseDown,
12971
12975
  selectedIdsMirror,
12972
12976
  onTooltipTask,
12977
+ isLoading = false,
12973
12978
  startColumnIndex,
12974
12979
  taskYOffset,
12975
12980
  taskHeight,
@@ -13098,17 +13103,17 @@ const TaskGanttContentInner = (props) => {
13098
13103
  distances,
13099
13104
  taskHeight,
13100
13105
  taskHalfHeight,
13101
- isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks,
13106
+ isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks && !isLoading,
13102
13107
  isDateChangeable: (t) => isDateChangeable(t) && !waitCommitTasks,
13103
- isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks,
13108
+ isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks && !isLoading,
13104
13109
  authorizedRelations,
13105
13110
  ganttRelationEvent,
13106
- canDelete: !task.isDisabled && !waitCommitTasks,
13107
- onDoubleClick,
13108
- onClick,
13109
- onEventStart: onTaskBarDragStart,
13111
+ canDelete: !task.isDisabled && !waitCommitTasks && !isLoading,
13112
+ onDoubleClick: isLoading ? void 0 : onDoubleClick,
13113
+ onClick: isLoading ? void 0 : onClick,
13114
+ onEventStart: isLoading ? void 0 : onTaskBarDragStart,
13110
13115
  onTooltipTask,
13111
- onRelationStart: onTaskBarRelationStart,
13116
+ onRelationStart: isLoading ? void 0 : onTaskBarRelationStart,
13112
13117
  isSelected: Boolean(selectedIdsMirror[taskId]),
13113
13118
  isCritical,
13114
13119
  rtl,
@@ -13328,7 +13333,8 @@ const TaskGanttContentInner = (props) => {
13328
13333
  visibleTasksMirror,
13329
13334
  onArrowDoubleClick,
13330
13335
  showProgress,
13331
- progressColor
13336
+ progressColor,
13337
+ isLoading
13332
13338
  ]);
13333
13339
  return /* @__PURE__ */ jsxs("g", { className: "content", children: [
13334
13340
  renderedSelectedTasks,
@@ -13363,15 +13369,17 @@ const TaskGanttContentInner = (props) => {
13363
13369
  ] });
13364
13370
  };
13365
13371
  const TaskGanttContent = memo(TaskGanttContentInner);
13366
- const ganttVerticalContainer = "_ganttVerticalContainer_1wr55_1";
13367
- const horizontalContainer = "_horizontalContainer_1wr55_73";
13368
- const wrapper = "_wrapper_1wr55_85";
13369
- const calendarDragging = "_calendarDragging_1wr55_109";
13372
+ const ganttVerticalContainer = "_ganttVerticalContainer_te0hs_1";
13373
+ const horizontalContainer = "_horizontalContainer_te0hs_73";
13374
+ const wrapper = "_wrapper_te0hs_85";
13375
+ const calendarDragging = "_calendarDragging_te0hs_109";
13376
+ const loadingOverlay = "_loadingOverlay_te0hs_117";
13370
13377
  const styles$2 = {
13371
13378
  ganttVerticalContainer,
13372
13379
  horizontalContainer,
13373
13380
  wrapper,
13374
- calendarDragging
13381
+ calendarDragging,
13382
+ loadingOverlay
13375
13383
  };
13376
13384
  const TaskGanttInner = (props) => {
13377
13385
  const {
@@ -13426,7 +13434,7 @@ const TaskGanttInner = (props) => {
13426
13434
  ]
13427
13435
  );
13428
13436
  useEffect(() => {
13429
- if (!contentRef.current) {
13437
+ if (!contentRef.current || barProps.isLoading) {
13430
13438
  return () => {
13431
13439
  };
13432
13440
  }
@@ -13496,7 +13504,12 @@ const TaskGanttInner = (props) => {
13496
13504
  contentContainer.removeEventListener("mouseup", onScrollEnd);
13497
13505
  contentContainer.removeEventListener("mouseout", onScrollEnd);
13498
13506
  };
13499
- }, [verticalScrollbarRef, horizontalContainerRef, verticalGanttContainerRef]);
13507
+ }, [
13508
+ verticalScrollbarRef,
13509
+ horizontalContainerRef,
13510
+ verticalGanttContainerRef,
13511
+ barProps.isLoading
13512
+ ]);
13500
13513
  return /* @__PURE__ */ jsxs(
13501
13514
  "div",
13502
13515
  {
@@ -18001,9 +18014,9 @@ const useContextMenu = (wrapperRef, scrollToTask) => {
18001
18014
  handleOpenContextMenu
18002
18015
  };
18003
18016
  };
18004
- const menuOption = "_menuOption_1frh4_3";
18005
- const icon = "_icon_1frh4_79";
18006
- const label = "_label_1frh4_87";
18017
+ const menuOption = "_menuOption_1c3e3_3";
18018
+ const icon = "_icon_1c3e3_81";
18019
+ const label = "_label_1c3e3_89";
18007
18020
  const styles$1 = {
18008
18021
  menuOption,
18009
18022
  icon,
@@ -18093,7 +18106,7 @@ function MenuOption(props) {
18093
18106
  closeTimeoutRef.current = null;
18094
18107
  }, 200);
18095
18108
  },
18096
- style: { position: "relative" },
18109
+ style: { position: "relative", width: "100%" },
18097
18110
  children: [
18098
18111
  /* @__PURE__ */ jsxs(
18099
18112
  "button",
@@ -18986,6 +18999,7 @@ const Gantt = (props) => {
18986
18999
  showProgress = true,
18987
19000
  progressColor
18988
19001
  } = props;
19002
+ const { isLoading = false } = props;
18989
19003
  const ganttSVGRef = useRef(null);
18990
19004
  const wrapperRef = useRef(null);
18991
19005
  const taskListRef = useRef(null);
@@ -19300,6 +19314,9 @@ const Gantt = (props) => {
19300
19314
  });
19301
19315
  const handleOpenGanttContextMenu = useCallback(
19302
19316
  (task, clientX, clientY) => {
19317
+ if (isLoading) {
19318
+ return;
19319
+ }
19303
19320
  const wrapperNode = wrapperRef.current;
19304
19321
  if (!wrapperNode) {
19305
19322
  return;
@@ -19312,7 +19329,7 @@ const Gantt = (props) => {
19312
19329
  y: clientY - top
19313
19330
  });
19314
19331
  },
19315
- [wrapperRef]
19332
+ [wrapperRef, isLoading]
19316
19333
  );
19317
19334
  const handleCloseGanttContextMenu = useCallback(() => {
19318
19335
  setGanttContextMenu({
@@ -19446,6 +19463,10 @@ const Gantt = (props) => {
19446
19463
  horizontalContainerRef
19447
19464
  ]);
19448
19465
  const handleKeyDown = (event) => {
19466
+ if (isLoading) {
19467
+ event.preventDefault();
19468
+ return;
19469
+ }
19449
19470
  const { columnWidth, rowHeight: rowHeight2 } = distances;
19450
19471
  let newScrollY = scrollY;
19451
19472
  let newScrollX = scrollX;
@@ -20111,6 +20132,9 @@ const Gantt = (props) => {
20111
20132
  }, [taskList.contextMenuOptions, locale]);
20112
20133
  const handleOpenContextMenuForRow = useCallback(
20113
20134
  (task, clientX, clientY) => {
20135
+ if (isLoading) {
20136
+ return;
20137
+ }
20114
20138
  try {
20115
20139
  if (onRowContextMenu && task) {
20116
20140
  onRowContextMenu(task);
@@ -20128,7 +20152,8 @@ const Gantt = (props) => {
20128
20152
  handleOpenContextMenu,
20129
20153
  selectTask,
20130
20154
  contextMenuOptions,
20131
- selectedIdsMirror
20155
+ selectedIdsMirror,
20156
+ isLoading
20132
20157
  ]
20133
20158
  );
20134
20159
  const ganttContextMenuOptions = useMemo(() => {
@@ -20262,6 +20287,7 @@ const Gantt = (props) => {
20262
20287
  onDeleteTask: (taskForDelete) => handleDeleteTasks([taskForDelete]),
20263
20288
  onTaskBarDragStart: handleTaskDragStart,
20264
20289
  onTooltipTask: onChangeTooltipTask,
20290
+ isLoading,
20265
20291
  mapGlobalRowIndexToTask,
20266
20292
  onArrowDoubleClick,
20267
20293
  renderedRowIndexes,
@@ -20314,7 +20340,8 @@ const Gantt = (props) => {
20314
20340
  changeInProgress == null ? void 0 : changeInProgress.action,
20315
20341
  handleDeleteTasks,
20316
20342
  showProgress,
20317
- progressColor
20343
+ progressColor,
20344
+ isLoading
20318
20345
  ]
20319
20346
  );
20320
20347
  const renderTaskListProps = useMemo(
@@ -20347,7 +20374,8 @@ const Gantt = (props) => {
20347
20374
  taskListContainerRef,
20348
20375
  taskListRef,
20349
20376
  tasks: visibleTasks,
20350
- ganttRef: wrapperRef
20377
+ ganttRef: wrapperRef,
20378
+ isLoading
20351
20379
  }),
20352
20380
  [
20353
20381
  childTasksMap,
@@ -20375,6 +20403,7 @@ const Gantt = (props) => {
20375
20403
  selectTaskOnMouseDown,
20376
20404
  selectedIdsMirror,
20377
20405
  taskList,
20406
+ isLoading,
20378
20407
  taskListContainerRef,
20379
20408
  visibleTasks
20380
20409
  ]
@@ -20389,13 +20418,22 @@ const Gantt = (props) => {
20389
20418
  ref: wrapperRef,
20390
20419
  "data-testid": "gantt",
20391
20420
  children: [
20392
- (!columnsProp || columnsProp.length > 0) && /* @__PURE__ */ jsx(
20393
- TaskList,
20394
- {
20395
- ...renderTaskListProps,
20396
- taskListHorizontalScrollRef
20397
- }
20398
- ),
20421
+ (!columnsProp || columnsProp.length > 0) && /* @__PURE__ */ jsxs(Fragment, { children: [
20422
+ (isLoading || waitCommitTasks) && /* @__PURE__ */ jsx(
20423
+ "div",
20424
+ {
20425
+ className: styles$2.loadingOverlay,
20426
+ "data-testid": "gantt-loading-overlay"
20427
+ }
20428
+ ),
20429
+ /* @__PURE__ */ jsx(
20430
+ TaskList,
20431
+ {
20432
+ ...renderTaskListProps,
20433
+ taskListHorizontalScrollRef
20434
+ }
20435
+ )
20436
+ ] }),
20399
20437
  /* @__PURE__ */ jsx(
20400
20438
  TaskGantt,
20401
20439
  {
@@ -10717,6 +10717,7 @@
10717
10717
  taskListHorizontalScrollRef,
10718
10718
  taskListRef,
10719
10719
  tasks,
10720
+ isLoading = false,
10720
10721
  onResizeColumn,
10721
10722
  canReorderTasks,
10722
10723
  tableBottom
@@ -10772,7 +10773,8 @@
10772
10773
  onClick,
10773
10774
  onExpanderClick,
10774
10775
  scrollToTask,
10775
- selectTaskOnMouseDown,
10776
+ selectTaskOnMouseDown: isLoading ? () => {
10777
+ } : selectTaskOnMouseDown,
10776
10778
  task,
10777
10779
  depth
10778
10780
  };
@@ -10797,6 +10799,7 @@
10797
10799
  onExpanderClick,
10798
10800
  scrollToTask,
10799
10801
  selectTaskOnMouseDown,
10802
+ isLoading,
10800
10803
  selectedIdsMirror
10801
10804
  ]
10802
10805
  );
@@ -10867,7 +10870,8 @@
10867
10870
  handleMoveTaskBefore,
10868
10871
  handleMoveTaskAfter,
10869
10872
  handleMoveTasksInside,
10870
- handleOpenContextMenu,
10873
+ handleOpenContextMenu: isLoading ? () => {
10874
+ } : handleOpenContextMenu,
10871
10875
  icons,
10872
10876
  isShowTaskNumbers,
10873
10877
  mapTaskToNestedIndex,
@@ -12987,6 +12991,7 @@
12987
12991
  selectTaskOnMouseDown,
12988
12992
  selectedIdsMirror,
12989
12993
  onTooltipTask,
12994
+ isLoading = false,
12990
12995
  startColumnIndex,
12991
12996
  taskYOffset,
12992
12997
  taskHeight,
@@ -13115,17 +13120,17 @@
13115
13120
  distances,
13116
13121
  taskHeight,
13117
13122
  taskHalfHeight,
13118
- isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks,
13123
+ isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks && !isLoading,
13119
13124
  isDateChangeable: (t) => isDateChangeable(t) && !waitCommitTasks,
13120
- isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks,
13125
+ isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks && !isLoading,
13121
13126
  authorizedRelations,
13122
13127
  ganttRelationEvent,
13123
- canDelete: !task.isDisabled && !waitCommitTasks,
13124
- onDoubleClick,
13125
- onClick,
13126
- onEventStart: onTaskBarDragStart,
13128
+ canDelete: !task.isDisabled && !waitCommitTasks && !isLoading,
13129
+ onDoubleClick: isLoading ? void 0 : onDoubleClick,
13130
+ onClick: isLoading ? void 0 : onClick,
13131
+ onEventStart: isLoading ? void 0 : onTaskBarDragStart,
13127
13132
  onTooltipTask,
13128
- onRelationStart: onTaskBarRelationStart,
13133
+ onRelationStart: isLoading ? void 0 : onTaskBarRelationStart,
13129
13134
  isSelected: Boolean(selectedIdsMirror[taskId]),
13130
13135
  isCritical,
13131
13136
  rtl,
@@ -13345,7 +13350,8 @@
13345
13350
  visibleTasksMirror,
13346
13351
  onArrowDoubleClick,
13347
13352
  showProgress,
13348
- progressColor
13353
+ progressColor,
13354
+ isLoading
13349
13355
  ]);
13350
13356
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "content", children: [
13351
13357
  renderedSelectedTasks,
@@ -13380,15 +13386,17 @@
13380
13386
  ] });
13381
13387
  };
13382
13388
  const TaskGanttContent = React.memo(TaskGanttContentInner);
13383
- const ganttVerticalContainer = "_ganttVerticalContainer_1wr55_1";
13384
- const horizontalContainer = "_horizontalContainer_1wr55_73";
13385
- const wrapper = "_wrapper_1wr55_85";
13386
- const calendarDragging = "_calendarDragging_1wr55_109";
13389
+ const ganttVerticalContainer = "_ganttVerticalContainer_te0hs_1";
13390
+ const horizontalContainer = "_horizontalContainer_te0hs_73";
13391
+ const wrapper = "_wrapper_te0hs_85";
13392
+ const calendarDragging = "_calendarDragging_te0hs_109";
13393
+ const loadingOverlay = "_loadingOverlay_te0hs_117";
13387
13394
  const styles$2 = {
13388
13395
  ganttVerticalContainer,
13389
13396
  horizontalContainer,
13390
13397
  wrapper,
13391
- calendarDragging
13398
+ calendarDragging,
13399
+ loadingOverlay
13392
13400
  };
13393
13401
  const TaskGanttInner = (props) => {
13394
13402
  const {
@@ -13443,7 +13451,7 @@
13443
13451
  ]
13444
13452
  );
13445
13453
  React.useEffect(() => {
13446
- if (!contentRef.current) {
13454
+ if (!contentRef.current || barProps.isLoading) {
13447
13455
  return () => {
13448
13456
  };
13449
13457
  }
@@ -13513,7 +13521,12 @@
13513
13521
  contentContainer.removeEventListener("mouseup", onScrollEnd);
13514
13522
  contentContainer.removeEventListener("mouseout", onScrollEnd);
13515
13523
  };
13516
- }, [verticalScrollbarRef, horizontalContainerRef, verticalGanttContainerRef]);
13524
+ }, [
13525
+ verticalScrollbarRef,
13526
+ horizontalContainerRef,
13527
+ verticalGanttContainerRef,
13528
+ barProps.isLoading
13529
+ ]);
13517
13530
  return /* @__PURE__ */ jsxRuntime.jsxs(
13518
13531
  "div",
13519
13532
  {
@@ -18018,9 +18031,9 @@
18018
18031
  handleOpenContextMenu
18019
18032
  };
18020
18033
  };
18021
- const menuOption = "_menuOption_1frh4_3";
18022
- const icon = "_icon_1frh4_79";
18023
- const label = "_label_1frh4_87";
18034
+ const menuOption = "_menuOption_1c3e3_3";
18035
+ const icon = "_icon_1c3e3_81";
18036
+ const label = "_label_1c3e3_89";
18024
18037
  const styles$1 = {
18025
18038
  menuOption,
18026
18039
  icon,
@@ -18110,7 +18123,7 @@
18110
18123
  closeTimeoutRef.current = null;
18111
18124
  }, 200);
18112
18125
  },
18113
- style: { position: "relative" },
18126
+ style: { position: "relative", width: "100%" },
18114
18127
  children: [
18115
18128
  /* @__PURE__ */ jsxRuntime.jsxs(
18116
18129
  "button",
@@ -19003,6 +19016,7 @@
19003
19016
  showProgress = true,
19004
19017
  progressColor
19005
19018
  } = props;
19019
+ const { isLoading = false } = props;
19006
19020
  const ganttSVGRef = React.useRef(null);
19007
19021
  const wrapperRef = React.useRef(null);
19008
19022
  const taskListRef = React.useRef(null);
@@ -19317,6 +19331,9 @@
19317
19331
  });
19318
19332
  const handleOpenGanttContextMenu = React.useCallback(
19319
19333
  (task, clientX, clientY) => {
19334
+ if (isLoading) {
19335
+ return;
19336
+ }
19320
19337
  const wrapperNode = wrapperRef.current;
19321
19338
  if (!wrapperNode) {
19322
19339
  return;
@@ -19329,7 +19346,7 @@
19329
19346
  y: clientY - top
19330
19347
  });
19331
19348
  },
19332
- [wrapperRef]
19349
+ [wrapperRef, isLoading]
19333
19350
  );
19334
19351
  const handleCloseGanttContextMenu = React.useCallback(() => {
19335
19352
  setGanttContextMenu({
@@ -19463,6 +19480,10 @@
19463
19480
  horizontalContainerRef
19464
19481
  ]);
19465
19482
  const handleKeyDown = (event) => {
19483
+ if (isLoading) {
19484
+ event.preventDefault();
19485
+ return;
19486
+ }
19466
19487
  const { columnWidth, rowHeight: rowHeight2 } = distances;
19467
19488
  let newScrollY = scrollY;
19468
19489
  let newScrollX = scrollX;
@@ -20128,6 +20149,9 @@
20128
20149
  }, [taskList.contextMenuOptions, locale]);
20129
20150
  const handleOpenContextMenuForRow = React.useCallback(
20130
20151
  (task, clientX, clientY) => {
20152
+ if (isLoading) {
20153
+ return;
20154
+ }
20131
20155
  try {
20132
20156
  if (onRowContextMenu && task) {
20133
20157
  onRowContextMenu(task);
@@ -20145,7 +20169,8 @@
20145
20169
  handleOpenContextMenu,
20146
20170
  selectTask,
20147
20171
  contextMenuOptions,
20148
- selectedIdsMirror
20172
+ selectedIdsMirror,
20173
+ isLoading
20149
20174
  ]
20150
20175
  );
20151
20176
  const ganttContextMenuOptions = React.useMemo(() => {
@@ -20279,6 +20304,7 @@
20279
20304
  onDeleteTask: (taskForDelete) => handleDeleteTasks([taskForDelete]),
20280
20305
  onTaskBarDragStart: handleTaskDragStart,
20281
20306
  onTooltipTask: onChangeTooltipTask,
20307
+ isLoading,
20282
20308
  mapGlobalRowIndexToTask,
20283
20309
  onArrowDoubleClick,
20284
20310
  renderedRowIndexes,
@@ -20331,7 +20357,8 @@
20331
20357
  changeInProgress == null ? void 0 : changeInProgress.action,
20332
20358
  handleDeleteTasks,
20333
20359
  showProgress,
20334
- progressColor
20360
+ progressColor,
20361
+ isLoading
20335
20362
  ]
20336
20363
  );
20337
20364
  const renderTaskListProps = React.useMemo(
@@ -20364,7 +20391,8 @@
20364
20391
  taskListContainerRef,
20365
20392
  taskListRef,
20366
20393
  tasks: visibleTasks,
20367
- ganttRef: wrapperRef
20394
+ ganttRef: wrapperRef,
20395
+ isLoading
20368
20396
  }),
20369
20397
  [
20370
20398
  childTasksMap,
@@ -20392,6 +20420,7 @@
20392
20420
  selectTaskOnMouseDown,
20393
20421
  selectedIdsMirror,
20394
20422
  taskList,
20423
+ isLoading,
20395
20424
  taskListContainerRef,
20396
20425
  visibleTasks
20397
20426
  ]
@@ -20406,13 +20435,22 @@
20406
20435
  ref: wrapperRef,
20407
20436
  "data-testid": "gantt",
20408
20437
  children: [
20409
- (!columnsProp || columnsProp.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
20410
- TaskList,
20411
- {
20412
- ...renderTaskListProps,
20413
- taskListHorizontalScrollRef
20414
- }
20415
- ),
20438
+ (!columnsProp || columnsProp.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20439
+ (isLoading || waitCommitTasks) && /* @__PURE__ */ jsxRuntime.jsx(
20440
+ "div",
20441
+ {
20442
+ className: styles$2.loadingOverlay,
20443
+ "data-testid": "gantt-loading-overlay"
20444
+ }
20445
+ ),
20446
+ /* @__PURE__ */ jsxRuntime.jsx(
20447
+ TaskList,
20448
+ {
20449
+ ...renderTaskListProps,
20450
+ taskListHorizontalScrollRef
20451
+ }
20452
+ )
20453
+ ] }),
20416
20454
  /* @__PURE__ */ jsxRuntime.jsx(
20417
20455
  TaskGantt,
20418
20456
  {
package/dist/style.css CHANGED
@@ -578,7 +578,7 @@
578
578
  user-select: none;
579
579
  stroke-width: 0;
580
580
  }
581
- ._ganttVerticalContainer_1wr55_1 {
581
+ ._ganttVerticalContainer_te0hs_1 {
582
582
  overflow-x: scroll;
583
583
  overflow-y: hidden;
584
584
  font-size: 0;
@@ -590,16 +590,16 @@
590
590
  height: 100%;
591
591
  }
592
592
 
593
- ._ganttVerticalContainer_1wr55_1::-webkit-scrollbar {
593
+ ._ganttVerticalContainer_te0hs_1::-webkit-scrollbar {
594
594
  width: 1rem;
595
595
  height: 1rem;
596
596
  }
597
597
 
598
- ._ganttVerticalContainer_1wr55_1::-webkit-scrollbar-corner {
598
+ ._ganttVerticalContainer_te0hs_1::-webkit-scrollbar-corner {
599
599
  background: transparent;
600
600
  }
601
601
 
602
- ._ganttVerticalContainer_1wr55_1::-webkit-scrollbar-thumb {
602
+ ._ganttVerticalContainer_te0hs_1::-webkit-scrollbar-thumb {
603
603
  border: 4px solid transparent;
604
604
  /*noinspection CssUnresolvedCustomProperty*/
605
605
  background: var(--gantt-scrollbar-thumb-color);
@@ -607,20 +607,20 @@
607
607
  background-clip: padding-box;
608
608
  }
609
609
 
610
- ._ganttVerticalContainer_1wr55_1::-webkit-scrollbar-thumb:hover {
610
+ ._ganttVerticalContainer_te0hs_1::-webkit-scrollbar-thumb:hover {
611
611
  border: 2px solid transparent;
612
612
  /*noinspection CssUnresolvedCustomProperty*/
613
613
  background: var(--gantt-scrollbar-thumb-color);
614
614
  background-clip: padding-box;
615
615
  }
616
616
 
617
- ._horizontalContainer_1wr55_73 {
617
+ ._horizontalContainer_te0hs_73 {
618
618
  margin: 0;
619
619
  padding: 0;
620
620
  overflow: hidden;
621
621
  }
622
622
 
623
- ._wrapper_1wr55_85 {
623
+ ._wrapper_te0hs_85 {
624
624
  display: flex;
625
625
  padding: 0;
626
626
  margin: 0;
@@ -632,11 +632,19 @@
632
632
  border-bottom: 1px solid var(--gantt-divider-color);
633
633
  }
634
634
 
635
- ._calendarDragging_1wr55_109 {
635
+ ._calendarDragging_te0hs_109 {
636
636
  cursor: grabbing;
637
637
  }
638
+
639
+ ._loadingOverlay_te0hs_117 {
640
+ position: absolute;
641
+ inset: 0;
642
+ background: rgba(255, 255, 255, 0.6);
643
+ z-index: 9999;
644
+ pointer-events: auto;
645
+ }
638
646
  /*noinspection CssUnresolvedCustomProperty*/
639
- ._menuOption_1frh4_3 {
647
+ ._menuOption_1c3e3_3 {
640
648
  display: flex;
641
649
  align-items: center;
642
650
  text-align: left;
@@ -644,6 +652,7 @@
644
652
  background-color: #fff;
645
653
  cursor: pointer;
646
654
  font-size: 16px;
655
+ width: 100%;
647
656
  min-width: 120px;
648
657
  border: none;
649
658
  padding-block: unset;
@@ -653,32 +662,32 @@
653
662
  fill: var(--gantt-table-action-color);
654
663
  }
655
664
 
656
- ._menuOption_1frh4_3 svg {
665
+ ._menuOption_1c3e3_3 svg {
657
666
  width: 20px;
658
667
  height: 20px;
659
668
  }
660
669
 
661
- ._menuOption_1frh4_3:hover {
670
+ ._menuOption_1c3e3_3:hover {
662
671
  background-color: #eeeeee;
663
672
  }
664
673
 
665
- ._menuOption_1frh4_3[aria-disabled="true"],
666
- ._menuOption_1frh4_3:disabled {
674
+ ._menuOption_1c3e3_3[aria-disabled="true"],
675
+ ._menuOption_1c3e3_3:disabled {
667
676
  opacity: 0.6;
668
677
  cursor: default;
669
678
  background-color: transparent;
670
679
  }
671
680
 
672
- ._menuOption_1frh4_3[aria-disabled="true"]:hover,
673
- ._menuOption_1frh4_3:disabled:hover {
681
+ ._menuOption_1c3e3_3[aria-disabled="true"]:hover,
682
+ ._menuOption_1c3e3_3:disabled:hover {
674
683
  background-color: transparent;
675
684
  }
676
685
 
677
- ._icon_1frh4_79 {
686
+ ._icon_1c3e3_81 {
678
687
  font-size: inherit;
679
688
  }
680
689
 
681
- ._label_1frh4_87 {
690
+ ._label_1c3e3_89 {
682
691
  flex: 1;
683
692
  }
684
693
  /* HTML: <div class="loader"></div> */
@@ -368,6 +368,12 @@ export interface GanttProps {
368
368
  * Custom color for progress bars. If not provided, theme progress colors are used.
369
369
  */
370
370
  progressColor?: string;
371
+ /**
372
+ * When true, disables user interactions with the gantt and task list and
373
+ * shows a loading/disabled state. Useful while external updates are in
374
+ * progress to prevent rapid user actions.
375
+ */
376
+ isLoading?: boolean;
371
377
  }
372
378
  export interface GanttTaskBarActions {
373
379
  allowMoveTaskBar?: (action: TaskBarMoveAction, task: RenderTask) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "description": "Interactive Gantt Chart for React with TypeScript.",
5
5
  "author": "aguilanbon",
6
6
  "homepage": "https://github.com/aguilanbon/gantt-task-react-v",