@visactor/vtable-gantt 1.26.5 → 1.26.7
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/cjs/Gantt.d.ts +6 -6
- package/cjs/Gantt.js +14 -8
- package/cjs/Gantt.js.map +1 -1
- package/cjs/components/MenuElementStyle.js +1 -2
- package/cjs/event/touch.js +1 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/gantt-node.d.ts +1 -1
- package/cjs/scenegraph/gantt-node.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/task-bar.d.ts +2 -2
- package/cjs/scenegraph/task-bar.js +3 -2
- package/cjs/scenegraph/task-bar.js.map +1 -1
- package/cjs/state/state-manager.js +4 -2
- package/cjs/state/state-manager.js.map +1 -1
- package/cjs/ts-types/events.d.ts +11 -9
- package/cjs/ts-types/events.js.map +1 -1
- package/dist/vtable-gantt.js +1155 -388
- package/dist/vtable-gantt.min.js +1 -1
- package/es/Gantt.d.ts +6 -6
- package/es/Gantt.js +14 -8
- package/es/Gantt.js.map +1 -1
- package/es/components/MenuElementStyle.js +1 -2
- package/es/event/touch.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/gantt-node.d.ts +1 -1
- package/es/scenegraph/gantt-node.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/task-bar.d.ts +2 -2
- package/es/scenegraph/task-bar.js +2 -2
- package/es/scenegraph/task-bar.js.map +1 -1
- package/es/state/state-manager.js +4 -2
- package/es/state/state-manager.js.map +1 -1
- package/es/ts-types/events.d.ts +11 -9
- package/es/ts-types/events.js.map +1 -1
- package/package.json +3 -3
package/es/Gantt.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ export declare class Gantt extends EventTarget {
|
|
|
153
153
|
getRecordIndexByTaskShowIndex(showIndex: number): number | number[];
|
|
154
154
|
getTaskShowIndexByRecordIndex(index: number | number[]): number;
|
|
155
155
|
getRecordByIndex(taskShowIndex: number, sub_task_index?: number | number[]): any;
|
|
156
|
-
_refreshTaskBar(taskShowIndex: number, sub_task_index?: number): void;
|
|
156
|
+
_refreshTaskBar(taskShowIndex: number, sub_task_index?: number | number[]): void;
|
|
157
157
|
_updateRecordToListTable(record: any, index: number | number[]): void;
|
|
158
158
|
private _refreshSortedTaskBarsAfterRecordUpdate;
|
|
159
159
|
getTaskInfoByTaskListIndex(taskShowIndex: number, sub_task_index?: number | number[]): {
|
|
@@ -169,12 +169,12 @@ export declare class Gantt extends EventTarget {
|
|
|
169
169
|
baselineDays: number;
|
|
170
170
|
};
|
|
171
171
|
_updateStartDateToTaskRecord(startDate: Date, index: number, sub_task_index?: number | number[]): void;
|
|
172
|
-
_updateEndDateToTaskRecord(endDate: Date, index: number, sub_task_index?: number): void;
|
|
173
|
-
_updateStartEndDateToTaskRecord(startDate: Date, endDate: Date, index: number, sub_task_index?: number): void;
|
|
174
|
-
_updateProgressToTaskRecord(progress: number, index: number, sub_task_index?: number): void;
|
|
172
|
+
_updateEndDateToTaskRecord(endDate: Date, index: number, sub_task_index?: number | number[]): void;
|
|
173
|
+
_updateStartEndDateToTaskRecord(startDate: Date, endDate: Date, index: number, sub_task_index?: number | number[]): void;
|
|
174
|
+
_updateProgressToTaskRecord(progress: number, index: number, sub_task_index?: number | number[]): void;
|
|
175
175
|
_dragOrderTaskRecord(source_index: number, source_sub_task_index: number, target_index: number, target_sub_task_index: number): void;
|
|
176
176
|
updateTaskRecord(record: any, task_index: number | number[]): void;
|
|
177
|
-
updateTaskRecord(record: any, task_index: number, sub_task_index: number): void;
|
|
177
|
+
updateTaskRecord(record: any, task_index: number, sub_task_index: number | number[]): void;
|
|
178
178
|
setPixelRatio(pixelRatio: number): void;
|
|
179
179
|
updateTasksShowMode(tasksShowMode: TasksShowMode): void;
|
|
180
180
|
_resize(): void;
|
|
@@ -198,7 +198,7 @@ export declare class Gantt extends EventTarget {
|
|
|
198
198
|
set scrollTop(value: number);
|
|
199
199
|
get scrollLeft(): number;
|
|
200
200
|
set scrollLeft(value: number);
|
|
201
|
-
getTaskBarRelativeRect(index: number): {
|
|
201
|
+
getTaskBarRelativeRect(index: number, sub_task_index?: number | number[]): {
|
|
202
202
|
left: number;
|
|
203
203
|
top: number;
|
|
204
204
|
width: number;
|
package/es/Gantt.js
CHANGED
|
@@ -383,7 +383,7 @@ export class Gantt extends EventTarget {
|
|
|
383
383
|
return this.records[taskShowIndex];
|
|
384
384
|
}
|
|
385
385
|
_refreshTaskBar(taskShowIndex, sub_task_index) {
|
|
386
|
-
this.scenegraph.taskBar.updateTaskBarNode(taskShowIndex, sub_task_index), this.scenegraph.refreshRecordLinkNodes(taskShowIndex,
|
|
386
|
+
this.scenegraph.taskBar.updateTaskBarNode(taskShowIndex, sub_task_index), this.scenegraph.refreshRecordLinkNodes(taskShowIndex, sub_task_index, this.scenegraph.taskBar.getTaskBarNodeByIndex(taskShowIndex, sub_task_index)),
|
|
387
387
|
this.scenegraph.updateNextFrame();
|
|
388
388
|
}
|
|
389
389
|
_updateRecordToListTable(record, index) {
|
|
@@ -460,7 +460,8 @@ export class Gantt extends EventTarget {
|
|
|
460
460
|
_updateStartDateToTaskRecord(startDate, index, sub_task_index) {
|
|
461
461
|
var _a;
|
|
462
462
|
const taskRecord = this.getRecordByIndex(index, sub_task_index), startDateField = this.parsedOptions.startDateField, dateFormat = null !== (_a = this.parsedOptions.dateFormat) && void 0 !== _a ? _a : parseDateFormat(taskRecord[startDateField]), newStartDate = formatDate(startDate, dateFormat);
|
|
463
|
-
if (taskRecord[startDateField] = newStartDate, isValid(sub_task_index)) Array.isArray(sub_task_index) && this.
|
|
463
|
+
if (taskRecord[startDateField] = newStartDate, isValid(sub_task_index)) Array.isArray(sub_task_index) && (this._updateRecordToListTable(taskRecord, sub_task_index),
|
|
464
|
+
this.stateManager.updateProjectTaskTimes(sub_task_index)); else {
|
|
464
465
|
const recordIndex = this.getRecordIndexByTaskShowIndex(index);
|
|
465
466
|
this._updateRecordToListTable(taskRecord, Array.isArray(recordIndex) ? recordIndex : index),
|
|
466
467
|
Array.isArray(recordIndex) && this.stateManager.updateProjectTaskTimes(recordIndex),
|
|
@@ -470,7 +471,8 @@ export class Gantt extends EventTarget {
|
|
|
470
471
|
_updateEndDateToTaskRecord(endDate, index, sub_task_index) {
|
|
471
472
|
var _a;
|
|
472
473
|
const taskRecord = this.getRecordByIndex(index, sub_task_index), endDateField = this.parsedOptions.endDateField, dateFormat = null !== (_a = this.parsedOptions.dateFormat) && void 0 !== _a ? _a : parseDateFormat(taskRecord[endDateField]), newEndDate = formatDate(endDate, dateFormat);
|
|
473
|
-
if (taskRecord[endDateField] = newEndDate, isValid(sub_task_index)) Array.isArray(sub_task_index) && this.
|
|
474
|
+
if (taskRecord[endDateField] = newEndDate, isValid(sub_task_index)) Array.isArray(sub_task_index) && (this._updateRecordToListTable(taskRecord, sub_task_index),
|
|
475
|
+
this.stateManager.updateProjectTaskTimes(sub_task_index)); else {
|
|
474
476
|
const recordIndex = this.getRecordIndexByTaskShowIndex(index);
|
|
475
477
|
this._updateRecordToListTable(taskRecord, Array.isArray(recordIndex) ? recordIndex : index),
|
|
476
478
|
Array.isArray(recordIndex) && this.stateManager.updateProjectTaskTimes(recordIndex),
|
|
@@ -482,7 +484,8 @@ export class Gantt extends EventTarget {
|
|
|
482
484
|
const taskRecord = this.getRecordByIndex(index, sub_task_index), startDateField = this.parsedOptions.startDateField, endDateField = this.parsedOptions.endDateField, dateFormat = null !== (_a = this.parsedOptions.dateFormat) && void 0 !== _a ? _a : parseDateFormat(taskRecord[startDateField]), newStartDate = formatDate(startDate, dateFormat);
|
|
483
485
|
taskRecord[startDateField] = newStartDate;
|
|
484
486
|
const newEndDate = formatDate(endDate, dateFormat);
|
|
485
|
-
if (taskRecord[endDateField] = newEndDate, isValid(sub_task_index)) Array.isArray(sub_task_index) && this.
|
|
487
|
+
if (taskRecord[endDateField] = newEndDate, isValid(sub_task_index)) Array.isArray(sub_task_index) && (this._updateRecordToListTable(taskRecord, sub_task_index),
|
|
488
|
+
this.stateManager.updateProjectTaskTimes(sub_task_index)); else {
|
|
486
489
|
const recordIndex = this.getRecordIndexByTaskShowIndex(index);
|
|
487
490
|
this._updateRecordToListTable(taskRecord, Array.isArray(recordIndex) ? recordIndex : index),
|
|
488
491
|
Array.isArray(recordIndex) && this.stateManager.updateProjectTaskTimes(recordIndex),
|
|
@@ -492,7 +495,8 @@ export class Gantt extends EventTarget {
|
|
|
492
495
|
_updateProgressToTaskRecord(progress, index, sub_task_index) {
|
|
493
496
|
const taskRecord = this.getRecordByIndex(index, sub_task_index), progressField = this.parsedOptions.progressField;
|
|
494
497
|
if (progressField) {
|
|
495
|
-
taskRecord[progressField] = progress
|
|
498
|
+
if (taskRecord[progressField] = progress, Array.isArray(sub_task_index)) return this._updateRecordToListTable(taskRecord, sub_task_index),
|
|
499
|
+
void this._refreshTaskBar(index, sub_task_index);
|
|
496
500
|
const recordIndex = this.getRecordIndexByTaskShowIndex(index);
|
|
497
501
|
this._updateRecordToListTable(taskRecord, Array.isArray(recordIndex) ? recordIndex : index),
|
|
498
502
|
this._refreshSortedTaskBarsAfterRecordUpdate(recordIndex, index) || this._refreshTaskBar(index, sub_task_index);
|
|
@@ -504,7 +508,8 @@ export class Gantt extends EventTarget {
|
|
|
504
508
|
updateTaskRecord(record, task_index, sub_task_index) {
|
|
505
509
|
if (isValid(sub_task_index)) {
|
|
506
510
|
const index = "number" == typeof task_index ? task_index : task_index[0];
|
|
507
|
-
return this._updateRecordToListTable(record, [ index, sub_task_index ]),
|
|
511
|
+
return this._updateRecordToListTable(record, Array.isArray(sub_task_index) ? sub_task_index : [ index, sub_task_index ]),
|
|
512
|
+
void this._refreshTaskBar(index, sub_task_index);
|
|
508
513
|
}
|
|
509
514
|
if (Array.isArray(task_index)) {
|
|
510
515
|
const index = task_index[0], sub_index = task_index[1];
|
|
@@ -644,8 +649,9 @@ export class Gantt extends EventTarget {
|
|
|
644
649
|
set scrollLeft(value) {
|
|
645
650
|
this.stateManager.setScrollLeft(value);
|
|
646
651
|
}
|
|
647
|
-
getTaskBarRelativeRect(index) {
|
|
648
|
-
const taskBarNode = this.scenegraph.taskBar.getTaskBarNodeByIndex(index);
|
|
652
|
+
getTaskBarRelativeRect(index, sub_task_index) {
|
|
653
|
+
const taskBarNode = this.scenegraph.taskBar.getTaskBarNodeByIndex(index, sub_task_index);
|
|
654
|
+
if (!taskBarNode) return null;
|
|
649
655
|
return {
|
|
650
656
|
left: taskBarNode.attribute.x + this.taskListTableInstance.tableNoFrameWidth + this.taskListTableInstance.tableX + this.tableX - this.scrollLeft,
|
|
651
657
|
top: taskBarNode.attribute.y + this.tableY + this.headerHeight - this.scrollTop,
|