@visactor/vtable 0.12.1-alpha.0 → 0.12.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.
Files changed (79) hide show
  1. package/cjs/components/menu/dom/logic/MenuContainer.js +3 -13
  2. package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -1
  3. package/cjs/components/menu/dom/logic/MenuElement.js +3 -13
  4. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
  5. package/cjs/components/tooltip/TooltipHandler.js +17 -8
  6. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  7. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +4 -14
  8. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  9. package/cjs/core/BaseTable.d.ts +6 -2
  10. package/cjs/core/BaseTable.js +18 -2
  11. package/cjs/core/BaseTable.js.map +1 -1
  12. package/cjs/dataset/dataset.d.ts +1 -0
  13. package/cjs/dataset/dataset.js +89 -58
  14. package/cjs/dataset/dataset.js.map +1 -1
  15. package/cjs/dataset/flatDataToObject.js +1 -2
  16. package/cjs/event/EventHandler.js +3 -2
  17. package/cjs/event/EventHandler.js.map +1 -1
  18. package/cjs/event/sparkline-event.js +2 -1
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/layout/chart-helper/get-axis-config.d.ts +11 -0
  23. package/cjs/layout/chart-helper/get-axis-config.js +65 -62
  24. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  25. package/cjs/layout/chart-helper/get-chart-spec.js +9 -24
  26. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  27. package/cjs/layout/pivot-header-layout.d.ts +6 -2
  28. package/cjs/layout/pivot-header-layout.js +32 -5
  29. package/cjs/layout/pivot-header-layout.js.map +1 -1
  30. package/cjs/layout/simple-header-layout.d.ts +7 -3
  31. package/cjs/layout/simple-header-layout.js +36 -8
  32. package/cjs/layout/simple-header-layout.js.map +1 -1
  33. package/cjs/scenegraph/refresh-node/update-chart.js +6 -3
  34. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  35. package/cjs/ts-types/base-table.d.ts +6 -0
  36. package/cjs/ts-types/base-table.js.map +1 -1
  37. package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -0
  38. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  39. package/dist/vtable.js +376 -269
  40. package/dist/vtable.min.js +2 -2
  41. package/es/components/menu/dom/logic/MenuContainer.js +3 -13
  42. package/es/components/menu/dom/logic/MenuContainer.js.map +1 -1
  43. package/es/components/menu/dom/logic/MenuElement.js +3 -13
  44. package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
  45. package/es/components/tooltip/TooltipHandler.js +17 -8
  46. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  47. package/es/components/tooltip/logic/BubbleTooltipElement.js +4 -14
  48. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  49. package/es/core/BaseTable.d.ts +6 -2
  50. package/es/core/BaseTable.js +18 -2
  51. package/es/core/BaseTable.js.map +1 -1
  52. package/es/dataset/dataset.d.ts +1 -0
  53. package/es/dataset/dataset.js +89 -58
  54. package/es/dataset/dataset.js.map +1 -1
  55. package/es/dataset/flatDataToObject.js +1 -2
  56. package/es/event/EventHandler.js +3 -2
  57. package/es/event/EventHandler.js.map +1 -1
  58. package/es/event/sparkline-event.js +2 -1
  59. package/es/index.d.ts +1 -1
  60. package/es/index.js +1 -1
  61. package/es/index.js.map +1 -1
  62. package/es/layout/chart-helper/get-axis-config.d.ts +11 -0
  63. package/es/layout/chart-helper/get-axis-config.js +61 -57
  64. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  65. package/es/layout/chart-helper/get-chart-spec.js +6 -21
  66. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  67. package/es/layout/pivot-header-layout.d.ts +6 -2
  68. package/es/layout/pivot-header-layout.js +32 -5
  69. package/es/layout/pivot-header-layout.js.map +1 -1
  70. package/es/layout/simple-header-layout.d.ts +7 -3
  71. package/es/layout/simple-header-layout.js +37 -7
  72. package/es/layout/simple-header-layout.js.map +1 -1
  73. package/es/scenegraph/refresh-node/update-chart.js +6 -3
  74. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  75. package/es/ts-types/base-table.d.ts +6 -0
  76. package/es/ts-types/base-table.js.map +1 -1
  77. package/es/ts-types/list-table/layout-map/api.d.ts +4 -0
  78. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  79. package/package.json +3 -3
@@ -135,7 +135,7 @@ class PivotHeaderLayoutMap {
135
135
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
136
136
  const id = hd.id, dimensionInfo = null !== (_b = null === (_a = this.rowsDefine) || void 0 === _a ? void 0 : _a.find((dimension => "string" != typeof dimension && dimension.dimensionKey === hd.dimensionKey))) && void 0 !== _b ? _b : null === (_c = this.columnsDefine) || void 0 === _c ? void 0 : _c.find((dimension => "string" != typeof dimension && dimension.dimensionKey === hd.dimensionKey)), indicatorInfo = null === (_d = this.indicatorsDefine) || void 0 === _d ? void 0 : _d.find((indicator => "string" != typeof indicator && (hd.indicatorKey ? indicator.indicatorKey === hd.indicatorKey : indicator.title === hd.value))), cell = {
137
137
  id: id,
138
- title: null !== (_e = hd.value) && void 0 !== _e ? _e : indicatorInfo.title,
138
+ title: null !== (_e = hd.value) && void 0 !== _e ? _e : null == indicatorInfo ? void 0 : indicatorInfo.title,
139
139
  field: hd.dimensionKey,
140
140
  style: "function" == typeof (null === (_f = null != indicatorInfo ? indicatorInfo : dimensionInfo) || void 0 === _f ? void 0 : _f.headerStyle) ? null === (_g = null != indicatorInfo ? indicatorInfo : dimensionInfo) || void 0 === _g ? void 0 : _g.headerStyle : Object.assign({}, null === (_h = null != indicatorInfo ? indicatorInfo : dimensionInfo) || void 0 === _h ? void 0 : _h.headerStyle),
141
141
  headerType: null !== (_k = null !== (_j = null == indicatorInfo ? void 0 : indicatorInfo.headerType) && void 0 !== _j ? _j : null == dimensionInfo ? void 0 : dimensionInfo.headerType) && void 0 !== _k ? _k : "text",
@@ -417,11 +417,29 @@ class PivotHeaderLayoutMap {
417
417
  isRowHeader(col, row) {
418
418
  return col < this.rowHeaderLevelCount && row >= this.columnHeaderLevelCount;
419
419
  }
420
+ isFrozenColumn(col, row) {
421
+ if ((0, util_1.isValid)(row)) {
422
+ if (col < this.frozenColCount && row >= this.frozenRowCount && row < this.rowCount - this.bottomFrozenRowCount) return !0;
423
+ } else if (this.frozenColCount > 0 && col < this.frozenColCount) return !0;
424
+ return !1;
425
+ }
420
426
  isRightFrozenColumn(col, row) {
421
- return col >= this.colCount - this.rightFrozenColCount && row >= this.columnHeaderLevelCount && row < this.rowCount - this.bottomFrozenRowCount;
427
+ if ((0, util_1.isValid)(row)) {
428
+ if (col >= this.colCount - this.rightFrozenColCount && row >= this.frozenRowCount && row < this.rowCount - this.bottomFrozenRowCount) return !0;
429
+ } else if (this.rightFrozenColCount > 0 && col >= this.colCount - this.rightFrozenColCount) return !0;
430
+ return !1;
431
+ }
432
+ isFrozenRow(col, row) {
433
+ if ((0, util_1.isValid)(row)) {
434
+ if (row < this.frozenRowCount && col >= this.frozenColCount && col < this.colCount - this.rightFrozenColCount) return !0;
435
+ } else if (row = col, this.frozenRowCount > 0 && row < this.frozenRowCount) return !0;
436
+ return !1;
422
437
  }
423
438
  isBottomFrozenRow(col, row) {
424
- return col >= this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount && col < this.colCount - this.rightFrozenColCount;
439
+ if ((0, util_1.isValid)(row)) {
440
+ if (row >= this.rowCount - this.bottomFrozenRowCount && col >= this.frozenColCount && col < this.colCount - this.rightFrozenColCount) return !0;
441
+ } else if (row = col, this.frozenRowCount > 0 && row >= this.rowCount - this.bottomFrozenRowCount) return !0;
442
+ return !1;
425
443
  }
426
444
  isLeftBottomCorner(col, row) {
427
445
  return col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount;
@@ -481,6 +499,14 @@ class PivotHeaderLayoutMap {
481
499
  };
482
500
  }
483
501
  resetCellIds() {}
502
+ get frozenColCount() {
503
+ var _a;
504
+ return null !== (_a = this._table.internalProps.frozenColCount) && void 0 !== _a ? _a : 0;
505
+ }
506
+ get frozenRowCount() {
507
+ var _a;
508
+ return null !== (_a = this._table.internalProps.frozenRowCount) && void 0 !== _a ? _a : 0;
509
+ }
484
510
  get headerLevelCount() {
485
511
  return this.columnHeaderLevelCount;
486
512
  }
@@ -511,7 +537,8 @@ class PivotHeaderLayoutMap {
511
537
  return this.columnDimensionTree.tree.size + this.rowHeaderLevelCount + this.rightFrozenColCount;
512
538
  }
513
539
  get rowCount() {
514
- return Math.max(this._rowHeaderCellIds.length, 1) + this.columnHeaderLevelCount + this.bottomFrozenRowCount;
540
+ var _a, _b;
541
+ return (null !== (_b = null === (_a = this._rowHeaderCellIds) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0) + this.columnHeaderLevelCount + this.bottomFrozenRowCount;
515
542
  }
516
543
  get bodyRowCount() {
517
544
  return this.rowDimensionTree.tree.size;
@@ -619,7 +646,7 @@ class PivotHeaderLayoutMap {
619
646
  row: row
620
647
  }
621
648
  };
622
- if (!this.isHeader(col, row) || -1 === col || -1 === row || this.isIndicatorHeader(col, row)) return result;
649
+ if (!this.isHeader(col, row) || -1 === col || -1 === row) return result;
623
650
  if (this.isRightFrozenColumn(col, row) || this.isBottomFrozenRow(col, row)) return result;
624
651
  if (this._cellRangeMap.has(`${col}-${row}`)) return this._cellRangeMap.get(`${col}-${row}`);
625
652
  if (this.isHeader(col, row) && -1 !== col && -1 !== row) {