@visactor/vtable 0.12.1-alpha.1 → 0.12.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 (79) hide show
  1. package/cjs/ListTable.js +2 -0
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +2 -2
  4. package/cjs/PivotTable.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/core/BaseTable.js +1 -1
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/dataset/dataset.d.ts +1 -0
  10. package/cjs/dataset/dataset.js +89 -58
  11. package/cjs/dataset/dataset.js.map +1 -1
  12. package/cjs/event/event.js +2 -3
  13. package/cjs/event/event.js.map +1 -1
  14. package/cjs/index.d.ts +1 -1
  15. package/cjs/index.js +1 -1
  16. package/cjs/index.js.map +1 -1
  17. package/cjs/layout/chart-helper/get-axis-config.d.ts +11 -0
  18. package/cjs/layout/chart-helper/get-axis-config.js +65 -62
  19. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  20. package/cjs/layout/chart-helper/get-chart-spec.js +9 -24
  21. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  22. package/cjs/layout/pivot-header-layout.js +2 -2
  23. package/cjs/layout/pivot-header-layout.js.map +1 -1
  24. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
  25. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  26. package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +1 -1
  27. package/cjs/scenegraph/group-creater/progress/update-position/util.js +10 -5
  28. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  29. package/cjs/scenegraph/stick-text/index.js +20 -18
  30. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  31. package/cjs/themes/DARK.js +1 -1
  32. package/cjs/themes/DARK.js.map +1 -1
  33. package/cjs/themes/SIMPLIFY.js +1 -1
  34. package/cjs/themes/SIMPLIFY.js.map +1 -1
  35. package/cjs/ts-types/base-table.js.map +1 -1
  36. package/cjs/ts-types/new-data-set.js.map +1 -1
  37. package/cjs/ts-types/table-engine.js.map +1 -1
  38. package/dist/vtable.js +238 -199
  39. package/dist/vtable.min.js +2 -2
  40. package/es/ListTable.js +2 -0
  41. package/es/ListTable.js.map +1 -1
  42. package/es/PivotTable.js +2 -2
  43. package/es/PivotTable.js.map +1 -1
  44. package/es/components/tooltip/TooltipHandler.js +17 -8
  45. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  46. package/es/core/BaseTable.js +1 -1
  47. package/es/core/BaseTable.js.map +1 -1
  48. package/es/dataset/dataset.d.ts +1 -0
  49. package/es/dataset/dataset.js +89 -58
  50. package/es/dataset/dataset.js.map +1 -1
  51. package/es/event/event.js +2 -3
  52. package/es/event/event.js.map +1 -1
  53. package/es/index.d.ts +1 -1
  54. package/es/index.js +1 -1
  55. package/es/index.js.map +1 -1
  56. package/es/layout/chart-helper/get-axis-config.d.ts +11 -0
  57. package/es/layout/chart-helper/get-axis-config.js +61 -57
  58. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  59. package/es/layout/chart-helper/get-chart-spec.js +6 -21
  60. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  61. package/es/layout/pivot-header-layout.js +2 -2
  62. package/es/layout/pivot-header-layout.js.map +1 -1
  63. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
  64. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  65. package/es/scenegraph/group-creater/progress/update-position/util.d.ts +1 -1
  66. package/es/scenegraph/group-creater/progress/update-position/util.js +10 -5
  67. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  68. package/es/scenegraph/stick-text/index.js +20 -18
  69. package/es/scenegraph/stick-text/index.js.map +1 -1
  70. package/es/themes/DARK.js +1 -1
  71. package/es/themes/DARK.js.map +1 -1
  72. package/es/themes/SIMPLIFY.js +1 -1
  73. package/es/themes/SIMPLIFY.js.map +1 -1
  74. package/es/ts-types/base-table.js.map +1 -1
  75. package/es/ts-types/new-data-set.js.map +1 -1
  76. package/es/ts-types/table-engine.js.map +1 -1
  77. package/package.json +2 -2
  78. package/cjs/components/axis/get-axis-attributes.d.ts +0 -151
  79. package/es/components/axis/get-axis-attributes.d.ts +0 -151
@@ -53,7 +53,7 @@ function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
53
53
  const syncLeftCol = distStartCol, syncRightCol = distEndCol;
54
54
  proxy.colStart = "left" === direction ? proxy.colStart + count : proxy.colStart - count,
55
55
  proxy.colEnd = "left" === direction ? proxy.colEnd + count : proxy.colEnd - count,
56
- checkFirstColMerge(distStartCol, !0, proxy), updateColContent(syncLeftCol, syncRightCol, proxy),
56
+ updateColContent(syncLeftCol, syncRightCol, proxy), checkFirstColMerge(distStartCol, proxy),
57
57
  updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
58
58
  const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol), deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
59
59
  proxy.table.scenegraph.proxy.deltaX += deltaX, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
@@ -65,8 +65,8 @@ function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
65
65
  computeColsWidth(proxy.table, distStartCol, distEndCol);
66
66
  updateAllColPosition(proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1), count, direction, proxy);
67
67
  const syncLeftCol = distStartCol, syncRightCol = distEndCol;
68
- proxy.colStart = distStartCol, proxy.colEnd = distEndCol, checkFirstColMerge(distStartCol, !1, proxy),
69
- updateColContent(syncLeftCol, syncRightCol, proxy), updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? "right" : "left"),
68
+ proxy.colStart = distStartCol, proxy.colEnd = distEndCol, updateColContent(syncLeftCol, syncRightCol, proxy),
69
+ checkFirstColMerge(distStartCol, proxy), updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? "right" : "left"),
70
70
  proxy.table.scenegraph.proxy.deltaX = 0, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
71
71
  proxy.totalCol = "left" === direction ? proxy.totalCol + count : proxy.totalCol - count,
72
72
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2),
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEzE,MAAM,UAAgB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAC5D,MAAM,UAAU,GAAI,KAAK,CAAC,KAAsB,CAAC,cAAc,CAC7D,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAC1D,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC;QACrC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC;QACpC,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;QACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QAE1D,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEhB,UAAU,CAAC,QAAQ,EAAE,MAA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Q,CAAC,IAAI,KAAK,OAAO,EAAE;YAC7B,sBAAsB,CACpB,QAAQ,EACR,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n checkFirstColMerge(distStartCol, true, proxy);\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n // await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n checkFirstColMerge(distStartCol, false, proxy);\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n // await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\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TableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n // await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n // await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { Group } from '../../../graphic/group';
2
2
  import type { SceneProxy } from '../proxy';
3
3
  export declare function checkFirstRowMerge(row: number, proxy: SceneProxy): void;
4
- export declare function checkFirstColMerge(col: number, scrolling: boolean, proxy: SceneProxy): void;
4
+ export declare function checkFirstColMerge(col: number, proxy: SceneProxy): void;
5
5
  export declare function getFirstChild(containerGroup: Group): Group;
6
6
  export declare function getLastChild(containerGroup: Group): Group;
7
7
  export declare function getPrevGroup(group: Group): Group;
@@ -15,14 +15,17 @@ export function checkFirstRowMerge(row, proxy) {
15
15
  }
16
16
  }
17
17
 
18
- export function checkFirstColMerge(col, scrolling, proxy) {
18
+ export function checkFirstColMerge(col, proxy) {
19
19
  for (let row = 0; row < proxy.table.rowCount; row++) {
20
20
  if (row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart || row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount) continue;
21
21
  const range = getCellMergeInfo(proxy.table, col, row);
22
22
  if (range && clearHadMergedColumn(range.start.col, range.end.col, row, proxy), range && range.start.col !== col && "cell" !== proxy.highPerformanceGetCell(range.start.col, range.start.row, !0).role) {
23
23
  const oldCellGroup = proxy.highPerformanceGetCell(col, row, !0), newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, !0);
24
24
  newCellGroup.col = col, newCellGroup.row = row, newCellGroup.setAttribute("x", proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x),
25
- oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup),
25
+ newCellGroup.setAttributes({
26
+ x: proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x,
27
+ y: proxy.table.getRowsHeight(0, range.start.row - 1) - oldCellGroup.parent.attribute.y
28
+ }), oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup),
26
29
  oldCellGroup.needUpdate = !1, newCellGroup.needUpdate = !1, proxy.cellCache.get(col) && proxy.cellCache.set(col, newCellGroup);
27
30
  }
28
31
  }
@@ -35,7 +38,8 @@ function clearHadMergedRow(rowStart, rowEnd, col, proxy) {
35
38
  cellGroup.setAttributes({
36
39
  width: 0,
37
40
  height: proxy.table.getRowHeight(cellGroup.row),
38
- y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)
41
+ y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1),
42
+ x: 0
39
43
  }), cellGroup.clear());
40
44
  }
41
45
  }
@@ -43,11 +47,12 @@ function clearHadMergedRow(rowStart, rowEnd, col, proxy) {
43
47
  function clearHadMergedColumn(colStart, colEnd, row, proxy) {
44
48
  for (let col = colStart; col <= colEnd; col++) {
45
49
  const cellGroup = proxy.highPerformanceGetCell(col, row, !0);
46
- "shadow-cell" !== cellGroup.role && "empty" !== cellGroup.role && cellGroup.row !== colStart && (cellGroup.role = "shadow-cell",
50
+ "shadow-cell" !== cellGroup.role && "empty" !== cellGroup.role && cellGroup.col !== colStart && (cellGroup.role = "shadow-cell",
47
51
  cellGroup.setAttributes({
48
52
  width: 0,
49
53
  height: proxy.table.getRowHeight(cellGroup.row),
50
- y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)
54
+ y: proxy.table.getRowsHeight(0, cellGroup.row - 1),
55
+ x: 0
51
56
  }), cellGroup.clear());
52
57
  }
53
58
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/progress/update-position/util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,UAAU,kBAAkB,CAAC,GAAW,EAAE,KAAiB;IAC/D,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,IACE,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,mBAAmB,IAAI,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC;YAChE,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,EACpF;YACA,SAAS;SACV;QAED,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAEtD,KAAK,IAAI,iBAAiB,CAAC,KAA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AAC;AACf,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,cAAqB;IACjD,IAAI,KAAK,GAAG,cAAc,CAAC,UAAmB,CAAC;IAC/C,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC7B,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,cAAqB;IAChD,IAAI,KAAK,GAAG,cAAc,CAAC,SAAkB,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC7B,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAY;IACvC,IAAI,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;IACjC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QACtC,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAY;IACvC,IAAI,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;IACjC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QACtC,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"util.js","sourcesContent":["import { table } from 'console';\nimport type { Group } from '../../../graphic/group';\nimport { getCellMergeInfo } from '../../../utils/get-cell-merge';\nimport { updateCell } from '../../cell-helper';\nimport type { SceneProxy } from '../proxy';\nimport { BaseTableAPI } from '../../../../ts-types/base-table';\n\nexport function checkFirstRowMerge(row: number, proxy: SceneProxy) {\n for (let col = 0; col < proxy.table.colCount; col++) {\n if (\n (col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||\n (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)\n ) {\n continue;\n }\n\n const range = getCellMergeInfo(proxy.table, col, row);\n // 清除之前mock的Merge cell\n range && clearHadMergedRow(range.start.row, range.end.row, col, proxy);\n\n // 重新生成mock的Merge cell\n if (\n range &&\n range.start.row !== row &&\n proxy.highPerformanceGetCell(range.start.col, range.start.row, true).role !== 'cell'\n ) {\n // 在row的位置添加range.start.row单元格\n const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);\n const newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, true);\n\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.setAttribute(\n 'y',\n proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1)\n );\n\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n oldCellGroup.needUpdate = false;\n newCellGroup.needUpdate = false;\n\n // update cache\n if (proxy.cellCache.get(col)) {\n proxy.cellCache.set(col, newCellGroup);\n }\n }\n }\n}\n\nexport function checkFirstColMerge(col: number, scrolling: boolean, proxy: SceneProxy) {\n for (let row = 0; row < proxy.table.rowCount; row++) {\n if (\n (row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||\n (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)\n ) {\n continue;\n }\n\n const range = getCellMergeInfo(proxy.table, col, row);\n // 清除之前mock的Merge cell\n range && clearHadMergedColumn(range.start.col, range.end.col, row, proxy);\n\n if (\n range &&\n range.start.col !== col &&\n proxy.highPerformanceGetCell(range.start.col, range.start.row, true).role !== 'cell'\n ) {\n // 在col的位置添加range.start.col单元格\n const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);\n const newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, true);\n\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.setAttribute(\n 'x',\n proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x\n );\n\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n oldCellGroup.needUpdate = false;\n newCellGroup.needUpdate = false;\n\n // update cache\n if (proxy.cellCache.get(col)) {\n proxy.cellCache.set(col, newCellGroup);\n }\n }\n }\n}\n\nfunction clearHadMergedRow(rowStart: number, rowEnd: number, col: number, proxy: SceneProxy) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.row !== rowStart) {\n cellGroup.role = 'shadow-cell';\n cellGroup.setAttributes({\n width: 0,\n height: proxy.table.getRowHeight(cellGroup.row),\n y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)\n });\n cellGroup.clear();\n }\n }\n}\n\nfunction clearHadMergedColumn(colStart: number, colEnd: number, row: number, proxy: SceneProxy) {\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.row !== colStart) {\n cellGroup.role = 'shadow-cell';\n cellGroup.setAttributes({\n width: 0,\n height: proxy.table.getRowHeight(cellGroup.row),\n y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)\n });\n cellGroup.clear();\n }\n }\n}\n\nfunction checkHasColMerge(colStart: number, colEnd: number, row: number, proxy: SceneProxy) {\n for (let col = colStart; col <= colEnd; col++) {\n if (\n proxy.highPerformanceGetCell(col, row, true).role !== 'shadow-cell' &&\n proxy.highPerformanceGetCell(col, row, true).role !== 'empty'\n ) {\n return true;\n }\n }\n return false;\n}\n\nexport function getFirstChild(containerGroup: Group): Group {\n let child = containerGroup.firstChild as Group;\n while (child.type !== 'group') {\n child = child._next as Group;\n }\n return child;\n}\n\nexport function getLastChild(containerGroup: Group): Group {\n let child = containerGroup.lastChild as Group;\n while (child.type !== 'group') {\n child = child._prev as Group;\n }\n return child;\n}\n\nexport function getPrevGroup(group: Group): Group {\n let child = group._prev as Group;\n while (child && child.type !== 'group') {\n child = child._prev as Group;\n }\n return child;\n}\n\nexport function getNextGroup(group: Group): Group {\n let child = group._next as Group;\n while (child && child.type !== 'group') {\n child = child._next as Group;\n }\n return child;\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/progress/update-position/util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,UAAU,kBAAkB,CAAC,GAAW,EAAE,KAAiB;IAC/D,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,IACE,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,mBAAmB,IAAI,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC;YAChE,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,EACpF;YACA,SAAS;SACV;QAED,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAEtD,KAAK,IAAI,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAGvE,IACE,KAAK;YACL,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG;YACvB,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE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KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAC7D;YACA,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,cAAqB;IACjD,IAAI,KAAK,GAAG,cAAc,CAAC,UAAmB,CAAC;IAC/C,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC7B,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,cAAqB;IAChD,IAAI,KAAK,GAAG,cAAc,CAAC,SAAkB,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC7B,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAY;IACvC,IAAI,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;IACjC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QACtC,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAY;IACvC,IAAI,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;IACjC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QACtC,KAAK,GAAG,KAAK,CAAC,KAAc,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"util.js","sourcesContent":["import { table } from 'console';\nimport type { Group } from '../../../graphic/group';\nimport { getCellMergeInfo } from '../../../utils/get-cell-merge';\nimport { updateCell } from '../../cell-helper';\nimport type { SceneProxy } from '../proxy';\nimport { BaseTableAPI } from '../../../../ts-types/base-table';\n\nexport function checkFirstRowMerge(row: number, proxy: SceneProxy) {\n for (let col = 0; col < proxy.table.colCount; col++) {\n if (\n (col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||\n (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)\n ) {\n continue;\n }\n\n const range = getCellMergeInfo(proxy.table, col, row);\n // 清除之前mock的Merge cell\n range && clearHadMergedRow(range.start.row, range.end.row, col, proxy);\n\n // 重新生成mock的Merge cell\n if (\n range &&\n range.start.row !== row &&\n proxy.highPerformanceGetCell(range.start.col, range.start.row, true).role !== 'cell'\n ) {\n // 在row的位置添加range.start.row单元格\n const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);\n const newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, true);\n\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.setAttribute(\n 'y',\n proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1)\n );\n\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n oldCellGroup.needUpdate = false;\n newCellGroup.needUpdate = false;\n\n // update cache\n if (proxy.cellCache.get(col)) {\n proxy.cellCache.set(col, newCellGroup);\n }\n }\n }\n}\n\nexport function checkFirstColMerge(col: number, proxy: SceneProxy) {\n for (let row = 0; row < proxy.table.rowCount; row++) {\n if (\n (row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||\n (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)\n ) {\n continue;\n }\n\n const range = getCellMergeInfo(proxy.table, col, row);\n // 清除之前mock的Merge cell\n range && clearHadMergedColumn(range.start.col, range.end.col, row, proxy);\n\n if (\n range &&\n range.start.col !== col &&\n proxy.highPerformanceGetCell(range.start.col, range.start.row, true).role !== 'cell'\n ) {\n // 在col的位置添加range.start.col单元格\n const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);\n const newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, true);\n\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.setAttribute(\n 'x',\n proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x\n );\n newCellGroup.setAttributes({\n x:\n proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) -\n oldCellGroup.parent.attribute.x,\n y: proxy.table.getRowsHeight(0, range.start.row - 1) - oldCellGroup.parent.attribute.y\n });\n\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n oldCellGroup.needUpdate = false;\n newCellGroup.needUpdate = false;\n\n // update cache\n if (proxy.cellCache.get(col)) {\n proxy.cellCache.set(col, newCellGroup);\n }\n }\n }\n}\n\nfunction clearHadMergedRow(rowStart: number, rowEnd: number, col: number, proxy: SceneProxy) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.row !== rowStart) {\n cellGroup.role = 'shadow-cell';\n cellGroup.setAttributes({\n width: 0,\n height: proxy.table.getRowHeight(cellGroup.row),\n y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1),\n x: 0\n });\n cellGroup.clear();\n }\n }\n}\n\nfunction clearHadMergedColumn(colStart: number, colEnd: number, row: number, proxy: SceneProxy) {\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.col !== colStart) {\n cellGroup.role = 'shadow-cell';\n cellGroup.setAttributes({\n width: 0,\n height: proxy.table.getRowHeight(cellGroup.row),\n y: proxy.table.getRowsHeight(0, cellGroup.row - 1),\n x: 0\n });\n cellGroup.clear();\n }\n }\n}\n\nfunction checkHasColMerge(colStart: number, colEnd: number, row: number, proxy: SceneProxy) {\n for (let col = colStart; col <= colEnd; col++) {\n if (\n proxy.highPerformanceGetCell(col, row, true).role !== 'shadow-cell' &&\n proxy.highPerformanceGetCell(col, row, true).role !== 'empty'\n ) {\n return true;\n }\n }\n return false;\n}\n\nexport function getFirstChild(containerGroup: Group): Group {\n let child = containerGroup.firstChild as Group;\n while (child.type !== 'group') {\n child = child._next as Group;\n }\n return child;\n}\n\nexport function getLastChild(containerGroup: Group): Group {\n let child = containerGroup.lastChild as Group;\n while (child.type !== 'group') {\n child = child._prev as Group;\n }\n return child;\n}\n\nexport function getPrevGroup(group: Group): Group {\n let child = group._prev as Group;\n while (child && child.type !== 'group') {\n child = child._prev as Group;\n }\n return child;\n}\n\nexport function getNextGroup(group: Group): Group {\n let child = group._next as Group;\n while (child && child.type !== 'group') {\n child = child._next as Group;\n }\n return child;\n}\n"]}
@@ -11,29 +11,31 @@ export function handleTextStick(table) {
11
11
  }));
12
12
  })), changedCells.length = 0;
13
13
  const {scrollTop: scrollTop, scrollLeft: scrollLeft, frozenRowCount: frozenRowCount, frozenColCount: frozenColCount} = table, frozenRowsHeight = table.getFrozenRowsHeight(), frozenColsWidth = table.getFrozenColsWidth(), {row: rowStart} = table.getRowAt(scrollTop + frozenRowsHeight + 1), {col: colStart} = table.getColAt(scrollLeft + frozenColsWidth + 1), rowEnd = table.getAllRowsHeight() > table.tableNoFrameHeight ? table.getRowAt(scrollTop + table.tableNoFrameHeight - 1).row : table.rowCount - 1, colEnd = table.getAllColsWidth() > table.tableNoFrameWidth ? table.getColAt(scrollLeft + table.tableNoFrameWidth - 1).col : table.colCount - 1;
14
- for (let row = 0; row < frozenRowCount; row++) for (let col = colStart; col <= colEnd; col++) if (null === (_a = table._getCellStyle(col, row)) || void 0 === _a ? void 0 : _a.textStick) {
15
- adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX),
16
- changedCells.push({
17
- col: col,
18
- row: row
19
- });
20
- }
21
- if (-1 !== rowStart) {
22
- for (let row = rowStart; row <= rowEnd; row++) for (let col = 0; col < frozenColCount; col++) if ((null === (_b = table._getCellStyle(col, row)) || void 0 === _b ? void 0 : _b.textStick) && "tree" !== table.internalProps.layoutMap.rowHierarchyType) {
23
- adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY),
14
+ if (!(colEnd < 0 || rowEnd < 0)) {
15
+ for (let row = 0; row < frozenRowCount; row++) for (let col = colStart; col <= colEnd; col++) if (null === (_a = table._getCellStyle(col, row)) || void 0 === _a ? void 0 : _a.textStick) {
16
+ adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX),
24
17
  changedCells.push({
25
18
  col: col,
26
19
  row: row
27
20
  });
28
21
  }
29
- for (let row = rowStart; row <= rowEnd; row++) for (let col = colStart; col <= colEnd; col++) if (null === (_c = table._getCellStyle(col, row)) || void 0 === _c ? void 0 : _c.textStick) {
30
- const cellGroup = table.scenegraph.getCell(col, row);
31
- adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY),
32
- adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX),
33
- changedCells.push({
34
- col: col,
35
- row: row
36
- });
22
+ if (-1 !== rowStart) {
23
+ for (let row = rowStart; row <= rowEnd; row++) for (let col = 0; col < frozenColCount; col++) if ((null === (_b = table._getCellStyle(col, row)) || void 0 === _b ? void 0 : _b.textStick) && "tree" !== table.internalProps.layoutMap.rowHierarchyType) {
24
+ adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY),
25
+ changedCells.push({
26
+ col: col,
27
+ row: row
28
+ });
29
+ }
30
+ for (let row = rowStart; row <= rowEnd; row++) for (let col = colStart; col <= colEnd; col++) if (null === (_c = table._getCellStyle(col, row)) || void 0 === _c ? void 0 : _c.textStick) {
31
+ const cellGroup = table.scenegraph.getCell(col, row);
32
+ adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY),
33
+ adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX),
34
+ changedCells.push({
35
+ col: col,
36
+ row: row
37
+ });
38
+ }
37
39
  }
38
40
  }
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/stick-text/index.ts"],"names":[],"mappings":"AAMA,MAAM,YAAY,GAAmC,EAAE,CAAC;AACxD,MAAM,UAAU,eAAe,CAAC,KAAmB;;IACjD,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACrE,SAAS,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,KAAK,CAAC,aAAa,CAAC;gBAClB,EAAE,EAAE,CAAC;gBACL,EAAE,EAAE,CAAC;aACN,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;IAExB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACxE,MAAM,gBAAgB,GAAG,KAAK,CAAC,mBAAmB,EAAE,CAAC;IACrD,MAAM,eAAe,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;IAEnD,MAAM,EAAE,GAAG,EAA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AAC;SACb;KACF;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,MAAM,KAAI,MAAC,MAAM,CAAC,KAA0B,0CAAE,SAAS,CAAA,EAAE;YAC3D,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"index.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport type { WrapText } from '../graphic/text';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { ITextStyleOption } from '../../ts-types';\nconst changedCells: { col: number; row: number }[] = [];\nexport function handleTextStick(table: BaseTableAPI) {\n changedCells.forEach(cellPos => {\n const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dy: 0,\n dx: 0\n });\n });\n });\n changedCells.length = 0;\n\n const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;\n const frozenRowsHeight = table.getFrozenRowsHeight();\n const frozenColsWidth = table.getFrozenColsWidth();\n // 计算非冻结\n const { row: rowStart } = table.getRowAt(scrollTop + frozenRowsHeight + 1);\n const { col: colStart } = table.getColAt(scrollLeft + frozenColsWidth + 1);\n const rowEnd =\n table.getAllRowsHeight() > table.tableNoFrameHeight\n ? table.getRowAt(scrollTop + table.tableNoFrameHeight - 1).row\n : table.rowCount - 1;\n const colEnd =\n table.getAllColsWidth() > table.tableNoFrameWidth\n ? table.getColAt(scrollLeft + table.tableNoFrameWidth - 1).col\n : table.colCount - 1;\n // 列表头单元格\n for (let row = 0; row < frozenRowCount; row++) {\n for (let col = colStart; col <= colEnd; col++) {\n if (table._getCellStyle(col, row)?.textStick) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell Horizontal\n adjustCellContentHorizontalLayout(\n cellGroup,\n frozenColsWidth + table.tableX,\n table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX\n );\n changedCells.push({ col, row });\n }\n }\n }\n\n if (rowStart === -1) {\n return;\n }\n // 行表头单元格\n for (let row = rowStart; row <= rowEnd; row++) {\n for (let col = 0; col < frozenColCount; col++) {\n if (\n table._getCellStyle(col, row)?.textStick &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).rowHierarchyType !== 'tree'\n ) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell vertical\n adjustCellContentVerticalLayout(\n cellGroup,\n frozenRowsHeight + table.tableY,\n table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY\n );\n changedCells.push({ col, row });\n }\n }\n }\n // body单元格\n for (let row = rowStart; row <= rowEnd; row++) {\n for (let col = colStart; col <= colEnd; col++) {\n if (table._getCellStyle(col, row)?.textStick) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell vertical\n adjustCellContentVerticalLayout(\n cellGroup,\n frozenRowsHeight + table.tableY,\n table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY\n );\n // adjust cell Horizontal\n adjustCellContentHorizontalLayout(\n cellGroup,\n frozenColsWidth + table.tableX,\n table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX\n );\n changedCells.push({ col, row });\n }\n }\n }\n}\n\n/*\n * adjust cell content vertical layout\n * @param {Group} cellGroup\n * @param {number} scrollTop\n */\nfunction adjustCellContentVerticalLayout(cellGroup: Group, minTop: number, maxTop: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textTop = text.globalAABBBounds.y1;\n const textBottom = text.globalAABBBounds.y2;\n\n if (textTop < minTop) {\n const deltaHeight = textTop - minTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight + 2); // 2 is the buffer\n });\n } else if (textBottom > maxTop) {\n const deltaHeight = textBottom - maxTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight); // 2 is the buffer\n });\n }\n}\n\n/*\n * adjust cell content horizontal layout\n * @param {Group} cellGroup\n * @param {number} scrollLeft\n */\nfunction adjustCellContentHorizontalLayout(cellGroup: Group, minLeft: number, maxLeft: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textLeft = text.globalAABBBounds.x1;\n const textRight = text.globalAABBBounds.x2;\n if (textLeft < minLeft) {\n const deltaWidth = textLeft - minLeft;\n // text is out of view, move all elements right\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth + 2); // 2 is the buffer\n });\n } else if (textRight > maxLeft) {\n const deltaWidth = textRight - maxLeft;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth); // 2 is the buffer\n });\n }\n}\n\nexport function checkHaveTextStick(table: BaseTableAPI) {\n const headerObjects = table.internalProps.layoutMap.headerObjects;\n const columnObjects = table.internalProps.layoutMap.columnObjects;\n for (let i = 0; i < headerObjects.length; i++) {\n const header = headerObjects[i];\n if (header && (header.style as ITextStyleOption)?.textStick) {\n return true;\n }\n }\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if (column && (column.style as ITextStyleOption)?.textStick) {\n return true;\n }\n }\n return false;\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/stick-text/index.ts"],"names":[],"mappings":"AAMA,MAAM,YAAY,GAAmC,EAAE,CAAC;AACxD,MAAM,UAAU,eAAe,CAAC,KAAmB;;IACjD,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC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AAS,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAmB;;IACpD,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC;IAClE,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC;IAClE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,MAAM,KAAI,MAAC,MAAM,CAAC,KAA0B,0CAAE,SAAS,CAAA,EAAE;YAC3D,OAAO,IAAI,CAAC;SACb;KACF;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,MAAM,KAAI,MAAC,MAAM,CAAC,KAA0B,0CAAE,SAAS,CAAA,EAAE;YAC3D,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"index.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport type { WrapText } from '../graphic/text';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { ITextStyleOption } from '../../ts-types';\nconst changedCells: { col: number; row: number }[] = [];\nexport function handleTextStick(table: BaseTableAPI) {\n changedCells.forEach(cellPos => {\n const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dy: 0,\n dx: 0\n });\n });\n });\n changedCells.length = 0;\n\n const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;\n const frozenRowsHeight = table.getFrozenRowsHeight();\n const frozenColsWidth = table.getFrozenColsWidth();\n // 计算非冻结\n const { row: rowStart } = table.getRowAt(scrollTop + frozenRowsHeight + 1);\n const { col: colStart } = table.getColAt(scrollLeft + frozenColsWidth + 1);\n const rowEnd =\n table.getAllRowsHeight() > table.tableNoFrameHeight\n ? table.getRowAt(scrollTop + table.tableNoFrameHeight - 1).row\n : table.rowCount - 1;\n const colEnd =\n table.getAllColsWidth() > table.tableNoFrameWidth\n ? table.getColAt(scrollLeft + table.tableNoFrameWidth - 1).col\n : table.colCount - 1;\n if (colEnd < 0 || rowEnd < 0) {\n return;\n }\n // 列表头单元格\n for (let row = 0; row < frozenRowCount; row++) {\n for (let col = colStart; col <= colEnd; col++) {\n if (table._getCellStyle(col, row)?.textStick) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell Horizontal\n adjustCellContentHorizontalLayout(\n cellGroup,\n frozenColsWidth + table.tableX,\n table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX\n );\n changedCells.push({ col, row });\n }\n }\n }\n\n if (rowStart === -1) {\n return;\n }\n // 行表头单元格\n for (let row = rowStart; row <= rowEnd; row++) {\n for (let col = 0; col < frozenColCount; col++) {\n if (\n table._getCellStyle(col, row)?.textStick &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).rowHierarchyType !== 'tree'\n ) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell vertical\n adjustCellContentVerticalLayout(\n cellGroup,\n frozenRowsHeight + table.tableY,\n table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY\n );\n changedCells.push({ col, row });\n }\n }\n }\n // body单元格\n for (let row = rowStart; row <= rowEnd; row++) {\n for (let col = colStart; col <= colEnd; col++) {\n if (table._getCellStyle(col, row)?.textStick) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell vertical\n adjustCellContentVerticalLayout(\n cellGroup,\n frozenRowsHeight + table.tableY,\n table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY\n );\n // adjust cell Horizontal\n adjustCellContentHorizontalLayout(\n cellGroup,\n frozenColsWidth + table.tableX,\n table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX\n );\n changedCells.push({ col, row });\n }\n }\n }\n}\n\n/*\n * adjust cell content vertical layout\n * @param {Group} cellGroup\n * @param {number} scrollTop\n */\nfunction adjustCellContentVerticalLayout(cellGroup: Group, minTop: number, maxTop: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textTop = text.globalAABBBounds.y1;\n const textBottom = text.globalAABBBounds.y2;\n\n if (textTop < minTop) {\n const deltaHeight = textTop - minTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight + 2); // 2 is the buffer\n });\n } else if (textBottom > maxTop) {\n const deltaHeight = textBottom - maxTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight); // 2 is the buffer\n });\n }\n}\n\n/*\n * adjust cell content horizontal layout\n * @param {Group} cellGroup\n * @param {number} scrollLeft\n */\nfunction adjustCellContentHorizontalLayout(cellGroup: Group, minLeft: number, maxLeft: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textLeft = text.globalAABBBounds.x1;\n const textRight = text.globalAABBBounds.x2;\n if (textLeft < minLeft) {\n const deltaWidth = textLeft - minLeft;\n // text is out of view, move all elements right\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth + 2); // 2 is the buffer\n });\n } else if (textRight > maxLeft) {\n const deltaWidth = textRight - maxLeft;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth); // 2 is the buffer\n });\n }\n}\n\nexport function checkHaveTextStick(table: BaseTableAPI) {\n const headerObjects = table.internalProps.layoutMap.headerObjects;\n const columnObjects = table.internalProps.layoutMap.columnObjects;\n for (let i = 0; i < headerObjects.length; i++) {\n const header = headerObjects[i];\n if (header && (header.style as ITextStyleOption)?.textStick) {\n return true;\n }\n }\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if (column && (column.style as ITextStyleOption)?.textStick) {\n return true;\n }\n }\n return false;\n}\n"]}
package/es/themes/DARK.js CHANGED
@@ -78,7 +78,7 @@ export default {
78
78
  hoverBgColor: "#EEE"
79
79
  },
80
80
  selectionStyle: {
81
- cellBgColor: "#29364D",
81
+ cellBgColor: "rgba(255, 255, 255, 0.1)",
82
82
  cellBorderColor: "#4284FF",
83
83
  cellBorderLineWidth: 2
84
84
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["themes/DARK.ts"],"names":[],"mappings":"AAEA,SAAS,kBAAkB,CAAC,IAA8B;IACxD,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAI5B,MAAM,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC,cAAc,CAAC;IACzC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAOD,eAAe;IACb,uBAAuB,EAAE,MAAM;IAE/B,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QACvB,KAAK,EAAE;YAC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Q,EAAE,EAAE;QACZ,UAAU,EAAE,YAAY;QACxB,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,MAAM;KACrB;IACD,cAAc,EAAE;QACd,WAAW,EAAE,SAAS;QAEtB,eAAe,EAAE,SAAS;QAC1B,mBAAmB,EAAE,CAAC;KACvB;CACmB,CAAC","file":"DARK.js","sourcesContent":["import type { ITableThemeDefine, StylePropertyFunctionArg } from '../ts-types';\n\nfunction getBackgroundColor(args: StylePropertyFunctionArg): string {\n const { row, table } = args;\n // if (row < table.frozenRowCount) {\n // return \"#FFF\";\n // }\n const index = row - table.frozenRowCount;\n if (!(index & 1)) {\n return '#2d3137';\n }\n return '#282a2e';\n}\n\n/**\n * dark theme\n * @name DARK\n * @memberof VTable.themes.DARK\n */\nexport default {\n underlayBackgroundColor: '#FFF',\n // selectionBgColor: '#CCE0FF',\n defaultStyle: {\n color: '#D3D5DA',\n bgColor: '#373b45',\n fontSize: 12,\n fontFamily: 'PingFang SC',\n fontWeight: 500,\n lineHeight: 12,\n borderColor: '#444A54',\n padding: [8, 12, 8, 12],\n hover: {\n cellBgColor: '#2F4774'\n }\n // click: {\n // cellBgColor: 'rgba(0, 0, 255,0.1)',\n // // inlineColumnBgColor: \"#82b2f5\",\n // cellBorderColor: '#4284FF',\n // cellBorderLineWidth: 2,\n // },\n },\n headerStyle: {\n color: '#D3D5DA',\n bgColor: '#373b45',\n fontSize: 12,\n fontFamily: 'PingFang SC',\n fontWeight: 500,\n lineHeight: 12,\n borderColor: '#444A54',\n padding: [8, 12, 8, 12],\n hover: {\n cellBgColor: '#2F4774'\n }\n // click: {\n // cellBgColor: '#2F4774',\n // // inlineColumnBgColor: \"#82b2f5\",\n // cellBorderColor: '#4284FF',\n // cellBorderLineWidth: 2,\n // },\n },\n rowHeaderStyle: {},\n cornerHeaderStyle: {},\n bodyStyle: {\n color: '#e5e7ea',\n bgColor: getBackgroundColor,\n fontSize: 12,\n fontFamily: 'PingFang SC',\n fontWeight: 500,\n lineHeight: 12,\n borderColor: '#444A54',\n padding: [8, 12, 8, 12],\n hover: {\n cellBgColor: '#29364D'\n }\n // click: {\n // cellBgColor: '#29364D',\n // // inlineColumnBgColor: \"#82b2f5\",\n // cellBorderColor: '#4284FF',\n // cellBorderLineWidth: 2,\n // },\n },\n frameStyle: {\n borderColor: '#d1d5da',\n borderLineWidth: 1,\n borderLineDash: [],\n cornerRadius: 10,\n shadowBlur: 6,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: 'rgba(00, 24, 47, 0.06)'\n },\n columnResize: {\n lineWidth: 1,\n lineColor: '#416EFF',\n bgColor: '#D9E2FF',\n width: 3\n },\n frozenColumnLine: {\n shadow: {\n width: 4,\n startColor: 'rgba(00, 24, 47, 0.05)',\n endColor: 'rgba(00, 24, 47, 0)'\n }\n },\n menuStyle: {\n color: '#000',\n highlightColor: '#2E68CF',\n fontSize: 12,\n fontFamily: 'sans-serif',\n highlightFont: '12px sans-serif',\n hoverBgColor: '#EEE'\n },\n selectionStyle: {\n cellBgColor: '#29364D',\n // inlineColumnBgColor: \"#82b2f5\",\n cellBorderColor: '#4284FF',\n cellBorderLineWidth: 2\n }\n} as ITableThemeDefine;\n"]}
1
+ {"version":3,"sources":["themes/DARK.ts"],"names":[],"mappings":"AAEA,SAAS,kBAAkB,CAAC,IAA8B;IACxD,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAI5B,MAAM,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC,cAAc,CAAC;IACzC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAOD,eAAe;IACb,uBAAuB,EAAE,MAAM;IAE/B,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,aAAa;QACzB,UAAU,E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,EAAE,CAAC;YACR,UAAU,EAAE,wBAAwB;YACpC,QAAQ,EAAE,qBAAqB;SAChC;KACF;IACD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;QACb,cAAc,EAAE,SAAS;QACzB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,YAAY;QACxB,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,MAAM;KACrB;IACD,cAAc,EAAE;QACd,WAAW,EAAE,0BAA0B;QAEvC,eAAe,EAAE,SAAS;QAC1B,mBAAmB,EAAE,CAAC;KACvB;CACmB,CAAC","file":"DARK.js","sourcesContent":["import type { ITableThemeDefine, StylePropertyFunctionArg } from '../ts-types';\n\nfunction getBackgroundColor(args: StylePropertyFunctionArg): string {\n const { row, table } = args;\n // if (row < table.frozenRowCount) {\n // return \"#FFF\";\n // }\n const index = row - table.frozenRowCount;\n if (!(index & 1)) {\n return '#2d3137';\n }\n return '#282a2e';\n}\n\n/**\n * dark theme\n * @name DARK\n * @memberof VTable.themes.DARK\n */\nexport default {\n underlayBackgroundColor: '#FFF',\n // selectionBgColor: '#CCE0FF',\n defaultStyle: {\n color: '#D3D5DA',\n bgColor: '#373b45',\n fontSize: 12,\n fontFamily: 'PingFang SC',\n fontWeight: 500,\n lineHeight: 12,\n borderColor: '#444A54',\n padding: [8, 12, 8, 12],\n hover: {\n cellBgColor: '#2F4774'\n }\n // click: {\n // cellBgColor: 'rgba(0, 0, 255,0.1)',\n // // inlineColumnBgColor: \"#82b2f5\",\n // cellBorderColor: '#4284FF',\n // cellBorderLineWidth: 2,\n // },\n },\n headerStyle: {\n color: '#D3D5DA',\n bgColor: '#373b45',\n fontSize: 12,\n fontFamily: 'PingFang SC',\n fontWeight: 500,\n lineHeight: 12,\n borderColor: '#444A54',\n padding: [8, 12, 8, 12],\n hover: {\n cellBgColor: '#2F4774'\n }\n // click: {\n // cellBgColor: '#2F4774',\n // // inlineColumnBgColor: \"#82b2f5\",\n // cellBorderColor: '#4284FF',\n // cellBorderLineWidth: 2,\n // },\n },\n rowHeaderStyle: {},\n cornerHeaderStyle: {},\n bodyStyle: {\n color: '#e5e7ea',\n bgColor: getBackgroundColor,\n fontSize: 12,\n fontFamily: 'PingFang SC',\n fontWeight: 500,\n lineHeight: 12,\n borderColor: '#444A54',\n padding: [8, 12, 8, 12],\n hover: {\n cellBgColor: '#29364D'\n }\n // click: {\n // cellBgColor: '#29364D',\n // // inlineColumnBgColor: \"#82b2f5\",\n // cellBorderColor: '#4284FF',\n // cellBorderLineWidth: 2,\n // },\n },\n frameStyle: {\n borderColor: '#d1d5da',\n borderLineWidth: 1,\n borderLineDash: [],\n cornerRadius: 10,\n shadowBlur: 6,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: 'rgba(00, 24, 47, 0.06)'\n },\n columnResize: {\n lineWidth: 1,\n lineColor: '#416EFF',\n bgColor: '#D9E2FF',\n width: 3\n },\n frozenColumnLine: {\n shadow: {\n width: 4,\n startColor: 'rgba(00, 24, 47, 0.05)',\n endColor: 'rgba(00, 24, 47, 0)'\n }\n },\n menuStyle: {\n color: '#000',\n highlightColor: '#2E68CF',\n fontSize: 12,\n fontFamily: 'sans-serif',\n highlightFont: '12px sans-serif',\n hoverBgColor: '#EEE'\n },\n selectionStyle: {\n cellBgColor: 'rgba(255, 255, 255, 0.1)',\n // inlineColumnBgColor: \"#82b2f5\",\n cellBorderColor: '#4284FF',\n cellBorderLineWidth: 2\n }\n} as ITableThemeDefine;\n"]}
@@ -36,7 +36,7 @@ export default {
36
36
  },
37
37
  selectionStyle: {
38
38
  cellBorderColor: "#FD5",
39
- cellBgColor: "#6FA8DC"
39
+ cellBgColor: "rgba(111, 168, 220, 0.1)"
40
40
  }
41
41
  };
42
42
  //# sourceMappingURL=SIMPLIFY.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["themes/SIMPLIFY.ts"],"names":[],"mappings":"AAIA,SAAS,wBAAwB,CAAC,IAA8B;IAC9D,MAAM,EACJ,GAAG,EACH,KAA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SAAS;QACpB,OAAO,EAAE,SAAS;KACnB;IACD,cAAc,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;CAC/C,CAAC","file":"SIMPLIFY.js","sourcesContent":["/*eslint no-bitwise:0*/\n\nimport type { ITableThemeDefine, StylePropertyFunctionArg } from '../ts-types';\n\nfunction getFrozenRowsBorderColor(args: StylePropertyFunctionArg): string[] {\n const {\n row,\n table: { frozenRowCount }\n } = args;\n if (frozenRowCount - 1 === row) {\n return ['#f2f2f2', '#f2f2f2', '#ccc7c7', '#f2f2f2'];\n }\n return ['#f2f2f2'];\n}\nfunction getBorderColor(args: StylePropertyFunctionArg): (string | null)[] {\n const { col, table } = args;\n const { colCount, frozenColCount } = table;\n const top: string | null = '#ccc7c7';\n const bottom: string | null = '#ccc7c7';\n // if (recordRowCount > 1) {\n // const startRow = table.getRecordStartRowByRecordIndex(row);\n // const endRow = startRow + recordRowCount - 1;\n // if (startRow !== row) {\n // top = null;\n // }\n // if (endRow !== row) {\n // bottom = null;\n // }\n // }\n if (frozenColCount - 1 === col) {\n return [top, '#f2f2f2', bottom, null];\n }\n if (colCount - 1 === col) {\n return [top, '#f2f2f2', bottom, null];\n }\n\n return [top, null, bottom, null];\n}\n/**\n * material design theme\n * @name SIMPLIFY\n * @memberof VTable.themes.choices\n */\nexport default {\n // selectionBgColor: '#CCE0FF',\n underlayBackgroundColor: '#FFF',\n\n defaultStyle: {\n borderColor: getBorderColor,\n // click: { cellBorderColor: '#FD5', cellBgColor: '#6FA8DC' },\n hover: { cellBorderColor: '#0000FF', cellBgColor: '#D0E0E3' },\n bgColor: '#FFF'\n },\n headerStyle: {\n color: 'rgba(0, 0, 0, 0.87)',\n borderColor: getFrozenRowsBorderColor\n },\n bodyStyle: {\n // rowsBgColor:'#FFF',\n color: 'rgba(0, 0, 0, 0.87)'\n },\n frameStyle: {\n borderColor: '#f2f2f2',\n borderLineWidth: 1\n },\n columnResize: {\n lineWidth: 1,\n lineCol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AAE,qBAAqB;QAC5B,WAAW,EAAE,wBAAwB;KACtC;IACD,SAAS,EAAE;QAET,KAAK,EAAE,qBAAqB;KAC7B;IACD,UAAU,EAAE;QACV,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,CAAC;KACnB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,SAAS;KACnB;IACD,cAAc,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;CAChE,CAAC","file":"SIMPLIFY.js","sourcesContent":["/*eslint no-bitwise:0*/\n\nimport type { ITableThemeDefine, StylePropertyFunctionArg } from '../ts-types';\n\nfunction getFrozenRowsBorderColor(args: StylePropertyFunctionArg): string[] {\n const {\n row,\n table: { frozenRowCount }\n } = args;\n if (frozenRowCount - 1 === row) {\n return ['#f2f2f2', '#f2f2f2', '#ccc7c7', '#f2f2f2'];\n }\n return ['#f2f2f2'];\n}\nfunction getBorderColor(args: StylePropertyFunctionArg): (string | null)[] {\n const { col, table } = args;\n const { colCount, frozenColCount } = table;\n const top: string | null = '#ccc7c7';\n const bottom: string | null = '#ccc7c7';\n // if (recordRowCount > 1) {\n // const startRow = table.getRecordStartRowByRecordIndex(row);\n // const endRow = startRow + recordRowCount - 1;\n // if (startRow !== row) {\n // top = null;\n // }\n // if (endRow !== row) {\n // bottom = null;\n // }\n // }\n if (frozenColCount - 1 === col) {\n return [top, '#f2f2f2', bottom, null];\n }\n if (colCount - 1 === col) {\n return [top, '#f2f2f2', bottom, null];\n }\n\n return [top, null, bottom, null];\n}\n/**\n * material design theme\n * @name SIMPLIFY\n * @memberof VTable.themes.choices\n */\nexport default {\n // selectionBgColor: '#CCE0FF',\n underlayBackgroundColor: '#FFF',\n\n defaultStyle: {\n borderColor: getBorderColor,\n // click: { cellBorderColor: '#FD5', cellBgColor: '#6FA8DC' },\n hover: { cellBorderColor: '#0000FF', cellBgColor: '#D0E0E3' },\n bgColor: '#FFF'\n },\n headerStyle: {\n color: 'rgba(0, 0, 0, 0.87)',\n borderColor: getFrozenRowsBorderColor\n },\n bodyStyle: {\n // rowsBgColor:'#FFF',\n color: 'rgba(0, 0, 0, 0.87)'\n },\n frameStyle: {\n borderColor: '#f2f2f2',\n borderLineWidth: 1\n },\n columnResize: {\n lineWidth: 1,\n lineColor: '#416EFF',\n bgColor: '#D9E2FF'\n },\n selectionStyle: { cellBorderColor: '#FD5', cellBgColor: 'rgba(111, 168, 220, 0.1)' }\n} as ITableThemeDefine;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/base-table.ts"],"names":[],"mappings":"","file":"base-table.js","sourcesContent":["import type { ITextSize } from '@visactor/vutils';\nimport type { RectProps, MaybePromiseOrUndefined, ICellHeaderPaths, CellInfo } from './common';\nimport type {\n TableEventListener,\n TableEventHandlersEventArgumentMap,\n TableEventHandlersReturnMap,\n EventListenerId,\n MousePointerCellEvent\n} from './events';\nimport type { MenuListItem, DropDownMenuEventInfo, DropDownMenuHighlightInfo } from './menu';\nimport type { CellStyle } from './style-define';\nimport type { ColumnIconOption } from './icon';\nimport type { ColumnData, ColumnDefine, ColumnsDefine, HeaderData, IndicatorData } from './list-table/layout-map/api';\nexport type { HeaderData } from './list-table/layout-map/api';\nimport type { TableTheme } from '../themes/theme';\nimport type { ICustomRender } from './customElement';\nexport type LayoutObjectId = number | string;\nimport type { Rect } from '../tools/Rect';\nimport type { Scenegraph } from '../scenegraph/scenegraph';\nimport type { StateManeger } from '../state/state';\nimport type { EventManeger } from '../event/event';\nimport type {\n CellAddress,\n CellRange,\n CellLocation,\n ColumnTypeOption,\n DataSourceAPI,\n FieldData,\n FieldDef,\n FieldFormat,\n FullExtendStyle,\n HeaderValues,\n HeightModeDef,\n HierarchyState,\n IDataConfig,\n IPagination,\n ITableThemeDefine,\n SortState,\n TableKeyboardOptions,\n WidthModeDef,\n IHeaderTreeDefine,\n IDimension,\n IIndicator\n} from '.';\nimport type { TooltipOptions } from './tooltip';\nimport type { IWrapTextGraphicAttribute } from '../scenegraph/graphic/text';\nimport type { ICustomLayout } from './customLayout';\nimport type { CachedDataSource, DataSource } from '../data';\nimport type { MenuHandler } from '../components/menu/dom/MenuHandler';\nimport type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout';\nimport type { SimpleHeaderLayoutMap } from '../layout';\nimport type { TooltipHandler } from '../components/tooltip/TooltipHandler';\nimport type { BodyHelper } from '../body-helper/body-helper';\nimport type { HeaderHelper } from '../header-helper/header-helper';\nimport type { EventHandler } from '../event/EventHandler';\nimport type { NumberMap } from '../tools/NumberMap';\nimport type { FocusInput } from '../core/FouseInput';\nimport type { ITableLegendOption } from './component/legend';\nimport type { DataSet } from '@visactor/vdataset';\nimport type { Title } from '../components/title/title';\nimport type { ITitle } from './component/title';\nimport type { DiscreteTableLegend } from '../components/legend/discrete-legend/discrete-legend';\nimport type { ContinueTableLegend } from '../components/legend/continue-legend/continue-legend';\n\nexport interface IBaseTableProtected {\n element: HTMLElement;\n // scrollable: Scrollable;\n handler: EventHandler;\n focusControl: FocusInput;\n canvas: HTMLCanvasElement;\n context: CanvasRenderingContext2D;\n rowCount: number;\n colCount: number;\n frozenColCount: number;\n allowFrozenColCount: number;\n\n frozenRowCount: number;\n rightFrozenColCount: number;\n bottomFrozenRowCount: number;\n defaultRowHeight: number;\n /**表头默认行高 可以按逐行设置 如果没有就取defaultRowHeight */\n defaultHeaderRowHeight: (number | 'auto') | (number | 'auto')[];\n defaultColWidth: number;\n defaultHeaderColWidth: (number | 'auto') | (number | 'auto')[];\n // font?: string;\n // underlayBackgroundColor?: string;\n keyboardOptions?: TableKeyboardOptions;\n\n // disableRowHeaderColumnResize?: boolean;\n // 列宽调整模式(全列调整;全列不可调整;仅表头单元格可调整;仅内容单元格可调整)\n columnResizeMode?: 'all' | 'none' | 'header' | 'body';\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n /** 控制拖拽表头移动位置顺序开关 */\n dragHeaderMode?: 'all' | 'none' | 'column' | 'row';\n\n cachedRecordsRowHeightMap: NumberMap<string | number>; //存储每一条记录对应行的行高,只有当设置为自动换行随内容撑开才会起作用\n // headerRowHeightsMap: NumberMap<number>; //目前是用来存储了表头各行的高度,从headerRowHeight计算而来,headerRowHeight可以设置为数组的形式\n _rowHeightsMap: NumberMap<number>; //存储数据条目每行高度\n _colWidthsMap: NumberMap<string | number>; //存储各列的宽度\n _colContentWidthsMap: NumberMap<string | number>; //存储各列的内容宽度\n _colWidthsLimit: {\n //存储各列的宽度限制\n [col: number]: {\n max?: string | number;\n min?: string | number;\n };\n };\n calcWidthContext: {\n _: IBaseTableProtected;\n full: number;\n // em: number;\n };\n\n _rowRangeHeightsMap: Map<string, number>; //存储指定行范围的总高度\n _colRangeWidthsMap: Map<string, number>; //存储指定列范围的总宽度\n\n _widthResizedColMap: Set<number>; //记录下被手动调整过列宽的列号\n\n bodyHelper: BodyHelper;\n headerHelper: HeaderHelper;\n\n cellTextOverflows: { [at: string]: string };\n // headerDescriptions: { [at: string]: string };\n focusedTable: boolean;\n\n config:\n | {\n [name: string]: any;\n }\n | undefined;\n // scroll: {\n // left: number;\n // top: number;\n // };\n releaseList?: { release: () => void }[] | null;\n theme: TableTheme;\n transpose?: boolean; //是否转置\n // autoRowHeight?: boolean; //是否自动撑开高度 对于设置了autoWrapText的multilineText的列生效\n pixelRatio?: number;\n /** 下拉菜单的相关配置。消失时机:显示后点击菜单区域外自动消失*/\n menu: {\n /** 代替原来的option.menuType */\n renderMode?: 'canvas' | 'html';\n /** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/\n defaultHeaderMenuItems?: MenuListItem[];\n /** 右键菜单。代替原来的option.contextmenu */\n contextMenuItems?: MenuListItem[] | ((field: FieldDef, row: number) => MenuListItem[]);\n /** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */\n dropDownMenuHighlight?: DropDownMenuHighlightInfo[];\n };\n /** 提示弹框的相关配置。消失时机:显示后鼠标移动到指定区域外或者进入新的单元格后自动消失*/\n tooltip: {\n renderMode: 'html' | 'canvas';\n /** 代替原来hover:isShowTooltip配置 */\n isShowOverflowTextTooltip: boolean;\n /** 弹框是否需要限定在表格区域内 */\n confine: boolean;\n };\n\n dataSourceEventIds?: EventListenerId[];\n headerEvents?: EventListenerId[];\n layoutMap: SimpleHeaderLayoutMap | PivotHeaderLayoutMap;\n headerValues?: HeaderValues;\n tooltipHandler: TooltipHandler;\n\n // headerRowHeight: number[] | number;//移到了BaseTable\n sortState: SortState | SortState[];\n\n dataSource: DataSource | CachedDataSource;\n records?: any;\n allowRangePaste: boolean;\n //重新思考逻辑:如果为false,行高按设置的rowHeight;如果设置为true,则按lineHeight及是否自动换行综合计算行高 2021.11.19 by:lff\n\n autoWrapText?: boolean;\n\n menuHandler: MenuHandler;\n\n /**\n * 计算列宽时 指定最大列宽 可设置boolean或者具体的值 默认为450\n */\n limitMaxAutoWidth?: boolean | number;\n\n title?: Title;\n legends?: DiscreteTableLegend | ContinueTableLegend;\n\n //是否开启图表异步渲染\n renderChartAsync?: boolean;\n // // 开启图表异步渲染 每批次渐进渲染图表个数\n // renderChartAsyncBatchCount?: number;\n}\nexport interface BaseTableConstructorOptions {\n // /** 指定表格的行数 */\n // rowCount?: number;\n\n // /** 指定表格的列数 */\n // colCount?: number;\n /**\n * 当前需要冻结的列数 基本表格生效\n */\n frozenColCount?: number;\n rightFrozenColCount?: number;\n bottomFrozenRowCount?: number;\n\n // /** 待实现 TODO */\n // frozenRowCount?: number;\n /** 可冻结列数,表示前多少列会出现冻结操作按钮 基本表格生效 */\n allowFrozenColCount?: number;\n /**\n * 默认行高. 默认 40\n */\n defaultRowHeight?: number;\n /** 列表头默认行高 可以按逐行设置 如果没有就取defaultRowHeight */\n defaultHeaderRowHeight?: (number | 'auto') | (number | 'auto')[];\n /**\n * 默认列宽. 默认 80\n */\n defaultColWidth?: number;\n /** 行表头默认列宽 可以按逐列设置 如果没有就取defaultColWidth */\n defaultHeaderColWidth?: (number | 'auto') | (number | 'auto')[];\n /** 快捷键功能设置 */\n keyboardOptions?: TableKeyboardOptions;\n /**\n * Canvas container\n */\n container?: HTMLElement | null;\n\n /**\n * 调整列宽 可操作范围。'all' | 'none' | 'header' | 'body'; 整列间隔线|禁止调整|只能在表头处间隔线|只能在body间隔线\n */\n columnResizeMode?: 'all' | 'none' | 'header' | 'body';\n /** 控制拖拽表头移动位置顺序开关 */\n dragHeaderMode?: 'all' | 'none' | 'column' | 'row';\n /**\n * 是否显示固定列图钉 基本表格生效\n */\n showFrozenIcon?: boolean;\n\n padding?:\n | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n }\n | number;\n /** hover交互配置 */\n hover?: {\n /** hover交互响应模式:十字交叉 整列 整行 或者单个单元格 */\n highlightMode: 'cross' | 'column' | 'row' | 'cell';\n /** 不响应鼠标hover交互 */\n disableHover?: boolean;\n /** 单独设置表头不响应鼠标hover交互 */\n disableHeaderHover?: boolean;\n };\n /** 选择单元格交互配置 */\n select?: {\n /** 不响应鼠标select交互 */\n disableSelect?: boolean;\n /** 单独设置表头不响应鼠标select交互 */\n disableHeaderSelect?: boolean;\n };\n /** 下拉菜单的相关配置。消失时机:显示后点击菜单区域外自动消失*/\n menu?: {\n /** 代替原来的option.menuType html目前实现较完整 先默认html渲染方式*/\n renderMode?: 'canvas' | 'html';\n /** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/\n defaultHeaderMenuItems?: MenuListItem[];\n /** 右键菜单。代替原来的option.contextmenu */\n contextMenuItems?: MenuListItem[] | ((field: string, row: number) => MenuListItem[]);\n /** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */\n dropDownMenuHighlight?: DropDownMenuHighlightInfo[];\n };\n /** tooltip相关配置 */\n tooltip?: {\n /** html目前实现较完整 先默认html渲染方式 */\n renderMode?: 'html'; // 目前暂不支持canvas方案\n /** 代替原来hover:isShowTooltip配置 暂时需要将renderMode配置为html才能显示,canvas的还未开发*/\n isShowOverflowTextTooltip?: boolean;\n /** 是否将 tooltip 框限制在画布区域内,默认开启。针对renderMode:\"html\"有效 */\n confine?: boolean;\n };\n /**\n * Theme\n */\n theme?: ITableThemeDefine;\n /** 宽度模式 */\n widthMode?: 'standard' | 'adaptive' | 'autoWidth';\n /** 高度模式 */\n heightMode?: 'standard' | 'adaptive' | 'autoHeight';\n /** 当列宽度不能占满容器时,是否需要自动拉宽来填充容器的宽度。默认false */\n autoFillWidth?: boolean;\n /** 当行高度不能占满容器时,是否需要自动拉高来填充容器的高度。默认false */\n autoFillHeight?: boolean;\n // /** 行高是否根据内容来计算 */\n // autoRowHeight?: boolean;\n /** 设备的像素比 不配的话默认获取window.devicePixelRatio */\n pixelRatio?: number;\n /** 自定义渲染 函数形式*/\n customRender?: ICustomRender;\n /**\n * 传入用户实例化的数据对象 目前不完善\n */\n dataSource?: DataSource;\n\n /** 开启自动换行 默认false */\n autoWrapText?: boolean;\n /** 单元格中可显示最大字符数 默认200 */\n maxCharactersNumber?: number; //\n // /** toolip最大字符数 */\n // maxTooltipCharactersNumber?: number;\n /** 最大可操作条目数 如copy操作可复制出最大数据条目数 */\n maxOperatableRecordCount?: number;\n /**\n * 计算列宽时 指定最大列宽 可设置boolean或者具体的值 默认为450\n */\n limitMaxAutoWidth?: boolean | number;\n\n // maximum number of data items maintained in table instance\n maintainedDataCount?: number;\n\n legends?: ITableLegendOption;\n title?: ITitle;\n //是否开启图表异步渲染\n renderChartAsync?: boolean;\n // 开启图表异步渲染 每批次渐进渲染图表个数\n renderChartAsyncBatchCount?: number;\n}\nexport interface BaseTableAPI {\n /** 表格的行数 */\n rowCount: number;\n /** 表格的列数 */\n colCount: number;\n /** 表格除去外层frame后的宽度 */\n tableNoFrameWidth: number;\n /** 表格除去外层frame后的高度 */\n tableNoFrameHeight: number;\n /** 表格的冻结行数 包括表头在内 */\n frozenRowCount: number;\n /** 表格的冻结列数 包括表头在内 */\n frozenColCount: number;\n\n bottomFrozenRowCount: number;\n rightFrozenColCount: number;\n /** 当前表格默认表头行高 */\n defaultHeaderRowHeight: (number | 'auto') | (number | 'auto')[];\n /** 当前表格默认行高 */\n defaultRowHeight: number;\n /** 当前表格默认列宽 */\n defaultColWidth: number;\n /** 当前表格默认表头列宽 */\n defaultHeaderColWidth: (number | 'auto') | (number | 'auto')[];\n /** 当前表格快捷键设置 */\n keyboardOptions: TableKeyboardOptions | null;\n /**\n * 是否显示图钉\n */\n showFrozenIcon: boolean;\n readonly canvas: HTMLCanvasElement;\n /** 表格可视区域的行数 */\n readonly visibleRowCount: number;\n /** 表格可视区域的列数 */\n readonly visibleColCount: number;\n /** 表格滚动值left */\n scrollLeft: number;\n /** 表格滚动值top */\n scrollTop: number;\n /** 用户设置的options 不要修改这个这个 */\n options: BaseTableConstructorOptions;\n /** 设置的全局下拉菜单列表项配置 */\n globalDropDownMenu?: MenuListItem[];\n /** 设置的全局自定义渲染函数 */\n customRender?: ICustomRender;\n\n /** 表格数据管理对象 */\n dataSource: DataSourceAPI;\n /** 设置的表格主题 */\n theme: TableTheme;\n /** 可允许设置冻结的最大列数 */\n allowFrozenColCount: number;\n\n /** 存储内部用到的属性 变量等 */\n internalProps: IBaseTableProtected;\n /** 分页信息 */\n pagination?: IPagination;\n\n /** 表格偏移像素值 水平方向 */\n tableX: number;\n /** 表格偏移像素值 垂直方向 */\n tableY: number;\n /** 表格宽度模式 */\n widthMode: WidthModeDef;\n /** 表格宽度模式 */\n heightMode: HeightModeDef;\n /** 当列宽度不能占满容器时,是否需要自动拉宽来填充容器的宽度。默认false */\n autoFillWidth: boolean;\n /** 当行高度不能占满容器时,是否需要自动拉高来填充容器的高度。默认false */\n autoFillHeight?: boolean;\n\n isReleased: boolean;\n\n on: <TYPE extends keyof TableEventHandlersEventArgumentMap>(\n type: TYPE,\n listener: TableEventListener<TYPE> //(event: TableEventHandlersEventArgumentMap[TYPE]) => TableEventHandlersReturnMap[TYPE]\n ) => EventListenerId;\n // &(<T extends keyof TableEventHandlersEventArgumentMap>(type: string, listener: AnyListener<T>) => EventListenerId);\n\n _vDataSet: DataSet;\n /** 场景树对象 */\n scenegraph: Scenegraph;\n /** 状态管理模块 */\n stateManeger?: StateManeger;\n /** 事件管理模块 */\n eventManeger?: EventManeger;\n /** 行表头的层数 */\n rowHeaderLevelCount: number;\n /** 列表头的层数 */\n columnHeaderLevelCount: number;\n /** 获取表格绘制的范围 不包括frame的宽度 */\n getDrawRange: () => Rect;\n /** 将鼠标坐标值 转换成表格坐标系中的坐标位置 */\n _getMouseAbstractPoint: (\n evt: TouchEvent | MouseEvent | undefined,\n isAddScroll?: boolean\n ) => { x: number; y: number; inTable: boolean };\n getElement: () => HTMLElement;\n getContainer: () => HTMLElement;\n\n setFrozenColCount: (count: number) => void;\n _setFrozenColCount: (count: number) => void;\n _updateSize: () => void;\n\n render: () => void;\n throttleInvalidate: () => void;\n getRowHeight: (row: number) => number;\n getDefaultRowHeight: (row: number) => number | 'auto';\n setRowHeight: (row: number, height: number, clearCache?: boolean) => void;\n getColWidth: (col: number) => number;\n getColWidthDefined: (col: number) => string | number;\n // getColWidthDefine: (col: number) => string | number;\n setColWidth: (col: number, width: number | string, clearCache?: boolean, skipCheckFrozen?: boolean) => void;\n _getColContentWidth: (col: number) => number;\n _setColContentWidth: (col: number, width: number | string, clearCache?: boolean) => void;\n getMaxColWidth: (col: number) => number;\n setMaxColWidth: (col: number, maxwidth: string | number) => void;\n getMinColWidth: (col: number) => number;\n setMinColWidth: (col: number, minwidth: string | number) => void;\n getCellRect: (col: number, row: number) => RectProps;\n getCellRelativeRect: (col: number, row: number) => RectProps;\n getCellsRect: (startCol: number, startRow: number, endCol: number, endRow: number) => RectProps;\n getCellRangeRect: (cellRange: CellRange | CellAddress) => RectProps;\n getCellRangeRelativeRect: (cellRange: CellRange | CellAddress) => RectProps;\n getVisibleCellRangeRelativeRect: (cellRange: CellRange | CellAddress) => RectProps;\n isFrozenCell: (col: number, row: number) => { row: boolean; col: boolean } | null;\n getRowAt: (absoluteY: number) => { top: number; row: number; bottom: number };\n getColAt: (absoluteX: number) => { left: number; col: number; right: number };\n getCellAt: (absoluteX: number, absoluteY: number) => CellAddress;\n _makeVisibleCell: (col: number, row: number) => void;\n // setFocusCursor(col: number, row: number): void;\n // focusCell(col: number, row: number): void;\n getCellOverflowText: (col: number, row: number) => string | null;\n getColsWidth: (startCol: number, endCol: number) => number;\n getRowsHeight: (startRow: number, endRow: number) => number;\n\n release: () => void;\n addReleaseObj: (releaseObj: { release: () => void }) => void;\n _getCellStyle: (col: number, row: number) => FullExtendStyle;\n clearCellStyleCache: () => void;\n\n getFrozenRowsHeight: () => number;\n getFrozenColsWidth: () => number;\n getBottomFrozenRowsHeight: () => number;\n getRightFrozenColsWidth: () => number;\n selectCell: (col: number, row: number) => void;\n selectCells: (cellRanges: CellRange[]) => void;\n getAllRowsHeight: () => number;\n getAllColsWidth: () => number;\n\n off: (id: EventListenerId) => void;\n getBodyField: (col: number, row: number) => FieldDef | undefined;\n getRecordByRowCol: (col: number, row: number) => MaybePromiseOrUndefined;\n getRecordIndexByRow: (col: number, row: number) => number;\n getRecordStartRowByRecordIndex: (index: number) => number;\n\n getHeaderField: (col: number, row: number) => any | undefined;\n getHeaderFieldKey: (col: number, row: number) => any | undefined;\n\n _getHeaderCellBySortState: (sortState: SortState) => CellAddress | undefined;\n getHeaderDefine: (col: number, row: number) => ColumnDefine;\n _getHeaderLayoutMap: (col: number, row: number) => HeaderData;\n getContext: () => CanvasRenderingContext2D;\n getCellRange: (col: number, row: number) => CellRange;\n _resetFrozenColCount: () => void;\n isCellRangeEqual: (col: number, row: number, targetCol: number, targetRow: number) => boolean;\n _getLayoutCellId: (col: number, row: number) => LayoutObjectId;\n _getBodyLayoutMap: (col: number, row: number) => ColumnData | IndicatorData;\n getBodyColumnDefine: (col: number, row: number) => ColumnDefine;\n getBodyColumnType: (col: number, row: number) => ColumnTypeOption;\n fireListeners: <TYPE extends keyof TableEventHandlersEventArgumentMap>(\n type: TYPE,\n event: TableEventHandlersEventArgumentMap[TYPE]\n ) => TableEventHandlersReturnMap[TYPE][];\n\n //更新分页\n updatePagination: (cof: IPagination) => void;\n //hover\n\n getHeaderDescription: (col: number, row: number) => string | undefined;\n\n getCellValue: (col: number, row: number) => string | null;\n getCellOriginValue: (col: number, row: number) => any;\n getCellOriginRecord: (col: number, row: number) => MaybePromiseOrUndefined;\n _dropDownMenuIsHighlight: (col: number, row: number, index: number) => boolean;\n // bindEvents(): void;\n refreshRowColCount: () => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n _hasField: (field: FieldDef, col: number, row: number) => boolean;\n getCellHeaderPaths: (col: number, row: number) => ICellHeaderPaths;\n getCellLocation: (col: number, row: number) => CellLocation;\n // isHitIcon(col: number, row: number, x: number, y: number, iconType: IconFuncTypeEnum): boolean;\n getCellIcons: (col: number, row: number) => ColumnIconOption[];\n\n getMenuInfo: (col: number, row: number, type: string) => DropDownMenuEventInfo;\n /**\n * 获取某个单元格的样式 共业务方调用\n * @param col\n * @param row\n */\n getCellStyle: (col: number, row: number) => CellStyle; // 计算后style\n\n getHierarchyState: (col: number, row: number) => HierarchyState | null;\n\n hasHierarchyTreeHeader: () => boolean;\n\n _canDragHeaderPosition: (col: number, row: number) => boolean;\n\n isHeader: (col: number, row: number) => boolean;\n\n isColumnHeader: (col: number, row: number) => boolean;\n\n isCornerHeader: (col: number, row: number) => boolean;\n\n isRowHeader: (col: number, row: number) => boolean;\n\n getCopyValue: () => string;\n\n getSelectedCellInfos: () => CellInfo[][];\n getCellInfo: (col: number, row: number) => Omit<MousePointerCellEvent, 'target'>;\n\n showTooltip: (col: number, row: number, tooltipOptions?: TooltipOptions) => void;\n\n measureText: (\n text: string,\n font: { fontSize: number; fontWeight?: string | number; fontFamily: string }\n ) => ITextSize;\n\n _canResizeColumn: (col: number, row: number) => boolean;\n\n getCustomRender: (col: number, row: number) => ICustomRender;\n getCustomLayout: (col: number, row: number) => ICustomLayout;\n isListTable: () => boolean;\n isPivotTable: (() => boolean) & (() => boolean);\n isPivotChart: (() => boolean) & (() => boolean);\n _clearColRangeWidthsMap: (col?: number) => void;\n _clearRowRangeHeightsMap: (row?: number) => void;\n clearRowHeightCache: () => void;\n clearColWidthCache: () => void;\n toggleHierarchyState: (col: number, row: number) => void;\n\n resize: () => void;\n\n getMergeCellRect: (col: number, row: number) => Rect;\n\n getTargetColAt: (absoluteX: number) => { col: number; left: number; right: number; width: number } | null;\n getTargetRowAt: (absoluteY: number) => { row: number; top: number; bottom: number; height: number } | null;\n\n renderWithRecreateCells: () => void;\n //#endregion tableAPI\n\n _adjustColWidth: (col: number, orgWidth: number) => number;\n _colWidthDefineToPxWidth: (width: string | number) => number;\n isFrozenColumn: (col: number, row?: number) => boolean;\n isLeftFrozenColumn: (col: number, row?: number) => boolean;\n isRightFrozenColumn: (col: number, row?: number) => boolean;\n isFrozenRow: (col: number, row?: number) => boolean;\n isTopFrozenRow: (col: number, row?: number) => boolean;\n isBottomFrozenRow: (col: number, row?: number) => boolean;\n}\nexport interface ListTableProtected extends IBaseTableProtected {\n /** 表格数据 */\n records: any[] | null;\n columns: ColumnsDefine;\n layoutMap: SimpleHeaderLayoutMap;\n}\n\nexport interface PivotTableProtected extends IBaseTableProtected {\n /** 表格数据 */\n records: any[] | null;\n layoutMap: PivotHeaderLayoutMap;\n dataConfig?: IDataConfig;\n /**\n * 透视表 传入数据是透视后的嵌套层级结构 还是需要进行汇总计算的平坦数据\n */\n enableDataAnalysis?: boolean;\n\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n}\nexport interface PivotChartProtected extends IBaseTableProtected {\n /** 表格数据 */\n records: any[] | Record<string, any[]>;\n layoutMap: PivotHeaderLayoutMap;\n dataConfig?: IDataConfig;\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n}\n"]}
1
+ {"version":3,"sources":["ts-types/base-table.ts"],"names":[],"mappings":"","file":"base-table.js","sourcesContent":["import type { ITextSize } from '@visactor/vutils';\nimport type { RectProps, MaybePromiseOrUndefined, ICellHeaderPaths, CellInfo } from './common';\nimport type {\n TableEventListener,\n TableEventHandlersEventArgumentMap,\n TableEventHandlersReturnMap,\n EventListenerId,\n MousePointerCellEvent\n} from './events';\nimport type { MenuListItem, DropDownMenuEventInfo, DropDownMenuHighlightInfo } from './menu';\nimport type { CellStyle } from './style-define';\nimport type { ColumnIconOption } from './icon';\nimport type { ColumnData, ColumnDefine, ColumnsDefine, HeaderData, IndicatorData } from './list-table/layout-map/api';\nexport type { HeaderData } from './list-table/layout-map/api';\nimport type { TableTheme } from '../themes/theme';\nimport type { ICustomRender } from './customElement';\nexport type LayoutObjectId = number | string;\nimport type { Rect } from '../tools/Rect';\nimport type { Scenegraph } from '../scenegraph/scenegraph';\nimport type { StateManeger } from '../state/state';\nimport type { EventManeger } from '../event/event';\nimport type {\n CellAddress,\n CellRange,\n CellLocation,\n ColumnTypeOption,\n DataSourceAPI,\n FieldData,\n FieldDef,\n FieldFormat,\n FullExtendStyle,\n HeaderValues,\n HeightModeDef,\n HierarchyState,\n IDataConfig,\n IPagination,\n ITableThemeDefine,\n SortState,\n TableKeyboardOptions,\n WidthModeDef,\n IHeaderTreeDefine,\n IDimension,\n IIndicator\n} from '.';\nimport type { TooltipOptions } from './tooltip';\nimport type { IWrapTextGraphicAttribute } from '../scenegraph/graphic/text';\nimport type { ICustomLayout } from './customLayout';\nimport type { CachedDataSource, DataSource } from '../data';\nimport type { MenuHandler } from '../components/menu/dom/MenuHandler';\nimport type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout';\nimport type { SimpleHeaderLayoutMap } from '../layout';\nimport type { TooltipHandler } from '../components/tooltip/TooltipHandler';\nimport type { BodyHelper } from '../body-helper/body-helper';\nimport type { HeaderHelper } from '../header-helper/header-helper';\nimport type { EventHandler } from '../event/EventHandler';\nimport type { NumberMap } from '../tools/NumberMap';\nimport type { FocusInput } from '../core/FouseInput';\nimport type { ITableLegendOption } from './component/legend';\nimport type { DataSet } from '@visactor/vdataset';\nimport type { Title } from '../components/title/title';\nimport type { ITitle } from './component/title';\nimport type { DiscreteTableLegend } from '../components/legend/discrete-legend/discrete-legend';\nimport type { ContinueTableLegend } from '../components/legend/continue-legend/continue-legend';\n\nexport interface IBaseTableProtected {\n element: HTMLElement;\n // scrollable: Scrollable;\n handler: EventHandler;\n focusControl: FocusInput;\n canvas: HTMLCanvasElement;\n context: CanvasRenderingContext2D;\n rowCount: number;\n colCount: number;\n frozenColCount: number;\n allowFrozenColCount: number;\n\n frozenRowCount: number;\n rightFrozenColCount: number;\n bottomFrozenRowCount: number;\n defaultRowHeight: number;\n /**表头默认行高 可以按逐行设置 如果没有就取defaultRowHeight */\n defaultHeaderRowHeight: (number | 'auto') | (number | 'auto')[];\n defaultColWidth: number;\n defaultHeaderColWidth: (number | 'auto') | (number | 'auto')[];\n // font?: string;\n // underlayBackgroundColor?: string;\n keyboardOptions?: TableKeyboardOptions;\n\n // disableRowHeaderColumnResize?: boolean;\n // 列宽调整模式(全列调整;全列不可调整;仅表头单元格可调整;仅内容单元格可调整)\n columnResizeMode?: 'all' | 'none' | 'header' | 'body';\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n /** 控制拖拽表头移动位置顺序开关 */\n dragHeaderMode?: 'all' | 'none' | 'column' | 'row';\n\n cachedRecordsRowHeightMap: NumberMap<string | number>; //存储每一条记录对应行的行高,只有当设置为自动换行随内容撑开才会起作用\n // headerRowHeightsMap: NumberMap<number>; //目前是用来存储了表头各行的高度,从headerRowHeight计算而来,headerRowHeight可以设置为数组的形式\n _rowHeightsMap: NumberMap<number>; //存储数据条目每行高度\n _colWidthsMap: NumberMap<string | number>; //存储各列的宽度\n _colContentWidthsMap: NumberMap<string | number>; //存储各列的内容宽度\n _colWidthsLimit: {\n //存储各列的宽度限制\n [col: number]: {\n max?: string | number;\n min?: string | number;\n };\n };\n calcWidthContext: {\n _: IBaseTableProtected;\n full: number;\n // em: number;\n };\n\n _rowRangeHeightsMap: Map<string, number>; //存储指定行范围的总高度\n _colRangeWidthsMap: Map<string, number>; //存储指定列范围的总宽度\n\n _widthResizedColMap: Set<number>; //记录下被手动调整过列宽的列号\n\n bodyHelper: BodyHelper;\n headerHelper: HeaderHelper;\n\n cellTextOverflows: { [at: string]: string };\n // headerDescriptions: { [at: string]: string };\n focusedTable: boolean;\n\n config:\n | {\n [name: string]: any;\n }\n | undefined;\n // scroll: {\n // left: number;\n // top: number;\n // };\n releaseList?: { release: () => void }[] | null;\n theme: TableTheme;\n transpose?: boolean; //是否转置\n // autoRowHeight?: boolean; //是否自动撑开高度 对于设置了autoWrapText的multilineText的列生效\n pixelRatio?: number;\n /** 下拉菜单的相关配置。消失时机:显示后点击菜单区域外自动消失*/\n menu: {\n /** 代替原来的option.menuType */\n renderMode?: 'canvas' | 'html';\n /** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/\n defaultHeaderMenuItems?: MenuListItem[];\n /** 右键菜单。代替原来的option.contextmenu */\n contextMenuItems?: MenuListItem[] | ((field: FieldDef, row: number) => MenuListItem[]);\n /** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */\n dropDownMenuHighlight?: DropDownMenuHighlightInfo[];\n };\n /** 提示弹框的相关配置。消失时机:显示后鼠标移动到指定区域外或者进入新的单元格后自动消失*/\n tooltip: {\n renderMode: 'html' | 'canvas';\n /** 代替原来hover:isShowTooltip配置 */\n isShowOverflowTextTooltip: boolean;\n /** 弹框是否需要限定在表格区域内 */\n confine: boolean;\n };\n\n dataSourceEventIds?: EventListenerId[];\n headerEvents?: EventListenerId[];\n layoutMap: SimpleHeaderLayoutMap | PivotHeaderLayoutMap;\n headerValues?: HeaderValues;\n tooltipHandler: TooltipHandler;\n\n // headerRowHeight: number[] | number;//移到了BaseTable\n sortState: SortState | SortState[];\n\n dataSource: DataSource | CachedDataSource;\n records?: any;\n allowRangePaste: boolean;\n //重新思考逻辑:如果为false,行高按设置的rowHeight;如果设置为true,则按lineHeight及是否自动换行综合计算行高 2021.11.19 by:lff\n\n autoWrapText?: boolean;\n\n menuHandler: MenuHandler;\n\n /**\n * 计算列宽时 指定最大列宽 可设置boolean或者具体的值 默认为450\n */\n limitMaxAutoWidth?: boolean | number;\n\n title?: Title;\n legends?: DiscreteTableLegend | ContinueTableLegend;\n\n //是否开启图表异步渲染\n renderChartAsync?: boolean;\n // // 开启图表异步渲染 每批次渐进渲染图表个数\n // renderChartAsyncBatchCount?: number;\n}\nexport interface BaseTableConstructorOptions {\n // /** 指定表格的行数 */\n // rowCount?: number;\n\n // /** 指定表格的列数 */\n // colCount?: number;\n /**\n * 当前需要冻结的列数 基本表格生效\n */\n frozenColCount?: number;\n rightFrozenColCount?: number;\n bottomFrozenRowCount?: number;\n\n // /** 待实现 TODO */\n // frozenRowCount?: number;\n /** 可冻结列数,表示前多少列会出现冻结操作按钮 基本表格生效 */\n allowFrozenColCount?: number;\n /**\n * 默认行高. 默认 40\n */\n defaultRowHeight?: number;\n /** 列表头默认行高 可以按逐行设置 如果没有就取defaultRowHeight */\n defaultHeaderRowHeight?: (number | 'auto') | (number | 'auto')[];\n /**\n * 默认列宽. 默认 80\n */\n defaultColWidth?: number;\n /** 行表头默认列宽 可以按逐列设置 如果没有就取defaultColWidth */\n defaultHeaderColWidth?: (number | 'auto') | (number | 'auto')[];\n /** 快捷键功能设置 */\n keyboardOptions?: TableKeyboardOptions;\n /**\n * Canvas container\n */\n container?: HTMLElement | null;\n\n /**\n * 调整列宽 可操作范围。'all' | 'none' | 'header' | 'body'; 整列间隔线|禁止调整|只能在表头处间隔线|只能在body间隔线\n */\n columnResizeMode?: 'all' | 'none' | 'header' | 'body';\n /** 控制拖拽表头移动位置顺序开关 */\n dragHeaderMode?: 'all' | 'none' | 'column' | 'row';\n /**\n * 是否显示固定列图钉 基本表格生效\n */\n showFrozenIcon?: boolean;\n\n padding?:\n | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n }\n | number;\n /** hover交互配置 */\n hover?: {\n /** hover交互响应模式:十字交叉 整列 整行 或者单个单元格 */\n highlightMode: 'cross' | 'column' | 'row' | 'cell';\n /** 不响应鼠标hover交互 */\n disableHover?: boolean;\n /** 单独设置表头不响应鼠标hover交互 */\n disableHeaderHover?: boolean;\n };\n /** 选择单元格交互配置 */\n select?: {\n /** 不响应鼠标select交互 */\n disableSelect?: boolean;\n /** 单独设置表头不响应鼠标select交互 */\n disableHeaderSelect?: boolean;\n };\n /** 下拉菜单的相关配置。消失时机:显示后点击菜单区域外自动消失*/\n menu?: {\n /** 代替原来的option.menuType html目前实现较完整 先默认html渲染方式*/\n renderMode?: 'canvas' | 'html';\n /** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/\n defaultHeaderMenuItems?: MenuListItem[];\n /** 右键菜单。代替原来的option.contextmenu */\n contextMenuItems?: MenuListItem[] | ((field: string, row: number) => MenuListItem[]);\n /** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */\n dropDownMenuHighlight?: DropDownMenuHighlightInfo[];\n };\n /** tooltip相关配置 */\n tooltip?: {\n /** html目前实现较完整 先默认html渲染方式 */\n renderMode?: 'html'; // 目前暂不支持canvas方案\n /** 代替原来hover:isShowTooltip配置 暂时需要将renderMode配置为html才能显示,canvas的还未开发*/\n isShowOverflowTextTooltip?: boolean;\n /** 是否将 tooltip 框限制在画布区域内,默认开启。针对renderMode:\"html\"有效 */\n confine?: boolean;\n };\n /**\n * Theme\n */\n theme?: ITableThemeDefine;\n /** 宽度模式 */\n widthMode?: 'standard' | 'adaptive' | 'autoWidth';\n /** 高度模式 */\n heightMode?: 'standard' | 'adaptive' | 'autoHeight';\n /** 当列宽度不能占满容器时,是否需要自动拉宽来填充容器的宽度。默认false */\n autoFillWidth?: boolean;\n /** 当行高度不能占满容器时,是否需要自动拉高来填充容器的高度。默认false */\n autoFillHeight?: boolean;\n // /** 行高是否根据内容来计算 */\n // autoRowHeight?: boolean;\n /** 设备的像素比 不配的话默认获取window.devicePixelRatio */\n pixelRatio?: number;\n /** 自定义渲染 函数形式*/\n customRender?: ICustomRender;\n /**\n * 传入用户实例化的数据对象 目前不完善\n */\n dataSource?: DataSource;\n\n /** 开启自动换行 默认false */\n autoWrapText?: boolean;\n /** 单元格中可显示最大字符数 默认200 */\n maxCharactersNumber?: number; //\n // /** toolip最大字符数 */\n // maxTooltipCharactersNumber?: number;\n /** 最大可操作条目数 如copy操作可复制出最大数据条目数 */\n maxOperatableRecordCount?: number;\n /**\n * 计算列宽时 指定最大列宽 可设置boolean或者具体的值 默认为450\n */\n limitMaxAutoWidth?: boolean | number;\n\n // maximum number of data items maintained in table instance\n maintainedDataCount?: number;\n\n legends?: ITableLegendOption;\n title?: ITitle;\n //是否开启图表异步渲染\n renderChartAsync?: boolean;\n // 开启图表异步渲染 每批次渐进渲染图表个数\n renderChartAsyncBatchCount?: number;\n}\nexport interface BaseTableAPI {\n /** 表格的行数 */\n rowCount: number;\n /** 表格的列数 */\n colCount: number;\n /** 表格除去外层frame后的宽度 */\n tableNoFrameWidth: number;\n /** 表格除去外层frame后的高度 */\n tableNoFrameHeight: number;\n /** 表格的冻结行数 包括表头在内 */\n frozenRowCount: number;\n /** 表格的冻结列数 包括表头在内 */\n frozenColCount: number;\n\n bottomFrozenRowCount: number;\n rightFrozenColCount: number;\n /** 当前表格默认表头行高 */\n defaultHeaderRowHeight: (number | 'auto') | (number | 'auto')[];\n /** 当前表格默认行高 */\n defaultRowHeight: number;\n /** 当前表格默认列宽 */\n defaultColWidth: number;\n /** 当前表格默认表头列宽 */\n defaultHeaderColWidth: (number | 'auto') | (number | 'auto')[];\n /** 当前表格快捷键设置 */\n keyboardOptions: TableKeyboardOptions | null;\n /**\n * 是否显示图钉\n */\n showFrozenIcon: boolean;\n readonly canvas: HTMLCanvasElement;\n /** 表格可视区域的行数 */\n readonly visibleRowCount: number;\n /** 表格可视区域的列数 */\n readonly visibleColCount: number;\n /** 表格滚动值left */\n scrollLeft: number;\n /** 表格滚动值top */\n scrollTop: number;\n /** 用户设置的options 不要修改这个这个 */\n options: BaseTableConstructorOptions;\n /** 设置的全局下拉菜单列表项配置 */\n globalDropDownMenu?: MenuListItem[];\n /** 设置的全局自定义渲染函数 */\n customRender?: ICustomRender;\n\n /** 表格数据管理对象 */\n dataSource: DataSourceAPI;\n /** 设置的表格主题 */\n theme: TableTheme;\n /** 可允许设置冻结的最大列数 */\n allowFrozenColCount: number;\n\n /** 存储内部用到的属性 变量等 */\n internalProps: IBaseTableProtected;\n /** 分页信息 */\n pagination?: IPagination;\n\n /** 表格偏移像素值 水平方向 */\n tableX: number;\n /** 表格偏移像素值 垂直方向 */\n tableY: number;\n /** 表格宽度模式 */\n widthMode: WidthModeDef;\n /** 表格宽度模式 */\n heightMode: HeightModeDef;\n /** 当列宽度不能占满容器时,是否需要自动拉宽来填充容器的宽度。默认false */\n autoFillWidth: boolean;\n /** 当行高度不能占满容器时,是否需要自动拉高来填充容器的高度。默认false */\n autoFillHeight?: boolean;\n\n isReleased: boolean;\n\n on: <TYPE extends keyof TableEventHandlersEventArgumentMap>(\n type: TYPE,\n listener: TableEventListener<TYPE> //(event: TableEventHandlersEventArgumentMap[TYPE]) => TableEventHandlersReturnMap[TYPE]\n ) => EventListenerId;\n // &(<T extends keyof TableEventHandlersEventArgumentMap>(type: string, listener: AnyListener<T>) => EventListenerId);\n\n _vDataSet: DataSet;\n /** 场景树对象 */\n scenegraph: Scenegraph;\n /** 状态管理模块 */\n stateManeger?: StateManeger;\n /** 事件管理模块 */\n eventManeger?: EventManeger;\n /** 行表头的层数 */\n rowHeaderLevelCount: number;\n /** 列表头的层数 */\n columnHeaderLevelCount: number;\n /** 获取表格绘制的范围 不包括frame的宽度 */\n getDrawRange: () => Rect;\n /** 将鼠标坐标值 转换成表格坐标系中的坐标位置 */\n _getMouseAbstractPoint: (\n evt: TouchEvent | MouseEvent | undefined,\n isAddScroll?: boolean\n ) => { x: number; y: number; inTable: boolean };\n getElement: () => HTMLElement;\n getContainer: () => HTMLElement;\n\n setFrozenColCount: (count: number) => void;\n _setFrozenColCount: (count: number) => void;\n _updateSize: () => void;\n\n render: () => void;\n throttleInvalidate: () => void;\n getRowHeight: (row: number) => number;\n getDefaultRowHeight: (row: number) => number | 'auto';\n setRowHeight: (row: number, height: number, clearCache?: boolean) => void;\n getColWidth: (col: number) => number;\n getColWidthDefined: (col: number) => string | number;\n // getColWidthDefine: (col: number) => string | number;\n setColWidth: (col: number, width: number | string, clearCache?: boolean, skipCheckFrozen?: boolean) => void;\n _getColContentWidth: (col: number) => number;\n _setColContentWidth: (col: number, width: number | string, clearCache?: boolean) => void;\n getMaxColWidth: (col: number) => number;\n setMaxColWidth: (col: number, maxwidth: string | number) => void;\n getMinColWidth: (col: number) => number;\n setMinColWidth: (col: number, minwidth: string | number) => void;\n getCellRect: (col: number, row: number) => RectProps;\n getCellRelativeRect: (col: number, row: number) => RectProps;\n getCellsRect: (startCol: number, startRow: number, endCol: number, endRow: number) => RectProps;\n getCellRangeRect: (cellRange: CellRange | CellAddress) => RectProps;\n getCellRangeRelativeRect: (cellRange: CellRange | CellAddress) => RectProps;\n getVisibleCellRangeRelativeRect: (cellRange: CellRange | CellAddress) => RectProps;\n isFrozenCell: (col: number, row: number) => { row: boolean; col: boolean } | null;\n getRowAt: (absoluteY: number) => { top: number; row: number; bottom: number };\n getColAt: (absoluteX: number) => { left: number; col: number; right: number };\n getCellAt: (absoluteX: number, absoluteY: number) => CellAddress;\n _makeVisibleCell: (col: number, row: number) => void;\n // setFocusCursor(col: number, row: number): void;\n // focusCell(col: number, row: number): void;\n getCellOverflowText: (col: number, row: number) => string | null;\n getColsWidth: (startCol: number, endCol: number) => number;\n getRowsHeight: (startRow: number, endRow: number) => number;\n\n release: () => void;\n addReleaseObj: (releaseObj: { release: () => void }) => void;\n _getCellStyle: (col: number, row: number) => FullExtendStyle;\n clearCellStyleCache: () => void;\n\n getFrozenRowsHeight: () => number;\n getFrozenColsWidth: () => number;\n getBottomFrozenRowsHeight: () => number;\n getRightFrozenColsWidth: () => number;\n selectCell: (col: number, row: number) => void;\n selectCells: (cellRanges: CellRange[]) => void;\n getAllRowsHeight: () => number;\n getAllColsWidth: () => number;\n\n off: (id: EventListenerId) => void;\n getBodyField: (col: number, row: number) => FieldDef | undefined;\n getRecordByRowCol: (col: number, row: number) => MaybePromiseOrUndefined;\n getRecordIndexByRow: (col: number, row: number) => number;\n getRecordStartRowByRecordIndex: (index: number) => number;\n\n getHeaderField: (col: number, row: number) => any | undefined;\n getHeaderFieldKey: (col: number, row: number) => any | undefined;\n\n _getHeaderCellBySortState: (sortState: SortState) => CellAddress | undefined;\n getHeaderDefine: (col: number, row: number) => ColumnDefine;\n _getHeaderLayoutMap: (col: number, row: number) => HeaderData;\n getContext: () => CanvasRenderingContext2D;\n getCellRange: (col: number, row: number) => CellRange;\n _resetFrozenColCount: () => void;\n isCellRangeEqual: (col: number, row: number, targetCol: number, targetRow: number) => boolean;\n _getLayoutCellId: (col: number, row: number) => LayoutObjectId;\n _getBodyLayoutMap: (col: number, row: number) => ColumnData | IndicatorData;\n getBodyColumnDefine: (col: number, row: number) => ColumnDefine;\n getBodyColumnType: (col: number, row: number) => ColumnTypeOption;\n fireListeners: <TYPE extends keyof TableEventHandlersEventArgumentMap>(\n type: TYPE,\n event: TableEventHandlersEventArgumentMap[TYPE]\n ) => TableEventHandlersReturnMap[TYPE][];\n\n //更新分页\n updatePagination: (cof: IPagination) => void;\n //hover\n\n getHeaderDescription: (col: number, row: number) => string | undefined;\n\n getCellValue: (col: number, row: number) => string | null;\n getCellOriginValue: (col: number, row: number) => any;\n getCellOriginRecord: (col: number, row: number) => MaybePromiseOrUndefined;\n _dropDownMenuIsHighlight: (col: number, row: number, index: number) => boolean;\n // bindEvents(): void;\n refreshRowColCount: () => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n _hasField: (field: FieldDef, col: number, row: number) => boolean;\n getCellHeaderPaths: (col: number, row: number) => ICellHeaderPaths;\n getCellLocation: (col: number, row: number) => CellLocation;\n // isHitIcon(col: number, row: number, x: number, y: number, iconType: IconFuncTypeEnum): boolean;\n getCellIcons: (col: number, row: number) => ColumnIconOption[];\n\n getMenuInfo: (col: number, row: number, type: string) => DropDownMenuEventInfo;\n /**\n * 获取某个单元格的样式 共业务方调用\n * @param col\n * @param row\n */\n getCellStyle: (col: number, row: number) => CellStyle; // 计算后style\n\n getHierarchyState: (col: number, row: number) => HierarchyState | null;\n\n hasHierarchyTreeHeader: () => boolean;\n\n _canDragHeaderPosition: (col: number, row: number) => boolean;\n\n isHeader: (col: number, row: number) => boolean;\n\n isColumnHeader: (col: number, row: number) => boolean;\n\n isCornerHeader: (col: number, row: number) => boolean;\n\n isRowHeader: (col: number, row: number) => boolean;\n\n getCopyValue: () => string;\n\n getSelectedCellInfos: () => CellInfo[][];\n getCellInfo: (col: number, row: number) => Omit<MousePointerCellEvent, 'target'>;\n\n showTooltip: (col: number, row: number, tooltipOptions?: TooltipOptions) => void;\n\n measureText: (\n text: string,\n font: { fontSize: number; fontWeight?: string | number; fontFamily: string }\n ) => ITextSize;\n\n _canResizeColumn: (col: number, row: number) => boolean;\n\n getCustomRender: (col: number, row: number) => ICustomRender;\n getCustomLayout: (col: number, row: number) => ICustomLayout;\n isListTable: () => boolean;\n isPivotTable: (() => boolean) & (() => boolean);\n isPivotChart: (() => boolean) & (() => boolean);\n _clearColRangeWidthsMap: (col?: number) => void;\n _clearRowRangeHeightsMap: (row?: number) => void;\n clearRowHeightCache: () => void;\n clearColWidthCache: () => void;\n toggleHierarchyState: (col: number, row: number) => void;\n\n resize: () => void;\n\n getMergeCellRect: (col: number, row: number) => Rect;\n\n getTargetColAt: (absoluteX: number) => { col: number; left: number; right: number; width: number } | null;\n getTargetRowAt: (absoluteY: number) => { row: number; top: number; bottom: number; height: number } | null;\n\n renderWithRecreateCells: () => void;\n //#endregion tableAPI\n\n _adjustColWidth: (col: number, orgWidth: number) => number;\n _colWidthDefineToPxWidth: (width: string | number) => number;\n isFrozenColumn: (col: number, row?: number) => boolean;\n isLeftFrozenColumn: (col: number, row?: number) => boolean;\n isRightFrozenColumn: (col: number, row?: number) => boolean;\n isFrozenRow: (col: number, row?: number) => boolean;\n isTopFrozenRow: (col: number, row?: number) => boolean;\n isBottomFrozenRow: (col: number, row?: number) => boolean;\n}\nexport interface ListTableProtected extends IBaseTableProtected {\n /** 表格数据 */\n records: any[] | null;\n columns: ColumnsDefine;\n layoutMap: SimpleHeaderLayoutMap;\n}\n\nexport interface PivotTableProtected extends IBaseTableProtected {\n /** 表格数据 */\n records: any[] | null;\n layoutMap: PivotHeaderLayoutMap;\n dataConfig?: IDataConfig;\n /**\n * 透视表是否开启数据分析\n * 如果传入数据是明细数据需要聚合分析则开启\n * 如传入数据是经过聚合好的为了提升性能这里设置为false,同时需要传入columnTree和rowTree\n */\n enableDataAnalysis?: boolean;\n\n /** 列表头树型结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头树型结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n}\nexport interface PivotChartProtected extends IBaseTableProtected {\n /** 表格数据 */\n records: any[] | Record<string, any[]>;\n layoutMap: PivotHeaderLayoutMap;\n dataConfig?: IDataConfig;\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/new-data-set.ts"],"names":[],"mappings":"AAUA,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,kCAAe,CAAA;AACjB,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AACD,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,yBAAa,CAAA;AACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB","file":"new-data-set.js","sourcesContent":["import type { SortOrder } from './common';\n\n//#region 总计小计\nexport interface TotalsStatus {\n isRowTotal: boolean;\n isRowSubTotal: boolean;\n isColTotal: boolean;\n isColSubTotal: boolean;\n}\n\nexport enum AggregationType {\n RECORD = 'RECORD',\n SUM = 'SUM',\n MIN = 'MIN',\n MAX = 'MAX',\n AVG = 'AVG',\n COUNT = 'COUNT'\n}\nexport enum SortType {\n ASC = 'ASC',\n DESC = 'DESC'\n}\nexport interface CalcTotals {\n aggregationType?: AggregationType; // 聚合方式\n // calcFunc?: (query: Record<string, any>, arr: Record<string, any>[]) => number;\n}\n\nexport interface Total {\n // 是否显示总计\n showGrandTotals: boolean;\n // 是否显示小计\n showSubTotals: boolean;\n // // 计算总计方法\n // calcGrandTotals?: CalcTotals;\n // // 计算小计方法\n // calcSubTotals?: CalcTotals;\n // 小计汇总维度定义\n subTotalsDimensions?: string[];\n // 默认'总计'\n grandTotalLabel?: string;\n // 默认'小计'\n subTotalLabel?: string;\n}\n\nexport interface Totals {\n row?: Total;\n column?: Total;\n}\n\n//#endregion 总计小计\n\n//#region 排序规则\n// export interface SortRule {\n// //排序维度\n// sortField: string;\n// //以下均为排序方法\n// //1. 指定排序类型\n// sortType?: SortType;\n// //2. 按维度成员指定排序\n// sortBy?: string[];\n// //3. 按指标值排序\n// sortByIndicator?: string;\n// //如果按指标值排序,还需要指定另外一个(行或列)方向的底层维度成员具体值\n// query?: string[];\n// //4. 自定义排序方法function\n// sortFunc?: (a: any, b: any) => number;\n// }\n//以下均为排序方法\n//1. 指定排序类型\nexport interface SortTypeRule {\n /**排序维度 */\n sortField: string;\n /**升序降序 ASC or DESC*/\n sortType?: SortType;\n}\n//2. 按维度成员指定排序\nexport interface SortByRule {\n /**排序维度 */\n sortField: string;\n /**根据指定具体顺序排序 */\n sortBy?: string[];\n}\n//3. 按指标值排序\nexport interface SortByIndicatorRule {\n /**排序维度 */\n sortField: string;\n /**升序降序 ASC or DESC*/\n sortType?: SortType;\n /**排序根据某个指标值 */\n sortByIndicator?: string;\n /**如果按指标值排序,还需要指定另外一个(行或列)方向的底层维度成员具体值。例如按照办公用品下的纸张 ['办公用品', '纸张'] */\n query?: string[];\n}\n//4. 自定义排序方法function\nexport interface SortFuncRule {\n /**排序维度 */\n sortField: string;\n /**自定义排序函数 */\n sortFunc?: (a: any, b: any) => number;\n}\n//自定义排序方法参数\n// export interface SortFuncParam extends SortRule {\n// data: Array<string | Record<string, any>>;\n// }\nexport type SortRule = SortTypeRule | SortByRule | SortByIndicatorRule | SortFuncRule;\nexport type SortRules = SortRule[];\n//#endregion 排序规则\n\n//#region 过滤规则\nexport interface FilterRule {\n filterKey?: string;\n filteredValues?: unknown[];\n filterFunc?: (row: Record<string, any>) => boolean;\n}\nexport type FilterRules = FilterRule[];\n//#endregion 过滤规则\n\n//#region 聚合规则\nexport interface AggregationRule<T extends AggregationType> {\n /** 区别于field 重新起个key值,供配置indicators使用 */\n indicatorKey: string;\n // 可以收集单个字段的聚合结果,或者收集多个字段的聚合结果\n field: T extends AggregationType.RECORD ? string[] | string : string;\n aggregationType: T;\n /**计算结果格式化 */\n formatFun?: (num: number) => string;\n}\nexport type AggregationRules = AggregationRule<AggregationType>[];\n//#endregion 聚合规则\n\n//#region 映射规则\nexport interface MappingRule {\n label?: LabelMapping;\n symbol?: SymbolMapping;\n bgColor?: MappingFuncRule;\n}\nexport type MappingRules = MappingRule[];\nexport interface LabelMapping {\n text?: MappingFuncRule;\n color?: MappingFuncRule;\n}\nexport interface SymbolMapping {\n shape?: 'circle' | 'rect';\n color?: MappingFuncRule;\n size?: MappingFuncRule;\n}\n\nexport type MappingFuncRule = {\n indicatorKey: string;\n mapping?: (table: any, value: number) => string;\n};\n\n//#endregion 映射规则\nexport interface DerivedFieldRule {\n fieldName?: string;\n derivedFunc?: (record: Record<string, any>) => any;\n}\nexport type DerivedFieldRules = DerivedFieldRule[];\n/**\n * 数据处理配置\n */\nexport interface IDataConfig {\n // rows: string[]; //行维度字段数组;\n // columns: string[]; //列维度字段数组;\n aggregationRules?: AggregationRules; //按照行列维度聚合值计算规则;\n // indicators?: string[]; //具体展示指标;\n // descriptions?: any[]; //字段标题及描述信息;\n sortRules?: SortRules; //排序规则;\n filterRules?: FilterRules; //过滤规则;\n totals?: Totals; //小计或总计;\n // indicatorsAsCol?: boolean;\n // hideIndicatorName?: boolean;\n /**\n * 目前mappding还不太好用 不建议使用 建议先用style\n */\n mappingRules?: MappingRules;\n derivedFieldRules?: DerivedFieldRules;\n\n // PivotChart逻辑新增\n collectValuesBy?: Record<string, CollectValueBy>;\n isPivotChart?: boolean;\n dimensionSortArray?: string[];\n}\n\n/** 在处理数据的过程中 去额外收集某个维度的维度值范围 可为离散值或者连续值范围 */\nexport type CollectValueBy = {\n /** 要收集的字段按什么进行分组 */\n by: string[];\n /** 是否计算一个range范围 true的话对应的收集数据的结果为{max:number,min:number} */\n range?: boolean;\n /** 收集是按照sumBy字段相同的进行分组聚合 聚合结果求最大最小值;如果不设置该值 则按单条数据求最大最小值 */\n sumBy?: string[];\n /** 帮助计算列宽使用 如果是chart图表 收集的是xFiled的维度值 可以根据维度值的个数乘于图元宽度计算一个最优列宽*/\n type?: 'xField' | 'yField' | undefined;\n /** 如果是收集的离散值,离散值的排序依据 */\n sortBy?: string[];\n};\nexport type CollectedValue = { max?: number; min?: number } | Array<string>;\n"]}
1
+ {"version":3,"sources":["ts-types/new-data-set.ts"],"names":[],"mappings":"AAUA,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,kCAAe,CAAA;AACjB,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AACD,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,yBAAa,CAAA;AACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB","file":"new-data-set.js","sourcesContent":["import type { SortOrder } from './common';\n\n//#region 总计小计\nexport interface TotalsStatus {\n isRowTotal: boolean;\n isRowSubTotal: boolean;\n isColTotal: boolean;\n isColSubTotal: boolean;\n}\n\nexport enum AggregationType {\n RECORD = 'RECORD',\n SUM = 'SUM',\n MIN = 'MIN',\n MAX = 'MAX',\n AVG = 'AVG',\n COUNT = 'COUNT'\n}\nexport enum SortType {\n ASC = 'ASC',\n DESC = 'DESC'\n}\nexport interface CalcTotals {\n aggregationType?: AggregationType; // 聚合方式\n // calcFunc?: (query: Record<string, any>, arr: Record<string, any>[]) => number;\n}\n\nexport interface Total {\n // 是否显示总计\n showGrandTotals: boolean;\n // 是否显示小计\n showSubTotals: boolean;\n // // 计算总计方法\n // calcGrandTotals?: CalcTotals;\n // // 计算小计方法\n // calcSubTotals?: CalcTotals;\n // 小计汇总维度定义\n subTotalsDimensions?: string[];\n // 默认'总计'\n grandTotalLabel?: string;\n // 默认'小计'\n subTotalLabel?: string;\n}\n\nexport interface Totals {\n row?: Total;\n column?: Total;\n}\n\n//#endregion 总计小计\n\n//#region 排序规则\n// export interface SortRule {\n// //排序维度\n// sortField: string;\n// //以下均为排序方法\n// //1. 指定排序类型\n// sortType?: SortType;\n// //2. 按维度成员指定排序\n// sortBy?: string[];\n// //3. 按指标值排序\n// sortByIndicator?: string;\n// //如果按指标值排序,还需要指定另外一个(行或列)方向的底层维度成员具体值\n// query?: string[];\n// //4. 自定义排序方法function\n// sortFunc?: (a: any, b: any) => number;\n// }\n//以下均为排序方法\n//1. 指定排序类型\nexport interface SortTypeRule {\n /**排序维度 */\n sortField: string;\n /**升序降序 ASC or DESC*/\n sortType?: SortType;\n}\n//2. 按维度成员指定排序\nexport interface SortByRule {\n /**排序维度 */\n sortField: string;\n /**根据指定具体顺序排序 */\n sortBy?: string[];\n}\n//3. 按指标值排序\nexport interface SortByIndicatorRule {\n /**排序维度 */\n sortField: string;\n /**升序降序 ASC or DESC*/\n sortType?: SortType;\n /**排序根据某个指标值 */\n sortByIndicator?: string;\n /**如果按指标值排序,还需要指定另外一个(行或列)方向的底层维度成员具体值。例如按照办公用品下的纸张 ['办公用品', '纸张'] */\n query?: string[];\n}\n//4. 自定义排序方法function\nexport interface SortFuncRule {\n /**排序维度 */\n sortField: string;\n /**自定义排序函数 */\n sortFunc?: (a: any, b: any) => number;\n}\n//自定义排序方法参数\n// export interface SortFuncParam extends SortRule {\n// data: Array<string | Record<string, any>>;\n// }\nexport type SortRule = SortTypeRule | SortByRule | SortByIndicatorRule | SortFuncRule;\nexport type SortRules = SortRule[];\n//#endregion 排序规则\n\n//#region 过滤规则\nexport interface FilterRule {\n filterKey?: string;\n filteredValues?: unknown[];\n filterFunc?: (row: Record<string, any>) => boolean;\n}\nexport type FilterRules = FilterRule[];\n//#endregion 过滤规则\n\n//#region 聚合规则\nexport interface AggregationRule<T extends AggregationType> {\n /** 区别于field 重新起个key值,供配置indicators使用 */\n indicatorKey: string;\n // 可以收集单个字段的聚合结果,或者收集多个字段的聚合结果\n field: T extends AggregationType.RECORD ? string[] | string : string;\n aggregationType: T;\n /**计算结果格式化 */\n formatFun?: (num: number) => string;\n}\nexport type AggregationRules = AggregationRule<AggregationType>[];\n//#endregion 聚合规则\n\n//#region 映射规则\nexport interface MappingRule {\n label?: LabelMapping;\n symbol?: SymbolMapping;\n bgColor?: MappingFuncRule;\n}\nexport type MappingRules = MappingRule[];\nexport interface LabelMapping {\n text?: MappingFuncRule;\n color?: MappingFuncRule;\n}\nexport interface SymbolMapping {\n shape?: 'circle' | 'rect';\n color?: MappingFuncRule;\n size?: MappingFuncRule;\n}\n\nexport type MappingFuncRule = {\n indicatorKey: string;\n mapping?: (table: any, value: number) => string;\n};\n\n//#endregion 映射规则\nexport interface DerivedFieldRule {\n fieldName?: string;\n derivedFunc?: (record: Record<string, any>) => any;\n}\nexport type DerivedFieldRules = DerivedFieldRule[];\n/**\n * 数据处理配置\n */\nexport interface IDataConfig {\n aggregationRules?: AggregationRules; //按照行列维度聚合值计算规则;\n sortRules?: SortRules; //排序规则;\n filterRules?: FilterRules; //过滤规则;\n totals?: Totals; //小计或总计;\n /**\n * 目前mappding还不太好用 不建议使用 建议先用style\n */\n mappingRules?: MappingRules;\n derivedFieldRules?: DerivedFieldRules;\n\n /**\n * PivotChart专有 请忽略\n */\n collectValuesBy?: Record<string, CollectValueBy>;\n /**\n * PivotChart专有 请忽略\n */\n isPivotChart?: boolean;\n /**\n * PivotChart专有 请忽略\n */\n dimensionSortArray?: string[];\n}\n\n/** 在处理数据的过程中 去额外收集某个维度的维度值范围 可为离散值或者连续值范围 */\nexport type CollectValueBy = {\n /** 要收集的字段按什么进行分组 */\n by: string[];\n /** 是否计算一个range范围 true的话对应的收集数据的结果为{max:number,min:number} */\n range?: boolean;\n /** 收集是按照sumBy字段相同的进行分组聚合 聚合结果求最大最小值;如果不设置该值 则按单条数据求最大最小值 */\n sumBy?: string[];\n /** 帮助计算列宽使用 如果是chart图表 收集的是xFiled的维度值 可以根据维度值的个数乘于图元宽度计算一个最优列宽*/\n type?: 'xField' | 'yField' | undefined;\n /** 如果是收集的离散值,离散值的排序依据 */\n sortBy?: string[];\n};\nexport type CollectedValue = { max?: number; min?: number } | Array<string>;\n"]}