k-vtable 1.0.37 → 1.0.38

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 (171) hide show
  1. package/cjs/ListTable.d.ts +2 -1
  2. package/cjs/ListTable.js +31 -10
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/body-helper/body-helper.d.ts +1 -0
  5. package/cjs/body-helper/body-helper.js +4 -3
  6. package/cjs/body-helper/body-helper.js.map +1 -1
  7. package/cjs/body-helper/style.js +2 -1
  8. package/cjs/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  9. package/cjs/core/BaseTable.d.ts +1 -0
  10. package/cjs/core/BaseTable.js +28 -22
  11. package/cjs/core/BaseTable.js.map +1 -1
  12. package/cjs/core/row-series-number-helper.d.ts +1 -0
  13. package/cjs/core/row-series-number-helper.js +3 -1
  14. package/cjs/core/row-series-number-helper.js.map +1 -1
  15. package/cjs/data/CachedDataSource.js +5 -3
  16. package/cjs/data/CachedDataSource.js.map +1 -1
  17. package/cjs/data/DataSource.js +1 -2
  18. package/cjs/dataset/DataStatistics.js +2 -1
  19. package/cjs/header-helper/header-helper.d.ts +1 -0
  20. package/cjs/header-helper/header-helper.js +4 -3
  21. package/cjs/header-helper/header-helper.js.map +1 -1
  22. package/cjs/header-helper/style.js +2 -1
  23. package/cjs/index.d.ts +1 -1
  24. package/cjs/index.js +1 -1
  25. package/cjs/index.js.map +1 -1
  26. package/cjs/plugins/custom-cell-style.js +1 -1
  27. package/cjs/scenegraph/animation/appear.js +18 -3
  28. package/cjs/scenegraph/animation/appear.js.map +1 -1
  29. package/cjs/scenegraph/component/custom.js +3 -3
  30. package/cjs/scenegraph/component/custom.js.map +1 -1
  31. package/cjs/scenegraph/component/menu.js +4 -4
  32. package/cjs/scenegraph/component/menu.js.map +1 -1
  33. package/cjs/scenegraph/graphic/chart.d.ts +6 -1
  34. package/cjs/scenegraph/graphic/chart.js +38 -4
  35. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  36. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  37. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  38. package/cjs/scenegraph/graphic/group.d.ts +3 -1
  39. package/cjs/scenegraph/graphic/group.js +21 -3
  40. package/cjs/scenegraph/graphic/group.js.map +1 -1
  41. package/cjs/scenegraph/group-creater/cell-helper.js +4 -3
  42. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  44. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  46. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  47. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  48. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  49. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +3 -3
  50. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  51. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  52. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  53. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  54. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  55. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  56. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -6
  58. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +101 -12
  60. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/column-helper.js +4 -3
  62. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  63. package/cjs/scenegraph/layout/update-row.js +3 -3
  64. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  65. package/cjs/scenegraph/runtime-contributions.d.ts +2 -0
  66. package/cjs/scenegraph/runtime-contributions.js +28 -0
  67. package/cjs/scenegraph/runtime-contributions.js.map +1 -0
  68. package/cjs/scenegraph/scenegraph.d.ts +4 -1
  69. package/cjs/scenegraph/scenegraph.js +40 -16
  70. package/cjs/scenegraph/scenegraph.js.map +1 -1
  71. package/cjs/scenegraph/utils/text-icon-layout.d.ts +4 -0
  72. package/cjs/scenegraph/utils/text-icon-layout.js +23 -6
  73. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  74. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  75. package/cjs/ts-types/base-table.d.ts +7 -1
  76. package/cjs/ts-types/base-table.js.map +1 -1
  77. package/cjs/ts-types/table-engine.d.ts +1 -1
  78. package/cjs/ts-types/table-engine.js.map +1 -1
  79. package/cjs/vrender-app.d.ts +20 -0
  80. package/cjs/vrender-app.js +141 -0
  81. package/cjs/vrender-app.js.map +1 -0
  82. package/cjs/vrender.d.ts +17 -1
  83. package/cjs/vrender.js +36 -15
  84. package/cjs/vrender.js.map +1 -1
  85. package/dist/vtable.js +106132 -96965
  86. package/dist/vtable.min.js +1 -1
  87. package/es/ListTable.d.ts +2 -1
  88. package/es/ListTable.js +30 -9
  89. package/es/ListTable.js.map +1 -1
  90. package/es/body-helper/body-helper.d.ts +1 -0
  91. package/es/body-helper/body-helper.js +4 -3
  92. package/es/body-helper/body-helper.js.map +1 -1
  93. package/es/body-helper/style.js +2 -1
  94. package/es/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  95. package/es/core/BaseTable.d.ts +1 -0
  96. package/es/core/BaseTable.js +30 -24
  97. package/es/core/BaseTable.js.map +1 -1
  98. package/es/core/row-series-number-helper.d.ts +1 -0
  99. package/es/core/row-series-number-helper.js +3 -1
  100. package/es/core/row-series-number-helper.js.map +1 -1
  101. package/es/data/CachedDataSource.js +5 -3
  102. package/es/data/CachedDataSource.js.map +1 -1
  103. package/es/data/DataSource.js +1 -2
  104. package/es/dataset/DataStatistics.js +2 -1
  105. package/es/header-helper/header-helper.d.ts +1 -0
  106. package/es/header-helper/header-helper.js +4 -3
  107. package/es/header-helper/header-helper.js.map +1 -1
  108. package/es/header-helper/style.js +2 -1
  109. package/es/index.d.ts +1 -1
  110. package/es/index.js +1 -1
  111. package/es/index.js.map +1 -1
  112. package/es/plugins/custom-cell-style.js +1 -1
  113. package/es/scenegraph/animation/appear.js +18 -3
  114. package/es/scenegraph/animation/appear.js.map +1 -1
  115. package/es/scenegraph/component/custom.js +3 -3
  116. package/es/scenegraph/component/custom.js.map +1 -1
  117. package/es/scenegraph/component/menu.js +4 -4
  118. package/es/scenegraph/component/menu.js.map +1 -1
  119. package/es/scenegraph/graphic/chart.d.ts +6 -1
  120. package/es/scenegraph/graphic/chart.js +39 -3
  121. package/es/scenegraph/graphic/chart.js.map +1 -1
  122. package/es/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  123. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  124. package/es/scenegraph/graphic/group.d.ts +3 -1
  125. package/es/scenegraph/graphic/group.js +21 -3
  126. package/es/scenegraph/graphic/group.js.map +1 -1
  127. package/es/scenegraph/group-creater/cell-helper.js +4 -3
  128. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  129. package/es/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  130. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  131. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  132. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  133. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  134. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  135. package/es/scenegraph/group-creater/cell-type/image-cell.js +3 -3
  136. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  137. package/es/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  138. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  139. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  140. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  141. package/es/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  142. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  143. package/es/scenegraph/group-creater/cell-type/text-cell.js +5 -5
  144. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  145. package/es/scenegraph/group-creater/cell-type/video-cell.js +99 -12
  146. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  147. package/es/scenegraph/group-creater/column-helper.js +4 -3
  148. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  149. package/es/scenegraph/layout/update-row.js +3 -3
  150. package/es/scenegraph/layout/update-row.js.map +1 -1
  151. package/es/scenegraph/runtime-contributions.d.ts +2 -0
  152. package/es/scenegraph/runtime-contributions.js +20 -0
  153. package/es/scenegraph/runtime-contributions.js.map +1 -0
  154. package/es/scenegraph/scenegraph.d.ts +4 -1
  155. package/es/scenegraph/scenegraph.js +42 -16
  156. package/es/scenegraph/scenegraph.js.map +1 -1
  157. package/es/scenegraph/utils/text-icon-layout.d.ts +4 -0
  158. package/es/scenegraph/utils/text-icon-layout.js +18 -2
  159. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  160. package/es/scenegraph/utils/text-measure.js.map +1 -1
  161. package/es/ts-types/base-table.d.ts +7 -1
  162. package/es/ts-types/base-table.js.map +1 -1
  163. package/es/ts-types/table-engine.d.ts +1 -1
  164. package/es/ts-types/table-engine.js.map +1 -1
  165. package/es/vrender-app.d.ts +20 -0
  166. package/es/vrender-app.js +161 -0
  167. package/es/vrender-app.js.map +1 -0
  168. package/es/vrender.d.ts +17 -1
  169. package/es/vrender.js +27 -8
  170. package/es/vrender.js.map +1 -1
  171. package/package.json +11 -10
@@ -10,6 +10,7 @@ export declare class BodyHelper {
10
10
  collapseIcon: SvgIcon;
11
11
  _table: BaseTableAPI;
12
12
  constructor(_table: BaseTableAPI);
13
+ updateIcons(): void;
13
14
  getIcons(col: number, row: number, cellValue: any, dataValue: any, context: CanvasRenderingContext2D): ColumnIconOption[];
14
15
  getStyleClass(cellType: 'text' | 'link' | 'image' | 'video' | 'chart' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio' | 'switch' | 'button'): typeof Style | typeof RadioStyle | typeof SwitchStyle | typeof ButtonStyle | typeof CheckboxStyle;
15
16
  getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;
@@ -26,7 +26,9 @@ import { ButtonStyle } from "./style/ButtonStyle";
26
26
 
27
27
  export class BodyHelper {
28
28
  constructor(_table) {
29
- this._table = _table;
29
+ this._table = _table, this.updateIcons();
30
+ }
31
+ updateIcons() {
30
32
  const regedIcons = registerIcons.get();
31
33
  this.expandIcon = regedIcons[InternalIconName.expandIconName], this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
32
34
  }
@@ -108,5 +110,4 @@ export class BodyHelper {
108
110
  var _a, _b;
109
111
  return this.expandIcon.width + (null !== (_a = this.expandIcon.marginLeft) && void 0 !== _a ? _a : 0) + (null !== (_b = this.expandIcon.marginRight) && void 0 !== _b ? _b : 0);
110
112
  }
111
- }
112
- //# sourceMappingURL=body-helper.js.map
113
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,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AC,CAAC,CAAC,GAAG,CAAC,CAAC;iBAChB;qBAAM,IAAI,CAAC,CAAA,MAAA,MAAA,IAAI,CAAC,MAAM,EAAC,SAAS,mDAAG,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,EAAE;oBACzD,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;iBACzB;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,gBAAgB,CAAC,GAAW,EAAE,GAAW;QACvC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/D,IAAI,cAAc,KAAK,cAAc,CAAC,MAAM,EAAE;YAE5C,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;aAAM,IAAI,cAAc,KAAK,cAAc,CAAC,QAAQ,EAAE;YAErD,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,qBAAqB;;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,MAAM,OAAO,UAAU;IAIrB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,WAAW;QACT,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC;QAEvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAY,CAAC;QACzE,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,gBAAgB,CAAC,gBAAgB,CAAY,CAAC;IAC/E,CAAC;IACD,QAAQ,CACN,GAAW,EACX,GAAW,EACX,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K,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n this.updateIcons();\n }\n\n updateIcons() {\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
@@ -25,4 +25,5 @@ export function of(columnStyle, bodyStyle, styleArg, StyleClassDef = Style, glob
25
25
  return columnStyle || bodyStyle ? columnStyle instanceof Style ? columnStyle : "function" == typeof columnStyle ? of(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme) : (columnStyle || (columnStyle = {}),
26
26
  globalAutoWrapText && !isValid(columnStyle.autoWrapText) && (columnStyle.autoWrapText = !0),
27
27
  StyleClassDef === CheckboxStyle ? new CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle ? new RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : StyleClassDef === SwitchStyle ? new SwitchStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_c = theme.switchStyle) && void 0 !== _c ? _c : {}) : StyleClassDef === ButtonStyle ? new ButtonStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_d = theme.buttonStyle) && void 0 !== _d ? _d : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
28
- }
28
+ }
29
+ //# sourceMappingURL=style.js.map
@@ -15,7 +15,7 @@ export declare class DiscreteTableLegend {
15
15
  resize(): void;
16
16
  adjustTableSize(attrs: any): void;
17
17
  getLegendAttributes(rect: any): any;
18
- getLegendItems(): import("@visactor/vrender-components/es/legend/discrete/type").LegendItemDatum[];
18
+ getLegendItems(): import("@visactor/vrender-components/legend/discrete/type").LegendItemDatum[];
19
19
  initEvent(): void;
20
20
  getLegendBounds(): {
21
21
  width: number;
@@ -352,6 +352,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
352
352
  get enableLineBreak(): boolean;
353
353
  set enableLineBreak(enableLineBreak: boolean);
354
354
  updateAutoWrapText(autoWrapText: boolean): void;
355
+ private _updateFunctionalIcons;
355
356
  get theme(): TableTheme;
356
357
  set theme(theme: TableTheme);
357
358
  updateTheme(theme: ITableThemeDefine): void;
@@ -92,7 +92,7 @@ export class BaseTable extends EventTarget {
92
92
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
93
93
  if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
94
94
  this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
95
- this.version = "1.0.37", this.id = `VTable${Date.now()}`, this.isReleased = !1,
95
+ this.version = "1.0.38", this.id = `VTable${Date.now()}`, this.isReleased = !1,
96
96
  this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
97
97
  "undefined" != typeof window) {
98
98
  const g = window;
@@ -104,7 +104,7 @@ export class BaseTable extends EventTarget {
104
104
  });
105
105
  registry.byId[this.id] = this, registry.list.push(this), registry.last = this, g.__vtable_last_id__ = this.id;
106
106
  }
107
- if ("node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
107
+ if ("node" === Env.mode ? (options = container, container = null) : !container || container instanceof HTMLElement || (options = container,
108
108
  container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
109
109
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
110
110
  options: options,
@@ -183,7 +183,7 @@ export class BaseTable extends EventTarget {
183
183
  return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
184
184
  }
185
185
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT),
186
- internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
186
+ internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
187
187
  container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element),
188
188
  this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this),
189
189
  internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this),
@@ -946,7 +946,7 @@ export class BaseTable extends EventTarget {
946
946
  }
947
947
  getBodyVisibleCellRange() {
948
948
  var _a, _b, _c, _d;
949
- const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenColsContentWidth = this.getFrozenColsContentWidth(), frozenColsOffset = this.getFrozenColsOffset(), bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), {col: colStart} = this.getColAt(scrollLeft + frozenColsContentWidth + 1), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1, colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col : this.colCount - 1;
949
+ const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenColsContentWidth = this.getFrozenColsContentWidth(), frozenColsOffset = this.getFrozenColsOffset(), bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), frozenHeaderHeight = this.frozenRowCount > this.columnHeaderLevelCount ? this.getRowsHeight(0, this.columnHeaderLevelCount - 1) : 0, rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), {col: colStart} = this.getColAt(scrollLeft + frozenColsContentWidth + 1), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight - frozenHeaderHeight)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1, colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col : this.colCount - 1;
950
950
  return colEnd < 0 || rowEnd < 0 ? null : {
951
951
  rowStart: rowStart,
952
952
  colStart: colStart,
@@ -956,7 +956,7 @@ export class BaseTable extends EventTarget {
956
956
  }
957
957
  getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
958
958
  var _a, _b, _c, _d;
959
- const {scrollTop: scrollTop} = this, bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1 + start_deltaY)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1;
959
+ const {scrollTop: scrollTop} = this, bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), frozenHeaderHeight = this.frozenRowCount > this.columnHeaderLevelCount ? this.getRowsHeight(0, this.columnHeaderLevelCount - 1) : 0, rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1 + start_deltaY)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight - frozenHeaderHeight + end_deltaY)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1;
960
960
  return rowEnd < 0 ? null : {
961
961
  rowStart: rowStart,
962
962
  rowEnd: rowEnd
@@ -1020,7 +1020,7 @@ export class BaseTable extends EventTarget {
1020
1020
  this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
1021
1021
  }
1022
1022
  release() {
1023
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
1023
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
1024
1024
  if ("undefined" != typeof window) {
1025
1025
  const g = window;
1026
1026
  (null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
@@ -1034,29 +1034,29 @@ export class BaseTable extends EventTarget {
1034
1034
  if (this.isReleased) return;
1035
1035
  null === (_f = null === (_e = null === (_d = this.scenegraph) || void 0 === _d ? void 0 : _d.component) || void 0 === _e ? void 0 : _e.vScrollBar) || void 0 === _f || _f.release(),
1036
1036
  null === (_j = null === (_h = null === (_g = this.scenegraph) || void 0 === _g ? void 0 : _g.component) || void 0 === _h ? void 0 : _h.hScrollBar) || void 0 === _j || _j.release(),
1037
- this.animationManager.clear(), this.animationManager.ticker.release(), null === (_m = null === (_l = null === (_k = this.scenegraph) || void 0 === _k ? void 0 : _k.stage) || void 0 === _l ? void 0 : _l.ticker) || void 0 === _m || _m.release();
1037
+ this.animationManager.clear(), this.animationManager.ticker.release(), (null === (_k = this.scenegraph) || void 0 === _k ? void 0 : _k.stageOwned) && (null === (_o = null === (_m = null === (_l = this.scenegraph) || void 0 === _l ? void 0 : _l.stage) || void 0 === _m ? void 0 : _m.ticker) || void 0 === _o || _o.release());
1038
1038
  const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
1039
1039
  (null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
1040
1040
  delete canvas.__vtable_id__);
1041
1041
  const element = null == internalProps ? void 0 : internalProps.element;
1042
1042
  (null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
1043
- delete element.__vtable_id__), this.clearCorrectTimer(), null === (_p = null === (_o = internalProps.tooltipHandler) || void 0 === _o ? void 0 : _o.release) || void 0 === _p || _p.call(_o),
1044
- null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
1045
- null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
1046
- null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
1047
- this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
1048
- null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
1043
+ delete element.__vtable_id__), this.clearCorrectTimer(), null === (_q = null === (_p = internalProps.tooltipHandler) || void 0 === _p ? void 0 : _p.release) || void 0 === _q || _q.call(_p),
1044
+ null === (_s = null === (_r = internalProps.menuHandler) || void 0 === _r ? void 0 : _r.release) || void 0 === _s || _s.call(_r),
1045
+ null === (_t = super.release) || void 0 === _t || _t.call(this), this.pluginManager.release(),
1046
+ null === (_v = null === (_u = internalProps.handler) || void 0 === _u ? void 0 : _u.release) || void 0 === _v || _v.call(_u),
1047
+ this.eventManager.release(), null === (_x = null === (_w = internalProps.focusControl) || void 0 === _w ? void 0 : _w.release) || void 0 === _x || _x.call(_w),
1048
+ null === (_y = internalProps.legends) || void 0 === _y || _y.forEach((legend => {
1049
1049
  null == legend || legend.release();
1050
- })), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
1051
- null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
1050
+ })), null === (_z = internalProps.title) || void 0 === _z || _z.release(), internalProps.title = null,
1051
+ null === (_0 = internalProps.emptyTip) || void 0 === _0 || _0.release(), internalProps.emptyTip = null,
1052
1052
  internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
1053
1053
  var _a;
1054
1054
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
1055
- })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
1056
- const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
1055
+ })), internalProps.releaseList = null), this.scenegraph.releaseStage(), this.scenegraph.proxy.release();
1056
+ const parentElement = null === (_1 = internalProps.element) || void 0 === _1 ? void 0 : _1.parentElement;
1057
1057
  parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
1058
- null === (_3 = null === (_2 = null === (_1 = this.editorManager) || void 0 === _1 ? void 0 : _1.editingEditor) || void 0 === _2 ? void 0 : _2.onEnd) || void 0 === _3 || _3.call(_2),
1059
- this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
1058
+ null === (_4 = null === (_3 = null === (_2 = this.editorManager) || void 0 === _2 ? void 0 : _2.editingEditor) || void 0 === _3 ? void 0 : _3.onEnd) || void 0 === _4 || _4.call(_3),
1059
+ this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_5 = this.reactCustomLayout) || void 0 === _5 || _5.clearCache(),
1060
1060
  clearChartRenderQueue();
1061
1061
  }
1062
1062
  fireListeners(type, event) {
@@ -1121,7 +1121,7 @@ export class BaseTable extends EventTarget {
1121
1121
  internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map,
1122
1122
  internalProps._colRangeWidthsMap = new Map), internalProps.stick.changedCells.clear(),
1123
1123
  internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT),
1124
- internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
1124
+ internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
1125
1125
  this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText,
1126
1126
  internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0,
1127
1127
  internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450,
@@ -1446,12 +1446,18 @@ export class BaseTable extends EventTarget {
1446
1446
  this.options.autoWrapText = autoWrapText, this.scenegraph.clearCells(), this.clearCellStyleCache(),
1447
1447
  this.scenegraph.createSceneGraph(), this.render());
1448
1448
  }
1449
+ _updateFunctionalIcons() {
1450
+ var _a, _b, _c;
1451
+ setIconColor(this.internalProps.theme.functionalIconsStyle), null === (_a = this.internalProps.headerHelper) || void 0 === _a || _a.updateIcons(),
1452
+ null === (_b = this.internalProps.bodyHelper) || void 0 === _b || _b.updateIcons(),
1453
+ null === (_c = this.internalProps.rowSeriesNumberHelper) || void 0 === _c || _c.updateIcons();
1454
+ }
1449
1455
  get theme() {
1450
1456
  return this.internalProps.theme;
1451
1457
  }
1452
1458
  set theme(theme) {
1453
1459
  this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(),
1454
- this.options.theme = theme, setIconColor(this.internalProps.theme.functionalIconsStyle);
1460
+ this.options.theme = theme, this._updateFunctionalIcons();
1455
1461
  }
1456
1462
  updateTheme(theme) {
1457
1463
  const oldHoverState = {
@@ -1459,9 +1465,9 @@ export class BaseTable extends EventTarget {
1459
1465
  row: this.stateManager.hover.cellPos.row
1460
1466
  };
1461
1467
  this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(),
1462
- setIconColor(this.internalProps.theme.functionalIconsStyle), this.options.theme = theme,
1463
- this.scenegraph.updateComponent(), this.scenegraph.updateStageBackground(), this.scenegraph.clearCells(),
1464
- this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
1468
+ this._updateFunctionalIcons(), this.options.theme = theme, this.scenegraph.updateComponent(),
1469
+ this.scenegraph.updateStageBackground(), this.scenegraph.clearCells(), this.clearCellStyleCache(),
1470
+ this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
1465
1471
  this.render();
1466
1472
  }
1467
1473
  getBodyField(col, row) {