gantt-task-react-powern 0.6.21 → 0.6.23

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.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ViewMode } from "../../types/public-types";
2
+ import { CalendarDefinition, ViewMode } from "../../types/public-types";
3
3
  import { DateSetup } from "../../types/date-setup";
4
4
  export declare type CalendarProps = {
5
5
  dateSetup: DateSetup;
@@ -10,5 +10,6 @@ export declare type CalendarProps = {
10
10
  columnWidth: number;
11
11
  fontFamily: string;
12
12
  fontSize: string;
13
+ projectCalendar?: CalendarDefinition;
13
14
  };
14
15
  export declare const Calendar: React.FC<CalendarProps>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { VirtualItem } from "@tanstack/react-virtual";
3
- import { EventOption } from "../../types/public-types";
3
+ import { CalendarDefinition, EventOption } from "../../types/public-types";
4
4
  import { BarTask } from "../../types/bar-task";
5
5
  import { GanttEvent } from "../../types/gantt-task-actions";
6
6
  export declare type TaskGanttContentProps = {
@@ -22,8 +22,10 @@ export declare type TaskGanttContentProps = {
22
22
  virtualItems?: VirtualItem[];
23
23
  visibleStartY: number;
24
24
  visibleEndY: number;
25
+ projectCalendar?: CalendarDefinition;
25
26
  setGanttEvent: (value: GanttEvent) => void;
26
27
  setFailedTask: (value: BarTask | null) => void;
27
28
  setSelectedTask: (taskId: string) => void;
29
+ onBarTasksUpdate?: (task: BarTask) => void;
28
30
  } & EventOption;
29
31
  export declare const TaskGanttContent: React.FC<TaskGanttContentProps>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { VirtualItem } from "@tanstack/react-virtual";
3
- import { Task } from "../../types/public-types";
3
+ import { CalendarDefinition, Task, ViewMode } from "../../types/public-types";
4
4
  export declare type GridBodyProps = {
5
5
  tasks: Task[];
6
6
  scheduleType: string;
@@ -14,5 +14,7 @@ export declare type GridBodyProps = {
14
14
  virtualItems?: VirtualItem[];
15
15
  visibleStartY: number;
16
16
  visibleEndY: number;
17
+ projectCalendar?: CalendarDefinition;
18
+ viewMode?: ViewMode;
17
19
  };
18
20
  export declare const GridBody: React.FC<GridBodyProps>;
@@ -22,6 +22,7 @@ export declare type TooltipProps = {
22
22
  fontFamily: string;
23
23
  type: string;
24
24
  }>;
25
+ isDragging?: boolean;
25
26
  };
26
27
  export declare const Tooltip: React.FC<TooltipProps>;
27
28
  export declare const StandardTooltipContent: React.FC<{
@@ -15,6 +15,10 @@ declare type BarDisplayProps = {
15
15
  taskId: string;
16
16
  arrowColor: string;
17
17
  }>;
18
+ segments?: Array<{
19
+ x1: number;
20
+ x2: number;
21
+ }>;
18
22
  styles: {
19
23
  taskProgressColor?: string;
20
24
  backgroundColor: string;
@@ -2,6 +2,7 @@ import { Task } from "../types/public-types";
2
2
  import { BarTask } from "../types/bar-task";
3
3
  import { BarMoveAction } from "../types/gantt-task-actions";
4
4
  export declare const convertToBarTasks: (tasks: Task[], dates: Date[], columnWidth: number, rowHeight: number, taskHeight: number, barCornerRadius: number, handleWidth: number, rtl: boolean, barProgressColor: string, barProgressSelectedColor: string, barBackgroundColor: string, barBackgroundSelectedColor: string, projectProgressColor: string, projectProgressSelectedColor: string, projectBackgroundColor: string, projectBackgroundSelectedColor: string, milestoneBackgroundColor: string, milestoneBackgroundSelectedColor: string) => BarTask[];
5
+ export declare const taskXCoordinate: (xDate: Date, dates: Date[], columnWidth: number) => number;
5
6
  export declare const progressWithByParams: (taskX1: number, taskX2: number, progress: number, rtl: boolean) => number[];
6
7
  export declare const progressByProgressWidth: (progressWidth: number, barTask: BarTask) => number;
7
8
  export declare const getProgressPoint: (progressX: number, taskY: number, taskHeight: number) => string;
@@ -0,0 +1,49 @@
1
+ import { CalendarDefinition } from "../types/public-types";
2
+ /** Parse "HH:MM" or "HH:MM:SS" into minutes since midnight. */
3
+ export declare function parseTimeToMinutes(t: string): number;
4
+ /** True if the date falls on a calendar holiday. */
5
+ export declare function isHoliday(date: Date, cal: CalendarDefinition): boolean;
6
+ /** True if the date's weekday is in off_days or is a holiday. */
7
+ export declare function isOffDay(date: Date, cal: CalendarDefinition): boolean;
8
+ /** True if the date is a regular working day (not off_day, not holiday). */
9
+ export declare function isWorkingDay(date: Date, cal: CalendarDefinition): boolean;
10
+ /**
11
+ * Returns the shift windows (in minutes since midnight) for a given date.
12
+ * Returns [] for off days / holidays.
13
+ */
14
+ export declare function getShiftsForDay(date: Date, cal: CalendarDefinition): Array<{
15
+ start: number;
16
+ end: number;
17
+ }>;
18
+ /**
19
+ * Returns all working time intervals between start and end, respecting:
20
+ * - off days and holidays (entire day skipped)
21
+ * - shift windows (multiple shifts per day are supported)
22
+ * - partial first/last days clipped to the actual start/end time
23
+ */
24
+ export declare function getWorkingIntervals(start: Date, end: Date, cal: CalendarDefinition): Array<{
25
+ start: Date;
26
+ end: Date;
27
+ }>;
28
+ /**
29
+ * Snaps a date to the nearest valid working moment.
30
+ * direction "forward" → move forward until inside a shift
31
+ * direction "backward" → move backward until inside a shift
32
+ * Searches up to 60 days to avoid infinite loops.
33
+ */
34
+ export declare function snapToWorkingTime(date: Date, cal: CalendarDefinition, direction: "forward" | "backward"): Date;
35
+ /**
36
+ * Returns the most recent week-start date on or before the given date,
37
+ * where weekStartDay is a JS day index (0=Sun, 1=Mon, ..., 6=Sat).
38
+ */
39
+ export declare function getWeekStartDate(date: Date, weekStartDay: number): Date;
40
+ /**
41
+ * Returns the quarter number (1–4) for a date, given a fiscal quarterStart month (0–11, 0=Jan).
42
+ * e.g. quarterStart=4 means Q1 starts in May.
43
+ */
44
+ export declare function getQuarterNumber(date: Date, quarterStart: number): number;
45
+ /**
46
+ * Returns the quarter start month (0-11) for a given date and fiscal quarterStart (0-indexed).
47
+ * Useful for labeling (e.g. Q1 starting in May → returns 4).
48
+ */
49
+ export declare function getQuarterStartMonth(date: Date, quarterStart: number): number;
@@ -5,7 +5,7 @@ declare type DateHelperScales = "year" | "quarter" | "month" | "day" | "hour" |
5
5
  export declare const getCachedDateTimeFormat: (locString: string | string[], opts?: DateTimeFormatOptions) => DateTimeFormat;
6
6
  export declare const addToDate: (date: Date, quantity: number, scale: DateHelperScales) => Date;
7
7
  export declare const startOfDate: (date: Date, scale: DateHelperScales) => Date;
8
- export declare const ganttDateRange: (tasks: Task[], viewMode: ViewMode, preStepsCount: number) => Date[];
8
+ export declare const ganttDateRange: (tasks: Task[], viewMode: ViewMode, preStepsCount: number, quarterStart?: number) => Date[];
9
9
  export declare const seedDates: (startDate: Date, endDate: Date, viewMode: ViewMode) => Date[];
10
10
  export declare const getLocaleMonth: (date: Date, locale: string) => string;
11
11
  export declare const getLocalDayOfWeek: (date: Date, locale: string, format?: "long" | "short" | "narrow" | undefined) => string;
package/dist/index.css CHANGED
@@ -193,6 +193,12 @@
193
193
  ._RuwuK {
194
194
  stroke: #e6e4e4;
195
195
  }
196
+
197
+ ._Zh9jh {
198
+ stroke: #d0d0d0;
199
+ stroke-dasharray: 4 4;
200
+ }
201
+
196
202
  ._2M-tt {
197
203
  fill: #e6e4e4 !important;
198
204
  }
@@ -212,6 +218,21 @@
212
218
  stroke: #e6e4e4;
213
219
  }
214
220
 
221
+ ._2X-yN {
222
+ stroke: #999;
223
+ stroke-width: 1.5;
224
+ }
225
+
226
+ ._2BaXZ {
227
+ stroke: #ccc;
228
+ stroke-width: 1;
229
+ stroke-dasharray: 3 3;
230
+ }
231
+
232
+ ._24p-y {
233
+ fill: #e6e4e4;
234
+ }
235
+
215
236
  ._2q1Kt {
216
237
  fill: #555;
217
238
  -webkit-touch-callout: none;