@visactor/vtable-gantt 1.17.3-alpha.13 → 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.13";
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.13";
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.13\";\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"]}
@@ -42330,18 +42330,9 @@
42330
42330
  var _a;
42331
42331
  const vChart = chart.activeChartInstance;
42332
42332
  if (!vChart) return !1;
42333
- const matrix = chart.parent.globalTransMatrix.clone(),
42334
- stageMatrix = chart.stage.window.getViewBoxTransform();
42335
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
42336
- const nextP = {
42337
- x: 0,
42338
- y: 0
42339
- };
42340
- matrix.getInverse().transformPoint(point, nextP);
42341
42333
  const vchartStage = vChart.getStage();
42342
42334
  null === (_a = vchartStage.dirtyBounds) || void 0 === _a || _a.clear();
42343
- vchartStage.window.getViewBoxTransform().transformPoint(nextP, nextP);
42344
- const pick = vchartStage.pick(nextP.x, nextP.y);
42335
+ const pick = vchartStage.pick(point.x, point.y);
42345
42336
  return (null !== pick.graphic || "root" !== pick.group.name) && pick;
42346
42337
  }
42347
42338
  };
@@ -48979,15 +48970,15 @@
48979
48970
  handler.on(table.getElement(), "blur", e => {
48980
48971
  eventManager.dealTableHover();
48981
48972
  }), handler.on(table.getElement(), "keydown", e => {
48982
- 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;
48983
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)) {
48984
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;
48985
48976
  let targetCol, targetRow;
48986
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;
48987
- 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));
48988
- } else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
48989
- if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
48990
- 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)) {
48991
48982
  const targetCol = stateManager.select.cellPos.col,
48992
48983
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
48993
48984
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
@@ -48995,30 +48986,30 @@
48995
48986
  }
48996
48987
  return;
48997
48988
  }
48998
- 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)) {
48999
48990
  const targetCol = stateManager.select.cellPos.col,
49000
48991
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
49001
48992
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
49002
48993
  table.selectCell(targetCol, targetRow, e.shiftKey);
49003
- } 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)) {
49004
48995
  const startCol = table.stateManager.select.ranges[0].start.col,
49005
48996
  startRow = table.stateManager.select.ranges[0].start.row,
49006
48997
  endCol = table.stateManager.select.ranges[0].end.col,
49007
48998
  endRow = table.stateManager.select.ranges[0].end.row;
49008
- 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));
49009
49000
  }
49010
49001
  } else if ("Tab" === e.key) {
49011
- 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) {
49012
49003
  if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
49013
49004
  let targetCol, targetRow;
49014
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;
49015
- 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)));
49016
49007
  }
49017
49008
  } else if (!(e.ctrlKey || e.metaKey || e.shiftKey)) {
49018
49009
  const editCellTrigger = table.options.editCellTrigger;
49019
- 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)) {
49020
49011
  const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
49021
- 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, ""));
49022
49013
  }
49023
49014
  }
49024
49015
  handleKeydownListener(e);
@@ -49196,7 +49187,9 @@
49196
49187
  callback: globalPointerdownCallback
49197
49188
  }), document.body.addEventListener("pointerdown", globalPointerdownCallback);
49198
49189
  const globalPointerupCallback = e => {
49199
- if (e.target !== table.canvas && (e => {
49190
+ var _a, _b;
49191
+ const target = e.target;
49192
+ if (target !== table.canvas && (e => {
49200
49193
  var _a, _b;
49201
49194
  if (stateManager.menu.isShow && setTimeout(() => {
49202
49195
  table.internalProps.menuHandler.pointInMenuElement(e.clientX, e.clientY) || stateManager.menu.isShow && stateManager.hideMenu();
@@ -49221,6 +49214,11 @@
49221
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()) {
49222
49215
  const endMoveColSuccess = table.stateManager.endMoveCol();
49223
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
+ });
49224
49222
  }
49225
49223
  };
49226
49224
  eventManager.globalEventListeners.push({
@@ -52359,7 +52357,7 @@
52359
52357
  constructor(container) {
52360
52358
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52361
52359
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
52362
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.13", 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");
52363
52361
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
52364
52362
  const {
52365
52363
  frozenColCount = 0,
@@ -65391,7 +65389,7 @@
65391
65389
  themes: themes$1
65392
65390
  });
65393
65391
 
65394
- const version = "1.17.3-alpha.13";
65392
+ const version = "1.17.3-alpha.15";
65395
65393
 
65396
65394
  exports.Gantt = Gantt;
65397
65395
  exports.TYPES = index$3;