@visactor/vtable-gantt 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.
@@ -63,4 +63,5 @@ class EventTarget {
63
63
  }
64
64
  }
65
65
 
66
- exports.EventTarget = EventTarget;
66
+ exports.EventTarget = EventTarget;
67
+ //# sourceMappingURL=EventTarget.js.map
@@ -83,5 +83,4 @@ function isTouchEvent(e) {
83
83
  return !!e.changedTouches;
84
84
  }
85
85
 
86
- //# sourceMappingURL=touch.js.map
87
86
  exports.bindTouchListener = bindTouchListener;
package/cjs/index.d.ts CHANGED
@@ -6,5 +6,5 @@ import * as tools from './tools';
6
6
  import * as VRender from './vrender';
7
7
  import * as VTable from './vtable';
8
8
  import * as plugins from './plugins';
9
- export declare const version = "1.25.1-alpha.1";
9
+ export declare const version = "1.26.0";
10
10
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
package/cjs/index.js CHANGED
@@ -56,5 +56,5 @@ exports.VTable = VTable;
56
56
 
57
57
  const plugins = __importStar(require("./plugins"));
58
58
 
59
- exports.plugins = plugins, exports.version = "1.25.1-alpha.1";
59
+ exports.plugins = plugins, exports.version = "1.26.0";
60
60
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,gBAAgB,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.25.1-alpha.1\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.26.0\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
@@ -45407,15 +45407,17 @@
45407
45407
  } else if ("sparkline" === type) {
45408
45408
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
45409
45409
  } else if ("checkbox" === type) {
45410
- const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
45411
- isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
45412
- if (isAggregation && isSeriesNumber) {
45410
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45413
45411
  cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45414
45412
  } else {
45415
45413
  cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
45416
45414
  }
45417
45415
  } else if ("radio" === type) {
45418
- cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45416
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45417
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45418
+ } else {
45419
+ cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45420
+ }
45419
45421
  } else if ("switch" === type) {
45420
45422
  cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
45421
45423
  } else if ("button" === type) {
@@ -54596,6 +54598,7 @@
54596
54598
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
54597
54599
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
54598
54600
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
54601
+ if (col >= 0 && row >= 0 && isCellDisableSelect(table, col, row)) return void scenegraph.updateNextFrame();
54599
54602
  let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
54600
54603
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
54601
54604
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
@@ -55791,8 +55794,11 @@
55791
55794
  updateOptionSetState() {
55792
55795
  this._updateOptionSetState(), this.setHoverState(), this.setSelectState(), this.setFrozenState();
55793
55796
  }
55797
+ endResizeIfResizing() {
55798
+ 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);
55799
+ }
55794
55800
  _updateOptionSetState() {
55795
- this.interactionState = InteractionState.default, this.hoverIcon = {
55801
+ this.endResizeIfResizing(), this.interactionState = InteractionState.default, this.hoverIcon = {
55796
55802
  col: -1,
55797
55803
  row: -1,
55798
55804
  icon: null
@@ -56921,6 +56927,7 @@
56921
56927
  }
56922
56928
 
56923
56929
  function bindTableGroupListener$1(eventManager) {
56930
+ var _a, _b, _c;
56924
56931
  const table = eventManager.table,
56925
56932
  stateManager = table.stateManager,
56926
56933
  getEventArgsSet = e => getCellEventArgsSetWithTable(e, table);
@@ -57037,7 +57044,13 @@
57037
57044
  event: e.nativeEvent
57038
57045
  });
57039
57046
  }), table.scenegraph.tableGroup.addEventListener("pointerleave", e => {
57040
- 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, {
57047
+ var _a, _b, _c;
57048
+ stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor());
57049
+ const scrollStyle = table.theme.scrollStyle,
57050
+ horizontalVisible = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _a ? _a : null == scrollStyle ? void 0 : scrollStyle.visible,
57051
+ verticalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
57052
+ barToSide = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _c && _c;
57053
+ 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, {
57041
57054
  col: table.stateManager.hover.cellPos.col,
57042
57055
  row: table.stateManager.hover.cellPos.row,
57043
57056
  cellRange: table.getCellRangeRelativeRect({
@@ -57266,7 +57279,29 @@
57266
57279
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
57267
57280
  (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);
57268
57281
  }
57269
- }), table.scenegraph.stage.addEventListener("pointermove", e => {
57282
+ });
57283
+ const scrollStyle = table.theme.scrollStyle,
57284
+ barToSide = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _a && _a,
57285
+ horizontalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
57286
+ verticalVisible = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _c ? _c : null == scrollStyle ? void 0 : scrollStyle.visible,
57287
+ shouldShowScrollOnCanvasHover = barToSide && "focus" === horizontalVisible,
57288
+ shouldShowVScrollOnCanvasHover = barToSide && "focus" === verticalVisible;
57289
+ (shouldShowScrollOnCanvasHover || shouldShowVScrollOnCanvasHover) && (table.scenegraph.stage.addEventListener("pointerenter", e => {
57290
+ var _a, _b, _c;
57291
+ const target = e.target;
57292
+ if (target === table.scenegraph.stage || (null === (_a = null == target ? void 0 : target.isDescendantsOf) || void 0 === _a ? void 0 : _a.call(target, table.scenegraph.stage))) {
57293
+ if (shouldShowScrollOnCanvasHover) {
57294
+ const relativeX = e.x - table.tableX,
57295
+ 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";
57296
+ stateManager.showHorizontalScrollBar(!1, target);
57297
+ }
57298
+ shouldShowVScrollOnCanvasHover && stateManager.showVerticalScrollBar();
57299
+ }
57300
+ }), table.scenegraph.stage.addEventListener("pointerleave", e => {
57301
+ var _a;
57302
+ const relatedTarget = e.relatedTarget;
57303
+ (!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());
57304
+ })), table.scenegraph.stage.addEventListener("pointermove", e => {
57270
57305
  var _a, _b, _c;
57271
57306
  const eventArgsSet = getCellEventArgsSetWithTable(e, table);
57272
57307
  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());
@@ -57825,7 +57860,10 @@
57825
57860
  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);
57826
57861
  const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX),
57827
57862
  targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
57828
- !(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);
57863
+ if (!(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$1(targetCol) && isValid$1(targetRow)) {
57864
+ if (isCellDisableSelect(table, targetCol.col, targetRow.row)) return;
57865
+ 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);
57866
+ }
57829
57867
  });
57830
57868
  } else table.eventManager.inertiaScroll.isInertiaScrolling() ? table.eventManager.inertiaScroll.endInertia() : table.eventManager.scrollYSpeed = 0;
57831
57869
  }
@@ -59901,6 +59939,7 @@
59901
59939
  switch (headerType) {
59902
59940
  case "text":
59903
59941
  case "link":
59942
+ default:
59904
59943
  return TextHeaderStyle;
59905
59944
  case "image":
59906
59945
  case "video":
@@ -60947,7 +60986,7 @@
60947
60986
  }
60948
60987
  constructor(container, options = {}) {
60949
60988
  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;
60950
- 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) {
60989
+ 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) {
60951
60990
  const g = window;
60952
60991
  g[this.id] = this;
60953
60992
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -62352,9 +62391,13 @@
62352
62391
  }
62353
62392
  getCellType(col, row) {
62354
62393
  let cellType;
62355
- 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", {
62394
+ if (this.isSeriesNumberInHeader(col, row)) {
62395
+ const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
62396
+ return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
62397
+ }
62398
+ return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
62356
62399
  cellType: cellType
62357
- }, col, row, this));
62400
+ }, col, row, this);
62358
62401
  }
62359
62402
  getHeaderField(col, row) {
62360
62403
  return this.internalProps.layoutMap.getHeaderField(col, row);
@@ -66350,7 +66393,7 @@
66350
66393
  setRecords(records, option) {
66351
66394
  var _a, _b, _c, _d, _e;
66352
66395
  let sort;
66353
- 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);
66396
+ 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);
66354
66397
  "undefined" != typeof window && window.performance.now();
66355
66398
  const oldHoverState = {
66356
66399
  col: this.stateManager.hover.cellPos.col,
@@ -78438,7 +78481,7 @@
78438
78481
  PluginManager: PluginManager
78439
78482
  });
78440
78483
 
78441
- const version = "1.25.1-alpha.1";
78484
+ const version = "1.26.0";
78442
78485
 
78443
78486
  exports.Gantt = Gantt;
78444
78487
  exports.TYPES = index$4;