gantt-lib 0.0.1
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.css.map +1 -0
- package/dist/index.d.mts +376 -0
- package/dist/index.d.ts +376 -0
- package/dist/index.js +1058 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1001 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +531 -0
- package/package.json +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/styles.css","../src/components/TimeScaleHeader/TimeScaleHeader.css","../src/components/TaskRow/TaskRow.css","../src/components/TodayIndicator/TodayIndicator.css","../src/components/GridBackground/GridBackground.css","../src/components/DragGuideLines/DragGuideLines.css","../src/components/GanttChart/GanttChart.css"],"sourcesContent":["/* Gantt Chart CSS Variables - User customizable theming */\n:root {\n /* Grid Colors */\n --gantt-grid-line-color: #e0e0e0;\n --gantt-cell-background: #ffffff;\n --gantt-row-hover-background: #f8f9fa;\n\n /* Dimensions */\n --gantt-row-height: 30px;\n --gantt-header-height: 40px;\n --gantt-day-width: 30px;\n\n /* Task Bar Styling */\n --gantt-task-bar-default-color: #3b82f6;\n --gantt-task-bar-text-color: #ffffff;\n --gantt-task-bar-border-radius: 4px;\n --gantt-task-bar-height: 24px;\n\n /* Today Indicator */\n --gantt-today-indicator-color: rgba(255, 0, 0, 0.2);\n --gantt-today-indicator-width: 2px;\n\n /* Calendar Grid - Weekend */\n --gantt-weekend-background: #fff9f8;\n --gantt-weekend-border: #fca5a5;\n\n /* Calendar Grid - Separators */\n --gantt-month-separator-width: 2px;\n --gantt-month-separator-color: #a1a1a1;\n --gantt-week-separator-width: 1px;\n --gantt-week-separator-color: #f3f4f6;\n --gantt-day-line-width: 1px;\n --gantt-day-line-color: #f3f4f6;\n}\n\n/* GanttChart Component Styles */\n.gantt-container {\n width: 100%;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n border: 1px solid var(--gantt-grid-line-color, #e0e0e0);\n background-color: var(--gantt-cell-background, #ffffff);\n}\n\n.gantt-scrollContainer {\n overflow: auto;\n}\n\n.gantt-stickyHeader {\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--gantt-cell-background, #ffffff);\n border-bottom: 1px solid var(--gantt-grid-line-color, #e0e0e0);\n}\n\n.gantt-taskArea {\n position: relative;\n background-color: var(--gantt-cell-background, #ffffff);\n}\n\n/* TaskRow Component Styles */\n.gantt-tr-row {\n position: relative;\n width: 100%;\n border-bottom: 1px solid var(--gantt-grid-line-color);\n box-sizing: border-box;\n}\n\n.gantt-tr-row:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.gantt-tr-taskBar {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n border-radius: var(--gantt-task-bar-border-radius);\n display: flex;\n align-items: center;\n padding: 0 0.5rem;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: visible;\n cursor: grab;\n}\n\n.gantt-tr-taskBar:hover {\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n}\n\n.gantt-tr-taskBar.gantt-tr-dragging {\n cursor: grabbing;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n opacity: 1;\n transition: none !important;\n}\n\n.gantt-tr-taskName {\n color: var(--gantt-task-bar-text-color);\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n.gantt-tr-taskDuration {\n color: var(--gantt-task-bar-text-color);\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n margin-right: 4px;\n}\n\n.gantt-tr-taskNameHidden {\n visibility: hidden;\n}\n\n.gantt-tr-rightLabels {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n gap: 4px;\n pointer-events: none;\n}\n\n.gantt-tr-dateLabelRight {\n position: static;\n margin-right: 0;\n}\n\n.gantt-tr-externalTaskName {\n font-size: 0.9rem;\n font-weight: 500;\n color: #00389f;\n white-space: nowrap;\n user-select: none;\n margin-left: 4px;\n}\n\n.gantt-tr-resizeHandle {\n position: absolute;\n top: 0;\n width: 8px;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.1);\n cursor: ew-resize;\n}\n\n.gantt-tr-resizeHandleLeft {\n left: 0;\n}\n\n.gantt-tr-resizeHandleRight {\n right: 0;\n}\n\n.gantt-tr-resizeZoneLeft {\n cursor: ew-resize;\n}\n\n.gantt-tr-resizeZoneRight {\n cursor: ew-resize;\n}\n\n.gantt-tr-taskContainer {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.gantt-tr-leftLabels {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n pointer-events: none;\n}\n\n.gantt-tr-dateLabel {\n font-size: 0.85rem;\n color: #666666;\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n}\n\n.gantt-tr-dateLabelLeft {\n position: absolute;\n right: 100%;\n margin-right: 6px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n/* TimeScaleHeader Component Styles - Two-row header layout */\n.gantt-tsh-header {\n display: flex;\n flex-direction: column;\n background-color: var(--gantt-cell-background);\n border-bottom: var(--gantt-week-separator-width, 1px) solid var(--gantt-week-separator-color, #374151);\n box-sizing: border-box;\n}\n\n.gantt-tsh-monthRow {\n display: flex;\n border-bottom: var(--gantt-day-line-width, 1px) solid var(--gantt-day-line-color, #f3f4f6);\n align-items: center;\n}\n\n.gantt-tsh-monthCell {\n box-sizing: border-box;\n padding: 0.1rem 0.5rem;\n font-size: 0.75rem;\n font-weight: 600;\n color: #1f2937;\n border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);\n text-align: left;\n}\n\n.gantt-tsh-monthCell:first-child {\n border-left: none;\n}\n\n.gantt-tsh-dayRow {\n display: grid;\n box-sizing: border-box;\n}\n\n.gantt-tsh-dayCell {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.gantt-tsh-monthBoundary {\n border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);\n}\n\n.gantt-tsh-dayLabel {\n font-size: 0.75rem;\n font-weight: 500;\n color: #374151;\n}\n\n.gantt-tsh-weekendDay {\n background-color: var(--gantt-weekend-background, #fee2e2);\n}\n\n.gantt-tsh-weekendDay .gantt-tsh-dayLabel {\n color: #dc2626;\n}\n\n.gantt-tsh-today {\n background-color: #dc2626;\n border-radius: 0 4px 4px 0;\n}\n\n.gantt-tsh-today .gantt-tsh-dayLabel {\n color: #ffffff;\n}\n\n/* GridBackground Component Styles */\n.gantt-gb-gridBackground {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 0;\n pointer-events: none;\n}\n\n.gantt-gb-weekendBlock {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: var(--gantt-weekend-background, #fee2e2);\n}\n\n.gantt-gb-gridLine {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: var(--gantt-day-line-color, #f3f4f6);\n}\n\n.gantt-gb-monthSeparator {\n width: var(--gantt-month-separator-width, 2px);\n background-color: var(--gantt-month-separator-color, #374151);\n}\n\n.gantt-gb-weekSeparator {\n width: var(--gantt-week-separator-width, 1px);\n background-color: var(--gantt-week-separator-color, #d1d5db);\n}\n\n.gantt-gb-dayLine {\n width: var(--gantt-day-line-width, 1px);\n background-color: var(--gantt-day-line-color, #f3f4f6);\n}\n\n/* TodayIndicator Component Styles */\n.gantt-ti-indicator {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 5;\n pointer-events: none;\n}\n\n/* DragGuideLines Component Styles */\n.gantt-dgl-guideLine {\n position: absolute;\n top: 0;\n width: 2px;\n background-color: var(--gantt-drag-guide-line-color, #3b82f6);\n z-index: 20;\n pointer-events: none;\n opacity: 0.6;\n}\n","/**\n * TimeScaleHeader Component Styles - Two-row header layout\n */\n\n.gantt-tsh-header {\n display: flex;\n flex-direction: column;\n background-color: var(--gantt-cell-background);\n border-bottom: var(--gantt-week-separator-width, 1px) solid var(--gantt-week-separator-color, #374151);\n box-sizing: border-box;\n}\n\n/* Month row (top row) */\n.gantt-tsh-monthRow {\n display: flex;\n border-bottom: var(--gantt-day-line-width, 1px) solid var(--gantt-day-line-color, #f3f4f6);\n align-items: center;\n}\n\n.gantt-tsh-monthCell {\n box-sizing: border-box;\n padding: 0.1rem 0.5rem;\n font-size: 0.75rem;\n font-weight: 600;\n color: #1f2937;\n border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);\n text-align: left;\n}\n\n.gantt-tsh-monthCell:first-child {\n border-left: none;\n}\n\n/* Day row (bottom row) */\n.gantt-tsh-dayRow {\n display: grid;\n box-sizing: border-box;\n}\n\n.gantt-tsh-dayCell {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.gantt-tsh-monthBoundary {\n border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);\n}\n\n.gantt-tsh-dayLabel {\n font-size: 0.75rem;\n font-weight: 500;\n color: #374151;\n}\n\n.gantt-tsh-weekendDay {\n background-color: var(--gantt-weekend-background, #fee2e2);\n}\n\n.gantt-tsh-weekendDay .gantt-tsh-dayLabel {\n color: #dc2626;\n}\n\n.gantt-tsh-today {\n background-color: #dc2626;\n border-radius: 0 4px 4px 0;\n}\n\n.gantt-tsh-today .gantt-tsh-dayLabel {\n color: #ffffff;\n}\n","/**\n * TaskRow Component Styles\n */\n\n.gantt-tr-row {\n position: relative;\n width: 100%;\n border-bottom: 1px solid var(--gantt-grid-line-color);\n box-sizing: border-box;\n}\n\n.gantt-tr-row:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.gantt-tr-taskBar {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n border-radius: var(--gantt-task-bar-border-radius);\n display: flex;\n align-items: center;\n padding: 0 0.5rem;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: visible;\n /* transition: box-shadow 0.15s ease; */\n cursor: grab;\n}\n\n/**\n * Hover state - provides smooth visual feedback\n * Transition disabled during drag (see .gantt-tr-taskBar.gantt-tr-dragging)\n */\n.gantt-tr-taskBar:hover {\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); */\n}\n\n/**\n * Dragging state - disables all transitions for performance\n *\n * CRITICAL: transition: none !important is required to override the\n * default box-shadow transition on .gantt-tr-taskBar. Without this, CSS transitions\n * during drag cause lag/ghosting and break the 60fps performance target.\n *\n * Per research anti-pattern: \"Using CSS transitions during drag causes lag/ghosting.\"\n */\n.gantt-tr-taskBar.gantt-tr-dragging {\n cursor: grabbing;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n opacity: 1;\n transition: none !important;\n}\n\n.gantt-tr-taskName {\n color: var(--gantt-task-bar-text-color);\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n.gantt-tr-taskDuration {\n color: var(--gantt-task-bar-text-color);\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n margin-right: 4px;\n}\n\n.gantt-tr-taskNameHidden {\n visibility: hidden;\n}\n\n.gantt-tr-rightLabels {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n gap: 4px;\n pointer-events: none;\n}\n\n.gantt-tr-dateLabelRight {\n position: static;\n margin-right: 0;\n}\n\n.gantt-tr-externalTaskName {\n font-size: 0.9rem;\n font-weight: 500;\n color: #00389f;\n white-space: nowrap;\n user-select: none;\n margin-left: 4px;\n}\n\n.gantt-tr-resizeHandle {\n position: absolute;\n top: 0;\n width: 8px;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.1);\n cursor: ew-resize;\n}\n\n.gantt-tr-resizeHandleLeft {\n left: 0;\n}\n\n.gantt-tr-resizeHandleRight {\n right: 0;\n}\n\n.gantt-tr-resizeZoneLeft {\n cursor: ew-resize;\n}\n\n.gantt-tr-resizeZoneRight {\n cursor: ew-resize;\n}\n\n.gantt-tr-taskContainer {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.gantt-tr-leftLabels {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n pointer-events: none;\n}\n\n.gantt-tr-dateLabel {\n font-size: 0.85rem;\n color: #666666;\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n}\n\n.gantt-tr-dateLabelLeft {\n position: absolute;\n right: 100%;\n margin-right: 6px;\n top: 50%;\n transform: translateY(-50%);\n}\n","/**\n * TodayIndicator Component Styles\n */\n\n.gantt-ti-indicator {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 5;\n pointer-events: none;\n}\n",".gantt-gb-gridBackground {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 0;\n pointer-events: none;\n}\n\n.gantt-gb-weekendBlock {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: var(--gantt-weekend-background, #fee2e2);\n}\n\n.gantt-gb-gridLine {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: var(--gantt-day-line-color, #f3f4f6);\n}\n\n.gantt-gb-monthSeparator {\n width: var(--gantt-month-separator-width, 2px);\n background-color: var(--gantt-month-separator-color, #374151);\n}\n\n.gantt-gb-weekSeparator {\n width: var(--gantt-week-separator-width, 1px);\n background-color: var(--gantt-week-separator-color, #d1d5db);\n}\n\n.gantt-gb-dayLine {\n width: var(--gantt-day-line-width, 1px);\n background-color: var(--gantt-day-line-color, #f3f4f6);\n}\n",".gantt-dgl-guideLine {\n position: absolute;\n top: 0;\n width: 2px;\n background-color: var(--gantt-drag-guide-line-color, #3b82f6);\n z-index: 20;\n pointer-events: none;\n opacity: 0.6;\n}\n",".gantt-container {\r\n width: 100%;\r\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\r\n border: 1px solid var(--gantt-grid-line-color, #e0e0e0);\r\n background-color: var(--gantt-cell-background, #ffffff);\r\n}\r\n\r\n.gantt-scrollContainer {\r\n overflow: auto;\r\n}\r\n\r\n.gantt-stickyHeader {\r\n position: sticky;\r\n top: 0;\r\n z-index: 10;\r\n background-color: var(--gantt-cell-background, #ffffff);\r\n border-bottom: 1px solid var(--gantt-grid-line-color, #e0e0e0);\r\n}\r\n\r\n.gantt-taskArea {\r\n position: relative;\r\n background-color: var(--gantt-cell-background, #ffffff);\r\n}\r\n"],"mappings":";AACA;AAEE,2BAAyB;AACzB,2BAAyB;AACzB,gCAA8B;AAG9B,sBAAoB;AACpB,yBAAuB;AACvB,qBAAmB;AAGnB,kCAAgC;AAChC,+BAA6B;AAC7B,kCAAgC;AAChC,2BAAyB;AAGzB,iCAA+B,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE;AAC/C,iCAA+B;AAG/B,8BAA4B;AAC5B,0BAAwB;AAGxB,iCAA+B;AAC/B,iCAA+B;AAC/B,gCAA8B;AAC9B,gCAA8B;AAC9B,0BAAwB;AACxB,0BAAwB;AAC1B;AAGA,CAAC;AACC,SAAO;AACP;AAAA,IAAa,SAAS;AAAA,IAAE,aAAa;AAAA,IAAE,kBAAkB;AAAA,IAAE,UAAU;AAAA,IAAE,MAAM;AAAA,IAAE;AAC/E,UAAQ,IAAI,MAAM,IAAI,uBAAuB,EAAE;AAC/C,oBAAkB,IAAI,uBAAuB,EAAE;AACjD;AAEA,CAAC;AACC,YAAU;AACZ;AAEA,CAAC;AACC,YAAU;AACV,OAAK;AACL,WAAS;AACT,oBAAkB,IAAI,uBAAuB,EAAE;AAC/C,iBAAe,IAAI,MAAM,IAAI,uBAAuB,EAAE;AACxD;AAEA,CAAC;AACC,YAAU;AACV,oBAAkB,IAAI,uBAAuB,EAAE;AACjD;AAGA,CAAC;AACC,YAAU;AACV,SAAO;AACP,iBAAe,IAAI,MAAM,IAAI;AAC7B,cAAY;AACd;AAEA,CAPC,YAOY;AACX,oBAAkB,KAAK,CA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AE,kBAAkB;AAAA,IAAE,UAAU;AAAA,IAAE,MAAM;AAAA,IAAE;AAC/E,UAAQ,IAAI,MAAM,IAAI,uBAAuB,EAAE;AAC/C,oBAAkB,IAAI,uBAAuB,EAAE;AACjD;AAEA,CAAC;AACC,YAAU;AACZ;AAEA,CAAC;AACC,YAAU;AACV,OAAK;AACL,WAAS;AACT,oBAAkB,IAAI,uBAAuB,EAAE;AAC/C,iBAAe,IAAI,MAAM,IAAI,uBAAuB,EAAE;AACxD;AAEA,CAAC;AACC,YAAU;AACV,oBAAkB,IAAI,uBAAuB,EAAE;AACjD;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Task data structure for Gantt chart
|
|
5
|
+
*/
|
|
6
|
+
interface Task {
|
|
7
|
+
/** Unique identifier for the task */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Display name of the task */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Task start date (ISO string or Date object) */
|
|
12
|
+
startDate: string | Date;
|
|
13
|
+
/** Task end date (ISO string or Date object) */
|
|
14
|
+
endDate: string | Date;
|
|
15
|
+
/** Optional color for task bar visualization */
|
|
16
|
+
color?: string;
|
|
17
|
+
}
|
|
18
|
+
interface GanttChartProps {
|
|
19
|
+
/** Array of tasks to display */
|
|
20
|
+
tasks: Task[];
|
|
21
|
+
/** Width of each day column in pixels (default: 40) */
|
|
22
|
+
dayWidth?: number;
|
|
23
|
+
/** Height of each task row in pixels (default: 40) */
|
|
24
|
+
rowHeight?: number;
|
|
25
|
+
/** Height of the header row in pixels (default: 40) */
|
|
26
|
+
headerHeight?: number;
|
|
27
|
+
/** Container height in pixels (default: 600) - adds vertical scrolling when tasks exceed this height */
|
|
28
|
+
containerHeight?: number;
|
|
29
|
+
/** Callback when tasks are modified via drag/resize. Can receive either the new tasks array or a functional updater. */
|
|
30
|
+
onChange?: (tasks: Task[] | ((currentTasks: Task[]) => Task[])) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* GanttChart component - displays tasks on a monthly timeline with Excel-like styling
|
|
34
|
+
*
|
|
35
|
+
* The calendar automatically shows full months based on task date ranges.
|
|
36
|
+
* For example, if tasks span from March 25 to May 5, the calendar shows
|
|
37
|
+
* the complete months of March, April, and May (March 1 - May 31).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <GanttChart
|
|
42
|
+
* tasks={[
|
|
43
|
+
* { id: '1', name: 'Task 1', startDate: '2026-02-01', endDate: '2026-02-05' }
|
|
44
|
+
* ]}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare const GanttChart: React$1.FC<GanttChartProps>;
|
|
49
|
+
|
|
50
|
+
interface TaskRowProps {
|
|
51
|
+
/** Task data to render */
|
|
52
|
+
task: Task;
|
|
53
|
+
/** Start of the month for positioning calculations */
|
|
54
|
+
monthStart: Date;
|
|
55
|
+
/** Width of each day column in pixels */
|
|
56
|
+
dayWidth: number;
|
|
57
|
+
/** Height of the task row in pixels */
|
|
58
|
+
rowHeight: number;
|
|
59
|
+
/** Callback when task is modified via drag/resize */
|
|
60
|
+
onChange?: (updatedTask: Task) => void;
|
|
61
|
+
/** Callback when task drag state changes (for rendering guide lines) */
|
|
62
|
+
onDragStateChange?: (state: {
|
|
63
|
+
isDragging: boolean;
|
|
64
|
+
dragMode: 'move' | 'resize-left' | 'resize-right' | null;
|
|
65
|
+
left: number;
|
|
66
|
+
width: number;
|
|
67
|
+
}) => void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* TaskRow component - renders a single task row with a task bar
|
|
71
|
+
*
|
|
72
|
+
* Uses React.memo for performance optimization (QL-01).
|
|
73
|
+
* The task bar is positioned absolutely based on start/end dates.
|
|
74
|
+
*/
|
|
75
|
+
declare const TaskRow: React$1.FC<TaskRowProps>;
|
|
76
|
+
|
|
77
|
+
interface TimeScaleHeaderProps {
|
|
78
|
+
/** Array of dates to display (from getMultiMonthDays) */
|
|
79
|
+
days: Date[];
|
|
80
|
+
/** Width of each day column in pixels */
|
|
81
|
+
dayWidth: number;
|
|
82
|
+
/** Height of the header row in pixels */
|
|
83
|
+
headerHeight: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* TimeScaleHeader component - displays two-row date headers for the Gantt chart
|
|
87
|
+
*
|
|
88
|
+
* Top row: Month names (Russian, left-aligned) spanning multiple day columns
|
|
89
|
+
* Bottom row: Day numbers (centered) in individual columns
|
|
90
|
+
*/
|
|
91
|
+
declare const TimeScaleHeader: React$1.FC<TimeScaleHeaderProps>;
|
|
92
|
+
|
|
93
|
+
interface GridBackgroundProps {
|
|
94
|
+
/** Array of dates to display (from getMultiMonthDays) */
|
|
95
|
+
dateRange: Date[];
|
|
96
|
+
/** Width of each day column in pixels */
|
|
97
|
+
dayWidth: number;
|
|
98
|
+
/** Total height of the grid area in pixels */
|
|
99
|
+
totalHeight: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* GridBackground component - renders vertical grid lines and weekend background highlighting
|
|
103
|
+
*
|
|
104
|
+
* This component provides the visual grid structure that runs behind task rows.
|
|
105
|
+
* It separates grid rendering from task rendering for better performance and cleaner code.
|
|
106
|
+
*
|
|
107
|
+
* Features:
|
|
108
|
+
* - Vertical grid lines at month/week/day boundaries
|
|
109
|
+
* - Pink background highlighting for weekend days
|
|
110
|
+
* - React.memo optimization for performance
|
|
111
|
+
* - Pointer events disabled (clicks pass through to tasks)
|
|
112
|
+
*/
|
|
113
|
+
declare const GridBackground: React$1.FC<GridBackgroundProps>;
|
|
114
|
+
|
|
115
|
+
interface TodayIndicatorProps {
|
|
116
|
+
/** Start of the month for positioning calculations */
|
|
117
|
+
monthStart: Date;
|
|
118
|
+
/** Width of each day column in pixels */
|
|
119
|
+
dayWidth: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* TodayIndicator component - displays a vertical line at the current date
|
|
123
|
+
*
|
|
124
|
+
* Only renders when the current date is within the visible month range.
|
|
125
|
+
* Satisfies REND-04 requirement for visual today indicator.
|
|
126
|
+
*/
|
|
127
|
+
declare const TodayIndicator: React$1.FC<TodayIndicatorProps>;
|
|
128
|
+
|
|
129
|
+
interface DragGuideLinesProps {
|
|
130
|
+
isDragging: boolean;
|
|
131
|
+
dragMode: 'move' | 'resize-left' | 'resize-right' | null;
|
|
132
|
+
left: number;
|
|
133
|
+
width: number;
|
|
134
|
+
totalHeight: number;
|
|
135
|
+
}
|
|
136
|
+
declare const DragGuideLines: React$1.FC<DragGuideLinesProps>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Options for useTaskDrag hook
|
|
140
|
+
*/
|
|
141
|
+
interface UseTaskDragOptions {
|
|
142
|
+
/** Unique identifier for the task */
|
|
143
|
+
taskId: string;
|
|
144
|
+
/** Initial start date of the task */
|
|
145
|
+
initialStartDate: Date;
|
|
146
|
+
/** Initial end date of the task */
|
|
147
|
+
initialEndDate: Date;
|
|
148
|
+
/** Start of the visible range (e.g., month start) */
|
|
149
|
+
monthStart: Date;
|
|
150
|
+
/** Width of each day in pixels */
|
|
151
|
+
dayWidth: number;
|
|
152
|
+
/** Callback when drag operation completes */
|
|
153
|
+
onDragEnd?: (result: {
|
|
154
|
+
id: string;
|
|
155
|
+
startDate: Date;
|
|
156
|
+
endDate: Date;
|
|
157
|
+
}) => void;
|
|
158
|
+
/** Callback for drag state changes (for parent components to render guide lines) */
|
|
159
|
+
onDragStateChange?: (state: {
|
|
160
|
+
isDragging: boolean;
|
|
161
|
+
dragMode: 'move' | 'resize-left' | 'resize-right' | null;
|
|
162
|
+
left: number;
|
|
163
|
+
width: number;
|
|
164
|
+
}) => void;
|
|
165
|
+
/** Width of edge zones for resize detection (default: 12px) */
|
|
166
|
+
edgeZoneWidth?: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Return value from useTaskDrag hook
|
|
170
|
+
*/
|
|
171
|
+
interface UseTaskDragReturn {
|
|
172
|
+
/** Whether a drag operation is in progress */
|
|
173
|
+
isDragging: boolean;
|
|
174
|
+
/** Current drag mode (null when not dragging) */
|
|
175
|
+
dragMode: 'move' | 'resize-left' | 'resize-right' | null;
|
|
176
|
+
/** Current left position in pixels (updated during drag) */
|
|
177
|
+
currentLeft: number;
|
|
178
|
+
/** Current width in pixels (updated during drag) */
|
|
179
|
+
currentWidth: number;
|
|
180
|
+
/** Props to spread on the drag handle element */
|
|
181
|
+
dragHandleProps: {
|
|
182
|
+
onMouseDown: (e: React.MouseEvent) => void;
|
|
183
|
+
style: React.CSSProperties;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Custom hook for managing task drag interactions
|
|
188
|
+
*
|
|
189
|
+
* HMR-SAFE: Uses module-level singleton to ensure drag state survives
|
|
190
|
+
* React Fast Refresh. Window event listeners are attached once at module
|
|
191
|
+
* level rather than per component instance.
|
|
192
|
+
*/
|
|
193
|
+
declare const useTaskDrag: (options: UseTaskDragOptions) => UseTaskDragReturn;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Parse date string as UTC to prevent DST issues
|
|
197
|
+
* @param date - Date string or Date object
|
|
198
|
+
* @returns Date object representing UTC midnight
|
|
199
|
+
* @throws Error if date string is invalid
|
|
200
|
+
*/
|
|
201
|
+
declare const parseUTCDate: (date: string | Date) => Date;
|
|
202
|
+
/**
|
|
203
|
+
* Get all days in the month of given date (UTC)
|
|
204
|
+
* @param date - Reference date (any day in the target month)
|
|
205
|
+
* @returns Array of Date objects for each day in the month
|
|
206
|
+
*/
|
|
207
|
+
declare const getMonthDays: (date: Date | string) => Date[];
|
|
208
|
+
/**
|
|
209
|
+
* Calculate day offset from month start (0-based)
|
|
210
|
+
* @param date - The date to calculate offset for
|
|
211
|
+
* @param monthStart - The start of the month as reference
|
|
212
|
+
* @returns Number of days from month start (negative if date is before month start)
|
|
213
|
+
*/
|
|
214
|
+
declare const getDayOffset: (date: Date, monthStart: Date) => number;
|
|
215
|
+
/**
|
|
216
|
+
* Check if date is today (UTC comparison)
|
|
217
|
+
* @param date - Date to check
|
|
218
|
+
* @returns True if date is today, false otherwise
|
|
219
|
+
*/
|
|
220
|
+
declare const isToday: (date: Date) => boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Check if date is a weekend day (Saturday or Sunday)
|
|
223
|
+
* @param date - Date to check
|
|
224
|
+
* @returns True if date is Saturday (6) or Sunday (0), false otherwise
|
|
225
|
+
*/
|
|
226
|
+
declare const isWeekend: (date: Date) => boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Calculate multi-month date range from task dates
|
|
229
|
+
* Expands range to include full months (1st of first month to last day of last month)
|
|
230
|
+
* @param tasks - Array of tasks with startDate and endDate
|
|
231
|
+
* @returns Array of Date objects for all days in the expanded range
|
|
232
|
+
*/
|
|
233
|
+
declare const getMultiMonthDays: (tasks: Array<{
|
|
234
|
+
startDate: string | Date;
|
|
235
|
+
endDate: string | Date;
|
|
236
|
+
}>) => Date[];
|
|
237
|
+
/**
|
|
238
|
+
* Calculate month spans within a date range
|
|
239
|
+
* @param dateRange - Array of Date objects representing the full range
|
|
240
|
+
* @returns Array of month span objects with month, days count, and start index
|
|
241
|
+
*/
|
|
242
|
+
declare const getMonthSpans: (dateRange: Date[]) => Array<{
|
|
243
|
+
month: Date;
|
|
244
|
+
days: number;
|
|
245
|
+
startIndex: number;
|
|
246
|
+
}>;
|
|
247
|
+
/**
|
|
248
|
+
* Format date as DD.MM (e.g., 25.03 for March 25th)
|
|
249
|
+
* @param date - Date to format
|
|
250
|
+
* @returns Formatted date string in DD.MM format
|
|
251
|
+
*/
|
|
252
|
+
declare const formatDateLabel: (date: Date | string) => string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Calculate task bar positioning and dimensions
|
|
256
|
+
* @param taskStartDate - Start date of the task
|
|
257
|
+
* @param taskEndDate - End date of the task
|
|
258
|
+
* @param monthStart - Start of the month/visible range
|
|
259
|
+
* @param dayWidth - Width of each day in pixels
|
|
260
|
+
* @returns Object with left position and width in pixels
|
|
261
|
+
*/
|
|
262
|
+
declare const calculateTaskBar: (taskStartDate: Date, taskEndDate: Date, monthStart: Date, dayWidth: number) => {
|
|
263
|
+
left: number;
|
|
264
|
+
width: number;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Convert pixel position to date (inverse of calculateTaskBar)
|
|
268
|
+
* @param pixels - Position in pixels (left or width)
|
|
269
|
+
* @param monthStart - Start of the month/visible range
|
|
270
|
+
* @param dayWidth - Width of each day in pixels
|
|
271
|
+
* @returns Date calculated from pixel position
|
|
272
|
+
*/
|
|
273
|
+
declare const pixelsToDate: (pixels: number, monthStart: Date, dayWidth: number) => Date;
|
|
274
|
+
/**
|
|
275
|
+
* Calculate total width for month grid
|
|
276
|
+
* @param daysInMonth - Number of days in the month
|
|
277
|
+
* @param dayWidth - Width of each day in pixels
|
|
278
|
+
* @returns Total grid width in pixels
|
|
279
|
+
*/
|
|
280
|
+
declare const calculateGridWidth: (daysInMonth: number, dayWidth: number) => number;
|
|
281
|
+
/**
|
|
282
|
+
* Detect which edge zone the cursor is in on a task bar
|
|
283
|
+
* @param clientX - Mouse X coordinate relative to viewport
|
|
284
|
+
* @param taskBarElement - The task bar DOM element
|
|
285
|
+
* @param edgeZoneWidth - Width of edge zones in pixels (default: 12px)
|
|
286
|
+
* @returns 'left' if in left edge, 'right' if in right edge, 'move' if in middle
|
|
287
|
+
*/
|
|
288
|
+
declare const detectEdgeZone: (clientX: number, taskBarElement: HTMLElement, edgeZoneWidth?: number) => "left" | "right" | "move";
|
|
289
|
+
/**
|
|
290
|
+
* Get appropriate cursor style for drag position
|
|
291
|
+
* @param position - The drag position (left edge, right edge, or move)
|
|
292
|
+
* @returns CSS cursor string for the position
|
|
293
|
+
*/
|
|
294
|
+
declare const getCursorForPosition: (position: "left" | "right" | "move") => string;
|
|
295
|
+
/**
|
|
296
|
+
* Calculate grid line positions for a date range
|
|
297
|
+
* @param dateRange - Array of Date objects representing the visible range
|
|
298
|
+
* @param dayWidth - Width of each day column in pixels
|
|
299
|
+
* @returns Array of grid line objects with x position and flags
|
|
300
|
+
*/
|
|
301
|
+
declare const calculateGridLines: (dateRange: Date[], dayWidth: number) => Array<{
|
|
302
|
+
x: number;
|
|
303
|
+
isMonthStart: boolean;
|
|
304
|
+
isWeekStart: boolean;
|
|
305
|
+
}>;
|
|
306
|
+
/**
|
|
307
|
+
* Calculate weekend background blocks for a date range
|
|
308
|
+
* @param dateRange - Array of Date objects representing the visible range
|
|
309
|
+
* @param dayWidth - Width of each day column in pixels
|
|
310
|
+
* @returns Array of weekend block objects with left position and width
|
|
311
|
+
*/
|
|
312
|
+
declare const calculateWeekendBlocks: (dateRange: Date[], dayWidth: number) => Array<{
|
|
313
|
+
left: number;
|
|
314
|
+
width: number;
|
|
315
|
+
}>;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Date range for Gantt chart display
|
|
319
|
+
*/
|
|
320
|
+
interface GanttDateRange {
|
|
321
|
+
/** Start date of the visible range */
|
|
322
|
+
start: Date;
|
|
323
|
+
/** End date of the visible range */
|
|
324
|
+
end: Date;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Task bar positioning and dimensions
|
|
328
|
+
*/
|
|
329
|
+
interface TaskBarGeometry {
|
|
330
|
+
/** Left position in pixels */
|
|
331
|
+
left: number;
|
|
332
|
+
/** Width in pixels */
|
|
333
|
+
width: number;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Grid configuration for layout calculations
|
|
337
|
+
*/
|
|
338
|
+
interface GridConfig {
|
|
339
|
+
/** Width of each day column in pixels */
|
|
340
|
+
dayWidth: number;
|
|
341
|
+
/** Height of each task row in pixels */
|
|
342
|
+
rowHeight: number;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Represents a month span in the calendar header
|
|
346
|
+
*/
|
|
347
|
+
interface MonthSpan {
|
|
348
|
+
/** First day of the month (UTC) */
|
|
349
|
+
month: Date;
|
|
350
|
+
/** Number of days this month spans in the visible range */
|
|
351
|
+
days: number;
|
|
352
|
+
/** Start index in the date range array */
|
|
353
|
+
startIndex: number;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Represents a vertical grid line
|
|
357
|
+
*/
|
|
358
|
+
interface GridLine {
|
|
359
|
+
/** X position in pixels */
|
|
360
|
+
x: number;
|
|
361
|
+
/** True if this line is at the start of a month */
|
|
362
|
+
isMonthStart: boolean;
|
|
363
|
+
/** True if this line is at the start of a week (Monday) */
|
|
364
|
+
isWeekStart: boolean;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Represents a weekend background block
|
|
368
|
+
*/
|
|
369
|
+
interface WeekendBlock {
|
|
370
|
+
/** Left position in pixels */
|
|
371
|
+
left: number;
|
|
372
|
+
/** Width in pixels */
|
|
373
|
+
width: number;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export { DragGuideLines, GanttChart, type GanttChartProps, type GanttDateRange, GridBackground, type GridConfig, type GridLine, type MonthSpan, type Task, type TaskBarGeometry, TaskRow, TimeScaleHeader, TodayIndicator, type WeekendBlock, calculateGridLines, calculateGridWidth, calculateTaskBar, calculateWeekendBlocks, detectEdgeZone, formatDateLabel, getCursorForPosition, getDayOffset, getMonthDays, getMonthSpans, getMultiMonthDays, isToday, isWeekend, parseUTCDate, pixelsToDate, useTaskDrag };
|