@visactor/vtable 1.22.13-alpha.0 → 1.23.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.
Files changed (51) hide show
  1. package/cjs/PivotTable.js +12 -5
  2. package/cjs/PivotTable.js.map +1 -1
  3. package/cjs/core/BaseTable.js +1 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/dataset/dataset.d.ts +4 -1
  6. package/cjs/dataset/dataset.js +40 -10
  7. package/cjs/dataset/dataset.js.map +1 -1
  8. package/cjs/event/media-click.js +2 -2
  9. package/cjs/event/media-click.js.map +1 -1
  10. package/cjs/index.d.ts +1 -1
  11. package/cjs/index.js +1 -1
  12. package/cjs/index.js.map +1 -1
  13. package/cjs/layout/pivot-header-layout.js +2 -1
  14. package/cjs/layout/pivot-header-layout.js.map +1 -1
  15. package/cjs/scenegraph/layout/compute-col-width.js +4 -2
  16. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  17. package/cjs/state/hover/col.js.map +1 -1
  18. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  19. package/cjs/state/hover/update-cell.js.map +1 -1
  20. package/cjs/tools/join.js +1 -0
  21. package/cjs/tools/join.js.map +1 -1
  22. package/cjs/ts-types/pivot-table/corner.d.ts +1 -1
  23. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  24. package/cjs/vrender.js.map +1 -1
  25. package/dist/vtable.js +146 -25
  26. package/dist/vtable.min.js +2 -2
  27. package/es/PivotTable.js +12 -5
  28. package/es/PivotTable.js.map +1 -1
  29. package/es/core/BaseTable.js +1 -1
  30. package/es/core/BaseTable.js.map +1 -1
  31. package/es/dataset/dataset.d.ts +4 -1
  32. package/es/dataset/dataset.js +40 -10
  33. package/es/dataset/dataset.js.map +1 -1
  34. package/es/event/media-click.js +2 -2
  35. package/es/event/media-click.js.map +1 -1
  36. package/es/index.d.ts +1 -1
  37. package/es/index.js +1 -1
  38. package/es/index.js.map +1 -1
  39. package/es/layout/pivot-header-layout.js +2 -1
  40. package/es/layout/pivot-header-layout.js.map +1 -1
  41. package/es/scenegraph/layout/compute-col-width.js +4 -2
  42. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  43. package/es/state/hover/col.js.map +1 -1
  44. package/es/state/hover/is-cell-hover.js.map +1 -1
  45. package/es/state/hover/update-cell.js.map +1 -1
  46. package/es/tools/join.js +1 -0
  47. package/es/tools/join.js.map +1 -1
  48. package/es/ts-types/pivot-table/corner.d.ts +1 -1
  49. package/es/ts-types/pivot-table/corner.js.map +1 -1
  50. package/es/vrender.js.map +1 -1
  51. package/package.json +9 -9
package/cjs/PivotTable.js CHANGED
@@ -884,14 +884,21 @@ class PivotTable extends BaseTable_1.BaseTable {
884
884
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
885
885
  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),
886
886
  !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 {
887
- const colKeys = null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual)).map((colPath => {
887
+ let indicatorPosition;
888
+ const colKeys = null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual)).map(((colPath, index) => {
888
889
  var _a;
889
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
890
- })), rowKeys = null === (_e = cellDimensionPath.rowHeaderPaths) || void 0 === _e ? void 0 : _e.filter((path => !path.virtual)).map((rowPath => {
890
+ return colPath.indicatorKey && (indicatorPosition = {
891
+ position: "col",
892
+ index: index
893
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
894
+ })), rowKeys = null === (_e = cellDimensionPath.rowHeaderPaths) || void 0 === _e ? void 0 : _e.filter((path => !path.virtual)).map(((rowPath, index) => {
891
895
  var _a;
892
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
896
+ return rowPath.indicatorKey && (indicatorPosition = {
897
+ position: "row",
898
+ index: index
899
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
893
900
  }));
894
- this.dataset.changeTreeNodeValue(this.internalProps.layoutMap.indicatorsAsCol ? rowKeys : rowKeys.slice(0, -1), this.internalProps.layoutMap.indicatorsAsCol ? colKeys.slice(0, -1) : colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), newValue);
901
+ this.dataset.changeTreeNodeValue(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), newValue, indicatorPosition);
895
902
  }
896
903
  } else if (this.flatDataToObjects) {
897
904
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);