@svar-ui/gantt-store 2.7.2 → 2.8.0
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/DataStore.d.ts +46 -9
- package/dist/types/GanttDataTree.d.ts +2 -1
- package/dist/types/columns.d.ts +8 -3
- package/dist/types/constraintTypes.d.ts +2 -0
- package/dist/types/helpers/data.d.ts +4 -0
- package/dist/types/helpers/editorItems.d.ts +12 -8
- package/dist/types/helpers/progress.d.ts +3 -0
- package/dist/types/helpers/progressLine.d.ts +2 -0
- package/dist/types/helpers/sCurve.d.ts +2 -0
- package/dist/types/helpers/toolbarButtons.d.ts +1 -0
- package/dist/types/inclusiveEnd.d.ts +4 -0
- package/dist/types/index.d.ts +12 -5
- package/dist/types/layout/displayMode.d.ts +6 -0
- package/dist/types/layout/panels.d.ts +51 -0
- package/dist/types/links.d.ts +1 -1
- package/dist/types/normalizeDates.d.ts +5 -3
- package/dist/types/placeholder.d.ts +6 -0
- package/dist/types/resourceLoad.d.ts +24 -0
- package/dist/types/scales.d.ts +13 -1
- package/dist/types/schedule-types.d.ts +3 -0
- package/dist/types/tasks.d.ts +21 -4
- package/dist/types/time.d.ts +1 -0
- package/dist/types/types.d.ts +191 -24
- package/package.json +3 -2
|
@@ -1,31 +1,47 @@
|
|
|
1
1
|
import { Store, EventBus } from "@svar-ui/lib-state";
|
|
2
2
|
import type { TDataConfig, TWritableCreator, TID } from "@svar-ui/lib-state";
|
|
3
|
-
import {
|
|
4
|
-
import { GroupManager } from "./pro/GroupManager";
|
|
5
|
-
import type { IData, IDataConfig, ITask, TMethodsConfig, IGanttColumn, IResourceColumn, ILink, IResource, IVisibleArea, IParsedTask, IExportConfig, TFilterHandler, TScrollMode, IAssignment, IGroupByConfig, TDataName, TResourceAssignment, ICalendar, TDisplayMode } from "./types";
|
|
3
|
+
import type { IData, IDataConfig, ITask, TMethodsConfig, IGanttColumn, IResourceColumn, ILink, IResource, IVisibleArea, IParsedTask, IExportConfig, TFilterHandler, TScrollMode, IAssignment, IGroupByConfig, TDataName, TResourceAssignment, ICalendar, TDisplayModeConfig, IConflict, InvalidLinkReason, TLinkValidator, IHistoryManager, IGroupManager, TDisplayPanel, TColumnSection } from "./types";
|
|
6
4
|
export default class DataStore extends Store<IData> {
|
|
7
5
|
in: EventBus<TMethodsConfig, keyof TMethodsConfig>;
|
|
8
6
|
private _router;
|
|
9
7
|
private _modules;
|
|
10
|
-
private _prevScaleMinUnit?;
|
|
11
8
|
private _prevConfig;
|
|
9
|
+
private _pendingGeometry;
|
|
10
|
+
private _resizeStart;
|
|
11
|
+
private _placeholderRow;
|
|
12
12
|
constructor(w: TWritableCreator);
|
|
13
|
-
init(
|
|
13
|
+
init(config: Partial<IDataConfig>): void;
|
|
14
|
+
private isHistorySource;
|
|
15
|
+
private isRemote;
|
|
16
|
+
private resetDatasetState;
|
|
14
17
|
private changed;
|
|
18
|
+
private prepareLayoutConfig;
|
|
19
|
+
private resyncLayout;
|
|
20
|
+
private syncLayout;
|
|
15
21
|
private enableModule;
|
|
16
22
|
private disableModule;
|
|
17
23
|
setState(state: Partial<IData>, ctx?: TDataConfig): {
|
|
18
24
|
[key: string]: () => void;
|
|
19
25
|
};
|
|
20
26
|
setStateAsync(state: Partial<IData>): void;
|
|
27
|
+
private editedRows;
|
|
28
|
+
private markGeometry;
|
|
21
29
|
getTask(id: TID): IParsedTask;
|
|
30
|
+
getLinkValidator(): TLinkValidator;
|
|
22
31
|
getResource(id: TID): import("./types").IParsedResource;
|
|
23
|
-
getHistory():
|
|
32
|
+
getHistory(): IHistoryManager;
|
|
24
33
|
getCalendar(id?: TID): ICalendar | undefined;
|
|
34
|
+
private buildHighlightTime;
|
|
25
35
|
getTaskCalendar(task: Partial<ITask>): ICalendar | undefined;
|
|
36
|
+
private resolveTaskCalendar;
|
|
37
|
+
private indexAssignments;
|
|
38
|
+
private resolveCalendars;
|
|
26
39
|
getResourceCalendar(resource: Partial<IResource>): ICalendar | undefined;
|
|
40
|
+
private getAssignedCalendar;
|
|
41
|
+
private alignAssignedTask;
|
|
42
|
+
private alignToCalendar;
|
|
27
43
|
private getLoadHours;
|
|
28
|
-
getGrouping():
|
|
44
|
+
getGrouping(): IGroupManager;
|
|
29
45
|
serialize(config?: {
|
|
30
46
|
data: TDataName;
|
|
31
47
|
}): any[];
|
|
@@ -35,7 +51,11 @@ export default class DataStore extends Store<IData> {
|
|
|
35
51
|
private shouldExpandScale;
|
|
36
52
|
private isScheduled;
|
|
37
53
|
private resetSummaryDates;
|
|
54
|
+
private deriveSummary;
|
|
55
|
+
private applyInactiveDown;
|
|
56
|
+
private releaseManualSummaries;
|
|
38
57
|
private moveSummaryKids;
|
|
58
|
+
getPlaceholderRow(): IParsedTask;
|
|
39
59
|
getNextRow(id: TID): IParsedTask;
|
|
40
60
|
getPrevRow(id: TID): IParsedTask;
|
|
41
61
|
scrollToTask(id: TID, mode: TScrollMode): void;
|
|
@@ -49,6 +69,7 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
49
69
|
task: Partial<ITask>;
|
|
50
70
|
target?: TID;
|
|
51
71
|
mode?: "before" | "after" | "child";
|
|
72
|
+
index?: number;
|
|
52
73
|
show?: TScrollMode;
|
|
53
74
|
select?: boolean;
|
|
54
75
|
eventSource?: string;
|
|
@@ -75,7 +96,7 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
75
96
|
toggle?: boolean;
|
|
76
97
|
range?: boolean;
|
|
77
98
|
show?: TScrollMode;
|
|
78
|
-
focus?:
|
|
99
|
+
focus?: TDisplayPanel;
|
|
79
100
|
eventSource?: string;
|
|
80
101
|
};
|
|
81
102
|
["drag-task"]: {
|
|
@@ -92,6 +113,7 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
92
113
|
mode?: "before" | "after" | "child";
|
|
93
114
|
source?: TID;
|
|
94
115
|
lazy?: boolean;
|
|
116
|
+
index?: number;
|
|
95
117
|
eventSource?: string;
|
|
96
118
|
skipUndo?: boolean;
|
|
97
119
|
};
|
|
@@ -101,6 +123,8 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
101
123
|
mode: "before" | "after" | "up" | "down" | "child";
|
|
102
124
|
inProgress?: boolean;
|
|
103
125
|
source?: TID;
|
|
126
|
+
eventSource?: string;
|
|
127
|
+
skipUndo?: boolean;
|
|
104
128
|
};
|
|
105
129
|
["indent-task"]: {
|
|
106
130
|
id: TID;
|
|
@@ -109,6 +133,9 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
109
133
|
["show-editor"]: {
|
|
110
134
|
id: TID;
|
|
111
135
|
};
|
|
136
|
+
["show-conflicts"]: {
|
|
137
|
+
mode?: boolean;
|
|
138
|
+
};
|
|
112
139
|
["add-link"]: {
|
|
113
140
|
id?: TID;
|
|
114
141
|
link: Partial<ILink>;
|
|
@@ -120,6 +147,7 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
120
147
|
};
|
|
121
148
|
["delete-link"]: {
|
|
122
149
|
id: TID;
|
|
150
|
+
reason?: InvalidLinkReason;
|
|
123
151
|
};
|
|
124
152
|
["scroll-chart"]: {
|
|
125
153
|
left?: number;
|
|
@@ -164,6 +192,7 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
164
192
|
width: number;
|
|
165
193
|
height: number;
|
|
166
194
|
scrollSize: number;
|
|
195
|
+
ganttWidth?: number;
|
|
167
196
|
};
|
|
168
197
|
["schedule-tasks"]: {
|
|
169
198
|
id?: TID;
|
|
@@ -189,19 +218,23 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
189
218
|
};
|
|
190
219
|
["delete-assignment"]: {
|
|
191
220
|
id: TID;
|
|
221
|
+
eventSource?: string;
|
|
192
222
|
};
|
|
193
223
|
["update-assignment"]: {
|
|
194
224
|
id: TID;
|
|
195
225
|
assignment: Partial<IAssignment>;
|
|
226
|
+
eventSource?: string;
|
|
196
227
|
};
|
|
197
228
|
["resize-grid"]: {
|
|
198
229
|
width: number;
|
|
230
|
+
section?: TColumnSection;
|
|
231
|
+
inProgress?: boolean;
|
|
199
232
|
};
|
|
200
233
|
["set-columns"]: {
|
|
201
234
|
columns: IGanttColumn[];
|
|
202
235
|
};
|
|
203
236
|
["set-display-mode"]: {
|
|
204
|
-
mode:
|
|
237
|
+
mode: TDisplayModeConfig;
|
|
205
238
|
};
|
|
206
239
|
["open-resource-row"]: {
|
|
207
240
|
id: TID;
|
|
@@ -213,9 +246,13 @@ export type IDataMethodsConfig = CombineTypes<{
|
|
|
213
246
|
add?: boolean;
|
|
214
247
|
_columns: IResourceColumn[];
|
|
215
248
|
};
|
|
249
|
+
["set-conflicts"]: {
|
|
250
|
+
conflicts: IConflict[];
|
|
251
|
+
};
|
|
216
252
|
}, {
|
|
217
253
|
skipProvider?: boolean;
|
|
218
254
|
skipUndo?: boolean;
|
|
255
|
+
joinUndo?: boolean;
|
|
219
256
|
[key: string]: any;
|
|
220
257
|
}>;
|
|
221
258
|
export {};
|
|
@@ -7,6 +7,8 @@ export default class GanttDataTree extends DataTree<IParsedTask> {
|
|
|
7
7
|
getBranch(id: TID): IParsedTask[];
|
|
8
8
|
contains(id: TID, target: TID): boolean;
|
|
9
9
|
getIndexById(id: TID): number;
|
|
10
|
+
update<Data>(id: TID, values: Data): void;
|
|
11
|
+
private _indexOf;
|
|
10
12
|
add(task: Partial<ITask>, index: number): IParsedTask;
|
|
11
13
|
copy(taskObj: ITask, parent: TID, ind: number): TID[][];
|
|
12
14
|
remove(id: TID): void;
|
|
@@ -15,7 +17,6 @@ export default class GanttDataTree extends DataTree<IParsedTask> {
|
|
|
15
17
|
getSummaryId(id: TID, all: boolean): TID[] | null;
|
|
16
18
|
sort(conf: TSort[], columns: IGanttColumn[]): void;
|
|
17
19
|
sortBranch(conf: TSort[], parent: TID, columns: IGanttColumn[]): void;
|
|
18
|
-
serialize(): Partial<ITask>[];
|
|
19
20
|
clear(): void;
|
|
20
21
|
filterTree(filter?: TFilterHandler, open?: boolean): void;
|
|
21
22
|
toArray(all?: boolean): IParsedTask[];
|
package/dist/types/columns.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type { IDataConfig, IGanttColumn, IResourceColumn } from "./types";
|
|
1
|
+
import type { IData, IDataConfig, IGanttColumn, IResourceColumn, TCalendarGetter, TColumnSection } from "./types";
|
|
2
|
+
export declare function getColumnsBySection(columns: IGanttColumn[], section?: TColumnSection): IGanttColumn[];
|
|
2
3
|
export declare const ADD_TASK_COLUMN_WIDTH = 37;
|
|
3
|
-
export declare
|
|
4
|
+
export declare const DEFAULT_COLUMN_WIDTH = 120;
|
|
5
|
+
export declare function getDateEditorButtons(columnId: string, unscheduledTasks?: boolean): ("Unschedule" | "today")[];
|
|
6
|
+
export declare function dropColumnCells(columns: IGanttColumn[]): IGanttColumn[];
|
|
7
|
+
export declare function getHeaderLength(columns: Pick<IGanttColumn, "header" | "hidden">[]): number;
|
|
8
|
+
export declare function normalizeColumns(columns: IGanttColumn[], stateGetter: () => Partial<IData>, calendarGetter?: TCalendarGetter): IGanttColumn[];
|
|
4
9
|
export declare function ensureVisibleFlex(columns: IGanttColumn[]): void;
|
|
5
10
|
export declare const defaultColumns: IGanttColumn[];
|
|
6
11
|
export declare function getDefaultColumns(config?: Partial<IDataConfig>): IGanttColumn[];
|
|
7
|
-
export declare function getDefaultGridWidth(columns: IGanttColumn[]): number;
|
|
12
|
+
export declare function getDefaultGridWidth(columns: IGanttColumn[], section?: TColumnSection): number;
|
|
8
13
|
export declare function getResourceColumns(): IResourceColumn[];
|
|
9
14
|
export declare function normalizeResourceColumns(columns: IResourceColumn[]): IResourceColumn[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IDataHash } from "../types";
|
|
2
|
+
export declare function dropUndefined(target: IDataHash, payload: IDataHash): void;
|
|
3
|
+
export declare function clamp<T extends number | Date>(value: T, lower: T, upper: T): T;
|
|
4
|
+
export declare function roundResourceMetric(value: number): number;
|
|
@@ -29,10 +29,7 @@ export declare function getEditorItems(config?: IDataConfig): ({
|
|
|
29
29
|
isHidden?: (task: Partial<ITask>, state: IData) => boolean;
|
|
30
30
|
isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
|
|
31
31
|
comp: "radio";
|
|
32
|
-
options:
|
|
33
|
-
id: import("@svar-ui/lib-state").TID;
|
|
34
|
-
label: string;
|
|
35
|
-
}[];
|
|
32
|
+
options: import("../types").IOption[];
|
|
36
33
|
} | {
|
|
37
34
|
[x: string]: any;
|
|
38
35
|
id?: import("@svar-ui/lib-state").TID;
|
|
@@ -43,10 +40,7 @@ export declare function getEditorItems(config?: IDataConfig): ({
|
|
|
43
40
|
isHidden?: (task: Partial<ITask>, state: IData) => boolean;
|
|
44
41
|
isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
|
|
45
42
|
comp: "combo" | "select" | "multiselect";
|
|
46
|
-
options?:
|
|
47
|
-
id: any;
|
|
48
|
-
label: string;
|
|
49
|
-
}[];
|
|
43
|
+
options?: import("../types").IOption<any>[];
|
|
50
44
|
} | {
|
|
51
45
|
[x: string]: any;
|
|
52
46
|
id?: import("@svar-ui/lib-state").TID;
|
|
@@ -128,6 +122,16 @@ export declare function getEditorItems(config?: IDataConfig): ({
|
|
|
128
122
|
isHidden?: (task: Partial<ITask>, state: IData) => boolean;
|
|
129
123
|
isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
|
|
130
124
|
comp: "segments";
|
|
125
|
+
} | {
|
|
126
|
+
[x: string]: any;
|
|
127
|
+
id?: import("@svar-ui/lib-state").TID;
|
|
128
|
+
key: string;
|
|
129
|
+
label?: string;
|
|
130
|
+
labelTemplate?: (value: any) => string;
|
|
131
|
+
config?: Record<string, any>;
|
|
132
|
+
isHidden?: (task: Partial<ITask>, state: IData) => boolean;
|
|
133
|
+
isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
|
|
134
|
+
comp: "constraint";
|
|
131
135
|
})[];
|
|
132
136
|
export declare const defaultEditorItems: TEditorItem[];
|
|
133
137
|
export declare function filterEditorButtons(items: IDataHash[], handler?: (item: IDataHash) => boolean): IDataHash[];
|
|
@@ -2,6 +2,7 @@ import type { IData, IDataHash, IParsedTask, IHistory, IDataConfig } from "../ty
|
|
|
2
2
|
import type { TID } from "@svar-ui/lib-state";
|
|
3
3
|
export declare function getToolbarButtons(config?: IDataConfig & {
|
|
4
4
|
group?: boolean;
|
|
5
|
+
conflicts?: boolean;
|
|
5
6
|
}): IButtonConfig[];
|
|
6
7
|
export interface IButtonConfig {
|
|
7
8
|
id?: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ICalendar, IDataConfig, IGanttColumn, ITask, TCalendarGetter } from "./types";
|
|
2
|
+
export declare function toInclusiveTask(task: Partial<ITask>, calendar?: ICalendar): Partial<ITask>;
|
|
3
|
+
export declare function fromInclusiveTask(values: Partial<ITask>, key: string, stored: Partial<ITask>): Partial<ITask>;
|
|
4
|
+
export declare function setInclusiveEndColumn(column: IGanttColumn, stateGetter: () => Pick<IDataConfig, "inclusiveEnd">, calendarGetter?: TCalendarGetter): IGanttColumn;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,16 +2,23 @@ export { default as DataStore } from "./DataStore";
|
|
|
2
2
|
export { grid } from "./dom/scales";
|
|
3
3
|
export { placeLink, normalizeLinks } from "./links";
|
|
4
4
|
export { getDiffer, getAdder, getUnitStart, format, formatDay, registerScaleUnit, } from "./time";
|
|
5
|
+
export { toInclusiveTask, fromInclusiveTask } from "./inclusiveEnd";
|
|
5
6
|
export { handleAction, isHandledAction } from "./helpers/actionHandlers";
|
|
6
7
|
export { calculateArea } from "./helpers/area";
|
|
8
|
+
export { PLACEHOLDER_ROW_ID, isPlaceholder, getPlaceholderTask, } from "./placeholder";
|
|
7
9
|
export { defaultToolbarButtons, getToolbarButtons, } from "./helpers/toolbarButtons";
|
|
8
10
|
export { defaultMenuOptions, getMenuOptions } from "./helpers/menuOptions";
|
|
9
11
|
export { defaultEditorItems, getEditorItems, getEditorButtons, filterEditorButtons, } from "./helpers/editorItems";
|
|
10
|
-
export {
|
|
12
|
+
export { getSegmentProgress } from "./helpers/progress";
|
|
13
|
+
export { resolveSCurvePoint } from "./helpers/sCurve";
|
|
14
|
+
export { defaultColumns, getDefaultColumns, getDefaultGridWidth, getHeaderLength, getResourceColumns, getDateEditorButtons, normalizeResourceColumns, } from "./columns";
|
|
15
|
+
export { toggleGridChart, toggleChartSubGrid } from "./layout/displayMode";
|
|
11
16
|
export { defaultTaskTypes } from "./taskTypes";
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export
|
|
17
|
+
export { defaultConstraintTypes } from "./constraintTypes";
|
|
18
|
+
export { prepareEditTask } from "./normalizeDates";
|
|
19
|
+
export { normalizeZoom, calcScaleCellDate } from "./scales";
|
|
20
|
+
export { isSegmentMoveAllowed, extendDragOptions, setTaskResources, } from "./tasks";
|
|
21
|
+
export { getHistogramBars, getHistogramCapacityPath, getResourceLoadColumns, getResourceHistogramColumns, resolveResourceHistogramBar, } from "./resourceLoad";
|
|
22
|
+
export type { TID, IApi, ITask, ILink, IResource, IAssignment, IDataAssignment, IComputedResource, IResourceLoad, IResourceColumn, IHistogramBar, IHistogramColumn, IHistogramColumnPosition, IResourceHistogramConfig, IResourceHistogramTooltip, IConfig, IZoomConfig, IGanttColumn, TMethodsConfig, IGanttTask, IMarker, IScheduleConfig, ICriticalPathConfig, IScaleConfig, ICalendar, ICalendarRule, CalendarConfig, Constraint, IConflict, InvalidLinkReason, TLinkDraft, TLinkValidator, ITaskCalendar, IHistoryManager, TDurationUnit, TSCurveType, TSCurveMetric, TSCurveLine, TSCurveConfig, ISCurveTooltip, ISCurveTooltipLine, } from "./types";
|
|
16
23
|
import { CalendarConfig } from "./types";
|
|
17
24
|
export declare function createCalendar(config?: CalendarConfig): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IGanttColumn, TDisplayModeConfig, TDisplayPanel } from "../types";
|
|
2
|
+
export declare function hasSubGridColumns(columns?: IGanttColumn[]): boolean;
|
|
3
|
+
export declare function normalizeDisplayMode(mode: TDisplayModeConfig | undefined, hasSubGrid: boolean): TDisplayPanel[];
|
|
4
|
+
export declare function toCompactPanels(mode: TDisplayPanel[], current?: TDisplayPanel[] | null): TDisplayPanel[];
|
|
5
|
+
export declare function toggleGridChart(panels: TDisplayPanel[], side: "start" | "end", compact?: boolean): TDisplayPanel[];
|
|
6
|
+
export declare function toggleChartSubGrid(panels: TDisplayPanel[], side: "start" | "end", compact?: boolean): TDisplayPanel[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { IData, TDisplayPanel } from "../types";
|
|
2
|
+
export declare const DEFAULT_MIN_CHART_WIDTH = 100;
|
|
3
|
+
export declare const DEFAULT_MIN_CHART_WITH_SUBGRID = 360;
|
|
4
|
+
export declare const DEFAULT_MIN_SUBGRID_WIDTH = 37;
|
|
5
|
+
export declare const DEFAULT_COMPACT_WIDTH = 650;
|
|
6
|
+
export declare function getResizerWidth(hasSubGrid: boolean, panels?: TDisplayPanel[]): number;
|
|
7
|
+
export type TResolveLayoutState = Pick<IData, "displayMode" | "_displayPanels" | "_compactMode" | "gridWidth" | "subGridWidth" | "_containerWidth" | "columns" | "_scrollSize" | "_gridCollapseThreshold">;
|
|
8
|
+
export type TResolveLayoutResult = {
|
|
9
|
+
compactMode: boolean;
|
|
10
|
+
gridWidth: number;
|
|
11
|
+
subGridWidth?: number;
|
|
12
|
+
displayPanels?: TDisplayPanel[];
|
|
13
|
+
};
|
|
14
|
+
type TPanelMeasure = {
|
|
15
|
+
ganttWidth: number;
|
|
16
|
+
gridWidth: number;
|
|
17
|
+
subGridWidth: number;
|
|
18
|
+
hasSubGrid: boolean;
|
|
19
|
+
scrollSize?: number;
|
|
20
|
+
};
|
|
21
|
+
export type TPanelFitMeasure = TPanelMeasure & {
|
|
22
|
+
collapseThreshold: number;
|
|
23
|
+
preferredGridWidth?: number;
|
|
24
|
+
preferredSubGridWidth?: number;
|
|
25
|
+
};
|
|
26
|
+
export declare function samePanels(a: TDisplayPanel[], b: TDisplayPanel[]): boolean;
|
|
27
|
+
export declare function getCollapseThreshold(state: Pick<IData, "_gridCollapseThreshold">): number;
|
|
28
|
+
export declare function getPanelFitMeasure(state: TResolveLayoutState, width: number, scrollSize?: number): TPanelFitMeasure;
|
|
29
|
+
export declare function resolveLayout(state: TResolveLayoutState, measure: {
|
|
30
|
+
width: number | null | undefined;
|
|
31
|
+
scrollSize?: number;
|
|
32
|
+
}): TResolveLayoutResult;
|
|
33
|
+
export declare function resolveGridDrag(panels: TDisplayPanel[], measure: TPanelFitMeasure): {
|
|
34
|
+
gridWidth: number;
|
|
35
|
+
subGridWidth: number;
|
|
36
|
+
panels: TDisplayPanel[];
|
|
37
|
+
};
|
|
38
|
+
export declare function resolveSubGridDrag(panels: TDisplayPanel[], measure: TPanelFitMeasure): {
|
|
39
|
+
subGridWidth: number;
|
|
40
|
+
panels: TDisplayPanel[];
|
|
41
|
+
};
|
|
42
|
+
export declare function previewGridDrag(panels: TDisplayPanel[], measure: TPanelFitMeasure): {
|
|
43
|
+
gridWidth: number;
|
|
44
|
+
panels: TDisplayPanel[];
|
|
45
|
+
};
|
|
46
|
+
export declare function previewSubGridDrag(panels: TDisplayPanel[], measure: TPanelFitMeasure): {
|
|
47
|
+
subGridWidth: number;
|
|
48
|
+
panels: TDisplayPanel[];
|
|
49
|
+
};
|
|
50
|
+
export declare function resolvePanelChange(prev: TDisplayPanel[], next: TDisplayPanel[], measure: TPanelFitMeasure): TDisplayPanel[];
|
|
51
|
+
export {};
|
package/dist/types/links.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export declare function placeLink(box: {
|
|
|
18
18
|
};
|
|
19
19
|
export declare function normalizeLinks(links: ILink[]): {
|
|
20
20
|
id: import("@svar-ui/lib-state").TID;
|
|
21
|
+
lag: number;
|
|
21
22
|
type: import("./types").TLinkType;
|
|
22
23
|
source: import("@svar-ui/lib-state").TID;
|
|
23
24
|
target: import("@svar-ui/lib-state").TID;
|
|
24
|
-
lag?: number;
|
|
25
25
|
}[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { ITask, IData, ICalendar, TCalendarGetter } from "./types";
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
1
|
+
import type { ITask, IData, ICalendar, TCalendarGetter, GanttDataTree, TID } from "./types";
|
|
2
|
+
export declare function parseTreeDates(tasks: GanttDataTree, state: Partial<IData>, calendarGetter: TCalendarGetter, parent?: TID): void;
|
|
3
|
+
export declare function deriveUnscheduled(task: Partial<ITask>, prev?: Partial<ITask>): void;
|
|
4
|
+
export declare function normalizeDates(task: Partial<ITask>, state: Partial<IData>, calendar: ICalendar | undefined, prev?: Partial<ITask>): void;
|
|
4
5
|
export declare function calcDates(task: Partial<ITask>, state: Partial<IData>, calendar: ICalendar | undefined, isBaseline?: boolean): void;
|
|
6
|
+
export declare function markNoWorkingTime(task: Partial<ITask>, state: Partial<IData>, calendar: ICalendar | undefined, prev?: Partial<ITask>): void;
|
|
5
7
|
export declare function getFields(isBaseline: boolean): string[];
|
|
6
8
|
export declare function prepareEditTask(task: Partial<ITask>, state: Partial<IData>, calendar: ICalendar, key: string): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IParsedTask, ITask, TID, IData, ICalendar } from "./types";
|
|
2
|
+
export declare const PLACEHOLDER_ROW_ID = "wx_placeholder_row";
|
|
3
|
+
export declare function isPlaceholder(id: TID): boolean;
|
|
4
|
+
export declare function getPlaceholderTask(row: Partial<ITask>, defaultText?: string): Partial<ITask>;
|
|
5
|
+
export declare function createPlaceholderRow(): IParsedTask;
|
|
6
|
+
export declare function applyPlaceholderDates(row: IParsedTask, state: Partial<IData>, calendar?: ICalendar): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GanttScaleData, IApi, IComputedResource, IHistogramBar, IHistogramColumn, IHistogramColumnPosition, IResourceHistogramConfig, IResourceHistogramTooltip, IResourceLoad } from "./types";
|
|
2
|
+
interface IResourceLoadColumn {
|
|
3
|
+
id: string;
|
|
4
|
+
width: number;
|
|
5
|
+
date: Date;
|
|
6
|
+
unit: string;
|
|
7
|
+
getter: (row: IComputedResource) => IResourceLoad | null;
|
|
8
|
+
template: (value: IResourceLoad | null) => string;
|
|
9
|
+
cell: any;
|
|
10
|
+
}
|
|
11
|
+
interface IResourceHistogramColumn extends IHistogramColumn {
|
|
12
|
+
unit: string;
|
|
13
|
+
cell: any;
|
|
14
|
+
getter: (row: IComputedResource) => {
|
|
15
|
+
hours: number;
|
|
16
|
+
capacity: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function getHistogramBars(resource: IComputedResource, column: IHistogramColumn): IHistogramBar[];
|
|
20
|
+
export declare function getHistogramCapacityPath(resource: IComputedResource, columns: IHistogramColumnPosition[], cellHeight: number): string;
|
|
21
|
+
export declare function getResourceLoadColumns(scales: GanttScaleData | null | undefined, LoadCell: any, template?: (value: IResourceLoad) => string): IResourceLoadColumn[];
|
|
22
|
+
export declare function getResourceHistogramColumns(scales: GanttScaleData | null | undefined, HistogramCell: any, config?: IResourceHistogramConfig): IResourceHistogramColumn[];
|
|
23
|
+
export declare function resolveResourceHistogramBar(api: IApi, target: EventTarget | null): IResourceHistogramTooltip | null;
|
|
24
|
+
export {};
|
package/dist/types/scales.d.ts
CHANGED
|
@@ -3,7 +3,17 @@ import type GanttDataTree from "./GanttDataTree";
|
|
|
3
3
|
import { Day } from "date-fns";
|
|
4
4
|
export declare function getMinUnit(scales: IScaleConfig[]): IScaleConfig;
|
|
5
5
|
export declare const units: string[];
|
|
6
|
-
|
|
6
|
+
interface IScaleBounds {
|
|
7
|
+
markers?: IMarker[];
|
|
8
|
+
projectStart?: Date;
|
|
9
|
+
projectEnd?: Date;
|
|
10
|
+
baselines?: boolean;
|
|
11
|
+
unscheduledTasks?: boolean;
|
|
12
|
+
progressLine?: Date;
|
|
13
|
+
deadlines?: boolean;
|
|
14
|
+
constraints?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function calcScales(prevStart?: Date, prevEnd?: Date, autoScale?: boolean, minUnit?: string, tasks?: GanttDataTree, config?: IScaleBounds): {
|
|
7
17
|
_start: Date;
|
|
8
18
|
_end: Date;
|
|
9
19
|
};
|
|
@@ -21,3 +31,5 @@ export declare function zoomScale(zoom: IZoomConfig, step: number, level: number
|
|
|
21
31
|
};
|
|
22
32
|
export declare function expandScale(minWidth: number, state: Partial<IData>): Partial<IData>;
|
|
23
33
|
export declare function calcScaleDate(x: number, state: Partial<IData>): Date;
|
|
34
|
+
export declare function calcScaleCellDate(x: number, state: Partial<IData>): Date;
|
|
35
|
+
export {};
|
|
@@ -2,4 +2,7 @@ export type TaskSlackInfo = any;
|
|
|
2
2
|
export type ICalendarRule = any;
|
|
3
3
|
export type CalendarConfig = any;
|
|
4
4
|
export type ICalendar = any;
|
|
5
|
+
export type Constraint = any;
|
|
6
|
+
export type Conflict = any;
|
|
7
|
+
export type InvalidLinkReason = any;
|
|
5
8
|
export declare const Calendar: any;
|
package/dist/types/tasks.d.ts
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import { IGanttTask, IParsedTask, GanttDataTree, ITask, IDataHash, IData } from "./types";
|
|
1
|
+
import { IGanttTask, IParsedTask, GanttDataTree, ITask, IDataHash, IData, ICalendar, TID, TMethodsConfig } from "./types";
|
|
2
|
+
import { EventBus } from "@svar-ui/lib-state";
|
|
2
3
|
export declare const heightAdjustment = 7;
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function isManualSummary(task: Partial<ITask>, state?: Partial<IData>): boolean;
|
|
5
|
+
export declare function dragSummaryKids(task: IParsedTask, dx: number, rollups: boolean, holdManual?: boolean): void;
|
|
6
|
+
export declare function dragSummary(tasks: GanttDataTree, task: IParsedTask, inactiveTasks?: boolean, autoSchedule?: boolean): void;
|
|
7
|
+
export declare function setSummaryDates(task: ITask, unscheduledTasks?: boolean, inactiveTasks?: boolean, excludeInactive?: boolean): ITask;
|
|
6
8
|
export declare function updateTask(t: IGanttTask, i: number | null, state: Partial<IData>): IGanttTask;
|
|
7
9
|
export declare function isSegmentMoveAllowed(task: IGanttTask, moveOptions: IDataHash): boolean;
|
|
8
10
|
export declare function extendDragOptions(task: ITask, options: IDataHash): void;
|
|
11
|
+
type TResourceHistory = {
|
|
12
|
+
startBatch(): void;
|
|
13
|
+
endBatch(): void;
|
|
14
|
+
isBatching(): boolean;
|
|
15
|
+
} | null;
|
|
16
|
+
export declare function setTaskResources(taskId: TID, resourceIds: TID[], ctx: {
|
|
17
|
+
exec: EventBus<TMethodsConfig, keyof TMethodsConfig>["exec"];
|
|
18
|
+
getState: () => Partial<IData>;
|
|
19
|
+
getHistory: () => TResourceHistory | null;
|
|
20
|
+
eventSource?: string;
|
|
21
|
+
skipUndo?: boolean;
|
|
22
|
+
joinUndo?: boolean;
|
|
23
|
+
}): void;
|
|
24
|
+
export declare function getDefaultTaskStart(state: Partial<IData>, calendar?: ICalendar): Date;
|
|
25
|
+
export {};
|
package/dist/types/time.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare function getUnitEnd(unit: string, date: Date, _weekStart?: Day):
|
|
|
13
13
|
export declare function isSameUnit(unit: string, a: Date, b: Date, _weekStart?: Day): boolean;
|
|
14
14
|
export declare function registerScaleUnit(unit: string, config: GanttScaleUnit): void;
|
|
15
15
|
export declare function adjustToWorkingDay(start: Date, diff: number, calendar: ICalendar): Date;
|
|
16
|
+
export declare function adjustEndToWorkingDay(end: Date, diff: number, calendar: ICalendar): Date;
|
|
16
17
|
export declare function shiftByWorkingDays(calendar: ICalendar): (date: Date, diff: number) => Date;
|
|
17
18
|
export declare function formatDay(date: Date): string;
|
|
18
19
|
export { format };
|