@visactor/vtable-gantt 1.7.2 → 1.7.3
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/tools/isx.js +2 -1
- package/cjs/ts-types/events.js +1 -2
- package/dist/vtable-gantt.js +35 -19
- package/dist/vtable-gantt.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/tools/isx.js +3 -1
- package/es/ts-types/events.js +1 -2
- package/package.json +3 -3
package/cjs/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import * as TYPES from './ts-types';
|
|
|
3
3
|
import type { ColumnDefine, ColumnsDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType } from '@visactor/vtable';
|
|
4
4
|
import { Gantt } from './Gantt';
|
|
5
5
|
import * as tools from './tools';
|
|
6
|
-
export declare const version = "1.7.
|
|
6
|
+
export declare const version = "1.7.3";
|
|
7
7
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAqBlC,sBAAK;AAPP,mCAAgC;AAS9B,sFATO,aAAK,OASP;AARP,+CAAiC;AAoB/B,sBAAK;AAnBM,QAAA,OAAO,GAAG,OAAO,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';\nexport const version = \"1.7.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAqBlC,sBAAK;AAPP,mCAAgC;AAS9B,sFATO,aAAK,OASP;AARP,+CAAiC;AAoB/B,sBAAK;AAnBM,QAAA,OAAO,GAAG,OAAO,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';\nexport const version = \"1.7.3\";\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};\n"]}
|
package/cjs/tools/isx.js
CHANGED
package/cjs/ts-types/events.js
CHANGED
package/dist/vtable-gantt.js
CHANGED
|
@@ -27300,7 +27300,7 @@
|
|
|
27300
27300
|
var _a;
|
|
27301
27301
|
let cellGroup,
|
|
27302
27302
|
isAsync = !1;
|
|
27303
|
-
if (isPromise(value) && (value = table.getCellValue(col, row), isAsync = !0), "text" === type || "link" === type) {
|
|
27303
|
+
if (isPromise(value) && (value = table.getCellValue(col, row), isAsync = !0), "text" === type || "link" === type || customResult) {
|
|
27304
27304
|
if ("link" === type) {
|
|
27305
27305
|
const cellValue = value,
|
|
27306
27306
|
headerStyle = table._getCellStyle(col, row);
|
|
@@ -29540,10 +29540,13 @@
|
|
|
29540
29540
|
globalCompositeOperation: "destination-out"
|
|
29541
29541
|
}), borderRect.addChild(shadowRect);
|
|
29542
29542
|
const hackRect = createRect({
|
|
29543
|
-
|
|
29544
|
-
|
|
29543
|
+
x: borderLeft / 2,
|
|
29544
|
+
y: borderTop / 2,
|
|
29545
|
+
width: group.attribute.width,
|
|
29546
|
+
height: group.attribute.height,
|
|
29545
29547
|
fill: "transparent",
|
|
29546
|
-
pickable: !1
|
|
29548
|
+
pickable: !1,
|
|
29549
|
+
globalCompositeOperation: "source-over"
|
|
29547
29550
|
});
|
|
29548
29551
|
borderRect.addChild(hackRect);
|
|
29549
29552
|
} else borderRect = createRect(rectAttributes), borderRect.name = "table-border-rect";
|
|
@@ -30105,8 +30108,12 @@
|
|
|
30105
30108
|
cellDisable && (selectMode = void 0);
|
|
30106
30109
|
}
|
|
30107
30110
|
} else if ("replace" === state.table.theme.selectionStyle.selectionFillMode) for (let i = 0; i < ranges.length; i++) {
|
|
30108
|
-
const range = ranges[i]
|
|
30109
|
-
|
|
30111
|
+
const range = ranges[i],
|
|
30112
|
+
rangeColStart = Math.min(range.start.col, range.end.col),
|
|
30113
|
+
rangeColEnd = Math.max(range.start.col, range.end.col),
|
|
30114
|
+
rangeRowStart = Math.min(range.start.row, range.end.row),
|
|
30115
|
+
rangeRowEnd = Math.max(range.start.row, range.end.row);
|
|
30116
|
+
if (rangeColStart <= col && rangeRowStart <= row && rangeColEnd >= col && rangeRowEnd >= row) {
|
|
30110
30117
|
selectMode = "cellBgColor";
|
|
30111
30118
|
break;
|
|
30112
30119
|
}
|
|
@@ -33784,11 +33791,13 @@
|
|
|
33784
33791
|
updateCheckboxCellState(col, row, checked) {
|
|
33785
33792
|
var _a, _b;
|
|
33786
33793
|
if (this.table.transpose) null === (_a = this.bodyGroup.children) || void 0 === _a || _a.forEach(columnGroup => {
|
|
33787
|
-
|
|
33794
|
+
var _a;
|
|
33795
|
+
null === (_a = columnGroup.getChildAt(row)) || void 0 === _a || _a.getChildren().forEach(node => {
|
|
33788
33796
|
"checkbox" === node.name && node.setAttribute("checked", checked);
|
|
33789
33797
|
});
|
|
33790
33798
|
});else {
|
|
33791
|
-
|
|
33799
|
+
const columnGroup = this.getColGroup(col);
|
|
33800
|
+
null === (_b = null == columnGroup ? void 0 : columnGroup.children) || void 0 === _b || _b.forEach(cellNode => {
|
|
33792
33801
|
cellNode.getChildren().find(node => {
|
|
33793
33802
|
"checkbox" === node.name && node.setAttribute("checked", checked);
|
|
33794
33803
|
});
|
|
@@ -34087,12 +34096,12 @@
|
|
|
34087
34096
|
let cell;
|
|
34088
34097
|
if (!cellGroup) {
|
|
34089
34098
|
const drawRange = this.table.getDrawRange();
|
|
34090
|
-
return abstractY >= drawRange.top && abstractY <= drawRange.bottom
|
|
34099
|
+
return abstractY >= drawRange.top && abstractY <= drawRange.bottom && (cell = this.table.getCellAtRelativePosition(abstractX - offset, abstractY), cell.col === this.table.colCount - 1) ? cell : {
|
|
34091
34100
|
col: -1,
|
|
34092
34101
|
row: -1
|
|
34093
34102
|
};
|
|
34094
34103
|
}
|
|
34095
|
-
return abstractX < cellGroup.globalAABBBounds.x1 + offset ? cell = {
|
|
34104
|
+
return cellGroup.stage ? (abstractX < cellGroup.globalAABBBounds.x1 + offset ? cell = {
|
|
34096
34105
|
col: cellGroup.col - 1,
|
|
34097
34106
|
row: cellGroup.row,
|
|
34098
34107
|
x: cellGroup.globalAABBBounds.x1
|
|
@@ -34100,7 +34109,10 @@
|
|
|
34100
34109
|
col: cellGroup.col,
|
|
34101
34110
|
row: cellGroup.row,
|
|
34102
34111
|
x: cellGroup.globalAABBBounds.x2
|
|
34103
|
-
}), cell && this.table.rightFrozenColCount > 0 && cell.col
|
|
34112
|
+
}), cell && this.table.rightFrozenColCount > 0 && cell.col >= this.table.colCount - this.table.rightFrozenColCount - 1 && this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() + this.table.scrollLeft < this.bodyGroup.attribute.width && (cell.col = cell.col + 1, cell.rightFrozen = !0), cell || {
|
|
34113
|
+
col: -1,
|
|
34114
|
+
row: -1
|
|
34115
|
+
}) : {
|
|
34104
34116
|
col: -1,
|
|
34105
34117
|
row: -1
|
|
34106
34118
|
};
|
|
@@ -34117,7 +34129,7 @@
|
|
|
34117
34129
|
col: cellGroup.col,
|
|
34118
34130
|
row: cellGroup.row,
|
|
34119
34131
|
y: cellGroup.globalAABBBounds.y2
|
|
34120
|
-
}), cell && this.table.bottomFrozenRowCount > 0 && cell.row
|
|
34132
|
+
}), cell && this.table.bottomFrozenRowCount > 0 && cell.row >= this.table.rowCount - this.table.bottomFrozenRowCount - 1 && this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() + this.table.scrollTop < this.bodyGroup.attribute.height && (cell.row = cell.row + 1, cell.bottomFrozen = !0), cell) return cell;
|
|
34121
34133
|
}
|
|
34122
34134
|
return {
|
|
34123
34135
|
col: -1,
|
|
@@ -34808,7 +34820,7 @@
|
|
|
34808
34820
|
}
|
|
34809
34821
|
rightColWidth - detaX < state.table.internalProps.limitMinWidth && (detaX = rightColWidth - state.table.internalProps.limitMinWidth);
|
|
34810
34822
|
}
|
|
34811
|
-
detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.
|
|
34823
|
+
detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.table.options.frozenColCount && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1), (state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose || state.table.options.rightFrozenColCount) && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame();
|
|
34812
34824
|
}
|
|
34813
34825
|
function updateResizeColForColumn(detaX, state) {
|
|
34814
34826
|
"adaptive" === state.table.widthMode && state.columnResize.col < state.table.colCount - 1 ? (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.scenegraph.updateColWidth(state.columnResize.col + 1, -detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col), state.table.internalProps._widthResizedColMap.add(state.columnResize.col + 1)) : (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col));
|
|
@@ -35785,7 +35797,7 @@
|
|
|
35785
35797
|
horizontal: 1,
|
|
35786
35798
|
vertical: 1
|
|
35787
35799
|
});
|
|
35788
|
-
(optimizedDeltaX || optimizedDeltaY) && state.interactionState !== InteractionState.scrolling && state.updateInteractionState(InteractionState.scrolling), optimizedDeltaX && (state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event), state.showHorizontalScrollBar(!0)), optimizedDeltaY && (state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event), state.showVerticalScrollBar(!0)), isWheelEvent && state.resetInteractionState(), event.cancelable && ("none" === state.table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, state) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, state)) && event.preventDefault();
|
|
35800
|
+
(optimizedDeltaX || optimizedDeltaY) && state.interactionState !== InteractionState.scrolling && state.updateInteractionState(InteractionState.scrolling), optimizedDeltaX && (state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event), state.showHorizontalScrollBar(!0)), optimizedDeltaY && (state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event), state.showVerticalScrollBar(!0)), isWheelEvent && state.resetInteractionState(), event.nativeEvent.cancelable && ("none" === state.table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, state) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, state)) && event.nativeEvent.preventDefault();
|
|
35789
35801
|
}
|
|
35790
35802
|
function optimizeScrollXY(x, y, ratio) {
|
|
35791
35803
|
var _a, _b;
|
|
@@ -36456,7 +36468,7 @@
|
|
|
36456
36468
|
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;
|
|
36457
36469
|
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));
|
|
36458
36470
|
}
|
|
36459
|
-
} else {
|
|
36471
|
+
} else if (!(e.ctrlKey || e.metaKey || e.shiftKey)) {
|
|
36460
36472
|
const editCellTrigger = table.options.editCellTrigger;
|
|
36461
36473
|
if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_u = table.editorManager) || void 0 === _u ? void 0 : _u.editingEditor)) {
|
|
36462
36474
|
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
@@ -38066,14 +38078,18 @@
|
|
|
38066
38078
|
}
|
|
38067
38079
|
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
38068
38080
|
const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
|
|
38069
|
-
if (-1 === index
|
|
38081
|
+
if (-1 === index) this.customCellStyleArrangement.push({
|
|
38070
38082
|
cellPosition: {
|
|
38071
38083
|
col: cellPos.col,
|
|
38072
38084
|
row: cellPos.row,
|
|
38073
38085
|
range: cellPos.range
|
|
38074
38086
|
},
|
|
38075
38087
|
customStyleId: customStyleId
|
|
38076
|
-
})
|
|
38088
|
+
});else {
|
|
38089
|
+
if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
|
|
38090
|
+
this.customCellStyleArrangement[index].customStyleId = customStyleId;
|
|
38091
|
+
}
|
|
38092
|
+
if (cellPos.range) for (let col = cellPos.range.start.col; col <= cellPos.range.end.col; col++) for (let row = cellPos.range.start.row; row <= cellPos.range.end.row; row++) this.table.scenegraph.updateCellContent(col, row);else this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
|
|
38077
38093
|
this.table.scenegraph.updateNextFrame();
|
|
38078
38094
|
}
|
|
38079
38095
|
updateCustomCell(customCellStyle, customCellStyleArrangement) {
|
|
@@ -38621,7 +38637,7 @@
|
|
|
38621
38637
|
constructor(container) {
|
|
38622
38638
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
38623
38639
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
38624
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.7.
|
|
38640
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.7.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
38625
38641
|
const {
|
|
38626
38642
|
frozenColCount = 0,
|
|
38627
38643
|
frozenRowCount: frozenRowCount,
|
|
@@ -44927,7 +44943,7 @@
|
|
|
44927
44943
|
getWeekday: getWeekday
|
|
44928
44944
|
});
|
|
44929
44945
|
|
|
44930
|
-
const version = "1.7.
|
|
44946
|
+
const version = "1.7.3";
|
|
44931
44947
|
|
|
44932
44948
|
exports.Gantt = Gantt;
|
|
44933
44949
|
exports.TYPES = index$1;
|