@visactor/vtable-gantt 1.26.1-alpha.0 → 1.26.1
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/components/Menu.js +0 -2
- package/cjs/event/touch.js +0 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/plugins/interface.js +2 -1
- package/cjs/state/gantt-table-sync.js +0 -1
- package/dist/vtable-gantt.js +75 -38
- package/dist/vtable-gantt.min.js +1 -1
- package/es/components/Menu.js +0 -2
- package/es/event/touch.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/plugins/interface.js +2 -1
- package/es/state/gantt-table-sync.js +1 -2
- package/package.json +6 -6
package/cjs/components/Menu.js
CHANGED
package/cjs/event/touch.js
CHANGED
package/cjs/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.26.1
|
|
9
|
+
export declare const version = "1.26.1";
|
|
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,
|
|
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.26.1\";\n/**\n * @namespace VTableGantt\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"]}
|
package/cjs/plugins/interface.js
CHANGED
|
@@ -89,7 +89,6 @@ function _syncTableSize(gantt) {
|
|
|
89
89
|
gantt._updateSize(), (0, gantt_helper_1.updateSplitLineAndResizeLine)(gantt), gantt.zoomScaleManager && gantt.zoomScaleManager.handleTableWidthChange());
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
//# sourceMappingURL=gantt-table-sync.js.map
|
|
93
92
|
exports.syncScrollStateToTable = syncScrollStateToTable, exports.syncScrollStateFromTable = syncScrollStateFromTable,
|
|
94
93
|
exports.syncEditCellFromTable = syncEditCellFromTable, exports.syncTreeChangeFromTable = syncTreeChangeFromTable,
|
|
95
94
|
exports.syncSortFromTable = syncSortFromTable, exports.syncDragOrderFromTable = syncDragOrderFromTable,
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -50938,7 +50938,7 @@
|
|
|
50938
50938
|
};
|
|
50939
50939
|
function dynamicSetX(x, screenLeft, isEnd, proxy) {
|
|
50940
50940
|
return __awaiter$7(this, void 0, void 0, function* () {
|
|
50941
|
-
if (!screenLeft) return;
|
|
50941
|
+
if (!screenLeft) return proxy.updateDeltaX(x), proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX), void proxy.table.scenegraph.updateNextFrame();
|
|
50942
50942
|
const screenLeftCol = screenLeft.col,
|
|
50943
50943
|
screenLeftX = screenLeft.left;
|
|
50944
50944
|
let deltaCol;
|
|
@@ -51114,7 +51114,7 @@
|
|
|
51114
51114
|
};
|
|
51115
51115
|
function dynamicSetY(y, screenTop, isEnd, proxy) {
|
|
51116
51116
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
51117
|
-
if (!screenTop) return;
|
|
51117
|
+
if (!screenTop) return proxy.updateDeltaY(y), proxy.updateBody(y - proxy.deltaY), void proxy.table.scenegraph.updateNextFrame();
|
|
51118
51118
|
const screenTopRow = screenTop.row,
|
|
51119
51119
|
screenTopY = screenTop.top;
|
|
51120
51120
|
let deltaRow;
|
|
@@ -51719,7 +51719,7 @@
|
|
|
51719
51719
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
51720
51720
|
const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + (this.rowEnd - this.rowStart + 1)) / 2,
|
|
51721
51721
|
yLimitBottom = this.table.getAllRowsHeight() - yLimitTop,
|
|
51722
|
-
screenTop = this.
|
|
51722
|
+
screenTop = this.resolveTargetRowInfo(y + this.table.scenegraph.colHeaderGroup.attribute.height);
|
|
51723
51723
|
screenTop && (this.screenTopRow = screenTop.row), y < yLimitTop && this.rowStart === this.bodyTopRow || y > yLimitBottom && this.rowEnd === this.bodyBottomRow ? (this.updateDeltaY(y), this.updateBody(y - this.deltaY)) : this.table.scenegraph.bodyGroup.firstChild && "group" === this.table.scenegraph.bodyGroup.firstChild.type && 0 !== this.table.scenegraph.bodyGroup.firstChild.childrenCount || this.table.scenegraph.rowHeaderGroup.firstChild && "group" === this.table.scenegraph.rowHeaderGroup.firstChild.type && 0 !== this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount ? this.dynamicSetY(y, screenTop, isEnd) : (this.updateDeltaY(y), this.updateBody(y - this.deltaY));
|
|
51724
51724
|
});
|
|
51725
51725
|
}
|
|
@@ -51728,7 +51728,7 @@
|
|
|
51728
51728
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
51729
51729
|
const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + (this.colEnd - this.colStart + 1)) / 2,
|
|
51730
51730
|
xLimitRight = this.table.getAllColsWidth() - xLimitLeft,
|
|
51731
|
-
screenLeft = this.
|
|
51731
|
+
screenLeft = this.resolveTargetColInfo(x + this.table.scenegraph.rowHeaderGroup.attribute.width + (null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0));
|
|
51732
51732
|
screenLeft && (this.screenLeftCol = screenLeft.col), x < xLimitLeft && this.colStart === this.bodyLeftCol || x > xLimitRight && this.colEnd === this.bodyRightCol || this.table.scenegraph.bodyGroup.firstChild && "group" === this.table.scenegraph.bodyGroup.firstChild.type && 0 === this.table.scenegraph.bodyGroup.firstChild.childrenCount ? (this.updateDeltaX(x), this.table.scenegraph.setBodyAndColHeaderX(-x + this.deltaX)) : this.dynamicSetX(x, screenLeft, isEnd);
|
|
51733
51733
|
});
|
|
51734
51734
|
}
|
|
@@ -51742,6 +51742,22 @@
|
|
|
51742
51742
|
dynamicSetX(x, screenLeft, isEnd, this);
|
|
51743
51743
|
});
|
|
51744
51744
|
}
|
|
51745
|
+
resolveTargetColInfo(absoluteX) {
|
|
51746
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
51747
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
51748
|
+
const screenLeft = this.table.getTargetColAt(absoluteX + offsets[i]);
|
|
51749
|
+
if (screenLeft) return screenLeft;
|
|
51750
|
+
}
|
|
51751
|
+
return null;
|
|
51752
|
+
}
|
|
51753
|
+
resolveTargetRowInfo(absoluteY) {
|
|
51754
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
51755
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
51756
|
+
const screenTop = this.table.getTargetRowAt(absoluteY + offsets[i]);
|
|
51757
|
+
if (screenTop) return screenTop;
|
|
51758
|
+
}
|
|
51759
|
+
return null;
|
|
51760
|
+
}
|
|
51745
51761
|
updateBody(y) {
|
|
51746
51762
|
this.table.scenegraph.setBodyAndRowHeaderY(-y);
|
|
51747
51763
|
}
|
|
@@ -54062,15 +54078,17 @@
|
|
|
54062
54078
|
this.table.scenegraph.proxy.setY(-y, isEnd);
|
|
54063
54079
|
}
|
|
54064
54080
|
setBodyAndRowHeaderY(y) {
|
|
54065
|
-
var _a, _b
|
|
54066
|
-
const
|
|
54067
|
-
|
|
54068
|
-
|
|
54081
|
+
var _a, _b;
|
|
54082
|
+
const firstBodyColGroup = this.bodyGroup.firstChild,
|
|
54083
|
+
firstRowHeaderColGroup = this.rowHeaderGroup.firstChild,
|
|
54084
|
+
firstBodyCell = null !== (_a = null == firstBodyColGroup ? void 0 : firstBodyColGroup.firstChild) && void 0 !== _a ? _a : null == firstRowHeaderColGroup ? void 0 : firstRowHeaderColGroup.firstChild;
|
|
54085
|
+
let lastBodyCell = null !== (_b = null == firstBodyColGroup ? void 0 : firstBodyColGroup.lastChild) && void 0 !== _b ? _b : null == firstRowHeaderColGroup ? void 0 : firstRowHeaderColGroup.lastChild;
|
|
54086
|
+
lastBodyCell && "group" !== lastBodyCell.type && (lastBodyCell = lastBodyCell._prev), 0 === y && firstBodyCell && firstBodyCell.row === this.table.frozenRowCount && firstBodyCell.attribute.y + y < 0 ? y = -firstBodyCell.attribute.y : lastBodyCell && this.table.tableNoFrameHeight < this.table.getAllRowsHeight() && lastBodyCell.row === this.table.rowCount - this.table.bottomFrozenRowCount - 1 && lastBodyCell.attribute.y + this.table.getRowHeight(lastBodyCell.row) + y < this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() && (y = this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() - lastBodyCell.attribute.y - this.table.getRowHeight(lastBodyCell.row)), this.colHeaderGroup.attribute.height + y !== this.bodyGroup.attribute.y && (this.bodyGroup.setAttribute("y", this.colHeaderGroup.attribute.height + y), this.rowHeaderGroup.setAttribute("y", this.cornerHeaderGroup.attribute.height + y), this.bodySelectGroup.setAttribute("y", this.bodyGroup.attribute.y), this.rowHeaderSelectGroup.setAttribute("y", this.rowHeaderGroup.attribute.y), this.colHeaderSelectGroup.setAttribute("y", this.colHeaderGroup.attribute.y), this.cornerHeaderSelectGroup.setAttribute("y", this.cornerHeaderGroup.attribute.y), this.table.rightFrozenColCount > 0 && (this.rightFrozenGroup.setAttribute("y", this.rightTopCornerGroup.attribute.height + y), this.rightFrozenSelectGroup.setAttribute("y", this.rightFrozenGroup.attribute.y), this.rightTopCornerSelectGroup.setAttribute("y", this.rightTopCornerGroup.attribute.y)), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenSelectGroup.setAttribute("y", this.bottomFrozenGroup.attribute.y), this.leftBottomCornerSelectGroup.setAttribute("y", this.leftBottomCornerGroup.attribute.y)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("y", this.rightBottomCornerGroup.attribute.y), this.updateNextFrame());
|
|
54069
54087
|
}
|
|
54070
54088
|
setBodyAndColHeaderX(x) {
|
|
54071
|
-
const firstBodyCol = this.bodyGroup.firstChild
|
|
54072
|
-
|
|
54073
|
-
0 === x && firstBodyCol && firstBodyCol.col === this.table.frozenColCount && firstBodyCol.attribute.x + x < 0 ? x = -firstBodyCol.attribute.x : lastBodyCol && this.table.tableNoFrameWidth < this.table.getAllColsWidth() && lastBodyCol.col === this.table.colCount - this.table.rightFrozenColCount - 1 && lastBodyCol.attribute.x + lastBodyCol.attribute.width + x < this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() && (x = this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() - lastBodyCol.attribute.x - lastBodyCol.attribute.width), this.table.getFrozenColsWidth() + x !== this.bodyGroup.attribute.x && (this.bodyGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.colHeaderGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bodySelectGroup.setAttribute("x", this.bodyGroup.attribute.x), this.colHeaderSelectGroup.setAttribute("x", this.colHeaderGroup.attribute.x), this.rowHeaderSelectGroup.setAttribute("x", this.rowHeaderGroup.attribute.x), this.cornerHeaderSelectGroup.setAttribute("x", this.cornerHeaderGroup.attribute.x), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bottomFrozenSelectGroup.setAttribute("x", this.bottomFrozenGroup.attribute.x), this.leftBottomCornerSelectGroup.setAttribute("x", this.leftBottomCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && (this.rightFrozenSelectGroup.setAttribute("x", this.rightFrozenGroup.attribute.x), this.rightTopCornerSelectGroup.setAttribute("x", this.rightTopCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("x", this.rightBottomCornerGroup.attribute.x), this.updateNextFrame());
|
|
54089
|
+
const firstBodyCol = this.bodyGroup.firstChild;
|
|
54090
|
+
let lastBodyCol = this.bodyGroup.lastChild;
|
|
54091
|
+
lastBodyCol && "group" !== lastBodyCol.type && (lastBodyCol = lastBodyCol._prev), 0 === x && firstBodyCol && firstBodyCol.col === this.table.frozenColCount && firstBodyCol.attribute.x + x < 0 ? x = -firstBodyCol.attribute.x : lastBodyCol && this.table.tableNoFrameWidth < this.table.getAllColsWidth() && lastBodyCol.col === this.table.colCount - this.table.rightFrozenColCount - 1 && lastBodyCol.attribute.x + lastBodyCol.attribute.width + x < this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() && (x = this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() - lastBodyCol.attribute.x - lastBodyCol.attribute.width), this.table.getFrozenColsWidth() + x !== this.bodyGroup.attribute.x && (this.bodyGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.colHeaderGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bodySelectGroup.setAttribute("x", this.bodyGroup.attribute.x), this.colHeaderSelectGroup.setAttribute("x", this.colHeaderGroup.attribute.x), this.rowHeaderSelectGroup.setAttribute("x", this.rowHeaderGroup.attribute.x), this.cornerHeaderSelectGroup.setAttribute("x", this.cornerHeaderGroup.attribute.x), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bottomFrozenSelectGroup.setAttribute("x", this.bottomFrozenGroup.attribute.x), this.leftBottomCornerSelectGroup.setAttribute("x", this.leftBottomCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && (this.rightFrozenSelectGroup.setAttribute("x", this.rightFrozenGroup.attribute.x), this.rightTopCornerSelectGroup.setAttribute("x", this.rightTopCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("x", this.rightBottomCornerGroup.attribute.x), this.updateNextFrame());
|
|
54074
54092
|
}
|
|
54075
54093
|
afterScenegraphCreated() {
|
|
54076
54094
|
var _a, _b;
|
|
@@ -57507,6 +57525,7 @@
|
|
|
57507
57525
|
}
|
|
57508
57526
|
function dblclickHandler(e, table) {
|
|
57509
57527
|
var _a, _b, _c, _d, _e, _f;
|
|
57528
|
+
if ("number" == typeof e.button && 0 !== e.button) return;
|
|
57510
57529
|
const eventArgsSet = getCellEventArgsSetWithTable(e, table);
|
|
57511
57530
|
let col = -1,
|
|
57512
57531
|
row = -1;
|
|
@@ -57702,7 +57721,13 @@
|
|
|
57702
57721
|
function bindContainerDomListener$1(eventManager) {
|
|
57703
57722
|
const table = eventManager.table,
|
|
57704
57723
|
stateManager = table.stateManager,
|
|
57705
|
-
handler = table.internalProps.handler
|
|
57724
|
+
handler = table.internalProps.handler,
|
|
57725
|
+
afterCompleteEdit = (completeEditResult, onSuccess) => {
|
|
57726
|
+
getPromiseValue(completeEditResult, isCompleteEdit => {
|
|
57727
|
+
var _a, _b, _c, _d, _e;
|
|
57728
|
+
!1 !== isCompleteEdit ? onSuccess() : null === (_e = null === (_d = null === (_c = null === (_b = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor) || void 0 === _b ? void 0 : _b.getInputElement) || void 0 === _c ? void 0 : _c.call(_b)) || void 0 === _d ? void 0 : _d.focus) || void 0 === _e || _e.call(_d);
|
|
57729
|
+
});
|
|
57730
|
+
};
|
|
57706
57731
|
function handleKeydownListener(e) {
|
|
57707
57732
|
var _a;
|
|
57708
57733
|
if (table.hasListeners(TABLE_EVENT_TYPE.KEYDOWN)) {
|
|
@@ -57725,7 +57750,7 @@
|
|
|
57725
57750
|
}
|
|
57726
57751
|
eventManager.dealTableHover();
|
|
57727
57752
|
}), handler.on(table.getElement(), "keydown", e => {
|
|
57728
|
-
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, _0
|
|
57753
|
+
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, _0;
|
|
57729
57754
|
const beforeKeydownEvent = {
|
|
57730
57755
|
keyCode: null !== (_a = e.keyCode) && void 0 !== _a ? _a : e.which,
|
|
57731
57756
|
code: e.code,
|
|
@@ -57735,48 +57760,60 @@
|
|
|
57735
57760
|
if ((null === (_d = null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.moveEditCellOnArrowKeys) || void 0 === _d || !_d) && (null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.editingEditor) || !1 === (null === (_f = table.options.keyboardOptions) || void 0 === _f ? void 0 : _f.moveSelectedCellOnArrowKeys)) return;
|
|
57736
57761
|
let targetCol, targetRow;
|
|
57737
57762
|
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;
|
|
57738
|
-
const isEditingCell = !!(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor)
|
|
57739
|
-
|
|
57740
|
-
|
|
57741
|
-
|
|
57742
|
-
|
|
57743
|
-
|
|
57744
|
-
|
|
57745
|
-
|
|
57746
|
-
|
|
57747
|
-
|
|
57748
|
-
|
|
57749
|
-
|
|
57750
|
-
|
|
57751
|
-
|
|
57763
|
+
const isEditingCell = !!(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor),
|
|
57764
|
+
completeEditResult = null === (_h = table.editorManager) || void 0 === _h ? void 0 : _h.completeEdit();
|
|
57765
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
57766
|
+
var _a, _b, _c, _d, _e;
|
|
57767
|
+
table.getElement().focus();
|
|
57768
|
+
const enableShiftSelectMode = null === (_b = null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.shiftMultiSelect) || void 0 === _b || _b;
|
|
57769
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode), null !== (_d = null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.moveEditCellOnArrowKeys) && void 0 !== _d && _d && isEditingCell && table.getEditor(targetCol, targetRow) && (null === (_e = table.editorManager) || void 0 === _e || _e.startEditCell(targetCol, targetRow));
|
|
57770
|
+
});
|
|
57771
|
+
} else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
|
|
57772
|
+
if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
|
|
57773
|
+
handleKeydownListener(e);
|
|
57774
|
+
const completeEditResult = null === (_l = table.editorManager) || void 0 === _l ? void 0 : _l.completeEdit();
|
|
57775
|
+
return void afterCompleteEdit(completeEditResult, () => {
|
|
57776
|
+
var _a, _b, _c;
|
|
57777
|
+
if (table.getElement().focus(), !0 === (null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.moveFocusCellOnEnter)) {
|
|
57778
|
+
const targetCol = stateManager.select.cellPos.col,
|
|
57779
|
+
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
57780
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57781
|
+
const enableShiftSelectMode = null === (_c = null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.shiftMultiSelect) || void 0 === _c || _c;
|
|
57782
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
57783
|
+
}
|
|
57784
|
+
});
|
|
57752
57785
|
}
|
|
57753
|
-
if (!0 === (null === (
|
|
57786
|
+
if (!0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
|
|
57754
57787
|
const targetCol = stateManager.select.cellPos.col,
|
|
57755
57788
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
57756
57789
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57757
|
-
const enableShiftSelectMode = null === (
|
|
57790
|
+
const enableShiftSelectMode = null === (_p = null === (_o = table.options.keyboardOptions) || void 0 === _o ? void 0 : _o.shiftMultiSelect) || void 0 === _p || _p;
|
|
57758
57791
|
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
57759
|
-
} else if ((null === (
|
|
57792
|
+
} else if ((null === (_r = null === (_q = table.options.keyboardOptions) || void 0 === _q ? void 0 : _q.editCellOnEnter) || void 0 === _r || _r) && 1 === (null !== (_t = null === (_s = table.stateManager.select.ranges) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0)) {
|
|
57760
57793
|
const startCol = table.stateManager.select.ranges[0].start.col,
|
|
57761
57794
|
startRow = table.stateManager.select.ranges[0].start.row,
|
|
57762
57795
|
endCol = table.stateManager.select.ranges[0].end.col,
|
|
57763
57796
|
endRow = table.stateManager.select.ranges[0].end.row;
|
|
57764
|
-
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (
|
|
57797
|
+
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_u = table.editorManager) || void 0 === _u || _u.startEditCell(startCol, startRow));
|
|
57765
57798
|
}
|
|
57766
57799
|
} else if ("Tab" === e.key) {
|
|
57767
|
-
if ((null === (
|
|
57800
|
+
if ((null === (_w = null === (_v = table.options.keyboardOptions) || void 0 === _v ? void 0 : _v.moveFocusCellOnTab) || void 0 === _w || _w) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
|
|
57768
57801
|
if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
|
|
57769
57802
|
let targetCol, targetRow;
|
|
57770
57803
|
if (e.preventDefault(), stateManager.select.cellPos.col === table.colCount - 1 ? (targetRow = Math.min(table.rowCount - 1, stateManager.select.cellPos.row + 1), targetCol = table.rowHeaderLevelCount) : (targetRow = stateManager.select.cellPos.row, targetCol = stateManager.select.cellPos.col + 1), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57771
|
-
const isEditingCell = !!(null === (
|
|
57772
|
-
|
|
57804
|
+
const isEditingCell = !!(null === (_x = table.editorManager) || void 0 === _x ? void 0 : _x.editingEditor),
|
|
57805
|
+
completeEditResult = null === (_y = table.editorManager) || void 0 === _y ? void 0 : _y.completeEdit();
|
|
57806
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
57807
|
+
var _a;
|
|
57808
|
+
table.getElement().focus(), table.selectCell(targetCol, targetRow), isEditingCell && table.getEditor(targetCol, targetRow) && (null === (_a = table.editorManager) || void 0 === _a || _a.startEditCell(targetCol, targetRow));
|
|
57809
|
+
});
|
|
57773
57810
|
}
|
|
57774
57811
|
} else if (!e.ctrlKey && !e.metaKey) {
|
|
57775
57812
|
const editCellTrigger = table.options.editCellTrigger,
|
|
57776
57813
|
selectedRanges = table.stateManager.select.ranges;
|
|
57777
|
-
if (1 === selectedRanges.length && selectedRanges[0].start.col === selectedRanges[0].end.col && selectedRanges[0].start.row === selectedRanges[0].end.row && ("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (
|
|
57814
|
+
if (1 === selectedRanges.length && selectedRanges[0].start.col === selectedRanges[0].end.col && selectedRanges[0].start.row === selectedRanges[0].end.row && ("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_z = table.editorManager) || void 0 === _z ? void 0 : _z.editingEditor)) {
|
|
57778
57815
|
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
57779
|
-
e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (
|
|
57816
|
+
e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (_0 = table.editorManager) || void 0 === _0 || _0.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
|
|
57780
57817
|
}
|
|
57781
57818
|
}
|
|
57782
57819
|
handleKeydownListener(e);
|
|
@@ -61038,7 +61075,7 @@
|
|
|
61038
61075
|
}
|
|
61039
61076
|
constructor(container, options = {}) {
|
|
61040
61077
|
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;
|
|
61041
|
-
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.1
|
|
61078
|
+
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
|
|
61042
61079
|
const g = window;
|
|
61043
61080
|
g[this.id] = this;
|
|
61044
61081
|
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
@@ -78533,7 +78570,7 @@
|
|
|
78533
78570
|
PluginManager: PluginManager
|
|
78534
78571
|
});
|
|
78535
78572
|
|
|
78536
|
-
const version = "1.26.1
|
|
78573
|
+
const version = "1.26.1";
|
|
78537
78574
|
|
|
78538
78575
|
exports.Gantt = Gantt;
|
|
78539
78576
|
exports.TYPES = index$4;
|