@svar-ui/gantt-store 2.4.2 → 2.4.3
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 +1 -1
- package/dist/types/helpers/editorItems.d.ts +1 -1
- package/dist/types/helpers/menuOptions.d.ts +1 -1
- package/dist/types/helpers/toolbarButtons.d.ts +1 -1
- package/dist/types/types.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/helpers/getCircularLinks.d.ts +0 -3
- package/dist/types/modules/AutoScheduler.pro.d.ts +0 -15
- package/dist/types/modules/ChangeTracker.pro.d.ts +0 -10
- package/dist/types/modules/CriticalPath.pro.d.ts +0 -11
- package/dist/types/modules/EventTracker.pro.d.ts +0 -20
- package/dist/types/modules/HistoryManager.pro.d.ts +0 -48
- package/dist/types/splitTasks.pro.d.ts +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Store, EventBus } from "@svar-ui/lib-state";
|
|
2
2
|
import type { TDataConfig, TWritableCreator, TID } from "@svar-ui/lib-state";
|
|
3
|
-
import { HistoryManager } from "./
|
|
3
|
+
import { HistoryManager } from "./pro/HistoryManager";
|
|
4
4
|
import type { IData, IDataConfig, ITask, TMethodsConfig, ILink, IVisibleArea, IParsedTask, TScrollTask } from "./types";
|
|
5
5
|
export default class DataStore extends Store<IData> {
|
|
6
6
|
in: EventBus<TMethodsConfig, keyof TMethodsConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TID } from "@svar-ui/lib-state";
|
|
2
2
|
import type { IParsedTask, IHistory, IData, IDataConfig, IDataHash } from "../types";
|
|
3
|
-
export declare function getMenuOptions(config
|
|
3
|
+
export declare function getMenuOptions(config?: IDataConfig): IOptionConfig[];
|
|
4
4
|
export interface IOptionConfig {
|
|
5
5
|
id?: TID;
|
|
6
6
|
separator?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IData, IDataHash, IParsedTask, IHistory, IDataConfig } from "../types";
|
|
2
2
|
import type { TID } from "@svar-ui/lib-state";
|
|
3
|
-
export declare function getToolbarButtons(config
|
|
3
|
+
export declare function getToolbarButtons(config?: IDataConfig): IButtonConfig[];
|
|
4
4
|
export interface IButtonConfig {
|
|
5
5
|
id?: string;
|
|
6
6
|
comp: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface ITask {
|
|
|
48
48
|
}
|
|
49
49
|
export interface IParsedTask extends ITask {
|
|
50
50
|
id: TID;
|
|
51
|
-
parent
|
|
51
|
+
parent: TID;
|
|
52
52
|
data?: IParsedTask[];
|
|
53
53
|
$level: number;
|
|
54
54
|
}
|
|
@@ -176,6 +176,7 @@ export interface IDataConfig extends IConfig {
|
|
|
176
176
|
_sort?: TSort[];
|
|
177
177
|
_scrollTask?: TScrollTask;
|
|
178
178
|
_weekStart?: Day;
|
|
179
|
+
_markers?: IMarker[];
|
|
179
180
|
}
|
|
180
181
|
export interface IData extends Omit<IDataConfig, "tasks" | "links"> {
|
|
181
182
|
zoom?: IZoomConfig;
|
|
@@ -192,7 +193,6 @@ export interface IData extends Omit<IDataConfig, "tasks" | "links"> {
|
|
|
192
193
|
_zoomOffset?: number;
|
|
193
194
|
_weekStart?: Day;
|
|
194
195
|
_scrollTask?: TScrollTask;
|
|
195
|
-
_markers?: IMarker[];
|
|
196
196
|
}
|
|
197
197
|
export interface IDataHash<T = any> {
|
|
198
198
|
[key: string]: T;
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EventTracker } from "./EventTracker.pro";
|
|
2
|
-
import type { TID } from "../types";
|
|
3
|
-
export declare class AutoSchedulerModule extends EventTracker {
|
|
4
|
-
private taskTracker;
|
|
5
|
-
private linkTracker;
|
|
6
|
-
init(): void;
|
|
7
|
-
destroy(): void;
|
|
8
|
-
schedule(id?: TID, deleteInvalidLinks?: boolean): void;
|
|
9
|
-
protected getDefaultTag(): string;
|
|
10
|
-
private setupScheduleHandler;
|
|
11
|
-
private setupTaskHandlers;
|
|
12
|
-
private setupLinkHandlers;
|
|
13
|
-
private deleteInvalidLinks;
|
|
14
|
-
private getInvalidLinks;
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TID } from "../types";
|
|
2
|
-
export declare class ChangeTracker<T extends {
|
|
3
|
-
id?: TID;
|
|
4
|
-
}> {
|
|
5
|
-
private prevState;
|
|
6
|
-
track(id: TID, item: Partial<T>, properties: (keyof T)[]): void;
|
|
7
|
-
hasChanged(id: TID, item: Partial<T>, properties: (keyof T)[]): boolean;
|
|
8
|
-
clear(id?: TID): void;
|
|
9
|
-
getSnapshot(id: TID): Partial<T> | undefined;
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EventTracker } from "./EventTracker.pro";
|
|
2
|
-
export declare class CriticalPathModule extends EventTracker {
|
|
3
|
-
private taskTracker;
|
|
4
|
-
private linkTracker;
|
|
5
|
-
init(): void;
|
|
6
|
-
destroy(): void;
|
|
7
|
-
calculate(): void;
|
|
8
|
-
protected getDefaultTag(): string;
|
|
9
|
-
private setupTaskHandlers;
|
|
10
|
-
private setupLinkHandlers;
|
|
11
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { EventBus } from "@svar-ui/lib-state";
|
|
2
|
-
import type { TMethodsConfig, IData } from "../types";
|
|
3
|
-
export declare abstract class EventTracker {
|
|
4
|
-
protected in: EventBus<TMethodsConfig, keyof TMethodsConfig>;
|
|
5
|
-
protected getState: () => Partial<IData>;
|
|
6
|
-
protected setState: (state: Partial<IData>) => void;
|
|
7
|
-
protected getHistory: () => any;
|
|
8
|
-
private _timer;
|
|
9
|
-
private _tags;
|
|
10
|
-
constructor(eventBus: EventBus<TMethodsConfig, keyof TMethodsConfig>, stateGetter: () => Partial<IData>, stateSetter: (state: Partial<IData>) => void, historyGetter: () => any);
|
|
11
|
-
abstract init(): void;
|
|
12
|
-
abstract destroy(): void;
|
|
13
|
-
protected debounce(code: () => void, delay?: number): void;
|
|
14
|
-
protected shouldTrack(ev: any, noTrack?: Record<string, number>): boolean;
|
|
15
|
-
protected registerHandler<K extends keyof TMethodsConfig>(type: "on" | "intercept", event: K, handler: (ev: TMethodsConfig[K]) => void, tag?: string): void;
|
|
16
|
-
protected on<K extends keyof TMethodsConfig>(event: K, handler: (ev: TMethodsConfig[K]) => void, tag?: string): void;
|
|
17
|
-
protected intercept<K extends keyof TMethodsConfig>(event: K, handler: (ev: TMethodsConfig[K]) => void, tag?: string): void;
|
|
18
|
-
protected detachHandlers(): void;
|
|
19
|
-
protected abstract getDefaultTag(): string;
|
|
20
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IDataHash, TMethodsConfig } from "../types";
|
|
2
|
-
import { EventTracker } from "./EventTracker.pro";
|
|
3
|
-
type TActionType = keyof TMethodsConfig;
|
|
4
|
-
type TBatchAction = "batch";
|
|
5
|
-
type TAllActionTypes = TActionType | TBatchAction;
|
|
6
|
-
type TSubActionData = IDataHash & {
|
|
7
|
-
action?: TActionType;
|
|
8
|
-
};
|
|
9
|
-
interface IActionData<T extends TAllActionTypes> {
|
|
10
|
-
action: T;
|
|
11
|
-
data: T extends TActionType ? TMethodsConfig[T] | TSubActionData : IHistoryEntry[];
|
|
12
|
-
}
|
|
13
|
-
interface IHistoryEntry extends IActionData<TAllActionTypes> {
|
|
14
|
-
source: IActionData<TAllActionTypes>;
|
|
15
|
-
}
|
|
16
|
-
interface IActionHandlers {
|
|
17
|
-
handler: (ev: any) => IHistoryEntry;
|
|
18
|
-
getSnapshot?: (ev: any) => IDataHash;
|
|
19
|
-
progress?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare class HistoryManager extends EventTracker {
|
|
22
|
-
private undo;
|
|
23
|
-
private redo;
|
|
24
|
-
private progress;
|
|
25
|
-
private _dataSnapshot;
|
|
26
|
-
private _batch;
|
|
27
|
-
private _isBatching;
|
|
28
|
-
init(): void;
|
|
29
|
-
destroy(): void;
|
|
30
|
-
protected getDefaultTag(): string;
|
|
31
|
-
getHandlers(): {
|
|
32
|
-
[key: string]: IActionHandlers;
|
|
33
|
-
};
|
|
34
|
-
resetHistory(): void;
|
|
35
|
-
private setHandlers;
|
|
36
|
-
private setPrevData;
|
|
37
|
-
private getPrevData;
|
|
38
|
-
private addToHistory;
|
|
39
|
-
startBatch(): void;
|
|
40
|
-
endBatch(): void;
|
|
41
|
-
handleUndo(): void;
|
|
42
|
-
handleRedo(): void;
|
|
43
|
-
private executeHistoryEntry;
|
|
44
|
-
private resetStateHistory;
|
|
45
|
-
private setStateHistory;
|
|
46
|
-
private getOrder;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ITask, IData, IParsedTask, IDataHash, Calendar } from "./types";
|
|
2
|
-
type TSegment = Partial<ITask>;
|
|
3
|
-
export declare function calcSplitDates(task: Partial<ITask>, stateOptions: Partial<IData>): void;
|
|
4
|
-
export declare function dragSplitTask(task: IParsedTask, ev: IDataHash): boolean;
|
|
5
|
-
export declare function updateSplitTask(task: IParsedTask, update: Partial<ITask | TSegment>, stateOptions: Partial<IData>, index?: number, diff?: number): Partial<ITask | Partial<ITask>>;
|
|
6
|
-
export declare function splitTask(task: IParsedTask, index: number | undefined, stateOptions: Partial<IData>): Partial<IParsedTask>;
|
|
7
|
-
export declare function isIndivisibleType(task: Partial<ITask>): boolean;
|
|
8
|
-
export declare function isIndivisible(task: IParsedTask, stateOptions: Partial<IData>, index?: number): boolean;
|
|
9
|
-
export declare function getEndAdder(unit: string, calendar: Calendar): (start: number | Date, step: number) => Date;
|
|
10
|
-
export declare function shiftNextSegments(segments: Partial<ITask>[], lengthUnit: string, index: number, calendar: Calendar, dir?: number): void;
|
|
11
|
-
export {};
|