@visactor/vtable-calendar 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.
@@ -37609,18 +37609,9 @@
37609
37609
  var _a;
37610
37610
  const vChart = chart.activeChartInstance;
37611
37611
  if (!vChart) return !1;
37612
- const matrix = chart.parent.globalTransMatrix.clone(),
37613
- stageMatrix = chart.stage.window.getViewBoxTransform();
37614
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
37615
- const nextP = {
37616
- x: 0,
37617
- y: 0
37618
- };
37619
- matrix.getInverse().transformPoint(point, nextP);
37620
37612
  const vchartStage = vChart.getStage();
37621
37613
  null === (_a = vchartStage.dirtyBounds) || void 0 === _a || _a.clear();
37622
- vchartStage.window.getViewBoxTransform().transformPoint(nextP, nextP);
37623
- const pick = vchartStage.pick(nextP.x, nextP.y);
37614
+ const pick = vchartStage.pick(point.x, point.y);
37624
37615
  return (null !== pick.graphic || "root" !== pick.group.name) && pick;
37625
37616
  }
37626
37617
  };
@@ -44258,15 +44249,15 @@
44258
44249
  handler.on(table.getElement(), "blur", e => {
44259
44250
  eventManager.dealTableHover();
44260
44251
  }), handler.on(table.getElement(), "keydown", e => {
44261
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
44252
+ 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;
44262
44253
  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)) {
44263
44254
  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;
44264
44255
  let targetCol, targetRow;
44265
44256
  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;
44266
- 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));
44267
- } else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
44268
- if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
44269
- if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (_l = table.options.keyboardOptions) || void 0 === _l ? void 0 : _l.moveFocusCellOnEnter)) {
44257
+ 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)));
44258
+ } else if ("Escape" === e.key) null === (_l = table.editorManager) || void 0 === _l || _l.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
44259
+ if (null === (_m = table.editorManager) || void 0 === _m ? void 0 : _m.editingEditor) {
44260
+ 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)) {
44270
44261
  const targetCol = stateManager.select.cellPos.col,
44271
44262
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
44272
44263
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
@@ -44274,30 +44265,30 @@
44274
44265
  }
44275
44266
  return;
44276
44267
  }
44277
- if (!0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
44268
+ if (!0 === (null === (_q = table.options.keyboardOptions) || void 0 === _q ? void 0 : _q.moveFocusCellOnEnter)) {
44278
44269
  const targetCol = stateManager.select.cellPos.col,
44279
44270
  targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
44280
44271
  if (isCellDisableSelect(table, targetCol, targetRow)) return;
44281
44272
  table.selectCell(targetCol, targetRow, e.shiftKey);
44282
- } 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)) {
44273
+ } 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)) {
44283
44274
  const startCol = table.stateManager.select.ranges[0].start.col,
44284
44275
  startRow = table.stateManager.select.ranges[0].start.row,
44285
44276
  endCol = table.stateManager.select.ranges[0].end.col,
44286
44277
  endRow = table.stateManager.select.ranges[0].end.row;
44287
- startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && table.editorManager.startEditCell(startCol, startRow);
44278
+ startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_v = table.editorManager) || void 0 === _v || _v.startEditCell(startCol, startRow));
44288
44279
  }
44289
44280
  } else if ("Tab" === e.key) {
44290
- 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) {
44281
+ 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) {
44291
44282
  if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
44292
44283
  let targetCol, targetRow;
44293
44284
  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;
44294
- 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));
44285
+ 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)));
44295
44286
  }
44296
44287
  } else if (!(e.ctrlKey || e.metaKey || e.shiftKey)) {
44297
44288
  const editCellTrigger = table.options.editCellTrigger;
44298
- if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_v = table.editorManager) || void 0 === _v ? void 0 : _v.editingEditor)) {
44289
+ if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_1 = table.editorManager) || void 0 === _1 ? void 0 : _1.editingEditor)) {
44299
44290
  const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
44300
- e.key.match(allowedKeys) && table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, "");
44291
+ 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, ""));
44301
44292
  }
44302
44293
  }
44303
44294
  handleKeydownListener(e);
@@ -44475,7 +44466,9 @@
44475
44466
  callback: globalPointerdownCallback
44476
44467
  }), document.body.addEventListener("pointerdown", globalPointerdownCallback);
44477
44468
  const globalPointerupCallback = e => {
44478
- if (e.target !== table.canvas && (e => {
44469
+ var _a, _b;
44470
+ const target = e.target;
44471
+ if (target !== table.canvas && (e => {
44479
44472
  var _a, _b;
44480
44473
  if (stateManager.menu.isShow && setTimeout(() => {
44481
44474
  table.internalProps.menuHandler.pointInMenuElement(e.clientX, e.clientY) || stateManager.menu.isShow && stateManager.hideMenu();
@@ -44500,6 +44493,11 @@
44500
44493
  })(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()) {
44501
44494
  const endMoveColSuccess = table.stateManager.endMoveCol();
44502
44495
  fireMoveColEventListeners(table, endMoveColSuccess, e);
44496
+ } else if ((null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor) && !table.getElement().contains(target)) {
44497
+ const isCompleteEdit = null === (_b = table.editorManager) || void 0 === _b ? void 0 : _b.completeEdit(e);
44498
+ getPromiseValue(isCompleteEdit, isCompleteEdit => {
44499
+ !1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
44500
+ });
44503
44501
  }
44504
44502
  };
44505
44503
  eventManager.globalEventListeners.push({
@@ -47638,7 +47636,7 @@
47638
47636
  constructor(container) {
47639
47637
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47640
47638
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
47641
- 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");
47639
+ 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");
47642
47640
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
47643
47641
  const {
47644
47642
  frozenColCount = 0,