@nocobase/plugin-gantt 0.18.0-alpha.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/README.md +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/Gantt.Designer.d.ts +2 -0
- package/dist/client/Gantt.Settings.d.ts +2 -0
- package/dist/client/GanttActionInitializers.d.ts +2 -0
- package/dist/client/GanttBlockInitializer.d.ts +2 -0
- package/dist/client/GanttBlockProvider.d.ts +11 -0
- package/dist/client/components/calendar/calendar.d.ts +14 -0
- package/dist/client/components/calendar/style.d.ts +5 -0
- package/dist/client/components/calendar/top-part-of-calendar.d.ts +11 -0
- package/dist/client/components/gantt/Event.d.ts +2 -0
- package/dist/client/components/gantt/gantt.d.ts +5 -0
- package/dist/client/components/gantt/style.d.ts +6 -0
- package/dist/client/components/gantt/task-gantt-content.d.ts +25 -0
- package/dist/client/components/gantt/task-gantt.d.ts +14 -0
- package/dist/client/components/grid/grid-body.d.ts +13 -0
- package/dist/client/components/grid/grid.d.ts +4 -0
- package/dist/client/components/grid/style.d.ts +6 -0
- package/dist/client/components/other/arrow.d.ts +12 -0
- package/dist/client/components/other/horizontal-scroll.d.ts +8 -0
- package/dist/client/components/other/style.d.ts +8 -0
- package/dist/client/components/other/tooltip.d.ts +29 -0
- package/dist/client/components/other/vertical-scroll.d.ts +9 -0
- package/dist/client/components/task-item/bar/bar-date-handle.d.ts +11 -0
- package/dist/client/components/task-item/bar/bar-display.d.ts +21 -0
- package/dist/client/components/task-item/bar/bar-progress-handle.d.ts +7 -0
- package/dist/client/components/task-item/bar/bar-small.d.ts +3 -0
- package/dist/client/components/task-item/bar/bar.d.ts +3 -0
- package/dist/client/components/task-item/bar/style.d.ts +2 -0
- package/dist/client/components/task-item/milestone/milestone.d.ts +3 -0
- package/dist/client/components/task-item/milestone/style.d.ts +2 -0
- package/dist/client/components/task-item/project/project.d.ts +3 -0
- package/dist/client/components/task-item/project/style.d.ts +3 -0
- package/dist/client/components/task-item/style.d.ts +4 -0
- package/dist/client/components/task-item/task-item.d.ts +15 -0
- package/dist/client/context.d.ts +3 -0
- package/dist/client/helpers/bar-helper.d.ts +14 -0
- package/dist/client/helpers/date-helper.d.ts +19 -0
- package/dist/client/helpers/other-helper.d.ts +9 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.js +244 -0
- package/dist/client/types/bar-task.d.ts +22 -0
- package/dist/client/types/date-setup.d.ts +5 -0
- package/dist/client/types/gantt-task-actions.d.ts +8 -0
- package/dist/client/types/public-types.d.ts +136 -0
- package/dist/client/utils.d.ts +62 -0
- package/dist/externalVersion.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/plugin.d.ts +11 -0
- package/dist/server/plugin.js +45 -0
- package/package.json +19 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @nocobase/plugin-gantt
|
package/client.d.ts
ADDED
package/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client/index.js');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const GanttBlockContext: React.Context<any>;
|
|
3
|
+
export declare const GanttBlockProvider: (props: any) => React.JSX.Element;
|
|
4
|
+
export declare const useGanttBlockContext: () => any;
|
|
5
|
+
export declare const useGanttBlockProps: () => {
|
|
6
|
+
fieldNames: any;
|
|
7
|
+
timeRange: any;
|
|
8
|
+
onExpanderClick: (task: any) => void;
|
|
9
|
+
expandAndCollapseAll: (flag: any) => void;
|
|
10
|
+
tasks: any;
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateSetup } from '../../types/date-setup';
|
|
3
|
+
import { ViewMode } from '../../types/public-types';
|
|
4
|
+
export type CalendarProps = {
|
|
5
|
+
dateSetup: DateSetup;
|
|
6
|
+
locale: string;
|
|
7
|
+
viewMode: ViewMode;
|
|
8
|
+
rtl: boolean;
|
|
9
|
+
headerHeight: number;
|
|
10
|
+
columnWidth: number;
|
|
11
|
+
fontFamily: string;
|
|
12
|
+
fontSize: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const Calendar: React.FC<CalendarProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type TopPartOfCalendarProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
x1Line: number;
|
|
5
|
+
y1Line: number;
|
|
6
|
+
y2Line: number;
|
|
7
|
+
xText: number;
|
|
8
|
+
yText: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const TopPartOfCalendar: React.FC<TopPartOfCalendarProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
ganttverticalcontainer: import("antd-style").SerializedStyles;
|
|
3
|
+
horizontalcontainer: import("antd-style").SerializedStyles;
|
|
4
|
+
wrapper: import("antd-style").SerializedStyles;
|
|
5
|
+
}>;
|
|
6
|
+
export default useStyles;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EventOption } from '../../types/public-types';
|
|
3
|
+
import { BarTask } from '../../types/bar-task';
|
|
4
|
+
import { GanttEvent } from '../../types/gantt-task-actions';
|
|
5
|
+
export type TaskGanttContentProps = {
|
|
6
|
+
tasks: BarTask[];
|
|
7
|
+
dates: Date[];
|
|
8
|
+
ganttEvent: GanttEvent;
|
|
9
|
+
selectedTask: BarTask | undefined;
|
|
10
|
+
rowHeight: number;
|
|
11
|
+
columnWidth: number;
|
|
12
|
+
timeStep: number;
|
|
13
|
+
svg?: React.RefObject<SVGSVGElement>;
|
|
14
|
+
svgWidth: number;
|
|
15
|
+
taskHeight: number;
|
|
16
|
+
arrowColor: string;
|
|
17
|
+
arrowIndent: number;
|
|
18
|
+
fontSize: string;
|
|
19
|
+
fontFamily: string;
|
|
20
|
+
rtl: boolean;
|
|
21
|
+
setGanttEvent: (value: GanttEvent) => void;
|
|
22
|
+
setFailedTask: (value: BarTask | null) => void;
|
|
23
|
+
setSelectedTask: (taskId: string) => void;
|
|
24
|
+
} & EventOption;
|
|
25
|
+
export declare const TaskGanttContent: React.FC<TaskGanttContentProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarProps } from '../calendar/calendar';
|
|
3
|
+
import { GridProps } from '../grid/grid';
|
|
4
|
+
import { TaskGanttContentProps } from './task-gantt-content';
|
|
5
|
+
export type TaskGanttProps = {
|
|
6
|
+
gridProps: GridProps;
|
|
7
|
+
calendarProps: CalendarProps;
|
|
8
|
+
barProps: TaskGanttContentProps;
|
|
9
|
+
ganttHeight: number;
|
|
10
|
+
scrollY: number;
|
|
11
|
+
scrollX: number;
|
|
12
|
+
ref: any;
|
|
13
|
+
};
|
|
14
|
+
export declare const TaskGantt: React.FC<TaskGanttProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Task } from '../../types/public-types';
|
|
3
|
+
export type GridBodyProps = {
|
|
4
|
+
tasks: Task[];
|
|
5
|
+
dates: Date[];
|
|
6
|
+
svgWidth: number;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
columnWidth: number;
|
|
9
|
+
todayColor: string;
|
|
10
|
+
rtl: boolean;
|
|
11
|
+
selectedRowKeys: any[];
|
|
12
|
+
};
|
|
13
|
+
export declare const GridBody: React.FC<GridBodyProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
gridRow: import("antd-style").SerializedStyles;
|
|
3
|
+
gridHeightRow: import("antd-style").SerializedStyles;
|
|
4
|
+
nbGridbody: import("antd-style").SerializedStyles;
|
|
5
|
+
}>;
|
|
6
|
+
export default useStyles;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BarTask } from '../../types/bar-task';
|
|
3
|
+
type ArrowProps = {
|
|
4
|
+
taskFrom: BarTask;
|
|
5
|
+
taskTo: BarTask;
|
|
6
|
+
rowHeight: number;
|
|
7
|
+
taskHeight: number;
|
|
8
|
+
arrowIndent: number;
|
|
9
|
+
rtl: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const Arrow: React.FC<ArrowProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
scrollWrapper: import("antd-style").SerializedStyles;
|
|
3
|
+
tooltipDefaultContainer: import("antd-style").SerializedStyles;
|
|
4
|
+
tooltipDetailsContainer: import("antd-style").SerializedStyles;
|
|
5
|
+
tooltipDetailsContainerHidden: import("antd-style").SerializedStyles;
|
|
6
|
+
nbGridOther: import("antd-style").SerializedStyles;
|
|
7
|
+
}>;
|
|
8
|
+
export default useStyles;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BarTask } from '../../types/bar-task';
|
|
3
|
+
import { Task } from '../../types/public-types';
|
|
4
|
+
export type TooltipProps = {
|
|
5
|
+
task: BarTask;
|
|
6
|
+
arrowIndent: number;
|
|
7
|
+
rtl: boolean;
|
|
8
|
+
svgContainerHeight: number;
|
|
9
|
+
svgContainerWidth: number;
|
|
10
|
+
svgWidth: number;
|
|
11
|
+
headerHeight: number;
|
|
12
|
+
taskListWidth: number;
|
|
13
|
+
scrollX: number;
|
|
14
|
+
scrollY: number;
|
|
15
|
+
rowHeight: number;
|
|
16
|
+
fontSize: string;
|
|
17
|
+
fontFamily: string;
|
|
18
|
+
TooltipContent: React.FC<{
|
|
19
|
+
task: Task;
|
|
20
|
+
fontSize: string;
|
|
21
|
+
fontFamily: string;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
25
|
+
export declare const StandardTooltipContent: React.FC<{
|
|
26
|
+
task: Task;
|
|
27
|
+
fontSize: string;
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { SyntheticEvent } from 'react';
|
|
2
|
+
export declare const VerticalScroll: React.FC<{
|
|
3
|
+
scroll: number;
|
|
4
|
+
ganttHeight: number;
|
|
5
|
+
ganttFullHeight: number;
|
|
6
|
+
headerHeight: number;
|
|
7
|
+
rtl: boolean;
|
|
8
|
+
onScroll: (event: SyntheticEvent<HTMLDivElement>) => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type BarDateHandleProps = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
barCornerRadius: number;
|
|
8
|
+
onMouseDown: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const BarDateHandle: React.FC<BarDateHandleProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type BarDisplayProps = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
progressX: number;
|
|
10
|
+
progressWidth: number;
|
|
11
|
+
barCornerRadius: number;
|
|
12
|
+
styles: {
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
backgroundSelectedColor: string;
|
|
15
|
+
progressColor: string;
|
|
16
|
+
progressSelectedColor: string;
|
|
17
|
+
};
|
|
18
|
+
onMouseDown: (event: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const BarDisplay: React.FC<BarDisplayProps>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BarTask } from '../../types/bar-task';
|
|
3
|
+
import { GanttContentMoveAction } from '../../types/gantt-task-actions';
|
|
4
|
+
export type TaskItemProps = {
|
|
5
|
+
task: BarTask;
|
|
6
|
+
arrowIndent: number;
|
|
7
|
+
taskHeight: number;
|
|
8
|
+
isProgressChangeable: boolean;
|
|
9
|
+
isDateChangeable: boolean;
|
|
10
|
+
isDelete: boolean;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
rtl: boolean;
|
|
13
|
+
onEventStart: (action: GanttContentMoveAction, selectedTask: BarTask, event?: React.MouseEvent | React.KeyboardEvent) => any;
|
|
14
|
+
};
|
|
15
|
+
export declare const TaskItem: React.FC<TaskItemProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BarTask } from '../types/bar-task';
|
|
2
|
+
import { BarMoveAction } from '../types/gantt-task-actions';
|
|
3
|
+
import { Task } from '../types/public-types';
|
|
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 progressWithByParams: (taskX1: number, taskX2: number, progress: number, rtl: boolean) => number[];
|
|
6
|
+
export declare const progressByProgressWidth: (progressWidth: number, barTask: BarTask) => number;
|
|
7
|
+
export declare const getProgressPoint: (progressX: number, taskY: number, taskHeight: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Method handles event in real time(mousemove) and on finish(mouseup)
|
|
10
|
+
*/
|
|
11
|
+
export declare const handleTaskBySVGMouseEvent: (svgX: number, action: BarMoveAction, selectedTask: BarTask, xStep: number, timeStep: number, initEventX1Delta: number, rtl: boolean) => {
|
|
12
|
+
isChanged: boolean;
|
|
13
|
+
changedTask: BarTask;
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Task, ViewMode } from '../types/public-types';
|
|
2
|
+
declare const DateTimeFormat: {
|
|
3
|
+
(locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
4
|
+
new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
5
|
+
supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[];
|
|
6
|
+
readonly prototype: Intl.DateTimeFormat;
|
|
7
|
+
};
|
|
8
|
+
type DateTimeFormat = typeof DateTimeFormat;
|
|
9
|
+
type DateHelperScales = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
10
|
+
export declare const getCachedDateTimeFormat: (locString: string | string[], opts?: any) => DateTimeFormat;
|
|
11
|
+
export declare const addToDate: (date: Date, quantity: number, scale: DateHelperScales) => Date;
|
|
12
|
+
export declare const startOfDate: (date: Date, scale: DateHelperScales) => Date;
|
|
13
|
+
export declare const ganttDateRange: (tasks: Task[], viewMode: ViewMode, preStepsCount: number) => Date[];
|
|
14
|
+
export declare const seedDates: (startDate: Date, endDate: Date, viewMode: ViewMode) => Date[];
|
|
15
|
+
export declare const getLocaleMonth: (date: Date, locale: string) => any;
|
|
16
|
+
export declare const getLocalDayOfWeek: (date: Date, locale: string, format?: 'long' | 'short' | 'narrow' | undefined) => any;
|
|
17
|
+
export declare const getWeekNumberISO8601: (date: Date) => string;
|
|
18
|
+
export declare const getDaysInMonth: (month: number, year: number) => number;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BarTask } from '../types/bar-task';
|
|
3
|
+
import { Task } from '../types/public-types';
|
|
4
|
+
export declare function isKeyboardEvent(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent): event is React.KeyboardEvent;
|
|
5
|
+
export declare function isMouseEvent(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent): event is React.MouseEvent;
|
|
6
|
+
export declare function isBarTask(task: Task | BarTask): task is BarTask;
|
|
7
|
+
export declare function removeHiddenTasks(tasks: Task[]): Task[];
|
|
8
|
+
export declare const sortTasks: (taskA: Task, taskB: Task) => 0 | 1 | -1;
|
|
9
|
+
export declare const getYmd: (date: Date) => string | 0;
|