@visactor/vtable-calendar 1.25.1-alpha.1 → 1.26.0

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.
@@ -41490,15 +41490,17 @@
41490
41490
  } else if ("sparkline" === type) {
41491
41491
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
41492
41492
  } else if ("checkbox" === type) {
41493
- const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
41494
- isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
41495
- if (isAggregation && isSeriesNumber) {
41493
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
41496
41494
  cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
41497
41495
  } else {
41498
41496
  cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
41499
41497
  }
41500
41498
  } else if ("radio" === type) {
41501
- cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
41499
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
41500
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
41501
+ } else {
41502
+ cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
41503
+ }
41502
41504
  } else if ("switch" === type) {
41503
41505
  cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
41504
41506
  } else if ("button" === type) {
@@ -50679,6 +50681,7 @@
50679
50681
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
50680
50682
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
50681
50683
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
50684
+ if (col >= 0 && row >= 0 && isCellDisableSelect(table, col, row)) return void scenegraph.updateNextFrame();
50682
50685
  let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
50683
50686
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
50684
50687
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
@@ -51874,8 +51877,11 @@
51874
51877
  updateOptionSetState() {
51875
51878
  this._updateOptionSetState(), this.setHoverState(), this.setSelectState(), this.setFrozenState();
51876
51879
  }
51880
+ endResizeIfResizing() {
51881
+ this.columnResize.resizing && (this.table.scenegraph.component.hideResizeCol(), this.columnResize.resizing = !1), this.rowResize.resizing && (this.table.scenegraph.component.hideResizeRow(), this.rowResize.resizing = !1), this.interactionState === InteractionState.grabing && (this.interactionState = InteractionState.default);
51882
+ }
51877
51883
  _updateOptionSetState() {
51878
- this.interactionState = InteractionState.default, this.hoverIcon = {
51884
+ this.endResizeIfResizing(), this.interactionState = InteractionState.default, this.hoverIcon = {
51879
51885
  col: -1,
51880
51886
  row: -1,
51881
51887
  icon: null
@@ -53004,6 +53010,7 @@
53004
53010
  }
53005
53011
 
53006
53012
  function bindTableGroupListener(eventManager) {
53013
+ var _a, _b, _c;
53007
53014
  const table = eventManager.table,
53008
53015
  stateManager = table.stateManager,
53009
53016
  getEventArgsSet = e => getCellEventArgsSetWithTable(e, table);
@@ -53120,7 +53127,13 @@
53120
53127
  event: e.nativeEvent
53121
53128
  });
53122
53129
  }), table.scenegraph.tableGroup.addEventListener("pointerleave", e => {
53123
- stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor()), (table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.horizontalVisible || !table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideHorizontalScrollBar(), (table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.verticalVisible || !table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideVerticalScrollBar(), table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && -1 !== table.stateManager.hover.cellPos.col && -1 !== table.stateManager.hover.cellPos.row && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
53130
+ var _a, _b, _c;
53131
+ stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor());
53132
+ const scrollStyle = table.theme.scrollStyle,
53133
+ horizontalVisible = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _a ? _a : null == scrollStyle ? void 0 : scrollStyle.visible,
53134
+ verticalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
53135
+ barToSide = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _c && _c;
53136
+ barToSide || "focus" !== horizontalVisible || stateManager.hideHorizontalScrollBar(), barToSide || "focus" !== verticalVisible || stateManager.hideVerticalScrollBar(), table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && -1 !== table.stateManager.hover.cellPos.col && -1 !== table.stateManager.hover.cellPos.row && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
53124
53137
  col: table.stateManager.hover.cellPos.col,
53125
53138
  row: table.stateManager.hover.cellPos.row,
53126
53139
  cellRange: table.getCellRangeRelativeRect({
@@ -53349,7 +53362,29 @@
53349
53362
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
53350
53363
  (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
53351
53364
  }
53352
- }), table.scenegraph.stage.addEventListener("pointermove", e => {
53365
+ });
53366
+ const scrollStyle = table.theme.scrollStyle,
53367
+ barToSide = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _a && _a,
53368
+ horizontalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
53369
+ verticalVisible = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _c ? _c : null == scrollStyle ? void 0 : scrollStyle.visible,
53370
+ shouldShowScrollOnCanvasHover = barToSide && "focus" === horizontalVisible,
53371
+ shouldShowVScrollOnCanvasHover = barToSide && "focus" === verticalVisible;
53372
+ (shouldShowScrollOnCanvasHover || shouldShowVScrollOnCanvasHover) && (table.scenegraph.stage.addEventListener("pointerenter", e => {
53373
+ var _a, _b, _c;
53374
+ const target = e.target;
53375
+ if (target === table.scenegraph.stage || (null === (_a = null == target ? void 0 : target.isDescendantsOf) || void 0 === _a ? void 0 : _a.call(target, table.scenegraph.stage))) {
53376
+ if (shouldShowScrollOnCanvasHover) {
53377
+ const relativeX = e.x - table.tableX,
53378
+ target = table.options.scrollFrozenCols && (null === (_b = table.getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(table)) > 0 && relativeX >= 0 && relativeX < table.getFrozenColsWidth() ? "frozen" : table.options.scrollRightFrozenCols && (null === (_c = table.getRightFrozenColsOffset) || void 0 === _c ? void 0 : _c.call(table)) > 0 && relativeX > table.tableNoFrameWidth - table.getRightFrozenColsWidth() ? "rightFrozen" : "body";
53379
+ stateManager.showHorizontalScrollBar(!1, target);
53380
+ }
53381
+ shouldShowVScrollOnCanvasHover && stateManager.showVerticalScrollBar();
53382
+ }
53383
+ }), table.scenegraph.stage.addEventListener("pointerleave", e => {
53384
+ var _a;
53385
+ const relatedTarget = e.relatedTarget;
53386
+ (!relatedTarget || relatedTarget !== table.scenegraph.stage && !(null === (_a = relatedTarget.isDescendantsOf) || void 0 === _a ? void 0 : _a.call(relatedTarget, table.scenegraph.stage))) && (shouldShowScrollOnCanvasHover && stateManager.hideHorizontalScrollBar(), shouldShowVScrollOnCanvasHover && stateManager.hideVerticalScrollBar());
53387
+ })), table.scenegraph.stage.addEventListener("pointermove", e => {
53353
53388
  var _a, _b, _c;
53354
53389
  const eventArgsSet = getCellEventArgsSetWithTable(e, table);
53355
53390
  null !== (_c = null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.isDescendantsOf) || void 0 === _b ? void 0 : _b.call(_a, table.scenegraph.tableGroup)) && void 0 !== _c && _c && (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("col-resize") : stateManager.isResizeRow() || eventManager.checkRowResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("row-resize") : stateManager.isMoveCol() || stateManager.updateCursor());
@@ -53908,7 +53943,10 @@
53908
53943
  right || left || (x > table.tableNoFrameWidth - table.getRightFrozenColsWidth() && x < table.tableNoFrameWidth || x > 0 && x < table.getFrozenColsWidth() ? (selectX = x, considerFrozenX = !0) : selectX = table.scrollLeft + frozenOffset + x), bottom || top || (y > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() && y < table.tableNoFrameHeight || y > 0 && y < table.getFrozenRowsHeight() ? (selectY = y, considerFrozenY = !0) : selectY = table.scrollTop + y), table.stateManager.updateInteractionState(InteractionState.grabing);
53909
53944
  const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX),
53910
53945
  targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
53911
- !(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$1(targetCol) && isValid$1(targetRow) && table.stateManager.updateSelectPos("row" === table.stateManager.select.selectInline ? table.colCount - 1 : targetCol.col, "col" === table.stateManager.select.selectInline ? table.rowCount - 1 : targetRow.row, !1, !1, !1, !1);
53946
+ if (!(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$1(targetCol) && isValid$1(targetRow)) {
53947
+ if (isCellDisableSelect(table, targetCol.col, targetRow.row)) return;
53948
+ table.stateManager.updateSelectPos("row" === table.stateManager.select.selectInline ? table.colCount - 1 : targetCol.col, "col" === table.stateManager.select.selectInline ? table.rowCount - 1 : targetRow.row, !1, !1, !1, !1);
53949
+ }
53912
53950
  });
53913
53951
  } else table.eventManager.inertiaScroll.isInertiaScrolling() ? table.eventManager.inertiaScroll.endInertia() : table.eventManager.scrollYSpeed = 0;
53914
53952
  }
@@ -55984,6 +56022,7 @@
55984
56022
  switch (headerType) {
55985
56023
  case "text":
55986
56024
  case "link":
56025
+ default:
55987
56026
  return TextHeaderStyle;
55988
56027
  case "image":
55989
56028
  case "video":
@@ -57030,7 +57069,7 @@
57030
57069
  }
57031
57070
  constructor(container, options = {}) {
57032
57071
  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;
57033
- if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.25.1-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
57072
+ if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
57034
57073
  const g = window;
57035
57074
  g[this.id] = this;
57036
57075
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -58435,9 +58474,13 @@
58435
58474
  }
58436
58475
  getCellType(col, row) {
58437
58476
  let cellType;
58438
- return this.isSeriesNumberInHeader(col, row) ? this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType : (cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
58477
+ if (this.isSeriesNumberInHeader(col, row)) {
58478
+ const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
58479
+ return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
58480
+ }
58481
+ return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
58439
58482
  cellType: cellType
58440
- }, col, row, this));
58483
+ }, col, row, this);
58441
58484
  }
58442
58485
  getHeaderField(col, row) {
58443
58486
  return this.internalProps.layoutMap.getHeaderField(col, row);
@@ -62397,7 +62440,7 @@
62397
62440
  setRecords(records, option) {
62398
62441
  var _a, _b, _c, _d, _e;
62399
62442
  let sort;
62400
- clearChartRenderQueue(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(), this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter(item => !item.dataSourceObj), this.internalProps.dataSource = null, Array.isArray(option) || (null == option ? void 0 : option.order) ? sort = option : option ? sort = option.sortState : null === option && (sort = null);
62443
+ this.stateManager.endResizeIfResizing(), clearChartRenderQueue(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(), this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter(item => !item.dataSourceObj), this.internalProps.dataSource = null, Array.isArray(option) || (null == option ? void 0 : option.order) ? sort = option : option ? sort = option.sortState : null === option && (sort = null);
62401
62444
  "undefined" != typeof window && window.performance.now();
62402
62445
  const oldHoverState = {
62403
62446
  col: this.stateManager.hover.cellPos.col,