@visactor/vtable-gantt 1.13.2-alpha.0 → 1.13.2
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 +5 -3
- package/cjs/Gantt.js +21 -3
- package/cjs/Gantt.js.map +1 -1
- package/cjs/data/DataSource.d.ts +0 -2
- package/cjs/data/DataSource.js +2 -5
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/event/event-manager.js +20 -5
- package/cjs/event/event-manager.js.map +1 -1
- package/cjs/gantt-helper.d.ts +2 -0
- package/cjs/gantt-helper.js +24 -2
- package/cjs/gantt-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/grid.d.ts +2 -1
- package/cjs/scenegraph/grid.js +63 -20
- package/cjs/scenegraph/grid.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +7 -0
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/task-bar.js +19 -4
- package/cjs/scenegraph/task-bar.js.map +1 -1
- package/cjs/tools/isx.d.ts +1 -1
- package/cjs/ts-types/gantt-engine.d.ts +21 -4
- package/cjs/ts-types/gantt-engine.js.map +1 -1
- package/dist/vtable-gantt.js +234 -52
- package/dist/vtable-gantt.min.js +2 -2
- package/es/Gantt.d.ts +5 -3
- package/es/Gantt.js +21 -4
- package/es/Gantt.js.map +1 -1
- package/es/data/DataSource.d.ts +0 -2
- package/es/data/DataSource.js +2 -4
- package/es/data/DataSource.js.map +1 -1
- package/es/event/event-manager.js +20 -5
- package/es/event/event-manager.js.map +1 -1
- package/es/gantt-helper.d.ts +2 -0
- package/es/gantt-helper.js +18 -0
- package/es/gantt-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/grid.d.ts +2 -1
- package/es/scenegraph/grid.js +62 -20
- package/es/scenegraph/grid.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +7 -0
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/task-bar.js +19 -4
- package/es/scenegraph/task-bar.js.map +1 -1
- package/es/tools/isx.d.ts +1 -1
- package/es/ts-types/gantt-engine.d.ts +21 -4
- package/es/ts-types/gantt-engine.js.map +1 -1
- package/package.json +6 -6
package/dist/vtable-gantt.js
CHANGED
|
@@ -25779,18 +25779,42 @@
|
|
|
25779
25779
|
this.group.appendChild(this.verticalLineGroup);
|
|
25780
25780
|
const timelineDates = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates;
|
|
25781
25781
|
const timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;
|
|
25782
|
-
|
|
25783
|
-
|
|
25784
|
-
|
|
25785
|
-
|
|
25786
|
-
|
|
25787
|
-
|
|
25788
|
-
|
|
25789
|
-
|
|
25790
|
-
|
|
25791
|
-
|
|
25792
|
-
|
|
25793
|
-
|
|
25782
|
+
if (typeof this.gridStyle.verticalLine === 'function') {
|
|
25783
|
+
for (let i = 0; i < timelineDates?.length - 1; i++) {
|
|
25784
|
+
const verticalLine_style = this.gridStyle.verticalLine({
|
|
25785
|
+
index: i,
|
|
25786
|
+
dateIndex: timelineDates[i].dateIndex,
|
|
25787
|
+
date: timelineDates[i].endDate,
|
|
25788
|
+
ganttInstance: this._scene._gantt
|
|
25789
|
+
});
|
|
25790
|
+
const x = Math.ceil(timelineColWidth * (i + 1)) + (verticalLine_style.lineWidth & 1 ? 0.5 : 0);
|
|
25791
|
+
const line = createLine({
|
|
25792
|
+
pickable: false,
|
|
25793
|
+
stroke: verticalLine_style.lineColor,
|
|
25794
|
+
lineWidth: verticalLine_style.lineWidth,
|
|
25795
|
+
points: [
|
|
25796
|
+
{ x, y: 0 },
|
|
25797
|
+
{ x, y: this.allGridHeight }
|
|
25798
|
+
]
|
|
25799
|
+
});
|
|
25800
|
+
this.verticalLineGroup.appendChild(line);
|
|
25801
|
+
}
|
|
25802
|
+
}
|
|
25803
|
+
else {
|
|
25804
|
+
const verticalLine_style = this.gridStyle.verticalLine;
|
|
25805
|
+
for (let i = 0; i < timelineDates?.length - 1; i++) {
|
|
25806
|
+
const x = Math.ceil(timelineColWidth * (i + 1)) + (verticalLine_style.lineWidth & 1 ? 0.5 : 0);
|
|
25807
|
+
const line = createLine({
|
|
25808
|
+
pickable: false,
|
|
25809
|
+
stroke: verticalLine_style.lineColor,
|
|
25810
|
+
lineWidth: verticalLine_style.lineWidth,
|
|
25811
|
+
points: [
|
|
25812
|
+
{ x, y: 0 },
|
|
25813
|
+
{ x, y: this.allGridHeight }
|
|
25814
|
+
]
|
|
25815
|
+
});
|
|
25816
|
+
this.verticalLineGroup.appendChild(line);
|
|
25817
|
+
}
|
|
25794
25818
|
}
|
|
25795
25819
|
}
|
|
25796
25820
|
}
|
|
@@ -25804,22 +25828,45 @@
|
|
|
25804
25828
|
});
|
|
25805
25829
|
this.horizontalLineGroup.name = 'grid-horizontal';
|
|
25806
25830
|
this.group.appendChild(this.horizontalLineGroup);
|
|
25807
|
-
|
|
25808
|
-
|
|
25809
|
-
|
|
25831
|
+
if (typeof this.gridStyle.horizontalLine === 'function') {
|
|
25832
|
+
let y = 0.5;
|
|
25833
|
+
for (let i = 0; i < this.rowCount - 1; i++) {
|
|
25834
|
+
const horizontalLine_style = this.gridStyle.horizontalLine({
|
|
25835
|
+
index: i,
|
|
25836
|
+
ganttInstance: this._scene._gantt
|
|
25837
|
+
});
|
|
25838
|
+
y = y + this._scene._gantt.getRowHeightByIndex(i);
|
|
25839
|
+
const line = createLine({
|
|
25840
|
+
pickable: false,
|
|
25841
|
+
stroke: horizontalLine_style.lineColor,
|
|
25842
|
+
lineWidth: horizontalLine_style.lineWidth,
|
|
25843
|
+
points: [
|
|
25844
|
+
{ x: 0, y },
|
|
25845
|
+
{ x: this.allGridWidth, y }
|
|
25846
|
+
]
|
|
25847
|
+
});
|
|
25848
|
+
this.horizontalLineGroup.appendChild(line);
|
|
25849
|
+
}
|
|
25810
25850
|
}
|
|
25811
|
-
|
|
25812
|
-
|
|
25813
|
-
|
|
25814
|
-
|
|
25815
|
-
|
|
25816
|
-
|
|
25817
|
-
|
|
25818
|
-
|
|
25819
|
-
|
|
25820
|
-
|
|
25821
|
-
|
|
25822
|
-
|
|
25851
|
+
else {
|
|
25852
|
+
const horizontalLine_style = this.gridStyle.horizontalLine;
|
|
25853
|
+
let y = 0;
|
|
25854
|
+
if (horizontalLine_style.lineWidth & 1) {
|
|
25855
|
+
y += 0.5;
|
|
25856
|
+
}
|
|
25857
|
+
for (let i = 0; i < this.rowCount - 1; i++) {
|
|
25858
|
+
y = y + this._scene._gantt.getRowHeightByIndex(i);
|
|
25859
|
+
const line = createLine({
|
|
25860
|
+
pickable: false,
|
|
25861
|
+
stroke: horizontalLine_style.lineColor,
|
|
25862
|
+
lineWidth: horizontalLine_style.lineWidth,
|
|
25863
|
+
points: [
|
|
25864
|
+
{ x: 0, y },
|
|
25865
|
+
{ x: this.allGridWidth, y }
|
|
25866
|
+
]
|
|
25867
|
+
});
|
|
25868
|
+
this.horizontalLineGroup.appendChild(line);
|
|
25869
|
+
}
|
|
25823
25870
|
}
|
|
25824
25871
|
}
|
|
25825
25872
|
}
|
|
@@ -28718,6 +28765,32 @@
|
|
|
28718
28765
|
}
|
|
28719
28766
|
return { startDate: createDateAtMidnight(startDate, true), endDate: createDateAtLastHour(endDate, true) };
|
|
28720
28767
|
}
|
|
28768
|
+
function updateOptionsWhenRecordChanged(gantt) {
|
|
28769
|
+
const options = gantt.options;
|
|
28770
|
+
const { unit: minTimeUnit, startOfWeek } = gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
28771
|
+
gantt.parsedOptions.markLine = generateMarkLine(options?.markLine);
|
|
28772
|
+
if (gantt.parsedOptions.markLine?.length ?? 0) {
|
|
28773
|
+
if (gantt.parsedOptions.markLine?.every(item => item.scrollToMarkLine === undefined)) {
|
|
28774
|
+
gantt.parsedOptions.markLine[0].scrollToMarkLine = true;
|
|
28775
|
+
}
|
|
28776
|
+
if (gantt.parsedOptions.markLine?.find(item => item.scrollToMarkLine)) {
|
|
28777
|
+
gantt.parsedOptions.scrollToMarkLineDate = getStartDateByTimeUnit(new Date(gantt.parsedOptions.markLine?.find(item => item.scrollToMarkLine).date), minTimeUnit, startOfWeek);
|
|
28778
|
+
}
|
|
28779
|
+
}
|
|
28780
|
+
gantt.parsedOptions.dependencyLinks = options.dependency?.links;
|
|
28781
|
+
}
|
|
28782
|
+
function updateOptionsWhenDateRangeChanged(gantt) {
|
|
28783
|
+
const options = gantt.options;
|
|
28784
|
+
const { unit: minTimeUnit, startOfWeek, step } = gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
28785
|
+
gantt.parsedOptions.minDate = options?.minDate
|
|
28786
|
+
? getStartDateByTimeUnit(new Date(options.minDate), minTimeUnit, startOfWeek)
|
|
28787
|
+
: undefined;
|
|
28788
|
+
gantt.parsedOptions.maxDate = options?.maxDate
|
|
28789
|
+
? getEndDateByTimeUnit(gantt.parsedOptions.minDate, new Date(options.maxDate), minTimeUnit, step)
|
|
28790
|
+
: undefined;
|
|
28791
|
+
gantt.parsedOptions._minDateTime = gantt.parsedOptions.minDate?.getTime();
|
|
28792
|
+
gantt.parsedOptions._maxDateTime = gantt.parsedOptions.maxDate?.getTime();
|
|
28793
|
+
}
|
|
28721
28794
|
|
|
28722
28795
|
class TimelineHeader {
|
|
28723
28796
|
group;
|
|
@@ -29110,7 +29183,6 @@
|
|
|
29110
29183
|
width: 100,
|
|
29111
29184
|
height: 100,
|
|
29112
29185
|
clip: true,
|
|
29113
|
-
cursor: this._scene._gantt.parsedOptions.taskBarMoveable ? 'grab' : 'default',
|
|
29114
29186
|
pickable: false,
|
|
29115
29187
|
cornerRadius: this._scene._gantt.parsedOptions.taskBarHoverStyle.cornerRadius ??
|
|
29116
29188
|
this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius ??
|
|
@@ -29180,6 +29252,41 @@
|
|
|
29180
29252
|
this.hoverBarGroup.setAttribute('width', width);
|
|
29181
29253
|
this.hoverBarGroup.setAttribute('height', height);
|
|
29182
29254
|
this.hoverBarGroup.setAttribute('visibleAll', true);
|
|
29255
|
+
this.hoverBarLeftIcon.setAttribute('visible', false);
|
|
29256
|
+
this.hoverBarRightIcon.setAttribute('visible', false);
|
|
29257
|
+
const { startDate, endDate, taskRecord } = this._scene._gantt.getTaskInfoByTaskListIndex(target.task_index, target.sub_task_index);
|
|
29258
|
+
let leftResizable = true;
|
|
29259
|
+
let rightResizable = true;
|
|
29260
|
+
if (typeof this._scene._gantt.parsedOptions.taskBarResizable === 'function') {
|
|
29261
|
+
const arg = {
|
|
29262
|
+
index: target.task_index,
|
|
29263
|
+
startDate,
|
|
29264
|
+
endDate,
|
|
29265
|
+
taskRecord,
|
|
29266
|
+
ganttInstance: this._scene._gantt
|
|
29267
|
+
};
|
|
29268
|
+
const resizableResult = this._scene._gantt.parsedOptions.taskBarResizable(arg);
|
|
29269
|
+
if (Array.isArray(resizableResult)) {
|
|
29270
|
+
[leftResizable, rightResizable] = resizableResult;
|
|
29271
|
+
}
|
|
29272
|
+
else {
|
|
29273
|
+
leftResizable = resizableResult;
|
|
29274
|
+
rightResizable = resizableResult;
|
|
29275
|
+
}
|
|
29276
|
+
}
|
|
29277
|
+
else if (Array.isArray(this._scene._gantt.parsedOptions.taskBarResizable)) {
|
|
29278
|
+
[leftResizable, rightResizable] = this._scene._gantt.parsedOptions.taskBarResizable;
|
|
29279
|
+
}
|
|
29280
|
+
else {
|
|
29281
|
+
leftResizable = this._scene._gantt.parsedOptions.taskBarResizable;
|
|
29282
|
+
rightResizable = this._scene._gantt.parsedOptions.taskBarResizable;
|
|
29283
|
+
}
|
|
29284
|
+
if (leftResizable) {
|
|
29285
|
+
this.hoverBarLeftIcon.setAttribute('visible', true);
|
|
29286
|
+
}
|
|
29287
|
+
if (rightResizable) {
|
|
29288
|
+
this.hoverBarRightIcon.setAttribute('visible', true);
|
|
29289
|
+
}
|
|
29183
29290
|
if (this.hoverBarLeftIcon) {
|
|
29184
29291
|
this.hoverBarLeftIcon.setAttribute('x', 0);
|
|
29185
29292
|
this.hoverBarLeftIcon.setAttribute('y', Math.ceil(height / 10));
|
|
@@ -30439,6 +30546,21 @@
|
|
|
30439
30546
|
scene.stage.defaultLayer.addChild(scene.scrollbarComponent.vScrollBar);
|
|
30440
30547
|
scene.dragOrderLine = new DragOrderLine(scene);
|
|
30441
30548
|
}
|
|
30549
|
+
updateSceneGraph() {
|
|
30550
|
+
const gantt = this._gantt;
|
|
30551
|
+
this.tableGroupWidth = gantt.tableNoFrameWidth;
|
|
30552
|
+
this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);
|
|
30553
|
+
let width;
|
|
30554
|
+
let height;
|
|
30555
|
+
if (Env$1.mode === 'node') ;
|
|
30556
|
+
else {
|
|
30557
|
+
vglobal.setEnv('browser');
|
|
30558
|
+
width = gantt.canvas.width;
|
|
30559
|
+
height = gantt.canvas.height;
|
|
30560
|
+
}
|
|
30561
|
+
this.stage.resize(width, height);
|
|
30562
|
+
this.refreshAll();
|
|
30563
|
+
}
|
|
30442
30564
|
afterCreateSceneGraph() {
|
|
30443
30565
|
this.scrollbarComponent.updateScrollBar();
|
|
30444
30566
|
bindScrollBarListener$1(this._gantt.eventManager);
|
|
@@ -32503,8 +32625,6 @@
|
|
|
32503
32625
|
const DEFAULTBORDERLINEDASH = [];
|
|
32504
32626
|
const DEFAULTFONTCOLOR = "#000";
|
|
32505
32627
|
const regUrl = /^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
|
32506
|
-
const ResizeColumnHotSpotSize = 16;
|
|
32507
|
-
const ResizeRowHotSpotSize = 16;
|
|
32508
32628
|
const IndicatorDimensionKeyPlaceholder = "$$indicator$$";
|
|
32509
32629
|
const DrillDown = '<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>';
|
|
32510
32630
|
const DrillUp = '<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>';
|
|
@@ -33017,6 +33137,10 @@
|
|
|
33017
33137
|
var _a;
|
|
33018
33138
|
return null !== (_a = columnResize.width) && void 0 !== _a ? _a : columnResize.lineWidth + 2;
|
|
33019
33139
|
},
|
|
33140
|
+
get resizeHotSpotSize() {
|
|
33141
|
+
var _a;
|
|
33142
|
+
return null !== (_a = columnResize.resizeHotSpotSize) && void 0 !== _a ? _a : 16;
|
|
33143
|
+
},
|
|
33020
33144
|
get labelColor() {
|
|
33021
33145
|
var _a;
|
|
33022
33146
|
return null !== (_a = columnResize.labelColor) && void 0 !== _a ? _a : "#FFF";
|
|
@@ -36461,6 +36585,24 @@
|
|
|
36461
36585
|
cursor: "pointer"
|
|
36462
36586
|
};
|
|
36463
36587
|
},
|
|
36588
|
+
get loading() {
|
|
36589
|
+
return {
|
|
36590
|
+
type: "image",
|
|
36591
|
+
src: "https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/media/loading-circle.gif",
|
|
36592
|
+
width: collapse_size,
|
|
36593
|
+
height: collapse_size,
|
|
36594
|
+
name: "loading",
|
|
36595
|
+
positionType: IconPosition.contentLeft,
|
|
36596
|
+
marginLeft: 0,
|
|
36597
|
+
marginRight: 4,
|
|
36598
|
+
hover: {
|
|
36599
|
+
width: collapse_size_2,
|
|
36600
|
+
height: collapse_size_2,
|
|
36601
|
+
bgColor: "rgba(101, 117, 168, 0.1)"
|
|
36602
|
+
},
|
|
36603
|
+
isGif: !0
|
|
36604
|
+
};
|
|
36605
|
+
},
|
|
36464
36606
|
get drillDown() {
|
|
36465
36607
|
return {
|
|
36466
36608
|
name: "drillDown",
|
|
@@ -44486,7 +44628,7 @@
|
|
|
44486
44628
|
createFrameBorder(this.bodyGroup, this.table.theme.bodyStyle.frameStyle, this.bodyGroup.role, isListTableWithFrozen ? [!0, !0, !0, !1] : void 0), createFrameBorder(this.rowHeaderGroup, this.isPivot || this.table.internalProps.transpose ? this.table.theme.rowHeaderStyle.frameStyle : this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [!0, !1, !0, !0] : void 0), createFrameBorder(this.colHeaderGroup, this.table.theme.headerStyle.frameStyle, this.colHeaderGroup.role, isListTableWithFrozen ? [!0, !0, !0, !1] : void 0), createFrameBorder(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [!0, !1, !0, !0] : void 0), createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0);
|
|
44487
44629
|
}
|
|
44488
44630
|
getResizeColAt(abstractX, abstractY, cellGroup) {
|
|
44489
|
-
|
|
44631
|
+
const offset = this.table.theme.columnResize.resizeHotSpotSize / 2;
|
|
44490
44632
|
let cell;
|
|
44491
44633
|
if (!cellGroup) {
|
|
44492
44634
|
const drawRange = this.table.getDrawRange();
|
|
@@ -44512,7 +44654,7 @@
|
|
|
44512
44654
|
};
|
|
44513
44655
|
}
|
|
44514
44656
|
getResizeRowAt(abstractX, abstractY, cellGroup) {
|
|
44515
|
-
|
|
44657
|
+
const offset = this.table.theme.columnResize.resizeHotSpotSize / 2;
|
|
44516
44658
|
if (cellGroup) {
|
|
44517
44659
|
let cell;
|
|
44518
44660
|
if (abstractY < cellGroup.globalAABBBounds.y1 + offset ? cell = {
|
|
@@ -45991,10 +46133,7 @@
|
|
|
45991
46133
|
}, 0), this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col), this.checkFrozen(), this.table.scenegraph.component.hideResizeCol(), this.table.scenegraph.updateNextFrame();
|
|
45992
46134
|
}
|
|
45993
46135
|
startResizeCol(col, x, y, isRightFrozen) {
|
|
45994
|
-
|
|
45995
|
-
this.columnResize.resizing = !0, this.columnResize.col = col, this.columnResize.x = x, this.columnResize.isRightFrozen = isRightFrozen, this.table.scenegraph.component.showResizeCol(col, y, isRightFrozen);
|
|
45996
|
-
const isHasSelected = !!(null === (_a = this.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
45997
|
-
this.updateSelectPos(-1, -1), this.endSelectCells(!0, isHasSelected), this.table.scenegraph.updateNextFrame();
|
|
46136
|
+
this.columnResize.resizing = !0, this.columnResize.col = col, this.columnResize.x = x, this.columnResize.isRightFrozen = isRightFrozen, this.table.scenegraph.component.showResizeCol(col, y, isRightFrozen), this.table.scenegraph.updateNextFrame();
|
|
45998
46137
|
}
|
|
45999
46138
|
updateResizeCol(xInTable, yInTable) {
|
|
46000
46139
|
updateResizeColumn(xInTable, yInTable, this);
|
|
@@ -46627,7 +46766,7 @@
|
|
|
46627
46766
|
event: e.nativeEvent,
|
|
46628
46767
|
target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
|
|
46629
46768
|
mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
|
|
46630
|
-
}), stateManager.interactionState === InteractionState.grabing && !(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor)) return void (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1 && (stateManager.isResizeCol() || (stateManager.isMoveCol() ? eventManager.dealColumnMover(eventArgsSet) : stateManager.isFillHandle() ? eventManager.dealFillSelect(eventArgsSet, !0) : (null === (_h = table.options.select) || void 0 === _h ? void 0 : _h.disableDragSelect) || eventManager.dealTableSelect(eventArgsSet, !0))));
|
|
46769
|
+
}), stateManager.interactionState === InteractionState.grabing && !(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor)) return void (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1 && (stateManager.isResizeCol() || stateManager.isResizeRow() || (stateManager.isMoveCol() ? eventManager.dealColumnMover(eventArgsSet) : stateManager.isFillHandle() ? eventManager.dealFillSelect(eventArgsSet, !0) : (null === (_h = table.options.select) || void 0 === _h ? void 0 : _h.disableDragSelect) || eventManager.dealTableSelect(eventArgsSet, !0))));
|
|
46631
46770
|
!(null === (_j = table.options.select) || void 0 === _j ? void 0 : _j.disableDragSelect) && table.eventManager.isDraging && stateManager.isSelecting() && !(null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) && eventManager.dealTableSelect(eventArgsSet, !0);
|
|
46632
46771
|
const cellGoup = e.path.find(node => "cell" === node.role);
|
|
46633
46772
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && (-1 === table.stateManager.hover.cellPos.col || -1 === table.stateManager.hover.cellPos.row || (null == cellGoup ? void 0 : cellGoup.col) === table.stateManager.hover.cellPos.col && (null == cellGoup ? void 0 : cellGoup.row) === table.stateManager.hover.cellPos.row || table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
@@ -46712,7 +46851,7 @@
|
|
|
46712
46851
|
event: e.nativeEvent
|
|
46713
46852
|
});
|
|
46714
46853
|
}), table.scenegraph.tableGroup.addEventListener("pointerleave", e => {
|
|
46715
|
-
stateManager.isResizeCol() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor()), (table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.horizontalVisible || !table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideHorizontalScrollBar(), (table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.verticalVisible || !table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideVerticalScrollBar(), table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && -1 !== table.stateManager.hover.cellPos.col && -1 !== table.stateManager.hover.cellPos.row && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
46854
|
+
stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor()), (table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.horizontalVisible || !table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideHorizontalScrollBar(), (table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.verticalVisible || !table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideVerticalScrollBar(), table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && -1 !== table.stateManager.hover.cellPos.col && -1 !== table.stateManager.hover.cellPos.row && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
46716
46855
|
col: table.stateManager.hover.cellPos.col,
|
|
46717
46856
|
row: table.stateManager.hover.cellPos.row,
|
|
46718
46857
|
cellRange: table.getCellRangeRelativeRect({
|
|
@@ -46915,14 +47054,14 @@
|
|
|
46915
47054
|
eventArgs: eventArgs
|
|
46916
47055
|
} = eventArgsSet;
|
|
46917
47056
|
if (!(null == eventArgs ? void 0 : eventArgs.targetCell)) {
|
|
46918
|
-
table.getCellAt(eventArgsSet.abstractPos.x -
|
|
47057
|
+
table.getCellAt(eventArgsSet.abstractPos.x - table.theme.columnResize.resizeHotSpotSize / 2, eventArgsSet.abstractPos.y) && table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE) && table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
46919
47058
|
event: e.nativeEvent
|
|
46920
47059
|
});
|
|
46921
47060
|
}
|
|
46922
47061
|
}
|
|
46923
47062
|
});
|
|
46924
47063
|
}), table.scenegraph.stage.addEventListener("pointerup", e => {
|
|
46925
|
-
"grabing" === stateManager.interactionState && (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol()
|
|
47064
|
+
"grabing" === stateManager.interactionState && (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol() ? endResizeCol(table) : stateManager.isResizeRow() && endResizeRow(table));
|
|
46926
47065
|
}), table.scenegraph.stage.addEventListener("pointertap", e => {
|
|
46927
47066
|
var _a, _b, _c;
|
|
46928
47067
|
const target = e.target;
|
|
@@ -50315,7 +50454,7 @@
|
|
|
50315
50454
|
constructor(container) {
|
|
50316
50455
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
50317
50456
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
50318
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.13.2
|
|
50457
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.13.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
50319
50458
|
const {
|
|
50320
50459
|
frozenColCount = 0,
|
|
50321
50460
|
frozenRowCount: frozenRowCount,
|
|
@@ -59447,8 +59586,25 @@
|
|
|
59447
59586
|
stateManager.updateInteractionState(InteractionState$1.grabing);
|
|
59448
59587
|
}
|
|
59449
59588
|
else if (gantt.parsedOptions.taskBarMoveable) {
|
|
59450
|
-
|
|
59451
|
-
|
|
59589
|
+
let moveable = true;
|
|
59590
|
+
if (typeof gantt.parsedOptions.taskBarMoveable === 'function') {
|
|
59591
|
+
const { startDate, endDate, taskRecord } = scene._gantt.getTaskInfoByTaskListIndex(downBarNode.task_index, downBarNode.sub_task_index);
|
|
59592
|
+
const args = {
|
|
59593
|
+
index: downBarNode.task_index,
|
|
59594
|
+
startDate,
|
|
59595
|
+
endDate,
|
|
59596
|
+
taskRecord,
|
|
59597
|
+
ganttInstance: scene._gantt
|
|
59598
|
+
};
|
|
59599
|
+
moveable = gantt.parsedOptions.taskBarMoveable(args);
|
|
59600
|
+
}
|
|
59601
|
+
else {
|
|
59602
|
+
moveable = gantt.parsedOptions.taskBarMoveable;
|
|
59603
|
+
}
|
|
59604
|
+
if (moveable) {
|
|
59605
|
+
stateManager.startMoveTaskBar(downBarNode, e.nativeEvent.x, e.nativeEvent.y, e.offset.y);
|
|
59606
|
+
stateManager.updateInteractionState(InteractionState$1.grabing);
|
|
59607
|
+
}
|
|
59452
59608
|
}
|
|
59453
59609
|
}
|
|
59454
59610
|
else if (downLeftLinkPointNode) {
|
|
@@ -60763,19 +60919,15 @@
|
|
|
60763
60919
|
|
|
60764
60920
|
class DataSource {
|
|
60765
60921
|
records;
|
|
60766
|
-
minDate;
|
|
60767
|
-
maxDate;
|
|
60768
60922
|
_gantt;
|
|
60769
60923
|
constructor(_gantt) {
|
|
60770
60924
|
this._gantt = _gantt;
|
|
60771
60925
|
this.records = _gantt.records;
|
|
60772
|
-
this.minDate = _gantt.parsedOptions.minDate;
|
|
60773
|
-
this.maxDate = _gantt.parsedOptions.maxDate;
|
|
60774
60926
|
this.processRecords();
|
|
60775
60927
|
}
|
|
60776
60928
|
processRecords() {
|
|
60777
|
-
const needMinDate = !this.minDate;
|
|
60778
|
-
const needMaxDate = !this.maxDate;
|
|
60929
|
+
const needMinDate = !this._gantt.options.minDate;
|
|
60930
|
+
const needMaxDate = !this._gantt.options.maxDate;
|
|
60779
60931
|
let minDate = Number.MAX_SAFE_INTEGER;
|
|
60780
60932
|
let maxDate = Number.MIN_SAFE_INTEGER;
|
|
60781
60933
|
if ((needMinDate ||
|
|
@@ -60802,8 +60954,6 @@
|
|
|
60802
60954
|
});
|
|
60803
60955
|
}
|
|
60804
60956
|
}
|
|
60805
|
-
needMinDate && (this.minDate = createDateAtMidnight(minDate));
|
|
60806
|
-
needMaxDate && (this.maxDate = createDateAtMidnight(maxDate));
|
|
60807
60957
|
const { unit: minTimeUnit, startOfWeek, step } = this._gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
60808
60958
|
if (needMinDate) {
|
|
60809
60959
|
this._gantt.parsedOptions.minDate = getStartDateByTimeUnit(new Date(minDate), minTimeUnit, startOfWeek);
|
|
@@ -61436,9 +61586,32 @@
|
|
|
61436
61586
|
}
|
|
61437
61587
|
this.scenegraph = null;
|
|
61438
61588
|
}
|
|
61589
|
+
updateOption(options) {
|
|
61590
|
+
this.taskListTableInstance?.release();
|
|
61591
|
+
this.parsedOptions = {};
|
|
61592
|
+
this.options = options;
|
|
61593
|
+
this.taskTableWidth =
|
|
61594
|
+
typeof options?.taskListTable?.tableWidth === 'number' ? options?.taskListTable?.tableWidth : -1;
|
|
61595
|
+
this.taskTableColumns = options?.taskListTable?.columns ?? [];
|
|
61596
|
+
this.records = options?.records ?? [];
|
|
61597
|
+
this._sortScales();
|
|
61598
|
+
initOptions(this);
|
|
61599
|
+
this.data.setRecords(this.records);
|
|
61600
|
+
this._generateTimeLineDateMap();
|
|
61601
|
+
this.timeLineHeaderLevel = this.parsedOptions.sortedTimelineScales.length;
|
|
61602
|
+
this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';
|
|
61603
|
+
this._updateSize();
|
|
61604
|
+
this._generateListTable();
|
|
61605
|
+
this._syncPropsFromTable();
|
|
61606
|
+
updateSplitLineAndResizeLine(this);
|
|
61607
|
+
this.scenegraph.updateSceneGraph();
|
|
61608
|
+
this.scenegraph.afterCreateSceneGraph();
|
|
61609
|
+
this._scrollToMarkLine();
|
|
61610
|
+
}
|
|
61439
61611
|
setRecords(records) {
|
|
61440
61612
|
this.records = records;
|
|
61441
61613
|
this.data.setRecords(records);
|
|
61614
|
+
updateOptionsWhenRecordChanged(this);
|
|
61442
61615
|
this.taskListTableInstance.setRecords(records);
|
|
61443
61616
|
this._syncPropsFromTable();
|
|
61444
61617
|
this._generateTimeLineDateMap();
|
|
@@ -61474,6 +61647,15 @@
|
|
|
61474
61647
|
}
|
|
61475
61648
|
}
|
|
61476
61649
|
}
|
|
61650
|
+
updateDateRange(minDate, maxDate) {
|
|
61651
|
+
this.options.minDate = minDate;
|
|
61652
|
+
this.options.maxDate = maxDate;
|
|
61653
|
+
updateOptionsWhenDateRangeChanged(this);
|
|
61654
|
+
this._generateTimeLineDateMap();
|
|
61655
|
+
this._updateSize();
|
|
61656
|
+
this.scenegraph.refreshAll();
|
|
61657
|
+
this._scrollToMarkLine();
|
|
61658
|
+
}
|
|
61477
61659
|
_scrollToMarkLine() {
|
|
61478
61660
|
if (this.parsedOptions.scrollToMarkLineDate && this.parsedOptions.minDate) {
|
|
61479
61661
|
const minDate = this.parsedOptions.minDate;
|
|
@@ -61609,7 +61791,7 @@
|
|
|
61609
61791
|
themes: themes$1
|
|
61610
61792
|
});
|
|
61611
61793
|
|
|
61612
|
-
const version = "1.13.2
|
|
61794
|
+
const version = "1.13.2";
|
|
61613
61795
|
|
|
61614
61796
|
exports.Gantt = Gantt;
|
|
61615
61797
|
exports.TYPES = index$3;
|