@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
@@ -144,7 +144,7 @@ export class PivotHeaderLayoutMap {
144
144
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
145
145
  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 = {
146
146
  id: id,
147
- title: null !== (_e = hd.value) && void 0 !== _e ? _e : indicatorInfo.title,
147
+ title: null !== (_e = hd.value) && void 0 !== _e ? _e : null == indicatorInfo ? void 0 : indicatorInfo.title,
148
148
  field: hd.dimensionKey,
149
149
  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),
150
150
  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",
@@ -426,11 +426,29 @@ export class PivotHeaderLayoutMap {
426
426
  isRowHeader(col, row) {
427
427
  return col < this.rowHeaderLevelCount && row >= this.columnHeaderLevelCount;
428
428
  }
429
+ isFrozenColumn(col, row) {
430
+ if (isValid(row)) {
431
+ if (col < this.frozenColCount && row >= this.frozenRowCount && row < this.rowCount - this.bottomFrozenRowCount) return !0;
432
+ } else if (this.frozenColCount > 0 && col < this.frozenColCount) return !0;
433
+ return !1;
434
+ }
429
435
  isRightFrozenColumn(col, row) {
430
- return col >= this.colCount - this.rightFrozenColCount && row >= this.columnHeaderLevelCount && row < this.rowCount - this.bottomFrozenRowCount;
436
+ if (isValid(row)) {
437
+ if (col >= this.colCount - this.rightFrozenColCount && row >= this.frozenRowCount && row < this.rowCount - this.bottomFrozenRowCount) return !0;
438
+ } else if (this.rightFrozenColCount > 0 && col >= this.colCount - this.rightFrozenColCount) return !0;
439
+ return !1;
440
+ }
441
+ isFrozenRow(col, row) {
442
+ if (isValid(row)) {
443
+ if (row < this.frozenRowCount && col >= this.frozenColCount && col < this.colCount - this.rightFrozenColCount) return !0;
444
+ } else if (row = col, this.frozenRowCount > 0 && row < this.frozenRowCount) return !0;
445
+ return !1;
431
446
  }
432
447
  isBottomFrozenRow(col, row) {
433
- return col >= this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount && col < this.colCount - this.rightFrozenColCount;
448
+ if (isValid(row)) {
449
+ if (row >= this.rowCount - this.bottomFrozenRowCount && col >= this.frozenColCount && col < this.colCount - this.rightFrozenColCount) return !0;
450
+ } else if (row = col, this.frozenRowCount > 0 && row >= this.rowCount - this.bottomFrozenRowCount) return !0;
451
+ return !1;
434
452
  }
435
453
  isLeftBottomCorner(col, row) {
436
454
  return col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount;
@@ -490,6 +508,14 @@ export class PivotHeaderLayoutMap {
490
508
  };
491
509
  }
492
510
  resetCellIds() {}
511
+ get frozenColCount() {
512
+ var _a;
513
+ return null !== (_a = this._table.internalProps.frozenColCount) && void 0 !== _a ? _a : 0;
514
+ }
515
+ get frozenRowCount() {
516
+ var _a;
517
+ return null !== (_a = this._table.internalProps.frozenRowCount) && void 0 !== _a ? _a : 0;
518
+ }
493
519
  get headerLevelCount() {
494
520
  return this.columnHeaderLevelCount;
495
521
  }
@@ -520,7 +546,8 @@ export class PivotHeaderLayoutMap {
520
546
  return this.columnDimensionTree.tree.size + this.rowHeaderLevelCount + this.rightFrozenColCount;
521
547
  }
522
548
  get rowCount() {
523
- return Math.max(this._rowHeaderCellIds.length, 1) + this.columnHeaderLevelCount + this.bottomFrozenRowCount;
549
+ var _a, _b;
550
+ return (null !== (_b = null === (_a = this._rowHeaderCellIds) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0) + this.columnHeaderLevelCount + this.bottomFrozenRowCount;
524
551
  }
525
552
  get bodyRowCount() {
526
553
  return this.rowDimensionTree.tree.size;
@@ -628,7 +655,7 @@ export class PivotHeaderLayoutMap {
628
655
  row: row
629
656
  }
630
657
  };
631
- if (!this.isHeader(col, row) || -1 === col || -1 === row || this.isIndicatorHeader(col, row)) return result;
658
+ if (!this.isHeader(col, row) || -1 === col || -1 === row) return result;
632
659
  if (this.isRightFrozenColumn(col, row) || this.isBottomFrozenRow(col, row)) return result;
633
660
  if (this._cellRangeMap.has(`${col}-${row}`)) return this._cellRangeMap.get(`${col}-${row}`);
634
661
  if (this.isHeader(col, row) && -1 !== col && -1 !== row) {