@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/cjs/PivotTable.js CHANGED
@@ -222,7 +222,7 @@ class PivotTable extends BaseTable_1.BaseTable {
222
222
  return layoutMap.getBodyIndexByCol(col);
223
223
  }
224
224
  getFieldData(field, col, row) {
225
- var _a;
225
+ var _a, _b, _c;
226
226
  if (!this.internalProps.layoutMap.isHeader(col, row)) {
227
227
  if (this.internalProps.recordsIsTwoDimensionalArray) {
228
228
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -232,13 +232,13 @@ class PivotTable extends BaseTable_1.BaseTable {
232
232
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
233
233
  if (cellDimensionPath) {
234
234
  let indicatorPosition;
235
- const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
235
+ const colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
236
236
  var _a;
237
237
  return colPath.indicatorKey && (indicatorPosition = {
238
238
  position: "col",
239
239
  index: index
240
240
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
241
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
241
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
242
242
  var _a;
243
243
  return rowPath.indicatorKey && (indicatorPosition = {
244
244
  position: "row",
@@ -314,7 +314,7 @@ class PivotTable extends BaseTable_1.BaseTable {
314
314
  }
315
315
  }
316
316
  getCellOriginValue(col, row) {
317
- var _a;
317
+ var _a, _b, _c;
318
318
  const table = this;
319
319
  if (table.internalProps.layoutMap.isHeader(col, row)) {
320
320
  const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
@@ -326,13 +326,13 @@ class PivotTable extends BaseTable_1.BaseTable {
326
326
  }
327
327
  if (this.dataset) {
328
328
  let indicatorPosition;
329
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
329
+ 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) => {
330
330
  var _a;
331
331
  return colPath.indicatorKey && (indicatorPosition = {
332
332
  position: "col",
333
333
  index: index
334
334
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
335
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
335
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
336
336
  var _a;
337
337
  return rowPath.indicatorKey && (indicatorPosition = {
338
338
  position: "row",
@@ -353,7 +353,7 @@ class PivotTable extends BaseTable_1.BaseTable {
353
353
  }
354
354
  }
355
355
  getCellRawValue(col, row) {
356
- var _a;
356
+ var _a, _b, _c;
357
357
  const table = this;
358
358
  if (table.internalProps.layoutMap.isHeader(col, row)) {
359
359
  const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
@@ -365,13 +365,13 @@ class PivotTable extends BaseTable_1.BaseTable {
365
365
  }
366
366
  if (this.dataset) {
367
367
  let indicatorPosition;
368
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
368
+ 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) => {
369
369
  var _a;
370
370
  return colPath.indicatorKey && (indicatorPosition = {
371
371
  position: "col",
372
372
  index: index
373
373
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
374
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
374
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
375
375
  var _a;
376
376
  return rowPath.indicatorKey && (indicatorPosition = {
377
377
  position: "row",
@@ -392,7 +392,7 @@ class PivotTable extends BaseTable_1.BaseTable {
392
392
  }
393
393
  }
394
394
  getCellOriginRecord(col, row) {
395
- var _a;
395
+ var _a, _b, _c;
396
396
  if (!this.internalProps.layoutMap.isHeader(col, row)) {
397
397
  if (this.internalProps.recordsIsTwoDimensionalArray) {
398
398
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -400,13 +400,13 @@ class PivotTable extends BaseTable_1.BaseTable {
400
400
  }
401
401
  if (this.dataset) {
402
402
  let indicatorPosition;
403
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
403
+ 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) => {
404
404
  var _a;
405
405
  return colPath.indicatorKey && (indicatorPosition = {
406
406
  position: "col",
407
407
  index: index
408
408
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
409
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
409
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
410
410
  var _a;
411
411
  return rowPath.indicatorKey && (indicatorPosition = {
412
412
  position: "row",
@@ -428,7 +428,7 @@ class PivotTable extends BaseTable_1.BaseTable {
428
428
  }
429
429
  }
430
430
  getCellRawRecord(col, row) {
431
- var _a;
431
+ var _a, _b, _c;
432
432
  if (!this.internalProps.layoutMap.isHeader(col, row)) {
433
433
  if (this.internalProps.recordsIsTwoDimensionalArray) {
434
434
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -436,13 +436,13 @@ class PivotTable extends BaseTable_1.BaseTable {
436
436
  }
437
437
  if (this.dataset) {
438
438
  let indicatorPosition;
439
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
439
+ 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) => {
440
440
  var _a;
441
441
  return colPath.indicatorKey && (indicatorPosition = {
442
442
  position: "col",
443
443
  index: index
444
444
  }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
445
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
445
+ })), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
446
446
  var _a;
447
447
  return rowPath.indicatorKey && (indicatorPosition = {
448
448
  position: "row",
@@ -809,7 +809,7 @@ class PivotTable extends BaseTable_1.BaseTable {
809
809
  this.scenegraph.updateNextFrame();
810
810
  }
811
811
  _changeCellValueToDataSet(col, row, oldValue, newValue) {
812
- var _a, _b, _c, _d, _e, _f;
812
+ var _a, _b, _c, _d, _e, _f, _g, _h;
813
813
  if (this.internalProps.recordsIsTwoDimensionalArray) {
814
814
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
815
815
  this.records[rowIndex][colIndex] = newValue;
@@ -817,10 +817,10 @@ class PivotTable extends BaseTable_1.BaseTable {
817
817
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
818
818
  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),
819
819
  !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 {
820
- const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
820
+ const colKeys = null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual)).map((colPath => {
821
821
  var _a;
822
822
  return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
823
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
823
+ })), rowKeys = null === (_e = cellDimensionPath.rowHeaderPaths) || void 0 === _e ? void 0 : _e.filter((path => !path.virtual)).map((rowPath => {
824
824
  var _a;
825
825
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
826
826
  }));
@@ -829,7 +829,7 @@ class PivotTable extends BaseTable_1.BaseTable {
829
829
  } else if (this.flatDataToObjects) {
830
830
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
831
831
  if (this.isHeader(col, row)) this.internalProps.layoutMap.changeTreeNodeTitle(col, row, newValue),
832
- !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 {
832
+ !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 {
833
833
  const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
834
834
  var _a;
835
835
  return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;