@visactor/vtable-gantt 1.5.4 → 1.6.0-alpha.4
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 +16 -7
- package/cjs/Gantt.js +52 -32
- package/cjs/Gantt.js.map +1 -1
- package/cjs/event/event-manager.js +6 -2
- package/cjs/event/event-manager.js.map +1 -1
- package/cjs/gantt-helper.js +28 -20
- 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/frame-border.js +2 -2
- package/cjs/scenegraph/frame-border.js.map +1 -1
- package/cjs/scenegraph/grid.js +6 -6
- package/cjs/scenegraph/grid.js.map +1 -1
- package/cjs/scenegraph/mark-line.js +2 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +4 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/scroll-bar.js +1 -2
- package/cjs/scenegraph/task-bar.d.ts +1 -0
- package/cjs/scenegraph/task-bar.js +11 -8
- package/cjs/scenegraph/task-bar.js.map +1 -1
- package/cjs/state/gantt-table-sync.js +1 -8
- package/cjs/state/gantt-table-sync.js.map +1 -1
- package/cjs/state/state-manager.js +5 -6
- package/cjs/state/state-manager.js.map +1 -1
- package/cjs/ts-types/gantt-engine.d.ts +9 -7
- package/cjs/ts-types/gantt-engine.js.map +1 -1
- package/dist/vtable-gantt.js +286 -156
- package/dist/vtable-gantt.min.js +1 -1
- package/es/Gantt.d.ts +16 -7
- package/es/Gantt.js +50 -31
- package/es/Gantt.js.map +1 -1
- package/es/event/event-manager.js +6 -2
- package/es/event/event-manager.js.map +1 -1
- package/es/gantt-helper.js +28 -20
- 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/frame-border.js +2 -2
- package/es/scenegraph/frame-border.js.map +1 -1
- package/es/scenegraph/grid.js +6 -6
- package/es/scenegraph/grid.js.map +1 -1
- package/es/scenegraph/mark-line.js +2 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +5 -0
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/scroll-bar.js +1 -2
- package/es/scenegraph/task-bar.d.ts +1 -0
- package/es/scenegraph/task-bar.js +4 -2
- package/es/scenegraph/task-bar.js.map +1 -1
- package/es/state/gantt-table-sync.js +1 -8
- package/es/state/gantt-table-sync.js.map +1 -1
- package/es/state/state-manager.js +6 -5
- package/es/state/state-manager.js.map +1 -1
- package/es/ts-types/gantt-engine.d.ts +9 -7
- package/es/ts-types/gantt-engine.js.map +1 -1
- package/package.json +18 -18
package/dist/vtable-gantt.js
CHANGED
|
@@ -29202,6 +29202,10 @@
|
|
|
29202
29202
|
},
|
|
29203
29203
|
get inlineRowBgColor() {
|
|
29204
29204
|
return null == selectionStyle ? void 0 : selectionStyle.inlineRowBgColor;
|
|
29205
|
+
},
|
|
29206
|
+
get selectionFillMode() {
|
|
29207
|
+
var _a;
|
|
29208
|
+
return null !== (_a = null == selectionStyle ? void 0 : selectionStyle.selectionFillMode) && void 0 !== _a ? _a : "overlay";
|
|
29205
29209
|
}
|
|
29206
29210
|
};
|
|
29207
29211
|
}
|
|
@@ -29322,6 +29326,10 @@
|
|
|
29322
29326
|
get inlineRowBgColor() {
|
|
29323
29327
|
var _a, _b, _c, _d, _e;
|
|
29324
29328
|
return null !== (_e = null !== (_c = null !== (_b = null === (_a = style.select) || void 0 === _a ? void 0 : _a.inlineRowBgColor) && void 0 !== _b ? _b : that.selectionStyle.inlineRowBgColor) && void 0 !== _c ? _c : (null === (_d = that.selectionStyle) || void 0 === _d ? void 0 : _d.cellBgColor) && "string" == typeof that.selectionStyle.cellBgColor ? changeColor(that.selectionStyle.cellBgColor, .1, !1) : void 0) && void 0 !== _e ? _e : void 0;
|
|
29329
|
+
},
|
|
29330
|
+
get cellBgColor() {
|
|
29331
|
+
var _a, _b, _c;
|
|
29332
|
+
if ("replace" === that.selectionStyle.selectionFillMode) return null !== (_c = null !== (_b = null === (_a = style.select) || void 0 === _a ? void 0 : _a.cellBgColor) && void 0 !== _b ? _b : that.selectionStyle.cellBgColor) && void 0 !== _c ? _c : void 0;
|
|
29325
29333
|
}
|
|
29326
29334
|
};
|
|
29327
29335
|
},
|
|
@@ -30911,8 +30919,8 @@
|
|
|
30911
30919
|
};
|
|
30912
30920
|
}
|
|
30913
30921
|
class ReactCustomLayout {
|
|
30914
|
-
constructor(table) {
|
|
30915
|
-
this.table = table, this.customLayoutFuncCache = new Map(), this.reactRemoveGraphicCache = new Map(), this.headerCustomLayoutFuncCache = new Map(), this.headerReactRemoveGraphicCache = new Map();
|
|
30922
|
+
constructor(removeAllContainer, table) {
|
|
30923
|
+
this.removeAllContainer = removeAllContainer, this.table = table, this.customLayoutFuncCache = new Map(), this.reactRemoveGraphicCache = new Map(), this.headerCustomLayoutFuncCache = new Map(), this.headerReactRemoveGraphicCache = new Map();
|
|
30916
30924
|
}
|
|
30917
30925
|
hasReactCreateGraphic(componentId, isHeaderCustomLayout) {
|
|
30918
30926
|
return isHeaderCustomLayout ? this.headerCustomLayoutFuncCache.has(componentId) : this.customLayoutFuncCache.has(componentId);
|
|
@@ -30967,6 +30975,9 @@
|
|
|
30967
30975
|
}
|
|
30968
30976
|
removeFun && removeFun(col, row);
|
|
30969
30977
|
}
|
|
30978
|
+
clearCache() {
|
|
30979
|
+
this.removeAllContainer();
|
|
30980
|
+
}
|
|
30970
30981
|
}
|
|
30971
30982
|
function getUpdateCustomCellRangeInListTable(componentId, table, isHeaderCustomLayout) {
|
|
30972
30983
|
const rowSeriesNumber = table.internalProps.rowSeriesNumber ? 1 : 0;
|
|
@@ -32017,7 +32028,8 @@
|
|
|
32017
32028
|
x: 0,
|
|
32018
32029
|
y: 0,
|
|
32019
32030
|
fill: !1,
|
|
32020
|
-
stroke: !1
|
|
32031
|
+
stroke: !1,
|
|
32032
|
+
pickable: !1
|
|
32021
32033
|
});
|
|
32022
32034
|
cellContent.name = "content", cellContent.setCellContentOption({
|
|
32023
32035
|
autoWidth: autoColWidth,
|
|
@@ -32113,10 +32125,10 @@
|
|
|
32113
32125
|
let newHeight = Math.max(leftIconHeight, contentHeight, rightIconHeight);
|
|
32114
32126
|
if (isCellHeightUpdate(scene, cellGroup, Math.round(newHeight + padding[0] + padding[2]), oldCellHeight)) return !0;
|
|
32115
32127
|
newHeight = (null !== (_d = cellGroup.contentHeight) && void 0 !== _d ? _d : cellHeight) - (padding[0] + padding[2]), cellGroup.forEachChildren(child => {
|
|
32116
|
-
"rect" !== child.type && "chart" !== child.type && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
|
|
32128
|
+
"rect" !== child.type && "chart" !== child.type && child.name !== CUSTOM_CONTAINER_NAME && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
|
|
32117
32129
|
});
|
|
32118
32130
|
} else "middle" !== textBaseline && "bottom" !== textBaseline || cellGroup.forEachChildren(child => {
|
|
32119
|
-
"rect" !== child.type && "chart" !== child.type && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", (cellHeight - padding[2] + padding[0] - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", cellHeight - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]));
|
|
32131
|
+
"rect" !== child.type && "chart" !== child.type && child.name !== CUSTOM_CONTAINER_NAME && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", (cellHeight - padding[2] + padding[0] - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", cellHeight - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]));
|
|
32120
32132
|
});
|
|
32121
32133
|
return !1;
|
|
32122
32134
|
}
|
|
@@ -32131,7 +32143,7 @@
|
|
|
32131
32143
|
cellGroup.getChildByName("content").updateHeight(newHeight);
|
|
32132
32144
|
}
|
|
32133
32145
|
cellGroup.forEachChildren(child => {
|
|
32134
|
-
child.setAttribute("dy", 0), "rect" === child.type || "chart" === child.type || ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
|
|
32146
|
+
child.setAttribute("dy", 0), "rect" === child.type || "chart" === child.type || child.name === CUSTOM_CONTAINER_NAME || ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
|
|
32135
32147
|
});
|
|
32136
32148
|
}
|
|
32137
32149
|
function isCellHeightUpdate(scene, cellGroup, newHeight, oldHeight) {
|
|
@@ -33344,7 +33356,7 @@
|
|
|
33344
33356
|
if (customMergeRange) for (let mergeRow = customMergeRange.start.row; mergeRow <= customMergeRange.end.row; mergeRow++) {
|
|
33345
33357
|
if (mergeRow === row) continue;
|
|
33346
33358
|
const mergedCell = scene.getCell(col, mergeRow),
|
|
33347
|
-
customContainer =
|
|
33359
|
+
customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) || mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
|
|
33348
33360
|
customContainer.removeAllChild(), mergedCell.removeChild(customContainer), getCustomCellMergeCustom(col, mergeRow, mergedCell, scene.table);
|
|
33349
33361
|
} else {
|
|
33350
33362
|
let customRender, customLayout;
|
|
@@ -33539,7 +33551,7 @@
|
|
|
33539
33551
|
if (customMergeRange) for (let mergeCol = customMergeRange.start.col; mergeCol <= customMergeRange.end.col; mergeCol++) {
|
|
33540
33552
|
if (mergeCol === col) continue;
|
|
33541
33553
|
const mergedCell = scene.getCell(mergeCol, row),
|
|
33542
|
-
customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) ||
|
|
33554
|
+
customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) || mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
|
|
33543
33555
|
customContainer.removeAllChild(), mergedCell.removeChild(customContainer), getCustomCellMergeCustom(mergeCol, row, mergedCell, scene.table);
|
|
33544
33556
|
} else {
|
|
33545
33557
|
let customRender, customLayout;
|
|
@@ -34826,18 +34838,39 @@
|
|
|
34826
34838
|
return isHandlingChartQueue;
|
|
34827
34839
|
}
|
|
34828
34840
|
function renderChart(chart) {
|
|
34829
|
-
var _a, _b, _c, _d
|
|
34841
|
+
var _a, _b, _c, _d;
|
|
34830
34842
|
const {
|
|
34831
|
-
|
|
34832
|
-
|
|
34833
|
-
|
|
34834
|
-
|
|
34835
|
-
|
|
34836
|
-
|
|
34837
|
-
|
|
34838
|
-
|
|
34839
|
-
|
|
34840
|
-
|
|
34843
|
+
axes: axes,
|
|
34844
|
+
dataId: dataId,
|
|
34845
|
+
data: data,
|
|
34846
|
+
spec: spec,
|
|
34847
|
+
ClassType: ClassType,
|
|
34848
|
+
canvas: canvas,
|
|
34849
|
+
mode: mode,
|
|
34850
|
+
modeParams: modeParams,
|
|
34851
|
+
dpr: dpr
|
|
34852
|
+
} = chart.attribute;
|
|
34853
|
+
let {
|
|
34854
|
+
chartInstance: chartInstance
|
|
34855
|
+
} = chart;
|
|
34856
|
+
chartInstance || (chartInstance = new ClassType(spec, {
|
|
34857
|
+
renderCanvas: canvas,
|
|
34858
|
+
mode: "node" === mode ? "node" : "desktop-browser",
|
|
34859
|
+
modeParams: modeParams,
|
|
34860
|
+
canvasControled: !1,
|
|
34861
|
+
viewBox: {
|
|
34862
|
+
x1: 0,
|
|
34863
|
+
x2: 0,
|
|
34864
|
+
y1: 0,
|
|
34865
|
+
y2: 0
|
|
34866
|
+
},
|
|
34867
|
+
dpr: dpr,
|
|
34868
|
+
interactive: !1,
|
|
34869
|
+
animation: !1,
|
|
34870
|
+
autoFit: !1
|
|
34871
|
+
}), chartInstance.renderSync(), chart.chartInstance = chartInstance);
|
|
34872
|
+
const viewBox = chart.getViewBox();
|
|
34873
|
+
if (viewBox.x2 <= viewBox.x1 && (viewBox.x2 = viewBox.x1 + 1), viewBox.y2 <= viewBox.y1 && (viewBox.y2 = viewBox.y1 + 1), null == axes || axes.forEach((axis, index) => {
|
|
34841
34874
|
var _a, _b, _c, _d;
|
|
34842
34875
|
"band" === axis.type ? chartInstance.updateModelSpec({
|
|
34843
34876
|
type: "axes",
|
|
@@ -34856,8 +34889,7 @@
|
|
|
34856
34889
|
x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
|
|
34857
34890
|
y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
|
|
34858
34891
|
y2: viewBox.y2 - chart.getRootNode().table.scrollTop
|
|
34859
|
-
}, !1, !1);
|
|
34860
|
-
if (null === (_b = null === (_a = chart.getRootNode().table.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.updateDataStateToActiveChartInstance) || void 0 === _b || _b.call(_a, chartInstance), "string" == typeof dataId) chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
34892
|
+
}, !1, !1), "string" == typeof dataId) chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
34861
34893
|
const dataBatch = [];
|
|
34862
34894
|
for (const dataIdStr in dataId) {
|
|
34863
34895
|
const dataIdAndField = dataId[dataIdStr],
|
|
@@ -34867,11 +34899,11 @@
|
|
|
34867
34899
|
});
|
|
34868
34900
|
dataBatch.push({
|
|
34869
34901
|
id: dataIdStr,
|
|
34870
|
-
values: dataIdAndField ? null !== (
|
|
34871
|
-
fields: null === (
|
|
34872
|
-
}), chartInstance.updateFullDataSync || chartInstance.updateDataSync(dataIdStr, dataIdAndField ? null !== (
|
|
34902
|
+
values: dataIdAndField ? null !== (_a = null == data ? void 0 : data.filter(item => item.hasOwnProperty(dataIdAndField))) && void 0 !== _a ? _a : [] : null != data ? data : [],
|
|
34903
|
+
fields: null === (_b = null == series ? void 0 : series.data) || void 0 === _b ? void 0 : _b.fields
|
|
34904
|
+
}), chartInstance.updateFullDataSync || chartInstance.updateDataSync(dataIdStr, dataIdAndField ? null !== (_c = null == data ? void 0 : data.filter(item => item.hasOwnProperty(dataIdAndField))) && void 0 !== _c ? _c : [] : null != data ? data : []);
|
|
34873
34905
|
}
|
|
34874
|
-
null === (
|
|
34906
|
+
null === (_d = chartInstance.updateFullDataSync) || void 0 === _d || _d.call(chartInstance, dataBatch);
|
|
34875
34907
|
}
|
|
34876
34908
|
cacheStageCanvas(chartInstance.getStage(), chart);
|
|
34877
34909
|
}
|
|
@@ -35111,6 +35143,12 @@
|
|
|
35111
35143
|
}
|
|
35112
35144
|
cellDisable && (selectMode = void 0);
|
|
35113
35145
|
}
|
|
35146
|
+
} else if ("replace" === state.table.theme.selectionStyle.selectionFillMode) for (let i = 0; i < ranges.length; i++) {
|
|
35147
|
+
const range = ranges[i];
|
|
35148
|
+
if (range.start.col <= col && range.start.row <= row && range.end.col >= col && range.end.row >= row) {
|
|
35149
|
+
selectMode = "cellBgColor";
|
|
35150
|
+
break;
|
|
35151
|
+
}
|
|
35114
35152
|
}
|
|
35115
35153
|
return selectMode;
|
|
35116
35154
|
}
|
|
@@ -37371,7 +37409,7 @@
|
|
|
37371
37409
|
}
|
|
37372
37410
|
|
|
37373
37411
|
function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
|
|
37374
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
37412
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37375
37413
|
let isHasFillHandleRect = !!(null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle);
|
|
37376
37414
|
if ((null === (_b = scene.table.stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length) > 1) isHasFillHandleRect = !1, scene.removeFillHandleFromSelectComponents();else if (1 === (null === (_c = scene.table.stateManager.select.ranges) || void 0 === _c ? void 0 : _c.length)) {
|
|
37377
37415
|
const maxRow = Math.max(scene.table.stateManager.select.ranges[0].start.row, scene.table.stateManager.select.ranges[0].end.row),
|
|
@@ -37390,7 +37428,7 @@
|
|
|
37390
37428
|
bodyClickLineWidth = null === (_e = theme.selectionStyle) || void 0 === _e ? void 0 : _e.cellBorderLineWidth,
|
|
37391
37429
|
rect = createRect({
|
|
37392
37430
|
pickable: !1,
|
|
37393
|
-
fill: null !== (
|
|
37431
|
+
fill: "replace" !== (null === (_f = theme.selectionStyle) || void 0 === _f ? void 0 : _f.selectionFillMode) && (null !== (_h = null === (_g = theme.selectionStyle) || void 0 === _g ? void 0 : _g.cellBgColor) && void 0 !== _h ? _h : "rgba(0, 0, 255,0.1)"),
|
|
37394
37432
|
lineWidth: bodyClickLineWidth,
|
|
37395
37433
|
stroke: strokes.map(stroke => !!stroke && bodyClickBorderColor),
|
|
37396
37434
|
x: firstCellBound.x1 - scene.tableGroup.attribute.x,
|
|
@@ -37887,7 +37925,7 @@
|
|
|
37887
37925
|
newNode && container && (targetGroup ? container.insertBefore(newNode, targetGroup) : container.appendChild(newNode));
|
|
37888
37926
|
}
|
|
37889
37927
|
|
|
37890
|
-
function
|
|
37928
|
+
function updateChartSizeForResizeColWidth(scenegraph, col) {
|
|
37891
37929
|
var _a, _b;
|
|
37892
37930
|
for (let c = col; c <= scenegraph.proxy.colEnd; c++) {
|
|
37893
37931
|
const columnGroup = scenegraph.getColGroup(c);
|
|
@@ -37910,6 +37948,19 @@
|
|
|
37910
37948
|
});
|
|
37911
37949
|
}
|
|
37912
37950
|
}
|
|
37951
|
+
function updateChartSizeForResizeRowHeight(scenegraph, row) {
|
|
37952
|
+
const updateCellNode = (c, r) => {
|
|
37953
|
+
const cellNode = scenegraph.getCell(c, r),
|
|
37954
|
+
width = scenegraph.table.getColWidth(cellNode.col),
|
|
37955
|
+
height = scenegraph.table.getRowHeight(cellNode.row);
|
|
37956
|
+
cellNode.children.forEach(node => {
|
|
37957
|
+
"chart" === node.type && (node.cacheCanvas = null, node.setAttribute("width", Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])), node.setAttribute("height", Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])));
|
|
37958
|
+
});
|
|
37959
|
+
};
|
|
37960
|
+
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) for (let r = row; r <= scenegraph.proxy.rowEnd; r++) updateCellNode(c, r);
|
|
37961
|
+
if (scenegraph.table.rightFrozenColCount >= 1) for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) for (let r = row; r <= scenegraph.proxy.rowEnd; r++) updateCellNode(c, r);
|
|
37962
|
+
if (scenegraph.table.frozenColCount >= 1) for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) for (let r = row; r <= scenegraph.proxy.rowEnd; r++) updateCellNode(c, r);
|
|
37963
|
+
}
|
|
37913
37964
|
function clearChartCacheImage(scenegraph) {
|
|
37914
37965
|
var _a;
|
|
37915
37966
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
@@ -38433,7 +38484,7 @@
|
|
|
38433
38484
|
this.isPivot = this.table.isPivotTable(), initSceneGraph(this);
|
|
38434
38485
|
}
|
|
38435
38486
|
clearCells() {
|
|
38436
|
-
var _a;
|
|
38487
|
+
var _a, _b;
|
|
38437
38488
|
(this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) && this.stage.pluginService.findPluginsByName("poptipForText").forEach(plugin => {
|
|
38438
38489
|
plugin.deactivate(this.stage.pluginService);
|
|
38439
38490
|
}), this.clear = !0, this.hasFrozen = !1, this.mergeMap.clear(), this.colHeaderGroup.clear(), this.rowHeaderGroup.clear(), this.cornerHeaderGroup.clear(), this.bodyGroup.clear(), this.bottomFrozenGroup.clear(), this.rightFrozenGroup.clear(), this.rightTopCornerGroup.clear(), this.rightBottomCornerGroup.clear(), this.leftBottomCornerGroup.clear(), this.colHeaderGroup.setAttributes({
|
|
@@ -38489,7 +38540,7 @@
|
|
|
38489
38540
|
y: this.table.tableY,
|
|
38490
38541
|
width: 0,
|
|
38491
38542
|
height: 0
|
|
38492
|
-
}), this.tableGroup.border && (this.tableGroup.parent.removeChild(this.tableGroup.border), delete this.tableGroup.border), null === (_a = this.proxy) || void 0 === _a || _a.release();
|
|
38543
|
+
}), this.tableGroup.border && (this.tableGroup.parent.removeChild(this.tableGroup.border), delete this.tableGroup.border), null === (_a = this.proxy) || void 0 === _a || _a.release(), null === (_b = this.table.reactCustomLayout) || void 0 === _b || _b.clearCache();
|
|
38493
38544
|
}
|
|
38494
38545
|
updateStageBackground() {
|
|
38495
38546
|
this.stage.background = this.table.theme.underlayBackgroundColor, this.stage.renderNextFrame();
|
|
@@ -38502,7 +38553,7 @@
|
|
|
38502
38553
|
}
|
|
38503
38554
|
createSceneGraph() {
|
|
38504
38555
|
let skipRowHeightClear = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
38505
|
-
skipRowHeightClear || this.table.rowHeightsMap.clear(), (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) && this.stage.pluginService.autoEnablePlugins.getContributions().forEach(p => {
|
|
38556
|
+
skipRowHeightClear || (this.table.rowHeightsMap.clear(), this.table.internalProps.layoutMap.clearCellRangeMap()), (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) && this.stage.pluginService.autoEnablePlugins.getContributions().forEach(p => {
|
|
38506
38557
|
"poptipForText" === p.name && this.stage.pluginService.register(p);
|
|
38507
38558
|
}), this.clear = !1, this.frozenColCount = this.table.frozenColCount, this.frozenRowCount = this.table.frozenRowCount, this.proxy = new SceneProxy(this.table), createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0, !0), this.table.isPivotChart() && (createCornerCell(this.rightTopCornerGroup, this.table.theme.cornerRightTopCellStyle || this.table.theme.cornerHeaderStyle || {}), createCornerCell(this.leftBottomCornerGroup, this.table.theme.cornerLeftBottomCellStyle || this.table.theme.cornerHeaderStyle || {}), createCornerCell(this.rightBottomCornerGroup, this.table.theme.cornerRightBottomCellStyle || this.table.theme.cornerHeaderStyle || {})), this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup, this.colHeaderGroup, this.rowHeaderGroup, this.rightFrozenGroup, this.bottomFrozenGroup, this.bodyGroup, 0, 0), this.afterScenegraphCreated();
|
|
38508
38559
|
}
|
|
@@ -38617,7 +38668,7 @@
|
|
|
38617
38668
|
deleteLastSelectedRangeComponents(this);
|
|
38618
38669
|
}
|
|
38619
38670
|
deleteAllSelectBorder() {
|
|
38620
|
-
deleteAllSelectBorder(this);
|
|
38671
|
+
deleteAllSelectBorder(this), deleteAllSelectingBorder(this);
|
|
38621
38672
|
}
|
|
38622
38673
|
updateCellSelectBorder(selectRange) {
|
|
38623
38674
|
let extendSelectRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
@@ -38634,8 +38685,11 @@
|
|
|
38634
38685
|
updateColWidth(col, detaX, skipUpdateContainer, skipTableWidthMap) {
|
|
38635
38686
|
updateColWidth(this, col, Math.round(detaX), skipTableWidthMap), skipUpdateContainer || this.updateContainer(!0);
|
|
38636
38687
|
}
|
|
38637
|
-
|
|
38638
|
-
|
|
38688
|
+
updateChartSizeForResizeColWidth(col) {
|
|
38689
|
+
updateChartSizeForResizeColWidth(this, col);
|
|
38690
|
+
}
|
|
38691
|
+
updateChartSizeForResizeRowHeight(col) {
|
|
38692
|
+
updateChartSizeForResizeRowHeight(this, col);
|
|
38639
38693
|
}
|
|
38640
38694
|
updateChartState(datum) {
|
|
38641
38695
|
this.table.isPivotChart() && updateChartState(this, datum);
|
|
@@ -38683,7 +38737,7 @@
|
|
|
38683
38737
|
table.internalProps.useOneRowHeightFillAll = !1, "adaptive" === table.heightMode || table.autoFillHeight ? computeRowsHeight(this.table, 0, this.table.rowCount - 1, !0, !0) : (table.frozenRowCount > 0 && computeRowsHeight(this.table, 0, table.frozenRowCount - 1, !0, !0), table.bottomFrozenRowCount > 0 && computeRowsHeight(this.table, table.bottomFrozenRowCount, table.rowCount - 1, !0, !0), computeRowsHeight(table, this.proxy.rowStart, this.proxy.rowEnd, !0, !0));
|
|
38684
38738
|
}
|
|
38685
38739
|
resize() {
|
|
38686
|
-
this.proxy.resize(), ("adaptive" === this.table.widthMode || this.table.autoFillWidth) && (0 === this.table.internalProps._widthResizedColMap.size ? this.recalculateColWidths() : this.dealWidthMode()), "adaptive" === this.table.heightMode ? 0 === this.table.internalProps._heightResizedRowMap.size ? this.recalculateRowHeights() : this.dealHeightMode() : this.table.autoFillHeight && this.dealHeightMode(), this.resetFrozen(), this.updateTableSize(), this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.
|
|
38740
|
+
this.proxy.resize(), ("adaptive" === this.table.widthMode || this.table.autoFillWidth) && (0 === this.table.internalProps._widthResizedColMap.size ? this.recalculateColWidths() : this.dealWidthMode()), "adaptive" === this.table.heightMode ? 0 === this.table.internalProps._heightResizedRowMap.size ? this.recalculateRowHeights() : this.dealHeightMode() : this.table.autoFillHeight && this.dealHeightMode(), this.resetFrozen(), this.updateTableSize(), this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.updateChartSizeForResizeColWidth(this.table.rowHeaderLevelCount), this.proxy.progress(), this.updateNextFrame();
|
|
38687
38741
|
}
|
|
38688
38742
|
updateTableSize() {
|
|
38689
38743
|
var _a, _b, _c, _d;
|
|
@@ -39554,17 +39608,18 @@
|
|
|
39554
39608
|
col: col,
|
|
39555
39609
|
row: row
|
|
39556
39610
|
}, state.table);
|
|
39557
|
-
|
|
39558
|
-
let lineX, backX, lineY, backY;
|
|
39559
|
-
state.table.internalProps.layoutMap.canMoveHeaderPosition({
|
|
39611
|
+
if (state.table.internalProps.layoutMap.canMoveHeaderPosition({
|
|
39560
39612
|
col: state.columnMove.colSource,
|
|
39561
39613
|
row: state.columnMove.rowSource
|
|
39562
39614
|
}, {
|
|
39563
|
-
col:
|
|
39564
|
-
row:
|
|
39565
|
-
})
|
|
39566
|
-
|
|
39567
|
-
|
|
39615
|
+
col: targetCell.col,
|
|
39616
|
+
row: targetCell.row
|
|
39617
|
+
})) {
|
|
39618
|
+
let lineX, backX, lineY, backY;
|
|
39619
|
+
state.columnMove.x = x - state.table.tableX, state.columnMove.y = y - state.table.tableY, state.columnMove.colTarget = targetCell.col, state.columnMove.rowTarget = targetCell.row, state.updateCursor("grabbing");
|
|
39620
|
+
const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
|
|
39621
|
+
"columnHeader" === cellLocation ? (backX = state.columnMove.x, lineX = state.table.isLeftFrozenColumn(col) ? state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1) : state.table.isRightFrozenColumn(col) ? state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1) : (state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1)) - state.table.stateManager.scroll.horizontalBarPos) : ("rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) && (backY = state.columnMove.y, lineY = state.table.isFrozenRow(row) ? state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1) : state.table.isBottomFrozenRow(row) ? state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1) : (state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) - state.table.stateManager.scroll.verticalBarPos), state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY), state.table.scenegraph.updateNextFrame();
|
|
39622
|
+
} else state.updateCursor("not-allowed"), state.columnMove.colTarget = state.columnMove.colSource, state.columnMove.rowTarget = state.columnMove.rowSource;
|
|
39568
39623
|
}
|
|
39569
39624
|
function endMoveCol(state) {
|
|
39570
39625
|
if ("canMoveHeaderPosition" in state.table.internalProps.layoutMap && state.columnMove.moving && state.columnMove.colSource >= 0 && state.columnMove.rowSource >= 0 && state.columnMove.colTarget >= 0 && state.columnMove.rowTarget >= 0) {
|
|
@@ -40169,7 +40224,7 @@
|
|
|
40169
40224
|
endResizeCol() {
|
|
40170
40225
|
setTimeout(() => {
|
|
40171
40226
|
this.columnResize.resizing = !1;
|
|
40172
|
-
}, 0), this.table.scenegraph.
|
|
40227
|
+
}, 0), this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col), this.checkFrozen(), this.table.scenegraph.component.hideResizeCol(), this.table.scenegraph.updateNextFrame();
|
|
40173
40228
|
}
|
|
40174
40229
|
startResizeCol(col, x, y, isRightFrozen) {
|
|
40175
40230
|
var _a;
|
|
@@ -40183,7 +40238,7 @@
|
|
|
40183
40238
|
endResizeRow() {
|
|
40184
40239
|
setTimeout(() => {
|
|
40185
40240
|
this.rowResize.resizing = !1;
|
|
40186
|
-
}, 0), this.table.scenegraph.
|
|
40241
|
+
}, 0), this.table.scenegraph.updateChartSizeForResizeColWidth(this.rowResize.row), this.table.scenegraph.component.hideResizeRow(), this.table.scenegraph.updateNextFrame();
|
|
40187
40242
|
}
|
|
40188
40243
|
startResizeRow(row, x, y, isBottomFrozen) {
|
|
40189
40244
|
var _a;
|
|
@@ -40337,7 +40392,8 @@
|
|
|
40337
40392
|
}
|
|
40338
40393
|
showVerticalScrollBar(autoHide) {
|
|
40339
40394
|
this.table.scenegraph.component.showVerticalScrollBar(), autoHide && (clearTimeout(this._clearVerticalScrollBar), this._clearVerticalScrollBar = setTimeout(() => {
|
|
40340
|
-
|
|
40395
|
+
var _a;
|
|
40396
|
+
null === (_a = this.table.scenegraph) || void 0 === _a || _a.component.hideVerticalScrollBar();
|
|
40341
40397
|
}, 1e3));
|
|
40342
40398
|
}
|
|
40343
40399
|
hideHorizontalScrollBar() {
|
|
@@ -40345,7 +40401,8 @@
|
|
|
40345
40401
|
}
|
|
40346
40402
|
showHorizontalScrollBar(autoHide) {
|
|
40347
40403
|
this.table.scenegraph.component.showHorizontalScrollBar(), autoHide && (clearTimeout(this._clearHorizontalScrollBar), this._clearHorizontalScrollBar = setTimeout(() => {
|
|
40348
|
-
|
|
40404
|
+
var _a;
|
|
40405
|
+
null === (_a = this.table.scenegraph) || void 0 === _a || _a.component.hideHorizontalScrollBar();
|
|
40349
40406
|
}, 1e3));
|
|
40350
40407
|
}
|
|
40351
40408
|
triggerContextMenu(col, row, x, y) {
|
|
@@ -41253,27 +41310,49 @@
|
|
|
41253
41310
|
handler.on(table.getElement(), "blur", e => {
|
|
41254
41311
|
eventManager.dealTableHover();
|
|
41255
41312
|
}), handler.on(table.getElement(), "wheel", e => {
|
|
41256
|
-
|
|
41313
|
+
var _a;
|
|
41314
|
+
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell$1(e, stateManager);
|
|
41257
41315
|
}), handler.on(table.getElement(), "keydown", e => {
|
|
41258
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
41316
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
41259
41317
|
if ("a" === e.key && (e.ctrlKey || e.metaKey)) (null === (_a = table.keyboardOptions) || void 0 === _a ? void 0 : _a.selectAllOnCtrlA) && (e.preventDefault(), eventManager.deelTableSelectAll());else if (stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0 && ("ArrowUp" === e.key || "ArrowDown" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key)) {
|
|
41260
41318
|
if ((null === (_c = null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.moveEditCellOnArrowKeys) || void 0 === _c || !_c) && (null === (_d = table.editorManager) || void 0 === _d ? void 0 : _d.editingEditor)) return;
|
|
41261
41319
|
let targetCol, targetRow;
|
|
41262
41320
|
if (e.preventDefault(), e.stopPropagation(), "ArrowUp" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = stateManager.select.cellPos.col, targetRow = 0) : (e.shiftKey, targetCol = stateManager.select.cellPos.col, targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row - 1))) : "ArrowDown" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = stateManager.select.cellPos.col, targetRow = table.rowCount - 1) : (e.shiftKey, targetCol = stateManager.select.cellPos.col, targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1))) : "ArrowLeft" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = 0, targetRow = stateManager.select.cellPos.row) : (e.shiftKey, targetRow = stateManager.select.cellPos.row, targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col - 1))) : "ArrowRight" === e.key && (e.ctrlKey || e.metaKey ? (targetCol = table.colCount - 1, targetRow = stateManager.select.cellPos.row) : (e.shiftKey, targetRow = stateManager.select.cellPos.row, targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col + 1)))), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
41263
41321
|
table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_f = null === (_e = table.options.keyboardOptions) || void 0 === _e ? void 0 : _e.moveEditCellOnArrowKeys) && void 0 !== _f && _f && (null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
|
|
41264
|
-
} else if ("Escape" === e.key) table.editorManager.cancelEdit();else if ("Enter" === e.key) {
|
|
41265
|
-
if (
|
|
41266
|
-
|
|
41322
|
+
} else if ("Escape" === e.key) null === (_h = table.editorManager) || void 0 === _h || _h.cancelEdit();else if ("Enter" === e.key) {
|
|
41323
|
+
if (null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) {
|
|
41324
|
+
if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (_k = table.options.keyboardOptions) || void 0 === _k ? void 0 : _k.moveFocusCellOnEnter)) {
|
|
41325
|
+
const targetCol = stateManager.select.cellPos.col,
|
|
41326
|
+
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
41327
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
41328
|
+
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
41329
|
+
}
|
|
41330
|
+
return;
|
|
41331
|
+
}
|
|
41332
|
+
if (!0 === (null === (_l = table.options.keyboardOptions) || void 0 === _l ? void 0 : _l.moveFocusCellOnEnter)) {
|
|
41333
|
+
const targetCol = stateManager.select.cellPos.col,
|
|
41334
|
+
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
41335
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
41336
|
+
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
41337
|
+
} else if ((null === (_o = null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.editCellOnEnter) || void 0 === _o || _o) && 1 === (null !== (_q = null === (_p = table.stateManager.select.ranges) || void 0 === _p ? void 0 : _p.length) && void 0 !== _q ? _q : 0)) {
|
|
41267
41338
|
const startCol = table.stateManager.select.ranges[0].start.col,
|
|
41268
41339
|
startRow = table.stateManager.select.ranges[0].start.row,
|
|
41269
41340
|
endCol = table.stateManager.select.ranges[0].end.col,
|
|
41270
41341
|
endRow = table.stateManager.select.ranges[0].end.row;
|
|
41271
41342
|
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && table.editorManager.startEditCell(startCol, startRow);
|
|
41272
41343
|
}
|
|
41273
|
-
} else if ("Tab" === e.key
|
|
41274
|
-
|
|
41275
|
-
|
|
41276
|
-
|
|
41344
|
+
} else if ("Tab" === e.key) {
|
|
41345
|
+
if ((null === (_s = null === (_r = table.options.keyboardOptions) || void 0 === _r ? void 0 : _r.moveFocusCellOnTab) || void 0 === _s || _s) && (e.preventDefault(), stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0)) {
|
|
41346
|
+
let targetCol, targetRow;
|
|
41347
|
+
if (stateManager.select.cellPos.col === table.colCount - 1 ? (targetRow = Math.min(table.rowCount - 1, stateManager.select.cellPos.row + 1), targetCol = table.rowHeaderLevelCount) : stateManager.select.cellPos.row === table.rowCount - 1 ? (targetRow = table.rowCount - 1, targetCol = table.rowHeaderLevelCount) : (targetRow = stateManager.select.cellPos.row, targetCol = stateManager.select.cellPos.col + 1), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
41348
|
+
table.selectCell(targetCol, targetRow), (null === (_t = table.editorManager) || void 0 === _t ? void 0 : _t.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
|
|
41349
|
+
}
|
|
41350
|
+
} else {
|
|
41351
|
+
const editCellTrigger = table.options.editCellTrigger;
|
|
41352
|
+
if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_u = table.editorManager) || void 0 === _u ? void 0 : _u.editingEditor)) {
|
|
41353
|
+
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
41354
|
+
e.key.match(allowedKeys) && table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, "");
|
|
41355
|
+
}
|
|
41277
41356
|
}
|
|
41278
41357
|
handleKeydownListener(e);
|
|
41279
41358
|
}), handler.on(table.getElement(), "copy", e => {
|
|
@@ -41336,7 +41415,8 @@
|
|
|
41336
41415
|
var _a;
|
|
41337
41416
|
!1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) && e.preventDefault();
|
|
41338
41417
|
}), handler.on(table.getContainer(), "resize", e => {
|
|
41339
|
-
|
|
41418
|
+
var _a;
|
|
41419
|
+
table.canvasSizeSeted || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$1(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio$1()), e.windowSizeNotChange || table.resize());
|
|
41340
41420
|
});
|
|
41341
41421
|
const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g,
|
|
41342
41422
|
cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
|
|
@@ -41445,7 +41525,7 @@
|
|
|
41445
41525
|
callback: globalPointerdownCallback
|
|
41446
41526
|
}), document.body.addEventListener("pointerdown", globalPointerdownCallback);
|
|
41447
41527
|
const globalPointerupCallback = e => {
|
|
41448
|
-
table.eventManager.LastBodyPointerXY = null, table.eventManager.isDown = !1, table.eventManager.isDraging = !1, table.eventManager.inertiaScroll.endInertia(), stateManager.isResizeCol() ? endResizeCol(table) : stateManager.isResizeRow() && endResizeRow(table);
|
|
41528
|
+
table.eventManager.LastBodyPointerXY = null, table.eventManager.isDown = !1, table.eventManager.isDraging = !1, table.eventManager.inertiaScroll.endInertia(), "grabing" === stateManager.interactionState && stateManager.isResizeCol() ? endResizeCol(table) : "grabing" === stateManager.interactionState && stateManager.isResizeRow() && endResizeRow(table);
|
|
41449
41529
|
};
|
|
41450
41530
|
eventManager.globalEventListeners.push({
|
|
41451
41531
|
name: "pointerup",
|
|
@@ -41658,7 +41738,7 @@
|
|
|
41658
41738
|
updateEventBinder() {
|
|
41659
41739
|
setTimeout(() => {
|
|
41660
41740
|
var _a;
|
|
41661
|
-
checkHaveTextStick(this.table) && 0 === (null === (_a = this.handleTextStickBindId) || void 0 === _a ? void 0 : _a.length) ? (this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
41741
|
+
this.table.isReleased || (checkHaveTextStick(this.table) && 0 === (null === (_a = this.handleTextStickBindId) || void 0 === _a ? void 0 : _a.length) ? (this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
41662
41742
|
handleTextStick(this.table);
|
|
41663
41743
|
})), this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, e => {
|
|
41664
41744
|
handleTextStick(this.table);
|
|
@@ -41666,7 +41746,7 @@
|
|
|
41666
41746
|
handleTextStick(this.table);
|
|
41667
41747
|
}))) : !checkHaveTextStick(this.table) && this.handleTextStickBindId && (this.handleTextStickBindId.forEach(id => {
|
|
41668
41748
|
this.table.off(id);
|
|
41669
|
-
}), this.handleTextStickBindId = []), bindSparklineHoverEvent(this.table);
|
|
41749
|
+
}), this.handleTextStickBindId = []), bindSparklineHoverEvent(this.table));
|
|
41670
41750
|
}, 0);
|
|
41671
41751
|
}
|
|
41672
41752
|
bindSelfEvent() {
|
|
@@ -41695,7 +41775,7 @@
|
|
|
41695
41775
|
const eventArgsSet = getCellEventArgsSet(e.federatedEvent),
|
|
41696
41776
|
resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.targetCell);
|
|
41697
41777
|
if (this.table.eventManager.checkCellFillhandle(eventArgsSet)) this.table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_FILL_HANDLE, {});else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
|
|
41698
|
-
this.table.scenegraph.updateAutoColWidth(resizeCol.col), this.table.internalProps._widthResizedColMap.add(resizeCol.col), this.table.scenegraph.
|
|
41778
|
+
this.table.scenegraph.updateAutoColWidth(resizeCol.col), this.table.internalProps._widthResizedColMap.add(resizeCol.col), this.table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
|
|
41699
41779
|
const state = this.table.stateManager;
|
|
41700
41780
|
state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
41701
41781
|
const colWidths = [];
|
|
@@ -43808,7 +43888,7 @@
|
|
|
43808
43888
|
constructor(container) {
|
|
43809
43889
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43810
43890
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
43811
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.
|
|
43891
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.6.0-alpha.4", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
43812
43892
|
const {
|
|
43813
43893
|
frozenColCount = 0,
|
|
43814
43894
|
frozenRowCount: frozenRowCount,
|
|
@@ -44171,7 +44251,7 @@
|
|
|
44171
44251
|
this.rowHeightsMap.put(row, (null === (_a = this.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? height : Math.round(height)), clearCache && this._clearRowRangeHeightsMap(row);
|
|
44172
44252
|
}
|
|
44173
44253
|
setRowHeight(row, height) {
|
|
44174
|
-
this.scenegraph.setRowHeight(row, height), this.internalProps._heightResizedRowMap.add(row);
|
|
44254
|
+
this.scenegraph.setRowHeight(row, height), this.scenegraph.updateChartSizeForResizeRowHeight(row), this.internalProps._heightResizedRowMap.add(row);
|
|
44175
44255
|
}
|
|
44176
44256
|
getRowsHeight(startRow, endRow) {
|
|
44177
44257
|
var _a, _b;
|
|
@@ -44219,7 +44299,7 @@
|
|
|
44219
44299
|
this.colWidthsMap.put(col, "number" == typeof width ? Math.round(width) : width), clearCache && this._clearColRangeWidthsMap(col), skipCheckFrozen || this.stateManager.checkFrozen();
|
|
44220
44300
|
}
|
|
44221
44301
|
setColWidth(col, width) {
|
|
44222
|
-
this.scenegraph.setColWidth(col, width), this.internalProps._widthResizedColMap.add(col);
|
|
44302
|
+
this.scenegraph.setColWidth(col, width), this.scenegraph.updateChartSizeForResizeColWidth(col), this.internalProps._widthResizedColMap.add(col);
|
|
44223
44303
|
}
|
|
44224
44304
|
_clearColRangeWidthsMap(col) {
|
|
44225
44305
|
if ("number" != typeof col) this._colRangeWidthsMap.clear();else {
|
|
@@ -45576,6 +45656,7 @@
|
|
|
45576
45656
|
var _a, _b;
|
|
45577
45657
|
const internalProps = this.internalProps;
|
|
45578
45658
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
45659
|
+
if (this.internalProps._widthResizedColMap.has(col)) continue;
|
|
45579
45660
|
const {
|
|
45580
45661
|
width: width,
|
|
45581
45662
|
minWidth: minWidth,
|
|
@@ -45588,8 +45669,8 @@
|
|
|
45588
45669
|
var _a;
|
|
45589
45670
|
null === (_a = this.dataSource) || void 0 === _a || _a.setSortedIndexMap(field, filedMap);
|
|
45590
45671
|
}
|
|
45591
|
-
checkReactCustomLayout() {
|
|
45592
|
-
this.reactCustomLayout || (this.reactCustomLayout = new ReactCustomLayout(this));
|
|
45672
|
+
checkReactCustomLayout(removeAllContainer) {
|
|
45673
|
+
this.reactCustomLayout || (this.reactCustomLayout = new ReactCustomLayout(removeAllContainer, this));
|
|
45593
45674
|
}
|
|
45594
45675
|
get bodyDomContainer() {
|
|
45595
45676
|
return this.internalProps.bodyDomContainer;
|
|
@@ -46965,10 +47046,11 @@
|
|
|
46965
47046
|
this.table = table, this.bindEvent();
|
|
46966
47047
|
}
|
|
46967
47048
|
bindEvent() {
|
|
46968
|
-
|
|
47049
|
+
this.table.internalProps.handler;
|
|
47050
|
+
const editCellTrigger = this.table.options.editCellTrigger;
|
|
46969
47051
|
this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
46970
47052
|
var _a;
|
|
46971
|
-
if (!
|
|
47053
|
+
if (!editCellTrigger || "doubleclick" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("doubleclick")) {
|
|
46972
47054
|
const {
|
|
46973
47055
|
col: col,
|
|
46974
47056
|
row: row
|
|
@@ -46979,17 +47061,13 @@
|
|
|
46979
47061
|
this.startEditCell(col, row);
|
|
46980
47062
|
}
|
|
46981
47063
|
}), this.table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
46982
|
-
if ("click" ===
|
|
47064
|
+
if ("click" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("click")) {
|
|
46983
47065
|
const {
|
|
46984
47066
|
col: col,
|
|
46985
47067
|
row: row
|
|
46986
47068
|
} = e;
|
|
46987
47069
|
this.startEditCell(col, row);
|
|
46988
47070
|
}
|
|
46989
|
-
}), handler.on(this.table.getElement(), "wheel", e => {
|
|
46990
|
-
this.completeEdit();
|
|
46991
|
-
}), handler.on(this.table.getElement(), "resize", e => {
|
|
46992
|
-
(this.table.autoFillWidth || this.table.autoFillHeight) && this.completeEdit();
|
|
46993
47071
|
});
|
|
46994
47072
|
}
|
|
46995
47073
|
startEditCell(col, row, value) {
|
|
@@ -47408,7 +47486,7 @@
|
|
|
47408
47486
|
const index = this.getRecordShowIndexByCell(col, row),
|
|
47409
47487
|
diffDataIndices = this.dataSource.toggleHierarchyState(index, this.scenegraph.proxy.rowStart - this.columnHeaderLevelCount, Math.max(this.scenegraph.proxy.rowEnd - this.columnHeaderLevelCount, this.scenegraph.proxy.rowStart - this.columnHeaderLevelCount + this.scenegraph.proxy.rowLimit - 1)),
|
|
47410
47488
|
diffPositions = this.internalProps.layoutMap.toggleHierarchyState(diffDataIndices);
|
|
47411
|
-
this.refreshRowColCount(), this.clearCellStyleCache(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.updateHierarchyIcon(col, row), this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions), checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth), this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight), ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.
|
|
47489
|
+
this.refreshRowColCount(), this.clearCellStyleCache(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.updateHierarchyIcon(col, row), this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions), checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth), this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight), ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(0));
|
|
47412
47490
|
}
|
|
47413
47491
|
_hasHierarchyTreeHeader() {
|
|
47414
47492
|
var _a, _b;
|
|
@@ -47508,7 +47586,8 @@
|
|
|
47508
47586
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), this.internalProps.emptyTip.resetVisible();
|
|
47509
47587
|
}
|
|
47510
47588
|
this.render(), isValid$1(oldHoverState.col) && isValid$1(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0 && setTimeout(() => {
|
|
47511
|
-
|
|
47589
|
+
var _a;
|
|
47590
|
+
null === (_a = this.internalProps) || void 0 === _a || _a.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
|
|
47512
47591
|
}, 0);
|
|
47513
47592
|
}
|
|
47514
47593
|
setRecordChildren(records, col, row) {
|
|
@@ -48684,7 +48763,13 @@
|
|
|
48684
48763
|
legend = new DiscreteLegend(merge({}, attrs, {
|
|
48685
48764
|
defaultSelected: this.selectedData
|
|
48686
48765
|
}));
|
|
48687
|
-
legend.name = "legend", this.legendComponent = legend, this.
|
|
48766
|
+
legend.name = "legend", this.legendComponent = legend, !1 === this.visible && (legend.setAttributes({
|
|
48767
|
+
maxWidth: 0,
|
|
48768
|
+
width: 0,
|
|
48769
|
+
maxHeight: 0,
|
|
48770
|
+
height: 0,
|
|
48771
|
+
clip: !0
|
|
48772
|
+
}), legend.hideAll()), this.table.scenegraph.stage.defaultLayer.appendChild(legend), this.adjustTableSize(attrs);
|
|
48688
48773
|
}
|
|
48689
48774
|
resize() {
|
|
48690
48775
|
this.legendComponent && (this.legendComponent.setAttributes({
|
|
@@ -50948,15 +51033,16 @@
|
|
|
50948
51033
|
});
|
|
50949
51034
|
this.group.name = 'grid-container';
|
|
50950
51035
|
scene.tableGroup.addChild(this.group);
|
|
51036
|
+
const horizontalSplitLineWidth = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth;
|
|
50951
51037
|
const line = createLine({
|
|
50952
51038
|
pickable: false,
|
|
50953
51039
|
stroke: scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineColor,
|
|
50954
|
-
lineWidth:
|
|
51040
|
+
lineWidth: horizontalSplitLineWidth,
|
|
50955
51041
|
points: [
|
|
50956
|
-
{ x: 0, y:
|
|
51042
|
+
{ x: 0, y: horizontalSplitLineWidth & 1 ? 0.5 : 0 },
|
|
50957
51043
|
{
|
|
50958
51044
|
x: scene._gantt.getAllColsWidth(),
|
|
50959
|
-
y:
|
|
51045
|
+
y: horizontalSplitLineWidth & 1 ? 0.5 : 0
|
|
50960
51046
|
}
|
|
50961
51047
|
]
|
|
50962
51048
|
});
|
|
@@ -51725,31 +51811,38 @@
|
|
|
51725
51811
|
fontFamily: 'Arial',
|
|
51726
51812
|
fontSize: 14
|
|
51727
51813
|
}, options?.taskBar?.barStyle);
|
|
51814
|
+
gantt.parsedOptions.taskBarHoverStyle = Object.assign({
|
|
51815
|
+
barOverLayColor: 'rgba(99, 144, 0, 0.4)'
|
|
51816
|
+
}, options?.taskBar?.hoverBarStyle);
|
|
51817
|
+
gantt.parsedOptions.taskBarSelectionStyle = Object.assign({
|
|
51818
|
+
barOverLayColor: 'rgba(99, 144, 0, 0.4)'
|
|
51819
|
+
}, options?.taskBar?.selectionBarStyle);
|
|
51728
51820
|
gantt.parsedOptions.taskBarLabelText = options?.taskBar?.labelText ?? '';
|
|
51729
51821
|
gantt.parsedOptions.taskBarMoveable = options?.taskBar?.moveable ?? true;
|
|
51730
51822
|
gantt.parsedOptions.taskBarResizable = options?.taskBar?.resizable ?? true;
|
|
51731
|
-
gantt.parsedOptions.taskBarHoverColor =
|
|
51732
|
-
options?.taskBar?.hoverColor === null ? 'rgba(0,0,0,0)' : options?.taskBar?.hoverColor ?? 'rgba(0,0,0,0.1)';
|
|
51733
51823
|
gantt.parsedOptions.taskBarLabelStyle = {
|
|
51734
51824
|
fontFamily: options?.taskBar?.labelTextStyle.fontFamily ?? 'Arial',
|
|
51735
51825
|
fontSize: options?.taskBar?.labelTextStyle.fontSize ?? gantt.parsedOptions.rowHeight,
|
|
51736
51826
|
color: options?.taskBar?.labelTextStyle.color ?? '#F01',
|
|
51737
51827
|
textAlign: options?.taskBar?.labelTextStyle.textAlign ?? 'left',
|
|
51738
51828
|
textBaseline: options?.taskBar?.labelTextStyle.textBaseline ?? 'middle',
|
|
51739
|
-
padding: options?.taskBar?.labelTextStyle.padding ?? 0,
|
|
51829
|
+
padding: options?.taskBar?.labelTextStyle.padding ?? [0, 0, 0, 10],
|
|
51740
51830
|
textOverflow: options?.taskBar?.labelTextStyle.textOverflow
|
|
51741
51831
|
};
|
|
51742
51832
|
gantt.parsedOptions.taskBarCustomLayout = options?.taskBar?.customLayout;
|
|
51743
|
-
gantt.parsedOptions.
|
|
51833
|
+
gantt.parsedOptions.outerFrameStyle = Object.assign({
|
|
51744
51834
|
borderColor: 'gray',
|
|
51745
|
-
borderLineWidth:
|
|
51835
|
+
borderLineWidth: 1,
|
|
51746
51836
|
cornerRadius: 4
|
|
51747
|
-
}, options.
|
|
51837
|
+
}, options.frame?.outerFrameStyle);
|
|
51748
51838
|
gantt.parsedOptions.markLine = generateMarkLine(options?.markLine);
|
|
51749
|
-
gantt.parsedOptions.
|
|
51750
|
-
|
|
51751
|
-
|
|
51752
|
-
|
|
51839
|
+
gantt.parsedOptions.verticalSplitLineHighlight = options.frame?.verticalSplitLineHighlight;
|
|
51840
|
+
gantt.parsedOptions.verticalSplitLine = Object.assign({
|
|
51841
|
+
lineColor: gantt.parsedOptions.outerFrameStyle.borderColor,
|
|
51842
|
+
lineWidth: gantt.parsedOptions.outerFrameStyle.borderLineWidth
|
|
51843
|
+
}, options.frame?.verticalSplitLine);
|
|
51844
|
+
gantt.parsedOptions.horizontalSplitLine = options.frame?.horizontalSplitLine;
|
|
51845
|
+
gantt.parsedOptions.verticalSplitLineMoveable = options.frame.verticalSplitLineMoveable;
|
|
51753
51846
|
}
|
|
51754
51847
|
function generateTimeLineDate(currentDate, endDate, scale) {
|
|
51755
51848
|
const { unit, step, format } = scale;
|
|
@@ -52036,6 +52129,7 @@
|
|
|
52036
52129
|
<line x1="30" y1="10" x2="30" y2="190" stroke="black" stroke-width="4"/>
|
|
52037
52130
|
<line x1="70" y1="10" x2="70" y2="190" stroke="black" stroke-width="4"/>
|
|
52038
52131
|
</svg>`;
|
|
52132
|
+
const TASKBAR_HOVER_ICON_WIDTH = 10;
|
|
52039
52133
|
class TaskBar {
|
|
52040
52134
|
group;
|
|
52041
52135
|
barContainer;
|
|
@@ -52164,7 +52258,7 @@
|
|
|
52164
52258
|
fill: color,
|
|
52165
52259
|
fontFamily: fontFamily,
|
|
52166
52260
|
text: parseStringTemplate(this._scene._gantt.parsedOptions.taskBarLabelText, taskRecord),
|
|
52167
|
-
maxLineWidth: taskBarSize -
|
|
52261
|
+
maxLineWidth: taskBarSize - TASKBAR_HOVER_ICON_WIDTH,
|
|
52168
52262
|
textBaseline,
|
|
52169
52263
|
textAlign,
|
|
52170
52264
|
ellipsis: textOverflow === 'clip'
|
|
@@ -52200,7 +52294,7 @@
|
|
|
52200
52294
|
cursor: this._scene._gantt.parsedOptions.taskBarMoveable ? 'grab' : 'default',
|
|
52201
52295
|
pickable: false,
|
|
52202
52296
|
cornerRadius: this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,
|
|
52203
|
-
fill: this._scene._gantt.parsedOptions.
|
|
52297
|
+
fill: this._scene._gantt.parsedOptions.taskBarHoverStyle.barOverLayColor,
|
|
52204
52298
|
visibleAll: false
|
|
52205
52299
|
});
|
|
52206
52300
|
this.hoverBarGroup = hoverBarGroup;
|
|
@@ -52209,7 +52303,7 @@
|
|
|
52209
52303
|
const icon = new Image$1({
|
|
52210
52304
|
x: 0,
|
|
52211
52305
|
y: 0,
|
|
52212
|
-
width:
|
|
52306
|
+
width: TASKBAR_HOVER_ICON_WIDTH,
|
|
52213
52307
|
height: 20,
|
|
52214
52308
|
image: TASKBAR_HOVER_ICON,
|
|
52215
52309
|
pickable: true,
|
|
@@ -52221,7 +52315,7 @@
|
|
|
52221
52315
|
const rightIcon = new Image$1({
|
|
52222
52316
|
x: 0,
|
|
52223
52317
|
y: 0,
|
|
52224
|
-
width:
|
|
52318
|
+
width: TASKBAR_HOVER_ICON_WIDTH,
|
|
52225
52319
|
height: 20,
|
|
52226
52320
|
image: TASKBAR_HOVER_ICON,
|
|
52227
52321
|
pickable: true,
|
|
@@ -52263,11 +52357,11 @@
|
|
|
52263
52357
|
if (this.hoverBarLeftIcon) {
|
|
52264
52358
|
this.hoverBarLeftIcon.setAttribute('x', 0);
|
|
52265
52359
|
this.hoverBarLeftIcon.setAttribute('y', Math.ceil(height / 10));
|
|
52266
|
-
this.hoverBarLeftIcon.setAttribute('width',
|
|
52360
|
+
this.hoverBarLeftIcon.setAttribute('width', TASKBAR_HOVER_ICON_WIDTH);
|
|
52267
52361
|
this.hoverBarLeftIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));
|
|
52268
|
-
this.hoverBarRightIcon.setAttribute('x', width -
|
|
52362
|
+
this.hoverBarRightIcon.setAttribute('x', width - TASKBAR_HOVER_ICON_WIDTH);
|
|
52269
52363
|
this.hoverBarRightIcon.setAttribute('y', Math.ceil(height / 10));
|
|
52270
|
-
this.hoverBarRightIcon.setAttribute('width',
|
|
52364
|
+
this.hoverBarRightIcon.setAttribute('width', TASKBAR_HOVER_ICON_WIDTH);
|
|
52271
52365
|
this.hoverBarRightIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));
|
|
52272
52366
|
}
|
|
52273
52367
|
}
|
|
@@ -52361,7 +52455,7 @@
|
|
|
52361
52455
|
}
|
|
52362
52456
|
createFrameBorder() {
|
|
52363
52457
|
const group = this._scene.tableGroup;
|
|
52364
|
-
const frameStyle = this._scene._gantt.parsedOptions.
|
|
52458
|
+
const frameStyle = this._scene._gantt.parsedOptions.outerFrameStyle;
|
|
52365
52459
|
if (!frameStyle) {
|
|
52366
52460
|
return;
|
|
52367
52461
|
}
|
|
@@ -52397,7 +52491,7 @@
|
|
|
52397
52491
|
}
|
|
52398
52492
|
}
|
|
52399
52493
|
resize() {
|
|
52400
|
-
this._scene._gantt.parsedOptions.
|
|
52494
|
+
this._scene._gantt.parsedOptions.outerFrameStyle;
|
|
52401
52495
|
this.border.setAttributes({
|
|
52402
52496
|
width: this._scene.tableGroup.attribute.width + this.border.attribute.lineWidth,
|
|
52403
52497
|
height: this._scene.tableGroup.attribute.height + this.border.attribute.lineWidth
|
|
@@ -52547,6 +52641,9 @@
|
|
|
52547
52641
|
release() {
|
|
52548
52642
|
this.stage.release();
|
|
52549
52643
|
}
|
|
52644
|
+
getTaskBarNodeByY(y) {
|
|
52645
|
+
getTaskIndexByY(y, this._gantt);
|
|
52646
|
+
}
|
|
52550
52647
|
}
|
|
52551
52648
|
|
|
52552
52649
|
const judgeType = (value) => {
|
|
@@ -52974,10 +53071,18 @@
|
|
|
52974
53071
|
gantt._resize();
|
|
52975
53072
|
}
|
|
52976
53073
|
});
|
|
52977
|
-
|
|
52978
|
-
|
|
52979
|
-
|
|
52980
|
-
|
|
53074
|
+
if (gantt.parsedOptions.verticalSplitLineMoveable) {
|
|
53075
|
+
handler.on(gantt.resizeLine, 'mousedown', (e) => {
|
|
53076
|
+
stateManager.updateInteractionState(InteractionState$1.grabing);
|
|
53077
|
+
stateManager.startResizeTableWidth(e);
|
|
53078
|
+
});
|
|
53079
|
+
handler.on(gantt.resizeLine, 'mouseover', (e) => {
|
|
53080
|
+
gantt.resizeLine.childNodes[1].style.opacity = '1';
|
|
53081
|
+
});
|
|
53082
|
+
handler.on(gantt.resizeLine, 'mouseout', (e) => {
|
|
53083
|
+
gantt.resizeLine.childNodes[1].style.opacity = '0';
|
|
53084
|
+
});
|
|
53085
|
+
}
|
|
52981
53086
|
vglobal.addEventListener('mousedown', (e) => {
|
|
52982
53087
|
gantt.eventManager.lastDragPointerXYOnWindow = { x: e.x, y: e.y };
|
|
52983
53088
|
});
|
|
@@ -53032,13 +53137,6 @@
|
|
|
53032
53137
|
}
|
|
53033
53138
|
}
|
|
53034
53139
|
function syncResizeStateFromTable(gantt) {
|
|
53035
|
-
if (gantt.taskListTableInstance && gantt.options.taskListTable?.width === 'auto') {
|
|
53036
|
-
gantt.taskListTableInstance?.on('resize_column', (args) => {
|
|
53037
|
-
gantt.taskTableWidth = gantt.taskListTableInstance.getAllColsWidth() + gantt.taskListTableInstance.tableX * 2;
|
|
53038
|
-
gantt.element.style.left = gantt.taskTableWidth ? `${gantt.taskTableWidth}px` : '0px';
|
|
53039
|
-
gantt._resize();
|
|
53040
|
-
});
|
|
53041
|
-
}
|
|
53042
53140
|
}
|
|
53043
53141
|
function syncEditCellFromTable(gantt) {
|
|
53044
53142
|
gantt.taskListTableInstance?.on('change_cell_value', (args) => {
|
|
@@ -53219,7 +53317,7 @@
|
|
|
53219
53317
|
const targetEndX = this.moveTaskBar.targetStartX + correctX;
|
|
53220
53318
|
this._gantt.stateManager.moveTaskBar.target.setAttribute('x', targetEndX);
|
|
53221
53319
|
const taskIndex = getTaskIndexByY(this.moveTaskBar.startY, this._gantt);
|
|
53222
|
-
this._gantt.
|
|
53320
|
+
this._gantt._updateDateToTaskRecord('move', days, taskIndex);
|
|
53223
53321
|
this.moveTaskBar.moving = false;
|
|
53224
53322
|
this.moveTaskBar.target = null;
|
|
53225
53323
|
this._gantt.scenegraph.updateNextFrame();
|
|
@@ -53264,13 +53362,13 @@
|
|
|
53264
53362
|
taskBarGroup.setAttribute('width', taskBarSize);
|
|
53265
53363
|
rect?.setAttribute('width', taskBarGroup.attribute.width);
|
|
53266
53364
|
progressRect?.setAttribute('width', (progress / 100) * taskBarGroup.attribute.width);
|
|
53267
|
-
this._gantt.
|
|
53365
|
+
this._gantt._updateDateToTaskRecord('start-move', -diff_days, taskIndex);
|
|
53268
53366
|
}
|
|
53269
53367
|
else if (direction === 'right') {
|
|
53270
53368
|
taskBarGroup.setAttribute('width', taskBarSize);
|
|
53271
53369
|
rect?.setAttribute('width', taskBarGroup.attribute.width);
|
|
53272
53370
|
progressRect?.setAttribute('width', (progress / 100) * taskBarGroup.attribute.width);
|
|
53273
|
-
this._gantt.
|
|
53371
|
+
this._gantt._updateDateToTaskRecord('end-move', diff_days, taskIndex);
|
|
53274
53372
|
}
|
|
53275
53373
|
this._gantt.scenegraph.taskBar.showHoverBar(taskBarGroup.attribute.x, taskBarGroup.attribute.y, taskBarGroup.attribute.width, taskBarGroup.attribute.height);
|
|
53276
53374
|
reCreateCustomNode(this._gantt, taskBarGroup, taskIndex);
|
|
@@ -53302,12 +53400,7 @@
|
|
|
53302
53400
|
}
|
|
53303
53401
|
rect?.setAttribute('width', taskBarGroup.attribute.width);
|
|
53304
53402
|
progressRect?.setAttribute('width', (progress / 100) * taskBarGroup.attribute.width);
|
|
53305
|
-
textLabel?.setAttribute('
|
|
53306
|
-
? taskBarSize / 2
|
|
53307
|
-
: this._gantt.parsedOptions.taskBarLabelStyle.textAlign === 'left'
|
|
53308
|
-
? 10
|
|
53309
|
-
: taskBarSize - 10);
|
|
53310
|
-
textLabel?.setAttribute('maxLineWidth', taskBarSize - 20);
|
|
53403
|
+
textLabel?.setAttribute('maxLineWidth', taskBarSize - TASKBAR_HOVER_ICON_WIDTH * 2);
|
|
53311
53404
|
const x = taskBarGroup.attribute.x;
|
|
53312
53405
|
const y = taskBarGroup.attribute.y;
|
|
53313
53406
|
const width = taskBarGroup.attribute.width;
|
|
@@ -53540,6 +53633,7 @@
|
|
|
53540
53633
|
canvas;
|
|
53541
53634
|
element;
|
|
53542
53635
|
resizeLine;
|
|
53636
|
+
horizontalSplitLine;
|
|
53543
53637
|
context;
|
|
53544
53638
|
sortedTimelineScales;
|
|
53545
53639
|
reverseSortedTimelineScales;
|
|
@@ -53566,7 +53660,6 @@
|
|
|
53566
53660
|
this._generateTimeLineDateMap();
|
|
53567
53661
|
this.headerLevel = this.sortedTimelineScales.length;
|
|
53568
53662
|
this.element = createRootElement({ top: 0, right: 0, left: 0, bottom: 0 }, 'vtable-gantt');
|
|
53569
|
-
this.element.style.top = '0px';
|
|
53570
53663
|
this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';
|
|
53571
53664
|
this.canvas = document.createElement('canvas');
|
|
53572
53665
|
this.element.appendChild(this.canvas);
|
|
@@ -53580,7 +53673,7 @@
|
|
|
53580
53673
|
}
|
|
53581
53674
|
this._generateListTable();
|
|
53582
53675
|
this._syncPropsFromTable();
|
|
53583
|
-
this.
|
|
53676
|
+
this._createSplitLineAndResizeLine();
|
|
53584
53677
|
this.scenegraph = new Scenegraph(this);
|
|
53585
53678
|
this.stateManager = new StateManager(this);
|
|
53586
53679
|
this.eventManager = new EventManager(this);
|
|
@@ -53634,8 +53727,8 @@
|
|
|
53634
53727
|
const height = Math.floor(heightP - getHorizontalScrollBarSize(this.parsedOptions.scrollStyle));
|
|
53635
53728
|
this.tableNoFrameWidth = widthP;
|
|
53636
53729
|
this.tableNoFrameHeight = Math.floor(heightP);
|
|
53637
|
-
if (this.parsedOptions.
|
|
53638
|
-
const lineWidth = this.parsedOptions.
|
|
53730
|
+
if (this.parsedOptions.outerFrameStyle) {
|
|
53731
|
+
const lineWidth = this.parsedOptions.outerFrameStyle?.borderLineWidth;
|
|
53639
53732
|
this.tableX = lineWidth;
|
|
53640
53733
|
this.tableY = lineWidth;
|
|
53641
53734
|
this.tableNoFrameWidth = width - lineWidth;
|
|
@@ -53648,8 +53741,14 @@
|
|
|
53648
53741
|
this.taskListTableInstance = new ListTableAll(this.container, listTableOption);
|
|
53649
53742
|
if (this.options?.taskListTable?.width === 'auto') {
|
|
53650
53743
|
this.taskTableWidth = this.taskListTableInstance.getAllColsWidth() + this.taskListTableInstance.tableX * 2;
|
|
53744
|
+
if (this.options?.taskListTable?.maxWidth) {
|
|
53745
|
+
this.taskTableWidth = Math.min(this.options?.taskListTable?.maxWidth, this.taskTableWidth);
|
|
53746
|
+
}
|
|
53747
|
+
if (this.options?.taskListTable?.minWidth) {
|
|
53748
|
+
this.taskTableWidth = Math.max(this.options?.taskListTable?.minWidth, this.taskTableWidth);
|
|
53749
|
+
}
|
|
53651
53750
|
this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';
|
|
53652
|
-
this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + this.parsedOptions.
|
|
53751
|
+
this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + this.parsedOptions.outerFrameStyle.borderLineWidth * 2);
|
|
53653
53752
|
this._updateSize();
|
|
53654
53753
|
}
|
|
53655
53754
|
if (this.taskListTableInstance.columnHeaderLevelCount > 1) {
|
|
@@ -53678,6 +53777,9 @@
|
|
|
53678
53777
|
}
|
|
53679
53778
|
for (const key in this.options.taskListTable) {
|
|
53680
53779
|
listTable_options[key] = this.options.taskListTable[key];
|
|
53780
|
+
if (key === 'columns') {
|
|
53781
|
+
listTable_options[key][listTable_options[key].length - 1].disableColumnResize = true;
|
|
53782
|
+
}
|
|
53681
53783
|
}
|
|
53682
53784
|
listTable_options.theme = {
|
|
53683
53785
|
scrollStyle: Object.assign({}, this.parsedOptions.scrollStyle, {
|
|
@@ -53687,13 +53789,13 @@
|
|
|
53687
53789
|
bgColor: this.parsedOptions.timelineHeaderBackgroundColor
|
|
53688
53790
|
}, this.options.taskListTable.headerStyle),
|
|
53689
53791
|
cellInnerBorder: false,
|
|
53690
|
-
frameStyle: Object.assign({}, this.parsedOptions.
|
|
53691
|
-
cornerRadius: this.parsedOptions.
|
|
53792
|
+
frameStyle: Object.assign({}, this.parsedOptions.outerFrameStyle, {
|
|
53793
|
+
cornerRadius: this.parsedOptions.outerFrameStyle.cornerRadius,
|
|
53692
53794
|
borderLineWidth: [
|
|
53693
|
-
this.parsedOptions.
|
|
53795
|
+
this.parsedOptions.outerFrameStyle.borderLineWidth,
|
|
53694
53796
|
0,
|
|
53695
|
-
this.parsedOptions.
|
|
53696
|
-
this.parsedOptions.
|
|
53797
|
+
this.parsedOptions.outerFrameStyle.borderLineWidth,
|
|
53798
|
+
this.parsedOptions.outerFrameStyle.borderLineWidth
|
|
53697
53799
|
]
|
|
53698
53800
|
}),
|
|
53699
53801
|
bodyStyle: Object.assign({}, DEFAULT.bodyStyle, this.options.taskListTable.bodyStyle)
|
|
@@ -53705,8 +53807,21 @@
|
|
|
53705
53807
|
listTable_options.clearDOM = false;
|
|
53706
53808
|
return listTable_options;
|
|
53707
53809
|
}
|
|
53708
|
-
|
|
53709
|
-
if (this.
|
|
53810
|
+
_createSplitLineAndResizeLine() {
|
|
53811
|
+
if (this.parsedOptions.horizontalSplitLine) {
|
|
53812
|
+
this.horizontalSplitLine = document.createElement('div');
|
|
53813
|
+
this.horizontalSplitLine.style.position = 'absolute';
|
|
53814
|
+
this.horizontalSplitLine.style.top = this.getAllHeaderRowsHeight() + 'px';
|
|
53815
|
+
this.horizontalSplitLine.style.left = this.tableY + 'px';
|
|
53816
|
+
this.horizontalSplitLine.style.height = (this.parsedOptions.horizontalSplitLine.lineWidth ?? 2) + 'px';
|
|
53817
|
+
this.horizontalSplitLine.style.width = this.tableNoFrameHeight + this.taskTableWidth + 'px';
|
|
53818
|
+
this.horizontalSplitLine.style.backgroundColor = this.parsedOptions.horizontalSplitLine.lineColor;
|
|
53819
|
+
this.horizontalSplitLine.style.zIndex = '100';
|
|
53820
|
+
this.horizontalSplitLine.style.userSelect = 'none';
|
|
53821
|
+
this.horizontalSplitLine.style.opacity = '1';
|
|
53822
|
+
this.container.appendChild(this.horizontalSplitLine);
|
|
53823
|
+
}
|
|
53824
|
+
if (this.taskListTableInstance) {
|
|
53710
53825
|
this.resizeLine = document.createElement('div');
|
|
53711
53826
|
this.resizeLine.style.position = 'absolute';
|
|
53712
53827
|
this.resizeLine.style.top = this.tableY + 'px';
|
|
@@ -53715,29 +53830,37 @@
|
|
|
53715
53830
|
this.resizeLine.style.height = this.drawHeight + 'px';
|
|
53716
53831
|
this.resizeLine.style.backgroundColor = 'rgba(0,0,0,0)';
|
|
53717
53832
|
this.resizeLine.style.zIndex = '100';
|
|
53718
|
-
this.resizeLine.style.cursor = 'col-resize';
|
|
53833
|
+
this.parsedOptions.verticalSplitLineMoveable && (this.resizeLine.style.cursor = 'col-resize');
|
|
53719
53834
|
this.resizeLine.style.userSelect = 'none';
|
|
53720
53835
|
this.resizeLine.style.opacity = '1';
|
|
53721
|
-
const
|
|
53722
|
-
|
|
53723
|
-
|
|
53724
|
-
|
|
53725
|
-
|
|
53726
|
-
|
|
53727
|
-
|
|
53728
|
-
|
|
53729
|
-
|
|
53730
|
-
|
|
53731
|
-
|
|
53732
|
-
|
|
53733
|
-
|
|
53734
|
-
|
|
53735
|
-
|
|
53736
|
-
highlightLine.style.
|
|
53737
|
-
|
|
53738
|
-
|
|
53836
|
+
const verticalSplitLine = document.createElement('div');
|
|
53837
|
+
verticalSplitLine.style.position = 'absolute';
|
|
53838
|
+
verticalSplitLine.style.top = '0px';
|
|
53839
|
+
verticalSplitLine.style.left = `${(14 - this.parsedOptions.verticalSplitLine.lineWidth) / 2}px`;
|
|
53840
|
+
verticalSplitLine.style.width = this.parsedOptions.verticalSplitLine.lineWidth + 'px';
|
|
53841
|
+
verticalSplitLine.style.height = '100%';
|
|
53842
|
+
verticalSplitLine.style.backgroundColor = this.parsedOptions.verticalSplitLine.lineColor;
|
|
53843
|
+
verticalSplitLine.style.zIndex = '100';
|
|
53844
|
+
verticalSplitLine.style.userSelect = 'none';
|
|
53845
|
+
verticalSplitLine.style.pointerEvents = 'none';
|
|
53846
|
+
verticalSplitLine.style.transition = 'background-color 0.3s';
|
|
53847
|
+
this.resizeLine.appendChild(verticalSplitLine);
|
|
53848
|
+
if (this.parsedOptions.verticalSplitLineHighlight) {
|
|
53849
|
+
const highlightLine = document.createElement('div');
|
|
53850
|
+
highlightLine.style.position = 'absolute';
|
|
53851
|
+
highlightLine.style.top = '0px';
|
|
53852
|
+
highlightLine.style.left = `${(14 - this.parsedOptions.verticalSplitLineHighlight.lineWidth ?? 2) / 2}px`;
|
|
53853
|
+
highlightLine.style.width = (this.parsedOptions.verticalSplitLineHighlight.lineWidth ?? 2) + 'px';
|
|
53854
|
+
highlightLine.style.height = '100%';
|
|
53855
|
+
highlightLine.style.backgroundColor = this.parsedOptions.verticalSplitLineHighlight.lineColor;
|
|
53856
|
+
highlightLine.style.zIndex = '100';
|
|
53857
|
+
highlightLine.style.cursor = 'col-resize';
|
|
53858
|
+
highlightLine.style.userSelect = 'none';
|
|
53859
|
+
highlightLine.style.pointerEvents = 'none';
|
|
53739
53860
|
highlightLine.style.opacity = '0';
|
|
53740
|
-
|
|
53861
|
+
highlightLine.style.transition = 'background-color 0.3s';
|
|
53862
|
+
this.resizeLine.appendChild(highlightLine);
|
|
53863
|
+
}
|
|
53741
53864
|
this.container.appendChild(this.resizeLine);
|
|
53742
53865
|
}
|
|
53743
53866
|
}
|
|
@@ -53863,7 +53986,7 @@
|
|
|
53863
53986
|
progress
|
|
53864
53987
|
};
|
|
53865
53988
|
}
|
|
53866
|
-
|
|
53989
|
+
_updateDateToTaskRecord(updateDateType, days, index) {
|
|
53867
53990
|
const taskRecord = this.getRecordByIndex(index);
|
|
53868
53991
|
const startDateField = this.parsedOptions.startDateField;
|
|
53869
53992
|
const endDateField = this.parsedOptions.endDateField;
|
|
@@ -53886,9 +54009,8 @@
|
|
|
53886
54009
|
}
|
|
53887
54010
|
this.updateRecordToListTable(taskRecord, index);
|
|
53888
54011
|
}
|
|
53889
|
-
updateTaskRecord(index) {
|
|
53890
|
-
|
|
53891
|
-
this.updateRecordToListTable(taskRecord, index);
|
|
54012
|
+
updateTaskRecord(index, record) {
|
|
54013
|
+
this.updateRecordToListTable(record, index);
|
|
53892
54014
|
}
|
|
53893
54015
|
setPixelRatio(pixelRatio) {
|
|
53894
54016
|
this.parsedOptions.pixelRatio = pixelRatio;
|
|
@@ -53896,7 +54018,7 @@
|
|
|
53896
54018
|
}
|
|
53897
54019
|
_resize() {
|
|
53898
54020
|
this._updateSize();
|
|
53899
|
-
this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + this.parsedOptions.
|
|
54021
|
+
this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + this.parsedOptions.outerFrameStyle.borderLineWidth * 2);
|
|
53900
54022
|
this._syncPropsFromTable();
|
|
53901
54023
|
this.scenegraph.resize();
|
|
53902
54024
|
}
|
|
@@ -53923,6 +54045,14 @@
|
|
|
53923
54045
|
}
|
|
53924
54046
|
setRecords(records) {
|
|
53925
54047
|
this.records = records;
|
|
54048
|
+
this.taskListTableInstance.setRecords(records);
|
|
54049
|
+
this._syncPropsFromTable();
|
|
54050
|
+
this.resizeLine.style.height = this.drawHeight + 'px';
|
|
54051
|
+
this.scenegraph.refreshTaskBarsAndGrid();
|
|
54052
|
+
const left = this.stateManager.scroll.horizontalBarPos;
|
|
54053
|
+
const top = this.stateManager.scroll.verticalBarPos;
|
|
54054
|
+
this.scenegraph.setX(-left);
|
|
54055
|
+
this.scenegraph.setY(-top);
|
|
53926
54056
|
}
|
|
53927
54057
|
}
|
|
53928
54058
|
|
|
@@ -53932,7 +54062,7 @@
|
|
|
53932
54062
|
getWeekNumber: getWeekNumber
|
|
53933
54063
|
});
|
|
53934
54064
|
|
|
53935
|
-
const version = "1.
|
|
54065
|
+
const version = "1.6.0-alpha.4";
|
|
53936
54066
|
|
|
53937
54067
|
exports.Gantt = Gantt;
|
|
53938
54068
|
exports.TYPES = index$1;
|