@visactor/vtable-sheet 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.
@@ -444,5 +444,4 @@ class WorkSheet {
444
444
  }
445
445
  }
446
446
 
447
- exports.WorkSheet = WorkSheet;
448
- //# sourceMappingURL=WorkSheet.js.map
447
+ exports.WorkSheet = WorkSheet;
@@ -264,4 +264,5 @@ function createFormulaDetectionOptions(sheetDefine, options, vtableSheet) {
264
264
  };
265
265
  }
266
266
 
267
- exports.getTablePlugins = getTablePlugins, exports.createFormulaDetectionOptions = createFormulaDetectionOptions;
267
+ exports.getTablePlugins = getTablePlugins, exports.createFormulaDetectionOptions = createFormulaDetectionOptions;
268
+ //# sourceMappingURL=table-plugins.js.map
@@ -142,4 +142,5 @@ class CellHighlightManager {
142
142
  }
143
143
  }
144
144
 
145
- exports.CellHighlightManager = CellHighlightManager;
145
+ exports.CellHighlightManager = CellHighlightManager;
146
+ //# sourceMappingURL=cell-highlight-manager.js.map
@@ -74,5 +74,4 @@ Object.defineProperty(exports, "CrossSheetFormulaHandler", {
74
74
  get: function() {
75
75
  return cross_sheet_formula_handler_1.CrossSheetFormulaHandler;
76
76
  }
77
- });
78
- //# sourceMappingURL=index.js.map
77
+ });
package/cjs/index.d.ts CHANGED
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
2
2
  import type { ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions } from './ts-types';
3
3
  import * as TYPES from './ts-types';
4
4
  import * as VTable from './vtable';
5
- export declare const version = "1.25.1-alpha.1";
5
+ export declare const version = "1.26.0";
6
6
  export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions };
package/cjs/index.js CHANGED
@@ -47,4 +47,4 @@ exports.VTable = VTable;
47
47
 
48
48
  const style_manager_1 = require("./styles/style-manager");
49
49
 
50
- exports.version = "1.25.1-alpha.1", (0, style_manager_1.importStyles)();
50
+ exports.version = "1.26.0", (0, style_manager_1.importStyles)();
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.25.1-alpha.1\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions };\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.26.0\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions };\n"]}
@@ -45599,15 +45599,17 @@
45599
45599
  } else if ("sparkline" === type) {
45600
45600
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
45601
45601
  } else if ("checkbox" === type) {
45602
- const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
45603
- isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
45604
- if (isAggregation && isSeriesNumber) {
45602
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45605
45603
  cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45606
45604
  } else {
45607
45605
  cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
45608
45606
  }
45609
45607
  } else if ("radio" === type) {
45610
- cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45608
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45609
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45610
+ } else {
45611
+ cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45612
+ }
45611
45613
  } else if ("switch" === type) {
45612
45614
  cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
45613
45615
  } else if ("button" === type) {
@@ -54788,6 +54790,7 @@
54788
54790
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
54789
54791
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
54790
54792
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
54793
+ if (col >= 0 && row >= 0 && isCellDisableSelect(table, col, row)) return void scenegraph.updateNextFrame();
54791
54794
  let extendSelectRange = !isValid$2(skipBodyMerge) || !skipBodyMerge;
54792
54795
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
54793
54796
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
@@ -55983,8 +55986,11 @@
55983
55986
  updateOptionSetState() {
55984
55987
  this._updateOptionSetState(), this.setHoverState(), this.setSelectState(), this.setFrozenState();
55985
55988
  }
55989
+ endResizeIfResizing() {
55990
+ 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);
55991
+ }
55986
55992
  _updateOptionSetState() {
55987
- this.interactionState = InteractionState.default, this.hoverIcon = {
55993
+ this.endResizeIfResizing(), this.interactionState = InteractionState.default, this.hoverIcon = {
55988
55994
  col: -1,
55989
55995
  row: -1,
55990
55996
  icon: null
@@ -57113,6 +57119,7 @@
57113
57119
  }
57114
57120
 
57115
57121
  function bindTableGroupListener(eventManager) {
57122
+ var _a, _b, _c;
57116
57123
  const table = eventManager.table,
57117
57124
  stateManager = table.stateManager,
57118
57125
  getEventArgsSet = e => getCellEventArgsSetWithTable(e, table);
@@ -57229,7 +57236,13 @@
57229
57236
  event: e.nativeEvent
57230
57237
  });
57231
57238
  }), table.scenegraph.tableGroup.addEventListener("pointerleave", e => {
57232
- 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, {
57239
+ var _a, _b, _c;
57240
+ stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor());
57241
+ const scrollStyle = table.theme.scrollStyle,
57242
+ horizontalVisible = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _a ? _a : null == scrollStyle ? void 0 : scrollStyle.visible,
57243
+ verticalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
57244
+ barToSide = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _c && _c;
57245
+ 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, {
57233
57246
  col: table.stateManager.hover.cellPos.col,
57234
57247
  row: table.stateManager.hover.cellPos.row,
57235
57248
  cellRange: table.getCellRangeRelativeRect({
@@ -57458,7 +57471,29 @@
57458
57471
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
57459
57472
  (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);
57460
57473
  }
57461
- }), table.scenegraph.stage.addEventListener("pointermove", e => {
57474
+ });
57475
+ const scrollStyle = table.theme.scrollStyle,
57476
+ barToSide = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _a && _a,
57477
+ horizontalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
57478
+ verticalVisible = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _c ? _c : null == scrollStyle ? void 0 : scrollStyle.visible,
57479
+ shouldShowScrollOnCanvasHover = barToSide && "focus" === horizontalVisible,
57480
+ shouldShowVScrollOnCanvasHover = barToSide && "focus" === verticalVisible;
57481
+ (shouldShowScrollOnCanvasHover || shouldShowVScrollOnCanvasHover) && (table.scenegraph.stage.addEventListener("pointerenter", e => {
57482
+ var _a, _b, _c;
57483
+ const target = e.target;
57484
+ if (target === table.scenegraph.stage || (null === (_a = null == target ? void 0 : target.isDescendantsOf) || void 0 === _a ? void 0 : _a.call(target, table.scenegraph.stage))) {
57485
+ if (shouldShowScrollOnCanvasHover) {
57486
+ const relativeX = e.x - table.tableX,
57487
+ 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";
57488
+ stateManager.showHorizontalScrollBar(!1, target);
57489
+ }
57490
+ shouldShowVScrollOnCanvasHover && stateManager.showVerticalScrollBar();
57491
+ }
57492
+ }), table.scenegraph.stage.addEventListener("pointerleave", e => {
57493
+ var _a;
57494
+ const relatedTarget = e.relatedTarget;
57495
+ (!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());
57496
+ })), table.scenegraph.stage.addEventListener("pointermove", e => {
57462
57497
  var _a, _b, _c;
57463
57498
  const eventArgsSet = getCellEventArgsSetWithTable(e, table);
57464
57499
  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());
@@ -58017,7 +58052,10 @@
58017
58052
  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);
58018
58053
  const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX),
58019
58054
  targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
58020
- !(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$2(targetCol) && isValid$2(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);
58055
+ if (!(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$2(targetCol) && isValid$2(targetRow)) {
58056
+ if (isCellDisableSelect(table, targetCol.col, targetRow.row)) return;
58057
+ 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);
58058
+ }
58021
58059
  });
58022
58060
  } else table.eventManager.inertiaScroll.isInertiaScrolling() ? table.eventManager.inertiaScroll.endInertia() : table.eventManager.scrollYSpeed = 0;
58023
58061
  }
@@ -60093,6 +60131,7 @@
60093
60131
  switch (headerType) {
60094
60132
  case "text":
60095
60133
  case "link":
60134
+ default:
60096
60135
  return TextHeaderStyle;
60097
60136
  case "image":
60098
60137
  case "video":
@@ -61139,7 +61178,7 @@
61139
61178
  }
61140
61179
  constructor(container, options = {}) {
61141
61180
  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;
61142
- 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) {
61181
+ 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) {
61143
61182
  const g = window;
61144
61183
  g[this.id] = this;
61145
61184
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -62544,9 +62583,13 @@
62544
62583
  }
62545
62584
  getCellType(col, row) {
62546
62585
  let cellType;
62547
- 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", {
62586
+ if (this.isSeriesNumberInHeader(col, row)) {
62587
+ const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
62588
+ return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
62589
+ }
62590
+ return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
62548
62591
  cellType: cellType
62549
- }, col, row, this));
62592
+ }, col, row, this);
62550
62593
  }
62551
62594
  getHeaderField(col, row) {
62552
62595
  return this.internalProps.layoutMap.getHeaderField(col, row);
@@ -66542,7 +66585,7 @@
66542
66585
  setRecords(records, option) {
66543
66586
  var _a, _b, _c, _d, _e;
66544
66587
  let sort;
66545
- 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);
66588
+ 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);
66546
66589
  "undefined" != typeof window && window.performance.now();
66547
66590
  const oldHoverState = {
66548
66591
  col: this.stateManager.hover.cellPos.col,
@@ -95729,7 +95772,7 @@
95729
95772
  importStyle();
95730
95773
  }
95731
95774
 
95732
- const version = "1.25.1-alpha.1";
95775
+ const version = "1.26.0";
95733
95776
  importStyles();
95734
95777
 
95735
95778
  exports.TYPES = index;