apexgantt 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/lib/gantt.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { GanttOptions } from './models/Options';
2
+
3
+ export declare class ApexGantt {
4
+ element: HTMLElement;
5
+ private options;
6
+ private viewMode;
7
+ constructor(element: HTMLElement, options?: GanttOptions);
8
+ private buildTasks;
9
+ buildTimeline(): Element[];
10
+ render(): void;
11
+ renderDependencyArrows(): void;
12
+ renderToolbar(container: Element): void;
13
+ zoomIn(): void;
14
+ zoomOut(): void;
15
+ }
@@ -0,0 +1,50 @@
1
+ import { GanttOptions } from './Options';
2
+ import { ViewMode } from '../util/gantt.util';
3
+ import { Dayjs } from 'dayjs';
4
+
5
+ export declare enum Orientation {
6
+ Horizontal = "horizontal",
7
+ Vertical = "vertical"
8
+ }
9
+ /**
10
+ * Interface representing the label of an annotation.
11
+ */
12
+ interface AnnotationLabel {
13
+ readonly orientation: Orientation;
14
+ readonly text: string;
15
+ readonly textColor: string;
16
+ }
17
+ /**
18
+ * Interface representing an annotation in the graph.
19
+ */
20
+ export interface Annotation {
21
+ readonly bgColor?: string;
22
+ readonly borderColor: string;
23
+ readonly borderDashArray: number;
24
+ readonly borderWidth: number;
25
+ readonly label?: AnnotationLabel;
26
+ readonly x1: string;
27
+ readonly x2?: null | string;
28
+ }
29
+ /**
30
+ * Class for rendering annotations on a graph.
31
+ */
32
+ export declare class AnnotationRenderer {
33
+ private options;
34
+ private ganttStartDate;
35
+ private viewMode;
36
+ constructor(options: GanttOptions, ganttStartDate: Dayjs, viewMode: ViewMode);
37
+ private calculateWidth;
38
+ private calculateX;
39
+ private drawAnnotation;
40
+ private getAnnotationStyles;
41
+ /**
42
+ * Render the label for an annotation.
43
+ */
44
+ private renderLabel;
45
+ /**
46
+ * Render all annotations.
47
+ */
48
+ render(): any[];
49
+ }
50
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Task } from './Tasks';
2
+ import { GanttOptions } from './Options';
3
+ import { onUpdateBarCallback } from './BarDragManager';
4
+ import { ViewMode } from '../util/gantt.util';
5
+ import { Dayjs } from 'dayjs';
6
+
7
+ export declare class Bar {
8
+ task: Task;
9
+ ganttStartDate: Dayjs;
10
+ options: GanttOptions;
11
+ viewMode: ViewMode;
12
+ index: number;
13
+ constructor(task: Task, ganttStartDate: Dayjs, options: GanttOptions, viewMode: ViewMode, index: number);
14
+ static calculateWidth(task: Task, viewMode: ViewMode, options: GanttOptions): number;
15
+ static calculateX(task: Task, ganttStartDate: Dayjs, viewMode: ViewMode, options: GanttOptions): number;
16
+ calculateHeight(): number;
17
+ drawBar(onUpdate?: onUpdateBarCallback): HTMLElement;
18
+ getBarStyles(barBgColor?: string): Partial<CSSStyleDeclaration>;
19
+ makeDraggable(barElement: HTMLDivElement, onUpdate?: any): void;
20
+ makeResizable(barElement: HTMLDivElement, onUpdate?: any): void;
21
+ }
@@ -0,0 +1,22 @@
1
+ import { Task } from './Tasks';
2
+ import { GanttOptions } from './Options';
3
+ import { ViewMode } from '../util/gantt.util';
4
+
5
+ export type onUpdateBarCallback = (id: string, options: Partial<Task>) => void;
6
+ export declare class BarDragManager {
7
+ private taskId;
8
+ private options;
9
+ private dragState;
10
+ private task;
11
+ constructor(taskId: string, options: GanttOptions, viewMode: ViewMode);
12
+ private calculateFinalPosition;
13
+ private createMouseDownHandler;
14
+ private createMouseMoveHandler;
15
+ private createMouseUpHandler;
16
+ private isOutOfBounds;
17
+ private moveBar;
18
+ private moveChildBars;
19
+ private updateChildrenPositions;
20
+ private updateTaskPosition;
21
+ makeDraggable(barElement: HTMLDivElement, onUpdate?: onUpdateBarCallback): () => void;
22
+ }
@@ -0,0 +1,16 @@
1
+ import { Task } from './Tasks';
2
+ import { GanttOptions } from './Options';
3
+ import { ViewMode } from '../util/gantt.util';
4
+
5
+ export type onUpdateBarCallback = (id: string, options: Partial<Task>) => void;
6
+ export declare class BarResizeManager {
7
+ private taskId;
8
+ private options;
9
+ private interactionState;
10
+ private task;
11
+ constructor(taskId: string, options: GanttOptions, viewMode: ViewMode);
12
+ private createMouseMoveHandler;
13
+ private createMouseUpHandler;
14
+ private createResizeMouseDownHandler;
15
+ makeResizable(barElement: HTMLDivElement, onUpdate?: onUpdateBarCallback): () => void;
16
+ }
@@ -0,0 +1,105 @@
1
+ import { Task } from './Tasks';
2
+ import { Dayjs } from 'dayjs';
3
+
4
+ type Dependency = {
5
+ fromId: string;
6
+ toId: string;
7
+ type: 'FF' | 'FS' | 'SF' | 'SS';
8
+ };
9
+ export declare class DataManager {
10
+ private dependencies;
11
+ private taskMap;
12
+ private taskTree;
13
+ constructor(tasks?: Task[]);
14
+ private buildTaskTree;
15
+ private processLevel;
16
+ /**
17
+ * Sort tasks recursively by a specified date field (start or end).
18
+ * @param field - The date field to sort by ('start' or 'end').
19
+ */
20
+ private sortTasksByDate;
21
+ /**
22
+ * Validate a single task.
23
+ * @param task - Task to validate
24
+ * @returns - The validated task
25
+ */
26
+ private validateTask;
27
+ /**
28
+ * Add a new dependency between tasks
29
+ */
30
+ addDependency(fromId: string, toId: string, type?: Dependency['type']): void;
31
+ /**
32
+ * Add a new task to the list.
33
+ * @param task - Task to add
34
+ */
35
+ addTask(task: Partial<Task>): void;
36
+ /**
37
+ * Calculate the overall progress of all tasks.
38
+ * @returns - Total progress percentage (0-100)
39
+ */
40
+ calculateProgress(): number;
41
+ /**
42
+ * Get a date range from all tasks.
43
+ * @returns - The start and end date from all tasks
44
+ */
45
+ getDateRange(add: number, viewMode: any): [Dayjs, Dayjs];
46
+ getFlatSortedTasks(tasks: Task[], getAll?: boolean): Task[];
47
+ getFlatTasks(): Task[];
48
+ getFlatVisibleTasks(): Task[];
49
+ getNestedChildTasks(taskId: string): Task[];
50
+ /**
51
+ * Get a task by ID.
52
+ * @param id - ID of the task
53
+ * @returns - The task or null if not found
54
+ */
55
+ getTaskById(id: string): null | Task;
56
+ /**
57
+ * Get all dependencies for a task
58
+ * @param taskId - ID of the task
59
+ * @returns Object containing incoming and outgoing dependencies
60
+ */
61
+ getTaskDependencies(taskId: string): {
62
+ incoming: Dependency[];
63
+ outgoing: Dependency[];
64
+ };
65
+ /**
66
+ * Get a all tasks.
67
+ * @returns - The all tasks
68
+ */
69
+ getTasks(): Task[];
70
+ /**
71
+ * Get a all top parent tasks.
72
+ * @returns - The all tasks
73
+ */
74
+ getTopParentTasks(): Task[];
75
+ hasChildren(id: string): boolean;
76
+ /**
77
+ * Remove a dependency
78
+ */
79
+ removeDependency(fromId: string, toId: string): void;
80
+ /**
81
+ * Remove a task by ID.
82
+ * @param id - ID of the task to remove
83
+ */
84
+ removeTask(id: string): void;
85
+ /**
86
+ * Validate and set the initial list of tasks.
87
+ * @param tasks - Array of tasks to initialize the DataManager
88
+ */
89
+ setTasks(tasks: Task[]): void;
90
+ toggleTask(id: string): void;
91
+ /**
92
+ * Update arrow positions when a task is moved
93
+ * @param taskId - ID of the task being moved
94
+ * @param dx - Change in x position
95
+ */
96
+ updateDependencyArrows(taskId: string): void;
97
+ /**
98
+ * Update an existing task by ID.
99
+ * @param id - ID of the task to update
100
+ * @param updates - Partial task updates
101
+ */
102
+ updateTask(id: string, updates: Partial<Task>): Task;
103
+ }
104
+ export declare const dataManager: DataManager;
105
+ export {};
@@ -0,0 +1,25 @@
1
+ export interface DialogOptions {
2
+ closeOnClickOutside?: boolean;
3
+ closeOnEscape?: boolean;
4
+ content?: HTMLElement | string;
5
+ height?: string;
6
+ id: string;
7
+ modal?: boolean;
8
+ title?: string;
9
+ width?: string;
10
+ }
11
+ export declare class Dialog {
12
+ private options;
13
+ private container;
14
+ private overlay;
15
+ constructor(options: DialogOptions);
16
+ private createDialog;
17
+ private createDialogStructure;
18
+ private setupEventListeners;
19
+ private updateDialogContent;
20
+ destroy(): void;
21
+ hide(): void;
22
+ isVisible(): boolean;
23
+ setContent(content: HTMLElement | string): void;
24
+ show(): void;
25
+ }
@@ -0,0 +1,62 @@
1
+ import { Task } from './Tasks';
2
+ import { Annotation, Orientation } from './Annotation';
3
+ import { ViewMode } from '../util/gantt.util';
4
+ import { ArrowLink } from '../../../../graph-utils/src/index.ts';
5
+
6
+ export interface CommonOptions {
7
+ readonly canvasStyle: string;
8
+ readonly enableExport: boolean;
9
+ readonly enableResize: boolean;
10
+ readonly headerBackground: string;
11
+ readonly height: number | string;
12
+ readonly inputDateFormat: string;
13
+ readonly tasksContainerWidth: number;
14
+ readonly viewMode: ViewMode;
15
+ readonly width: number | string;
16
+ }
17
+ export interface GanttBarOptions {
18
+ readonly barBackgroundColor: string;
19
+ readonly barBorderRadius: string;
20
+ readonly barMargin: number;
21
+ readonly barTextColor: string;
22
+ readonly enableTaskEdit: boolean;
23
+ }
24
+ export interface GanttRowOptions {
25
+ readonly rowBackgroundColors: readonly string[];
26
+ readonly rowHeight: number;
27
+ }
28
+ export interface TooltipOptions {
29
+ readonly enableTooltip: boolean;
30
+ readonly tooltipBGColor: string;
31
+ readonly tooltipBorderColor: string;
32
+ readonly tooltipId: string;
33
+ readonly tooltipTemplate?: (task: Task, dateFormat: string) => string;
34
+ }
35
+ export interface FontOptions {
36
+ readonly fontColor: string;
37
+ readonly fontFamily: string;
38
+ readonly fontSize: string;
39
+ readonly fontWeight: string;
40
+ }
41
+ export interface AnnotationOptions {
42
+ readonly annotationBgColor?: string;
43
+ readonly annotationBorderColor?: string;
44
+ readonly annotationBorderDashArray?: number[];
45
+ readonly annotationBorderWidth?: number;
46
+ readonly annotationOrientation?: Orientation;
47
+ readonly annotationTextColor?: string;
48
+ }
49
+ export interface InteractiveOptions {
50
+ readonly enableTaskDrag: boolean;
51
+ readonly enableTaskResize: boolean;
52
+ }
53
+ export interface GanttData {
54
+ readonly annotations: Annotation[];
55
+ readonly series: Task[];
56
+ }
57
+ export type GanttOptions = AnnotationOptions & CommonOptions & FontOptions & GanttBarOptions & GanttData & GanttRowOptions & InteractiveOptions & TooltipOptions;
58
+ export declare const ColumnWidthByMode: Record<ViewMode, number>;
59
+ export declare function getDaysInUnit(date: any, mode: any): number;
60
+ export declare const getPixelsPerDayForUnit: (unitStartDate: any, viewMode: any) => number;
61
+ export declare const arrowLink: ArrowLink;
62
+ export declare const DefaultOptions: GanttOptions;
@@ -0,0 +1,22 @@
1
+ import { Task } from './Tasks';
2
+
3
+ export declare class TaskForm {
4
+ private task;
5
+ private onSubmit;
6
+ private dateFormat;
7
+ private errors;
8
+ private form;
9
+ private submitButton;
10
+ constructor(task: Task, onSubmit: (updatedTask: Partial<Task>) => void, dateFormat?: string);
11
+ private clearError;
12
+ private createForm;
13
+ private formatDate;
14
+ private handleSubmit;
15
+ private setupFieldValidation;
16
+ private showError;
17
+ private updateSubmitButton;
18
+ private validateDates;
19
+ private validateName;
20
+ private validateProgress;
21
+ getElement(): HTMLFormElement;
22
+ }
@@ -0,0 +1,31 @@
1
+ import { GanttOptions } from './Options';
2
+
3
+ export declare enum TaskType {
4
+ Milestone = "milestone",
5
+ Task = "task"
6
+ }
7
+ export interface Task {
8
+ readonly barBackgroundColor?: string;
9
+ collapsed?: boolean;
10
+ readonly dependency?: string;
11
+ readonly endTime: string;
12
+ readonly id: string;
13
+ readonly left?: number;
14
+ readonly level: number;
15
+ readonly name: string;
16
+ readonly parentId?: string;
17
+ readonly progress: number;
18
+ readonly rowBackgroundColor?: string;
19
+ readonly startTime: string;
20
+ readonly type?: TaskType;
21
+ readonly width?: number;
22
+ }
23
+ export declare class Tasks {
24
+ options: GanttOptions;
25
+ constructor(options: GanttOptions);
26
+ generateBody(tasks: Task[], reRender: () => void): HTMLElement;
27
+ generateHeader(headerList: string[]): HTMLElement;
28
+ generateRow(task: Task, reRender: () => void): HTMLTableRowElement;
29
+ generateRows(tasks: Task[], tableBody: HTMLElement, reRender: () => void): HTMLElement;
30
+ render(reRender: () => void): HTMLElement;
31
+ }
@@ -0,0 +1,16 @@
1
+ import { Task } from './Tasks';
2
+ import { GanttOptions } from './Options';
3
+ import { ViewMode } from '../util/gantt.util';
4
+ import { HeaderObject } from '../util/date.util';
5
+ import { Dayjs } from 'dayjs';
6
+
7
+ export declare class TimeLine {
8
+ viewMode: ViewMode;
9
+ options: GanttOptions;
10
+ constructor(viewMode: ViewMode, options: GanttOptions);
11
+ generateHeader(headerData: HeaderObject[], subHeader: null | string[]): HTMLElement;
12
+ generateRow(taskId: string, cellCount: number): HTMLElement;
13
+ generateRows(tasks: Task[], cellCount: number): HTMLElement;
14
+ getHeaderData(startDate: Dayjs, endDate: Dayjs, viewMode: ViewMode): [HeaderObject[], null | string[]] | null;
15
+ render(): HTMLElement[] | null;
16
+ }
@@ -0,0 +1 @@
1
+ export declare const DialogStyle = "\n .gantt-dialog-container {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 999;\n }\n\n .gantt-dialog-container .dialog-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n .gantt-dialog-container .gantt-dialog {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 300px;\n }\n\n .gantt-dialog .dialog-header {\n padding: 12px 16px;\n border-bottom: 1px solid #eee;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .gantt-dialog .dialog-title {\n font-weight: 600;\n font-size: 16px;\n }\n\n .gantt-dialog .dialog-close {\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n padding: 0;\n color: #666;\n transition: color 0.2s;\n }\n\n .gantt-dialog .dialog-close:hover {\n color: #333;\n }\n\n .gantt-dialog .dialog-content {\n padding: 16px;\n max-height: calc(100vh - 200px);\n overflow-y: auto;\n }\n\n .gantt-dialog-container.show {\n display: block;\n }\n\n /* Animation classes */\n .gantt-dialog-container.animate .dialog-overlay {\n animation: fadeIn 0.2s ease-out;\n }\n\n .gantt-dialog-container.animate .gantt-dialog {\n animation: slideIn 0.3s ease-out;\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n";
@@ -0,0 +1 @@
1
+ export declare const GanttStyle = "\n * {\n box-sizing: border-box;\n }\n\n .gantt-container * {\n user-select: none;\n }\n\n .gantt-actions-container {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 5px 0;\n }\n\n .gantt-container {\n display: flex; \n border: 1px solid #DFE0E1;\n height: auto;\n position: relative;\n }\n \n .gantt-button {\n border: 1px solid #D9D9D9;\n border-radius: 2px;\n background: #fff;\n padding: 4px 12px;\n color: rgba(0, 0, 0, 0.7);\n line-height: 20px;\n font-weight: bold;\n cursor: pointer;\n }\n \n .gantt-button:disabled {\n color: rgba(0, 0, 0, 0.2);\n }\n";
@@ -0,0 +1 @@
1
+ export declare const TaskFormStyle = "\n\n .task-form .form-group {\n margin-bottom: 18px;\n position: relative;\n }\n\n .task-form label {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n }\n\n .task-form input {\n width: 100%;\n padding: 8px;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-size: 14px;\n }\n\n .task-form input:focus {\n outline: none;\n border-color: #0066cc;\n }\n\n .task-form .grid {\n display: flex;\n justify-content: space-between;\n }\n\n .task-form .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n }\n\n .task-form .btn-primary {\n background: #0066cc;\n color: white;\n border: none;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .task-form .btn-primary:hover {\n background: #0052a3;\n }\n\n .task-form .btn-disabled,\n .task-form .btn-disabled:hover {\n background: #99c2ff;\n cursor: not-allowed;\n opacity: 0.7;\n }\n\n .task-form .form-error {\n position: absolute;\n bottom: -15px;\n left: 0;\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n line-height: 1.2;\n transition: opacity 0.2s ease;\n }\n\n .task-form .invalid {\n border-color: #dc3545;\n }\n\n .task-form .invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n }\n\n .color-picker-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .color-picker-wrapper input[type=\"color\"] {\n -webkit-appearance: none;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-picker-wrapper input[type=\"color\"]::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n .color-picker-wrapper input[type=\"color\"]::-webkit-color-swatch {\n border: 1px solid #ddd;\n border-radius: 4px;\n }\n\n .color-picker-wrapper .color-preview {\n font-size: 12px;\n color: #666;\n }\n";
@@ -0,0 +1 @@
1
+ export declare const TableStyle = "\n .tasks-table,\n .tasks-table th,\n .tasks-table td {\n border: 1px solid #eff0f0;\n border-collapse: collapse;\n }\n\n .tasks-table th {\n height: 50px;\n }\n\n .tasks-table th,\n .tasks-table td {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tasks-table .tasks-data-row .task-toggle-icon,\n .tasks-table .tasks-data-row .task-toggle-icon-blank {\n margin-right: 5px;\n width: 10px;\n }\n";
@@ -0,0 +1 @@
1
+ export declare const TimelineStyle = "\n .gantt-container .timeline-container {\n width: 100%;\n overflow-y: auto;\n position: relative;\n }\n\n .timeline-container .annotation {\n position: absolute;\n }\n\n .timeline-container .bar-timeline {\n position: absolute;\n cursor: move;\n cursor: grab;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .timeline-container .bar-timeline .bar-handle {\n height: 100%;\n width: 5px;\n position: absolute;\n z-index: 1000;\n background: transparent;\n }\n\n .timeline-container .bar-timeline .bar-handle:hover {\n cursor: col-resize;\n }\n\n .resizing {\n pointer-events: none;\n opacity: 0.8;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-left {\n left: -5px;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-right {\n right: -5px;\n }\n\n .timeline-container .bar-timeline.dragging {\n cursor: grabbing;\n }\n\n .bar-timeline .bar-timeline-progress {\n position: absolute;\n pointer-events: none;\n height: 100%;\n left: 0;\n }\n\n .bar-timeline .bar-label {\n white-space: nowrap;\n pointer-events: none;\n overflow: hidden;\n z-index: 1;\n }\n\n .timeline-container .timeline-header,\n .timeline-container .timeline-body {\n width: max-content;\n position: relative;\n }\n \n .timeline-container .timeline-header-row,\n .timeline-container .timeline-data-row {\n display: flex;\n }\n\n .timeline-container .timeline-header-cell,\n .timeline-container .timeline-data-cell {\n padding: 0 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 0.5px solid #eff0f0;\n }\n";
@@ -0,0 +1 @@
1
+ export declare function updateArrow(fromId: string, toId: string): void;
@@ -0,0 +1,2 @@
1
+ export declare function getBarElement(taskId: string): HTMLElement | null;
2
+ export declare function getBarRowElement(taskId: string): HTMLElement | null;
@@ -0,0 +1,24 @@
1
+ import { TUnit } from './gantt.util';
2
+ import { Dayjs } from 'dayjs';
3
+
4
+ export interface HeaderObject {
5
+ readonly data: string;
6
+ readonly width: number;
7
+ }
8
+ export declare const MonthsInQuarter: {
9
+ 1: string[];
10
+ 2: string[];
11
+ 3: string[];
12
+ 4: string[];
13
+ };
14
+ export declare function getRange(startDate: Dayjs, endDate: Dayjs, type: TUnit): Dayjs[];
15
+ export declare function getDaysInRange(startDate: Dayjs, endDate: Dayjs): Dayjs[];
16
+ export declare function getWeeksInRange(startDate: Dayjs, endDate: Dayjs): Dayjs[];
17
+ export declare function getMonthsInRange(startDate: Dayjs, endDate: Dayjs): Dayjs[];
18
+ export declare function getQuartersInRange(startDate: Dayjs, endDate: Dayjs): Dayjs[];
19
+ export declare function getYearsInRange(startDate: Dayjs, endDate: Dayjs): Dayjs[];
20
+ export declare function getDayModeData(startDate: Dayjs, endDate: Dayjs, columnWidth: number): [HeaderObject[], string[]];
21
+ export declare function getWeekModeData(startDate: Dayjs, endDate: Dayjs, columnWidth: number): [HeaderObject[], string[]];
22
+ export declare function getMonthModeData(startDate: Dayjs, endDate: Dayjs, columnWidth: number): [HeaderObject[], string[]];
23
+ export declare function getQuarterModeData(startDate: Dayjs, endDate: Dayjs, columnWidth: number): [HeaderObject[], string[]];
24
+ export declare function getYearModeData(startDate: Dayjs, endDate: Dayjs, columnWidth: number): [HeaderObject[], null];
@@ -0,0 +1,9 @@
1
+ export declare const SupportedScales: string[];
2
+ export declare enum ViewMode {
3
+ Day = "day",
4
+ Month = "month",
5
+ Quarter = "quarter",
6
+ Week = "week",
7
+ Year = "year"
8
+ }
9
+ export type TUnit = ViewMode.Day | ViewMode.Month | ViewMode.Week | ViewMode.Year;
@@ -0,0 +1 @@
1
+ export declare const exportGanttToPDF: (element: any, filename?: string) => Promise<void>;
@@ -0,0 +1,37 @@
1
+ import { ViewMode } from './gantt.util';
2
+ import { Task } from '../models/Tasks';
3
+ import { GanttOptions } from '../models/Options';
4
+ import { Dayjs } from 'dayjs';
5
+
6
+ export declare enum ColumnKey {
7
+ Duration = "duration",
8
+ EndTime = "endTime",
9
+ Name = "name",
10
+ Progress = "progress",
11
+ StartTime = "startTime"
12
+ }
13
+ export declare const ColumnKeyTitleMap: {
14
+ duration: string;
15
+ name: string;
16
+ progress: string;
17
+ startTime: string;
18
+ };
19
+ export interface ColumnListItem {
20
+ readonly key: ColumnKey;
21
+ readonly title: string;
22
+ readonly width?: string;
23
+ }
24
+ export declare const ColumnList: ColumnListItem[];
25
+ export declare function getTaskTextByColumn(task: Task, columnKey: ColumnKey, inputDateFormat: string): string;
26
+ export declare function getTaskRowElement(taskId: string): HTMLElement | null;
27
+ export declare function updateColumnContent(taskId: string, columnKey: string, value: string): void;
28
+ export declare function getRowBackgroundColor(index: number, rowBackgroundColors: readonly string[]): string;
29
+ export declare function setTaskRowBackgroundColor(taskId: string, bgColor: string): void;
30
+ interface TaskElements {
31
+ taskBar: HTMLElement | null;
32
+ taskBarRow: HTMLElement | null;
33
+ taskRow: HTMLElement | null;
34
+ }
35
+ export declare const getTaskElements: (taskId: string) => TaskElements;
36
+ export declare const updateTaskInUI: (taskId: string, updates: Partial<Task>, options: GanttOptions, viewMode: ViewMode, ganttStartDate: Dayjs) => void;
37
+ export {};
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "apexgantt",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "dayjs": "^1.11.13",
6
+ "lodash": "^4.17.21"
7
+ },
8
+ "type": "module",
9
+ "main": "./apexgantt.min.js",
10
+ "module": "./apexgantt.es.min.js",
11
+ "types": "./index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./index.d.ts",
16
+ "default": "./apexgantt.es.min.js"
17
+ },
18
+ "require": {
19
+ "types": "./index.d.ts",
20
+ "default": "./apexgantt.min.js"
21
+ }
22
+ }
23
+ }
24
+ }