@visactor/vtable 1.4.2-beta.0 → 1.4.2

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 (119) hide show
  1. package/cjs/ListTable.js +1 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +19 -19
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +2 -0
  6. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  7. package/cjs/core/BaseTable.d.ts +1 -2
  8. package/cjs/core/BaseTable.js +16 -150
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/core/utils/get-cell-position.d.ts +42 -0
  11. package/cjs/core/utils/get-cell-position.js +204 -0
  12. package/cjs/core/utils/get-cell-position.js.map +1 -0
  13. package/cjs/edit/edit-manager.d.ts +1 -1
  14. package/cjs/edit/edit-manager.js +7 -6
  15. package/cjs/edit/edit-manager.js.map +1 -1
  16. package/cjs/event/event.js +7 -3
  17. package/cjs/event/event.js.map +1 -1
  18. package/cjs/event/listener/container-dom.js +92 -86
  19. package/cjs/event/listener/container-dom.js.map +1 -1
  20. package/cjs/event/listener/table-group.js +29 -20
  21. package/cjs/event/listener/table-group.js.map +1 -1
  22. package/cjs/index.d.ts +1 -1
  23. package/cjs/index.js +1 -1
  24. package/cjs/index.js.map +1 -1
  25. package/cjs/layout/layout-helper.js +2 -2
  26. package/cjs/layout/layout-helper.js.map +1 -1
  27. package/cjs/layout/pivot-header-layout.js +182 -53
  28. package/cjs/layout/pivot-header-layout.js.map +1 -1
  29. package/cjs/layout/simple-header-layout.d.ts +3 -0
  30. package/cjs/layout/simple-header-layout.js +28 -22
  31. package/cjs/layout/simple-header-layout.js.map +1 -1
  32. package/cjs/scenegraph/component/custom.js +4 -2
  33. package/cjs/scenegraph/component/custom.js.map +1 -1
  34. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +60 -56
  35. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  36. package/cjs/scenegraph/group-creater/cell-helper.js +13 -11
  37. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  38. package/cjs/scenegraph/group-creater/progress/proxy.js +8 -8
  39. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  40. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  41. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  42. package/cjs/state/cell-move/index.js +4 -1
  43. package/cjs/state/cell-move/index.js.map +1 -1
  44. package/cjs/state/sort/index.js +7 -3
  45. package/cjs/state/sort/index.js.map +1 -1
  46. package/cjs/state/state.d.ts +1 -1
  47. package/cjs/state/state.js +10 -6
  48. package/cjs/state/state.js.map +1 -1
  49. package/cjs/tools/util.d.ts +1 -0
  50. package/cjs/tools/util.js +11 -2
  51. package/cjs/tools/util.js.map +1 -1
  52. package/cjs/ts-types/base-table.d.ts +2 -0
  53. package/cjs/ts-types/base-table.js.map +1 -1
  54. package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -0
  55. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  56. package/cjs/ts-types/table-engine.d.ts +1 -1
  57. package/cjs/ts-types/table-engine.js.map +1 -1
  58. package/cjs/vrender.js.map +1 -1
  59. package/dist/vtable.js +791 -438
  60. package/dist/vtable.min.js +2 -2
  61. package/es/ListTable.js +1 -1
  62. package/es/ListTable.js.map +1 -1
  63. package/es/PivotTable.js +19 -19
  64. package/es/PivotTable.js.map +1 -1
  65. package/es/components/tooltip/logic/BubbleTooltipElement.js +3 -1
  66. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  67. package/es/core/BaseTable.d.ts +1 -2
  68. package/es/core/BaseTable.js +18 -150
  69. package/es/core/BaseTable.js.map +1 -1
  70. package/es/core/utils/get-cell-position.d.ts +42 -0
  71. package/es/core/utils/get-cell-position.js +192 -0
  72. package/es/core/utils/get-cell-position.js.map +1 -0
  73. package/es/edit/edit-manager.d.ts +1 -1
  74. package/es/edit/edit-manager.js +7 -6
  75. package/es/edit/edit-manager.js.map +1 -1
  76. package/es/event/event.js +6 -2
  77. package/es/event/event.js.map +1 -1
  78. package/es/event/listener/container-dom.js +92 -86
  79. package/es/event/listener/container-dom.js.map +1 -1
  80. package/es/event/listener/table-group.js +29 -20
  81. package/es/event/listener/table-group.js.map +1 -1
  82. package/es/index.d.ts +1 -1
  83. package/es/index.js +1 -1
  84. package/es/index.js.map +1 -1
  85. package/es/layout/layout-helper.js +2 -2
  86. package/es/layout/layout-helper.js.map +1 -1
  87. package/es/layout/pivot-header-layout.js +182 -53
  88. package/es/layout/pivot-header-layout.js.map +1 -1
  89. package/es/layout/simple-header-layout.d.ts +3 -0
  90. package/es/layout/simple-header-layout.js +28 -22
  91. package/es/layout/simple-header-layout.js.map +1 -1
  92. package/es/scenegraph/component/custom.js +4 -2
  93. package/es/scenegraph/component/custom.js.map +1 -1
  94. package/es/scenegraph/graphic/contributions/group-contribution-render.js +60 -56
  95. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  96. package/es/scenegraph/group-creater/cell-helper.js +13 -11
  97. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  98. package/es/scenegraph/group-creater/progress/proxy.js +8 -8
  99. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  100. package/es/scenegraph/layout/compute-col-width.js +1 -1
  101. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  102. package/es/state/cell-move/index.js +4 -1
  103. package/es/state/cell-move/index.js.map +1 -1
  104. package/es/state/sort/index.js +7 -3
  105. package/es/state/sort/index.js.map +1 -1
  106. package/es/state/state.d.ts +1 -1
  107. package/es/state/state.js +10 -6
  108. package/es/state/state.js.map +1 -1
  109. package/es/tools/util.d.ts +1 -0
  110. package/es/tools/util.js +9 -0
  111. package/es/tools/util.js.map +1 -1
  112. package/es/ts-types/base-table.d.ts +2 -0
  113. package/es/ts-types/base-table.js.map +1 -1
  114. package/es/ts-types/list-table/define/basic-define.d.ts +1 -0
  115. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  116. package/es/ts-types/table-engine.d.ts +1 -1
  117. package/es/ts-types/table-engine.js.map +1 -1
  118. package/es/vrender.js.map +1 -1
  119. package/package.json +5 -5
package/es/PivotTable.js CHANGED
@@ -224,7 +224,7 @@ export class PivotTable extends BaseTable {
224
224
  return layoutMap.getBodyIndexByCol(col);
225
225
  }
226
226
  getFieldData(field, col, row) {
227
- var _a;
227
+ var _a, _b, _c;
228
228
  if (!this.internalProps.layoutMap.isHeader(col, row)) {
229
229
  if (this.internalProps.recordsIsTwoDimensionalArray) {
230
230
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -234,13 +234,13 @@ export class PivotTable extends BaseTable {
234
234
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
235
235
  if (cellDimensionPath) {
236
236
  let indicatorPosition;
237
- const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
237
+ const colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
238
238
  var _a;
239
239
  return colPath.indicatorKey && (indicatorPosition = {
240
240
  position: "col",
241
241
  index: index
242
242
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
243
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
243
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
244
244
  var _a;
245
245
  return rowPath.indicatorKey && (indicatorPosition = {
246
246
  position: "row",
@@ -316,7 +316,7 @@ export class PivotTable extends BaseTable {
316
316
  }
317
317
  }
318
318
  getCellOriginValue(col, row) {
319
- var _a;
319
+ var _a, _b, _c;
320
320
  const table = this;
321
321
  if (table.internalProps.layoutMap.isHeader(col, row)) {
322
322
  const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
@@ -328,13 +328,13 @@ export class PivotTable extends BaseTable {
328
328
  }
329
329
  if (this.dataset) {
330
330
  let indicatorPosition;
331
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
331
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
332
332
  var _a;
333
333
  return colPath.indicatorKey && (indicatorPosition = {
334
334
  position: "col",
335
335
  index: index
336
336
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
337
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
337
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
338
338
  var _a;
339
339
  return rowPath.indicatorKey && (indicatorPosition = {
340
340
  position: "row",
@@ -355,7 +355,7 @@ export class PivotTable extends BaseTable {
355
355
  }
356
356
  }
357
357
  getCellRawValue(col, row) {
358
- var _a;
358
+ var _a, _b, _c;
359
359
  const table = this;
360
360
  if (table.internalProps.layoutMap.isHeader(col, row)) {
361
361
  const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
@@ -367,13 +367,13 @@ export class PivotTable extends BaseTable {
367
367
  }
368
368
  if (this.dataset) {
369
369
  let indicatorPosition;
370
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
370
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
371
371
  var _a;
372
372
  return colPath.indicatorKey && (indicatorPosition = {
373
373
  position: "col",
374
374
  index: index
375
375
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
376
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
376
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
377
377
  var _a;
378
378
  return rowPath.indicatorKey && (indicatorPosition = {
379
379
  position: "row",
@@ -394,7 +394,7 @@ export class PivotTable extends BaseTable {
394
394
  }
395
395
  }
396
396
  getCellOriginRecord(col, row) {
397
- var _a;
397
+ var _a, _b, _c;
398
398
  if (!this.internalProps.layoutMap.isHeader(col, row)) {
399
399
  if (this.internalProps.recordsIsTwoDimensionalArray) {
400
400
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -402,13 +402,13 @@ export class PivotTable extends BaseTable {
402
402
  }
403
403
  if (this.dataset) {
404
404
  let indicatorPosition;
405
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
405
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
406
406
  var _a;
407
407
  return colPath.indicatorKey && (indicatorPosition = {
408
408
  position: "col",
409
409
  index: index
410
410
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
411
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
411
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
412
412
  var _a;
413
413
  return rowPath.indicatorKey && (indicatorPosition = {
414
414
  position: "row",
@@ -430,7 +430,7 @@ export class PivotTable extends BaseTable {
430
430
  }
431
431
  }
432
432
  getCellRawRecord(col, row) {
433
- var _a;
433
+ var _a, _b, _c;
434
434
  if (!this.internalProps.layoutMap.isHeader(col, row)) {
435
435
  if (this.internalProps.recordsIsTwoDimensionalArray) {
436
436
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -438,13 +438,13 @@ export class PivotTable extends BaseTable {
438
438
  }
439
439
  if (this.dataset) {
440
440
  let indicatorPosition;
441
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
441
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
442
442
  var _a;
443
443
  return colPath.indicatorKey && (indicatorPosition = {
444
444
  position: "col",
445
445
  index: index
446
446
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
447
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
447
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
448
448
  var _a;
449
449
  return rowPath.indicatorKey && (indicatorPosition = {
450
450
  position: "row",
@@ -810,7 +810,7 @@ export class PivotTable extends BaseTable {
810
810
  this.scenegraph.updateNextFrame();
811
811
  }
812
812
  _changeCellValueToDataSet(col, row, oldValue, newValue) {
813
- var _a, _b, _c, _d, _e, _f;
813
+ var _a, _b, _c, _d, _e, _f, _g, _h;
814
814
  if (this.internalProps.recordsIsTwoDimensionalArray) {
815
815
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
816
816
  this.records[rowIndex][colIndex] = newValue;
@@ -818,10 +818,10 @@ export class PivotTable extends BaseTable {
818
818
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
819
819
  if (this.isCornerHeader(col, row)) this.internalProps.layoutMap.changeCornerTitle(col, row, newValue); else if (this.isHeader(col, row)) this.internalProps.layoutMap.changeTreeNodeTitle(col, row, newValue),
820
820
  !this.isCornerHeader(col, row) && this.dataset.changeRecordFieldValue((null === (_a = cellDimensionPath.colHeaderPaths) || void 0 === _a ? void 0 : _a.length) ? null !== (_b = cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].indicatorKey) && void 0 !== _b ? _b : cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].dimensionKey : null !== (_c = cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].indicatorKey) && void 0 !== _c ? _c : cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].dimensionKey, oldValue, newValue); else {
821
- const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
821
+ const colKeys = null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual)).map((colPath => {
822
822
  var _a;
823
823
  return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
824
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
824
+ })), rowKeys = null === (_e = cellDimensionPath.rowHeaderPaths) || void 0 === _e ? void 0 : _e.filter((path => !path.virtual)).map((rowPath => {
825
825
  var _a;
826
826
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
827
827
  }));
@@ -830,7 +830,7 @@ export class PivotTable extends BaseTable {
830
830
  } else if (this.flatDataToObjects) {
831
831
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
832
832
  if (this.isHeader(col, row)) this.internalProps.layoutMap.changeTreeNodeTitle(col, row, newValue),
833
- !this.isCornerHeader(col, row) && this.flatDataToObjects.changeRecordFieldValue((null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.length) ? null !== (_e = cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].indicatorKey) && void 0 !== _e ? _e : cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].dimensionKey : null !== (_f = cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].indicatorKey) && void 0 !== _f ? _f : cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].dimensionKey, oldValue, newValue); else {
833
+ !this.isCornerHeader(col, row) && this.flatDataToObjects.changeRecordFieldValue((null === (_f = cellDimensionPath.colHeaderPaths) || void 0 === _f ? void 0 : _f.length) ? null !== (_g = cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].indicatorKey) && void 0 !== _g ? _g : cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].dimensionKey : null !== (_h = cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].indicatorKey) && void 0 !== _h ? _h : cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].dimensionKey, oldValue, newValue); else {
834
834
  const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
835
835
  var _a;
836
836
  return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;