@visactor/vtable-calendar 1.26.1-alpha.0 → 1.26.2-alpha.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/dist/vtable-calendar.js +74 -37
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +3 -3
package/dist/vtable-calendar.js
CHANGED
|
@@ -47021,7 +47021,7 @@
|
|
|
47021
47021
|
};
|
|
47022
47022
|
function dynamicSetX(x, screenLeft, isEnd, proxy) {
|
|
47023
47023
|
return __awaiter$7(this, void 0, void 0, function* () {
|
|
47024
|
-
if (!screenLeft) return;
|
|
47024
|
+
if (!screenLeft) return proxy.updateDeltaX(x), proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX), void proxy.table.scenegraph.updateNextFrame();
|
|
47025
47025
|
const screenLeftCol = screenLeft.col,
|
|
47026
47026
|
screenLeftX = screenLeft.left;
|
|
47027
47027
|
let deltaCol;
|
|
@@ -47197,7 +47197,7 @@
|
|
|
47197
47197
|
};
|
|
47198
47198
|
function dynamicSetY(y, screenTop, isEnd, proxy) {
|
|
47199
47199
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
47200
|
-
if (!screenTop) return;
|
|
47200
|
+
if (!screenTop) return proxy.updateDeltaY(y), proxy.updateBody(y - proxy.deltaY), void proxy.table.scenegraph.updateNextFrame();
|
|
47201
47201
|
const screenTopRow = screenTop.row,
|
|
47202
47202
|
screenTopY = screenTop.top;
|
|
47203
47203
|
let deltaRow;
|
|
@@ -47802,7 +47802,7 @@
|
|
|
47802
47802
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
47803
47803
|
const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + (this.rowEnd - this.rowStart + 1)) / 2,
|
|
47804
47804
|
yLimitBottom = this.table.getAllRowsHeight() - yLimitTop,
|
|
47805
|
-
screenTop = this.
|
|
47805
|
+
screenTop = this.resolveTargetRowInfo(y + this.table.scenegraph.colHeaderGroup.attribute.height);
|
|
47806
47806
|
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));
|
|
47807
47807
|
});
|
|
47808
47808
|
}
|
|
@@ -47811,7 +47811,7 @@
|
|
|
47811
47811
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
47812
47812
|
const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + (this.colEnd - this.colStart + 1)) / 2,
|
|
47813
47813
|
xLimitRight = this.table.getAllColsWidth() - xLimitLeft,
|
|
47814
|
-
screenLeft = this.
|
|
47814
|
+
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));
|
|
47815
47815
|
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);
|
|
47816
47816
|
});
|
|
47817
47817
|
}
|
|
@@ -47825,6 +47825,22 @@
|
|
|
47825
47825
|
dynamicSetX(x, screenLeft, isEnd, this);
|
|
47826
47826
|
});
|
|
47827
47827
|
}
|
|
47828
|
+
resolveTargetColInfo(absoluteX) {
|
|
47829
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
47830
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
47831
|
+
const screenLeft = this.table.getTargetColAt(absoluteX + offsets[i]);
|
|
47832
|
+
if (screenLeft) return screenLeft;
|
|
47833
|
+
}
|
|
47834
|
+
return null;
|
|
47835
|
+
}
|
|
47836
|
+
resolveTargetRowInfo(absoluteY) {
|
|
47837
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
47838
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
47839
|
+
const screenTop = this.table.getTargetRowAt(absoluteY + offsets[i]);
|
|
47840
|
+
if (screenTop) return screenTop;
|
|
47841
|
+
}
|
|
47842
|
+
return null;
|
|
47843
|
+
}
|
|
47828
47844
|
updateBody(y) {
|
|
47829
47845
|
this.table.scenegraph.setBodyAndRowHeaderY(-y);
|
|
47830
47846
|
}
|
|
@@ -50145,15 +50161,17 @@
|
|
|
50145
50161
|
this.table.scenegraph.proxy.setY(-y, isEnd);
|
|
50146
50162
|
}
|
|
50147
50163
|
setBodyAndRowHeaderY(y) {
|
|
50148
|
-
var _a, _b
|
|
50149
|
-
const
|
|
50150
|
-
|
|
50151
|
-
|
|
50164
|
+
var _a, _b;
|
|
50165
|
+
const firstBodyColGroup = this.bodyGroup.firstChild,
|
|
50166
|
+
firstRowHeaderColGroup = this.rowHeaderGroup.firstChild,
|
|
50167
|
+
firstBodyCell = null !== (_a = null == firstBodyColGroup ? void 0 : firstBodyColGroup.firstChild) && void 0 !== _a ? _a : null == firstRowHeaderColGroup ? void 0 : firstRowHeaderColGroup.firstChild;
|
|
50168
|
+
let lastBodyCell = null !== (_b = null == firstBodyColGroup ? void 0 : firstBodyColGroup.lastChild) && void 0 !== _b ? _b : null == firstRowHeaderColGroup ? void 0 : firstRowHeaderColGroup.lastChild;
|
|
50169
|
+
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());
|
|
50152
50170
|
}
|
|
50153
50171
|
setBodyAndColHeaderX(x) {
|
|
50154
|
-
const firstBodyCol = this.bodyGroup.firstChild
|
|
50155
|
-
|
|
50156
|
-
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());
|
|
50172
|
+
const firstBodyCol = this.bodyGroup.firstChild;
|
|
50173
|
+
let lastBodyCol = this.bodyGroup.lastChild;
|
|
50174
|
+
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());
|
|
50157
50175
|
}
|
|
50158
50176
|
afterScenegraphCreated() {
|
|
50159
50177
|
var _a, _b;
|
|
@@ -53590,6 +53608,7 @@
|
|
|
53590
53608
|
}
|
|
53591
53609
|
function dblclickHandler(e, table) {
|
|
53592
53610
|
var _a, _b, _c, _d, _e, _f;
|
|
53611
|
+
if ("number" == typeof e.button && 0 !== e.button) return;
|
|
53593
53612
|
const eventArgsSet = getCellEventArgsSetWithTable(e, table);
|
|
53594
53613
|
let col = -1,
|
|
53595
53614
|
row = -1;
|
|
@@ -53785,7 +53804,13 @@
|
|
|
53785
53804
|
function bindContainerDomListener(eventManager) {
|
|
53786
53805
|
const table = eventManager.table,
|
|
53787
53806
|
stateManager = table.stateManager,
|
|
53788
|
-
handler = table.internalProps.handler
|
|
53807
|
+
handler = table.internalProps.handler,
|
|
53808
|
+
afterCompleteEdit = (completeEditResult, onSuccess) => {
|
|
53809
|
+
getPromiseValue(completeEditResult, isCompleteEdit => {
|
|
53810
|
+
var _a, _b, _c, _d, _e;
|
|
53811
|
+
!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);
|
|
53812
|
+
});
|
|
53813
|
+
};
|
|
53789
53814
|
function handleKeydownListener(e) {
|
|
53790
53815
|
var _a;
|
|
53791
53816
|
if (table.hasListeners(TABLE_EVENT_TYPE.KEYDOWN)) {
|
|
@@ -53808,7 +53833,7 @@
|
|
|
53808
53833
|
}
|
|
53809
53834
|
eventManager.dealTableHover();
|
|
53810
53835
|
}), handler.on(table.getElement(), "keydown", e => {
|
|
53811
|
-
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
|
|
53836
|
+
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;
|
|
53812
53837
|
const beforeKeydownEvent = {
|
|
53813
53838
|
keyCode: null !== (_a = e.keyCode) && void 0 !== _a ? _a : e.which,
|
|
53814
53839
|
code: e.code,
|
|
@@ -53818,48 +53843,60 @@
|
|
|
53818
53843
|
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;
|
|
53819
53844
|
let targetCol, targetRow;
|
|
53820
53845
|
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;
|
|
53821
|
-
const isEditingCell = !!(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor)
|
|
53822
|
-
|
|
53823
|
-
|
|
53824
|
-
|
|
53825
|
-
|
|
53826
|
-
|
|
53827
|
-
|
|
53828
|
-
|
|
53829
|
-
|
|
53830
|
-
|
|
53831
|
-
|
|
53832
|
-
|
|
53833
|
-
|
|
53834
|
-
|
|
53846
|
+
const isEditingCell = !!(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor),
|
|
53847
|
+
completeEditResult = null === (_h = table.editorManager) || void 0 === _h ? void 0 : _h.completeEdit();
|
|
53848
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
53849
|
+
var _a, _b, _c, _d, _e;
|
|
53850
|
+
table.getElement().focus();
|
|
53851
|
+
const enableShiftSelectMode = null === (_b = null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.shiftMultiSelect) || void 0 === _b || _b;
|
|
53852
|
+
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));
|
|
53853
|
+
});
|
|
53854
|
+
} else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
|
|
53855
|
+
if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
|
|
53856
|
+
handleKeydownListener(e);
|
|
53857
|
+
const completeEditResult = null === (_l = table.editorManager) || void 0 === _l ? void 0 : _l.completeEdit();
|
|
53858
|
+
return void afterCompleteEdit(completeEditResult, () => {
|
|
53859
|
+
var _a, _b, _c;
|
|
53860
|
+
if (table.getElement().focus(), !0 === (null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.moveFocusCellOnEnter)) {
|
|
53861
|
+
const targetCol = stateManager.select.cellPos.col,
|
|
53862
|
+
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
53863
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
53864
|
+
const enableShiftSelectMode = null === (_c = null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.shiftMultiSelect) || void 0 === _c || _c;
|
|
53865
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
53866
|
+
}
|
|
53867
|
+
});
|
|
53835
53868
|
}
|
|
53836
|
-
if (!0 === (null === (
|
|
53869
|
+
if (!0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
|
|
53837
53870
|
const targetCol = stateManager.select.cellPos.col,
|
|
53838
53871
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
53839
53872
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
53840
|
-
const enableShiftSelectMode = null === (
|
|
53873
|
+
const enableShiftSelectMode = null === (_p = null === (_o = table.options.keyboardOptions) || void 0 === _o ? void 0 : _o.shiftMultiSelect) || void 0 === _p || _p;
|
|
53841
53874
|
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
53842
|
-
} else if ((null === (
|
|
53875
|
+
} 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)) {
|
|
53843
53876
|
const startCol = table.stateManager.select.ranges[0].start.col,
|
|
53844
53877
|
startRow = table.stateManager.select.ranges[0].start.row,
|
|
53845
53878
|
endCol = table.stateManager.select.ranges[0].end.col,
|
|
53846
53879
|
endRow = table.stateManager.select.ranges[0].end.row;
|
|
53847
|
-
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (
|
|
53880
|
+
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_u = table.editorManager) || void 0 === _u || _u.startEditCell(startCol, startRow));
|
|
53848
53881
|
}
|
|
53849
53882
|
} else if ("Tab" === e.key) {
|
|
53850
|
-
if ((null === (
|
|
53883
|
+
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) {
|
|
53851
53884
|
if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
|
|
53852
53885
|
let targetCol, targetRow;
|
|
53853
53886
|
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;
|
|
53854
|
-
const isEditingCell = !!(null === (
|
|
53855
|
-
|
|
53887
|
+
const isEditingCell = !!(null === (_x = table.editorManager) || void 0 === _x ? void 0 : _x.editingEditor),
|
|
53888
|
+
completeEditResult = null === (_y = table.editorManager) || void 0 === _y ? void 0 : _y.completeEdit();
|
|
53889
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
53890
|
+
var _a;
|
|
53891
|
+
table.getElement().focus(), table.selectCell(targetCol, targetRow), isEditingCell && table.getEditor(targetCol, targetRow) && (null === (_a = table.editorManager) || void 0 === _a || _a.startEditCell(targetCol, targetRow));
|
|
53892
|
+
});
|
|
53856
53893
|
}
|
|
53857
53894
|
} else if (!e.ctrlKey && !e.metaKey) {
|
|
53858
53895
|
const editCellTrigger = table.options.editCellTrigger,
|
|
53859
53896
|
selectedRanges = table.stateManager.select.ranges;
|
|
53860
|
-
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 === (
|
|
53897
|
+
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)) {
|
|
53861
53898
|
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
53862
|
-
e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (
|
|
53899
|
+
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, ""));
|
|
53863
53900
|
}
|
|
53864
53901
|
}
|
|
53865
53902
|
handleKeydownListener(e);
|
|
@@ -57121,7 +57158,7 @@
|
|
|
57121
57158
|
}
|
|
57122
57159
|
constructor(container, options = {}) {
|
|
57123
57160
|
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;
|
|
57124
|
-
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.
|
|
57161
|
+
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.2-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
|
|
57125
57162
|
const g = window;
|
|
57126
57163
|
g[this.id] = this;
|
|
57127
57164
|
const registry = g.__vtable__ || (g.__vtable__ = {
|