@svar-ui/gantt-store 2.4.4 → 2.5.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.
@@ -1,7 +1,7 @@
1
1
  import { Store, EventBus } from "@svar-ui/lib-state";
2
2
  import type { TDataConfig, TWritableCreator, TID } from "@svar-ui/lib-state";
3
3
  import { HistoryManager } from "./pro/HistoryManager";
4
- import type { IData, IDataConfig, ITask, TMethodsConfig, ILink, IVisibleArea, IParsedTask, TScrollTask } from "./types";
4
+ import type { IData, IDataConfig, ITask, TMethodsConfig, ILink, IVisibleArea, IParsedTask, TScrollTask, IExportConfig } from "./types";
5
5
  export default class DataStore extends Store<IData> {
6
6
  in: EventBus<TMethodsConfig, keyof TMethodsConfig>;
7
7
  private _router;
@@ -67,6 +67,7 @@ export type IDataMethodsConfig = CombineTypes<{
67
67
  width?: number;
68
68
  left?: number;
69
69
  top?: number;
70
+ start?: boolean;
70
71
  inProgress?: boolean;
71
72
  };
72
73
  ["copy-task"]: {
@@ -150,6 +151,11 @@ export type IDataMethodsConfig = CombineTypes<{
150
151
  id: TID;
151
152
  segmentIndex?: number;
152
153
  };
154
+ ["export-data"]: IExportConfig;
155
+ ["import-data"]: {
156
+ data: string;
157
+ format?: "mspx";
158
+ };
153
159
  }, {
154
160
  skipProvider?: boolean;
155
161
  spipUndo?: boolean;
@@ -15,4 +15,5 @@ export default class GanttDataTree extends DataTree<IParsedTask> {
15
15
  sort(conf: TSort[]): void;
16
16
  sortBranch(conf: TSort[], parent?: TID): void;
17
17
  serialize(): Partial<ITask>[];
18
+ clear(): void;
18
19
  }
@@ -0,0 +1 @@
1
+ export declare function postToNewWindow(url: string, data: Record<string, string>): void;
@@ -1,3 +1,92 @@
1
- import type { TEditorItem, IDataConfig } from "../types";
2
- export declare function getEditorItems(config?: IDataConfig): TEditorItem[];
1
+ import type { TEditorItem, ITask, IData, IDataConfig } from "../types";
2
+ export declare function getEditorItems(config?: IDataConfig): ({
3
+ [x: string]: any;
4
+ id?: import("@svar-ui/lib-state").TID;
5
+ key: string;
6
+ label?: string;
7
+ labelTemplate?: (value: any) => string;
8
+ config?: Record<string, any>;
9
+ isHidden?: (task: Partial<ITask>) => boolean;
10
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
11
+ comp: "text" | "textarea";
12
+ } | {
13
+ [x: string]: any;
14
+ id?: import("@svar-ui/lib-state").TID;
15
+ key: string;
16
+ label?: string;
17
+ labelTemplate?: (value: any) => string;
18
+ config?: Record<string, any>;
19
+ isHidden?: (task: Partial<ITask>) => boolean;
20
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
21
+ comp: "counter";
22
+ } | {
23
+ [x: string]: any;
24
+ id?: import("@svar-ui/lib-state").TID;
25
+ key: string;
26
+ label?: string;
27
+ labelTemplate?: (value: any) => string;
28
+ config?: Record<string, any>;
29
+ isHidden?: (task: Partial<ITask>) => boolean;
30
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
31
+ comp: "radio";
32
+ options: {
33
+ id: import("@svar-ui/lib-state").TID;
34
+ label: string;
35
+ }[];
36
+ } | {
37
+ [x: string]: any;
38
+ id?: import("@svar-ui/lib-state").TID;
39
+ key: string;
40
+ label?: string;
41
+ labelTemplate?: (value: any) => string;
42
+ config?: Record<string, any>;
43
+ isHidden?: (task: Partial<ITask>) => boolean;
44
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
45
+ comp: "combo" | "select" | "multiselect";
46
+ options?: {
47
+ id: any;
48
+ label: string;
49
+ }[];
50
+ } | {
51
+ [x: string]: any;
52
+ id?: import("@svar-ui/lib-state").TID;
53
+ key: string;
54
+ label?: string;
55
+ labelTemplate?: (value: any) => string;
56
+ config?: Record<string, any>;
57
+ isHidden?: (task: Partial<ITask>) => boolean;
58
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
59
+ comp: "slider";
60
+ } | {
61
+ [x: string]: any;
62
+ id?: import("@svar-ui/lib-state").TID;
63
+ key: string;
64
+ label?: string;
65
+ labelTemplate?: (value: any) => string;
66
+ config?: Record<string, any>;
67
+ isHidden?: (task: Partial<ITask>) => boolean;
68
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
69
+ comp: "date";
70
+ time?: boolean;
71
+ } | {
72
+ [x: string]: any;
73
+ id?: import("@svar-ui/lib-state").TID;
74
+ key: string;
75
+ label?: string;
76
+ labelTemplate?: (value: any) => string;
77
+ config?: Record<string, any>;
78
+ isHidden?: (task: Partial<ITask>) => boolean;
79
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
80
+ comp: "links";
81
+ } | {
82
+ [x: string]: any;
83
+ id?: import("@svar-ui/lib-state").TID;
84
+ key: string;
85
+ label?: string;
86
+ labelTemplate?: (value: any) => string;
87
+ config?: Record<string, any>;
88
+ isHidden?: (task: Partial<ITask>) => boolean;
89
+ isDisabled?: (task: Partial<ITask>, state: IData) => boolean;
90
+ comp: "twostate";
91
+ })[];
3
92
  export declare const defaultEditorItems: TEditorItem[];
@@ -1,9 +1,9 @@
1
- import type { IScaleConfig, GanttScaleData, IUnitFormats, IZoomConfig, TLengthUnit } from "./types";
1
+ import type { IScaleConfig, GanttScaleData, IUnitFormats, IZoomConfig, TLengthUnit, IMarker } from "./types";
2
2
  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
- export declare function calcScales(prevStart: Date, prevEnd: Date, autoScale: boolean, minUnit?: string, tasks?: GanttDataTree): {
6
+ export declare function calcScales(prevStart?: Date, prevEnd?: Date, autoScale?: boolean, minUnit?: string, tasks?: GanttDataTree, markers?: IMarker[]): {
7
7
  _start: Date;
8
8
  _end: Date;
9
9
  };
@@ -1,6 +1,6 @@
1
- import { IGanttTask, GanttScaleData, IParsedTask, GanttDataTree, ITask, IData, IDataHash } from "./types";
2
- export declare function dragSummaryKids(task: IParsedTask, dx: number, _scales: GanttScaleData, cellWidth: number): void;
3
- export declare function dragSummary(tasks: GanttDataTree, task: IParsedTask, _scales: GanttScaleData, cellWidth: number): void;
1
+ import { IGanttTask, IParsedTask, GanttDataTree, ITask, IData, IDataHash } from "./types";
2
+ export declare function dragSummaryKids(task: IParsedTask, dx: number, state: Partial<IData>): void;
3
+ export declare function dragSummary(tasks: GanttDataTree, task: IParsedTask, state: Partial<IData>, updateHidden?: boolean): void;
4
4
  export declare function setSummaryDates(task: ITask, tasks?: Partial<ITask>[]): ITask;
5
5
  export declare function updateTask(t: IGanttTask, i: number, state: Partial<IData>): IGanttTask;
6
6
  export declare function isSegmentMoveAllowed(task: IGanttTask, moveOptions: IDataHash): boolean;
@@ -6,6 +6,47 @@ import type DataStore from "./DataStore";
6
6
  import type { IApi as ITableApi, IColumn } from "@svar-ui/grid-store";
7
7
  export type TMethodsConfig = IDataMethodsConfig;
8
8
  export type { GanttDataTree, TID };
9
+ export interface IExportConfig {
10
+ url?: string;
11
+ format?: "pdf" | "png" | "xlsx" | "mspx";
12
+ fileName?: string;
13
+ styles?: string;
14
+ ganttConfig?: Record<string, any>;
15
+ pdf?: {
16
+ fitSize?: boolean;
17
+ size?: "auto" | string | {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ landscape?: boolean;
22
+ styles?: string;
23
+ margins?: {
24
+ top?: number;
25
+ bottom?: number;
26
+ left?: number;
27
+ right?: number;
28
+ };
29
+ header?: string;
30
+ footer?: string;
31
+ scale?: number;
32
+ };
33
+ png?: {
34
+ fitSize?: boolean;
35
+ size?: "auto" | string | {
36
+ width: number;
37
+ height: number;
38
+ };
39
+ landscape?: boolean;
40
+ styles?: string;
41
+ };
42
+ excel?: {
43
+ sheetNames?: string[];
44
+ visual?: boolean;
45
+ dateFormat?: string;
46
+ columns?: IGanttColumn[];
47
+ indent?: "native" | "spaces";
48
+ };
49
+ }
9
50
  export interface IActionConfig<T = any> {
10
51
  data?: T;
11
52
  noSave?: boolean;
@@ -111,6 +152,10 @@ export interface IScheduleConfig {
111
152
  type?: "forward";
112
153
  auto?: boolean;
113
154
  }
155
+ export interface ISummaryConfig {
156
+ autoProgress?: boolean;
157
+ autoConvert?: boolean;
158
+ }
114
159
  export interface ICalendarConfig {
115
160
  name?: string;
116
161
  weekHours?: {
@@ -166,6 +211,7 @@ export interface IConfig {
166
211
  projectEnd?: Date;
167
212
  calendar?: Calendar;
168
213
  splitTasks?: boolean;
214
+ summary?: ISummaryConfig;
169
215
  }
170
216
  export interface IDataConfig extends IConfig {
171
217
  scrollLeft: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svar-ui/gantt-store",
3
- "version": "2.4.4",
3
+ "version": "2.5.0",
4
4
  "description": "Internal state management used by SVAR Gantt component",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",