@visactor/vtable 1.5.7-alpha.1 → 1.5.7

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 (239) hide show
  1. package/cjs/ListTable-all.js +5 -5
  2. package/cjs/ListTable-all.js.map +1 -1
  3. package/cjs/ListTable.d.ts +3 -0
  4. package/cjs/ListTable.js +41 -284
  5. package/cjs/ListTable.js.map +1 -1
  6. package/cjs/body-helper/style/Style.d.ts +2 -2
  7. package/cjs/body-helper/style/Style.js.map +1 -1
  8. package/cjs/components/title/title.js +3 -1
  9. package/cjs/components/title/title.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +5 -3
  11. package/cjs/core/BaseTable.js +13 -83
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/core/group-helper.d.ts +6 -0
  14. package/cjs/core/group-helper.js +22 -0
  15. package/cjs/core/group-helper.js.map +1 -0
  16. package/cjs/core/record-helper.d.ts +8 -0
  17. package/cjs/core/record-helper.js +337 -0
  18. package/cjs/core/record-helper.js.map +1 -0
  19. package/cjs/core/style-helper.d.ts +3 -0
  20. package/cjs/core/style-helper.js +110 -0
  21. package/cjs/core/style-helper.js.map +1 -0
  22. package/cjs/core/tableHelper.d.ts +0 -2
  23. package/cjs/core/tableHelper.js +15 -19
  24. package/cjs/core/tableHelper.js.map +1 -1
  25. package/cjs/data/CachedDataSource.d.ts +10 -1
  26. package/cjs/data/CachedDataSource.js +102 -3
  27. package/cjs/data/CachedDataSource.js.map +1 -1
  28. package/cjs/dataset/dataset.js +0 -1
  29. package/cjs/edit/edit-manager.js +2 -1
  30. package/cjs/event/event.js +3 -1
  31. package/cjs/event/event.js.map +1 -1
  32. package/cjs/header-helper/style/Style.d.ts +2 -2
  33. package/cjs/header-helper/style/Style.js.map +1 -1
  34. package/cjs/index.d.ts +3 -1
  35. package/cjs/index.js +25 -2
  36. package/cjs/index.js.map +1 -1
  37. package/cjs/layout/cell-range/simple-cell-range.d.ts +4 -0
  38. package/cjs/layout/cell-range/simple-cell-range.js +106 -0
  39. package/cjs/layout/cell-range/simple-cell-range.js.map +1 -0
  40. package/cjs/layout/layout-helper.js +2 -2
  41. package/cjs/layout/layout-helper.js.map +1 -1
  42. package/cjs/layout/pivot-header-layout.js +4 -2
  43. package/cjs/layout/pivot-header-layout.js.map +1 -1
  44. package/cjs/layout/row-height-map.js +1 -0
  45. package/cjs/layout/simple-header-layout.d.ts +1 -2
  46. package/cjs/layout/simple-header-layout.js +6 -90
  47. package/cjs/layout/simple-header-layout.js.map +1 -1
  48. package/cjs/plugins/icons.js +1 -1
  49. package/cjs/plugins/list-tree-stick-cell.d.ts +16 -0
  50. package/cjs/plugins/list-tree-stick-cell.js +178 -0
  51. package/cjs/plugins/list-tree-stick-cell.js.map +1 -0
  52. package/cjs/plugins/themes.js +1 -1
  53. package/cjs/scenegraph/component/custom.js +1 -1
  54. package/cjs/scenegraph/component/custom.js.map +1 -1
  55. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
  56. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  57. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
  58. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +48 -7
  59. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  60. package/cjs/scenegraph/graphic/group.js +1 -1
  61. package/cjs/scenegraph/graphic/group.js.map +1 -1
  62. package/cjs/scenegraph/group-creater/cell-helper.d.ts +2 -1
  63. package/cjs/scenegraph/group-creater/cell-helper.js +29 -10
  64. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  65. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
  66. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  67. package/cjs/scenegraph/group-creater/column-helper.js +9 -2
  68. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  69. package/cjs/scenegraph/group-creater/init-scenegraph.js +2 -2
  70. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  71. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  72. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  73. package/cjs/scenegraph/layout/compute-row-height.js +2 -2
  74. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  75. package/cjs/scenegraph/layout/update-height.js +3 -1
  76. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  77. package/cjs/scenegraph/layout/update-width.js +5 -3
  78. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  79. package/cjs/scenegraph/scenegraph.js +54 -39
  80. package/cjs/scenegraph/scenegraph.js.map +1 -1
  81. package/cjs/scenegraph/stick-text/index.js +5 -6
  82. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  83. package/cjs/scenegraph/style/frame-border.d.ts +1 -1
  84. package/cjs/scenegraph/style/frame-border.js +27 -12
  85. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  86. package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
  87. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  88. package/cjs/scenegraph/utils/get-hierarchy-offset.js +6 -8
  89. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  90. package/cjs/scenegraph/utils/text-icon-layout.js +6 -4
  91. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  92. package/cjs/themes/theme.d.ts +2 -0
  93. package/cjs/themes/theme.js +13 -4
  94. package/cjs/themes/theme.js.map +1 -1
  95. package/cjs/tools/helper.d.ts +1 -1
  96. package/cjs/tools/helper.js +3 -3
  97. package/cjs/tools/helper.js.map +1 -1
  98. package/cjs/ts-types/base-table.d.ts +9 -0
  99. package/cjs/ts-types/base-table.js.map +1 -1
  100. package/cjs/ts-types/column/style.d.ts +2 -2
  101. package/cjs/ts-types/column/style.js.map +1 -1
  102. package/cjs/ts-types/component/index.d.ts +1 -0
  103. package/cjs/ts-types/component/index.js +21 -0
  104. package/cjs/ts-types/component/index.js.map +1 -0
  105. package/cjs/ts-types/index.d.ts +1 -0
  106. package/cjs/ts-types/index.js +1 -1
  107. package/cjs/ts-types/index.js.map +1 -1
  108. package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -0
  109. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  110. package/cjs/ts-types/new-data-set.d.ts +1 -0
  111. package/cjs/ts-types/new-data-set.js.map +1 -1
  112. package/cjs/ts-types/table-engine.d.ts +10 -0
  113. package/cjs/ts-types/table-engine.js.map +1 -1
  114. package/cjs/ts-types/theme.d.ts +2 -1
  115. package/cjs/ts-types/theme.js.map +1 -1
  116. package/cjs/vrender.d.ts +1 -1
  117. package/cjs/vrender.js +2 -1
  118. package/cjs/vrender.js.map +1 -1
  119. package/dist/vtable.js +8405 -5360
  120. package/dist/vtable.min.js +2 -2
  121. package/es/ListTable-all.js +5 -3
  122. package/es/ListTable-all.js.map +1 -1
  123. package/es/ListTable.d.ts +3 -0
  124. package/es/ListTable.js +44 -286
  125. package/es/ListTable.js.map +1 -1
  126. package/es/body-helper/style/Style.d.ts +2 -2
  127. package/es/body-helper/style/Style.js.map +1 -1
  128. package/es/components/title/title.js +3 -1
  129. package/es/components/title/title.js.map +1 -1
  130. package/es/core/BaseTable.d.ts +5 -3
  131. package/es/core/BaseTable.js +16 -87
  132. package/es/core/BaseTable.js.map +1 -1
  133. package/es/core/group-helper.d.ts +6 -0
  134. package/es/core/group-helper.js +14 -0
  135. package/es/core/group-helper.js.map +1 -0
  136. package/es/core/record-helper.d.ts +8 -0
  137. package/es/core/record-helper.js +332 -0
  138. package/es/core/record-helper.js.map +1 -0
  139. package/es/core/style-helper.d.ts +3 -0
  140. package/es/core/style-helper.js +86 -0
  141. package/es/core/style-helper.js.map +1 -0
  142. package/es/core/tableHelper.d.ts +0 -2
  143. package/es/core/tableHelper.js +12 -17
  144. package/es/core/tableHelper.js.map +1 -1
  145. package/es/data/CachedDataSource.d.ts +10 -1
  146. package/es/data/CachedDataSource.js +103 -0
  147. package/es/data/CachedDataSource.js.map +1 -1
  148. package/es/dataset/dataset.js +1 -2
  149. package/es/edit/edit-manager.js +2 -1
  150. package/es/event/event.js +3 -1
  151. package/es/event/event.js.map +1 -1
  152. package/es/header-helper/style/Style.d.ts +2 -2
  153. package/es/header-helper/style/Style.js.map +1 -1
  154. package/es/index.d.ts +3 -1
  155. package/es/index.js +5 -1
  156. package/es/index.js.map +1 -1
  157. package/es/layout/cell-range/simple-cell-range.d.ts +4 -0
  158. package/es/layout/cell-range/simple-cell-range.js +99 -0
  159. package/es/layout/cell-range/simple-cell-range.js.map +1 -0
  160. package/es/layout/layout-helper.js +2 -2
  161. package/es/layout/layout-helper.js.map +1 -1
  162. package/es/layout/pivot-header-layout.js +4 -2
  163. package/es/layout/pivot-header-layout.js.map +1 -1
  164. package/es/layout/row-height-map.js +2 -1
  165. package/es/layout/simple-header-layout.d.ts +1 -2
  166. package/es/layout/simple-header-layout.js +7 -89
  167. package/es/layout/simple-header-layout.js.map +1 -1
  168. package/es/plugins/icons.js +1 -1
  169. package/es/plugins/list-tree-stick-cell.d.ts +16 -0
  170. package/es/plugins/list-tree-stick-cell.js +176 -0
  171. package/es/plugins/list-tree-stick-cell.js.map +1 -0
  172. package/es/plugins/themes.js +1 -1
  173. package/es/scenegraph/component/custom.js +1 -1
  174. package/es/scenegraph/component/custom.js.map +1 -1
  175. package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -3
  176. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  177. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
  178. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +49 -5
  179. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  180. package/es/scenegraph/graphic/group.js +1 -1
  181. package/es/scenegraph/graphic/group.js.map +1 -1
  182. package/es/scenegraph/group-creater/cell-helper.d.ts +2 -1
  183. package/es/scenegraph/group-creater/cell-helper.js +23 -8
  184. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  185. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
  186. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  187. package/es/scenegraph/group-creater/column-helper.js +8 -2
  188. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  189. package/es/scenegraph/group-creater/init-scenegraph.js +2 -2
  190. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  191. package/es/scenegraph/layout/compute-col-width.js +1 -3
  192. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  193. package/es/scenegraph/layout/compute-row-height.js +2 -2
  194. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  195. package/es/scenegraph/layout/update-height.js +3 -1
  196. package/es/scenegraph/layout/update-height.js.map +1 -1
  197. package/es/scenegraph/layout/update-width.js +5 -3
  198. package/es/scenegraph/layout/update-width.js.map +1 -1
  199. package/es/scenegraph/scenegraph.js +54 -39
  200. package/es/scenegraph/scenegraph.js.map +1 -1
  201. package/es/scenegraph/stick-text/index.js +5 -6
  202. package/es/scenegraph/stick-text/index.js.map +1 -1
  203. package/es/scenegraph/style/frame-border.d.ts +1 -1
  204. package/es/scenegraph/style/frame-border.js +27 -10
  205. package/es/scenegraph/style/frame-border.js.map +1 -1
  206. package/es/scenegraph/utils/get-cell-merge.js +1 -1
  207. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  208. package/es/scenegraph/utils/get-hierarchy-offset.js +7 -9
  209. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  210. package/es/scenegraph/utils/text-icon-layout.js +6 -4
  211. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  212. package/es/themes/theme.d.ts +2 -0
  213. package/es/themes/theme.js +13 -4
  214. package/es/themes/theme.js.map +1 -1
  215. package/es/tools/helper.d.ts +1 -1
  216. package/es/tools/helper.js +1 -1
  217. package/es/tools/helper.js.map +1 -1
  218. package/es/ts-types/base-table.d.ts +9 -0
  219. package/es/ts-types/base-table.js.map +1 -1
  220. package/es/ts-types/column/style.d.ts +2 -2
  221. package/es/ts-types/column/style.js.map +1 -1
  222. package/es/ts-types/component/index.d.ts +1 -0
  223. package/es/ts-types/component/index.js +2 -0
  224. package/es/ts-types/component/index.js.map +1 -0
  225. package/es/ts-types/index.d.ts +1 -0
  226. package/es/ts-types/index.js +2 -0
  227. package/es/ts-types/index.js.map +1 -1
  228. package/es/ts-types/list-table/layout-map/api.d.ts +1 -0
  229. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  230. package/es/ts-types/new-data-set.d.ts +1 -0
  231. package/es/ts-types/new-data-set.js.map +1 -1
  232. package/es/ts-types/table-engine.d.ts +10 -0
  233. package/es/ts-types/table-engine.js.map +1 -1
  234. package/es/ts-types/theme.d.ts +2 -1
  235. package/es/ts-types/theme.js.map +1 -1
  236. package/es/vrender.d.ts +1 -1
  237. package/es/vrender.js +3 -2
  238. package/es/vrender.js.map +1 -1
  239. package/package.json +9 -8
@@ -20,26 +20,25 @@ function handleTextStick(table) {
20
20
  if (!(colEnd < 0 || rowEnd < 0)) {
21
21
  for (let row = 0; row < frozenRowCount && !(colEnd < colStart); row++) [ colStart, colEnd ].forEach((col => {
22
22
  const style = table._getCellStyle(col, row);
23
- if (null == style ? void 0 : style.textStick) {
23
+ if ((null == style ? void 0 : style.textStick) && "vertical" !== (null == style ? void 0 : style.textStick)) {
24
24
  adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table);
25
25
  }
26
26
  }));
27
27
  for (let col = 0; col < frozenColCount && !(rowEnd < rowStart); col++) [ rowStart, rowEnd ].forEach((row => {
28
28
  const style = table._getCellStyle(col, row);
29
- if ((null == style ? void 0 : style.textStick) && "tree" !== table.internalProps.layoutMap.rowHierarchyType) {
29
+ if ((null == style ? void 0 : style.textStick) && "tree" !== table.internalProps.layoutMap.rowHierarchyType && "horizontal" !== (null == style ? void 0 : style.textStick)) {
30
30
  adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table);
31
31
  }
32
32
  }));
33
33
  for (let col = colStart; col <= colEnd && !(rowEnd < rowStart); col++) [ rowStart, rowEnd ].forEach((row => {
34
34
  const style = table._getCellStyle(col, row);
35
- if (null == style ? void 0 : style.textStick) {
35
+ if ((null == style ? void 0 : style.textStick) && "horizontal" !== (null == style ? void 0 : style.textStick)) {
36
36
  adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table);
37
37
  }
38
38
  }));
39
- for (let row = rowStart; row < rowEnd && !(colEnd < colStart); row++) [ colStart, colEnd ].forEach((col => {
40
- var _a;
39
+ for (let row = rowStart; row <= rowEnd && !(colEnd < colStart); row++) [ colStart, colEnd ].forEach((col => {
41
40
  const style = table._getCellStyle(col, row);
42
- if (null === (_a = table._getCellStyle(col, row)) || void 0 === _a ? void 0 : _a.textStick) {
41
+ if ((null == style ? void 0 : style.textStick) && "vertical" !== (null == style ? void 0 : style.textStick)) {
43
42
  adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table);
44
43
  }
45
44
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/stick-text/index.ts"],"names":[],"mappings":";;;AAKA,6CAAiD;AACjD,yDAA4D;AAE5D,SAAgB,eAAe,CAAC,KAAmB;IAEjD,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,aA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,CAAC,CAAC,CAAC;QAChC,IAAI,MAAM,KAAI,MAAC,MAAM,CAAC,KAA0B,0CAAE,SAAS,CAAA,EAAE;YAC3D,OAAO,IAAI,CAAC;SACb;KACF;IACD,MAAM,UAAU,GACd,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;IAC/G,IAAI,UAAU,EAAE;QACd,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AArBD,gDAqBC","file":"index.js","sourcesContent":["import type { IGraphic, Image, Text } from './../../vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { ITextStyleOption, StickCell } from '../../ts-types';\nimport { isNumber, min } from '@visactor/vutils';\nimport { getCellMergeRange } from '../../tools/merge-range';\n\nexport function handleTextStick(table: BaseTableAPI) {\n // reset\n const { changedCells } = table.internalProps.stick; // changedCells only cache one time\n changedCells.forEach((cellPos: StickCell) => {\n const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: cellPos.dx,\n dy: cellPos.dy\n });\n });\n });\n changedCells.clear();\n\n const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;\n const frozenRowsHeight = table.getFrozenRowsHeight();\n const frozenColsWidth = table.getFrozenColsWidth();\n // 计算非冻结\n const { row: rowTop } = table.getRowAt(scrollTop + frozenRowsHeight + 1);\n const { col: colLeft } = table.getColAt(scrollLeft + frozenColsWidth + 1);\n const rowStart = Math.max(rowTop, table.frozenRowCount);\n const colStart = Math.max(colLeft, table.frozenColCount);\n const rowEnd =\n table.getAllRowsHeight() > table.tableNoFrameHeight\n ? table.getRowAt(scrollTop + table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() - 1).row\n : table.rowCount - table.bottomFrozenRowCount - 1;\n const colEnd =\n table.getAllColsWidth() > table.tableNoFrameWidth\n ? table.getColAt(scrollLeft + table.tableNoFrameWidth - table.getRightFrozenColsWidth() - 1).col\n : table.colCount - table.rightFrozenColCount - 1;\n if (colEnd < 0 || rowEnd < 0) {\n return;\n }\n\n // column header\n for (let row = 0; row < frozenRowCount; row++) {\n if (colEnd < colStart) {\n break;\n }\n [colStart, colEnd].forEach((col: number) => {\n const style = table._getCellStyle(col, row);\n if (style?.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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n\n // row header\n for (let col = 0; col < frozenColCount; col++) {\n if (rowEnd < rowStart) {\n break;\n }\n [rowStart, rowEnd].forEach((row: number) => {\n const style = table._getCellStyle(col, row);\n if (style?.textStick && (table.internalProps.layoutMap as PivotHeaderLayoutMap).rowHierarchyType !== 'tree') {\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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n\n // body\n for (let col = colStart; col <= colEnd; col++) {\n if (rowEnd < rowStart) {\n break;\n }\n [rowStart, rowEnd].forEach((row: number) => {\n const style = table._getCellStyle(col, row);\n if (style?.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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n for (let row = rowStart; row < rowEnd; row++) {\n if (colEnd < colStart) {\n break;\n }\n [colStart, colEnd].forEach((col: number) => {\n const style = table._getCellStyle(col, row);\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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n}\n\n/*\n * adjust cell content vertical layout\n * @param {Group} cellGroup\n * @param {number} scrollTop\n */\nfunction adjustCellContentVerticalLayout(\n cellGroup: Group,\n minTop: number,\n maxTop: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined,\n table: BaseTableAPI\n) {\n if (\n isNumber(cellGroup.mergeStartCol) &&\n isNumber(cellGroup.mergeStartRow) &&\n isNumber(cellGroup.mergeEndCol) &&\n isNumber(cellGroup.mergeEndRow)\n ) {\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);\n }\n }\n } else {\n dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);\n }\n}\n\nfunction dealVertical(\n cellGroup: Group,\n minTop: number,\n maxTop: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined\n) {\n // get text element\n const graphic =\n (cellGroup.getChildByName('text', true) as Text) || (cellGroup.getChildByName('image', true) as Image);\n if (!graphic) {\n return;\n }\n if (graphic.type === 'image') {\n const { image: url } = graphic.attribute;\n if (!url || !graphic.resources) {\n return;\n }\n const res = graphic.resources.get(url as any);\n if (res.state !== 'success') {\n return;\n }\n }\n\n // const textBaseline = (graphic as any).attribute.textBaseline ?? (graphic as any).textBaseline ?? 'top';\n const textBaseline = (graphic as any).textBaseline ?? 'top';\n\n graphic.AABBBounds.width();\n const textTop = graphic.globalAABBBounds.y1;\n const textBottom = graphic.globalAABBBounds.y2;\n\n if (textBaseline === 'middle' && textStickBaseOnAlign) {\n const cellTop = cellGroup.globalAABBBounds.y1 + ((cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0);\n const cellBottom = cellTop + (cellGroup.contentHeight ?? cellGroup.attribute.height ?? 0);\n if (cellTop < minTop || cellBottom > maxTop) {\n const visibleCellTop = Math.max(cellTop, minTop);\n const visibleCellBottom = Math.min(cellBottom, maxTop);\n const delta =\n graphic.globalTransMatrix.f - (visibleCellBottom + visibleCellTop) / 2 + graphic.AABBBounds.height() / 2;\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', (child.attribute.dy ?? 0) - delta + 2); // 2 is the buffer\n });\n }\n } else if (textTop < minTop) {\n const deltaHeight = textTop - minTop;\n // text is out of view, move all elements down\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', (child.attribute.dy ?? 0) - 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 !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', (child.attribute.dy ?? 0) - 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(\n cellGroup: Group,\n minLeft: number,\n maxLeft: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined,\n table: BaseTableAPI\n) {\n if (\n isNumber(cellGroup.mergeStartCol) &&\n isNumber(cellGroup.mergeStartRow) &&\n isNumber(cellGroup.mergeEndCol) &&\n isNumber(cellGroup.mergeEndRow)\n ) {\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);\n }\n }\n } else {\n dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);\n }\n}\n\nfunction dealHorizontal(\n cellGroup: Group,\n minLeft: number,\n maxLeft: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined\n) {\n // get text element\n // const text = cellGroup.getChildByName('text', true) as Text;\n // if (!text) {\n // return;\n // }\n\n // get text element\n const graphic =\n (cellGroup.getChildByName('text', true) as Text) || (cellGroup.getChildByName('image', true) as Image);\n if (!graphic) {\n return;\n }\n if (graphic.type === 'image') {\n const { image: url } = graphic.attribute;\n if (!url || !graphic.resources) {\n return;\n }\n const res = graphic.resources.get(url as any);\n if (res.state !== 'success') {\n return;\n }\n }\n const textAlign = (graphic as any).attribute.textAlign ?? (graphic as any).textAlign ?? 'left';\n graphic.AABBBounds.width();\n const textLeft = graphic.globalAABBBounds.x1;\n const textRight = graphic.globalAABBBounds.x2;\n if (textAlign === 'center' && textStickBaseOnAlign) {\n const cellLeft = cellGroup.globalAABBBounds.x1 + ((cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0);\n const cellRight = cellLeft + (cellGroup.contentWidth ?? cellGroup.attribute.width ?? 0);\n if (cellLeft < minLeft || cellRight > maxLeft) {\n const visibleCellLeft = Math.max(cellLeft, minLeft);\n const visibleCellRight = Math.min(cellRight, maxLeft);\n const delta = graphic.globalTransMatrix.e - (visibleCellRight + visibleCellLeft) / 2;\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', (child.attribute.dx ?? 0) - delta + 2); // 2 is the buffer\n });\n }\n } else if (textLeft < minLeft) {\n const deltaWidth = textLeft - minLeft;\n // text is out of view, move all elements right\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', (child.attribute.dx ?? 0) - 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 !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', (child.attribute.dx ?? 0) - 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 const themeStick =\n table.theme.headerStyle.textStick || table.theme.rowHeaderStyle.textStick || table.theme.bodyStyle.textStick;\n if (themeStick) {\n return true;\n }\n return false;\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/stick-text/index.ts"],"names":[],"mappings":";;;AAKA,6CAAiD;AACjD,yDAA4D;AAE5D,SAAgB,eAAe,CAAC,KAAmB;IAEjD,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;IACnD,YAAY,CAAC,OAAO,CAAC,CAAC,OAAkB,EAAE,EAAE;QAC1C,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,OAAO,CAAC,EAAE;gBACd,EAAE,EAAE,OAAO,CAAC,EAAE;aACf,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,YAAY,CAAC,KAAK,EAAE,CAAC;IAErB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAA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AAI,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;IAC/G,IAAI,UAAU,EAAE;QACd,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AArBD,gDAqBC","file":"index.js","sourcesContent":["import type { IGraphic, Image, Text } from './../../vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { ITextStyleOption, StickCell } from '../../ts-types';\nimport { isNumber, min } from '@visactor/vutils';\nimport { getCellMergeRange } from '../../tools/merge-range';\n\nexport function handleTextStick(table: BaseTableAPI) {\n // reset\n const { changedCells } = table.internalProps.stick; // changedCells only cache one time\n changedCells.forEach((cellPos: StickCell) => {\n const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: cellPos.dx,\n dy: cellPos.dy\n });\n });\n });\n changedCells.clear();\n\n const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;\n const frozenRowsHeight = table.getFrozenRowsHeight();\n const frozenColsWidth = table.getFrozenColsWidth();\n // 计算非冻结\n const { row: rowTop } = table.getRowAt(scrollTop + frozenRowsHeight + 1);\n const { col: colLeft } = table.getColAt(scrollLeft + frozenColsWidth + 1);\n const rowStart = Math.max(rowTop, table.frozenRowCount);\n const colStart = Math.max(colLeft, table.frozenColCount);\n const rowEnd =\n table.getAllRowsHeight() > table.tableNoFrameHeight\n ? table.getRowAt(scrollTop + table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() - 1).row\n : table.rowCount - table.bottomFrozenRowCount - 1;\n const colEnd =\n table.getAllColsWidth() > table.tableNoFrameWidth\n ? table.getColAt(scrollLeft + table.tableNoFrameWidth - table.getRightFrozenColsWidth() - 1).col\n : table.colCount - table.rightFrozenColCount - 1;\n if (colEnd < 0 || rowEnd < 0) {\n return;\n }\n\n // column header\n for (let row = 0; row < frozenRowCount; row++) {\n if (colEnd < colStart) {\n break;\n }\n [colStart, colEnd].forEach((col: number) => {\n const style = table._getCellStyle(col, row);\n if (style?.textStick && style?.textStick !== 'vertical') {\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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n\n // row header\n for (let col = 0; col < frozenColCount; col++) {\n if (rowEnd < rowStart) {\n break;\n }\n [rowStart, rowEnd].forEach((row: number) => {\n const style = table._getCellStyle(col, row);\n if (\n style?.textStick &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).rowHierarchyType !== 'tree' &&\n style?.textStick !== 'horizontal'\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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n\n // body\n for (let col = colStart; col <= colEnd; col++) {\n if (rowEnd < rowStart) {\n break;\n }\n [rowStart, rowEnd].forEach((row: number) => {\n const style = table._getCellStyle(col, row);\n if (style?.textStick && style?.textStick !== 'horizontal') {\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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n for (let row = rowStart; row <= rowEnd; row++) {\n if (colEnd < colStart) {\n break;\n }\n [colStart, colEnd].forEach((col: number) => {\n const style = table._getCellStyle(col, row);\n if (style?.textStick && style?.textStick !== 'vertical') {\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 changedCells,\n style?.textStickBaseOnAlign,\n table\n );\n }\n });\n }\n}\n\n/*\n * adjust cell content vertical layout\n * @param {Group} cellGroup\n * @param {number} scrollTop\n */\nfunction adjustCellContentVerticalLayout(\n cellGroup: Group,\n minTop: number,\n maxTop: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined,\n table: BaseTableAPI\n) {\n if (\n isNumber(cellGroup.mergeStartCol) &&\n isNumber(cellGroup.mergeStartRow) &&\n isNumber(cellGroup.mergeEndCol) &&\n isNumber(cellGroup.mergeEndRow)\n ) {\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);\n }\n }\n } else {\n dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);\n }\n}\n\nfunction dealVertical(\n cellGroup: Group,\n minTop: number,\n maxTop: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined\n) {\n // get text element\n const graphic =\n (cellGroup.getChildByName('text', true) as Text) || (cellGroup.getChildByName('image', true) as Image);\n if (!graphic) {\n return;\n }\n if (graphic.type === 'image') {\n const { image: url } = graphic.attribute;\n if (!url || !graphic.resources) {\n return;\n }\n const res = graphic.resources.get(url as any);\n if (res.state !== 'success') {\n return;\n }\n }\n\n // const textBaseline = (graphic as any).attribute.textBaseline ?? (graphic as any).textBaseline ?? 'top';\n const textBaseline = (graphic as any).textBaseline ?? 'top';\n\n graphic.AABBBounds.width();\n const textTop = graphic.globalAABBBounds.y1;\n const textBottom = graphic.globalAABBBounds.y2;\n\n if (textBaseline === 'middle' && textStickBaseOnAlign) {\n const cellTop = cellGroup.globalAABBBounds.y1 + ((cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0);\n const cellBottom = cellTop + (cellGroup.contentHeight ?? cellGroup.attribute.height ?? 0);\n if (cellTop < minTop || cellBottom > maxTop) {\n const visibleCellTop = Math.max(cellTop, minTop);\n const visibleCellBottom = Math.min(cellBottom, maxTop);\n const delta =\n graphic.globalTransMatrix.f - (visibleCellBottom + visibleCellTop) / 2 + graphic.AABBBounds.height() / 2;\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', (child.attribute.dy ?? 0) - delta + 2); // 2 is the buffer\n });\n }\n } else if (textTop < minTop) {\n const deltaHeight = textTop - minTop;\n // text is out of view, move all elements down\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', (child.attribute.dy ?? 0) - 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 !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', (child.attribute.dy ?? 0) - 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(\n cellGroup: Group,\n minLeft: number,\n maxLeft: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined,\n table: BaseTableAPI\n) {\n if (\n isNumber(cellGroup.mergeStartCol) &&\n isNumber(cellGroup.mergeStartRow) &&\n isNumber(cellGroup.mergeEndCol) &&\n isNumber(cellGroup.mergeEndRow)\n ) {\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);\n }\n }\n } else {\n dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);\n }\n}\n\nfunction dealHorizontal(\n cellGroup: Group,\n minLeft: number,\n maxLeft: number,\n changedCells: Map<string, StickCell>,\n textStickBaseOnAlign: boolean | undefined\n) {\n // get text element\n // const text = cellGroup.getChildByName('text', true) as Text;\n // if (!text) {\n // return;\n // }\n\n // get text element\n const graphic =\n (cellGroup.getChildByName('text', true) as Text) || (cellGroup.getChildByName('image', true) as Image);\n if (!graphic) {\n return;\n }\n if (graphic.type === 'image') {\n const { image: url } = graphic.attribute;\n if (!url || !graphic.resources) {\n return;\n }\n const res = graphic.resources.get(url as any);\n if (res.state !== 'success') {\n return;\n }\n }\n const textAlign = (graphic as any).attribute.textAlign ?? (graphic as any).textAlign ?? 'left';\n graphic.AABBBounds.width();\n const textLeft = graphic.globalAABBBounds.x1;\n const textRight = graphic.globalAABBBounds.x2;\n if (textAlign === 'center' && textStickBaseOnAlign) {\n const cellLeft = cellGroup.globalAABBBounds.x1 + ((cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0);\n const cellRight = cellLeft + (cellGroup.contentWidth ?? cellGroup.attribute.width ?? 0);\n if (cellLeft < minLeft || cellRight > maxLeft) {\n const visibleCellLeft = Math.max(cellLeft, minLeft);\n const visibleCellRight = Math.min(cellRight, maxLeft);\n const delta = graphic.globalTransMatrix.e - (visibleCellRight + visibleCellLeft) / 2;\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', (child.attribute.dx ?? 0) - delta + 2); // 2 is the buffer\n });\n }\n } else if (textLeft < minLeft) {\n const deltaWidth = textLeft - minLeft;\n // text is out of view, move all elements right\n !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', (child.attribute.dx ?? 0) - 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 !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&\n changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {\n col: cellGroup.col,\n row: cellGroup.row,\n dx: (cellGroup.firstChild as IGraphic)?.attribute.dx ?? 0,\n dy: (cellGroup.firstChild as IGraphic)?.attribute.dy ?? 0\n });\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', (child.attribute.dx ?? 0) - 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 const themeStick =\n table.theme.headerStyle.textStick || table.theme.rowHeaderStyle.textStick || table.theme.bodyStyle.textStick;\n if (themeStick) {\n return true;\n }\n return false;\n}\n"]}
@@ -3,6 +3,6 @@ import type { Group } from '../graphic/group';
3
3
  import type { BaseTableAPI } from '../../ts-types/base-table';
4
4
  export declare function createFrameBorder(group: Group, frameTheme: TableFrameStyle | undefined, role: string, strokeArray: [boolean, boolean, boolean, boolean] | undefined, justForXYPosition?: boolean): void;
5
5
  export declare function updateFrameBorder(group: Group, frameTheme: TableFrameStyle | undefined, strokeArray?: [boolean, boolean, boolean, boolean]): void;
6
- export declare function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined): string | true | (string | boolean)[];
6
+ export declare function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined, strokeLineWidth?: number | number[]): string | true | (string | boolean)[];
7
7
  export declare function updateFrameBorderSize(group: Group): void;
8
8
  export declare function updateCornerRadius(table: BaseTableAPI): void;
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.updateCornerRadius = exports.updateFrameBorderSize = exports.getStroke = exports.updateFrameBorder = exports.createFrameBorder = void 0;
6
6
 
7
- const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils"), padding_1 = require("../utils/padding");
7
+ const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils"), padding_1 = require("../utils/padding"), helper_1 = require("../../tools/helper");
8
8
 
9
9
  function createFrameBorder(group, frameTheme, role, strokeArray, justForXYPosition) {
10
- var _a, _b, _c, _d, _e;
10
+ var _a, _b, _c, _d, _e, _f;
11
11
  if (!frameTheme) return;
12
12
  const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme;
13
13
  let hasShadow = !1;
@@ -18,7 +18,7 @@ function createFrameBorder(group, frameTheme, role, strokeArray, justForXYPositi
18
18
  rectAttributes.shadowOffsetY = shadowOffsetY, rectAttributes.shadowColor = shadowColor,
19
19
  rectAttributes.stroke = !0, rectAttributes.stroke = shadowColor, rectAttributes.lineWidth = 1,
20
20
  hasShadow = !0), borderLineWidth && (rectAttributes.stroke = !0, rectAttributes.fill = !1,
21
- rectAttributes.stroke = getStroke(borderColor, strokeArray), rectAttributes.lineWidth = borderLineWidth,
21
+ rectAttributes.stroke = getStroke(borderColor, strokeArray, borderLineWidth), rectAttributes.lineWidth = borderLineWidth,
22
22
  borderLineDash && (rectAttributes.lineDash = borderLineDash), rectAttributes.lineCap = "butt"),
23
23
  Array.isArray(borderColor) && (rectAttributes.strokeArrayColor = (0, padding_1.getQuadProps)(borderColor)),
24
24
  Array.isArray(borderLineWidth) && (rectAttributes.strokeArrayWidth = (0, padding_1.getQuadProps)(borderLineWidth),
@@ -27,9 +27,22 @@ function createFrameBorder(group, frameTheme, role, strokeArray, justForXYPositi
27
27
  const borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_a = rectAttributes.lineWidth) && void 0 !== _a ? _a : 0, borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_b = rectAttributes.lineWidth) && void 0 !== _b ? _b : 0, borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_c = rectAttributes.lineWidth) && void 0 !== _c ? _c : 0, borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0;
28
28
  if (group.setAttributes(groupAttributes), !justForXYPosition && rectAttributes.stroke) if (rectAttributes.x = borderLeft / 2,
29
29
  rectAttributes.y = borderTop / 2, rectAttributes.pickable = !1, isTableGroup) {
30
+ if (cornerRadius) if (Array.isArray(cornerRadius)) {
31
+ const cornerRadiusArr = (0, padding_1.getQuadProps)(cornerRadius);
32
+ rectAttributes.cornerRadius = cornerRadiusArr, groupAttributes.cornerRadius = cornerRadiusArr,
33
+ cornerRadiusArr[0] && (cornerRadiusArr[0] = cornerRadiusArr[0] + Math.min(borderLeft, borderTop) / 2),
34
+ cornerRadiusArr[1] && (cornerRadiusArr[1] = cornerRadiusArr[1] + Math.min(borderTop, borderRight) / 2),
35
+ cornerRadiusArr[2] && (cornerRadiusArr[2] = cornerRadiusArr[2] + Math.min(borderRight, borderBottom) / 2),
36
+ cornerRadiusArr[3] && (cornerRadiusArr[3] = cornerRadiusArr[3] + Math.min(borderBottom, borderLeft) / 2);
37
+ } else if ((0, vutils_1.isArray)(borderLineWidth)) {
38
+ const cornerRadiusArr = [];
39
+ rectAttributes.cornerRadius = cornerRadiusArr, groupAttributes.cornerRadius = cornerRadiusArr,
40
+ cornerRadiusArr[0] = cornerRadius + Math.min(borderLeft, borderTop) / 2, cornerRadiusArr[1] = cornerRadius + Math.min(borderTop, borderRight) / 2,
41
+ cornerRadiusArr[2] = cornerRadius + Math.min(borderRight, borderBottom) / 2, cornerRadiusArr[3] = cornerRadius + Math.min(borderBottom, borderLeft) / 2;
42
+ } else rectAttributes.cornerRadius = cornerRadius + (null !== (_e = rectAttributes.lineWidth) && void 0 !== _e ? _e : 0) / 2,
43
+ groupAttributes.cornerRadius = cornerRadius + (null !== (_f = rectAttributes.lineWidth) && void 0 !== _f ? _f : 0) / 2;
30
44
  let shadowRect, borderRect;
31
- if (cornerRadius && (rectAttributes.cornerRadius = cornerRadius + (null !== (_e = rectAttributes.lineWidth) && void 0 !== _e ? _e : 0) / 2),
32
- frameTheme.innerBorder ? (rectAttributes.x = group.attribute.x + borderLeft / 2,
45
+ if (frameTheme.innerBorder ? (rectAttributes.x = group.attribute.x + borderLeft / 2,
33
46
  rectAttributes.y = group.attribute.y + borderTop / 2, rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2,
34
47
  rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2) : (rectAttributes.x = group.attribute.x - borderLeft / 2,
35
48
  rectAttributes.y = group.attribute.y - borderTop / 2, rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2,
@@ -70,10 +83,10 @@ function updateFrameBorder(group, frameTheme, strokeArray) {
70
83
  null === (_a = group.border) || void 0 === _a || _a.setAttribute("stroke", getStroke(borderColor, strokeArray));
71
84
  }
72
85
 
73
- function getStroke(borderColor, strokeArray) {
86
+ function getStroke(borderColor, strokeArray, strokeLineWidth) {
74
87
  let stroke = !0;
75
- return strokeArray && !(0, vutils_1.isArray)(borderColor) ? stroke = strokeArray.map((stroke => !!stroke && borderColor)) : strokeArray ? stroke = strokeArray : strokeArray || (0,
76
- vutils_1.isArray)(borderColor) ? (0, vutils_1.isArray)(borderColor) && (stroke = !0) : stroke = borderColor,
88
+ return !strokeArray && !(0, vutils_1.isArray)(strokeLineWidth) || (0, vutils_1.isArray)(borderColor) ? strokeArray ? stroke = strokeArray : strokeArray || (0,
89
+ vutils_1.isArray)(borderColor) ? (0, vutils_1.isArray)(borderColor) && (stroke = !0) : stroke = borderColor : stroke = (null != strokeArray ? strokeArray : strokeLineWidth).map((stroke => !!stroke && borderColor)),
77
90
  stroke;
78
91
  }
79
92
 
@@ -97,10 +110,12 @@ function updateCornerRadius(table) {
97
110
  rowHeaderGroup.setAttribute("cornerRadius", 0), bodyGroup.setAttribute("cornerRadius", 0),
98
111
  rightTopCornerGroup.setAttribute("cornerRadius", 0), leftBottomCornerGroup.setAttribute("cornerRadius", 0),
99
112
  rightBottomCornerGroup.setAttribute("cornerRadius", 0), rightFrozenGroup.setAttribute("cornerRadius", 0),
100
- bottomFrozenGroup.setAttribute("cornerRadius", 0), cornerHeaderGroup.attribute.width > 0 && cornerHeaderGroup.attribute.height > 0 ? setCornerRadius(cornerHeaderGroup, [ cornerRadius, 0, 0, 0 ]) : colHeaderGroup.attribute.height > 0 ? setCornerRadius(colHeaderGroup, [ cornerRadius, 0, 0, 0 ]) : rowHeaderGroup.attribute.width > 0 ? setCornerRadius(rowHeaderGroup, [ cornerRadius, 0, 0, 0 ]) : setCornerRadius(bodyGroup, [ cornerRadius, 0, 0, 0 ]),
101
- leftBottomCornerGroup.attribute.width > 0 && leftBottomCornerGroup.attribute.height > 0 ? setCornerRadius(leftBottomCornerGroup, [ 0, 0, 0, cornerRadius ]) : bottomFrozenGroup.attribute.height > 0 ? setCornerRadius(bottomFrozenGroup, [ 0, 0, 0, cornerRadius ]) : rowHeaderGroup.attribute.width > 0 ? setCornerRadius(rowHeaderGroup, [ 0, 0, 0, cornerRadius ]) : setCornerRadius(bodyGroup, [ 0, 0, 0, cornerRadius ]),
102
- rightTopCornerGroup.attribute.width > 0 && rightTopCornerGroup.attribute.height > 0 ? setCornerRadius(rightTopCornerGroup, [ 0, cornerRadius, 0, 0 ]) : colHeaderGroup.attribute.height > 0 ? setCornerRadius(colHeaderGroup, [ 0, cornerRadius, 0, 0 ]) : rightFrozenGroup.attribute.width > 0 ? setCornerRadius(rightFrozenGroup, [ 0, cornerRadius, 0, 0 ]) : setCornerRadius(bodyGroup, [ 0, cornerRadius, 0, 0 ]),
103
- rightBottomCornerGroup.attribute.width > 0 && rightBottomCornerGroup.attribute.height > 0 ? setCornerRadius(rightBottomCornerGroup, [ 0, 0, cornerRadius, 0 ]) : rightFrozenGroup.attribute.width > 0 ? setCornerRadius(rightFrozenGroup, [ 0, 0, cornerRadius, 0 ]) : bottomFrozenGroup.attribute.height > 0 ? setCornerRadius(bottomFrozenGroup, [ 0, 0, cornerRadius, 0 ]) : setCornerRadius(bodyGroup, [ 0, 0, cornerRadius, 0 ]);
113
+ bottomFrozenGroup.setAttribute("cornerRadius", 0);
114
+ const cornerRadiusArray = (0, helper_1.toBoxArray)(cornerRadius);
115
+ cornerHeaderGroup.attribute.width > 0 && cornerHeaderGroup.attribute.height > 0 ? setCornerRadius(cornerHeaderGroup, [ cornerRadiusArray[0], 0, 0, 0 ]) : colHeaderGroup.attribute.height > 0 ? setCornerRadius(colHeaderGroup, [ cornerRadiusArray[0], 0, 0, 0 ]) : rowHeaderGroup.attribute.width > 0 ? setCornerRadius(rowHeaderGroup, [ cornerRadiusArray[0], 0, 0, 0 ]) : setCornerRadius(bodyGroup, [ cornerRadiusArray[0], 0, 0, 0 ]),
116
+ leftBottomCornerGroup.attribute.width > 0 && leftBottomCornerGroup.attribute.height > 0 ? setCornerRadius(leftBottomCornerGroup, [ 0, 0, 0, cornerRadiusArray[3] ]) : bottomFrozenGroup.attribute.height > 0 ? setCornerRadius(bottomFrozenGroup, [ 0, 0, 0, cornerRadiusArray[3] ]) : rowHeaderGroup.attribute.width > 0 ? setCornerRadius(rowHeaderGroup, [ 0, 0, 0, cornerRadiusArray[3] ]) : setCornerRadius(bodyGroup, [ 0, 0, 0, cornerRadiusArray[3] ]),
117
+ rightTopCornerGroup.attribute.width > 0 && rightTopCornerGroup.attribute.height > 0 ? setCornerRadius(rightTopCornerGroup, [ 0, cornerRadiusArray[1], 0, 0 ]) : colHeaderGroup.attribute.height > 0 ? setCornerRadius(colHeaderGroup, [ 0, cornerRadiusArray[1], 0, 0 ]) : rightFrozenGroup.attribute.width > 0 ? setCornerRadius(rightFrozenGroup, [ 0, cornerRadiusArray[1], 0, 0 ]) : setCornerRadius(bodyGroup, [ 0, cornerRadiusArray[1], 0, 0 ]),
118
+ rightBottomCornerGroup.attribute.width > 0 && rightBottomCornerGroup.attribute.height > 0 ? setCornerRadius(rightBottomCornerGroup, [ 0, 0, cornerRadiusArray[2], 0 ]) : rightFrozenGroup.attribute.width > 0 ? setCornerRadius(rightFrozenGroup, [ 0, 0, cornerRadiusArray[2], 0 ]) : bottomFrozenGroup.attribute.height > 0 ? setCornerRadius(bottomFrozenGroup, [ 0, 0, cornerRadiusArray[2], 0 ]) : setCornerRadius(bodyGroup, [ 0, 0, cornerRadiusArray[2], 0 ]);
104
119
  }
105
120
 
106
121
  function setCornerRadius(group, cornerRadius) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/style/frame-border.ts"],"names":[],"mappings":";;;AACA,6CAA0D;AAG1D,6CAA2C;AAC3C,8CAAgD;AAWhD,SAAgB,iBAAiB,CAC/B,KAAY,EACZ,UAAuC,EACvC,IAAY,EACZ,WAA6D,EAC7D,iBAA2B;;IAE3B,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,CAAC;IAEtC,MAAM,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACf,GAAG,UAAU,CAAC;IAEf,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,eAAe,GAA2B,EAAE,CAAC;IACnD,MAAM,cAAc,GAA0B;QAC5C,QAAQ,EAAE,KAAK;KAChB,CAAC;IAEF,IAAI,UAAU,IAAI,YAAY,EAAE;QAE9B,cAAc,CAAC,UAAU,GAAG,UAAU,CAAC;QACvC,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC;QACzC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;QAC7B,cAAc,CAAC,MAAM,GAAG,WAAW,CAAC;QACpC,cAAc,CAAC,SAAS,GAAG,CAAC,CAAC;QAC7B,SAAS,GAAG,IAAI,CAAC;KAIlB;IAGD,IAAI,eAAe,EAAE;QACnB,cAAc,CAAC,MAAM,GAAG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,MAAM,GAAG,CAAC,EAAE;QAC7F,eAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;KAClE;SAAM,IAAI,gBAAgB,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,EAAE;QAC/C,eAAe,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;KAC5D;SAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QACjD,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;KAC7D;SAAM;QACL,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;KACrD;AACH,CAAC;AAvED,gDAuEC;AAED,SAAS,eAAe,CAAC,KAAY,EAAE,YAAsB;IAC3D,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,MAAM,EAAE;QAChB,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;KACzD;AACH,CAAC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRect, IRectGraphicAttribute } from './../../vrender';\nimport { createGroup, createRect } from './../../vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n let hasShadow = false;\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n hasShadow = true;\n\n // rectAttributes.fill = true;\n // rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'butt';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n // if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n // const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n // const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n // groupAttributes.x = deltaX;\n // groupAttributes.y = deltaY;\n // // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n // }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius + (rectAttributes.lineWidth ?? 0) / 2;\n }\n if (frameTheme.innerBorder) {\n rectAttributes.x = group.attribute.x + borderLeft / 2;\n rectAttributes.y = group.attribute.y + borderTop / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n } else {\n rectAttributes.x = group.attribute.x - borderLeft / 2;\n rectAttributes.y = group.attribute.y - borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n }\n\n let shadowRect;\n let borderRect;\n if (hasShadow) {\n rectAttributes.fill = 'white';\n (rectAttributes as any).notAdjustPos = true;\n // rectAttributes.globalCompositeOperation = 'source-over';\n\n // first draw group\n borderRect = createGroup(rectAttributes);\n borderRect.name = 'table-border-rect';\n\n // second draw rect\n shadowRect = createRect({\n x: borderLeft / 2,\n y: borderTop / 2,\n width: group.attribute.width,\n height: group.attribute.height,\n fill: 'red',\n cornerRadius: group.attribute.cornerRadius,\n globalCompositeOperation: 'destination-out'\n });\n borderRect.addChild(shadowRect);\n\n // hack for vrender globalCompositeOperation&clip render problem\n const hackRect = createRect({\n width: 1,\n height: 1,\n fill: 'transparent',\n pickable: false\n });\n borderRect.addChild(hackRect);\n } else {\n borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n }\n\n // to be fixed: border index in shadow mode\n if (frameTheme.innerBorder && !hasShadow) {\n group.parent.insertAfter(borderRect, group);\n } else {\n group.parent.insertBefore(borderRect, group);\n }\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray?: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nexport function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n\n if (group.border.type === 'group') {\n (group.border.firstChild as IRect).setAttributes({\n width: group.attribute.width,\n height: group.attribute.height\n });\n }\n}\n\nexport function updateCornerRadius(table: BaseTableAPI) {\n if (!table.theme.frameStyle.cornerRadius) {\n return;\n }\n const cornerRadius = table.theme.frameStyle.cornerRadius;\n const {\n cornerHeaderGroup,\n colHeaderGroup,\n rowHeaderGroup,\n bodyGroup,\n rightTopCornerGroup,\n leftBottomCornerGroup,\n rightBottomCornerGroup,\n rightFrozenGroup,\n bottomFrozenGroup\n } = table.scenegraph;\n\n // reset corner radius\n cornerHeaderGroup.setAttribute('cornerRadius', 0);\n colHeaderGroup.setAttribute('cornerRadius', 0);\n rowHeaderGroup.setAttribute('cornerRadius', 0);\n bodyGroup.setAttribute('cornerRadius', 0);\n rightTopCornerGroup.setAttribute('cornerRadius', 0);\n leftBottomCornerGroup.setAttribute('cornerRadius', 0);\n rightBottomCornerGroup.setAttribute('cornerRadius', 0);\n rightFrozenGroup.setAttribute('cornerRadius', 0);\n bottomFrozenGroup.setAttribute('cornerRadius', 0);\n\n // left top\n if (cornerHeaderGroup.attribute.width > 0 && cornerHeaderGroup.attribute.height > 0) {\n setCornerRadius(cornerHeaderGroup, [cornerRadius, 0, 0, 0]);\n } else if (colHeaderGroup.attribute.height > 0) {\n setCornerRadius(colHeaderGroup, [cornerRadius, 0, 0, 0]);\n } else if (rowHeaderGroup.attribute.width > 0) {\n setCornerRadius(rowHeaderGroup, [cornerRadius, 0, 0, 0]);\n } else {\n setCornerRadius(bodyGroup, [cornerRadius, 0, 0, 0]);\n }\n\n // left bottom\n if (leftBottomCornerGroup.attribute.width > 0 && leftBottomCornerGroup.attribute.height > 0) {\n setCornerRadius(leftBottomCornerGroup, [0, 0, 0, cornerRadius]);\n } else if (bottomFrozenGroup.attribute.height > 0) {\n setCornerRadius(bottomFrozenGroup, [0, 0, 0, cornerRadius]);\n } else if (rowHeaderGroup.attribute.width > 0) {\n setCornerRadius(rowHeaderGroup, [0, 0, 0, cornerRadius]);\n } else {\n setCornerRadius(bodyGroup, [0, 0, 0, cornerRadius]);\n }\n\n // right top\n if (rightTopCornerGroup.attribute.width > 0 && rightTopCornerGroup.attribute.height > 0) {\n setCornerRadius(rightTopCornerGroup, [0, cornerRadius, 0, 0]);\n } else if (colHeaderGroup.attribute.height > 0) {\n setCornerRadius(colHeaderGroup, [0, cornerRadius, 0, 0]);\n } else if (rightFrozenGroup.attribute.width > 0) {\n setCornerRadius(rightFrozenGroup, [0, cornerRadius, 0, 0]);\n } else {\n setCornerRadius(bodyGroup, [0, cornerRadius, 0, 0]);\n }\n\n // right bottom\n if (rightBottomCornerGroup.attribute.width > 0 && rightBottomCornerGroup.attribute.height > 0) {\n setCornerRadius(rightBottomCornerGroup, [0, 0, cornerRadius, 0]);\n } else if (rightFrozenGroup.attribute.width > 0) {\n setCornerRadius(rightFrozenGroup, [0, 0, cornerRadius, 0]);\n } else if (bottomFrozenGroup.attribute.height > 0) {\n setCornerRadius(bottomFrozenGroup, [0, 0, cornerRadius, 0]);\n } else {\n setCornerRadius(bodyGroup, [0, 0, cornerRadius, 0]);\n }\n}\n\nfunction setCornerRadius(group: Group, cornerRadius: number[]) {\n group.setAttribute('cornerRadius', cornerRadius);\n if (group.border) {\n group.border.setAttribute('cornerRadius', cornerRadius);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/style/frame-border.ts"],"names":[],"mappings":";;;AACA,6CAA0D;AAG1D,6CAA2C;AAC3C,8CAAgD;AAEhD,+CAAgD;AAUhD,SAAgB,iBAAiB,CAC/B,KAAY,EACZ,UAAuC,EACvC,IAAY,EACZ,WAA6D,EAC7D,iBAA2B;;IAE3B,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,CAAC;IAEtC,MAAM,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACf,GAAG,UAAU,CAAC;IACf,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,eAAe,GAA2B,EAAE,CAAC;IACnD,MAAM,cAAc,GAA0B;QAC5C,QAAQ,EAAE,KAAK;KAChB,CAAC;IAEF,IAAI,UAAU,IAAI,YAAY,EAAE;QAE9B,cAAc,CAAC,UAAU,GAAG,UAAU,CAAC;QACvC,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC;QACzC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;QAC7B,cAAc,CAAC,MAAM,GAAG,WAAW,CAAC;QACpC,cAAc,CAAC,SAAS,GAAG,CAAC,CAAC;QAC7B,SAAS,GAAG,IAAI,CAAC;KAIlB;IAGD,IAAI,eAAe,EAAE;QACnB,cAAc,CAAC,MAAM,G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SAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QACjD,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACrE;SAAM;QACL,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC7D;AACH,CAAC;AAxED,gDAwEC;AAED,SAAS,eAAe,CAAC,KAAY,EAAE,YAAsB;IAC3D,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,MAAM,EAAE;QAChB,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;KACzD;AACH,CAAC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRect, IRectGraphicAttribute } from './../../vrender';\nimport { createGroup, createRect } from './../../vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { toBoxArray } from '../../tools/helper';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n let hasShadow = false;\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n hasShadow = true;\n\n // rectAttributes.fill = true;\n // rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray, borderLineWidth);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'butt';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n // if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n // const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n // const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n // groupAttributes.x = deltaX;\n // groupAttributes.y = deltaY;\n // // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n // }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n if (cornerRadius) {\n if (Array.isArray(cornerRadius)) {\n const cornerRadiusArr = getQuadProps(cornerRadius);\n rectAttributes.cornerRadius = cornerRadiusArr;\n groupAttributes.cornerRadius = cornerRadiusArr;\n cornerRadiusArr[0] && (cornerRadiusArr[0] = cornerRadiusArr[0] + Math.min(borderLeft, borderTop) / 2);\n cornerRadiusArr[1] && (cornerRadiusArr[1] = cornerRadiusArr[1] + Math.min(borderTop, borderRight) / 2);\n cornerRadiusArr[2] && (cornerRadiusArr[2] = cornerRadiusArr[2] + Math.min(borderRight, borderBottom) / 2);\n cornerRadiusArr[3] && (cornerRadiusArr[3] = cornerRadiusArr[3] + Math.min(borderBottom, borderLeft) / 2);\n } else if (isArray(borderLineWidth)) {\n const cornerRadiusArr: number[] = [];\n rectAttributes.cornerRadius = cornerRadiusArr;\n groupAttributes.cornerRadius = cornerRadiusArr;\n cornerRadiusArr[0] = cornerRadius + Math.min(borderLeft, borderTop) / 2;\n cornerRadiusArr[1] = cornerRadius + Math.min(borderTop, borderRight) / 2;\n cornerRadiusArr[2] = cornerRadius + Math.min(borderRight, borderBottom) / 2;\n cornerRadiusArr[3] = cornerRadius + Math.min(borderBottom, borderLeft) / 2;\n } else {\n rectAttributes.cornerRadius = cornerRadius + (rectAttributes.lineWidth ?? 0) / 2;\n groupAttributes.cornerRadius = cornerRadius + (rectAttributes.lineWidth ?? 0) / 2;\n }\n }\n if (frameTheme.innerBorder) {\n rectAttributes.x = group.attribute.x + borderLeft / 2;\n rectAttributes.y = group.attribute.y + borderTop / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n } else {\n rectAttributes.x = group.attribute.x - borderLeft / 2;\n rectAttributes.y = group.attribute.y - borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n }\n\n let shadowRect;\n let borderRect;\n if (hasShadow) {\n rectAttributes.fill = 'white';\n (rectAttributes as any).notAdjustPos = true;\n // rectAttributes.globalCompositeOperation = 'source-over';\n\n // first draw group\n borderRect = createGroup(rectAttributes);\n borderRect.name = 'table-border-rect';\n\n // second draw rect\n shadowRect = createRect({\n x: borderLeft / 2,\n y: borderTop / 2,\n width: group.attribute.width,\n height: group.attribute.height,\n fill: 'red',\n cornerRadius: group.attribute.cornerRadius,\n globalCompositeOperation: 'destination-out'\n });\n borderRect.addChild(shadowRect);\n\n // hack for vrender globalCompositeOperation&clip render problem\n const hackRect = createRect({\n width: 1,\n height: 1,\n fill: 'transparent',\n pickable: false\n });\n borderRect.addChild(hackRect);\n } else {\n borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n }\n\n // to be fixed: border index in shadow mode\n if (frameTheme.innerBorder && !hasShadow) {\n group.parent.insertAfter(borderRect, group);\n } else {\n group.parent.insertBefore(borderRect, group);\n }\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray?: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nexport function getStroke(\n borderColor: string | string[],\n strokeArray: boolean[] | undefined,\n strokeLineWidth?: number | number[]\n) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if ((strokeArray || isArray(strokeLineWidth)) && !isArray(borderColor)) {\n stroke = (strokeArray ?? (strokeLineWidth as number[])).map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n\n if (group.border.type === 'group') {\n (group.border.firstChild as IRect).setAttributes({\n width: group.attribute.width,\n height: group.attribute.height\n });\n }\n}\n\nexport function updateCornerRadius(table: BaseTableAPI) {\n if (!table.theme.frameStyle.cornerRadius) {\n return;\n }\n const cornerRadius = table.theme.frameStyle.cornerRadius;\n const {\n cornerHeaderGroup,\n colHeaderGroup,\n rowHeaderGroup,\n bodyGroup,\n rightTopCornerGroup,\n leftBottomCornerGroup,\n rightBottomCornerGroup,\n rightFrozenGroup,\n bottomFrozenGroup\n } = table.scenegraph;\n\n // reset corner radius\n cornerHeaderGroup.setAttribute('cornerRadius', 0);\n colHeaderGroup.setAttribute('cornerRadius', 0);\n rowHeaderGroup.setAttribute('cornerRadius', 0);\n bodyGroup.setAttribute('cornerRadius', 0);\n rightTopCornerGroup.setAttribute('cornerRadius', 0);\n leftBottomCornerGroup.setAttribute('cornerRadius', 0);\n rightBottomCornerGroup.setAttribute('cornerRadius', 0);\n rightFrozenGroup.setAttribute('cornerRadius', 0);\n bottomFrozenGroup.setAttribute('cornerRadius', 0);\n\n const cornerRadiusArray = toBoxArray(cornerRadius);\n // left top\n if (cornerHeaderGroup.attribute.width > 0 && cornerHeaderGroup.attribute.height > 0) {\n setCornerRadius(cornerHeaderGroup, [cornerRadiusArray[0], 0, 0, 0]);\n } else if (colHeaderGroup.attribute.height > 0) {\n setCornerRadius(colHeaderGroup, [cornerRadiusArray[0], 0, 0, 0]);\n } else if (rowHeaderGroup.attribute.width > 0) {\n setCornerRadius(rowHeaderGroup, [cornerRadiusArray[0], 0, 0, 0]);\n } else {\n setCornerRadius(bodyGroup, [cornerRadiusArray[0], 0, 0, 0]);\n }\n\n // left bottom\n if (leftBottomCornerGroup.attribute.width > 0 && leftBottomCornerGroup.attribute.height > 0) {\n setCornerRadius(leftBottomCornerGroup, [0, 0, 0, cornerRadiusArray[3]]);\n } else if (bottomFrozenGroup.attribute.height > 0) {\n setCornerRadius(bottomFrozenGroup, [0, 0, 0, cornerRadiusArray[3]]);\n } else if (rowHeaderGroup.attribute.width > 0) {\n setCornerRadius(rowHeaderGroup, [0, 0, 0, cornerRadiusArray[3]]);\n } else {\n setCornerRadius(bodyGroup, [0, 0, 0, cornerRadiusArray[3]]);\n }\n\n // right top\n if (rightTopCornerGroup.attribute.width > 0 && rightTopCornerGroup.attribute.height > 0) {\n setCornerRadius(rightTopCornerGroup, [0, cornerRadiusArray[1], 0, 0]);\n } else if (colHeaderGroup.attribute.height > 0) {\n setCornerRadius(colHeaderGroup, [0, cornerRadiusArray[1], 0, 0]);\n } else if (rightFrozenGroup.attribute.width > 0) {\n setCornerRadius(rightFrozenGroup, [0, cornerRadiusArray[1], 0, 0]);\n } else {\n setCornerRadius(bodyGroup, [0, cornerRadiusArray[1], 0, 0]);\n }\n\n // right bottom\n if (rightBottomCornerGroup.attribute.width > 0 && rightBottomCornerGroup.attribute.height > 0) {\n setCornerRadius(rightBottomCornerGroup, [0, 0, cornerRadiusArray[2], 0]);\n } else if (rightFrozenGroup.attribute.width > 0) {\n setCornerRadius(rightFrozenGroup, [0, 0, cornerRadiusArray[2], 0]);\n } else if (bottomFrozenGroup.attribute.height > 0) {\n setCornerRadius(bottomFrozenGroup, [0, 0, cornerRadiusArray[2], 0]);\n } else {\n setCornerRadius(bodyGroup, [0, 0, cornerRadiusArray[2], 0]);\n }\n}\n\nfunction setCornerRadius(group: Group, cornerRadius: number[]) {\n group.setAttribute('cornerRadius', cornerRadius);\n if (group.border) {\n group.border.setAttribute('cornerRadius', cornerRadius);\n }\n}\n"]}
@@ -6,7 +6,7 @@ function getCellMergeInfo(table, col, row) {
6
6
  const customMerge = table.getCustomMerge(col, row);
7
7
  if (customMerge) return customMerge.range;
8
8
  }
9
- if (!table.isHeader(col, row) && !(null === (_a = table.getBodyColumnDefine(col, row)) || void 0 === _a ? void 0 : _a.mergeCell)) return !1;
9
+ if (!table.internalProps.enableTreeNodeMerge && !table.isHeader(col, row) && !(null === (_a = table.getBodyColumnDefine(col, row)) || void 0 === _a ? void 0 : _a.mergeCell)) return !1;
10
10
  const range = table.getCellRange(col, row);
11
11
  return !(range.start.col === range.end.col && range.start.row === range.end.row) && range;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/utils/get-cell-merge.ts"],"names":[],"mappings":";;;AAUA,SAAgB,gBAAgB,CAAC,KAAmB,EAAE,GAAW,EAAE,GAAW;;IAE5E,IAAI,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE;QACvC,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,WAAW,EAAE;YACf,OAAO,WAAW,CAAC,KAAK,CAAC;SAC1B;KACF;IACD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA,MAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAkB,0CAAE,SAAS,CAAA,EAAE;QAClG,OAAO,KAAK,CAAC;KACd;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACvF,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,4CAiBC","file":"get-cell-merge.js","sourcesContent":["import type { CellRange, ColumnDefine, TextColumnDefine } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\n/**\n * @description: 获取对应坐标单元格的单元格合并信息,没有单元格合并返回false,有合并返回合并信息\n * @param {BaseTableAPI} table\n * @param {number} col\n * @param {number} row\n * @return {false | CellRange}\n */\nexport function getCellMergeInfo(table: BaseTableAPI, col: number, row: number): false | CellRange {\n // 先判断非表头且非cellMerge配置,返回false\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n return customMerge.range;\n }\n }\n if (!table.isHeader(col, row) && !(table.getBodyColumnDefine(col, row) as ColumnDefine)?.mergeCell) {\n return false;\n }\n const range = table.getCellRange(col, row);\n const isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (!isMerge) {\n return false;\n }\n return range;\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/utils/get-cell-merge.ts"],"names":[],"mappings":";;;AAUA,SAAgB,gBAAgB,CAAC,KAAmB,EAAE,GAAW,EAAE,GAAW;;IAE5E,IAAI,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE;QACvC,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,WAAW,EAAE;YACf,OAAO,WAAW,CAAC,KAAK,CAAC;SAC1B;KACF;IACD,IACE,CAAC,KAAK,CAAC,aAAa,CAAC,mBAAmB;QACxC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;QACzB,CAAC,CAAA,MAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAkB,0CAAE,SAAS,CAAA,EACjE;QACA,OAAO,KAAK,CAAC;KACd;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACvF,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AArBD,4CAqBC","file":"get-cell-merge.js","sourcesContent":["import type { CellRange, ColumnDefine, TextColumnDefine } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\n/**\n * @description: 获取对应坐标单元格的单元格合并信息,没有单元格合并返回false,有合并返回合并信息\n * @param {BaseTableAPI} table\n * @param {number} col\n * @param {number} row\n * @return {false | CellRange}\n */\nexport function getCellMergeInfo(table: BaseTableAPI, col: number, row: number): false | CellRange {\n // 先判断非表头且非cellMerge配置,返回false\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n return customMerge.range;\n }\n }\n if (\n !table.internalProps.enableTreeNodeMerge &&\n !table.isHeader(col, row) &&\n !(table.getBodyColumnDefine(col, row) as ColumnDefine)?.mergeCell\n ) {\n return false;\n }\n const range = table.getCellRange(col, row);\n const isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (!isMerge) {\n return false;\n }\n return range;\n}\n"]}
@@ -7,20 +7,18 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const vutils_1 = require("@visactor/vutils"), ts_types_1 = require("../../ts-types");
8
8
 
9
9
  function getHierarchyOffset(col, row, table) {
10
- var _a, _b, _c;
10
+ var _a, _b, _c, _d, _e;
11
11
  let cellHierarchyIndent = 0;
12
12
  const layoutMap = table.internalProps.layoutMap;
13
13
  if (layoutMap.isHeader(col, row)) {
14
14
  const hd = layoutMap.getHeader(col, row);
15
15
  (0, vutils_1.isValid)(null == hd ? void 0 : hd.hierarchyLevel) && (cellHierarchyIndent = (null !== (_a = hd.hierarchyLevel) && void 0 !== _a ? _a : 0) * (null !== (_b = layoutMap.rowHierarchyIndent) && void 0 !== _b ? _b : 0),
16
16
  layoutMap.rowHierarchyTextStartAlignment && !table.internalProps.headerHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth()));
17
- } else {
18
- const define = table.getBodyColumnDefine(col, row);
19
- if (null == define ? void 0 : define.tree) {
20
- const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));
21
- cellHierarchyIndent = Array.isArray(indexArr) && table.getHierarchyState(col, row) !== ts_types_1.HierarchyState.none ? (indexArr.length - 1) * (null !== (_c = layoutMap.hierarchyIndent) && void 0 !== _c ? _c : 0) : 0,
22
- layoutMap.hierarchyTextStartAlignment && !table.internalProps.bodyHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.bodyHelper.getHierarchyIconWidth());
23
- }
17
+ } else if (table.options.groupBy || (null === (_c = table.getBodyColumnDefine(col, row)) || void 0 === _c ? void 0 : _c.tree)) {
18
+ const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row)), groupLength = null !== (_d = table.dataSource.getGroupLength()) && void 0 !== _d ? _d : 0;
19
+ let indexArrLngth = (0, vutils_1.isArray)(indexArr) ? indexArr.length - 1 : 0;
20
+ groupLength > 0 && indexArrLngth === groupLength && (indexArrLngth = 0), cellHierarchyIndent = Array.isArray(indexArr) && table.getHierarchyState(col, row) !== ts_types_1.HierarchyState.none ? indexArrLngth * (null !== (_e = layoutMap.hierarchyIndent) && void 0 !== _e ? _e : 0) : 0,
21
+ layoutMap.hierarchyTextStartAlignment && !table.internalProps.bodyHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.bodyHelper.getHierarchyIconWidth());
24
22
  }
25
23
  return cellHierarchyIndent;
26
24
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/utils/get-hierarchy-offset.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAI3C,6CAAgD;AAGhD,SAAgB,kBAAkB,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;;IAE9E,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IAEhD,IAAI,SAAS,CAAC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G,EAAE,GAAG,CAAC,EAC1D;gBACA,mBAAmB,IAAI,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC;aAC/E;SACF;KACF;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AApCD,gDAoCC","file":"get-hierarchy-offset.js","sourcesContent":["import { isValid } from '@visactor/vutils';\nimport type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { ColumnDefine } from '../../ts-types';\nimport { HierarchyState } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\n\nexport function getHierarchyOffset(col: number, row: number, table: BaseTableAPI): number {\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row) as HeaderData;\n if (isValid(hd?.hierarchyLevel)) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n if (\n (layoutMap as PivotHeaderLayoutMap).rowHierarchyTextStartAlignment &&\n !table.internalProps.headerHelper.getHierarchyIcon(col, row)\n ) {\n cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth();\n }\n }\n } else {\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n const define = table.getBodyColumnDefine(col, row);\n if ((define as ColumnDefine)?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n if (\n (layoutMap as SimpleHeaderLayoutMap).hierarchyTextStartAlignment &&\n !table.internalProps.bodyHelper.getHierarchyIcon(col, row)\n ) {\n cellHierarchyIndent += table.internalProps.bodyHelper.getHierarchyIconWidth();\n }\n }\n }\n\n return cellHierarchyIndent;\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/utils/get-hierarchy-offset.ts"],"names":[],"mappings":";;;AAAA,6CAAoD;AAIpD,6CAAgD;AAGhD,SAAgB,kBAAkB,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;;IAE9E,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IAEhD,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;QAChC,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAe,CAAC;QACvD,IAAI,IAAA,gBAAO,EAAC,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,cAAc,CAAC,EAAE;YAC/B,mBAAmB,GAAG,CAAC,MAAA,EAAE,CAAC,cAAc,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAC,SAAkC,CAAC,kBAAkB,mCAAI,CAAC,CAAC,CAAC;YAC/G,IACG,SAAkC,CAAC,8BAA8B;gBAClE,CAAC,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC5D;gBACA,mBAAmB,IAAI,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC;aACjF;SACF;KACF;SAAM;QAGL,IACG,KAAK,CAAC,OAAuC,CAAC,OAAO;aACtD,MAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAkB,0CAAE,IAAI,CAAA,EAC3D;YACA,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACxF,MAAM,WAAW,GAAG,MAAA,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,mCAAI,CAAC,CAAC;YAC3D,IAAI,aAAa,GAAG,IAAA,gBAAO,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAChE,IAAI,WAAW,GAAG,CAAC,IAAI,aAAa,KAAK,WAAW,EAAE;gBACpD,aAAa,GAAG,CAAC,CAAC;aACnB;YACD,mBAAmB;gBACjB,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,yBAAc,CAAC,IAAI;oBAClF,CAAC,CAAC,aAAa,GAAG,CAAC,MAAC,SAAmC,CAAC,eAAe,mCAAI,CAAC,CAAC;oBAC7E,CAAC,CAAC,CAAC,CAAC;YACR,IACG,SAAmC,CAAC,2BAA2B;gBAChE,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC1D;gBACA,mBAAmB,IAAI,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC;aAC/E;SACF;KACF;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AA3CD,gDA2CC","file":"get-hierarchy-offset.js","sourcesContent":["import { isArray, isValid } from '@visactor/vutils';\nimport type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { ColumnDefine, ListTableConstructorOptions } from '../../ts-types';\nimport { HierarchyState } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\n\nexport function getHierarchyOffset(col: number, row: number, table: BaseTableAPI): number {\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row) as HeaderData;\n if (isValid(hd?.hierarchyLevel)) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n if (\n (layoutMap as PivotHeaderLayoutMap).rowHierarchyTextStartAlignment &&\n !table.internalProps.headerHelper.getHierarchyIcon(col, row)\n ) {\n cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth();\n }\n }\n } else {\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n if (\n (table.options as ListTableConstructorOptions).groupBy ||\n (table.getBodyColumnDefine(col, row) as ColumnDefine)?.tree\n ) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));\n const groupLength = table.dataSource.getGroupLength() ?? 0;\n let indexArrLngth = isArray(indexArr) ? indexArr.length - 1 : 0;\n if (groupLength > 0 && indexArrLngth === groupLength) {\n indexArrLngth = 0;\n }\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? indexArrLngth * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n if (\n (layoutMap as SimpleHeaderLayoutMap).hierarchyTextStartAlignment &&\n !table.internalProps.bodyHelper.getHierarchyIcon(col, row)\n ) {\n cellHierarchyIndent += table.internalProps.bodyHelper.getHierarchyIconWidth();\n }\n }\n }\n\n return cellHierarchyIndent;\n}\n"]}
@@ -153,17 +153,19 @@ function updateCellContentWidth(cellGroup, distWidth, cellHeight, detaX, autoRow
153
153
  (0, vutils_1.isValidNumber)(cellGroup.contentWidth) && (detaX = distWidth - (null !== (_a = cellGroup.contentWidth) && void 0 !== _a ? _a : cellGroup.attribute.width));
154
154
  let oldTextHeight, leftIconWidth = 0, leftIconHeight = 0, rightIconWidth = 0, rightIconHeight = 0;
155
155
  cellGroup.forEachChildren((iconMark => {
156
- "icon-left" === iconMark.role ? (leftIconWidth += iconMark.AABBBounds.width(), leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height())) : "icon-right" === iconMark.role && (rightIconWidth += iconMark.AABBBounds.width(),
156
+ var _a, _b, _c, _d;
157
+ "icon-left" === iconMark.role ? (leftIconWidth += iconMark.AABBBounds.width() + (null !== (_a = iconMark.attribute.marginLeft) && void 0 !== _a ? _a : 0) + (null !== (_b = iconMark.attribute.marginRight) && void 0 !== _b ? _b : 0),
158
+ leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height())) : "icon-right" === iconMark.role && (rightIconWidth += iconMark.AABBBounds.width() + (null !== (_c = iconMark.attribute.marginLeft) && void 0 !== _c ? _c : 0) + (null !== (_d = iconMark.attribute.marginRight) && void 0 !== _d ? _d : 0),
157
159
  rightIconHeight = Math.max(rightIconHeight, iconMark.AABBBounds.height()));
158
160
  }));
159
161
  const textMark = cellGroup.getChildByName("text"), cellContent = cellGroup.getChildByName("content");
160
162
  let contentHeight;
161
163
  textMark instanceof vrender_1.Text ? (oldTextHeight = textMark.AABBBounds.height(),
162
- textMark.setAttribute("maxLineWidth", distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]) - (null !== (_b = textMark.attribute.dx) && void 0 !== _b ? _b : 0) - (null !== (_c = scene.table.theme._contentOffset) && void 0 !== _c ? _c : 0)),
164
+ textMark.setAttribute("maxLineWidth", distWidth - leftIconWidth - rightIconWidth - (padding[1] + padding[3]) - (null !== (_b = textMark.attribute.dx) && void 0 !== _b ? _b : 0) - (null !== (_c = scene.table.theme._contentOffset) && void 0 !== _c ? _c : 0)),
163
165
  contentHeight = textMark.AABBBounds.height()) : textMark instanceof vrender_1.RichText ? (oldTextHeight = textMark.AABBBounds.height(),
164
- textMark.setAttribute("width", distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3])),
166
+ textMark.setAttribute("width", distWidth - leftIconWidth - rightIconWidth - (padding[1] + padding[3])),
165
167
  contentHeight = textMark.AABBBounds.height()) : cellContent && (oldTextHeight = cellContent.AABBBounds.height(),
166
- cellContent.updateWidth(distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3])),
168
+ cellContent.updateWidth(distWidth - leftIconWidth - rightIconWidth - (padding[1] + padding[3])),
167
169
  contentHeight = cellContent.AABBBounds.height());
168
170
  const oldCellHeight = Math.round(Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2]);
169
171
  if (cellGroup.forEachChildren((child => {