@visactor/vtable-sheet 1.20.0 → 1.20.1-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/README.md CHANGED
@@ -5,7 +5,7 @@ VTable Sheet is a powerful Excel-like spreadsheet component based on VTable. It
5
5
  ## Features
6
6
 
7
7
  - Multiple sheet support
8
- - Formula calculation using HyperFormula
8
+ - Formula calculation is a completely self-developed formula calculation engine
9
9
  - Cell formatting
10
10
  - Cell merging
11
11
  - Sheet operations (add, rename, delete)
@@ -76,7 +76,7 @@ interface IVTableSheetOptions {
76
76
 
77
77
  ## Working with Formulas
78
78
 
79
- VTableSheet supports Excel-like formulas powered by [HyperFormula](https://github.com/handsontable/hyperformula).
79
+ VTableSheet supports Excel-like formulas, which is a completely self-developed formula calculation engine.
80
80
 
81
81
  ### Formula Storage and Persistence
82
82
 
package/cjs/index.d.ts CHANGED
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
2
2
  import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
3
3
  import * as TYPES from './ts-types';
4
4
  import * as VTable from './vtable';
5
- export declare const version = "1.20.0";
5
+ export declare const version = "1.20.1-alpha.0";
6
6
  export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
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.20.0", (0, style_manager_1.importStyles)();
50
+ exports.version = "1.20.1-alpha.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,QAAQ,CAAC;AAEhC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.20.0\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\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,gBAAgB,CAAC;AAExC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.20.1-alpha.0\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
@@ -59248,7 +59248,7 @@
59248
59248
  }
59249
59249
 
59250
59250
  function getAxisConfigInPivotChart(col, row, layout) {
59251
- var _a, _b, _c, _d, _e, _f, _g;
59251
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
59252
59252
  if (layout._table.isPivotChart()) if (layout.indicatorsAsCol) {
59253
59253
  if (layout.hasTwoIndicatorAxes && row === layout.columnHeaderLevelCount - 1 && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) {
59254
59254
  const axisRange = getRange("top", col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 1, layout);
@@ -59287,7 +59287,10 @@
59287
59287
  const info = layout.getIndicatorInfo(key);
59288
59288
  info && (indicatorInfo = info);
59289
59289
  });
59290
- const axisRange = getRange("bottom", col, row - 1, col, row, col, row, 0, layout);
59290
+ const axisRange = getRange("bottom", col, row - 1, col, row, col, row, 0, layout),
59291
+ {
59292
+ chartType: chartType
59293
+ } = getAxisOption(col, row - 1, "bottom", layout);
59291
59294
  if (!axisRange) return;
59292
59295
  const chartCellStyle = layout._table._getCellStyle(col, row - 1),
59293
59296
  padding = getQuadProps(getProp("padding", chartCellStyle, col, row - 1, layout._table)),
@@ -59300,12 +59303,21 @@
59300
59303
  targetRange: targetRange,
59301
59304
  theme: theme
59302
59305
  } = axisRange;
59303
- 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({
59306
+ 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));
59307
+ let domain = [];
59308
+ if ("heatmap" === chartType) {
59309
+ const colDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.rowCount - layout.bottomFrozenRowCount - 1, "xField"),
59310
+ data = null !== (_a = layout.dataset.collectedValues[colDimensionKey]) && void 0 !== _a ? _a : [],
59311
+ colPath = layout.getColKeysPath(col, row);
59312
+ domain = null !== (_b = null == data ? void 0 : data[null != colPath ? colPath : ""]) && void 0 !== _b ? _b : [];
59313
+ }
59314
+ return merge$1({
59304
59315
  title: {
59305
59316
  visible: !0,
59306
59317
  text: null == indicatorInfo ? void 0 : indicatorInfo.title
59307
59318
  },
59308
- range: range
59319
+ range: range,
59320
+ domain: "linear" === (null == axisOption ? void 0 : axisOption.type) ? void 0 : Array.from(domain)
59309
59321
  }, axisOption, {
59310
59322
  orient: "bottom",
59311
59323
  type: (null == axisOption ? void 0 : axisOption.type) || "linear",
@@ -59323,9 +59335,9 @@
59323
59335
  if (col === layout.rowHeaderLevelCount - 1 && row >= layout.columnHeaderLevelCount && row < layout.rowCount - layout.bottomFrozenRowCount) {
59324
59336
  let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row);
59325
59337
  isArray$a(rowDimensionKey) && (rowDimensionKey = rowDimensionKey[0]);
59326
- const data = null !== (_a = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _a ? _a : [],
59338
+ const data = null !== (_c = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _c ? _c : [],
59327
59339
  rowPath = layout.getRowKeysPath(col, row),
59328
- domain = null !== (_b = data[null != rowPath ? rowPath : ""]) && void 0 !== _b ? _b : [],
59340
+ domain = null !== (_d = data[null != rowPath ? rowPath : ""]) && void 0 !== _d ? _d : [],
59329
59341
  {
59330
59342
  axisOption: axisOption,
59331
59343
  theme: theme,
@@ -59343,9 +59355,9 @@
59343
59355
  }
59344
59356
  }, axisOption, {
59345
59357
  orient: "left",
59346
- type: null !== (_c = null == axisOption ? void 0 : axisOption.type) && void 0 !== _c ? _c : "band",
59358
+ type: null !== (_e = null == axisOption ? void 0 : axisOption.type) && void 0 !== _e ? _e : "band",
59347
59359
  __vtableChartTheme: theme,
59348
- inverse: transformInverse(axisOption, "horizontal" === (null !== (_d = null == spec ? void 0 : spec.direction) && void 0 !== _d ? _d : "scatter" === chartType ? "vertical" : "horizontal")),
59360
+ inverse: transformInverse(axisOption, "horizontal" === (null !== (_f = null == spec ? void 0 : spec.direction) && void 0 !== _f ? _f : "scatter" === chartType ? "vertical" : "horizontal")),
59349
59361
  __vtablePadding: padding
59350
59362
  });
59351
59363
  }
@@ -59357,7 +59369,10 @@
59357
59369
  const info = layout.getIndicatorInfo(key);
59358
59370
  info && (indicatorInfo = info);
59359
59371
  });
59360
- const axisRange = getRange("left", col + 1, row, col, row, col, row, 0, layout);
59372
+ const axisRange = getRange("left", col + 1, row, col, row, col, row, 0, layout),
59373
+ {
59374
+ chartType: chartType
59375
+ } = getAxisOption(col + 1, row, "left", layout);
59361
59376
  if (!axisRange) return;
59362
59377
  const chartCellStyle = layout._table._getCellStyle(col + 1, row),
59363
59378
  padding = getQuadProps(getProp("padding", chartCellStyle, col + 1, row, layout._table)),
@@ -59370,13 +59385,22 @@
59370
59385
  targetRange: targetRange,
59371
59386
  theme: theme
59372
59387
  } = axisRange;
59373
- 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({
59388
+ 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));
59389
+ let domain = [];
59390
+ if ("heatmap" === chartType) {
59391
+ const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row, "yField"),
59392
+ data = null !== (_g = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _g ? _g : [],
59393
+ rowPath = layout.getRowKeysPath(col, row);
59394
+ domain = null !== (_h = null == data ? void 0 : data[null != rowPath ? rowPath : ""]) && void 0 !== _h ? _h : [];
59395
+ }
59396
+ return merge$1({
59374
59397
  title: {
59375
59398
  visible: !0,
59376
59399
  text: null == indicatorInfo ? void 0 : indicatorInfo.title,
59377
59400
  autoRotate: !0
59378
59401
  },
59379
- range: range
59402
+ range: range,
59403
+ domain: "linear" === (null == axisOption ? void 0 : axisOption.type) ? void 0 : Array.from(domain)
59380
59404
  }, axisOption, {
59381
59405
  orient: "left",
59382
59406
  type: (null == axisOption ? void 0 : axisOption.type) || "linear",
@@ -59392,7 +59416,10 @@
59392
59416
  });
59393
59417
  }
59394
59418
  if (col === layout.colCount - layout.rightFrozenColCount && row >= layout.columnHeaderLevelCount && row < layout.rowCount - layout.bottomFrozenRowCount) {
59395
- const axisRange = getRange("right", col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout);
59419
+ const axisRange = getRange("right", col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout),
59420
+ {
59421
+ chartType: chartType
59422
+ } = getAxisOption(col - 1, row, "right", layout);
59396
59423
  if (!axisRange) return;
59397
59424
  const chartCellStyle = layout._table._getCellStyle(col - 1, row),
59398
59425
  padding = getQuadProps(getProp("padding", chartCellStyle, col - 1, row, layout._table)),
@@ -59405,11 +59432,20 @@
59405
59432
  targetRange: targetRange,
59406
59433
  theme: theme
59407
59434
  } = axisRange;
59408
- 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({
59435
+ 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));
59436
+ let domain = [];
59437
+ if ("heatmap" === chartType) {
59438
+ const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.colCount - layout.rightFrozenColCount - 1, row, "yField"),
59439
+ data = null !== (_j = layout.dataset.collectedValues[rowDimensionKey]) && void 0 !== _j ? _j : [],
59440
+ rowPath = layout.getRowKeysPath(col, row);
59441
+ domain = null !== (_k = null == data ? void 0 : data[null != rowPath ? rowPath : ""]) && void 0 !== _k ? _k : [];
59442
+ }
59443
+ return merge$1({
59409
59444
  range: range,
59410
59445
  title: {
59411
59446
  autoRotate: !0
59412
- }
59447
+ },
59448
+ domain: "linear" === (null == axisOption ? void 0 : axisOption.type) ? void 0 : Array.from(domain)
59413
59449
  }, axisOption, {
59414
59450
  orient: "right",
59415
59451
  type: (null == axisOption ? void 0 : axisOption.type) || "linear",
@@ -59427,9 +59463,9 @@
59427
59463
  if (row === layout.rowCount - layout.bottomFrozenRowCount && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) {
59428
59464
  let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount);
59429
59465
  isArray$a(columnDimensionKey) && (columnDimensionKey = columnDimensionKey[0]);
59430
- const data = null !== (_e = layout.dataset.collectedValues[columnDimensionKey]) && void 0 !== _e ? _e : [],
59466
+ const data = null !== (_l = layout.dataset.collectedValues[columnDimensionKey]) && void 0 !== _l ? _l : [],
59431
59467
  colPath = layout.getColKeysPath(col, row),
59432
- domain = null !== (_f = null == data ? void 0 : data[null != colPath ? colPath : ""]) && void 0 !== _f ? _f : [],
59468
+ domain = null !== (_m = null == data ? void 0 : data[null != colPath ? colPath : ""]) && void 0 !== _m ? _m : [],
59433
59469
  {
59434
59470
  axisOption: axisOption,
59435
59471
  isPercent: isPercent,
@@ -59444,7 +59480,7 @@
59444
59480
  range: "linear" === (null == axisOption ? void 0 : axisOption.type) ? domain : void 0
59445
59481
  }, axisOption, {
59446
59482
  orient: "bottom",
59447
- type: null !== (_g = null == axisOption ? void 0 : axisOption.type) && void 0 !== _g ? _g : "band",
59483
+ type: null !== (_o = null == axisOption ? void 0 : axisOption.type) && void 0 !== _o ? _o : "band",
59448
59484
  __vtableChartTheme: theme,
59449
59485
  __vtablePadding: padding
59450
59486
  });
@@ -59951,7 +59987,7 @@
59951
59987
  }
59952
59988
  constructor(container, options = {}) {
59953
59989
  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;
59954
- if (super(), this.showFrozenIcon = !0, this.version = "1.20.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
59990
+ 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$1.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");
59955
59991
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59956
59992
  options: options,
59957
59993
  container: container
@@ -78931,7 +78967,7 @@
78931
78967
  importStyle();
78932
78968
  }
78933
78969
 
78934
- const version = "1.20.0";
78970
+ const version = "1.20.1-alpha.0";
78935
78971
  importStyles();
78936
78972
 
78937
78973
  exports.TYPES = index;