@visactor/vtable-gantt 1.17.3-alpha.14 → 1.17.3-alpha.15

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 CHANGED
@@ -5,5 +5,5 @@ import { Gantt } from './Gantt';
5
5
  import * as tools from './tools';
6
6
  import * as VRender from './vrender';
7
7
  import * as VTable from './vtable';
8
- export declare const version = "1.17.3-alpha.14";
8
+ export declare const version = "1.17.3-alpha.15";
9
9
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable };
package/cjs/index.js CHANGED
@@ -52,5 +52,5 @@ exports.VRender = VRender;
52
52
 
53
53
  const VTable = __importStar(require("./vtable"));
54
54
 
55
- exports.VTable = VTable, exports.version = "1.17.3-alpha.14";
55
+ exports.VTable = VTable, exports.version = "1.17.3-alpha.15";
56
56
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,iBAAiB,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';\nexport const version = \"1.17.3-alpha.14\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,iBAAiB,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';\nexport const version = \"1.17.3-alpha.15\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable\n};\n"]}
@@ -48970,15 +48970,15 @@
48970
48970
  handler.on(table.getElement(), "blur", e => {
48971
48971
  eventManager.dealTableHover();
48972
48972
  }), handler.on(table.getElement(), "keydown", e => {
48973
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
48973
+ 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, _1, _2;
48974
48974
  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)) {
48975
48975
  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) || !1 === (null === (_e = table.options.keyboardOptions) || void 0 === _e ? void 0 : _e.moveSelectedCellOnArrowKeys)) return;
48976
48976
  let targetCol, targetRow;
48977
48977
  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;
48978
- table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_g = null === (_f = table.options.keyboardOptions) || void 0 === _f ? void 0 : _f.moveEditCellOnArrowKeys) && void 0 !== _g && _g && (null === (_h = table.editorManager) || void 0 === _h ? void 0 : _h.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
48979
- } else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
48980
- if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
48981
- if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (_l = table.options.keyboardOptions) || void 0 === _l ? void 0 : _l.moveFocusCellOnEnter)) {
48978
+ table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_g = null === (_f = table.options.keyboardOptions) || void 0 === _f ? void 0 : _f.moveEditCellOnArrowKeys) && void 0 !== _g && _g && (null === (_h = table.editorManager) || void 0 === _h ? void 0 : _h.editingEditor) && (null === (_j = table.editorManager) || void 0 === _j || _j.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && (null === (_k = table.editorManager) || void 0 === _k || _k.startEditCell(targetCol, targetRow)));
48979
+ } else if ("Escape" === e.key) null === (_l = table.editorManager) || void 0 === _l || _l.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
48980
+ if (null === (_m = table.editorManager) || void 0 === _m ? void 0 : _m.editingEditor) {
48981
+ if (handleKeydownListener(e), null === (_o = table.editorManager) || void 0 === _o || _o.completeEdit(), table.getElement().focus(), !0 === (null === (_p = table.options.keyboardOptions) || void 0 === _p ? void 0 : _p.moveFocusCellOnEnter)) {
48982
48982
  const targetCol = stateManager.select.cellPos.col,
48983
48983
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
48984
48984
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
@@ -48986,30 +48986,30 @@
48986
48986
  }
48987
48987
  return;
48988
48988
  }
48989
- if (!0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
48989
+ if (!0 === (null === (_q = table.options.keyboardOptions) || void 0 === _q ? void 0 : _q.moveFocusCellOnEnter)) {
48990
48990
  const targetCol = stateManager.select.cellPos.col,
48991
48991
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
48992
48992
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
48993
48993
  table.selectCell(targetCol, targetRow, e.shiftKey);
48994
- } else if ((null === (_p = null === (_o = table.options.keyboardOptions) || void 0 === _o ? void 0 : _o.editCellOnEnter) || void 0 === _p || _p) && 1 === (null !== (_r = null === (_q = table.stateManager.select.ranges) || void 0 === _q ? void 0 : _q.length) && void 0 !== _r ? _r : 0)) {
48994
+ } else if ((null === (_s = null === (_r = table.options.keyboardOptions) || void 0 === _r ? void 0 : _r.editCellOnEnter) || void 0 === _s || _s) && 1 === (null !== (_u = null === (_t = table.stateManager.select.ranges) || void 0 === _t ? void 0 : _t.length) && void 0 !== _u ? _u : 0)) {
48995
48995
  const startCol = table.stateManager.select.ranges[0].start.col,
48996
48996
  startRow = table.stateManager.select.ranges[0].start.row,
48997
48997
  endCol = table.stateManager.select.ranges[0].end.col,
48998
48998
  endRow = table.stateManager.select.ranges[0].end.row;
48999
- startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && table.editorManager.startEditCell(startCol, startRow);
48999
+ startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_v = table.editorManager) || void 0 === _v || _v.startEditCell(startCol, startRow));
49000
49000
  }
49001
49001
  } else if ("Tab" === e.key) {
49002
- if ((null === (_t = null === (_s = table.options.keyboardOptions) || void 0 === _s ? void 0 : _s.moveFocusCellOnTab) || void 0 === _t || _t) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
49002
+ if ((null === (_x = null === (_w = table.options.keyboardOptions) || void 0 === _w ? void 0 : _w.moveFocusCellOnTab) || void 0 === _x || _x) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
49003
49003
  if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
49004
49004
  let targetCol, targetRow;
49005
49005
  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;
49006
- table.selectCell(targetCol, targetRow), (null === (_u = table.editorManager) || void 0 === _u ? void 0 : _u.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
49006
+ table.selectCell(targetCol, targetRow), (null === (_y = table.editorManager) || void 0 === _y ? void 0 : _y.editingEditor) && (null === (_z = table.editorManager) || void 0 === _z || _z.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && (null === (_0 = table.editorManager) || void 0 === _0 || _0.startEditCell(targetCol, targetRow)));
49007
49007
  }
49008
49008
  } else if (!(e.ctrlKey || e.metaKey || e.shiftKey)) {
49009
49009
  const editCellTrigger = table.options.editCellTrigger;
49010
- if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_v = table.editorManager) || void 0 === _v ? void 0 : _v.editingEditor)) {
49010
+ if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_1 = table.editorManager) || void 0 === _1 ? void 0 : _1.editingEditor)) {
49011
49011
  const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
49012
- e.key.match(allowedKeys) && table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, "");
49012
+ e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (_2 = table.editorManager) || void 0 === _2 || _2.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
49013
49013
  }
49014
49014
  }
49015
49015
  handleKeydownListener(e);
@@ -49187,7 +49187,9 @@
49187
49187
  callback: globalPointerdownCallback
49188
49188
  }), document.body.addEventListener("pointerdown", globalPointerdownCallback);
49189
49189
  const globalPointerupCallback = e => {
49190
- if (e.target !== table.canvas && (e => {
49190
+ var _a, _b;
49191
+ const target = e.target;
49192
+ if (target !== table.canvas && (e => {
49191
49193
  var _a, _b;
49192
49194
  if (stateManager.menu.isShow && setTimeout(() => {
49193
49195
  table.internalProps.menuHandler.pointInMenuElement(e.clientX, e.clientY) || stateManager.menu.isShow && stateManager.hideMenu();
@@ -49212,6 +49214,11 @@
49212
49214
  })(e), table.eventManager.LastBodyPointerXY = null, table.eventManager.isDown = !1, table.eventManager.isDraging = !1, table.eventManager.inertiaScroll.endInertia(), "grabing" === stateManager.interactionState && stateManager.isResizeCol()) endResizeCol(table);else if ("grabing" === stateManager.interactionState && stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
49213
49215
  const endMoveColSuccess = table.stateManager.endMoveCol();
49214
49216
  fireMoveColEventListeners(table, endMoveColSuccess, e);
49217
+ } else if ((null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor) && !table.getElement().contains(target)) {
49218
+ const isCompleteEdit = null === (_b = table.editorManager) || void 0 === _b ? void 0 : _b.completeEdit(e);
49219
+ getPromiseValue(isCompleteEdit, isCompleteEdit => {
49220
+ !1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
49221
+ });
49215
49222
  }
49216
49223
  };
49217
49224
  eventManager.globalEventListeners.push({
@@ -52350,7 +52357,7 @@
52350
52357
  constructor(container) {
52351
52358
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52352
52359
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
52353
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.14", 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");
52360
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.15", 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");
52354
52361
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
52355
52362
  const {
52356
52363
  frozenColCount = 0,
@@ -65382,7 +65389,7 @@
65382
65389
  themes: themes$1
65383
65390
  });
65384
65391
 
65385
- const version = "1.17.3-alpha.14";
65392
+ const version = "1.17.3-alpha.15";
65386
65393
 
65387
65394
  exports.Gantt = Gantt;
65388
65395
  exports.TYPES = index$3;