@itcase/gantt-old 0.0.0-stage → 1.2.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.
Files changed (126) hide show
  1. package/README.md +0 -3
  2. package/dist/css/components/Chart/Chart.css +15 -0
  3. package/dist/css/components/Dependencies/Dependence.css +6 -0
  4. package/dist/css/components/Divider/Divider.css +94 -0
  5. package/dist/css/components/EmployeesList/EmployeesList.css +41 -0
  6. package/dist/css/components/GroupBar/GroupBar.css +20 -0
  7. package/dist/css/components/Header/Header.css +55 -0
  8. package/dist/css/components/InvalidTaskBar/InvalidTaskBar.css +23 -0
  9. package/dist/css/components/Scale/Scale.css +62 -0
  10. package/dist/css/components/ScrollBar/ScrollBar.css +16 -0
  11. package/dist/css/components/ScrollTop/ScrollTop.css +16 -0
  12. package/dist/css/components/SelectionIndicator/SelectionIndicator.css +7 -0
  13. package/dist/css/components/TableBody/RowToggler.css +25 -0
  14. package/dist/css/components/TableInterval/TableInterval.css +65 -0
  15. package/dist/css/components/TableTask/TableTask.css +41 -0
  16. package/dist/css/components/TaskBar/TaskBar.css +96 -0
  17. package/dist/css/components/TaskBarThumb/TaskBarThumb.css +35 -0
  18. package/dist/css/components/TimeIndicator/TimeIndicator.css +18 -0
  19. package/dist/css/components/Today/Today.css +13 -0
  20. package/dist/css/styles/main.css +758 -0
  21. package/dist/css/styles/mediaqueries.css +66 -0
  22. package/dist/css/styles/mixin_elevation.css +33 -0
  23. package/dist/css/styles/mixin_fill-gradient.css +23 -0
  24. package/dist/css/styles/mixin_global.css +54 -0
  25. package/dist/esm/index.js +3592 -0
  26. package/dist/types/components/BarList/BarList.d.ts +3 -0
  27. package/dist/types/components/BarList/index.d.ts +2 -0
  28. package/dist/types/components/BarThumbList/BarThumbList.d.ts +3 -0
  29. package/dist/types/components/BarThumbList/index.d.ts +2 -0
  30. package/dist/types/components/Chart/Chart.d.ts +3 -0
  31. package/dist/types/components/Chart/index.d.ts +2 -0
  32. package/dist/types/components/ContextMenu/index.d.ts +2 -0
  33. package/dist/types/components/Dependencies/Dependence.d.ts +7 -0
  34. package/dist/types/components/Dependencies/Dependencies.d.ts +3 -0
  35. package/dist/types/components/Dependencies/index.d.ts +2 -0
  36. package/dist/types/components/Divider/Divider.d.ts +3 -0
  37. package/dist/types/components/Divider/index.d.ts +2 -0
  38. package/dist/types/components/DragGroupOverlay/DragGroupOverlay.d.ts +6 -0
  39. package/dist/types/components/DragGroupOverlay/dragGroupOverlay.interface.d.ts +8 -0
  40. package/dist/types/components/DragGroupOverlay/index.d.ts +2 -0
  41. package/dist/types/components/DragPlaceOverlay/DragPlaceOverlay.d.ts +6 -0
  42. package/dist/types/components/DragPlaceOverlay/dragPlaceOverlay.interface.d.ts +6 -0
  43. package/dist/types/components/DragPlaceOverlay/index.d.ts +2 -0
  44. package/dist/types/components/DragPresent/DragPresent.d.ts +3 -0
  45. package/dist/types/components/DragPresent/index.d.ts +2 -0
  46. package/dist/types/components/DragResize/AutoScroller.d.ts +22 -0
  47. package/dist/types/components/DragResize/DragResize.d.ts +30 -0
  48. package/dist/types/components/DragResize/index.d.ts +2 -0
  49. package/dist/types/components/DragTaskOverlay/DragTaskOverlay.d.ts +6 -0
  50. package/dist/types/components/DragTaskOverlay/DragTaskOverlay.interface.d.ts +7 -0
  51. package/dist/types/components/DragTaskOverlay/index.d.ts +2 -0
  52. package/dist/types/components/Draggable/Draggable.d.ts +21 -0
  53. package/dist/types/components/Draggable/DraggableOverlay.d.ts +9 -0
  54. package/dist/types/components/Draggable/draggable-svg.d.ts +9 -0
  55. package/dist/types/components/Draggable/index.d.ts +3 -0
  56. package/dist/types/components/EmployeesList/EmployeesList.d.ts +6 -0
  57. package/dist/types/components/EmployeesList/EmployeesList.interface.d.ts +13 -0
  58. package/dist/types/components/EmployeesList/index.d.ts +2 -0
  59. package/dist/types/components/Gantt/Gantt.d.ts +59 -0
  60. package/dist/types/components/GroupBar/GroupBar.d.ts +7 -0
  61. package/dist/types/components/GroupBar/index.d.ts +2 -0
  62. package/dist/types/components/GroupContainer/GroupContainer.d.ts +14 -0
  63. package/dist/types/components/GroupContainer/index.d.ts +3 -0
  64. package/dist/types/components/Header/Header.d.ts +3 -0
  65. package/dist/types/components/Header/index.d.ts +2 -0
  66. package/dist/types/components/InvalidTaskBar/InvalidTaskBar.d.ts +7 -0
  67. package/dist/types/components/InvalidTaskBar/index.d.ts +2 -0
  68. package/dist/types/components/Item/Item.d.ts +37 -0
  69. package/dist/types/components/Item/components/Action/Action.d.ts +9 -0
  70. package/dist/types/components/Item/components/Action/index.d.ts +2 -0
  71. package/dist/types/components/Item/components/Handle/Handle.d.ts +3 -0
  72. package/dist/types/components/Item/components/Handle/index.d.ts +1 -0
  73. package/dist/types/components/Item/components/Remove/Remove.d.ts +2 -0
  74. package/dist/types/components/Item/components/Remove/index.d.ts +1 -0
  75. package/dist/types/components/Item/components/index.d.ts +3 -0
  76. package/dist/types/components/Item/index.d.ts +3 -0
  77. package/dist/types/components/MultipleContainers/MultipleContainers.d.ts +5 -0
  78. package/dist/types/components/MultipleContainers/index.d.ts +2 -0
  79. package/dist/types/components/MultipleContainers/multipleContainers.interface.d.ts +26 -0
  80. package/dist/types/components/MultipleContainers/multipleContainersKeyboardCoordinates.d.ts +2 -0
  81. package/dist/types/components/PlaceContainer/PlaceContainer.d.ts +15 -0
  82. package/dist/types/components/PlaceContainer/index.d.ts +3 -0
  83. package/dist/types/components/Scale/Scale.d.ts +6 -0
  84. package/dist/types/components/Scale/index.d.ts +2 -0
  85. package/dist/types/components/ScrollBar/ScrollBar.d.ts +3 -0
  86. package/dist/types/components/ScrollBar/index.d.ts +2 -0
  87. package/dist/types/components/ScrollTop/ScrollTop.d.ts +3 -0
  88. package/dist/types/components/ScrollTop/index.d.ts +2 -0
  89. package/dist/types/components/SelectionIndicator/SelectionIndicator.d.ts +3 -0
  90. package/dist/types/components/SelectionIndicator/index.d.ts +2 -0
  91. package/dist/types/components/SortableContainer/SortableContainer.d.ts +13 -0
  92. package/dist/types/components/SortableContainer/index.d.ts +2 -0
  93. package/dist/types/components/SortableItem/SortableItem.d.ts +3 -0
  94. package/dist/types/components/SortableItem/index.d.ts +2 -0
  95. package/dist/types/components/SortableItem/sortableItem.interface.d.ts +20 -0
  96. package/dist/types/components/SortablePlace/SortablePlace.d.ts +16 -0
  97. package/dist/types/components/SortablePlace/index.d.ts +2 -0
  98. package/dist/types/components/Table/Table.d.ts +5 -0
  99. package/dist/types/components/Table/index.d.ts +2 -0
  100. package/dist/types/components/TableBody/RowToggler.d.ts +9 -0
  101. package/dist/types/components/TableBody/TableBody.d.ts +3 -0
  102. package/dist/types/components/TableBody/index.d.ts +2 -0
  103. package/dist/types/components/TableInterval/TableInterval.d.ts +3 -0
  104. package/dist/types/components/TableInterval/index.d.ts +2 -0
  105. package/dist/types/components/TableTask/TableTask.d.ts +3 -0
  106. package/dist/types/components/TableTask/index.d.ts +2 -0
  107. package/dist/types/components/TaskBar/TaskBar.d.ts +7 -0
  108. package/dist/types/components/TaskBar/index.d.ts +2 -0
  109. package/dist/types/components/TaskBarThumb/TaskBarThumb.d.ts +7 -0
  110. package/dist/types/components/TaskBarThumb/index.d.ts +2 -0
  111. package/dist/types/components/TimeIndicator/TimeIndicator.d.ts +3 -0
  112. package/dist/types/components/TimeIndicator/index.d.ts +2 -0
  113. package/dist/types/components/Today/Today.d.ts +3 -0
  114. package/dist/types/components/Today/index.d.ts +2 -0
  115. package/dist/types/config/constants.d.ts +7 -0
  116. package/dist/types/context/GanttContext.d.ts +44 -0
  117. package/dist/types/hooks/useDragResize.d.ts +10 -0
  118. package/dist/types/index.d.ts +5 -0
  119. package/dist/types/locales/index.d.ts +1 -0
  120. package/dist/types/locales/ru-ru.d.ts +2 -0
  121. package/dist/types/locales/types.d.ts +31 -0
  122. package/dist/types/providers/TasksPropsProvider.d.ts +3 -0
  123. package/dist/types/store/GanttStore.d.ts +181 -0
  124. package/dist/types/types/types.d.ts +262 -0
  125. package/dist/types/utils/index.d.ts +12 -0
  126. package/package.json +106 -4
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { UniqueIdentifier } from '@dnd-kit/core';
3
+ import { ContainerProps } from '../GroupContainer';
4
+ interface iSortablePlaceProps extends ContainerProps {
5
+ id: UniqueIdentifier;
6
+ children: React.ReactNode;
7
+ disabled?: boolean;
8
+ items: UniqueIdentifier[];
9
+ placeData: any;
10
+ style?: React.CSSProperties;
11
+ toggleCollapsePlace: (placeId: UniqueIdentifier) => void;
12
+ }
13
+ declare const SortablePlace: ((props: iSortablePlaceProps) => import("react/jsx-runtime").JSX.Element) & {
14
+ displayName: string;
15
+ };
16
+ export { SortablePlace };
@@ -0,0 +1,2 @@
1
+ import { SortablePlace } from './SortablePlace';
2
+ export { SortablePlace };
@@ -0,0 +1,5 @@
1
+ declare function Table(): import("react/jsx-runtime").JSX.Element;
2
+ declare const _default: typeof Table & {
3
+ displayName: string;
4
+ };
5
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import Table from './Table';
2
+ export { Table };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface RowTogglerProps {
3
+ onClick: React.DOMAttributes<HTMLDivElement>['onClick'];
4
+ isCollapsed: boolean;
5
+ level: number;
6
+ prefixCls?: string;
7
+ }
8
+ declare const RowToggler: React.FC<RowTogglerProps>;
9
+ export default RowToggler;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const TableBody: React.FC;
3
+ export default TableBody;
@@ -0,0 +1,2 @@
1
+ import TableBody from './TableBody';
2
+ export { TableBody };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.FunctionComponent<{}>;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import TableInterval from './TableInterval';
2
+ export { TableInterval };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.FunctionComponent<{}>;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import TableTask from './TableTask';
2
+ export { TableTask };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Gantt } from '../../types/types';
3
+ interface TaskBarProps {
4
+ data: Gantt.Bar;
5
+ }
6
+ declare const _default: React.FunctionComponent<TaskBarProps>;
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import TaskBar from './TaskBar';
2
+ export { TaskBar };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { Gantt } from '../../types/types';
3
+ interface TaskBarProps {
4
+ data: Gantt.Bar;
5
+ }
6
+ declare const _default: React.FunctionComponent<TaskBarProps>;
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import TaskBarThumb from './TaskBarThumb';
2
+ export { TaskBarThumb };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.FunctionComponent<{}>;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import TimeIndicator from './TimeIndicator';
2
+ export { TimeIndicator };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.FunctionComponent<{}>;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import Today from './Today';
2
+ export { Today };
@@ -0,0 +1,7 @@
1
+ export declare const ROW_HEIGHT = 40;
2
+ export declare const HEADER_HEIGHT = 56;
3
+ export declare const BAR_HEIGHT = 8;
4
+ export declare const TOP_PADDING = 0;
5
+ export declare const TABLE_INDENT = 30;
6
+ export declare const MIN_VIEW_RATE = 0.5;
7
+ export declare const ONE_MIN_MS: number;
@@ -0,0 +1,44 @@
1
+ import type React from 'react';
2
+ import type GanttStore from '../store/GanttStore';
3
+ import type { DefaultRecordType, Gantt } from '../types/types';
4
+ export interface GanttContext<RecordType = DefaultRecordType> {
5
+ store: GanttStore;
6
+ getBarColor?: (record: Gantt.Record<RecordType>) => {
7
+ backgroundColor: string;
8
+ borderColor: string;
9
+ };
10
+ showBackToday: boolean;
11
+ showUnitSwitch: boolean;
12
+ onRow?: {
13
+ onClick: (record: Gantt.Record<RecordType>) => void;
14
+ };
15
+ tableIndent: number;
16
+ barHeight: number;
17
+ expandIcon?: ({ level, isCollapsed, onClick, }: {
18
+ level: number;
19
+ isCollapsed: boolean;
20
+ onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
21
+ }) => React.ReactNode;
22
+ renderBar?: (barInfo: Gantt.Bar<RecordType>, { width, height }: {
23
+ width: number;
24
+ height: number;
25
+ }) => React.ReactNode;
26
+ renderInvalidBar?: (element: React.ReactNode, barInfo: Gantt.Bar<RecordType>) => React.ReactNode;
27
+ renderGroupBar?: (barInfo: Gantt.Bar<RecordType>, { width, height }: {
28
+ width: number;
29
+ height: number;
30
+ }) => React.ReactNode;
31
+ renderBarThumb?: (item: Gantt.Record<RecordType>, type: 'left' | 'right') => React.ReactNode;
32
+ onBarClick?: (record: Gantt.Record<RecordType>) => void;
33
+ onClickTaskItem: (taskId: number) => void;
34
+ tableCollapseAble: boolean;
35
+ scrollTop: boolean | React.CSSProperties;
36
+ alwaysShowTaskBar?: boolean;
37
+ renderLeftText?: (barInfo: Gantt.Bar<RecordType>) => React.ReactNode;
38
+ renderRightText?: (barInfo: Gantt.Bar<RecordType>) => React.ReactNode;
39
+ onExpand?: (record: Gantt.Record<RecordType>, isCollapsed: boolean) => void;
40
+ mediaUrl?: string;
41
+ hideTable?: boolean;
42
+ }
43
+ declare const context: React.Context<GanttContext<DefaultRecordType>>;
44
+ export default context;
@@ -0,0 +1,10 @@
1
+ import type React from 'react';
2
+ export default function useDragResize(handleResize: ({ width }: {
3
+ width: number;
4
+ }) => void, { initSize, minWidth: minWidthConfig, maxWidth: maxWidthConfig, }: {
5
+ initSize: {
6
+ width: number;
7
+ };
8
+ minWidth?: number;
9
+ maxWidth?: number;
10
+ }): [(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void, boolean];
@@ -0,0 +1,5 @@
1
+ import GanttComponent, { GanttProps, GanttRef } from './components/Gantt/Gantt';
2
+ export type { Gantt, ITask as Task, iTaskRecord as TaskRecord, iTasksGroup as TasksGroup, } from './types/types';
3
+ export type { GanttProps, GanttRef };
4
+ export * from './locales';
5
+ export default GanttComponent;
@@ -0,0 +1 @@
1
+ export * from './ru-ru';
@@ -0,0 +1,2 @@
1
+ import type { GanttLocale } from './types';
2
+ export declare const ruRU: GanttLocale;
@@ -0,0 +1,31 @@
1
+ export interface GanttLocale {
2
+ today: string;
3
+ minute: string;
4
+ hour: string;
5
+ day: string;
6
+ days: string;
7
+ week: string;
8
+ month: string;
9
+ quarter: string;
10
+ halfYear: string;
11
+ firstHalf: string;
12
+ secondHalf: string;
13
+ majorFormat: {
14
+ minute: string;
15
+ hour: string;
16
+ day: string;
17
+ week: string;
18
+ month: string;
19
+ quarter: string;
20
+ halfYear: string;
21
+ };
22
+ minorFormat: {
23
+ minute: string;
24
+ hour: string;
25
+ day: string;
26
+ week: string;
27
+ month: string;
28
+ quarter: string;
29
+ halfYear: string;
30
+ };
31
+ }
@@ -0,0 +1,3 @@
1
+ declare function TasksPropsProvider(props: any): import("react/jsx-runtime").JSX.Element;
2
+ declare const useTasksProps: () => {};
3
+ export { TasksPropsProvider, useTasksProps };
@@ -0,0 +1,181 @@
1
+ import type React from 'react';
2
+ import type { Dayjs } from 'dayjs';
3
+ import type { GanttLocale } from '../locales/types';
4
+ import { Gantt } from '../types/types';
5
+ export declare const defaultLocale: GanttLocale;
6
+ export declare const ONE_DAY_MS = 86400000;
7
+ export declare const ONE_HOUR_MS: number;
8
+ export declare const ONE_MIN_MS: number;
9
+ export declare const getViewTypeList: (locale: GanttLocale) => Gantt.ISightConfig[];
10
+ declare function isRestDay(date: string): boolean;
11
+ declare class GanttStore {
12
+ constructor({ rowHeight, disabled, customSights, taskStatusesChoices, }: {
13
+ rowHeight: number;
14
+ disabled: boolean;
15
+ customSights: Gantt.ISightConfig[];
16
+ });
17
+ _wheelTimer: number | undefined;
18
+ scrollTimer: number | undefined;
19
+ locale: GanttLocale;
20
+ data: Gantt.Item[];
21
+ originData: Gantt.Record[];
22
+ columns: Array<any>;
23
+ dependencies: Gantt.Dependence[];
24
+ scrolling: boolean;
25
+ scrollTop: number;
26
+ collapse: boolean;
27
+ tableWidth: number;
28
+ viewWidth: number;
29
+ width: number;
30
+ height: number;
31
+ bodyWidth: number;
32
+ translateX: number;
33
+ sightConfig: Gantt.ISightConfig;
34
+ showSelectionIndicator: boolean;
35
+ selectionIndicatorTop: number;
36
+ dragging: Gantt.Bar | null;
37
+ draggingType: Gantt.MoveType | null;
38
+ disabled: boolean;
39
+ minDateLimit: any;
40
+ maxDateLimit: any;
41
+ contextMenuData: {
42
+ item: any;
43
+ };
44
+ viewTypeList: Gantt.ISightConfig[];
45
+ gestureKeyPress: boolean;
46
+ mainElementRef: React.RefObject<HTMLDivElement>;
47
+ chartElementRef: React.RefObject<HTMLDivElement>;
48
+ isPointerPress: boolean;
49
+ startDateKey: string;
50
+ endDateKey: string;
51
+ autoScrollPos: number;
52
+ clientX: number;
53
+ rowHeight: number;
54
+ taskStatusesChoices: {};
55
+ onUpdate: (data: any, dt_begin?: string, dt_end?: string) => Promise<boolean>;
56
+ onSortingChange: (_updatedGroup: any) => Promise<boolean>;
57
+ onGroupSortingChange: (updatedGroupsList: any[], placeId: number) => (number | any[])[];
58
+ onPlaceSortingChange: (_updatedPlacesList: any[]) => Promise<boolean>;
59
+ onMoveTaskToAnotherGroup: (_newGroup: any, _oldGroup: any, _movedTask: object) => Promise<boolean>;
60
+ onCreateNewTask: (_newTask: any, _groupId: string | number) => boolean;
61
+ onAddTaskAssignee: (_taskId: number) => number;
62
+ isRestDay: typeof isRestDay;
63
+ getStartDate(): string;
64
+ setIsRestDay(function_: (date: string) => boolean): void;
65
+ update(data?: {}): void;
66
+ setData(data: Gantt.Record[] | any, startDateKey?: string, endDateKey?: string): void;
67
+ setShowSelectionIndicator(showSelectionIndicator: boolean): void;
68
+ setScrollTop(scrollTopValue: number): void;
69
+ setScrolling(scrolling: boolean): void;
70
+ toggleCollapse(): void;
71
+ toggleCollapseGroup(groupId: number | string): void;
72
+ toggleCollapsePlace(placeId: number): void;
73
+ setRowCollapse(item: Gantt.Item, isCollapsed: boolean): void;
74
+ setOnUpdate(onUpdate: any): void;
75
+ setOnSortingChange(onSortingChange: any): void;
76
+ setOnGroupSortingChange(onGroupSortingChange: any): void;
77
+ setOnPlaceSortingChange(onPlaceSortingChange: any): void;
78
+ setOnMoveTaskToAnotherGroup(onMoveTaskToAnotherGroup: (newGroup: any, oldGroup: any, movedTask: any) => Promise<boolean>): void;
79
+ setOnCreateNewTask(onCreateNewTask: any): void;
80
+ setOnAddTaskAssignee(onAddTaskAssignee: any): void;
81
+ setColumns(columns: Array<any>): void;
82
+ setDependencies(dependencies: Gantt.Dependence[]): void;
83
+ setHideTable(isHidden?: boolean): void;
84
+ setMinDateLimit(minDateLimit: string | null): void;
85
+ setMaxDateLimit(maxDateLimit: string | null): void;
86
+ handlePanMove(translateX: number): void;
87
+ handlePanEnd(): void;
88
+ syncSize(size: {
89
+ width?: number;
90
+ height?: number;
91
+ }): void;
92
+ handleResizeTableWidth(width: number): void;
93
+ initWidth(): void;
94
+ setTranslateX(translateX: number): void;
95
+ switchSight(type: Gantt.Sight): void;
96
+ scrollToToday(): void;
97
+ getTranslateXByDate(date: string): number;
98
+ get currentTimeUnit(): 'day' | 'hour' | 'minute';
99
+ get todayTranslateX(): number;
100
+ get scrollBarWidth(): number;
101
+ get scrollBalanceRatio(): number;
102
+ get scrollLimitations(): {
103
+ min: number;
104
+ max: number;
105
+ };
106
+ get scrollLeft(): number;
107
+ get scrollWidth(): number;
108
+ get bodyClientHeight(): number;
109
+ getMaxRange(bar: any): {
110
+ width: number;
111
+ translateX: number;
112
+ earliestDate?: undefined;
113
+ latestDate?: undefined;
114
+ } | {
115
+ width: number;
116
+ translateX: number;
117
+ earliestDate: Dayjs;
118
+ latestDate: Dayjs;
119
+ };
120
+ get bodyScrollHeight(): number;
121
+ get pxUnitAmp(): number;
122
+ /** Current start time in milliseconds */
123
+ get translateAmp(): number;
124
+ getDurationAmp(): number;
125
+ getWidthByDate: (dt_begin: Dayjs, dt_end: Dayjs) => number;
126
+ getMajorList(): Gantt.Major[];
127
+ majorAmp2Px(ampList: Gantt.MajorAmp[]): {
128
+ label: string;
129
+ left: number;
130
+ width: number;
131
+ key: string;
132
+ }[];
133
+ getMinorList(): Gantt.Minor[];
134
+ startXRectBar: (startX: number) => {
135
+ left: number;
136
+ width: number;
137
+ };
138
+ minorAmp2Px(ampList: Gantt.MinorAmp[]): Gantt.Minor[];
139
+ getTaskBarThumbVisible(barInfo: Gantt.Bar): boolean;
140
+ scrollToBar(barInfo: Gantt.Bar, type: 'left' | 'right'): void;
141
+ get getColumnsWidth(): number[];
142
+ get getAllGroupRecordsList(): Gantt.Record[];
143
+ get getRecordList(): Gantt.Record[];
144
+ get getBarList(): Gantt.Bar[];
145
+ handleWheel: (event: WheelEvent) => void;
146
+ handleScroll: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void;
147
+ scrollY: import("lodash").DebouncedFuncLeading<(scrollTop: number) => void>;
148
+ get getVisibleRows(): {
149
+ start: number;
150
+ count: number;
151
+ };
152
+ handleMouseMove: import("lodash").DebouncedFunc<(event: any) => void>;
153
+ handleMouseLeave(): void;
154
+ showSelectionBar(event: MouseEvent): void;
155
+ getHovered: (top: number) => boolean;
156
+ handleDragStart(barInfo: Gantt.Bar, type: Gantt.MoveType): void;
157
+ handleDragEnd(): void;
158
+ handleInvalidBarLeave(): void;
159
+ handleInvalidBarHover(barInfo: Gantt.Bar, left: number, width: number): void;
160
+ handleInvalidBarDragStart(barInfo: Gantt.Bar): void;
161
+ handleInvalidBarDragEnd(barInfo: Gantt.Bar, oldSize: {
162
+ width: number;
163
+ x: number;
164
+ }): Promise<void>;
165
+ updateBarSize(barInfo: Gantt.Bar, { width, x }: {
166
+ width: number;
167
+ x: number;
168
+ }): Gantt.Bar<import("../types/types").DefaultRecordType>;
169
+ getMovedDay(ms: number): number;
170
+ getMovedHour(ms: number): number;
171
+ getMovedMinutes(ms: number): number;
172
+ updateTaskMinutes(barInfo: Gantt.Bar, oldSize: {
173
+ width: number;
174
+ x: number;
175
+ }, type: 'move' | 'left' | 'right'): Promise<void>;
176
+ updateOriginGroupsSorting(updatedGroupsList: any[], placeId: number): void;
177
+ createNewTask(newTask: any, groupId: string | number): boolean;
178
+ isToday(key: string): boolean;
179
+ isCurrentHour(key: string): boolean;
180
+ }
181
+ export default GanttStore;
@@ -0,0 +1,262 @@
1
+ import type React from 'react';
2
+ import type { Dayjs } from 'dayjs';
3
+ export type DefaultRecordType = Record<string, any>;
4
+ export declare namespace Gantt {
5
+ interface Major {
6
+ width: number;
7
+ left: number;
8
+ label: string;
9
+ key: string;
10
+ }
11
+ interface MajorAmp {
12
+ label: string;
13
+ dt_begin: Dayjs;
14
+ dt_end: Dayjs;
15
+ }
16
+ interface Minor {
17
+ width: number;
18
+ left: number;
19
+ label: string;
20
+ isWeek: boolean;
21
+ key: string;
22
+ }
23
+ interface MinorAmp {
24
+ label: string;
25
+ dt_begin: Dayjs;
26
+ dt_end: Dayjs;
27
+ }
28
+ type Sight = 'hour' | 'day' | 'week' | 'month' | 'quarter';
29
+ type MoveType = 'left' | 'right' | 'move' | 'create';
30
+ enum ESightValues {
31
+ hour = 200,
32
+ day = 2700,
33
+ week = 9200,
34
+ month = 41000,
35
+ quarter = 86400
36
+ }
37
+ interface ISightConfig {
38
+ type: Sight;
39
+ label: string;
40
+ value: ESightValues;
41
+ }
42
+ type Record<RecordType = DefaultRecordType> = RecordType & {
43
+ group?: boolean;
44
+ borderColor?: string;
45
+ backgroundColor?: string;
46
+ isCollapsed?: boolean;
47
+ children?: Record<RecordType>[];
48
+ disabled?: boolean;
49
+ };
50
+ interface Item<RecordType = DefaultRecordType> {
51
+ groups: {
52
+ tasks: any;
53
+ record: Record<RecordType>;
54
+ id: number;
55
+ sort: number;
56
+ key: React.Key;
57
+ dt_begin: string | null;
58
+ dt_end: string | null;
59
+ content: string;
60
+ isCollapsed: boolean;
61
+ group?: boolean;
62
+ children?: Item<RecordType>[];
63
+ _parent?: Item<RecordType>;
64
+ _bar?: Bar<RecordType>;
65
+ _depth?: number;
66
+ _index?: number;
67
+ }[];
68
+ tasks: any;
69
+ record: Record<RecordType>;
70
+ sort: number;
71
+ key: React.Key;
72
+ dt_begin: string | null;
73
+ dt_end: string | null;
74
+ content: string;
75
+ isCollapsed: boolean;
76
+ group?: boolean;
77
+ children?: Item<RecordType>[];
78
+ _parent?: Item<RecordType>;
79
+ _bar?: Bar<RecordType>;
80
+ _depth?: number;
81
+ _index?: number;
82
+ }
83
+ interface Bar<RecordType = DefaultRecordType> {
84
+ key: React.Key;
85
+ label: string;
86
+ width: number;
87
+ isGroupRow?: boolean;
88
+ isPlaceRow?: boolean;
89
+ translateX: number;
90
+ translateY: number;
91
+ stepGesture: string;
92
+ invalidDateRange: boolean;
93
+ dateTextFormat: (startX: number) => string;
94
+ getDateWidth: (startX: number, endX: number, timeUnit?: any) => string;
95
+ task: Item<RecordType>;
96
+ record: Record<RecordType>;
97
+ loading: boolean;
98
+ groupId?: number | string;
99
+ _group?: boolean;
100
+ _depth: number;
101
+ _index?: number;
102
+ _childrenCount: number;
103
+ _parent?: Item<RecordType>;
104
+ }
105
+ type ColumnAlign = 'center' | 'right' | 'left';
106
+ interface Column<RecordType = DefaultRecordType> {
107
+ width?: number;
108
+ minWidth?: number;
109
+ maxWidth?: number;
110
+ flex?: number;
111
+ name: string;
112
+ label: string;
113
+ style?: any;
114
+ render?: (item: Record<RecordType>) => React.ReactNode;
115
+ align?: ColumnAlign;
116
+ }
117
+ type DependenceType = 'start_finish' | 'finish_start' | 'start_start' | 'finish_finish';
118
+ interface Dependence {
119
+ from: string;
120
+ to: string;
121
+ type: DependenceType;
122
+ color?: string;
123
+ }
124
+ }
125
+ interface Facility {
126
+ active: boolean;
127
+ id: number;
128
+ name: string;
129
+ sort: number;
130
+ time_zone: string;
131
+ time_zone_offset: string;
132
+ }
133
+ interface User {
134
+ email: string;
135
+ first_name: string;
136
+ last_name: string;
137
+ phone: string;
138
+ id: number;
139
+ is_type_admin: boolean;
140
+ is_type_director: boolean;
141
+ is_type_brigadier: boolean;
142
+ is_type_employee: boolean;
143
+ is_type_external_employee: boolean;
144
+ }
145
+ interface Approval {
146
+ id: number;
147
+ approver: User;
148
+ comment: string;
149
+ dt_create: string;
150
+ }
151
+ type Creator = User;
152
+ interface PlaceEntity {
153
+ active: boolean;
154
+ cell_tier: string;
155
+ identifier: string;
156
+ image: string;
157
+ name: string;
158
+ type: {
159
+ id: number;
160
+ image: string;
161
+ image_list_version: string;
162
+ image_detail_version: string;
163
+ image_gallery_version: string;
164
+ creator: Creator;
165
+ active: boolean;
166
+ dt_create: string;
167
+ name: string;
168
+ sort: number;
169
+ };
170
+ place_zone: {
171
+ frontend_data: string;
172
+ id: number;
173
+ name: string;
174
+ };
175
+ }
176
+ interface IBlock {
177
+ id: number;
178
+ creator: User;
179
+ facility: Facility;
180
+ dt_create: string;
181
+ name: string;
182
+ sort: number;
183
+ frontend_data: string;
184
+ }
185
+ interface IZone {
186
+ id: number;
187
+ creator: User;
188
+ facility: Facility;
189
+ block: IBlock;
190
+ dt_create: string;
191
+ name: string;
192
+ sort: number;
193
+ frontend_data: string;
194
+ }
195
+ interface IPlaceSection {
196
+ id: number;
197
+ creator: User;
198
+ facility: Facility;
199
+ zone: IZone;
200
+ dt_create: string;
201
+ name: string;
202
+ sort: number;
203
+ frontend_data: string;
204
+ }
205
+ interface iPlaceObject {
206
+ [place: string]: {
207
+ [groups: string]: Array<iTaskRecord>;
208
+ };
209
+ }
210
+ interface iTaskPlace {
211
+ id: number;
212
+ sort: number;
213
+ name: string;
214
+ comment: string;
215
+ groups: iTasksGroup[];
216
+ placeKey: string;
217
+ place_department: any;
218
+ place_block: any;
219
+ place_zone: any;
220
+ place_section: any;
221
+ place_tray: any;
222
+ place_row: any;
223
+ place_rowside: any;
224
+ place_cell: any;
225
+ place_entity: any;
226
+ }
227
+ interface iTasksGroup {
228
+ id: number | string;
229
+ sort: number;
230
+ name: string;
231
+ comment: string;
232
+ tasks: iTaskRecord[];
233
+ }
234
+ interface iTaskRecord {
235
+ id: number;
236
+ comment: string;
237
+ sort: number;
238
+ task: ITask;
239
+ }
240
+ interface ITask {
241
+ id: number;
242
+ place_section?: IPlaceSection;
243
+ place_entity?: number | PlaceEntity;
244
+ creator?: Creator;
245
+ facility?: Facility | number;
246
+ executor_users?: User[];
247
+ approval?: Approval;
248
+ dt_create?: string;
249
+ dt_begin?: string;
250
+ dt_end?: string;
251
+ status?: string;
252
+ priority?: string;
253
+ dt_begin_actual?: string;
254
+ dt_end_actual?: string;
255
+ name?: string;
256
+ sort?: number;
257
+ name_short?: string;
258
+ approval_type?: string;
259
+ parallel_task?: number;
260
+ constructor?: number;
261
+ }
262
+ export type { iTaskPlace, iTasksGroup, iTaskRecord, ITask, IPlaceSection, iPlaceObject };