@visactor/vtable-gantt 1.19.5 → 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/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/dist/vtable-gantt.js +126 -90
- package/dist/vtable-gantt.min.js +2 -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/package.json +3 -3
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,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I,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"]}
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -41859,6 +41859,7 @@
|
|
|
41859
41859
|
}
|
|
41860
41860
|
function dealWithIcon(icon, mark, col, row, range, table, dealWithIconComputeVar) {
|
|
41861
41861
|
var _a, _b, _c, _d, _e, _f;
|
|
41862
|
+
if (!icon) return;
|
|
41862
41863
|
const iconAttribute = {};
|
|
41863
41864
|
"image" === icon.type ? icon.isGif ? (iconAttribute.gif = icon.src, iconAttribute.image = icon.src) : iconAttribute.image = icon.src : ("svg" === icon.type || "svg" in icon) && (iconAttribute.image = icon.svg), iconAttribute.width = icon.width, iconAttribute.height = icon.height, iconAttribute.visibleTime = null !== (_a = icon.visibleTime) && void 0 !== _a ? _a : "always", iconAttribute.funcType = icon.funcType, iconAttribute.interactive = icon.interactive, iconAttribute.isGif = icon.isGif;
|
|
41864
41865
|
let iconMark,
|
|
@@ -45960,7 +45961,7 @@
|
|
|
45960
45961
|
|
|
45961
45962
|
function computeColsWidth(table, colStart, colEnd, update) {
|
|
45962
45963
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
45963
|
-
table.internalProps.columnWidthConfig &&
|
|
45964
|
+
table.internalProps.columnWidthConfig && _parseColumnWidthConfig(table, table.internalProps.columnWidthConfig), table.isPivotTable() && table.internalProps.columnWidthConfigForRowHeader && _parseColumnWidthConfigForPivotRowHeader(table, table.internalProps.columnWidthConfigForRowHeader), colStart = null != colStart ? colStart : 0, colEnd = null != colEnd ? colEnd : table.colCount - 1, 0 === colStart && colEnd === table.colCount - 1 && table._clearColRangeWidthsMap();
|
|
45964
45965
|
const layoutMap = table.internalProps.layoutMap;
|
|
45965
45966
|
table.isPivotTable() && (layoutMap.enableUseGetBodyCache(), layoutMap.enableUseHeaderPathCache());
|
|
45966
45967
|
const oldColWidths = [],
|
|
@@ -46267,6 +46268,54 @@
|
|
|
46267
46268
|
}, 0) : Math.round((update && null !== (_d = newWidths[col]) && void 0 !== _d ? _d : table.getColWidth(col)) * factor), update ? newWidths[col] = table._adjustColWidth(col, colWidth) : fromScenegraph ? table.scenegraph.setColWidth(col, table._adjustColWidth(col, colWidth)) : table._setColWidth(col, table._adjustColWidth(col, colWidth), !1, !0);
|
|
46268
46269
|
}
|
|
46269
46270
|
}
|
|
46271
|
+
function _parseColumnWidthConfig(table, columnWidthConfig) {
|
|
46272
|
+
table.isPivotTable() ? _parseColumnWidthConfigForPivotTable(table, columnWidthConfig) : table.isListTable() && _parseColumnWidthConfigForListTable(table, columnWidthConfig);
|
|
46273
|
+
}
|
|
46274
|
+
function _parseColumnWidthConfigForListTable(table, columnWidthConfig) {
|
|
46275
|
+
for (let i = 0; i < (null == columnWidthConfig ? void 0 : columnWidthConfig.length); i++) {
|
|
46276
|
+
const item = columnWidthConfig[i],
|
|
46277
|
+
key = item.key,
|
|
46278
|
+
width = item.width,
|
|
46279
|
+
columnData = table.internalProps.layoutMap.getColumnByKey(key);
|
|
46280
|
+
if (columnData.columnDefine) {
|
|
46281
|
+
const {
|
|
46282
|
+
col: col
|
|
46283
|
+
} = columnData;
|
|
46284
|
+
table.internalProps._widthResizedColMap.has(col) || (table._setColWidth(col, width), table.internalProps._widthResizedColMap.add(col));
|
|
46285
|
+
}
|
|
46286
|
+
}
|
|
46287
|
+
}
|
|
46288
|
+
function _parseColumnWidthConfigForPivotTable(table, columnWidthConfig) {
|
|
46289
|
+
for (let i = 0; i < (null == columnWidthConfig ? void 0 : columnWidthConfig.length); i++) {
|
|
46290
|
+
const item = columnWidthConfig[i],
|
|
46291
|
+
dimensions = item.dimensions,
|
|
46292
|
+
width = item.width,
|
|
46293
|
+
cell = table.getCellAddressByHeaderPaths(dimensions);
|
|
46294
|
+
if (cell && cell.col >= table.rowHeaderLevelCount) {
|
|
46295
|
+
const cellPath = table.getCellHeaderPaths(cell.col, table.columnHeaderLevelCount);
|
|
46296
|
+
if (cellPath.colHeaderPaths.length === dimensions.length) {
|
|
46297
|
+
let match = !0;
|
|
46298
|
+
for (let i = 0; i < dimensions.length; i++) {
|
|
46299
|
+
const dimension = dimensions[i];
|
|
46300
|
+
if (cellPath.colHeaderPaths.findIndex((colPath, index) => colPath.indicatorKey === dimension.indicatorKey || colPath.dimensionKey === dimension.dimensionKey && colPath.value === dimension.value) < 0) {
|
|
46301
|
+
match = !1;
|
|
46302
|
+
break;
|
|
46303
|
+
}
|
|
46304
|
+
}
|
|
46305
|
+
match && !table.internalProps._widthResizedColMap.has(cell.col) && (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col));
|
|
46306
|
+
}
|
|
46307
|
+
} else cell && cell.col < table.rowHeaderLevelCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
|
|
46308
|
+
}
|
|
46309
|
+
}
|
|
46310
|
+
function _parseColumnWidthConfigForPivotRowHeader(table, columnWidthConfig) {
|
|
46311
|
+
for (let i = 0; i < (null == columnWidthConfig ? void 0 : columnWidthConfig.length); i++) {
|
|
46312
|
+
const item = columnWidthConfig[i],
|
|
46313
|
+
dimensions = item.dimensions,
|
|
46314
|
+
width = item.width,
|
|
46315
|
+
cell = table.getCellAddressByHeaderPaths(dimensions);
|
|
46316
|
+
cell && cell.col < table.rowHeaderLevelCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
|
|
46317
|
+
}
|
|
46318
|
+
}
|
|
46270
46319
|
|
|
46271
46320
|
const emptyGroup = new Group$1({});
|
|
46272
46321
|
emptyGroup.role = "empty";
|
|
@@ -48849,7 +48898,7 @@
|
|
|
48849
48898
|
function updateHierarchyIcon(col, row, scene) {
|
|
48850
48899
|
let iconConfig;
|
|
48851
48900
|
iconConfig = scene.table.isHeader(col, row) ? scene.table.internalProps.headerHelper.getHierarchyIcon(col, row) : scene.table.internalProps.bodyHelper.getHierarchyIcon(col, row), updateCellRangeIcon(col, row, icon => icon.attribute.funcType === IconFuncTypeEnum.collapse || icon.attribute.funcType === IconFuncTypeEnum.expand, icon => {
|
|
48852
|
-
dealWithIcon(iconConfig, icon), icon.name = iconConfig.name;
|
|
48901
|
+
dealWithIcon(iconConfig, icon), icon.name = null == iconConfig ? void 0 : iconConfig.name;
|
|
48853
48902
|
}, scene);
|
|
48854
48903
|
}
|
|
48855
48904
|
function updateCellGroupIcon(cellGroup, filter, dealer) {
|
|
@@ -56363,7 +56412,7 @@
|
|
|
56363
56412
|
}
|
|
56364
56413
|
constructor(container, options = {}) {
|
|
56365
56414
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
56366
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.19.
|
|
56415
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.19.6", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
56367
56416
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56368
56417
|
options: options,
|
|
56369
56418
|
container: container
|
|
@@ -62002,20 +62051,6 @@
|
|
|
62002
62051
|
getBodyRowIndexByRecordIndex(index) {
|
|
62003
62052
|
return Array.isArray(index) && 1 === index.length && (index = index[0]), this.dataSource.getTableIndex(index);
|
|
62004
62053
|
}
|
|
62005
|
-
_parseColumnWidthConfig(columnWidthConfig) {
|
|
62006
|
-
for (let i = 0; i < (null == columnWidthConfig ? void 0 : columnWidthConfig.length); i++) {
|
|
62007
|
-
const item = columnWidthConfig[i],
|
|
62008
|
-
key = item.key,
|
|
62009
|
-
width = item.width,
|
|
62010
|
-
columnData = this.internalProps.layoutMap.getColumnByKey(key);
|
|
62011
|
-
if (columnData.columnDefine) {
|
|
62012
|
-
const {
|
|
62013
|
-
col: col
|
|
62014
|
-
} = columnData;
|
|
62015
|
-
this.internalProps._widthResizedColMap.has(col) || (this._setColWidth(col, width), this.internalProps._widthResizedColMap.add(col));
|
|
62016
|
-
}
|
|
62017
|
-
}
|
|
62018
|
-
}
|
|
62019
62054
|
release() {
|
|
62020
62055
|
this.editorManager.release(), super.release();
|
|
62021
62056
|
}
|
|
@@ -67631,82 +67666,83 @@
|
|
|
67631
67666
|
}
|
|
67632
67667
|
initMarkLines() {
|
|
67633
67668
|
const markLine = this._scene._gantt.parsedOptions.markLine;
|
|
67634
|
-
|
|
67635
|
-
|
|
67636
|
-
|
|
67637
|
-
|
|
67638
|
-
|
|
67639
|
-
|
|
67640
|
-
|
|
67641
|
-
|
|
67642
|
-
|
|
67643
|
-
let positionOffset = 0;
|
|
67644
|
-
if (line.position === 'right') {
|
|
67645
|
-
positionOffset = 1;
|
|
67646
|
-
}
|
|
67647
|
-
else if (line.position === 'middle') {
|
|
67648
|
-
positionOffset = 0.5;
|
|
67649
|
-
}
|
|
67650
|
-
else if (line.position === 'date') {
|
|
67651
|
-
const date = createDateAtMidnight(line.date);
|
|
67669
|
+
const minDate = this._scene._gantt.parsedOptions.minDate;
|
|
67670
|
+
minDate &&
|
|
67671
|
+
markLine.forEach(line => {
|
|
67672
|
+
const style = line.style;
|
|
67673
|
+
const contentStyle = line.contentStyle || {};
|
|
67674
|
+
const date = this._scene._gantt.parsedOptions.timeScaleIncludeHour
|
|
67675
|
+
? createDateAtMidnight(line.date)
|
|
67676
|
+
: createDateAtMidnight(line.date, true);
|
|
67677
|
+
const { unit, step } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
67652
67678
|
const unitCount = computeCountToTimeScale(date, minDate, unit, step);
|
|
67653
|
-
|
|
67654
|
-
|
|
67655
|
-
|
|
67656
|
-
|
|
67657
|
-
|
|
67658
|
-
|
|
67659
|
-
|
|
67660
|
-
|
|
67661
|
-
|
|
67662
|
-
|
|
67663
|
-
|
|
67664
|
-
|
|
67665
|
-
|
|
67666
|
-
|
|
67667
|
-
|
|
67668
|
-
|
|
67669
|
-
|
|
67670
|
-
lineDash: style.lineDash,
|
|
67671
|
-
points: [
|
|
67672
|
-
{ x: this.markLineContainerWidth / 2, y: 0 },
|
|
67673
|
-
{ x: this.markLineContainerWidth / 2, y: this.height }
|
|
67674
|
-
]
|
|
67675
|
-
});
|
|
67676
|
-
markLineGroup.appendChild(lineObj);
|
|
67677
|
-
if (line.content) {
|
|
67678
|
-
const textMaxLineWidth = this._scene._gantt.parsedOptions.timelineColWidth;
|
|
67679
|
-
const textContainerHeight = contentStyle.lineHeight || 18;
|
|
67680
|
-
const textGroup = new Group$2({
|
|
67681
|
-
x: this.markLineContainerWidth / 2,
|
|
67679
|
+
let positionOffset = 0;
|
|
67680
|
+
if (line.position === 'right') {
|
|
67681
|
+
positionOffset = 1;
|
|
67682
|
+
}
|
|
67683
|
+
else if (line.position === 'middle') {
|
|
67684
|
+
positionOffset = 0.5;
|
|
67685
|
+
}
|
|
67686
|
+
else if (line.position === 'date') {
|
|
67687
|
+
const date = createDateAtMidnight(line.date);
|
|
67688
|
+
const unitCount = computeCountToTimeScale(date, minDate, unit, step);
|
|
67689
|
+
const cellIndex = Math.floor(unitCount);
|
|
67690
|
+
positionOffset = unitCount - cellIndex;
|
|
67691
|
+
}
|
|
67692
|
+
const dateX = this._scene._gantt.parsedOptions.timelineColWidth * (Math.floor(unitCount) + positionOffset);
|
|
67693
|
+
const markLineGroup = new Group$2({
|
|
67694
|
+
pickable: false,
|
|
67695
|
+
x: dateX - this.markLineContainerWidth / 2,
|
|
67682
67696
|
y: 0,
|
|
67683
|
-
|
|
67684
|
-
height:
|
|
67685
|
-
clip: false,
|
|
67686
|
-
fill: contentStyle.backgroundColor || style.lineColor,
|
|
67687
|
-
display: 'flex',
|
|
67688
|
-
cornerRadius: contentStyle.cornerRadius || [0, 2, 2, 0]
|
|
67697
|
+
width: this.markLineContainerWidth,
|
|
67698
|
+
height: this.height
|
|
67689
67699
|
});
|
|
67690
|
-
|
|
67691
|
-
|
|
67692
|
-
|
|
67693
|
-
|
|
67694
|
-
|
|
67695
|
-
|
|
67696
|
-
|
|
67697
|
-
|
|
67698
|
-
|
|
67699
|
-
|
|
67700
|
-
|
|
67701
|
-
poptip: {
|
|
67702
|
-
position: 'top',
|
|
67703
|
-
dx: textMaxLineWidth / 4,
|
|
67704
|
-
dy: -textContainerHeight / 4
|
|
67705
|
-
}
|
|
67700
|
+
markLineGroup.name = 'mark-line';
|
|
67701
|
+
this.markLIneContainer.appendChild(markLineGroup);
|
|
67702
|
+
const lineObj = createLine({
|
|
67703
|
+
pickable: false,
|
|
67704
|
+
stroke: style.lineColor,
|
|
67705
|
+
lineWidth: style.lineWidth,
|
|
67706
|
+
lineDash: style.lineDash,
|
|
67707
|
+
points: [
|
|
67708
|
+
{ x: this.markLineContainerWidth / 2, y: 0 },
|
|
67709
|
+
{ x: this.markLineContainerWidth / 2, y: this.height }
|
|
67710
|
+
]
|
|
67706
67711
|
});
|
|
67707
|
-
|
|
67708
|
-
|
|
67709
|
-
|
|
67712
|
+
markLineGroup.appendChild(lineObj);
|
|
67713
|
+
if (line.content) {
|
|
67714
|
+
const textMaxLineWidth = this._scene._gantt.parsedOptions.timelineColWidth;
|
|
67715
|
+
const textContainerHeight = contentStyle.lineHeight || 18;
|
|
67716
|
+
const textGroup = new Group$2({
|
|
67717
|
+
x: this.markLineContainerWidth / 2,
|
|
67718
|
+
y: 0,
|
|
67719
|
+
cursor: 'pointer',
|
|
67720
|
+
height: textContainerHeight,
|
|
67721
|
+
clip: false,
|
|
67722
|
+
fill: contentStyle.backgroundColor || style.lineColor,
|
|
67723
|
+
display: 'flex',
|
|
67724
|
+
cornerRadius: contentStyle.cornerRadius || [0, 2, 2, 0]
|
|
67725
|
+
});
|
|
67726
|
+
textGroup.name = 'mark-line-content';
|
|
67727
|
+
textGroup.data = line;
|
|
67728
|
+
markLineGroup.appendChild(textGroup);
|
|
67729
|
+
const text = new Text$1({
|
|
67730
|
+
maxLineWidth: textMaxLineWidth,
|
|
67731
|
+
text: line.content,
|
|
67732
|
+
cursor: 'pointer',
|
|
67733
|
+
lineHeight: textContainerHeight,
|
|
67734
|
+
fontWeight: contentStyle.fontWeight || 'normal',
|
|
67735
|
+
fill: contentStyle.color || style.lineColor,
|
|
67736
|
+
fontSize: contentStyle.fontSize || 12,
|
|
67737
|
+
poptip: {
|
|
67738
|
+
position: 'top',
|
|
67739
|
+
dx: textMaxLineWidth / 4,
|
|
67740
|
+
dy: -textContainerHeight / 4
|
|
67741
|
+
}
|
|
67742
|
+
});
|
|
67743
|
+
textGroup.appendChild(text);
|
|
67744
|
+
}
|
|
67745
|
+
});
|
|
67710
67746
|
}
|
|
67711
67747
|
refresh() {
|
|
67712
67748
|
this.height =
|
|
@@ -72806,7 +72842,7 @@
|
|
|
72806
72842
|
PluginManager: PluginManager
|
|
72807
72843
|
});
|
|
72808
72844
|
|
|
72809
|
-
const version = "1.19.
|
|
72845
|
+
const version = "1.19.6";
|
|
72810
72846
|
|
|
72811
72847
|
exports.Gantt = Gantt;
|
|
72812
72848
|
exports.TYPES = index$4;
|