@visactor/vtable-gantt 1.20.1-alpha.0 → 1.20.1-alpha.1

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.20.1-alpha.0";
9
+ export declare const version = "1.20.1-alpha.1";
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.20.1-alpha.0";
59
+ exports.plugins = plugins, exports.version = "1.20.1-alpha.1";
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.20.1-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"]}
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.20.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"]}
@@ -57334,7 +57334,7 @@
57334
57334
  }
57335
57335
 
57336
57336
  function getAxisConfigInPivotChart(col, row, layout) {
57337
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
57337
+ var _a, _b, _c, _d, _e, _f, _g;
57338
57338
  if (layout._table.isPivotChart()) if (layout.indicatorsAsCol) {
57339
57339
  if (layout.hasTwoIndicatorAxes && row === layout.columnHeaderLevelCount - 1 && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) {
57340
57340
  const axisRange = getRange("top", col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 1, layout);
@@ -57373,10 +57373,7 @@
57373
57373
  const info = layout.getIndicatorInfo(key);
57374
57374
  info && (indicatorInfo = info);
57375
57375
  });
57376
- const axisRange = getRange("bottom", col, row - 1, col, row, col, row, 0, layout),
57377
- {
57378
- chartType: chartType
57379
- } = getAxisOption(col, row - 1, "bottom", layout);
57376
+ const axisRange = getRange("bottom", col, row - 1, col, row, col, row, 0, layout);
57380
57377
  if (!axisRange) return;
57381
57378
  const chartCellStyle = layout._table._getCellStyle(col, row - 1),
57382
57379
  padding = getQuadProps(getProp("padding", chartCellStyle, col, row - 1, layout._table)),
@@ -57389,21 +57386,12 @@
57389
57386
  targetRange: targetRange,
57390
57387
  theme: theme
57391
57388
  } = axisRange;
57392
- isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1));
57393
- let domain = [];
57394
- if ("heatmap" === chartType) {
57395
- const colDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.rowCount - layout.bottomFrozenRowCount - 1, "xField"),
57396
- data = null !== (_a = layout.dataset.collectedValues[colDimensionKey]) && void 0 !== _a ? _a : [],
57397
- colPath = layout.getColKeysPath(col, row);
57398
- domain = null !== (_b = null == data ? void 0 : data[null != colPath ? colPath : ""]) && void 0 !== _b ? _b : [];
57399
- }
57400
- return merge$1({
57389
+ return isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1)), merge$1({
57401
57390
  title: {
57402
57391
  visible: !0,
57403
57392
  text: null == indicatorInfo ? void 0 : indicatorInfo.title
57404
57393
  },
57405
- range: range,
57406
- domain: "linear" === (null == axisOption ? void 0 : axisOption.type) ? void 0 : Array.from(domain)
57394
+ range: range
57407
57395
  }, axisOption, {
57408
57396
  orient: "bottom",
57409
57397
  type: (null == axisOption ? void 0 : axisOption.type) || "linear",
@@ -57421,9 +57409,9 @@
57421
57409
  if (col === layout.rowHeaderLevelCount - 1 && row >= layout.columnHeaderLevelCount && row < layout.rowCount - layout.bottomFrozenRowCount) {
57422
57410
  let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row);
57423
57411
  isArray$7(rowDimensionKey) && (rowDimensionKey = rowDimensionKey[0]);
57424
- const data = null !== (_c = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _c ? _c : [],
57412
+ const data = null !== (_a = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _a ? _a : [],
57425
57413
  rowPath = layout.getRowKeysPath(col, row),
57426
- domain = null !== (_d = data[null != rowPath ? rowPath : ""]) && void 0 !== _d ? _d : [],
57414
+ domain = null !== (_b = data[null != rowPath ? rowPath : ""]) && void 0 !== _b ? _b : [],
57427
57415
  {
57428
57416
  axisOption: axisOption,
57429
57417
  theme: theme,
@@ -57441,9 +57429,9 @@
57441
57429
  }
57442
57430
  }, axisOption, {
57443
57431
  orient: "left",
57444
- type: null !== (_e = null == axisOption ? void 0 : axisOption.type) && void 0 !== _e ? _e : "band",
57432
+ type: null !== (_c = null == axisOption ? void 0 : axisOption.type) && void 0 !== _c ? _c : "band",
57445
57433
  __vtableChartTheme: theme,
57446
- inverse: transformInverse(axisOption, "horizontal" === (null !== (_f = null == spec ? void 0 : spec.direction) && void 0 !== _f ? _f : "scatter" === chartType ? "vertical" : "horizontal")),
57434
+ inverse: transformInverse(axisOption, "horizontal" === (null !== (_d = null == spec ? void 0 : spec.direction) && void 0 !== _d ? _d : "scatter" === chartType ? "vertical" : "horizontal")),
57447
57435
  __vtablePadding: padding
57448
57436
  });
57449
57437
  }
@@ -57455,10 +57443,7 @@
57455
57443
  const info = layout.getIndicatorInfo(key);
57456
57444
  info && (indicatorInfo = info);
57457
57445
  });
57458
- const axisRange = getRange("left", col + 1, row, col, row, col, row, 0, layout),
57459
- {
57460
- chartType: chartType
57461
- } = getAxisOption(col + 1, row, "left", layout);
57446
+ const axisRange = getRange("left", col + 1, row, col, row, col, row, 0, layout);
57462
57447
  if (!axisRange) return;
57463
57448
  const chartCellStyle = layout._table._getCellStyle(col + 1, row),
57464
57449
  padding = getQuadProps(getProp("padding", chartCellStyle, col + 1, row, layout._table)),
@@ -57471,22 +57456,13 @@
57471
57456
  targetRange: targetRange,
57472
57457
  theme: theme
57473
57458
  } = axisRange;
57474
- isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1));
57475
- let domain = [];
57476
- if ("heatmap" === chartType) {
57477
- const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row, "yField"),
57478
- data = null !== (_g = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _g ? _g : [],
57479
- rowPath = layout.getRowKeysPath(col, row);
57480
- domain = null !== (_h = null == data ? void 0 : data[null != rowPath ? rowPath : ""]) && void 0 !== _h ? _h : [];
57481
- }
57482
- return merge$1({
57459
+ return isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1)), merge$1({
57483
57460
  title: {
57484
57461
  visible: !0,
57485
57462
  text: null == indicatorInfo ? void 0 : indicatorInfo.title,
57486
57463
  autoRotate: !0
57487
57464
  },
57488
- range: range,
57489
- domain: "linear" === (null == axisOption ? void 0 : axisOption.type) ? void 0 : Array.from(domain)
57465
+ range: range
57490
57466
  }, axisOption, {
57491
57467
  orient: "left",
57492
57468
  type: (null == axisOption ? void 0 : axisOption.type) || "linear",
@@ -57502,10 +57478,7 @@
57502
57478
  });
57503
57479
  }
57504
57480
  if (col === layout.colCount - layout.rightFrozenColCount && row >= layout.columnHeaderLevelCount && row < layout.rowCount - layout.bottomFrozenRowCount) {
57505
- const axisRange = getRange("right", col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout),
57506
- {
57507
- chartType: chartType
57508
- } = getAxisOption(col - 1, row, "right", layout);
57481
+ const axisRange = getRange("right", col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout);
57509
57482
  if (!axisRange) return;
57510
57483
  const chartCellStyle = layout._table._getCellStyle(col - 1, row),
57511
57484
  padding = getQuadProps(getProp("padding", chartCellStyle, col - 1, row, layout._table)),
@@ -57518,20 +57491,11 @@
57518
57491
  targetRange: targetRange,
57519
57492
  theme: theme
57520
57493
  } = axisRange;
57521
- isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1));
57522
- let domain = [];
57523
- if ("heatmap" === chartType) {
57524
- const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.colCount - layout.rightFrozenColCount - 1, row, "yField"),
57525
- data = null !== (_j = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _j ? _j : [],
57526
- rowPath = layout.getRowKeysPath(col, row);
57527
- domain = null !== (_k = null == data ? void 0 : data[null != rowPath ? rowPath : ""]) && void 0 !== _k ? _k : [];
57528
- }
57529
- return merge$1({
57494
+ return isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1)), merge$1({
57530
57495
  range: range,
57531
57496
  title: {
57532
57497
  autoRotate: !0
57533
- },
57534
- domain: "linear" === (null == axisOption ? void 0 : axisOption.type) ? void 0 : Array.from(domain)
57498
+ }
57535
57499
  }, axisOption, {
57536
57500
  orient: "right",
57537
57501
  type: (null == axisOption ? void 0 : axisOption.type) || "linear",
@@ -57549,9 +57513,9 @@
57549
57513
  if (row === layout.rowCount - layout.bottomFrozenRowCount && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) {
57550
57514
  let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount);
57551
57515
  isArray$7(columnDimensionKey) && (columnDimensionKey = columnDimensionKey[0]);
57552
- const data = null !== (_l = layout.dataset.collectedValues[columnDimensionKey]) && void 0 !== _l ? _l : [],
57516
+ const data = null !== (_e = layout.dataset.collectedValues[columnDimensionKey]) && void 0 !== _e ? _e : [],
57553
57517
  colPath = layout.getColKeysPath(col, row),
57554
- domain = null !== (_m = null == data ? void 0 : data[null != colPath ? colPath : ""]) && void 0 !== _m ? _m : [],
57518
+ domain = null !== (_f = null == data ? void 0 : data[null != colPath ? colPath : ""]) && void 0 !== _f ? _f : [],
57555
57519
  {
57556
57520
  axisOption: axisOption,
57557
57521
  isPercent: isPercent,
@@ -57566,7 +57530,7 @@
57566
57530
  range: "linear" === (null == axisOption ? void 0 : axisOption.type) ? domain : void 0
57567
57531
  }, axisOption, {
57568
57532
  orient: "bottom",
57569
- type: null !== (_o = null == axisOption ? void 0 : axisOption.type) && void 0 !== _o ? _o : "band",
57533
+ type: null !== (_g = null == axisOption ? void 0 : axisOption.type) && void 0 !== _g ? _g : "band",
57570
57534
  __vtableChartTheme: theme,
57571
57535
  __vtablePadding: padding
57572
57536
  });
@@ -58073,7 +58037,7 @@
58073
58037
  }
58074
58038
  constructor(container, options = {}) {
58075
58039
  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;
58076
- if (super(), this.showFrozenIcon = !0, this.version = "1.20.1-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");
58040
+ if (super(), this.showFrozenIcon = !0, this.version = "1.20.1-alpha.1", 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");
58077
58041
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
58078
58042
  options: options,
58079
58043
  container: container
@@ -58155,8 +58119,8 @@
58155
58119
  if (internalProps.calcWidthContext = {
58156
58120
  _: internalProps,
58157
58121
  get full() {
58158
- var _a;
58159
- return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
58122
+ var _a, _b;
58123
+ return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
58160
58124
  }
58161
58125
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this), internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_s = options.allowFrozenColCount) && void 0 !== _s ? _s : 0, internalProps.limitMaxAutoWidth = null !== (_t = options.limitMaxAutoWidth) && void 0 !== _t ? _t : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, this.scenegraph = new Scenegraph$1(this), this.stateManager = new StateManager$1(this), this.eventManager = new EventManager$1(this), this.animationManager = new TableAnimationManager(this), options.legends) {
58162
58126
  internalProps.legends = [];
@@ -58450,12 +58414,13 @@
58450
58414
  var _a;
58451
58415
  if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
58452
58416
  this.internalProps.pixelRatio = pixelRatio;
58453
- const canvasWidth = this.canvasWidth;
58417
+ const that = this,
58418
+ canvasWidth = this.canvasWidth;
58454
58419
  this.internalProps.calcWidthContext = {
58455
58420
  _: this.internalProps,
58456
58421
  get full() {
58457
- var _a;
58458
- return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
58422
+ var _a, _b;
58423
+ return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
58459
58424
  }
58460
58425
  }, this.scenegraph.setPixelRatio(pixelRatio);
58461
58426
  }
@@ -74890,7 +74855,7 @@
74890
74855
  PluginManager: PluginManager
74891
74856
  });
74892
74857
 
74893
- const version = "1.20.1-alpha.0";
74858
+ const version = "1.20.1-alpha.1";
74894
74859
 
74895
74860
  exports.Gantt = Gantt;
74896
74861
  exports.TYPES = index$4;