@visactor/vtable-gantt 1.18.5-alpha.0 → 1.18.5

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.
@@ -72,5 +72,4 @@ class DataSource {
72
72
  }
73
73
  }
74
74
 
75
- exports.DataSource = DataSource;
76
- //# sourceMappingURL=DataSource.js.map
75
+ exports.DataSource = DataSource;
@@ -83,4 +83,5 @@ function isTouchEvent(e) {
83
83
  return !!e.changedTouches;
84
84
  }
85
85
 
86
+ //# sourceMappingURL=touch.js.map
86
87
  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.18.5-alpha.0";
9
+ export declare const version = "1.18.5";
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.18.5-alpha.0";
59
+ exports.plugins = plugins, exports.version = "1.18.5";
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.18.5-alpha.0\";\n/**\n * @namespace VTable\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.18.5\";\n/**\n * @namespace VTable\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"]}
@@ -34339,7 +34339,7 @@
34339
34339
  var _a, _b, _c;
34340
34340
  this.lastFilterRules = this.dataConfig.filterRules, this.dataConfig.filterRules = filterRules, this._source = this.processRecords(null !== (_b = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSourceObj), this._sourceLength = (null === (_c = this._source) || void 0 === _c ? void 0 : _c.length) || 0, this.sortedIndexMap.clear(), this.currentIndexedData = Array.from({
34341
34341
  length: this._sourceLength
34342
- }, (_, i) => i), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength);
34342
+ }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength);
34343
34343
  }
34344
34344
  updateFilterRules(filterRules) {
34345
34345
  var _a, _b, _c;
@@ -47970,7 +47970,7 @@
47970
47970
 
47971
47971
  function handleWhell(event, state) {
47972
47972
  let isWheelEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
47973
- var _a;
47973
+ var _a, _b, _c;
47974
47974
  let {
47975
47975
  deltaX: deltaX,
47976
47976
  deltaY: deltaY
@@ -47980,7 +47980,9 @@
47980
47980
  horizontal: 1,
47981
47981
  vertical: 1
47982
47982
  });
47983
- (optimizedDeltaX || optimizedDeltaY) && state.interactionState !== InteractionState.scrolling && state.updateInteractionState(InteractionState.scrolling), optimizedDeltaX && (state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event), state.showHorizontalScrollBar(!0)), optimizedDeltaY && (state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event), state.showVerticalScrollBar(!0)), isWheelEvent && state.resetInteractionState(state.interactionStateBeforeScroll), (null === (_a = event.nativeEvent) || void 0 === _a ? void 0 : _a.cancelable) && ("none" === state.table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, state) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, state)) && event.nativeEvent.preventDefault();
47983
+ (optimizedDeltaX || optimizedDeltaY) && state.interactionState !== InteractionState.scrolling && state.updateInteractionState(InteractionState.scrolling);
47984
+ const autoHide = "scrolling" === (null === (_b = null === (_a = state.table.options.theme) || void 0 === _a ? void 0 : _a.scrollStyle) || void 0 === _b ? void 0 : _b.visible);
47985
+ optimizedDeltaX && (state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event), state.showHorizontalScrollBar(autoHide)), optimizedDeltaY && (state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event), state.showVerticalScrollBar(autoHide)), isWheelEvent && state.resetInteractionState(state.interactionStateBeforeScroll), (null === (_c = event.nativeEvent) || void 0 === _c ? void 0 : _c.cancelable) && ("none" === state.table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, state) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, state)) && event.nativeEvent.preventDefault();
47984
47986
  }
47985
47987
  function optimizeScrollXY(x, y, ratio) {
47986
47988
  var _a, _b;
@@ -48281,7 +48283,7 @@
48281
48283
  });
48282
48284
  }
48283
48285
  setTimeout(() => {
48284
- eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
48286
+ eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
48285
48287
  }, 0);
48286
48288
  }
48287
48289
  }), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
@@ -49415,8 +49417,12 @@
49415
49417
  ranges = table.getSelectedCellRanges();
49416
49418
  let cellInRange = !1;
49417
49419
  if (ranges.length > 0) for (let i = 0; i < ranges.length; i++) {
49418
- const range = ranges[i];
49419
- if (col >= range.start.col && col <= range.end.col && row >= range.start.row && row <= range.end.row) {
49420
+ const range = ranges[i],
49421
+ startCol = range.start.col,
49422
+ endCol = range.end.col,
49423
+ startRow = range.start.row,
49424
+ endRow = range.end.row;
49425
+ if (col >= startCol && col <= endCol && row >= startRow && row <= endRow || col >= endCol && col <= startCol && row >= endRow && row <= startRow || col >= startCol && col <= endCol && row >= endRow && row <= startRow || col >= endCol && col <= startCol && row >= startRow && row <= endRow) {
49420
49426
  cellInRange = !0;
49421
49427
  break;
49422
49428
  }
@@ -50129,22 +50135,28 @@
50129
50135
  element = null !== (_a = table.internalProps.menu.parentElement) && void 0 !== _a ? _a : table.getElement(),
50130
50136
  {
50131
50137
  width: containerWidth,
50138
+ height: containerHeight,
50132
50139
  left: containerLeft,
50133
50140
  top: containerTop
50134
50141
  } = element.getBoundingClientRect(),
50135
50142
  {
50136
50143
  x: rootLeft,
50137
50144
  y: rootTop,
50138
- width: rootWidth
50145
+ width: rootWidth,
50146
+ height: rootHeight
50139
50147
  } = rootElement.getBoundingClientRect();
50140
50148
  if (secondElement) {
50141
50149
  secondElement.parentElement !== element && element.appendChild(secondElement), secondElement.style.left = "0px";
50142
50150
  const maxWidth = .8 * containerWidth;
50143
50151
  secondElement.style.maxWidth = `${maxWidth}px`;
50144
50152
  const secondElementWidth = secondElement.clientWidth,
50145
- secondElementTop = y - 4 - containerTop,
50153
+ secondElementHeight = secondElement.clientHeight,
50146
50154
  secondElementLeft = x - containerLeft;
50147
- secondElement.style.top = `${secondElementTop}px`;
50155
+ let topStyle = y - 4 - containerTop;
50156
+ if (topStyle + secondElementHeight > containerHeight) {
50157
+ topStyle = topStyle - secondElementHeight + secondElement.firstElementChild.clientHeight + 4;
50158
+ }
50159
+ secondElement.style.top = `${topStyle}px`;
50148
50160
  let leftStyle = secondElementLeft;
50149
50161
  return leftStyle + secondElementWidth > containerWidth ? leftStyle = leftStyle - secondElementWidth - rootWidth : leftStyle += 4, secondElement.style.left = `${leftStyle}px`, !0;
50150
50162
  }
@@ -52270,7 +52282,7 @@
52270
52282
  constructor(container) {
52271
52283
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52272
52284
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
52273
- if (super(), this.showFrozenIcon = !0, this.version = "1.18.5-alpha.0", 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");
52285
+ if (super(), this.showFrozenIcon = !0, this.version = "1.18.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");
52274
52286
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
52275
52287
  options: options,
52276
52288
  container: container
@@ -54031,9 +54043,11 @@
54031
54043
  this.render();
54032
54044
  const stage = this.scenegraph.stage;
54033
54045
  if (stage) {
54034
- const contentWidth = this.tableX + this.getAllColsWidth(),
54046
+ let contentWidth = this.tableX + this.getAllColsWidth(),
54035
54047
  contentHeight = this.tableY + this.getAllRowsHeight();
54036
- if (contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
54048
+ if (this.internalProps.legends && this.internalProps.legends.forEach(legend => {
54049
+ "right" === legend.orient ? contentWidth = Math.max(contentWidth, legend.legendComponent.globalAABBBounds.x2) : "bottom" === legend.orient && (contentHeight = Math.max(contentHeight, legend.legendComponent.globalAABBBounds.y2));
54050
+ }), this.internalProps.title && ("right" === this.internalProps.title._titleOption.orient ? contentWidth = Math.max(contentWidth, this.internalProps.title.getComponentGraphic().globalAABBBounds.x2) : "bottom" === this.internalProps.title._titleOption.orient && (contentHeight = Math.max(contentHeight, this.internalProps.title.getComponentGraphic().globalAABBBounds.y2))), contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
54037
54051
  stage.render();
54038
54052
  return stage.window.getImageBuffer(type);
54039
54053
  }
@@ -55667,7 +55681,7 @@
55667
55681
  }, null !== (_b = this.columnHierarchyType) && void 0 !== _b ? _b : null, "grid-tree" === this.columnHierarchyType ? this.columnExpandLevel : void 0), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
55668
55682
  }
55669
55683
  handleRowSeriesNumber(rowSeriesNumber) {
55670
- var _a;
55684
+ var _a, _b;
55671
55685
  rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map((seriesNumber, index) => {
55672
55686
  var _a, _b;
55673
55687
  return {
@@ -55697,7 +55711,7 @@
55697
55711
  style: rowSeriesNumber.style,
55698
55712
  width: rowSeriesNumber.width,
55699
55713
  format: rowSeriesNumber.format,
55700
- field: rowSeriesNumber.field,
55714
+ field: null !== (_b = rowSeriesNumber.field) && void 0 !== _b ? _b : "_vtable_rowSeries_number",
55701
55715
  icon: rowSeriesNumber.icon,
55702
55716
  headerIcon: rowSeriesNumber.headerIcon,
55703
55717
  isChildNode: !1
@@ -68459,7 +68473,7 @@
68459
68473
  PluginManager: PluginManager
68460
68474
  });
68461
68475
 
68462
- const version = "1.18.5-alpha.0";
68476
+ const version = "1.18.5";
68463
68477
 
68464
68478
  exports.Gantt = Gantt;
68465
68479
  exports.TYPES = index$4;