@visactor/vtable-calendar 1.22.12-alpha.5 → 1.22.12

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.
@@ -21199,14 +21199,20 @@
21199
21199
  x: x,
21200
21200
  y: y
21201
21201
  } = this.stage.eventPointTransform(e);
21202
- let currentScrollValue,
21203
- currentPos,
21202
+ let currentPos,
21203
+ currentScrollValue = 0,
21204
21204
  delta = 0;
21205
21205
  const {
21206
- width: width,
21207
- height: height
21208
- } = this.getSliderRenderBounds();
21209
- return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
21206
+ width: width,
21207
+ height: height
21208
+ } = this.getSliderRenderBounds(),
21209
+ track = "vertical" === direction ? height : width,
21210
+ travel = Math.max(track - this._sliderSize, 0),
21211
+ {
21212
+ range: range
21213
+ } = this.attribute,
21214
+ ratio = clamp$1(range[1] - range[0], 0, 1);
21215
+ return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos) : (currentPos = x, delta = currentPos - this._prePos), currentScrollValue = travel > 0 && ratio < 1 ? delta / travel * (1 - ratio) : 0, [currentPos, currentScrollValue];
21210
21216
  }, this._onSliderPointerMove = e => {
21211
21217
  const {
21212
21218
  stopSliderMovePropagation = !0
@@ -21350,15 +21356,24 @@
21350
21356
  }
21351
21357
  _getSliderPos(range) {
21352
21358
  const {
21353
- direction: direction
21359
+ direction: direction,
21360
+ minSliderSize = 0
21354
21361
  } = this.attribute,
21355
21362
  {
21356
21363
  width: width,
21357
21364
  height: height,
21358
21365
  x1: x1,
21359
21366
  y1: y1
21360
- } = this.getSliderRenderBounds();
21361
- return "horizontal" === direction ? [width * range[0] + x1, width * range[1] + x1] : [height * range[0] + y1, height * range[1] + y1];
21367
+ } = this.getSliderRenderBounds(),
21368
+ track = "horizontal" === direction ? width : height,
21369
+ origin = "horizontal" === direction ? x1 : y1,
21370
+ start = clamp$1(range[0], 0, 1),
21371
+ end = clamp$1(range[1], 0, 1),
21372
+ ratio = clamp$1(end - start, 0, 1),
21373
+ L = Math.max(ratio * track, minSliderSize),
21374
+ T = Math.max(track - L, 0),
21375
+ pStart = origin + start / Math.max(1 - ratio, 1e-12) * T;
21376
+ return [pStart, pStart + L];
21362
21377
  }
21363
21378
  _getScrollRange() {
21364
21379
  if (this._sliderLimitRange) return this._sliderLimitRange;
@@ -21398,6 +21413,7 @@
21398
21413
  direction: "horizontal",
21399
21414
  round: !0,
21400
21415
  sliderSize: 20,
21416
+ minSliderSize: 0,
21401
21417
  sliderStyle: {
21402
21418
  fill: "rgba(0, 0, 0, .5)"
21403
21419
  },
@@ -44875,25 +44891,25 @@
44875
44891
  releaseRowChartInstance = !0,
44876
44892
  releaseAllChartInstance = !1
44877
44893
  } = {}) {
44878
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
44894
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44879
44895
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
44880
- !this.activeChartInstance || !forceRelease && getBrushingChartInstance(table.scenegraph) && getBrushingChartInstance(table.scenegraph) === this.activeChartInstance || (null === (_b = this.activeChartInstance) || void 0 === _b || _b.updateViewBox({
44896
+ !this.activeChartInstance || !forceRelease && getBrushingChartInstance(table.scenegraph) && getBrushingChartInstance(table.scenegraph) === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44881
44897
  x1: -1e3,
44882
44898
  x2: -800,
44883
44899
  y1: -1e3,
44884
44900
  y2: -800
44885
- }, !1, !1), null === (_c = this.activeChartInstance) || void 0 === _c || _c.release(), this.activeChartInstance = null);
44901
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
44886
44902
  const {
44887
44903
  col: col,
44888
44904
  row: row
44889
44905
  } = this.parent;
44890
- table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_e = null === (_d = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _d ? void 0 : _d.hideLabelHoverOnAxis) || void 0 === _e || _e.call(_d)), table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_g = null === (_f = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _f ? void 0 : _f.hideLabelHoverOnAxis) || void 0 === _g || _g.call(_f));
44906
+ table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_d = null === (_c = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _c ? void 0 : _c.hideLabelHoverOnAxis) || void 0 === _d || _d.call(_c)), table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_f = null === (_e = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _e ? void 0 : _e.hideLabelHoverOnAxis) || void 0 === _f || _f.call(_e));
44891
44907
  } else {
44892
44908
  const {
44893
44909
  col: col,
44894
44910
  row: row
44895
44911
  } = this.parent;
44896
- releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_j = null === (_h = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _h ? void 0 : _h.hideLabelHoverOnAxis) || void 0 === _j || _j.call(_h)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_l = null === (_k = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _k ? void 0 : _k.hideLabelHoverOnAxis) || void 0 === _l || _l.call(_k));
44912
+ releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_h = null === (_g = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _g ? void 0 : _g.hideLabelHoverOnAxis) || void 0 === _h || _h.call(_g)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_k = null === (_j = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _j ? void 0 : _j.hideLabelHoverOnAxis) || void 0 === _k || _k.call(_j));
44897
44913
  }
44898
44914
  releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
44899
44915
  }
@@ -46302,7 +46318,7 @@
46302
46318
  dimensions = item.dimensions,
46303
46319
  width = item.width,
46304
46320
  cell = table.getCellAddressByHeaderPaths(dimensions);
46305
- cell && cell.col < table.rowHeaderLevelCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
46321
+ cell && cell.col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
46306
46322
  }
46307
46323
  }
46308
46324
 
@@ -56345,7 +56361,7 @@
56345
56361
  }
56346
56362
  constructor(container, options = {}) {
56347
56363
  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;
56348
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.12-alpha.5", 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");
56364
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.12", 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");
56349
56365
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56350
56366
  options: options,
56351
56367
  container: container
@@ -57553,36 +57569,34 @@
57553
57569
  }
57554
57570
  }]);
57555
57571
  }
57556
- startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
57557
- var _a, _b, _c, _d, _e, _f;
57572
+ startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode, makeSelectCellVisible) {
57573
+ var _a, _b;
57558
57574
  const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1],
57559
57575
  startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex,
57560
57576
  endCol = colIndex,
57561
57577
  endRow = this.rowCount - 1;
57562
- this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
57578
+ this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
57563
57579
  }
57564
- dragSelectCol(colIndex, enableCtrlSelectMode) {
57565
- var _a, _b;
57580
+ dragSelectCol(colIndex, enableCtrlSelectMode, makeSelectCellVisible) {
57566
57581
  const currentSelectRanges = this.stateManager.select.ranges,
57567
57582
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
57568
- lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
57583
+ lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
57569
57584
  }
57570
57585
  endDragSelect() {
57571
57586
  this.stateManager.updateInteractionState(InteractionState.default);
57572
57587
  }
57573
- startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
57574
- var _a, _b, _c, _d, _e, _f;
57588
+ startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift, makeSelectCellVisible) {
57589
+ var _a, _b;
57575
57590
  const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1],
57576
57591
  startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex,
57577
57592
  endCol = this.colCount - 1,
57578
57593
  endRow = rowIndex;
57579
- this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
57594
+ this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
57580
57595
  }
57581
- dragSelectRow(rowIndex, isCtrl) {
57582
- var _a, _b;
57596
+ dragSelectRow(rowIndex, isCtrl, makeSelectCellVisible) {
57583
57597
  const currentSelectRanges = this.stateManager.select.ranges,
57584
57598
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
57585
- lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
57599
+ lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
57586
57600
  }
57587
57601
  get recordsCount() {
57588
57602
  var _a;
@@ -61396,6 +61410,9 @@
61396
61410
  completeEditCell() {
61397
61411
  this.editorManager.completeEdit();
61398
61412
  }
61413
+ cancelEditCell() {
61414
+ this.editorManager.cancelEdit();
61415
+ }
61399
61416
  getEditor(col, row) {
61400
61417
  var _a, _b;
61401
61418
  const lastSelectedCellEditor = this.editorManager.cacheLastSelectedCellEditor[`${col}-${row}`];