@visactor/vtable-gantt 1.19.4 → 1.19.6
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/data/DataSource.js +2 -1
- package/cjs/event/touch.js +0 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/mark-line.js +3 -2
- package/cjs/scenegraph/mark-line.js.map +1 -1
- package/cjs/scenegraph/timeline-header.js +1 -2
- package/cjs/state/gantt-table-sync.js +1 -0
- package/cjs/state/state-manager.js +25 -1
- package/cjs/state/state-manager.js.map +1 -1
- package/cjs/ts-types/EVENT_TYPE.d.ts +1 -0
- package/cjs/ts-types/EVENT_TYPE.js +2 -1
- package/cjs/ts-types/EVENT_TYPE.js.map +1 -1
- package/cjs/ts-types/events.d.ts +12 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/dist/vtable-gantt.js +308 -109
- package/dist/vtable-gantt.min.js +2 -2
- package/es/data/DataSource.js +2 -1
- package/es/event/touch.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/mark-line.js +3 -2
- package/es/scenegraph/mark-line.js.map +1 -1
- package/es/scenegraph/timeline-header.js +1 -2
- package/es/state/gantt-table-sync.js +2 -1
- package/es/state/state-manager.js +24 -1
- package/es/state/state-manager.js.map +1 -1
- package/es/ts-types/EVENT_TYPE.d.ts +1 -0
- package/es/ts-types/EVENT_TYPE.js +2 -1
- package/es/ts-types/EVENT_TYPE.js.map +1 -1
- package/es/ts-types/events.d.ts +12 -0
- package/es/ts-types/events.js.map +1 -1
- package/package.json +5 -5
package/cjs/data/DataSource.js
CHANGED
package/cjs/event/touch.js
CHANGED
package/cjs/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.19.
|
|
9
|
+
export declare const version = "1.19.6";
|
|
10
10
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.19.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.19.6\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
|
|
@@ -27,9 +27,10 @@ class MarkLine {
|
|
|
27
27
|
}), this.group.appendChild(this.markLIneContainer), this.initMarkLines();
|
|
28
28
|
}
|
|
29
29
|
initMarkLines() {
|
|
30
|
-
this._scene._gantt.parsedOptions.markLine
|
|
30
|
+
const markLine = this._scene._gantt.parsedOptions.markLine, minDate = this._scene._gantt.parsedOptions.minDate;
|
|
31
|
+
minDate && markLine.forEach((line => {
|
|
31
32
|
const style = line.style, contentStyle = line.contentStyle || {}, date = this._scene._gantt.parsedOptions.timeScaleIncludeHour ? (0,
|
|
32
|
-
util_1.createDateAtMidnight)(line.date) : (0, util_1.createDateAtMidnight)(line.date, !0),
|
|
33
|
+
util_1.createDateAtMidnight)(line.date) : (0, util_1.createDateAtMidnight)(line.date, !0), {unit: unit, step: step} = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], unitCount = (0,
|
|
33
34
|
util_1.computeCountToTimeScale)(date, minDate, unit, step);
|
|
34
35
|
let positionOffset = 0;
|
|
35
36
|
if ("right" === line.position) positionOffset = 1; else if ("middle" === line.position) positionOffset = .5; else if ("date" === line.position) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/mark-line.ts"],"names":[],"mappings":";;;AAAA,wCAA8E;AAI9E,yDAAsE;AAEtE,MAAa,QAAQ;IAMnB,YAAY,KAAiB;QAF7B,2BAAsB,GAAW,EAAE,CAAC;QAGlC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC7G,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC;YACrB,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE;YACxC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,qBAAqB,CAAC;QACxC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEtC,IAAI,CAAC,iBAAiB,GAAG,IAAI,eAAK,CAAC;YACjC,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,W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,CAAC;4BACxB,EAAE,EAAE,CAAC,mBAAmB,GAAG,CAAC;yBAC7B;qBACF,CAAC,CAAC;oBACH,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;iBAC7B;YACH,CAAC,CAAC,CAAC;IACP,CAAC;IAGD,OAAO;QACL,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC9E,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC9C,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,CAAC,CAAS;QACZ,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA/HD,4BA+HC","file":"mark-line.js","sourcesContent":["import { computeCountToTimeScale, createDateAtMidnight } from '../tools/util';\nimport { DayTimes } from '../gantt-helper';\n//import type { IMarkLine } from '../ts-types';\nimport type { Scenegraph } from './scenegraph';\nimport { Group, createLine, Text } from '@visactor/vtable/es/vrender';\n\nexport class MarkLine {\n _scene: Scenegraph;\n group: Group;\n markLIneContainer: Group;\n markLineContainerWidth: number = 20;\n height: number;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.height =\n Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight) - scene._gantt.getAllHeaderRowsHeight();\n this.group = new Group({\n x: 0,\n y: scene._gantt.getAllHeaderRowsHeight(),\n width: scene._gantt.tableNoFrameWidth,\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.name = 'mark-line-container';\n scene.ganttGroup.addChild(this.group);\n\n this.markLIneContainer = new Group({\n x: 0,\n y: 0,\n width: this._scene._gantt.getAllDateColsWidth(),\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.appendChild(this.markLIneContainer);\n this.initMarkLines();\n }\n initMarkLines() {\n const markLine = this._scene._gantt.parsedOptions.markLine;\n const minDate = this._scene._gantt.parsedOptions.minDate;\n minDate &&\n markLine.forEach(line => {\n const style = line.style;\n const contentStyle = line.contentStyle || {};\n const date = this._scene._gantt.parsedOptions.timeScaleIncludeHour\n ? createDateAtMidnight(line.date)\n : createDateAtMidnight(line.date, true);\n const { unit, step } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const unitCount = computeCountToTimeScale(date, minDate, unit, step);\n let positionOffset = 0;\n if (line.position === 'right') {\n positionOffset = 1;\n } else if (line.position === 'middle') {\n positionOffset = 0.5;\n } else if (line.position === 'date') {\n const date = createDateAtMidnight(line.date);\n const unitCount = computeCountToTimeScale(date, minDate, unit, step);\n const cellIndex = Math.floor(unitCount);\n positionOffset = unitCount - cellIndex;\n }\n const dateX = this._scene._gantt.parsedOptions.timelineColWidth * (Math.floor(unitCount) + positionOffset);\n const markLineGroup = new Group({\n pickable: false,\n x: dateX - this.markLineContainerWidth / 2,\n y: 0,\n width: this.markLineContainerWidth,\n height: this.height\n });\n markLineGroup.name = 'mark-line';\n this.markLIneContainer.appendChild(markLineGroup);\n // 创建整个任务条rect\n const lineObj = createLine({\n pickable: false,\n stroke: style.lineColor,\n lineWidth: style.lineWidth,\n lineDash: style.lineDash,\n points: [\n { x: this.markLineContainerWidth / 2, y: 0 },\n { x: this.markLineContainerWidth / 2, y: this.height }\n ]\n });\n markLineGroup.appendChild(lineObj);\n if (line.content) {\n const textMaxLineWidth = this._scene._gantt.parsedOptions.timelineColWidth;\n const textContainerHeight = contentStyle.lineHeight || 18;\n // 创建内容区\n const textGroup = new Group({\n x: this.markLineContainerWidth / 2,\n y: 0,\n cursor: 'pointer',\n height: textContainerHeight,\n clip: false,\n fill: contentStyle.backgroundColor || style.lineColor,\n display: 'flex',\n cornerRadius: contentStyle.cornerRadius || [0, 2, 2, 0]\n });\n textGroup.name = 'mark-line-content';\n textGroup.data = line;\n markLineGroup.appendChild(textGroup);\n // 创建内容\n const text = new Text({\n maxLineWidth: textMaxLineWidth,\n text: line.content,\n cursor: 'pointer',\n lineHeight: textContainerHeight,\n fontWeight: contentStyle.fontWeight || 'normal',\n fill: contentStyle.color || style.lineColor,\n fontSize: contentStyle.fontSize || 12,\n poptip: {\n position: 'top',\n dx: textMaxLineWidth / 4,\n dy: -textContainerHeight / 4\n }\n });\n textGroup.appendChild(text);\n }\n });\n }\n\n /** 重新场景场景树节点 */\n refresh() {\n this.height =\n Math.min(this._scene._gantt.tableNoFrameHeight, this._scene._gantt.drawHeight) -\n this._scene._gantt.getAllHeaderRowsHeight();\n this.markLIneContainer.removeAllChild();\n this.group.setAttribute('height', this.height);\n this.markLIneContainer.setAttribute('height', this.height);\n this.initMarkLines();\n }\n setX(x: number) {\n this.markLIneContainer.setAttribute('x', x);\n }\n}\n"]}
|
|
@@ -89,6 +89,7 @@ function _syncTableSize(gantt) {
|
|
|
89
89
|
gantt._updateSize(), (0, gantt_helper_1.updateSplitLineAndResizeLine)(gantt));
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
//# sourceMappingURL=gantt-table-sync.js.map
|
|
92
93
|
exports.syncScrollStateToTable = syncScrollStateToTable, exports.syncScrollStateFromTable = syncScrollStateFromTable,
|
|
93
94
|
exports.syncEditCellFromTable = syncEditCellFromTable, exports.syncTreeChangeFromTable = syncTreeChangeFromTable,
|
|
94
95
|
exports.syncSortFromTable = syncSortFromTable, exports.syncDragOrderFromTable = syncDragOrderFromTable,
|
|
@@ -142,7 +142,7 @@ class StateManager {
|
|
|
142
142
|
this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling() && this.moveTaskBar.moveTaskBarXInertia.endInertia();
|
|
143
143
|
const deltaX = this.moveTaskBar.deltaX, deltaY = this.moveTaskBar.deltaY, target = this.moveTaskBar.target;
|
|
144
144
|
if (Math.abs(deltaX) >= 1 || Math.abs(deltaY) >= 1) {
|
|
145
|
-
const taskIndex = target.task_index, sub_task_index = target.sub_task_index, {startDate: oldStartDate, endDate: oldEndDate} = this._gantt.getTaskInfoByTaskListIndex(taskIndex, sub_task_index), targetEndY = this.moveTaskBar.targetStartY + this._gantt.parsedOptions.rowHeight * Math.round(deltaY / this._gantt.parsedOptions.rowHeight), milestoneTaskbarHeight = this._gantt.parsedOptions.taskBarMilestoneStyle.width, testDateX = this.moveTaskBar.target.attribute.x + (target.record.type === ts_types_1.TaskType.MILESTONE ? milestoneTaskbarHeight / 2 : 0), startDateColIndex = (0,
|
|
145
|
+
const oldRowIndex = target.task_index, taskIndex = target.task_index, sub_task_index = target.sub_task_index, {startDate: oldStartDate, endDate: oldEndDate} = this._gantt.getTaskInfoByTaskListIndex(taskIndex, sub_task_index), targetEndY = this.moveTaskBar.targetStartY + this._gantt.parsedOptions.rowHeight * Math.round(deltaY / this._gantt.parsedOptions.rowHeight), milestoneTaskbarHeight = this._gantt.parsedOptions.taskBarMilestoneStyle.width, testDateX = this.moveTaskBar.target.attribute.x + (target.record.type === ts_types_1.TaskType.MILESTONE ? milestoneTaskbarHeight / 2 : 0), startDateColIndex = (0,
|
|
146
146
|
gantt_helper_1.getDateIndexByX)(testDateX - this._gantt.stateManager.scroll.horizontalBarPos, this._gantt), timelineStartDate = this._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[startDateColIndex];
|
|
147
147
|
if (!timelineStartDate) return;
|
|
148
148
|
const newStartDate = timelineStartDate.startDate, newEndDate = new Date(newStartDate.getTime() + ((0,
|
|
@@ -160,6 +160,30 @@ class StateManager {
|
|
|
160
160
|
index: taskIndex,
|
|
161
161
|
record: newRecord
|
|
162
162
|
});
|
|
163
|
+
const newRowIndex = (0, gantt_helper_1.getTaskIndexsByTaskY)(targetEndY, this._gantt).task_index;
|
|
164
|
+
this._gantt.hasListeners(ts_types_1.GANTT_EVENT_TYPE.MOVE_END_TASK_BAR) && this._gantt.fireListeners(ts_types_1.GANTT_EVENT_TYPE.MOVE_END_TASK_BAR, {
|
|
165
|
+
startDate: newRecord[this._gantt.parsedOptions.startDateField],
|
|
166
|
+
endDate: newRecord[this._gantt.parsedOptions.endDateField],
|
|
167
|
+
oldStartDate: oldStartDate,
|
|
168
|
+
oldEndDate: oldEndDate,
|
|
169
|
+
oldRowIndex: oldRowIndex,
|
|
170
|
+
newRowIndex: newRowIndex,
|
|
171
|
+
index: taskIndex,
|
|
172
|
+
record: newRecord
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
const newRecord = this._gantt.getRecordByIndex(taskIndex, sub_task_index), newRowIndex = (0,
|
|
176
|
+
gantt_helper_1.getTaskIndexsByTaskY)(targetEndY, this._gantt).task_index;
|
|
177
|
+
this._gantt.hasListeners(ts_types_1.GANTT_EVENT_TYPE.MOVE_END_TASK_BAR) && this._gantt.fireListeners(ts_types_1.GANTT_EVENT_TYPE.MOVE_END_TASK_BAR, {
|
|
178
|
+
startDate: newRecord[this._gantt.parsedOptions.startDateField],
|
|
179
|
+
endDate: newRecord[this._gantt.parsedOptions.endDateField],
|
|
180
|
+
oldStartDate: oldStartDate,
|
|
181
|
+
oldEndDate: oldEndDate,
|
|
182
|
+
oldRowIndex: oldRowIndex,
|
|
183
|
+
newRowIndex: newRowIndex,
|
|
184
|
+
index: newRowIndex,
|
|
185
|
+
record: newRecord
|
|
186
|
+
});
|
|
163
187
|
}
|
|
164
188
|
if (this._gantt.parsedOptions.tasksShowMode === ts_types_1.TasksShowMode.Sub_Tasks_Arrange || this._gantt.parsedOptions.tasksShowMode === ts_types_1.TasksShowMode.Sub_Tasks_Compact) {
|
|
165
189
|
const indexs = (0, gantt_helper_1.getTaskIndexsByTaskY)(targetEndY, this._gantt);
|