@visactor/vtable-gantt 1.22.12-alpha.5 → 1.22.13-alpha.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.
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.22.12-alpha.5";
9
+ export declare const version = "1.22.13-alpha.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.22.12-alpha.5";
59
+ exports.plugins = plugins, exports.version = "1.22.13-alpha.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,iBAAiB,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.22.12-alpha.5\";\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,iBAAiB,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.22.13-alpha.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"]}
@@ -187,4 +187,5 @@ class TimelineHeader {
187
187
  }
188
188
  }
189
189
 
190
- exports.TimelineHeader = TimelineHeader;
190
+ exports.TimelineHeader = TimelineHeader;
191
+ //# sourceMappingURL=timeline-header.js.map
@@ -89,7 +89,6 @@ function _syncTableSize(gantt) {
89
89
  gantt._updateSize(), (0, gantt_helper_1.updateSplitLineAndResizeLine)(gantt), gantt.zoomScaleManager && gantt.zoomScaleManager.handleTableWidthChange());
90
90
  }
91
91
 
92
- //# sourceMappingURL=gantt-table-sync.js.map
93
92
  exports.syncScrollStateToTable = syncScrollStateToTable, exports.syncScrollStateFromTable = syncScrollStateFromTable,
94
93
  exports.syncEditCellFromTable = syncEditCellFromTable, exports.syncTreeChangeFromTable = syncTreeChangeFromTable,
95
94
  exports.syncSortFromTable = syncSortFromTable, exports.syncDragOrderFromTable = syncDragOrderFromTable,
@@ -21441,14 +21441,20 @@
21441
21441
  x: x,
21442
21442
  y: y
21443
21443
  } = this.stage.eventPointTransform(e);
21444
- let currentScrollValue,
21445
- currentPos,
21444
+ let currentPos,
21445
+ currentScrollValue = 0,
21446
21446
  delta = 0;
21447
21447
  const {
21448
- width: width,
21449
- height: height
21450
- } = this.getSliderRenderBounds();
21451
- return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
21448
+ width: width,
21449
+ height: height
21450
+ } = this.getSliderRenderBounds(),
21451
+ track = "vertical" === direction ? height : width,
21452
+ travel = Math.max(track - this._sliderSize, 0),
21453
+ {
21454
+ range: range
21455
+ } = this.attribute,
21456
+ ratio = clamp$1(range[1] - range[0], 0, 1);
21457
+ 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];
21452
21458
  }, this._onSliderPointerMove = e => {
21453
21459
  const {
21454
21460
  stopSliderMovePropagation = !0
@@ -21592,15 +21598,24 @@
21592
21598
  }
21593
21599
  _getSliderPos(range) {
21594
21600
  const {
21595
- direction: direction
21601
+ direction: direction,
21602
+ minSliderSize = 0
21596
21603
  } = this.attribute,
21597
21604
  {
21598
21605
  width: width,
21599
21606
  height: height,
21600
21607
  x1: x1,
21601
21608
  y1: y1
21602
- } = this.getSliderRenderBounds();
21603
- return "horizontal" === direction ? [width * range[0] + x1, width * range[1] + x1] : [height * range[0] + y1, height * range[1] + y1];
21609
+ } = this.getSliderRenderBounds(),
21610
+ track = "horizontal" === direction ? width : height,
21611
+ origin = "horizontal" === direction ? x1 : y1,
21612
+ start = clamp$1(range[0], 0, 1),
21613
+ end = clamp$1(range[1], 0, 1),
21614
+ ratio = clamp$1(end - start, 0, 1),
21615
+ L = Math.max(ratio * track, minSliderSize),
21616
+ T = Math.max(track - L, 0),
21617
+ pStart = origin + start / Math.max(1 - ratio, 1e-12) * T;
21618
+ return [pStart, pStart + L];
21604
21619
  }
21605
21620
  _getScrollRange() {
21606
21621
  if (this._sliderLimitRange) return this._sliderLimitRange;
@@ -21640,6 +21655,7 @@
21640
21655
  direction: "horizontal",
21641
21656
  round: !0,
21642
21657
  sliderSize: 20,
21658
+ minSliderSize: 0,
21643
21659
  sliderStyle: {
21644
21660
  fill: "rgba(0, 0, 0, .5)"
21645
21661
  },
@@ -48728,25 +48744,25 @@
48728
48744
  releaseRowChartInstance = !0,
48729
48745
  releaseAllChartInstance = !1
48730
48746
  } = {}) {
48731
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
48747
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48732
48748
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
48733
- !this.activeChartInstance || !forceRelease && getBrushingChartInstance(table.scenegraph) && getBrushingChartInstance(table.scenegraph) === this.activeChartInstance || (null === (_b = this.activeChartInstance) || void 0 === _b || _b.updateViewBox({
48749
+ !this.activeChartInstance || !forceRelease && getBrushingChartInstance(table.scenegraph) && getBrushingChartInstance(table.scenegraph) === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48734
48750
  x1: -1e3,
48735
48751
  x2: -800,
48736
48752
  y1: -1e3,
48737
48753
  y2: -800
48738
- }, !1, !1), null === (_c = this.activeChartInstance) || void 0 === _c || _c.release(), this.activeChartInstance = null);
48754
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48739
48755
  const {
48740
48756
  col: col,
48741
48757
  row: row
48742
48758
  } = this.parent;
48743
- 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));
48759
+ 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));
48744
48760
  } else {
48745
48761
  const {
48746
48762
  col: col,
48747
48763
  row: row
48748
48764
  } = this.parent;
48749
- 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));
48765
+ 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));
48750
48766
  }
48751
48767
  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));
48752
48768
  }
@@ -50155,7 +50171,7 @@
50155
50171
  dimensions = item.dimensions,
50156
50172
  width = item.width,
50157
50173
  cell = table.getCellAddressByHeaderPaths(dimensions);
50158
- cell && cell.col < table.rowHeaderLevelCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
50174
+ cell && cell.col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
50159
50175
  }
50160
50176
  }
50161
50177
 
@@ -60198,7 +60214,7 @@
60198
60214
  }
60199
60215
  constructor(container, options = {}) {
60200
60216
  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;
60201
- 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");
60217
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.13-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");
60202
60218
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60203
60219
  options: options,
60204
60220
  container: container
@@ -61406,36 +61422,34 @@
61406
61422
  }
61407
61423
  }]);
61408
61424
  }
61409
- startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
61410
- var _a, _b, _c, _d, _e, _f;
61425
+ startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode, makeSelectCellVisible) {
61426
+ var _a, _b;
61411
61427
  const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1],
61412
61428
  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,
61413
61429
  endCol = colIndex,
61414
61430
  endRow = this.rowCount - 1;
61415
- 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;
61431
+ 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;
61416
61432
  }
61417
- dragSelectCol(colIndex, enableCtrlSelectMode) {
61418
- var _a, _b;
61433
+ dragSelectCol(colIndex, enableCtrlSelectMode, makeSelectCellVisible) {
61419
61434
  const currentSelectRanges = this.stateManager.select.ranges,
61420
61435
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61421
- 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;
61436
+ lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
61422
61437
  }
61423
61438
  endDragSelect() {
61424
61439
  this.stateManager.updateInteractionState(InteractionState.default);
61425
61440
  }
61426
- startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
61427
- var _a, _b, _c, _d, _e, _f;
61441
+ startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift, makeSelectCellVisible) {
61442
+ var _a, _b;
61428
61443
  const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1],
61429
61444
  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,
61430
61445
  endCol = this.colCount - 1,
61431
61446
  endRow = rowIndex;
61432
- 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;
61447
+ 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;
61433
61448
  }
61434
- dragSelectRow(rowIndex, isCtrl) {
61435
- var _a, _b;
61449
+ dragSelectRow(rowIndex, isCtrl, makeSelectCellVisible) {
61436
61450
  const currentSelectRanges = this.stateManager.select.ranges,
61437
61451
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61438
- 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;
61452
+ lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
61439
61453
  }
61440
61454
  get recordsCount() {
61441
61455
  var _a;
@@ -65285,6 +65299,9 @@
65285
65299
  completeEditCell() {
65286
65300
  this.editorManager.completeEdit();
65287
65301
  }
65302
+ cancelEditCell() {
65303
+ this.editorManager.cancelEdit();
65304
+ }
65288
65305
  getEditor(col, row) {
65289
65306
  var _a, _b;
65290
65307
  const lastSelectedCellEditor = this.editorManager.cacheLastSelectedCellEditor[`${col}-${row}`];
@@ -76515,7 +76532,7 @@
76515
76532
  PluginManager: PluginManager
76516
76533
  });
76517
76534
 
76518
- const version = "1.22.12-alpha.5";
76535
+ const version = "1.22.13-alpha.0";
76519
76536
 
76520
76537
  exports.Gantt = Gantt;
76521
76538
  exports.TYPES = index$4;