@visactor/vtable-calendar 1.18.4-alpha.1 → 1.18.4-alpha.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.
@@ -38283,9 +38283,9 @@
38283
38283
  y2: viewBox.y2 - viewBox.y1
38284
38284
  }, !1, !1);
38285
38285
  const chartStage = chartInstance.getStage(),
38286
- matrix = chart.globalTransMatrix,
38287
- stageMatrix = chart.stage.window.getViewBoxTransform().clone();
38288
- stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
38286
+ matrix = chart.globalTransMatrix.clone(),
38287
+ stageMatrix = chart.stage.window.getViewBoxTransform();
38288
+ matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
38289
38289
  const {
38290
38290
  table: table
38291
38291
  } = chart.getRootNode();
@@ -46032,7 +46032,7 @@
46032
46032
  handler.on(table.getElement(), "blur", e => {
46033
46033
  eventManager.dealTableHover();
46034
46034
  }), handler.on(table.getElement(), "keydown", e => {
46035
- 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, _3;
46035
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
46036
46036
  const beforeKeydownEvent = {
46037
46037
  keyCode: null !== (_a = e.keyCode) && void 0 !== _a ? _a : e.which,
46038
46038
  code: e.code,
@@ -46042,10 +46042,10 @@
46042
46042
  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;
46043
46043
  let targetCol, targetRow;
46044
46044
  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;
46045
- table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_h = null === (_g = table.options.keyboardOptions) || void 0 === _g ? void 0 : _g.moveEditCellOnArrowKeys) && void 0 !== _h && _h && (null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) && (null === (_k = table.editorManager) || void 0 === _k || _k.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && (null === (_l = table.editorManager) || void 0 === _l || _l.startEditCell(targetCol, targetRow)));
46046
- } else if ("Escape" === e.key) null === (_m = table.editorManager) || void 0 === _m || _m.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
46047
- if (null === (_o = table.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) {
46048
- if (handleKeydownListener(e), null === (_p = table.editorManager) || void 0 === _p || _p.completeEdit(), table.getElement().focus(), !0 === (null === (_q = table.options.keyboardOptions) || void 0 === _q ? void 0 : _q.moveFocusCellOnEnter)) {
46045
+ table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_h = null === (_g = table.options.keyboardOptions) || void 0 === _g ? void 0 : _g.moveEditCellOnArrowKeys) && void 0 !== _h && _h && (null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
46046
+ } else if ("Escape" === e.key) null === (_k = table.editorManager) || void 0 === _k || _k.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
46047
+ if (null === (_l = table.editorManager) || void 0 === _l ? void 0 : _l.editingEditor) {
46048
+ if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
46049
46049
  const targetCol = stateManager.select.cellPos.col,
46050
46050
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
46051
46051
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
@@ -46053,30 +46053,30 @@
46053
46053
  }
46054
46054
  return;
46055
46055
  }
46056
- if (!0 === (null === (_r = table.options.keyboardOptions) || void 0 === _r ? void 0 : _r.moveFocusCellOnEnter)) {
46056
+ if (!0 === (null === (_o = table.options.keyboardOptions) || void 0 === _o ? void 0 : _o.moveFocusCellOnEnter)) {
46057
46057
  const targetCol = stateManager.select.cellPos.col,
46058
46058
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
46059
46059
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
46060
46060
  table.selectCell(targetCol, targetRow, e.shiftKey);
46061
- } else if ((null === (_t = null === (_s = table.options.keyboardOptions) || void 0 === _s ? void 0 : _s.editCellOnEnter) || void 0 === _t || _t) && 1 === (null !== (_v = null === (_u = table.stateManager.select.ranges) || void 0 === _u ? void 0 : _u.length) && void 0 !== _v ? _v : 0)) {
46061
+ } else if ((null === (_q = null === (_p = table.options.keyboardOptions) || void 0 === _p ? void 0 : _p.editCellOnEnter) || void 0 === _q || _q) && 1 === (null !== (_s = null === (_r = table.stateManager.select.ranges) || void 0 === _r ? void 0 : _r.length) && void 0 !== _s ? _s : 0)) {
46062
46062
  const startCol = table.stateManager.select.ranges[0].start.col,
46063
46063
  startRow = table.stateManager.select.ranges[0].start.row,
46064
46064
  endCol = table.stateManager.select.ranges[0].end.col,
46065
46065
  endRow = table.stateManager.select.ranges[0].end.row;
46066
- startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_w = table.editorManager) || void 0 === _w || _w.startEditCell(startCol, startRow));
46066
+ startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && table.editorManager.startEditCell(startCol, startRow);
46067
46067
  }
46068
46068
  } else if ("Tab" === e.key) {
46069
- if ((null === (_y = null === (_x = table.options.keyboardOptions) || void 0 === _x ? void 0 : _x.moveFocusCellOnTab) || void 0 === _y || _y) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
46069
+ if ((null === (_u = null === (_t = table.options.keyboardOptions) || void 0 === _t ? void 0 : _t.moveFocusCellOnTab) || void 0 === _u || _u) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
46070
46070
  if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
46071
46071
  let targetCol, targetRow;
46072
46072
  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;
46073
- table.selectCell(targetCol, targetRow), (null === (_z = table.editorManager) || void 0 === _z ? void 0 : _z.editingEditor) && (null === (_0 = table.editorManager) || void 0 === _0 || _0.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && (null === (_1 = table.editorManager) || void 0 === _1 || _1.startEditCell(targetCol, targetRow)));
46073
+ table.selectCell(targetCol, targetRow), (null === (_v = table.editorManager) || void 0 === _v ? void 0 : _v.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
46074
46074
  }
46075
46075
  } else if (!e.ctrlKey && !e.metaKey) {
46076
46076
  const editCellTrigger = table.options.editCellTrigger;
46077
- if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_2 = table.editorManager) || void 0 === _2 ? void 0 : _2.editingEditor)) {
46077
+ if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_w = table.editorManager) || void 0 === _w ? void 0 : _w.editingEditor)) {
46078
46078
  const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
46079
- e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (_3 = table.editorManager) || void 0 === _3 || _3.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
46079
+ e.key.match(allowedKeys) && (table.editorManager.beginTriggerEditCellMode = "keydown", table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
46080
46080
  }
46081
46081
  }
46082
46082
  handleKeydownListener(e);
@@ -46267,7 +46267,7 @@
46267
46267
  callback: globalPointerdownCallback
46268
46268
  }), vglobal.addEventListener("pointerdown", globalPointerdownCallback);
46269
46269
  const globalPointerupCallback = e => {
46270
- var _a, _b;
46270
+ var _a;
46271
46271
  if (table.isReleased) return;
46272
46272
  const target = e.target;
46273
46273
  if (target !== table.canvas && (e => {
@@ -46295,8 +46295,8 @@
46295
46295
  })(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()) {
46296
46296
  const endMoveColSuccess = table.stateManager.endMoveCol();
46297
46297
  fireMoveColEventListeners(table, endMoveColSuccess, e);
46298
- } else if ((null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor) && !table.getElement().contains(target)) {
46299
- const isCompleteEdit = null === (_b = table.editorManager) || void 0 === _b ? void 0 : _b.completeEdit(e);
46298
+ } else if (table.editorManager.editingEditor && !table.getElement().contains(target)) {
46299
+ const isCompleteEdit = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.completeEdit(e);
46300
46300
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
46301
46301
  !1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
46302
46302
  });
@@ -49575,7 +49575,7 @@
49575
49575
  constructor(container) {
49576
49576
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
49577
49577
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
49578
- if (super(), this.showFrozenIcon = !0, this.version = "1.18.4-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49578
+ if (super(), this.showFrozenIcon = !0, this.version = "1.18.4-alpha.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49579
49579
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
49580
49580
  options: options,
49581
49581
  container: container