@visactor/vtable 0.20.4-alpha.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/cjs/ListTable.d.ts +9 -2
  2. package/cjs/ListTable.js +25 -9
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +7 -1
  5. package/cjs/PivotChart.js +7 -7
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +9 -2
  8. package/cjs/PivotTable.js +26 -11
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/body-helper/style/Style.d.ts +3 -0
  11. package/cjs/body-helper/style/Style.js +16 -9
  12. package/cjs/body-helper/style/Style.js.map +1 -1
  13. package/cjs/core/BaseTable.d.ts +16 -2
  14. package/cjs/core/BaseTable.js +18 -10
  15. package/cjs/core/BaseTable.js.map +1 -1
  16. package/cjs/core/tableHelper.js +3 -1
  17. package/cjs/core/tableHelper.js.map +1 -1
  18. package/cjs/event/listener/container-dom.js +59 -13
  19. package/cjs/event/listener/container-dom.js.map +1 -1
  20. package/cjs/event/listener/table-group.js +2 -1
  21. package/cjs/event/listener/table-group.js.map +1 -1
  22. package/cjs/header-helper/style/Style.d.ts +3 -0
  23. package/cjs/header-helper/style/Style.js +15 -8
  24. package/cjs/header-helper/style/Style.js.map +1 -1
  25. package/cjs/index.d.ts +3 -2
  26. package/cjs/index.js +16 -2
  27. package/cjs/index.js.map +1 -1
  28. package/cjs/layout/pivot-header-layout.d.ts +3 -2
  29. package/cjs/layout/pivot-header-layout.js +24 -18
  30. package/cjs/layout/pivot-header-layout.js.map +1 -1
  31. package/cjs/layout/row-height-map.d.ts +1 -0
  32. package/cjs/layout/row-height-map.js +25 -1
  33. package/cjs/layout/row-height-map.js.map +1 -1
  34. package/cjs/layout/simple-header-layout.d.ts +3 -2
  35. package/cjs/layout/simple-header-layout.js +16 -12
  36. package/cjs/layout/simple-header-layout.js.map +1 -1
  37. package/cjs/plugins/custom-cell-style.d.ts +19 -0
  38. package/cjs/plugins/custom-cell-style.js +63 -0
  39. package/cjs/plugins/custom-cell-style.js.map +1 -0
  40. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +29 -7
  41. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  42. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +9 -2
  43. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  44. package/cjs/scenegraph/group-creater/cell-helper.js +11 -4
  45. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  46. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +22 -19
  47. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  48. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +21 -18
  49. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  50. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +7 -7
  51. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  52. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +21 -18
  53. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +11 -10
  55. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +7 -7
  57. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  58. package/cjs/scenegraph/group-creater/progress/default-width-height.d.ts +3 -0
  59. package/cjs/scenegraph/group-creater/progress/default-width-height.js +24 -0
  60. package/cjs/scenegraph/group-creater/progress/default-width-height.js.map +1 -0
  61. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +8 -4
  62. package/cjs/scenegraph/group-creater/progress/proxy.js +50 -10
  63. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  64. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -1
  65. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +14 -16
  66. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  67. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -1
  68. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +28 -30
  69. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  70. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +1 -1
  71. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  72. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  73. package/cjs/scenegraph/layout/compute-row-height.js +3 -2
  74. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  75. package/cjs/scenegraph/layout/move-cell.d.ts +1 -2
  76. package/cjs/scenegraph/layout/move-cell.js +3 -16
  77. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  78. package/cjs/scenegraph/scenegraph.d.ts +4 -4
  79. package/cjs/scenegraph/scenegraph.js +13 -9
  80. package/cjs/scenegraph/scenegraph.js.map +1 -1
  81. package/cjs/scenegraph/stick-text/index.js +1 -1
  82. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  83. package/cjs/scenegraph/utils/cell-border-stroke-width.d.ts +3 -0
  84. package/cjs/scenegraph/utils/cell-border-stroke-width.js +16 -0
  85. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -0
  86. package/cjs/scenegraph/utils/get-prop.js +3 -3
  87. package/cjs/scenegraph/utils/get-prop.js.map +1 -1
  88. package/cjs/scenegraph/utils/text-icon-layout.js +9 -3
  89. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  90. package/cjs/scenegraph/utils/text-measure.d.ts +4 -2
  91. package/cjs/scenegraph/utils/text-measure.js +20 -5
  92. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  93. package/cjs/state/cell-move/index.js +6 -6
  94. package/cjs/state/cell-move/index.js.map +1 -1
  95. package/cjs/state/state.js +2 -2
  96. package/cjs/state/state.js.map +1 -1
  97. package/cjs/themes/ARCO.js +2 -1
  98. package/cjs/themes/theme.d.ts +3 -0
  99. package/cjs/themes/theme.js +21 -1
  100. package/cjs/themes/theme.js.map +1 -1
  101. package/cjs/tools/NumberMap.d.ts +1 -0
  102. package/cjs/tools/NumberMap.js +21 -0
  103. package/cjs/tools/NumberMap.js.map +1 -1
  104. package/cjs/tools/isx.d.ts +1 -1
  105. package/cjs/tools/util.d.ts +1 -1
  106. package/cjs/ts-types/base-table.d.ts +17 -2
  107. package/cjs/ts-types/base-table.js.map +1 -1
  108. package/cjs/ts-types/column/style.d.ts +1 -0
  109. package/cjs/ts-types/column/style.js.map +1 -1
  110. package/cjs/ts-types/common.d.ts +14 -2
  111. package/cjs/ts-types/common.js.map +1 -1
  112. package/cjs/ts-types/customElement.d.ts +2 -0
  113. package/cjs/ts-types/customElement.js.map +1 -1
  114. package/cjs/ts-types/style-define.d.ts +2 -0
  115. package/cjs/ts-types/style-define.js.map +1 -1
  116. package/cjs/ts-types/table-engine.d.ts +1 -1
  117. package/cjs/ts-types/table-engine.js.map +1 -1
  118. package/cjs/ts-types/theme.d.ts +3 -0
  119. package/cjs/ts-types/theme.js.map +1 -1
  120. package/cjs/vrender.js.map +1 -1
  121. package/dist/vtable.js +3327 -1273
  122. package/dist/vtable.min.js +2 -2
  123. package/es/ListTable.d.ts +9 -2
  124. package/es/ListTable.js +25 -9
  125. package/es/ListTable.js.map +1 -1
  126. package/es/PivotChart.d.ts +7 -1
  127. package/es/PivotChart.js +7 -7
  128. package/es/PivotChart.js.map +1 -1
  129. package/es/PivotTable.d.ts +9 -2
  130. package/es/PivotTable.js +27 -12
  131. package/es/PivotTable.js.map +1 -1
  132. package/es/body-helper/style/Style.d.ts +3 -0
  133. package/es/body-helper/style/Style.js +16 -9
  134. package/es/body-helper/style/Style.js.map +1 -1
  135. package/es/core/BaseTable.d.ts +16 -2
  136. package/es/core/BaseTable.js +19 -9
  137. package/es/core/BaseTable.js.map +1 -1
  138. package/es/core/tableHelper.js +3 -1
  139. package/es/core/tableHelper.js.map +1 -1
  140. package/es/event/listener/container-dom.js +58 -14
  141. package/es/event/listener/container-dom.js.map +1 -1
  142. package/es/event/listener/table-group.js +1 -1
  143. package/es/event/listener/table-group.js.map +1 -1
  144. package/es/header-helper/style/Style.d.ts +3 -0
  145. package/es/header-helper/style/Style.js +15 -8
  146. package/es/header-helper/style/Style.js.map +1 -1
  147. package/es/index.d.ts +3 -2
  148. package/es/index.js +4 -2
  149. package/es/index.js.map +1 -1
  150. package/es/layout/pivot-header-layout.d.ts +3 -2
  151. package/es/layout/pivot-header-layout.js +24 -18
  152. package/es/layout/pivot-header-layout.js.map +1 -1
  153. package/es/layout/row-height-map.d.ts +1 -0
  154. package/es/layout/row-height-map.js +25 -1
  155. package/es/layout/row-height-map.js.map +1 -1
  156. package/es/layout/simple-header-layout.d.ts +3 -2
  157. package/es/layout/simple-header-layout.js +16 -12
  158. package/es/layout/simple-header-layout.js.map +1 -1
  159. package/es/plugins/custom-cell-style.d.ts +19 -0
  160. package/es/plugins/custom-cell-style.js +55 -0
  161. package/es/plugins/custom-cell-style.js.map +1 -0
  162. package/es/scenegraph/graphic/contributions/group-contribution-render.js +29 -6
  163. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  164. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +9 -2
  165. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  166. package/es/scenegraph/group-creater/cell-helper.js +11 -4
  167. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  168. package/es/scenegraph/group-creater/cell-type/chart-cell.js +23 -18
  169. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  170. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +22 -17
  171. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  172. package/es/scenegraph/group-creater/cell-type/image-cell.js +8 -6
  173. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  174. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +22 -17
  175. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  176. package/es/scenegraph/group-creater/cell-type/text-cell.js +11 -9
  177. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  178. package/es/scenegraph/group-creater/cell-type/video-cell.js +8 -6
  179. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  180. package/es/scenegraph/group-creater/progress/default-width-height.d.ts +3 -0
  181. package/es/scenegraph/group-creater/progress/default-width-height.js +18 -0
  182. package/es/scenegraph/group-creater/progress/default-width-height.js.map +1 -0
  183. package/es/scenegraph/group-creater/progress/proxy.d.ts +8 -4
  184. package/es/scenegraph/group-creater/progress/proxy.js +51 -11
  185. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  186. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -1
  187. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +14 -16
  188. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  189. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -1
  190. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +28 -31
  191. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  192. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +1 -1
  193. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  194. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  195. package/es/scenegraph/layout/compute-row-height.js +3 -1
  196. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  197. package/es/scenegraph/layout/move-cell.d.ts +1 -2
  198. package/es/scenegraph/layout/move-cell.js +3 -16
  199. package/es/scenegraph/layout/move-cell.js.map +1 -1
  200. package/es/scenegraph/scenegraph.d.ts +4 -4
  201. package/es/scenegraph/scenegraph.js +13 -9
  202. package/es/scenegraph/scenegraph.js.map +1 -1
  203. package/es/scenegraph/stick-text/index.js +1 -1
  204. package/es/scenegraph/stick-text/index.js.map +1 -1
  205. package/es/scenegraph/utils/cell-border-stroke-width.d.ts +3 -0
  206. package/es/scenegraph/utils/cell-border-stroke-width.js +10 -0
  207. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -0
  208. package/es/scenegraph/utils/get-prop.js +3 -3
  209. package/es/scenegraph/utils/get-prop.js.map +1 -1
  210. package/es/scenegraph/utils/text-icon-layout.js +9 -3
  211. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  212. package/es/scenegraph/utils/text-measure.d.ts +4 -2
  213. package/es/scenegraph/utils/text-measure.js +19 -5
  214. package/es/scenegraph/utils/text-measure.js.map +1 -1
  215. package/es/state/cell-move/index.js +6 -6
  216. package/es/state/cell-move/index.js.map +1 -1
  217. package/es/state/state.js +2 -2
  218. package/es/state/state.js.map +1 -1
  219. package/es/themes/ARCO.js +2 -1
  220. package/es/themes/theme.d.ts +3 -0
  221. package/es/themes/theme.js +21 -1
  222. package/es/themes/theme.js.map +1 -1
  223. package/es/tools/NumberMap.d.ts +1 -0
  224. package/es/tools/NumberMap.js +21 -0
  225. package/es/tools/NumberMap.js.map +1 -1
  226. package/es/tools/isx.d.ts +1 -1
  227. package/es/tools/util.d.ts +1 -1
  228. package/es/ts-types/base-table.d.ts +17 -2
  229. package/es/ts-types/base-table.js.map +1 -1
  230. package/es/ts-types/column/style.d.ts +1 -0
  231. package/es/ts-types/column/style.js.map +1 -1
  232. package/es/ts-types/common.d.ts +14 -2
  233. package/es/ts-types/common.js.map +1 -1
  234. package/es/ts-types/customElement.d.ts +2 -0
  235. package/es/ts-types/customElement.js.map +1 -1
  236. package/es/ts-types/style-define.d.ts +2 -0
  237. package/es/ts-types/style-define.js.map +1 -1
  238. package/es/ts-types/table-engine.d.ts +1 -1
  239. package/es/ts-types/table-engine.js.map +1 -1
  240. package/es/ts-types/theme.d.ts +3 -0
  241. package/es/ts-types/theme.js.map +1 -1
  242. package/es/vrender.js.map +1 -1
  243. package/package.json +6 -6
  244. package/cjs/scenegraph/component/menu.d.ts +0 -41
  245. package/es/scenegraph/component/menu.d.ts +0 -41
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/column/style.ts"],"names":[],"mappings":"","file":"style.js","sourcesContent":["import type { LineWidthsPropertyDefine } from '..';\nimport { PaddingPropertyDefine } from '..';\nimport type {\n ColorPropertyDefine,\n ColorsPropertyDefine,\n IconPropertyDefine,\n LineClamp,\n LineDashsPropertyDefine,\n TextOverflow,\n UnderlinePropertyDefine,\n LineDashPropertyDefine,\n LineThroughPropertyDefine,\n TagPropertyDefine,\n PaddingsPropertyDefine,\n StylePropertyFunctionArg,\n CursorPropertyDefine,\n MarkedPropertyDefine,\n FontSizePropertyDefine,\n FontFamilyPropertyDefine,\n FontWeightPropertyDefine,\n FontVariantPropertyDefine,\n FontStylePropertyDefine,\n TextAlignType,\n TextBaselineType\n} from '../style-define';\nimport type { ThemeStyle } from '../theme';\n//这个style是在绘制里面的内容时用到的,用不到borderColor和borderLineWidth,所以和IStyleOption有些不一致\nexport interface ColumnStyle {\n padding?: PaddingsPropertyDefine;\n bgColor?: ColorPropertyDefine;\n // eslint-disable-next-line no-undef\n textAlign?: TextAlignType;\n // eslint-disable-next-line no-undef\n textBaseline?: TextBaselineType;\n color?: ColorPropertyDefine;\n\n fontSize?: FontSizePropertyDefine;\n fontFamily?: FontFamilyPropertyDefine;\n fontWeight?: FontWeightPropertyDefine;\n fontVariant?: FontVariantPropertyDefine;\n fontStyle?: FontStylePropertyDefine;\n\n textOverflow?: TextOverflow;\n // doChangeStyle: () => void;\n clone: () => ColumnStyle;\n linkColor?: ColorPropertyDefine;\n}\n\nexport type IHeaderStyle = ColumnStyle;\n\nexport type ISortheaderSyle = IHeaderStyle;\n\nexport interface IStyleOption {\n bgColor?: ColorPropertyDefine;\n padding?: PaddingsPropertyDefine;\n textAlign?: TextAlignType;\n textBaseline?: TextBaselineType;\n color?: ColorPropertyDefine;\n\n fontSize?: FontSizePropertyDefine;\n fontFamily?: FontFamilyPropertyDefine;\n fontWeight?: FontWeightPropertyDefine;\n fontVariant?: FontVariantPropertyDefine;\n fontStyle?: FontStylePropertyDefine;\n\n textOverflow?: TextOverflow;\n borderColor?: ColorsPropertyDefine;\n borderLineWidth?: LineWidthsPropertyDefine;\n\n lineHeight?: number;\n underline?: UnderlinePropertyDefine;\n /** TODO */\n underlineColor?: ColorPropertyDefine;\n /** TODO */\n underlineDash?: LineDashPropertyDefine;\n lineThrough?: LineThroughPropertyDefine;\n /** TODO */\n lineThroughColor?: ColorPropertyDefine;\n /** TODO */\n lineThroughDash?: LineDashPropertyDefine;\n\n borderLineDash?: LineDashsPropertyDefine;\n linkColor?: ColorPropertyDefine;\n\n // tag?: TagPropertyDefine;\n // tagFont?: FontPropertyDefine;\n // tagColor?: ColorPropertyDefine;\n // tagBgColor?: ColorPropertyDefine;\n // tagMargin?: number | string | (number | string)[];\n\n // dropDownIcon?: IconPropertyDefine;\n // dropDownHoverIcon?: IconPropertyDefine;\n cursor?: CursorPropertyDefine;\n\n textStick?: boolean;\n\n marked?: MarkedPropertyDefine;\n}\n\nexport interface ITextStyleOption extends IStyleOption {\n // lineHeight?: string | number;//移入IStyleOption中 单行文本类型也可以有\n autoWrapText?: boolean;\n lineClamp?: LineClamp;\n}\n\nexport interface IImageStyleOption extends IStyleOption {\n // imageSizing?: 'keep-aspect-ratio';\n // imageAutoSizing?: boolean;\n margin?: number;\n}\n// export type ISortHeaderStyleOption = IStyleOption;\n\nexport type ColumnStyleOption =\n | IStyleOption\n | ITextStyleOption\n | IImageStyleOption\n | ProgressBarStyleOption\n | CheckboxStyleOption\n | ((styleArg: StylePropertyFunctionArg) => IStyleOption | ITextStyleOption | IImageStyleOption);\n\nexport type HeaderStyleOption =\n | (IStyleOption & { textStick?: boolean }) //表头可以配置吸附\n | ITextStyleOption\n | IImageStyleOption\n // | ISortHeaderStyleOption\n | ((styleArg: StylePropertyFunctionArg) => IStyleOption | ITextStyleOption | IImageStyleOption);\n// | ISortHeaderStyleOption\n\nexport type FullExtendStyle = HeaderStyleOption & ColumnStyleOption & ThemeStyle;\n\n// export interface BaseStyleOption {\n// bgColor?: ColorPropertyDefine;\n// }\n\n// export interface StdBaseStyleOption extends BaseStyleOption {\n// // eslint-disable-next-line no-undef\n// textAlign?: CanvasTextAlign;\n// // eslint-disable-next-line no-undef\n// textBaseline?: CanvasTextBaseline;\n// }\n// export interface StyleOption extends StdBaseStyleOption {\n// color?: ColorPropertyDefine;\n// font?: FontPropertyDefine;\n// padding?: PaddingsPropertyDefine;\n// textOverflow?: TextOverflow;\n// }\nexport interface ProgressBarStyleOption extends IStyleOption {\n // 是否显示进度条\n showBar?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n // 进度条颜色\n barColor?: ColorPropertyDefine;\n // 进度条背景颜色\n barBgColor?: ColorPropertyDefine;\n // 进度条高度\n barHeight?: number | string;\n // 进度条距单元格底部距离\n barBottom?: number | string;\n // 进度条padding\n barPadding?: (number | string)[];\n // 进度条正向颜色\n barPositiveColor?: ColorPropertyDefine;\n // 进度条负向颜色\n barNegativeColor?: ColorPropertyDefine;\n // 进度条坐标轴轴颜色\n barAxisColor?: ColorPropertyDefine;\n // 进度条方向是否从右到左\n barRightToLeft?: boolean;\n\n // 是否显示进度条标记\n showBarMark?: boolean;\n // 进度条标记正向颜色\n barMarkPositiveColor?: ColorPropertyDefine;\n // 进度条标记负向颜色\n barMarkNegativeColor?: ColorPropertyDefine;\n // 进度条标记宽度\n barMarkWidth?: number;\n // 进度条标记位置\n barMarkPosition?: 'right' | 'bottom';\n}\n\nexport type CheckboxStyleOption = {\n size?: number;\n spaceBetweenTextAndIcon?: number;\n checkboxStyle?: CheckboxStyle;\n} & ITextStyleOption;\n\nexport type CheckboxStyle = {\n // 选择框尺寸\n size?: number;\n // 选择框与文字间距\n spaceBetweenTextAndIcon?: number;\n\n // 未选中状态填充颜色\n defaultFill?: string;\n // 未选中状态描边颜色\n defaultStroke?: string;\n // disable状态填充颜色\n disableFill?: string;\n // checked状态填充颜色\n checkedFill?: string;\n // checked状态描边颜色\n checkedStroke?: string;\n // checked状态填充颜色\n disableCheckedFill?: string;\n // checked状态描边颜色\n disableCheckedStroke?: string;\n\n // checked状态图标url\n checkIconImage?: string;\n // indeterminate状态图标url\n indeterminateIconImage?: string;\n};\n"]}
1
+ {"version":3,"sources":["../src/ts-types/column/style.ts"],"names":[],"mappings":"","file":"style.js","sourcesContent":["import type { LineWidthsPropertyDefine } from '..';\nimport { PaddingPropertyDefine } from '..';\nimport type {\n ColorPropertyDefine,\n ColorsPropertyDefine,\n IconPropertyDefine,\n LineClamp,\n LineDashsPropertyDefine,\n TextOverflow,\n UnderlinePropertyDefine,\n LineDashPropertyDefine,\n LineThroughPropertyDefine,\n TagPropertyDefine,\n PaddingsPropertyDefine,\n StylePropertyFunctionArg,\n CursorPropertyDefine,\n MarkedPropertyDefine,\n FontSizePropertyDefine,\n FontFamilyPropertyDefine,\n FontWeightPropertyDefine,\n FontVariantPropertyDefine,\n FontStylePropertyDefine,\n TextAlignType,\n TextBaselineType\n} from '../style-define';\nimport type { ThemeStyle } from '../theme';\n//这个style是在绘制里面的内容时用到的,用不到borderColor和borderLineWidth,所以和IStyleOption有些不一致\nexport interface ColumnStyle {\n padding?: PaddingsPropertyDefine;\n bgColor?: ColorPropertyDefine;\n // eslint-disable-next-line no-undef\n textAlign?: TextAlignType;\n // eslint-disable-next-line no-undef\n textBaseline?: TextBaselineType;\n color?: ColorPropertyDefine;\n\n fontSize?: FontSizePropertyDefine;\n fontFamily?: FontFamilyPropertyDefine;\n fontWeight?: FontWeightPropertyDefine;\n fontVariant?: FontVariantPropertyDefine;\n fontStyle?: FontStylePropertyDefine;\n\n textOverflow?: TextOverflow;\n // doChangeStyle: () => void;\n clone: () => ColumnStyle;\n linkColor?: ColorPropertyDefine;\n}\n\nexport type IHeaderStyle = ColumnStyle;\n\nexport type ISortheaderSyle = IHeaderStyle;\n\nexport interface IStyleOption {\n bgColor?: ColorPropertyDefine;\n padding?: PaddingsPropertyDefine;\n textAlign?: TextAlignType;\n textBaseline?: TextBaselineType;\n color?: ColorPropertyDefine;\n\n fontSize?: FontSizePropertyDefine;\n fontFamily?: FontFamilyPropertyDefine;\n fontWeight?: FontWeightPropertyDefine;\n fontVariant?: FontVariantPropertyDefine;\n fontStyle?: FontStylePropertyDefine;\n\n textOverflow?: TextOverflow;\n borderColor?: ColorsPropertyDefine;\n borderLineWidth?: LineWidthsPropertyDefine;\n\n lineHeight?: number;\n underline?: UnderlinePropertyDefine;\n /** TODO */\n underlineColor?: ColorPropertyDefine;\n underlineDash?: LineDashPropertyDefine;\n underlineOffset?: number;\n lineThrough?: LineThroughPropertyDefine;\n /** TODO */\n lineThroughColor?: ColorPropertyDefine;\n /** TODO */\n lineThroughDash?: LineDashPropertyDefine;\n\n borderLineDash?: LineDashsPropertyDefine;\n linkColor?: ColorPropertyDefine;\n\n // tag?: TagPropertyDefine;\n // tagFont?: FontPropertyDefine;\n // tagColor?: ColorPropertyDefine;\n // tagBgColor?: ColorPropertyDefine;\n // tagMargin?: number | string | (number | string)[];\n\n // dropDownIcon?: IconPropertyDefine;\n // dropDownHoverIcon?: IconPropertyDefine;\n cursor?: CursorPropertyDefine;\n\n textStick?: boolean;\n\n marked?: MarkedPropertyDefine;\n}\n\nexport interface ITextStyleOption extends IStyleOption {\n // lineHeight?: string | number;//移入IStyleOption中 单行文本类型也可以有\n autoWrapText?: boolean;\n lineClamp?: LineClamp;\n}\n\nexport interface IImageStyleOption extends IStyleOption {\n // imageSizing?: 'keep-aspect-ratio';\n // imageAutoSizing?: boolean;\n margin?: number;\n}\n// export type ISortHeaderStyleOption = IStyleOption;\n\nexport type ColumnStyleOption =\n | IStyleOption\n | ITextStyleOption\n | IImageStyleOption\n | ProgressBarStyleOption\n | CheckboxStyleOption\n | ((styleArg: StylePropertyFunctionArg) => IStyleOption | ITextStyleOption | IImageStyleOption);\n\nexport type HeaderStyleOption =\n | (IStyleOption & { textStick?: boolean }) //表头可以配置吸附\n | ITextStyleOption\n | IImageStyleOption\n // | ISortHeaderStyleOption\n | ((styleArg: StylePropertyFunctionArg) => IStyleOption | ITextStyleOption | IImageStyleOption);\n// | ISortHeaderStyleOption\n\nexport type FullExtendStyle = HeaderStyleOption & ColumnStyleOption & ThemeStyle;\n\n// export interface BaseStyleOption {\n// bgColor?: ColorPropertyDefine;\n// }\n\n// export interface StdBaseStyleOption extends BaseStyleOption {\n// // eslint-disable-next-line no-undef\n// textAlign?: CanvasTextAlign;\n// // eslint-disable-next-line no-undef\n// textBaseline?: CanvasTextBaseline;\n// }\n// export interface StyleOption extends StdBaseStyleOption {\n// color?: ColorPropertyDefine;\n// font?: FontPropertyDefine;\n// padding?: PaddingsPropertyDefine;\n// textOverflow?: TextOverflow;\n// }\nexport interface ProgressBarStyleOption extends IStyleOption {\n // 是否显示进度条\n showBar?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n // 进度条颜色\n barColor?: ColorPropertyDefine;\n // 进度条背景颜色\n barBgColor?: ColorPropertyDefine;\n // 进度条高度\n barHeight?: number | string;\n // 进度条距单元格底部距离\n barBottom?: number | string;\n // 进度条padding\n barPadding?: (number | string)[];\n // 进度条正向颜色\n barPositiveColor?: ColorPropertyDefine;\n // 进度条负向颜色\n barNegativeColor?: ColorPropertyDefine;\n // 进度条坐标轴轴颜色\n barAxisColor?: ColorPropertyDefine;\n // 进度条方向是否从右到左\n barRightToLeft?: boolean;\n\n // 是否显示进度条标记\n showBarMark?: boolean;\n // 进度条标记正向颜色\n barMarkPositiveColor?: ColorPropertyDefine;\n // 进度条标记负向颜色\n barMarkNegativeColor?: ColorPropertyDefine;\n // 进度条标记宽度\n barMarkWidth?: number;\n // 进度条标记位置\n barMarkPosition?: 'right' | 'bottom';\n}\n\nexport type CheckboxStyleOption = {\n size?: number;\n spaceBetweenTextAndIcon?: number;\n checkboxStyle?: CheckboxStyle;\n} & ITextStyleOption;\n\nexport type CheckboxStyle = {\n // 选择框尺寸\n size?: number;\n // 选择框与文字间距\n spaceBetweenTextAndIcon?: number;\n\n // 未选中状态填充颜色\n defaultFill?: string;\n // 未选中状态描边颜色\n defaultStroke?: string;\n // disable状态填充颜色\n disableFill?: string;\n // checked状态填充颜色\n checkedFill?: string;\n // checked状态描边颜色\n checkedStroke?: string;\n // checked状态填充颜色\n disableCheckedFill?: string;\n // checked状态描边颜色\n disableCheckedStroke?: string;\n\n // checked状态图标url\n checkIconImage?: string;\n // indeterminate状态图标url\n indeterminateIconImage?: string;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import type { ColumnTypeOption } from './column';
2
- import type { CellLocation, FieldData, FieldDef } from './table-engine';
1
+ import type { ColumnStyleOption, ColumnTypeOption } from './column';
2
+ import type { CellLocation, CellRange, FieldData, FieldDef } from './table-engine';
3
3
  import type { Rect } from '../tools/Rect';
4
4
  export type MaybePromise<T> = T | Promise<T>;
5
5
  export type MaybeCall<T, A extends any[]> = T | ((...args: A) => T);
@@ -93,3 +93,15 @@ export declare enum HighlightScope {
93
93
  'none' = "none"
94
94
  }
95
95
  export type SortOrder = 'asc' | 'desc' | 'normal';
96
+ export type CustomCellStyle = {
97
+ id: string;
98
+ style: ColumnStyleOption;
99
+ };
100
+ export type CustomCellStyleArrangement = {
101
+ cellPosition: {
102
+ col?: number;
103
+ row?: number;
104
+ range?: CellRange;
105
+ };
106
+ customStyleId: string;
107
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/common.ts"],"names":[],"mappings":"AA0GA,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,2CAAyB,CAAA;AAC3B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AASD,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,+BAAe,CAAA;AACjB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","file":"common.js","sourcesContent":["import type { ColumnTypeOption } from './column';\nimport type { CellLocation, FieldData, FieldDef } from './table-engine';\nimport type { Rect } from '../tools/Rect';\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type MaybeCall<T, A extends any[]> = T | ((...args: A) => T);\n\nexport type MaybePromiseOrUndefined = any | undefined | Promise<any | undefined>;\nexport type MaybePromiseOrCallOrUndefined = any | undefined | Promise<any | undefined> | ((...args: any) => any);\nexport type PromiseMaybeUndefOrCall<T, A extends any[]> = Promise<T | undefined> | ((...args: A) => T);\nexport type AnyFunction = (...args: any[]) => any;\n\nexport interface RectProps {\n left: number;\n right: number;\n top: number;\n bottom: number;\n width: number;\n height: number;\n}\n\nexport interface CellPosition {\n col: number;\n row: number;\n}\n\nexport type ColorsDef = string | (string | null)[];\nexport type LineWidthsDef = number | (number | null)[];\nexport type LineDashsDef = number[] | (number[] | null)[];\nexport type shadowColorsDef = { from: string; to: string } | ({ from: string; to: string } | null)[];\nexport type PaddingsDef = number | (number | null)[];\nexport type SortOption = boolean | ((v1: any, v2: any, order: SortOrder) => -1 | 0 | 1);\nexport type MergeCellOption = boolean | ((v1: any, v2: any) => boolean);\nexport type BaseCellInfo = {\n row: number;\n col: number;\n /**format之后的值 */\n value: FieldData;\n /**原始值 */\n dataValue: FieldData;\n};\nexport type CellInfo = {\n col: number;\n row: number;\n title?: string | (() => string) | undefined;\n /**维度名称 */\n field?: FieldDef;\n /**单元格行列表头paths */\n cellHeaderPaths?: ICellHeaderPaths;\n /**单元格的位置 */\n cellRange?: Rect;\n /**整条数据-原始数据 */\n originData?: any;\n /**format之后的值 */\n value?: FieldData;\n /**原始值 */\n dataValue?: FieldData;\n cellLocation?: CellLocation;\n cellType?: ColumnTypeOption;\n};\n\nexport type ICellHeaderPaths = IListTableCellHeaderPaths | IPivotTableCellHeaderPaths;\nexport type IListTableCellHeaderPaths = {\n readonly colHeaderPaths?: {\n field: FieldDef;\n // title: string | (() => string) | undefined;\n }[];\n readonly rowHeaderPaths?: {\n field: FieldDef;\n // title: string | (() => string) | undefined;\n }[];\n cellLocation: CellLocation;\n};\nexport type IPivotTableCellHeaderPaths = {\n /** 列表头各级path表头信息 */\n readonly colHeaderPaths?: {\n dimensionKey?: string;\n indicatorKey?: string;\n value?: string;\n }[];\n /** 行表头各级path表头信息 */\n readonly rowHeaderPaths?: {\n dimensionKey?: string;\n indicatorKey?: string;\n value?: string;\n }[];\n cellLocation: CellLocation;\n};\n\nexport interface IDimensionInfo {\n dimensionKey?: string;\n value?: string;\n indicatorKey?: string;\n isPivotCorner?: boolean;\n}\n\n/**\n * 当前表格的交互状态:\n * Default 默认展示\n * grabing 拖拽中\n * -Resize column 改变列宽\n * -column move 调整列顺序\n * -drag select 拖拽多选\n * Scrolling 滚动中\n */\nexport enum InteractionState {\n 'default' = 'default',\n 'grabing' = 'grabing',\n 'scrolling' = 'scrolling'\n}\n/**\n * 单元格的高亮效果设置\n * single 单个单元格高亮\n * column 整列高亮\n * row 整行高量\n * cross 十字花 行列均高亮\n * none 无高亮\n */\nexport enum HighlightScope {\n 'single' = 'single',\n 'column' = 'column',\n 'row' = 'row',\n 'cross' = 'cross',\n 'none' = 'none'\n}\n\nexport type SortOrder = 'asc' | 'desc' | 'normal';\n"]}
1
+ {"version":3,"sources":["../src/ts-types/common.ts"],"names":[],"mappings":"AA4GA,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,2CAAyB,CAAA;AAC3B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AASD,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,+BAAe,CAAA;AACjB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","file":"common.js","sourcesContent":["import type { Style } from '../body-helper/style';\nimport type { ColumnStyleOption, ColumnTypeOption } from './column';\nimport type { ColumnData } from './list-table/layout-map/api';\nimport type { CellLocation, CellRange, FieldData, FieldDef } from './table-engine';\nimport type { Rect } from '../tools/Rect';\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type MaybeCall<T, A extends any[]> = T | ((...args: A) => T);\n\nexport type MaybePromiseOrUndefined = any | undefined | Promise<any | undefined>;\nexport type MaybePromiseOrCallOrUndefined = any | undefined | Promise<any | undefined> | ((...args: any) => any);\nexport type PromiseMaybeUndefOrCall<T, A extends any[]> = Promise<T | undefined> | ((...args: A) => T);\nexport type AnyFunction = (...args: any[]) => any;\n\nexport interface RectProps {\n left: number;\n right: number;\n top: number;\n bottom: number;\n width: number;\n height: number;\n}\n\nexport interface CellPosition {\n col: number;\n row: number;\n}\n\nexport type ColorsDef = string | (string | null)[];\nexport type LineWidthsDef = number | (number | null)[];\nexport type LineDashsDef = number[] | (number[] | null)[];\nexport type shadowColorsDef = { from: string; to: string } | ({ from: string; to: string } | null)[];\nexport type PaddingsDef = number | (number | null)[];\nexport type SortOption = boolean | ((v1: any, v2: any, order: SortOrder) => -1 | 0 | 1);\nexport type MergeCellOption = boolean | ((v1: any, v2: any) => boolean);\nexport type BaseCellInfo = {\n row: number;\n col: number;\n /**format之后的值 */\n value: FieldData;\n /**原始值 */\n dataValue: FieldData;\n};\nexport type CellInfo = {\n col: number;\n row: number;\n title?: string | (() => string) | undefined;\n /**维度名称 */\n field?: FieldDef;\n /**单元格行列表头paths */\n cellHeaderPaths?: ICellHeaderPaths;\n /**单元格的位置 */\n cellRange?: Rect;\n /**整条数据-原始数据 */\n originData?: any;\n /**format之后的值 */\n value?: FieldData;\n /**原始值 */\n dataValue?: FieldData;\n cellLocation?: CellLocation;\n cellType?: ColumnTypeOption;\n};\n\nexport type ICellHeaderPaths = IListTableCellHeaderPaths | IPivotTableCellHeaderPaths;\nexport type IListTableCellHeaderPaths = {\n readonly colHeaderPaths?: {\n field: FieldDef;\n // title: string | (() => string) | undefined;\n }[];\n readonly rowHeaderPaths?: {\n field: FieldDef;\n // title: string | (() => string) | undefined;\n }[];\n cellLocation: CellLocation;\n};\nexport type IPivotTableCellHeaderPaths = {\n /** 列表头各级path表头信息 */\n readonly colHeaderPaths?: {\n dimensionKey?: string;\n indicatorKey?: string;\n value?: string;\n }[];\n /** 行表头各级path表头信息 */\n readonly rowHeaderPaths?: {\n dimensionKey?: string;\n indicatorKey?: string;\n value?: string;\n }[];\n cellLocation: CellLocation;\n};\n\nexport interface IDimensionInfo {\n dimensionKey?: string;\n value?: string;\n indicatorKey?: string;\n isPivotCorner?: boolean;\n}\n\n/**\n * 当前表格的交互状态:\n * Default 默认展示\n * grabing 拖拽中\n * -Resize column 改变列宽\n * -column move 调整列顺序\n * -drag select 拖拽多选\n * Scrolling 滚动中\n */\nexport enum InteractionState {\n 'default' = 'default',\n 'grabing' = 'grabing',\n 'scrolling' = 'scrolling'\n}\n/**\n * 单元格的高亮效果设置\n * single 单个单元格高亮\n * column 整列高亮\n * row 整行高量\n * cross 十字花 行列均高亮\n * none 无高亮\n */\nexport enum HighlightScope {\n 'single' = 'single',\n 'column' = 'column',\n 'row' = 'row',\n 'cross' = 'cross',\n 'none' = 'none'\n}\n\nexport type SortOrder = 'asc' | 'desc' | 'normal';\n\nexport type CustomCellStyle = {\n id: string;\n style: ColumnStyleOption;\n};\n\nexport type CustomCellStyleArrangement = {\n cellPosition: {\n col?: number;\n row?: number;\n range?: CellRange;\n };\n customStyleId: string;\n};\n"]}
@@ -38,6 +38,8 @@ export interface TextElement extends baseElement {
38
38
  textBaseline?: TextBaselineType;
39
39
  lineHeight?: number;
40
40
  underline?: number;
41
+ underlineDash?: number[];
42
+ underlineOffset?: number;
41
43
  lineThrough?: number;
42
44
  heightLimit?: number;
43
45
  lineClamp?: number;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/customElement.ts"],"names":[],"mappings":"","file":"customElement.js","sourcesContent":["import type { FieldData } from './table-engine';\nimport type { RectProps } from './common';\nimport type { BaseTableAPI } from './base-table';\nimport type { TextAlignType, TextBaselineType } from './style-define';\nexport interface CustomRenderFunctionArg {\n row: number;\n col: number;\n table: BaseTableAPI;\n /**format之后的值 */\n value: FieldData;\n /**原始值 */\n dataValue: FieldData;\n rect?: RectProps;\n}\ninterface baseElement {\n elementKey?: string;\n x: number | string | ((value: string) => number | string);\n y: number | string | ((value: string) => number | string);\n dx?: number;\n dy?: number;\n // clickable?: boolean; // @dispose\n pickable?: boolean;\n cursor?: string;\n name?: string;\n}\nexport interface TextElement extends baseElement {\n type: 'text';\n text: string | ((value: string) => string);\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n color?: string | ((value: string) => string);\n lineWidth: number;\n fontSize?: number | ((value: string) => number);\n fontFamily?: string | ((value: string) => string);\n fontWeight?: string | number | ((value: string) => string | number);\n fontVariant?: string;\n fontStyle?: string;\n ellipsis?: boolean | string;\n maxLineWidth?: number;\n textAlign?: TextAlignType;\n textBaseline?: TextBaselineType;\n lineHeight?: number;\n underline?: number;\n lineThrough?: number;\n heightLimit?: number;\n lineClamp?: number;\n width?: number;\n height?: number;\n background?: {\n fill?: string;\n expandY?: number;\n expandX?: number;\n cornerRadius?: number;\n };\n}\nexport interface LineElement extends Omit<baseElement, 'x' | 'y'> {\n type: 'line';\n stroke?: string | ((value: string) => string);\n points: { x: number; y: number }[];\n lineWidth?: number;\n}\n\nexport interface RectElement extends baseElement {\n type: 'rect';\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n radius?: number | string | ((value: string) => number | string);\n}\n\nexport interface CircleElement extends baseElement {\n type: 'circle';\n radius: number | string | ((value: string) => number | string);\n // radian?: number | string | ((value: string) => number | string);\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n}\nexport interface ArcElement extends baseElement {\n type: 'arc';\n radius: number | string | ((value: string) => number | string);\n startAngle?: number | ((value: string) => number);\n endAngle?: number | ((value: string) => number);\n // clockWise?: boolean;\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n}\nexport interface IconElement extends baseElement {\n type: 'icon';\n svg: string | ((value: string) => string);\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n hover?: {\n x: number | string;\n y: number | string;\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n bgColor: string;\n radius?: number;\n };\n}\nexport interface ImageElement extends baseElement {\n type: 'image';\n src: string | ((value: string) => string);\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n hover?: {\n x: number | string;\n y: number | string;\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n bgColor: string;\n radius?: number;\n };\n shape?: 'circle' | 'square';\n}\nexport type ICustomRenderElement =\n | TextElement\n | RectElement\n | CircleElement\n | IconElement\n | ImageElement\n | ArcElement\n | LineElement;\nexport type ICustomRenderElements = Array<ICustomRenderElement>;\n\nexport type ICustomRenderFuc = (args: CustomRenderFunctionArg) => ICustomRenderObj;\n\nexport type ICustomRenderObj = {\n /** 配置出来的类型集合 */\n elements: ICustomRenderElements;\n /** 期望单元格的高度 */\n expectedHeight: number;\n /** 期望单元格的宽度 */\n expectedWidth: number;\n /**\n * 是否还需要默认渲染内容 只有配置true才绘制 默认 不绘制\n */\n renderDefault?: boolean;\n};\n\nexport type ICustomRender = ICustomRenderFuc | ICustomRenderObj;\n"]}
1
+ {"version":3,"sources":["../src/ts-types/customElement.ts"],"names":[],"mappings":"","file":"customElement.js","sourcesContent":["import type { FieldData } from './table-engine';\nimport type { RectProps } from './common';\nimport type { BaseTableAPI } from './base-table';\nimport type { TextAlignType, TextBaselineType } from './style-define';\nexport interface CustomRenderFunctionArg {\n row: number;\n col: number;\n table: BaseTableAPI;\n /**format之后的值 */\n value: FieldData;\n /**原始值 */\n dataValue: FieldData;\n rect?: RectProps;\n}\ninterface baseElement {\n elementKey?: string;\n x: number | string | ((value: string) => number | string);\n y: number | string | ((value: string) => number | string);\n dx?: number;\n dy?: number;\n // clickable?: boolean; // @dispose\n pickable?: boolean;\n cursor?: string;\n name?: string;\n}\nexport interface TextElement extends baseElement {\n type: 'text';\n text: string | ((value: string) => string);\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n color?: string | ((value: string) => string);\n lineWidth: number;\n fontSize?: number | ((value: string) => number);\n fontFamily?: string | ((value: string) => string);\n fontWeight?: string | number | ((value: string) => string | number);\n fontVariant?: string;\n fontStyle?: string;\n ellipsis?: boolean | string;\n maxLineWidth?: number;\n textAlign?: TextAlignType;\n textBaseline?: TextBaselineType;\n lineHeight?: number;\n underline?: number;\n underlineDash?: number[];\n underlineOffset?: number;\n lineThrough?: number;\n heightLimit?: number;\n lineClamp?: number;\n width?: number;\n height?: number;\n background?: {\n fill?: string;\n expandY?: number;\n expandX?: number;\n cornerRadius?: number;\n };\n}\nexport interface LineElement extends Omit<baseElement, 'x' | 'y'> {\n type: 'line';\n stroke?: string | ((value: string) => string);\n points: { x: number; y: number }[];\n lineWidth?: number;\n}\n\nexport interface RectElement extends baseElement {\n type: 'rect';\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n radius?: number | string | ((value: string) => number | string);\n}\n\nexport interface CircleElement extends baseElement {\n type: 'circle';\n radius: number | string | ((value: string) => number | string);\n // radian?: number | string | ((value: string) => number | string);\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n}\nexport interface ArcElement extends baseElement {\n type: 'arc';\n radius: number | string | ((value: string) => number | string);\n startAngle?: number | ((value: string) => number);\n endAngle?: number | ((value: string) => number);\n // clockWise?: boolean;\n stroke?: string | ((value: string) => string);\n fill?: string | ((value: string) => string);\n}\nexport interface IconElement extends baseElement {\n type: 'icon';\n svg: string | ((value: string) => string);\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n hover?: {\n x: number | string;\n y: number | string;\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n bgColor: string;\n radius?: number;\n };\n}\nexport interface ImageElement extends baseElement {\n type: 'image';\n src: string | ((value: string) => string);\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n hover?: {\n x: number | string;\n y: number | string;\n width: number | string | ((value: string) => number | string);\n height: number | string | ((value: string) => number | string);\n bgColor: string;\n radius?: number;\n };\n shape?: 'circle' | 'square';\n}\nexport type ICustomRenderElement =\n | TextElement\n | RectElement\n | CircleElement\n | IconElement\n | ImageElement\n | ArcElement\n | LineElement;\nexport type ICustomRenderElements = Array<ICustomRenderElement>;\n\nexport type ICustomRenderFuc = (args: CustomRenderFunctionArg) => ICustomRenderObj;\n\nexport type ICustomRenderObj = {\n /** 配置出来的类型集合 */\n elements: ICustomRenderElements;\n /** 期望单元格的高度 */\n expectedHeight: number;\n /** 期望单元格的宽度 */\n expectedWidth: number;\n /**\n * 是否还需要默认渲染内容 只有配置true才绘制 默认 不绘制\n */\n renderDefault?: boolean;\n};\n\nexport type ICustomRender = ICustomRenderFuc | ICustomRenderObj;\n"]}
@@ -54,6 +54,8 @@ export type CellStyle = {
54
54
  borderLineDash: LineDashsDef;
55
55
  underline: boolean;
56
56
  underlineWidth: number;
57
+ underlineDash: number[];
58
+ underlineOffset: number;
57
59
  lineThrough: boolean;
58
60
  lineThroughLineWidth: number;
59
61
  _strokeArrayWidth: number[];
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/style-define.ts"],"names":[],"mappings":"","file":"style-define.js","sourcesContent":["import type { BaseTableAPI } from './base-table';\nimport type { ColorsDef, ICellHeaderPaths, LineDashsDef, LineWidthsDef, PaddingsDef } from './common';\nimport type { ColumnIconOption } from './icon';\nimport type { FieldData } from './table-engine';\n\n// ****** TextStyle Options *******\nexport type TextOverflow = string /* a char */; //设置一行的省略形式,另外还有clip。如果autoWrapText设置了自动换行,这个无效\nexport type LineClamp = number | 'auto'; //设置单元格显示的行数,如果不设置的话 默认全部展示直到超过了显示范围,会截断暂时文本,如果设置了auto,显示不了的文本会出现省略号\nexport type TextAlignType = 'center' | 'end' | 'left' | 'right' | 'start'; // 设置单元格内文字的水平对齐方式\nexport type TextBaselineType = 'alphabetic' | 'bottom' | 'middle' | 'top'; // 设置单元格内文字的垂直对齐方式\n\nexport interface StylePropertyFunctionArg {\n row: number;\n col: number;\n /** 表格实例 */\n table: BaseTableAPI;\n /**有format的话 格式化后或者计算后的值 */\n value?: FieldData;\n /**原始值 */\n dataValue?: FieldData;\n /** progressbar类型特有,表示当前数值在总体数据范围的比例 */\n percentile?: number;\n /** 单元格的表头路径信息 */\n cellHeaderPaths: ICellHeaderPaths;\n}\nexport type ColorPropertyDefine =\n | string\n | ((args: StylePropertyFunctionArg) => string)\n | ((args: StylePropertyFunctionArg) => CanvasGradient)\n | ((args: StylePropertyFunctionArg) => CanvasPattern);\n\nexport type ColorsPropertyDefine =\n | ColorPropertyDefine\n | (string | null)[]\n | ((args: StylePropertyFunctionArg) => (string | null)[]);\n\nexport type LineWidthPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type LineWidthsPropertyDefine =\n | LineWidthPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type LineDashPropertyDefine = Array<number> | ((args: StylePropertyFunctionArg) => Array<number>);\n\nexport type LineDashsPropertyDefine =\n | LineDashPropertyDefine\n | (Array<number> | null)[]\n | ((args: StylePropertyFunctionArg) => (Array<number> | null)[]);\n\n// export type FontPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontSizePropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\nexport type FontFamilyPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontWeightPropertyDefine = string | number | ((args: StylePropertyFunctionArg) => string | number);\nexport type FontVariantPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontStylePropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type TagPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type CursorPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type IconPropertyDefine =\n | string\n | ColumnIconOption\n | ((args: StylePropertyFunctionArg) => string | ColumnIconOption);\n\nexport type UnderlinePropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\nexport type LineThroughPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type PaddingPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type PaddingsPropertyDefine =\n | PaddingPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type MarkedPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type CellStyle = {\n textAlign: CanvasTextAlign;\n padding: PaddingsDef;\n textBaseline: CanvasTextBaseline;\n color: CanvasRenderingContext2D['fillStyle'];\n bgColor: CanvasRenderingContext2D['fillStyle'];\n // font: string;\n fontSize: number;\n fontFamily: string;\n fontWeight: string | number;\n fontVariant: string;\n fontStyle: string;\n // lineHeight: string | number;\n lineHeight: number;\n autoWrapText: boolean;\n lineClamp: LineClamp;\n textOverflow: TextOverflow;\n borderColor: ColorsDef;\n borderLineWidth: LineWidthsDef;\n borderLineDash: LineDashsDef;\n underline: boolean;\n // underlineColor: CanvasRenderingContext2D['strokeStyle'];\n underlineWidth: number;\n // underlineDash: number[];\n lineThrough: boolean;\n // lineThroughColor: CanvasRenderingContext2D['strokeStyle'];\n // lineThroughDash: number[];\n lineThroughLineWidth: number;\n\n _strokeArrayWidth: number[];\n _strokeArrayColor: string[];\n _linkColor: CanvasRenderingContext2D['fillStyle'];\n};\n"]}
1
+ {"version":3,"sources":["../src/ts-types/style-define.ts"],"names":[],"mappings":"","file":"style-define.js","sourcesContent":["import type { BaseTableAPI } from './base-table';\nimport type { ColorsDef, ICellHeaderPaths, LineDashsDef, LineWidthsDef, PaddingsDef } from './common';\nimport type { ColumnIconOption } from './icon';\nimport type { FieldData } from './table-engine';\n\n// ****** TextStyle Options *******\nexport type TextOverflow = string /* a char */; //设置一行的省略形式,另外还有clip。如果autoWrapText设置了自动换行,这个无效\nexport type LineClamp = number | 'auto'; //设置单元格显示的行数,如果不设置的话 默认全部展示直到超过了显示范围,会截断暂时文本,如果设置了auto,显示不了的文本会出现省略号\nexport type TextAlignType = 'center' | 'end' | 'left' | 'right' | 'start'; // 设置单元格内文字的水平对齐方式\nexport type TextBaselineType = 'alphabetic' | 'bottom' | 'middle' | 'top'; // 设置单元格内文字的垂直对齐方式\n\nexport interface StylePropertyFunctionArg {\n row: number;\n col: number;\n /** 表格实例 */\n table: BaseTableAPI;\n /**有format的话 格式化后或者计算后的值 */\n value?: FieldData;\n /**原始值 */\n dataValue?: FieldData;\n /** progressbar类型特有,表示当前数值在总体数据范围的比例 */\n percentile?: number;\n /** 单元格的表头路径信息 */\n cellHeaderPaths: ICellHeaderPaths;\n}\nexport type ColorPropertyDefine =\n | string\n | ((args: StylePropertyFunctionArg) => string)\n | ((args: StylePropertyFunctionArg) => CanvasGradient)\n | ((args: StylePropertyFunctionArg) => CanvasPattern);\n\nexport type ColorsPropertyDefine =\n | ColorPropertyDefine\n | (string | null)[]\n | ((args: StylePropertyFunctionArg) => (string | null)[]);\n\nexport type LineWidthPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type LineWidthsPropertyDefine =\n | LineWidthPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type LineDashPropertyDefine = Array<number> | ((args: StylePropertyFunctionArg) => Array<number>);\n\nexport type LineDashsPropertyDefine =\n | LineDashPropertyDefine\n | (Array<number> | null)[]\n | ((args: StylePropertyFunctionArg) => (Array<number> | null)[]);\n\n// export type FontPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontSizePropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\nexport type FontFamilyPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontWeightPropertyDefine = string | number | ((args: StylePropertyFunctionArg) => string | number);\nexport type FontVariantPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontStylePropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type TagPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type CursorPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type IconPropertyDefine =\n | string\n | ColumnIconOption\n | ((args: StylePropertyFunctionArg) => string | ColumnIconOption);\n\nexport type UnderlinePropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\nexport type LineThroughPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type PaddingPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type PaddingsPropertyDefine =\n | PaddingPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type MarkedPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type CellStyle = {\n textAlign: CanvasTextAlign;\n padding: PaddingsDef;\n textBaseline: CanvasTextBaseline;\n color: CanvasRenderingContext2D['fillStyle'];\n bgColor: CanvasRenderingContext2D['fillStyle'];\n // font: string;\n fontSize: number;\n fontFamily: string;\n fontWeight: string | number;\n fontVariant: string;\n fontStyle: string;\n // lineHeight: string | number;\n lineHeight: number;\n autoWrapText: boolean;\n lineClamp: LineClamp;\n textOverflow: TextOverflow;\n borderColor: ColorsDef;\n borderLineWidth: LineWidthsDef;\n borderLineDash: LineDashsDef;\n underline: boolean;\n // underlineColor: CanvasRenderingContext2D['strokeStyle'];\n underlineWidth: number;\n underlineDash: number[];\n underlineOffset: number;\n lineThrough: boolean;\n // lineThroughColor: CanvasRenderingContext2D['strokeStyle'];\n // lineThroughDash: number[];\n lineThroughLineWidth: number;\n\n _strokeArrayWidth: number[];\n _strokeArrayColor: string[];\n _linkColor: CanvasRenderingContext2D['fillStyle'];\n};\n"]}
@@ -115,7 +115,7 @@ export interface ListTableAPI extends BaseTableAPI {
115
115
  isListTable: () => true;
116
116
  isPivotTable: () => false;
117
117
  changeCellValue: (col: number, row: number, value: string | number | null) => void;
118
- changeCellValues: (col: number, row: number, values: (string | number)[][]) => void;
118
+ changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => void;
119
119
  getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;
120
120
  getEditor: (col: number, row: number) => IEditor;
121
121
  startEditCell: (col?: number, row?: number) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":"AAkaA,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","file":"table-engine.js","sourcesContent":["import type { RectProps, MaybePromiseOrUndefined, IDimensionInfo, SortOrder, BaseCellInfo } from './common';\nimport type { SvgIcon } from './icon';\nexport type { HeaderData } from './list-table/layout-map/api';\nexport type LayoutObjectId = number | string;\nimport type { Rect } from '../tools/Rect';\nimport type { BaseTableAPI, BaseTableConstructorOptions, ListTableProtected } from './base-table';\nimport type {\n Aggregation,\n AggregationType,\n CustomAggregation,\n FilterRules,\n IPivotTableDataConfig\n} from './new-data-set';\nimport type { Either } from '../tools/helper';\nimport type {\n IChartIndicator,\n IColumnDimension,\n ICornerDefine,\n IDimension,\n IIndicator,\n IRowDimension,\n ITitleDefine\n} from './pivot-table';\nimport type { ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { ITextStyleOption } from '../body-helper/style';\nimport type { DataSource } from '../data';\nimport type { EditManeger } from '../edit/edit-manager';\nimport type { ICustomRender } from './customElement';\nimport type { ICustomLayout } from './customLayout';\n\nexport interface CellAddress {\n col: number;\n row: number;\n}\nexport interface CellAddressWithBound {\n col: number;\n row: number;\n rect?: RectProps;\n x?: number;\n y?: number;\n}\nexport interface CellRange {\n start: CellAddress;\n end: CellAddress;\n}\n\nexport type FieldGetter = (record: any, col?: number, row?: number, table?: BaseTableAPI) => any;\nexport type FieldSetter = (record: any, value: any) => void;\nexport interface FieldAssessor {\n get: FieldGetter;\n set: FieldSetter;\n}\n\nexport type FieldDef = string | number | string[];\nexport type FieldKeyDef = string | number;\nexport type FieldFormat = FieldGetter | FieldAssessor;\n\nexport type FieldData = MaybePromiseOrUndefined;\n\nexport type WidthModeDef = 'standard' | 'adaptive' | 'autoWidth';\nexport type HeightModeDef = 'standard' | 'adaptive' | 'autoHeight';\nexport type ShowColumnRowType = 'column' | 'row' | 'none';\n/** 单元格所处表格哪部分 */\nexport type CellLocation = 'body' | 'rowHeader' | 'columnHeader' | 'cornerHeader';\nexport type CellSubLocation =\n | 'body'\n | 'rowHeader'\n | 'columnHeader'\n | 'cornerHeader'\n | 'bottomFrozen'\n | 'rightFrozen'\n | 'rightTopCorner'\n | 'leftBottomCorner'\n | 'rightBottomCorner';\n\nexport interface TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格可编辑则进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean;\n /** 快捷键复制 默认:false*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n /** 快捷键粘贴。粘贴内容到指定位置(即需要有选中状态),支持批量粘贴。 默认:false */\n pasteValueToCell?: boolean; //paste是和浏览器的快捷键一致的\n}\nexport interface TableEventOptions {\n /** 是否阻止右键的默认行为, 默认为true。*/\n preventDefaultContextMenu?: boolean;\n}\nexport interface DataSourceAPI {\n clearCurrentIndexedData: () => void;\n length: number;\n get: (index: number) => MaybePromiseOrUndefined;\n getField: <F extends FieldDef>(index: number, field: F, col: number, row: number, table: BaseTableAPI) => FieldData;\n hasField: (index: number, field: FieldDef) => boolean;\n sort: (field: FieldDef, order: SortOrder, orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1) => void;\n clearSortedMap: () => void;\n updatePagination: (pagination: IPagination) => void;\n getIndexKey: (index: number) => number | number[];\n /** 数据是否为树形结构 且可以展开收起 */\n hierarchyExpandLevel: number;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\n /** 排序规则 */\n order: SortOrder;\n}\nexport interface PivotSortState {\n col: number;\n row: number;\n order: SortOrder;\n}\n\n/**\n * 分页配置\n */\nexport interface IPagination {\n /** 数据总条数 透视表中这个数据会自动加上 不需用户传入*/\n totalCount?: number;\n /** 每页显示数据条数 */\n perPageCount: number;\n /** 每页显示条数 */\n currentPage?: number;\n}\nexport type HeaderValues = Map<any, any>;\nexport interface ListTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 传入用户实例化的数据对象 目前不完善\n */\n dataSource?: DataSource;\n /**\n * 是否显示表头\n */\n showHeader?: boolean;\n /**\n * Simple header property\n */\n columns?: ColumnsDefine; //请不要再这个上面修改配置,这里相当于是一个原始值备份,有一个内部专用的protectspace.columns\n /**\n *@deprecated 已废弃 请使用columns\n */\n header?: ColumnsDefine;\n\n transpose?: boolean; //是否转置\n /**\n * 展示为tree的列 层级缩进值\n */\n hierarchyIndent?: number;\n /** 展开层数 默认为1只显示根节点*/\n hierarchyExpandLevel?: number;\n\n /** 分页配置 */\n pagination?: IPagination;\n\n /**\n * 排序状态\n */\n sortState?: SortState | SortState[];\n /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\n // dataConfig?: IListTableDataConfig;\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置编辑器 */\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 编辑触发时机 双击事件 单击事件 api手动开启编辑。默认为双击'doubleclick' */\n editCellTrigger?: 'doubleclick' | 'click' | 'api';\n /** 拖拽表头移动位置 针对冻结部分的规则 默认为fixedFrozenCount\n * \"disabled\"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。\n * \"adjustFrozenCount\"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。\n * \"fixedFrozenCount\"(可调整冻结列,并维持冻结数量不变):允许自由拖拽其他列的表头移入或移出冻结列位置,同时保持冻结列的数量不变。\n */\n frozenColDragHeaderMode?: 'disabled' | 'adjustFrozenCount' | 'fixedFrozenCount';\n aggregation?:\n | Aggregation\n | CustomAggregation\n | (Aggregation | CustomAggregation)[]\n | ((args: {\n col: number;\n field: string;\n }) => Aggregation | CustomAggregation | (Aggregation | CustomAggregation)[] | null);\n}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\n // /** 数据分析相关配置 */\n // dataConfig?: IListTableDataConfig;\n internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][]) => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n //#region 编辑器相关demo\n /** 获取单元格配置的编辑器 */\n getEditor: (col: number, row: number) => IEditor;\n /** 开启单元格编辑 */\n startEditCell: (col?: number, row?: number) => void;\n /** 结束编辑 */\n completeEditCell: () => void;\n //#endregion\n addRecord: (record: any, recordIndex?: number) => void;\n addRecords: (records: any[], recordIndex?: number) => void;\n deleteRecords: (recordIndexs: number[]) => void;\n updateRecords: (records: any[], recordIndexs: number[]) => void;\n updateFilterRules: (filterRules: FilterRules) => void;\n getAggregateValuesByField: (field: string | number) => {\n col: number;\n aggregateValue: { aggregationType: AggregationType; value: number | string }[];\n }[];\n}\nexport interface PivotTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n /** 设置排序状态,只对应按钮展示效果 无数据排序逻辑 */\n pivotSortState?: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n\n //#region layout中挪到外层的属性\n /**层级维度结构显示形式 */\n rowHierarchyType?: 'grid' | 'tree';\n /**展开层数 */\n rowExpandLevel?: number;\n /**子层级维度缩进距离 */\n rowHierarchyIndent?: number;\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 指标在具体维度展示的层级顺序,从0开始 ———有数据分析的透视表才需要配置这个 */\n indicatorIndex?: number;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 指标维度key 注意非具体指标key 数据分析的透视表才需要配置这个 */\n // indicatorDimensionKey?: string;\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n //#endregion\n /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\n dataConfig?: IPivotTableDataConfig;\n\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n}\nexport interface PivotChartConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合, 平坦数据集合。另外一种特殊方式是传入分组后的数据,分组依据为指标\n */\n records?: any[] | Record<string, any[]>;\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IChartIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n\n axes?: ITableAxisOption[];\n}\nexport interface PivotTableAPI extends BaseTableAPI {\n records?: any;\n options: PivotTableConstructorOptions;\n editorManager: EditManeger;\n // internalProps: PivotTableProtected;\n pivotSortState: PivotSortState[];\n isListTable: () => false;\n isPivotTable: () => true;\n getPivotSortState: (col: number, row: number) => SortOrder;\n toggleHierarchyState: (col: number, row: number) => void;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][]) => void;\n}\nexport interface PivotChartAPI extends BaseTableAPI {\n records?: any | Record<string, any[]>;\n options: PivotChartConstructorOptions;\n // internalProps: PivotTableProtected;\n isListTable: () => false;\n isPivotTable: () => true;\n}\nexport type SetPasteValueTestData = CellAddress & {\n table: BaseTableAPI;\n record: any;\n value: string;\n\n oldValue: any;\n};\n\nexport interface InlineAPI {\n width: (arg: { ctx: CanvasRenderingContext2D }) => number;\n font: () => string | null;\n color: () => string | null;\n canDraw: () => boolean;\n onReady: (callback: Function) => void;\n\n draw: (opt: any) => void;\n canBreak: () => boolean;\n}\n\nexport interface CellContext {\n readonly col: number;\n readonly row: number;\n /**format之后的值 */\n readonly value: FieldData;\n /**原始值 */\n readonly dataValue: FieldData;\n showIcon?: SvgIcon;\n getContext: () => CanvasRenderingContext2D;\n toCurrentContext: () => CellContext;\n getDrawRect: () => RectProps | null;\n getRect: () => RectProps;\n setRectFilter: (rectFilter: (base: RectProps) => RectProps) => void;\n updateRect: (rect: Rect | RectProps) => void;\n updateDrawRect: (rect: Rect | RectProps) => void;\n}\n\nexport enum Placement {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right'\n}\n\nexport enum HierarchyState {\n expand = 'expand',\n collapse = 'collapse',\n none = 'none'\n}\nexport type IHeaderTreeDefine = Either<IDimensionHeaderNode, IIndicatorHeaderNode>;\nexport interface IIndicatorHeaderNode {\n /**\n * 指标的key值 对应数据集的字段名\n */\n indicatorKey: string | number;\n /**\n * 指标名称 如:“销售额”,“例如”, 对应到单元格显示的值。可不填,不填的话 从indicators的对应配置中取值显示\n */\n value?: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | null;\n}\nexport interface IDimensionHeaderNode {\n /**\n * 维度的唯一标识,对应数据集的字段名称\n */\n dimensionKey: string | number;\n /** 维度成员值 */\n value: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | null;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\n}\n\nexport interface IExtensionRowDefine {\n rows: (IRowDimension | string)[];\n rowTree: IHeaderTreeDefine[] | ((args: { dimensionKey: string | number; value: string }[]) => IHeaderTreeDefine[]);\n}\n\nexport type StickCell = { col: number; row: number; dx: number; dy: number };\n\nexport type CustomMergeCell = (col: number, row: number, table: BaseTableAPI) => undefined | CustomMerge;\nexport type CustomMerge = {\n range: CellRange;\n text?: string;\n style?: ITextStyleOption;\n customLayout?: ICustomLayout;\n customRender?: ICustomRender;\n};\n"]}
1
+ {"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":"AAkaA,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","file":"table-engine.js","sourcesContent":["import type { RectProps, MaybePromiseOrUndefined, IDimensionInfo, SortOrder, BaseCellInfo } from './common';\nimport type { SvgIcon } from './icon';\nexport type { HeaderData } from './list-table/layout-map/api';\nexport type LayoutObjectId = number | string;\nimport type { Rect } from '../tools/Rect';\nimport type { BaseTableAPI, BaseTableConstructorOptions, ListTableProtected } from './base-table';\nimport type {\n Aggregation,\n AggregationType,\n CustomAggregation,\n FilterRules,\n IPivotTableDataConfig\n} from './new-data-set';\nimport type { Either } from '../tools/helper';\nimport type {\n IChartIndicator,\n IColumnDimension,\n ICornerDefine,\n IDimension,\n IIndicator,\n IRowDimension,\n ITitleDefine\n} from './pivot-table';\nimport type { ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { ITextStyleOption } from '../body-helper/style';\nimport type { DataSource } from '../data';\nimport type { EditManeger } from '../edit/edit-manager';\nimport type { ICustomRender } from './customElement';\nimport type { ICustomLayout } from './customLayout';\n\nexport interface CellAddress {\n col: number;\n row: number;\n}\nexport interface CellAddressWithBound {\n col: number;\n row: number;\n rect?: RectProps;\n x?: number;\n y?: number;\n}\nexport interface CellRange {\n start: CellAddress;\n end: CellAddress;\n}\n\nexport type FieldGetter = (record: any, col?: number, row?: number, table?: BaseTableAPI) => any;\nexport type FieldSetter = (record: any, value: any) => void;\nexport interface FieldAssessor {\n get: FieldGetter;\n set: FieldSetter;\n}\n\nexport type FieldDef = string | number | string[];\nexport type FieldKeyDef = string | number;\nexport type FieldFormat = FieldGetter | FieldAssessor;\n\nexport type FieldData = MaybePromiseOrUndefined;\n\nexport type WidthModeDef = 'standard' | 'adaptive' | 'autoWidth';\nexport type HeightModeDef = 'standard' | 'adaptive' | 'autoHeight';\nexport type ShowColumnRowType = 'column' | 'row' | 'none';\n/** 单元格所处表格哪部分 */\nexport type CellLocation = 'body' | 'rowHeader' | 'columnHeader' | 'cornerHeader';\nexport type CellSubLocation =\n | 'body'\n | 'rowHeader'\n | 'columnHeader'\n | 'cornerHeader'\n | 'bottomFrozen'\n | 'rightFrozen'\n | 'rightTopCorner'\n | 'leftBottomCorner'\n | 'rightBottomCorner';\n\nexport interface TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格可编辑则进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean;\n /** 快捷键复制 默认:false*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n /** 快捷键粘贴,默认:false 。粘贴内容到指定位置(即粘贴前要有选中的单元格);支持批量粘贴;粘贴生效仅针对配置了编辑 editor 的单元格;*/\n pasteValueToCell?: boolean; //paste是和浏览器的快捷键一致的\n}\nexport interface TableEventOptions {\n /** 是否阻止右键的默认行为, 默认为true。*/\n preventDefaultContextMenu?: boolean;\n}\nexport interface DataSourceAPI {\n clearCurrentIndexedData: () => void;\n length: number;\n get: (index: number) => MaybePromiseOrUndefined;\n getField: <F extends FieldDef>(index: number, field: F, col: number, row: number, table: BaseTableAPI) => FieldData;\n hasField: (index: number, field: FieldDef) => boolean;\n sort: (field: FieldDef, order: SortOrder, orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1) => void;\n clearSortedMap: () => void;\n updatePagination: (pagination: IPagination) => void;\n getIndexKey: (index: number) => number | number[];\n /** 数据是否为树形结构 且可以展开收起 */\n hierarchyExpandLevel: number;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\n /** 排序规则 */\n order: SortOrder;\n}\nexport interface PivotSortState {\n col: number;\n row: number;\n order: SortOrder;\n}\n\n/**\n * 分页配置\n */\nexport interface IPagination {\n /** 数据总条数 透视表中这个数据会自动加上 不需用户传入*/\n totalCount?: number;\n /** 每页显示数据条数 */\n perPageCount: number;\n /** 每页显示条数 */\n currentPage?: number;\n}\nexport type HeaderValues = Map<any, any>;\nexport interface ListTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 传入用户实例化的数据对象 目前不完善\n */\n dataSource?: DataSource;\n /**\n * 是否显示表头\n */\n showHeader?: boolean;\n /**\n * Simple header property\n */\n columns?: ColumnsDefine; //请不要再这个上面修改配置,这里相当于是一个原始值备份,有一个内部专用的protectspace.columns\n /**\n *@deprecated 已废弃 请使用columns\n */\n header?: ColumnsDefine;\n\n transpose?: boolean; //是否转置\n /**\n * 展示为tree的列 层级缩进值\n */\n hierarchyIndent?: number;\n /** 展开层数 默认为1只显示根节点*/\n hierarchyExpandLevel?: number;\n\n /** 分页配置 */\n pagination?: IPagination;\n\n /**\n * 排序状态\n */\n sortState?: SortState | SortState[];\n /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\n // dataConfig?: IListTableDataConfig;\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置编辑器 */\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 编辑触发时机 双击事件 单击事件 api手动开启编辑。默认为双击'doubleclick' */\n editCellTrigger?: 'doubleclick' | 'click' | 'api';\n /** 拖拽表头移动位置 针对冻结部分的规则 默认为fixedFrozenCount\n * \"disabled\"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。\n * \"adjustFrozenCount\"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。\n * \"fixedFrozenCount\"(可调整冻结列,并维持冻结数量不变):允许自由拖拽其他列的表头移入或移出冻结列位置,同时保持冻结列的数量不变。\n */\n frozenColDragHeaderMode?: 'disabled' | 'adjustFrozenCount' | 'fixedFrozenCount';\n aggregation?:\n | Aggregation\n | CustomAggregation\n | (Aggregation | CustomAggregation)[]\n | ((args: {\n col: number;\n field: string;\n }) => Aggregation | CustomAggregation | (Aggregation | CustomAggregation)[] | null);\n}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\n // /** 数据分析相关配置 */\n // dataConfig?: IListTableDataConfig;\n internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n //#region 编辑器相关demo\n /** 获取单元格配置的编辑器 */\n getEditor: (col: number, row: number) => IEditor;\n /** 开启单元格编辑 */\n startEditCell: (col?: number, row?: number) => void;\n /** 结束编辑 */\n completeEditCell: () => void;\n //#endregion\n addRecord: (record: any, recordIndex?: number) => void;\n addRecords: (records: any[], recordIndex?: number) => void;\n deleteRecords: (recordIndexs: number[]) => void;\n updateRecords: (records: any[], recordIndexs: number[]) => void;\n updateFilterRules: (filterRules: FilterRules) => void;\n getAggregateValuesByField: (field: string | number) => {\n col: number;\n aggregateValue: { aggregationType: AggregationType; value: number | string }[];\n }[];\n}\nexport interface PivotTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n /** 设置排序状态,只对应按钮展示效果 无数据排序逻辑 */\n pivotSortState?: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n\n //#region layout中挪到外层的属性\n /**层级维度结构显示形式 */\n rowHierarchyType?: 'grid' | 'tree';\n /**展开层数 */\n rowExpandLevel?: number;\n /**子层级维度缩进距离 */\n rowHierarchyIndent?: number;\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 指标在具体维度展示的层级顺序,从0开始 ———有数据分析的透视表才需要配置这个 */\n indicatorIndex?: number;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 指标维度key 注意非具体指标key 数据分析的透视表才需要配置这个 */\n // indicatorDimensionKey?: string;\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n //#endregion\n /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\n dataConfig?: IPivotTableDataConfig;\n\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n}\nexport interface PivotChartConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合, 平坦数据集合。另外一种特殊方式是传入分组后的数据,分组依据为指标\n */\n records?: any[] | Record<string, any[]>;\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IChartIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n\n axes?: ITableAxisOption[];\n}\nexport interface PivotTableAPI extends BaseTableAPI {\n records?: any;\n options: PivotTableConstructorOptions;\n editorManager: EditManeger;\n // internalProps: PivotTableProtected;\n pivotSortState: PivotSortState[];\n isListTable: () => false;\n isPivotTable: () => true;\n getPivotSortState: (col: number, row: number) => SortOrder;\n toggleHierarchyState: (col: number, row: number) => void;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][]) => void;\n}\nexport interface PivotChartAPI extends BaseTableAPI {\n records?: any | Record<string, any[]>;\n options: PivotChartConstructorOptions;\n // internalProps: PivotTableProtected;\n isListTable: () => false;\n isPivotTable: () => true;\n}\nexport type SetPasteValueTestData = CellAddress & {\n table: BaseTableAPI;\n record: any;\n value: string;\n\n oldValue: any;\n};\n\nexport interface InlineAPI {\n width: (arg: { ctx: CanvasRenderingContext2D }) => number;\n font: () => string | null;\n color: () => string | null;\n canDraw: () => boolean;\n onReady: (callback: Function) => void;\n\n draw: (opt: any) => void;\n canBreak: () => boolean;\n}\n\nexport interface CellContext {\n readonly col: number;\n readonly row: number;\n /**format之后的值 */\n readonly value: FieldData;\n /**原始值 */\n readonly dataValue: FieldData;\n showIcon?: SvgIcon;\n getContext: () => CanvasRenderingContext2D;\n toCurrentContext: () => CellContext;\n getDrawRect: () => RectProps | null;\n getRect: () => RectProps;\n setRectFilter: (rectFilter: (base: RectProps) => RectProps) => void;\n updateRect: (rect: Rect | RectProps) => void;\n updateDrawRect: (rect: Rect | RectProps) => void;\n}\n\nexport enum Placement {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right'\n}\n\nexport enum HierarchyState {\n expand = 'expand',\n collapse = 'collapse',\n none = 'none'\n}\nexport type IHeaderTreeDefine = Either<IDimensionHeaderNode, IIndicatorHeaderNode>;\nexport interface IIndicatorHeaderNode {\n /**\n * 指标的key值 对应数据集的字段名\n */\n indicatorKey: string | number;\n /**\n * 指标名称 如:“销售额”,“例如”, 对应到单元格显示的值。可不填,不填的话 从indicators的对应配置中取值显示\n */\n value?: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | null;\n}\nexport interface IDimensionHeaderNode {\n /**\n * 维度的唯一标识,对应数据集的字段名称\n */\n dimensionKey: string | number;\n /** 维度成员值 */\n value: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | null;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\n}\n\nexport interface IExtensionRowDefine {\n rows: (IRowDimension | string)[];\n rowTree: IHeaderTreeDefine[] | ((args: { dimensionKey: string | number; value: string }[]) => IHeaderTreeDefine[]);\n}\n\nexport type StickCell = { col: number; row: number; dx: number; dy: number };\n\nexport type CustomMergeCell = (col: number, row: number, table: BaseTableAPI) => undefined | CustomMerge;\nexport type CustomMerge = {\n range: CellRange;\n text?: string;\n style?: ITextStyleOption;\n customLayout?: ICustomLayout;\n customRender?: ICustomRender;\n};\n"]}
@@ -109,5 +109,8 @@ export interface ITableThemeDefine {
109
109
  };
110
110
  checkboxStyle?: CheckboxStyle;
111
111
  textPopTipStyle?: PopTipAttributes;
112
+ cellInnerBorder?: boolean;
113
+ cellBorderClipDirection?: 'top-left' | 'bottom-right';
114
+ _contentOffset?: number;
112
115
  }
113
116
  export type RequiredTableThemeDefine = Required<ITableThemeDefine>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine } from '.';\nimport type { CheckboxStyle, ITextStyleOption } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ColumnIconOption } from './icon';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from '@visactor/vrender-components';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n // click?: Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 */\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n };\n\n checkboxStyle?: CheckboxStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
1
+ {"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine } from '.';\nimport type { CheckboxStyle, ITextStyleOption } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ColumnIconOption } from './icon';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from '@visactor/vrender-components';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n // click?: Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 */\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n };\n\n checkboxStyle?: CheckboxStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 四边单元格,靠近边框的border是否显示;配置false的话,左侧单元格不显示左边框,同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
package/es/vrender.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","file":"vrender.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"0.20.4-alpha.2\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n registerArc3d();\n registerArea();\n registerCircle();\n registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n registerPath();\n registerPolygon();\n registerPyramid3d();\n registerRect();\n registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerWrapText();\n}\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","file":"vrender.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"0.21.0\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n registerArc3d();\n registerArea();\n registerCircle();\n registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n registerPath();\n registerPolygon();\n registerPyramid3d();\n registerRect();\n registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerWrapText();\n}\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vtable",
3
- "version": "0.20.4-alpha.2",
3
+ "version": "0.21.0",
4
4
  "description": "canvas table width high performance",
5
5
  "keywords": [
6
6
  "grid",
@@ -35,15 +35,15 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@visactor/vtable-editors": "0.20.4-alpha.2",
39
- "@visactor/vrender-core": "0.17.20-alpha.3",
40
- "@visactor/vrender-kits": "0.17.20-alpha.3",
41
- "@visactor/vrender-components": "0.17.20-alpha.3",
38
+ "@visactor/vrender-core": "0.18.2-alpha.1",
39
+ "@visactor/vrender-kits": "0.18.2-alpha.1",
40
+ "@visactor/vrender-components": "0.18.2-alpha.1",
42
41
  "@visactor/vutils-extension": "~1.8.5",
43
42
  "@visactor/vutils": "~0.17.1",
44
43
  "@visactor/vscale": "~0.17.1",
45
44
  "@visactor/vdataset": "~0.17.1",
46
- "cssfontparser": "^1.2.1"
45
+ "cssfontparser": "^1.2.1",
46
+ "@visactor/vtable-editors": "0.21.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "luxon": "*",
@@ -1,41 +0,0 @@
1
- import type { IGroup } from './../../vrender';
2
- import type { MenuListItem } from '../../ts-types';
3
- import { Group } from '../graphic/group';
4
- import type { BaseTableAPI } from '../../ts-types/base-table';
5
- export declare enum MenuType {
6
- 'dropDown' = "dropDown",
7
- 'contextmenu' = "contextmenu",
8
- 'custom' = "custom"
9
- }
10
- type MenuInfo = MenuListItem[];
11
- export declare class MenuHandler {
12
- private _table;
13
- private _menuInstance;
14
- private _menuInfo;
15
- constructor(table: BaseTableAPI);
16
- bindTableComponent(componentGroup: Group): void;
17
- release(): void;
18
- attach(x: number, y: number, col: number, row: number, type: MenuType, menuInfo?: MenuInfo): void;
19
- updateMenuInfo(col: number, row: number, type: MenuType, menuInfo: MenuListItem[], highlightIndex: number): void;
20
- checkDropDownMenuChange(col: number, row: number): boolean;
21
- checkContextMenuChange(x: number, y: number): boolean;
22
- updateMenuInstance(menuInfo: MenuInfo, highlightIndex: number): void;
23
- updatePosition(x: number, y: number): void;
24
- addToScene(): void;
25
- detach(): void;
26
- getMenuInfo(col: number, row: number, type: MenuType): {
27
- menuInfo: MenuListItem[];
28
- highlightIndex: number;
29
- };
30
- bindEvent(): void;
31
- getEventInfo(target: IGroup): {
32
- col: number;
33
- row: number;
34
- menuKey: string;
35
- dropDownIndex: number;
36
- text: string;
37
- highlight: boolean;
38
- };
39
- get bounds(): import("@visactor/vutils").IBounds;
40
- }
41
- export {};
@@ -1,41 +0,0 @@
1
- import type { IGroup } from './../../vrender';
2
- import type { MenuListItem } from '../../ts-types';
3
- import { Group } from '../graphic/group';
4
- import type { BaseTableAPI } from '../../ts-types/base-table';
5
- export declare enum MenuType {
6
- 'dropDown' = "dropDown",
7
- 'contextmenu' = "contextmenu",
8
- 'custom' = "custom"
9
- }
10
- type MenuInfo = MenuListItem[];
11
- export declare class MenuHandler {
12
- private _table;
13
- private _menuInstance;
14
- private _menuInfo;
15
- constructor(table: BaseTableAPI);
16
- bindTableComponent(componentGroup: Group): void;
17
- release(): void;
18
- attach(x: number, y: number, col: number, row: number, type: MenuType, menuInfo?: MenuInfo): void;
19
- updateMenuInfo(col: number, row: number, type: MenuType, menuInfo: MenuListItem[], highlightIndex: number): void;
20
- checkDropDownMenuChange(col: number, row: number): boolean;
21
- checkContextMenuChange(x: number, y: number): boolean;
22
- updateMenuInstance(menuInfo: MenuInfo, highlightIndex: number): void;
23
- updatePosition(x: number, y: number): void;
24
- addToScene(): void;
25
- detach(): void;
26
- getMenuInfo(col: number, row: number, type: MenuType): {
27
- menuInfo: MenuListItem[];
28
- highlightIndex: number;
29
- };
30
- bindEvent(): void;
31
- getEventInfo(target: IGroup): {
32
- col: number;
33
- row: number;
34
- menuKey: string;
35
- dropDownIndex: number;
36
- text: string;
37
- highlight: boolean;
38
- };
39
- get bounds(): import("@visactor/vutils").IBounds;
40
- }
41
- export {};