@visactor/vtable 0.13.1-alpha.0 → 0.13.1

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 (145) hide show
  1. package/cjs/ListTable.d.ts +5 -1
  2. package/cjs/ListTable.js +27 -7
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +6 -2
  5. package/cjs/PivotChart.js +33 -25
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +6 -2
  8. package/cjs/PivotTable.js +12 -8
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +6 -2
  11. package/cjs/core/BaseTable.js +9 -6
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/data/CachedDataSource.d.ts +2 -1
  14. package/cjs/data/CachedDataSource.js +2 -2
  15. package/cjs/data/CachedDataSource.js.map +1 -1
  16. package/cjs/data/DataSource.d.ts +5 -3
  17. package/cjs/data/DataSource.js +11 -8
  18. package/cjs/data/DataSource.js.map +1 -1
  19. package/cjs/dataset/statistics-helper.d.ts +2 -1
  20. package/cjs/dataset/statistics-helper.js +2 -2
  21. package/cjs/dataset/statistics-helper.js.map +1 -1
  22. package/cjs/event/listener/table-group.js +10 -0
  23. package/cjs/event/listener/table-group.js.map +1 -1
  24. package/cjs/header-helper/header-helper.d.ts +2 -2
  25. package/cjs/header-helper/header-helper.js +4 -1
  26. package/cjs/header-helper/header-helper.js.map +1 -1
  27. package/cjs/header-helper/style/CheckboxStyle.d.ts +7 -0
  28. package/cjs/header-helper/style/CheckboxStyle.js +24 -0
  29. package/cjs/header-helper/style/CheckboxStyle.js.map +1 -0
  30. package/cjs/index.d.ts +1 -1
  31. package/cjs/index.js +1 -1
  32. package/cjs/index.js.map +1 -1
  33. package/cjs/layout/pivot-header-layout.d.ts +3 -2
  34. package/cjs/layout/pivot-header-layout.js +4 -3
  35. package/cjs/layout/pivot-header-layout.js.map +1 -1
  36. package/cjs/layout/pivot-layout.js.map +1 -1
  37. package/cjs/layout/simple-header-layout.d.ts +1 -1
  38. package/cjs/layout/simple-header-layout.js +1 -1
  39. package/cjs/layout/simple-header-layout.js.map +1 -1
  40. package/cjs/scenegraph/component/custom.d.ts +0 -1
  41. package/cjs/scenegraph/component/custom.js +2 -14
  42. package/cjs/scenegraph/component/custom.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +31 -17
  44. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  45. package/cjs/scenegraph/layout/compute-col-width.js +3 -4
  46. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  47. package/cjs/scenegraph/layout/compute-row-height.js +2 -3
  48. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  49. package/cjs/scenegraph/scenegraph.d.ts +2 -0
  50. package/cjs/scenegraph/scenegraph.js +32 -0
  51. package/cjs/scenegraph/scenegraph.js.map +1 -1
  52. package/cjs/scenegraph/utils/get-hierarchy-offset.js +1 -1
  53. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  54. package/cjs/state/state.d.ts +10 -0
  55. package/cjs/state/state.js +83 -1
  56. package/cjs/state/state.js.map +1 -1
  57. package/cjs/tools/get-data-path/index.js.map +1 -1
  58. package/cjs/ts-types/base-table.d.ts +5 -2
  59. package/cjs/ts-types/base-table.js.map +1 -1
  60. package/cjs/ts-types/column/type.d.ts +1 -1
  61. package/cjs/ts-types/column/type.js.map +1 -1
  62. package/cjs/ts-types/list-table/define/Composite-define.d.ts +2 -0
  63. package/cjs/ts-types/list-table/define/Composite-define.js.map +1 -1
  64. package/cjs/ts-types/list-table/define/checkbox-define.d.ts +7 -1
  65. package/cjs/ts-types/list-table/define/checkbox-define.js.map +1 -1
  66. package/cjs/ts-types/list-table/define/index.d.ts +2 -2
  67. package/cjs/ts-types/list-table/define/index.js.map +1 -1
  68. package/cjs/ts-types/list-table/layout-map/api.d.ts +2 -2
  69. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  70. package/cjs/ts-types/table-engine.d.ts +2 -2
  71. package/cjs/ts-types/table-engine.js.map +1 -1
  72. package/dist/vtable.js +873 -246
  73. package/dist/vtable.min.js +2 -2
  74. package/es/ListTable.d.ts +5 -1
  75. package/es/ListTable.js +27 -7
  76. package/es/ListTable.js.map +1 -1
  77. package/es/PivotChart.d.ts +6 -2
  78. package/es/PivotChart.js +33 -25
  79. package/es/PivotChart.js.map +1 -1
  80. package/es/PivotTable.d.ts +6 -2
  81. package/es/PivotTable.js +12 -8
  82. package/es/PivotTable.js.map +1 -1
  83. package/es/core/BaseTable.d.ts +6 -2
  84. package/es/core/BaseTable.js +9 -6
  85. package/es/core/BaseTable.js.map +1 -1
  86. package/es/data/CachedDataSource.d.ts +2 -1
  87. package/es/data/CachedDataSource.js +2 -2
  88. package/es/data/CachedDataSource.js.map +1 -1
  89. package/es/data/DataSource.d.ts +5 -3
  90. package/es/data/DataSource.js +11 -8
  91. package/es/data/DataSource.js.map +1 -1
  92. package/es/dataset/statistics-helper.d.ts +2 -1
  93. package/es/dataset/statistics-helper.js +2 -2
  94. package/es/dataset/statistics-helper.js.map +1 -1
  95. package/es/event/listener/table-group.js +10 -0
  96. package/es/event/listener/table-group.js.map +1 -1
  97. package/es/header-helper/header-helper.d.ts +2 -2
  98. package/es/header-helper/header-helper.js +5 -0
  99. package/es/header-helper/header-helper.js.map +1 -1
  100. package/es/header-helper/style/CheckboxStyle.d.ts +7 -0
  101. package/es/header-helper/style/CheckboxStyle.js +16 -0
  102. package/es/header-helper/style/CheckboxStyle.js.map +1 -0
  103. package/es/index.d.ts +1 -1
  104. package/es/index.js +1 -1
  105. package/es/index.js.map +1 -1
  106. package/es/layout/pivot-header-layout.d.ts +3 -2
  107. package/es/layout/pivot-header-layout.js +4 -3
  108. package/es/layout/pivot-header-layout.js.map +1 -1
  109. package/es/layout/pivot-layout.js.map +1 -1
  110. package/es/layout/simple-header-layout.d.ts +1 -1
  111. package/es/layout/simple-header-layout.js +1 -1
  112. package/es/layout/simple-header-layout.js.map +1 -1
  113. package/es/scenegraph/component/custom.d.ts +0 -1
  114. package/es/scenegraph/component/custom.js +0 -12
  115. package/es/scenegraph/component/custom.js.map +1 -1
  116. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +30 -15
  117. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  118. package/es/scenegraph/layout/compute-col-width.js +2 -5
  119. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  120. package/es/scenegraph/layout/compute-row-height.js +1 -4
  121. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  122. package/es/scenegraph/scenegraph.d.ts +2 -0
  123. package/es/scenegraph/scenegraph.js +32 -0
  124. package/es/scenegraph/scenegraph.js.map +1 -1
  125. package/es/scenegraph/utils/get-hierarchy-offset.js +1 -1
  126. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  127. package/es/state/state.d.ts +10 -0
  128. package/es/state/state.js +84 -2
  129. package/es/state/state.js.map +1 -1
  130. package/es/tools/get-data-path/index.js.map +1 -1
  131. package/es/ts-types/base-table.d.ts +5 -2
  132. package/es/ts-types/base-table.js.map +1 -1
  133. package/es/ts-types/column/type.d.ts +1 -1
  134. package/es/ts-types/column/type.js.map +1 -1
  135. package/es/ts-types/list-table/define/Composite-define.d.ts +2 -0
  136. package/es/ts-types/list-table/define/Composite-define.js.map +1 -1
  137. package/es/ts-types/list-table/define/checkbox-define.d.ts +7 -1
  138. package/es/ts-types/list-table/define/checkbox-define.js.map +1 -1
  139. package/es/ts-types/list-table/define/index.d.ts +2 -2
  140. package/es/ts-types/list-table/define/index.js.map +1 -1
  141. package/es/ts-types/list-table/layout-map/api.d.ts +2 -2
  142. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  143. package/es/ts-types/table-engine.d.ts +2 -2
  144. package/es/ts-types/table-engine.js.map +1 -1
  145. package/package.json +9 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/column/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["export type ColumnTypeOption = 'text' | 'image' | 'video' | 'link' | 'chart' | 'sparkline' | 'progressbar' | 'checkbox';\nexport type HeaderTypeOption = 'text' | 'image' | 'video' | 'link';\n"]}
1
+ {"version":3,"sources":["ts-types/column/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["export type ColumnTypeOption = 'text' | 'image' | 'video' | 'link' | 'chart' | 'sparkline' | 'progressbar' | 'checkbox';\nexport type HeaderTypeOption = 'text' | 'image' | 'video' | 'link' | 'checkbox';\n"]}
@@ -18,4 +18,6 @@ export interface ICompositeColumnBodyDefine extends IBasicColumnBodyDefine {
18
18
  barType?: 'default' | 'negative' | 'negative_no_axis';
19
19
  dependField?: string;
20
20
  sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);
21
+ checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);
22
+ disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/list-table/define/Composite-define.ts"],"names":[],"mappings":"","file":"Composite-define.js","sourcesContent":["import type { ColumnTypeOption, IStyleOption, ITextStyleOption } from '../../column';\nimport type { CellInfo } from '../../common';\nimport type { SparklineSpec } from '../../sparkline';\nimport type { StylePropertyFunctionArg } from '../../style-define';\nimport type { IBasicColumnBodyDefine } from './basic-define';\n\nexport interface ICompositeColumnBodyDefine extends IBasicColumnBodyDefine {\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n cellType: (arg0: CellInfo) => ColumnTypeOption;\n // link 特有\n /** 链接是否可点击跳转 */\n linkJump?: boolean;\n /** 链接是否进行正则检测,如果链接符合url规则才展示成为link。如果配置了模板链接该配置不生效。 */\n linkDetect?: boolean;\n /** 模板链接地址,如:'https://www.google.com.hk/search?q={name}',name是数据源属性字段名。 */\n templateLink?: string;\n\n // image 特有\n /** 是否保持横纵比 默认false */\n keepAspectRatio?: boolean;\n /** 是否按图片尺寸自动撑开单元格尺寸 默认false */\n imageAutoSizing?: boolean;\n\n // chart 特有\n /** 注入的图表库组件名称 */\n chartModule?: string;\n /** 对应图表库的spec 其中value对应在records中提供 */\n chartSpec?: any | ((arg0: CellInfo) => any);\n\n // progressbar 特有\n /* 进度条展示的最大最小数据值限制,从min到max为整个进度条的长度;\n * 如果barType为'negative'或'negative_no_axis',负向进度条的总长度为长度为min到0,正向进度条的总长度为长度为0到max,\n * 例如:min为10,max为50,数据为30,进度条展示为单元格宽度的一半\n */\n min?: number;\n max?: number;\n /* 进度条类型 默认default\n * default:由min到max的进度条\n * negative:分别展示min到0,0到max的正负向两个进度条,中间展示0值坐标轴\n * negative_no_axis:展示与negative相同,不限制0值坐标轴\n */\n barType?: 'default' | 'negative' | 'negative_no_axis';\n /** 进度图依赖的数据,如果需要单元格展示的文字和进度图使用的数据字段不同,在dependField里配置进度图使用的数据字段 */\n dependField?: string;\n\n // sparkline 特有\n sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);\n}\n"]}
1
+ {"version":3,"sources":["ts-types/list-table/define/Composite-define.ts"],"names":[],"mappings":"","file":"Composite-define.js","sourcesContent":["import type { ColumnTypeOption, IStyleOption, ITextStyleOption } from '../../column';\nimport type { CellInfo } from '../../common';\nimport type { SparklineSpec } from '../../sparkline';\nimport type { StylePropertyFunctionArg } from '../../style-define';\nimport type { IBasicColumnBodyDefine } from './basic-define';\n\nexport interface ICompositeColumnBodyDefine extends IBasicColumnBodyDefine {\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n cellType: (arg0: CellInfo) => ColumnTypeOption;\n // link 特有\n /** 链接是否可点击跳转 */\n linkJump?: boolean;\n /** 链接是否进行正则检测,如果链接符合url规则才展示成为link。如果配置了模板链接该配置不生效。 */\n linkDetect?: boolean;\n /** 模板链接地址,如:'https://www.google.com.hk/search?q={name}',name是数据源属性字段名。 */\n templateLink?: string;\n\n // image 特有\n /** 是否保持横纵比 默认false */\n keepAspectRatio?: boolean;\n /** 是否按图片尺寸自动撑开单元格尺寸 默认false */\n imageAutoSizing?: boolean;\n\n // chart 特有\n /** 注入的图表库组件名称 */\n chartModule?: string;\n /** 对应图表库的spec 其中value对应在records中提供 */\n chartSpec?: any | ((arg0: CellInfo) => any);\n\n // progressbar 特有\n /* 进度条展示的最大最小数据值限制,从min到max为整个进度条的长度;\n * 如果barType为'negative'或'negative_no_axis',负向进度条的总长度为长度为min到0,正向进度条的总长度为长度为0到max,\n * 例如:min为10,max为50,数据为30,进度条展示为单元格宽度的一半\n */\n min?: number;\n max?: number;\n /* 进度条类型 默认default\n * default:由min到max的进度条\n * negative:分别展示min到0,0到max的正负向两个进度条,中间展示0值坐标轴\n * negative_no_axis:展示与negative相同,不限制0值坐标轴\n */\n barType?: 'default' | 'negative' | 'negative_no_axis';\n /** 进度图依赖的数据,如果需要单元格展示的文字和进度图使用的数据字段不同,在dependField里配置进度图使用的数据字段 */\n dependField?: string;\n\n // sparkline 特有\n sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);\n\n //checkbox\n checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n}\n"]}
@@ -1,6 +1,12 @@
1
1
  import type { CheckboxStyleOption } from '../../column';
2
2
  import type { StylePropertyFunctionArg } from '../../style-define';
3
- import type { IBasicColumnBodyDefine } from './basic-define';
3
+ import type { IBasicColumnBodyDefine, IBasicHeaderDefine } from './basic-define';
4
+ export interface ICheckboxHeaderDefine extends IBasicHeaderDefine {
5
+ headerStyle?: CheckboxStyleOption | ((styleArg: StylePropertyFunctionArg) => CheckboxStyleOption);
6
+ headerType: 'checkbox';
7
+ checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);
8
+ disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);
9
+ }
4
10
  export interface ICheckboxColumnBodyDefine extends IBasicColumnBodyDefine {
5
11
  style?: CheckboxStyleOption | ((styleArg: StylePropertyFunctionArg) => CheckboxStyleOption);
6
12
  cellType: 'checkbox';
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/list-table/define/checkbox-define.ts"],"names":[],"mappings":"","file":"checkbox-define.js","sourcesContent":["import type { CheckboxStyleOption } from '../../column';\nimport type { StylePropertyFunctionArg } from '../../style-define';\nimport type { IBasicColumnBodyDefine } from './basic-define';\n\nexport interface ICheckboxColumnBodyDefine extends IBasicColumnBodyDefine {\n style?: CheckboxStyleOption | ((styleArg: StylePropertyFunctionArg) => CheckboxStyleOption);\n cellType: 'checkbox';\n checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n}\n"]}
1
+ {"version":3,"sources":["ts-types/list-table/define/checkbox-define.ts"],"names":[],"mappings":"","file":"checkbox-define.js","sourcesContent":["import type { CheckboxStyleOption } from '../../column';\nimport type { StylePropertyFunctionArg } from '../../style-define';\nimport type { IBasicColumnBodyDefine, IBasicHeaderDefine } from './basic-define';\n\nexport interface ICheckboxHeaderDefine extends IBasicHeaderDefine {\n headerStyle?: CheckboxStyleOption | ((styleArg: StylePropertyFunctionArg) => CheckboxStyleOption);\n headerType: 'checkbox';\n checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n}\nexport interface ICheckboxColumnBodyDefine extends IBasicColumnBodyDefine {\n style?: CheckboxStyleOption | ((styleArg: StylePropertyFunctionArg) => CheckboxStyleOption);\n cellType: 'checkbox';\n checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  import type { Either } from '../../../tools/helper';
2
2
  import type { ICompositeColumnBodyDefine } from './Composite-define';
3
3
  import type { IChartColumnBodyDefine } from './chart-define';
4
- import type { ICheckboxColumnBodyDefine } from './checkbox-define';
4
+ import type { ICheckboxColumnBodyDefine, ICheckboxHeaderDefine } from './checkbox-define';
5
5
  import type { IImageColumnBodyDefine, IImageHeaderDefine } from './image-define';
6
6
  import type { ILinkColumnBodyDefine, ILinkHeaderDefine } from './link-define';
7
7
  import type { ITextColumnBodyDefine, ITextHeaderDefine } from './multilinetext-define';
8
8
  import type { IProgressbarColumnBodyDefine } from './progressbar-define';
9
9
  import type { ISparklineColumnBodyDefine } from './sparkline-define';
10
- export type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ITextHeaderDefine;
10
+ export type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ICheckboxHeaderDefine | ITextHeaderDefine;
11
11
  export type ColumnBodyDefine = ILinkColumnBodyDefine | IImageColumnBodyDefine | ISparklineColumnBodyDefine | IProgressbarColumnBodyDefine | ICheckboxColumnBodyDefine | IChartColumnBodyDefine | ITextColumnBodyDefine;
12
12
  export type TextColumnDefine = ITextColumnBodyDefine & HeaderDefine;
13
13
  export type LinkColumnDefine = ILinkColumnBodyDefine & HeaderDefine;
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/list-table/define/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":["import type { Either } from '../../../tools/helper';\nimport type { ICompositeColumnBodyDefine } from './Composite-define';\nimport type { IChartColumnBodyDefine } from './chart-define';\nimport type { ICheckboxColumnBodyDefine } from './checkbox-define';\nimport type { IImageColumnBodyDefine, IImageHeaderDefine } from './image-define';\nimport type { ILinkColumnBodyDefine, ILinkHeaderDefine } from './link-define';\nimport type { ITextColumnBodyDefine, ITextHeaderDefine } from './multilinetext-define';\nimport type { IProgressbarColumnBodyDefine } from './progressbar-define';\nimport type { ISparklineColumnBodyDefine } from './sparkline-define';\n\nexport type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ITextHeaderDefine;\n\nexport type ColumnBodyDefine =\n | ILinkColumnBodyDefine\n | IImageColumnBodyDefine\n | ISparklineColumnBodyDefine\n | IProgressbarColumnBodyDefine\n | ICheckboxColumnBodyDefine\n | IChartColumnBodyDefine\n | ITextColumnBodyDefine;\nexport type TextColumnDefine = ITextColumnBodyDefine & HeaderDefine;\nexport type LinkColumnDefine = ILinkColumnBodyDefine & HeaderDefine;\nexport type ImageColumnDefine = IImageColumnBodyDefine & HeaderDefine;\nexport type SparklineColumnDefine = ISparklineColumnBodyDefine & HeaderDefine;\nexport type ProgressbarColumnDefine = IProgressbarColumnBodyDefine & HeaderDefine;\nexport type CheckboxColumnDefine = ICheckboxColumnBodyDefine & HeaderDefine;\nexport type ChartColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type CompositeColumnDefine = ICompositeColumnBodyDefine & HeaderDefine;\n// export type GroupColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type GroupColumnDefine = HeaderDefine & {\n columns: ColumnsDefine;\n hideColumnsSubHeader?: boolean;\n};\nexport type ColumnDefine = Either<\n | LinkColumnDefine\n | ImageColumnDefine\n | SparklineColumnDefine\n | ProgressbarColumnDefine\n | CheckboxColumnDefine\n | ChartColumnDefine\n | TextColumnDefine\n | CompositeColumnDefine,\n GroupColumnDefine\n>;\n\n// export type ColumnDefine = HeaderDefine & ColumnBodyDefine;\n\nexport type ColumnsDefine = ColumnDefine[];\n"]}
1
+ {"version":3,"sources":["ts-types/list-table/define/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":["import type { Either } from '../../../tools/helper';\nimport type { ICompositeColumnBodyDefine } from './Composite-define';\nimport type { IChartColumnBodyDefine } from './chart-define';\nimport type { ICheckboxColumnBodyDefine, ICheckboxHeaderDefine } from './checkbox-define';\nimport type { IImageColumnBodyDefine, IImageHeaderDefine } from './image-define';\nimport type { ILinkColumnBodyDefine, ILinkHeaderDefine } from './link-define';\nimport type { ITextColumnBodyDefine, ITextHeaderDefine } from './multilinetext-define';\nimport type { IProgressbarColumnBodyDefine } from './progressbar-define';\nimport type { ISparklineColumnBodyDefine } from './sparkline-define';\n\nexport type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ICheckboxHeaderDefine | ITextHeaderDefine;\n\nexport type ColumnBodyDefine =\n | ILinkColumnBodyDefine\n | IImageColumnBodyDefine\n | ISparklineColumnBodyDefine\n | IProgressbarColumnBodyDefine\n | ICheckboxColumnBodyDefine\n | IChartColumnBodyDefine\n | ITextColumnBodyDefine;\nexport type TextColumnDefine = ITextColumnBodyDefine & HeaderDefine;\nexport type LinkColumnDefine = ILinkColumnBodyDefine & HeaderDefine;\nexport type ImageColumnDefine = IImageColumnBodyDefine & HeaderDefine;\nexport type SparklineColumnDefine = ISparklineColumnBodyDefine & HeaderDefine;\nexport type ProgressbarColumnDefine = IProgressbarColumnBodyDefine & HeaderDefine;\nexport type CheckboxColumnDefine = ICheckboxColumnBodyDefine & HeaderDefine;\nexport type ChartColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type CompositeColumnDefine = ICompositeColumnBodyDefine & HeaderDefine;\n// export type GroupColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type GroupColumnDefine = HeaderDefine & {\n columns: ColumnsDefine;\n hideColumnsSubHeader?: boolean;\n};\nexport type ColumnDefine = Either<\n | LinkColumnDefine\n | ImageColumnDefine\n | SparklineColumnDefine\n | ProgressbarColumnDefine\n | CheckboxColumnDefine\n | ChartColumnDefine\n | TextColumnDefine\n | CompositeColumnDefine,\n GroupColumnDefine\n>;\n\n// export type ColumnDefine = HeaderDefine & ColumnBodyDefine;\n\nexport type ColumnsDefine = ColumnDefine[];\n"]}
@@ -10,7 +10,7 @@ export interface HeaderData extends WidthData {
10
10
  fieldKey?: FieldKeyDef;
11
11
  fieldFormat?: FieldFormat;
12
12
  style?: HeaderStyleOption | ColumnStyle | null | undefined;
13
- headerType: 'text' | 'link' | 'image' | 'video';
13
+ headerType: 'text' | 'link' | 'image' | 'video' | 'checkbox';
14
14
  define: ColumnDefine;
15
15
  dropDownMenu?: MenuListItem[];
16
16
  pivotInfo?: PivotInfo;
@@ -88,7 +88,7 @@ interface LayoutMapAPI {
88
88
  getCellRange: (col: number, row: number) => CellRange;
89
89
  getHeaderCellAdressById: (id: number) => CellAddress | undefined;
90
90
  getHeaderCellAddressByField: (field: string) => CellAddress | undefined;
91
- getRecordIndexByRow: (col: number, row: number) => number;
91
+ getRecordIndexByCell: (col: number, row: number) => number;
92
92
  getRecordStartRowByRecordIndex: (index: number) => number;
93
93
  getColumnWidthDefined: (col: number) => WidthData;
94
94
  release: () => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/list-table/layout-map/api.ts"],"names":[],"mappings":"","file":"api.js","sourcesContent":["import type {\n CellAddress,\n CellRange,\n ColumnIconOption,\n ColumnStyle,\n ColumnStyleOption,\n // ColumnTypeOption,\n FieldDef,\n FieldFormat,\n HeaderStyleOption,\n LayoutObjectId,\n MenuListItem,\n IPivotTableCellHeaderPaths,\n CellInfo,\n // ICustomRenderFuc,\n // ICustomRenderObj,\n PivotInfo,\n FieldKeyDef,\n CustomRenderFunctionArg,\n SparklineSpec,\n HierarchyState\n} from '../../';\n\nimport type { HeaderDefine, ColumnDefine, ColumnBodyDefine } from '../define';\n\n// todo: 修改引用这些类型的路径\nexport type {\n HeaderDefine,\n ColumnDefine,\n ColumnBodyDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine\n} from '../define';\n\n/**\n * layout中组织表头的信息类 和HeaderDefine对应\n */\nexport interface HeaderData extends WidthData {\n id: LayoutObjectId;\n title?: string | (() => string);\n // captionIcon?: ColumnIconOption;\n headerIcon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n icons?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);\n\n field: FieldDef;\n fieldKey?: FieldKeyDef;\n fieldFormat?: FieldFormat;\n style?: HeaderStyleOption | ColumnStyle | null | undefined;\n headerType: 'text' | 'link' | 'image' | 'video'; // headerType.BaseHeader;\n define: ColumnDefine;\n // sortIconPosition?: RectProps;\n // freezeIconPosition?: RectProps;\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n dropDownMenu?: MenuListItem[];\n pivotInfo?: PivotInfo;\n /**\n * 维度层级level 从0开始:第0层 第1层\n */\n hierarchyLevel?: number;\n /**\n * 维度总层级数\n */\n dimensionTotalLevel?: number;\n /**\n * 层级展开or折叠状态\n */\n hierarchyState?: HierarchyState;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n\n showSort?: boolean;\n\n /**\n * 表头描述 鼠标hover会提示该信息\n */\n description?: string | ((args: CellInfo) => string);\n\n // header内容为空\n isEmpty?: boolean;\n\n /** 记录当前表头节点的上级表头结点的cellId */\n parentCellId?: LayoutObjectId;\n}\n\nexport interface WidthData {\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n}\n/**\n * layout中组织body列的信息类 和ColumnDefine对应\n */\nexport interface ColumnData extends WidthData {\n id: LayoutObjectId;\n field: FieldDef;\n fieldKey?: FieldKeyDef;\n fieldFormat?: FieldFormat;\n // icon?: ColumnIconOption | ColumnIconOption[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart'; //BaseColumn<T, any>;\n /** 如果是绘制图表库组件的图表类型 需要将注入的组件名称 写到chartType */\n chartModule?: string;\n /** 如果是绘制图表库组件的图表类型 统一图表配置chartSpec */\n chartSpec?: any | ((arg0: CellInfo) => any);\n chartInstance?: any;\n sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);\n style: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n templateLink?: string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n}\n\nexport interface IndicatorData extends WidthData {\n id: LayoutObjectId;\n field: string | number;\n /**\n * 唯一标识一种指标\n */\n indicatorKey: string;\n // fieldKey: FieldKeyDef;\n fieldFormat?: FieldFormat;\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart'; //BaseColumn<T, any>;\n chartModule?: string;\n chartSpec?: any | ((arg0: CustomRenderFunctionArg) => any);\n chartInstance?: any;\n style?: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n // headerIcon?:\n // | (string | ColumnIconOption)[]\n // | ((args: CellInfo) => (string | ColumnIconOption)[]);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n sparklineSpec?: SparklineSpec | ((arg0: CustomRenderFunctionArg) => SparklineSpec);\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n}\n\n// Simple header\n\n// export interface GroupHeaderDefine extends HeaderDefine {\n// columns: HeadersDefine;\n// hideColumnsSubHeader?: boolean;\n// dropDownMenu?: MenuListItem[];\n// }\n// type Either<X, Y> =\n// | ({\n// [KX in keyof X]: X[KX];\n// } & {\n// [KY in Exclude<keyof Y, keyof X>]?: never;\n// })\n// | ({\n// [KY in keyof Y]: Y[KY];\n// } & {\n// [KX in Exclude<keyof X, keyof Y>]?: never;\n// });\n// export type HeaderColumnDefine = Either<GroupHeaderDefine, ColumnDefine>;\n// export type HeadersDefine = HeaderColumnDefine[];\n\n// Advanced layout\n\n// export interface HeaderCellDefine extends HeaderDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\nexport type HeaderCellDefine = HeaderDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\n// export interface CellDefine extends ColumnDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\n\nexport type CellDefine = ColumnBodyDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\nexport type ArrayLayoutDefine = CellDefine[][];\n/** @internal */\ninterface LayoutMapAPI {\n readonly headerLevelCount: number;\n readonly rowHeaderLevelCount: number;\n readonly columnHeaderLevelCount: number;\n readonly bodyRowCount: number;\n readonly colCount: number | undefined;\n readonly rowCount: number | undefined;\n readonly columnWidths: WidthData[];\n readonly headerObjects: HeaderData[];\n readonly columnObjects: ColumnData[] | IndicatorData[];\n // transpose: boolean;\n // showHeader: boolean;\n isHeader: (col: number, row: number) => boolean;\n // isHeaderNode(col: number, row: number): boolean; //是否为叶子表头\n /**获取单元格header对象 包括field style type 等 */\n getHeader: (col: number, row: number) => HeaderData;\n /**获取对应header的field */\n getHeaderField: (col: number, row: number) => FieldDef;\n // getHeaderFieldKey(col: number, row: number): FieldKeyDef;\n /**获取单元格column对象 包括field style type 等 */\n getBody: (col: number, row: number) => ColumnData | IndicatorData;\n /**获取单元格标识key */\n getCellId: (col: number, row: number) => LayoutObjectId;\n getCellRange: (col: number, row: number) => CellRange;\n // getCellRangeTranspose(col: number, row: number): CellRange;\n // getBodyLayoutRangeById: (id: LayoutObjectId) => CellRange;\n getHeaderCellAdressById: (id: number) => CellAddress | undefined;\n getHeaderCellAddressByField: (field: string) => CellAddress | undefined;\n getRecordIndexByRow: (col: number, row: number) => number;\n getRecordStartRowByRecordIndex: (index: number) => number;\n /** 从定义中获取一列配置项width的定义值 */\n getColumnWidthDefined: (col: number) => WidthData;\n release: () => void;\n\n isFrozenColumn: (col: number, row?: number) => boolean;\n isRightFrozenColumn: (col: number, row?: number) => boolean;\n isFrozenRow: (col: number, row?: number) => boolean;\n isBottomFrozenRow: (col: number, row?: number) => boolean;\n}\n\nexport type { LayoutMapAPI };\n"]}
1
+ {"version":3,"sources":["ts-types/list-table/layout-map/api.ts"],"names":[],"mappings":"","file":"api.js","sourcesContent":["import type {\n CellAddress,\n CellRange,\n ColumnIconOption,\n ColumnStyle,\n ColumnStyleOption,\n // ColumnTypeOption,\n FieldDef,\n FieldFormat,\n HeaderStyleOption,\n LayoutObjectId,\n MenuListItem,\n IPivotTableCellHeaderPaths,\n CellInfo,\n // ICustomRenderFuc,\n // ICustomRenderObj,\n PivotInfo,\n FieldKeyDef,\n CustomRenderFunctionArg,\n SparklineSpec,\n HierarchyState\n} from '../../';\n\nimport type { HeaderDefine, ColumnDefine, ColumnBodyDefine } from '../define';\n\n// todo: 修改引用这些类型的路径\nexport type {\n HeaderDefine,\n ColumnDefine,\n ColumnBodyDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine\n} from '../define';\n\n/**\n * layout中组织表头的信息类 和HeaderDefine对应\n */\nexport interface HeaderData extends WidthData {\n id: LayoutObjectId;\n title?: string | (() => string);\n // captionIcon?: ColumnIconOption;\n headerIcon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n icons?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);\n\n field: FieldDef;\n fieldKey?: FieldKeyDef;\n fieldFormat?: FieldFormat;\n style?: HeaderStyleOption | ColumnStyle | null | undefined;\n headerType: 'text' | 'link' | 'image' | 'video' | 'checkbox'; // headerType.BaseHeader;\n define: ColumnDefine;\n // sortIconPosition?: RectProps;\n // freezeIconPosition?: RectProps;\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n dropDownMenu?: MenuListItem[];\n pivotInfo?: PivotInfo;\n /**\n * 维度层级level 从0开始:第0层 第1层\n */\n hierarchyLevel?: number;\n /**\n * 维度总层级数\n */\n dimensionTotalLevel?: number;\n /**\n * 层级展开or折叠状态\n */\n hierarchyState?: HierarchyState;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n\n showSort?: boolean;\n\n /**\n * 表头描述 鼠标hover会提示该信息\n */\n description?: string | ((args: CellInfo) => string);\n\n // header内容为空\n isEmpty?: boolean;\n\n /** 记录当前表头节点的上级表头结点的cellId */\n parentCellId?: LayoutObjectId;\n}\n\nexport interface WidthData {\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n}\n/**\n * layout中组织body列的信息类 和ColumnDefine对应\n */\nexport interface ColumnData extends WidthData {\n id: LayoutObjectId;\n field: FieldDef;\n fieldKey?: FieldKeyDef;\n fieldFormat?: FieldFormat;\n // icon?: ColumnIconOption | ColumnIconOption[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart'; //BaseColumn<T, any>;\n /** 如果是绘制图表库组件的图表类型 需要将注入的组件名称 写到chartType */\n chartModule?: string;\n /** 如果是绘制图表库组件的图表类型 统一图表配置chartSpec */\n chartSpec?: any | ((arg0: CellInfo) => any);\n chartInstance?: any;\n sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);\n style: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n templateLink?: string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n}\n\nexport interface IndicatorData extends WidthData {\n id: LayoutObjectId;\n field: string | number;\n /**\n * 唯一标识一种指标\n */\n indicatorKey: string;\n // fieldKey: FieldKeyDef;\n fieldFormat?: FieldFormat;\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart'; //BaseColumn<T, any>;\n chartModule?: string;\n chartSpec?: any | ((arg0: CustomRenderFunctionArg) => any);\n chartInstance?: any;\n style?: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n // headerIcon?:\n // | (string | ColumnIconOption)[]\n // | ((args: CellInfo) => (string | ColumnIconOption)[]);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n sparklineSpec?: SparklineSpec | ((arg0: CustomRenderFunctionArg) => SparklineSpec);\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n}\n\n// Simple header\n\n// export interface GroupHeaderDefine extends HeaderDefine {\n// columns: HeadersDefine;\n// hideColumnsSubHeader?: boolean;\n// dropDownMenu?: MenuListItem[];\n// }\n// type Either<X, Y> =\n// | ({\n// [KX in keyof X]: X[KX];\n// } & {\n// [KY in Exclude<keyof Y, keyof X>]?: never;\n// })\n// | ({\n// [KY in keyof Y]: Y[KY];\n// } & {\n// [KX in Exclude<keyof X, keyof Y>]?: never;\n// });\n// export type HeaderColumnDefine = Either<GroupHeaderDefine, ColumnDefine>;\n// export type HeadersDefine = HeaderColumnDefine[];\n\n// Advanced layout\n\n// export interface HeaderCellDefine extends HeaderDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\nexport type HeaderCellDefine = HeaderDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\n// export interface CellDefine extends ColumnDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\n\nexport type CellDefine = ColumnBodyDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\nexport type ArrayLayoutDefine = CellDefine[][];\n/** @internal */\ninterface LayoutMapAPI {\n readonly headerLevelCount: number;\n readonly rowHeaderLevelCount: number;\n readonly columnHeaderLevelCount: number;\n readonly bodyRowCount: number;\n readonly colCount: number | undefined;\n readonly rowCount: number | undefined;\n readonly columnWidths: WidthData[];\n readonly headerObjects: HeaderData[];\n readonly columnObjects: ColumnData[] | IndicatorData[];\n // transpose: boolean;\n // showHeader: boolean;\n isHeader: (col: number, row: number) => boolean;\n // isHeaderNode(col: number, row: number): boolean; //是否为叶子表头\n /**获取单元格header对象 包括field style type 等 */\n getHeader: (col: number, row: number) => HeaderData;\n /**获取对应header的field */\n getHeaderField: (col: number, row: number) => FieldDef;\n // getHeaderFieldKey(col: number, row: number): FieldKeyDef;\n /**获取单元格column对象 包括field style type 等 */\n getBody: (col: number, row: number) => ColumnData | IndicatorData;\n /**获取单元格标识key */\n getCellId: (col: number, row: number) => LayoutObjectId;\n getCellRange: (col: number, row: number) => CellRange;\n // getCellRangeTranspose(col: number, row: number): CellRange;\n // getBodyLayoutRangeById: (id: LayoutObjectId) => CellRange;\n getHeaderCellAdressById: (id: number) => CellAddress | undefined;\n getHeaderCellAddressByField: (field: string) => CellAddress | undefined;\n getRecordIndexByCell: (col: number, row: number) => number;\n getRecordStartRowByRecordIndex: (index: number) => number;\n /** 从定义中获取一列配置项width的定义值 */\n getColumnWidthDefined: (col: number) => WidthData;\n release: () => void;\n\n isFrozenColumn: (col: number, row?: number) => boolean;\n isRightFrozenColumn: (col: number, row?: number) => boolean;\n isFrozenRow: (col: number, row?: number) => boolean;\n isBottomFrozenRow: (col: number, row?: number) => boolean;\n}\n\nexport type { LayoutMapAPI };\n"]}
@@ -20,7 +20,7 @@ export interface CellRange {
20
20
  start: CellAddress;
21
21
  end: CellAddress;
22
22
  }
23
- export type FieldGetter = (record: any) => any;
23
+ export type FieldGetter = (record: any, col?: number, row?: number, table?: BaseTableAPI) => any;
24
24
  export type FieldSetter = (record: any, value: any) => void;
25
25
  export interface FieldAssessor {
26
26
  get: FieldGetter;
@@ -42,7 +42,7 @@ export interface DataSourceAPI {
42
42
  clearCurrentIndexedData: () => void;
43
43
  length: number;
44
44
  get: (index: number) => MaybePromiseOrUndefined;
45
- getField: <F extends FieldDef>(index: number, field: F) => FieldData;
45
+ getField: <F extends FieldDef>(index: number, field: F, col: number, row: number, table: BaseTableAPI) => FieldData;
46
46
  hasField: (index: number, field: FieldDef) => boolean;
47
47
  sort: (field: FieldDef, order: SortOrder, orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1) => void;
48
48
  clearSortedMap: () => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["ts-types/table-engine.ts"],"names":[],"mappings":"AA2TA,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 } 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 } from './base-table';\nimport type { IDataConfig } from './new-data-set';\nimport type { Either } from '../tools/helper';\nimport type { IChartIndicator, ICornerDefine, IDimension, IIndicator, ITitleDefine } from './pivot-table';\nimport type { ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\n\nexport interface CellAddress {\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) => 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';\nexport type CellLocation = 'body' | 'rowHeader' | 'columnHeader' | 'cornerHeader' | 'bottomFrozen' | 'rightFrozen';\n\nexport interface TableKeyboardOptions {\n // moveCellOnTab?: boolean;\n // moveCellOnEnter?: boolean;\n // deleteCellValueOnDel?: boolean;\n\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean;\n /** 快捷键复制 默认不开启*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n}\nexport interface DataSourceAPI {\n clearCurrentIndexedData: () => void;\n length: number;\n get: (index: number) => MaybePromiseOrUndefined;\n getField: <F extends FieldDef>(index: number, field: F) => 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 enableHierarchyState: boolean;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\n\n fieldKey?: FieldKeyDef;\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 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}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n sortState: SortState[] | SortState | null;\n // internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\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?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | 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?: IDataConfig;\n /**\n * 透视表是否开启数据分析\n * 如果传入数据是明细数据需要聚合分析则开启\n * 如传入数据是经过聚合好的为了提升性能这里设置为false,同时需要传入columnTree和rowTree\n */\n enableDataAnalysis?: boolean;\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\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?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | 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 // 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}\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: (IDimension | string)[];\n rowTree: IHeaderTreeDefine[] | ((args: { dimensionKey: string | number; value: string }[]) => IHeaderTreeDefine[]);\n}\n"]}
1
+ {"version":3,"sources":["ts-types/table-engine.ts"],"names":[],"mappings":"AA2TA,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 } 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 } from './base-table';\nimport type { IDataConfig } from './new-data-set';\nimport type { Either } from '../tools/helper';\nimport type { IChartIndicator, ICornerDefine, IDimension, IIndicator, ITitleDefine } from './pivot-table';\nimport type { ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\n\nexport interface CellAddress {\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';\nexport type CellLocation = 'body' | 'rowHeader' | 'columnHeader' | 'cornerHeader' | 'bottomFrozen' | 'rightFrozen';\n\nexport interface TableKeyboardOptions {\n // moveCellOnTab?: boolean;\n // moveCellOnEnter?: boolean;\n // deleteCellValueOnDel?: boolean;\n\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean;\n /** 快捷键复制 默认不开启*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\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 enableHierarchyState: boolean;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\n\n fieldKey?: FieldKeyDef;\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 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}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n sortState: SortState[] | SortState | null;\n // internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\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?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | 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?: IDataConfig;\n /**\n * 透视表是否开启数据分析\n * 如果传入数据是明细数据需要聚合分析则开启\n * 如传入数据是经过聚合好的为了提升性能这里设置为false,同时需要传入columnTree和rowTree\n */\n enableDataAnalysis?: boolean;\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\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?: (IDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IDimension | 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 // 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}\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: (IDimension | string)[];\n rowTree: IHeaderTreeDefine[] | ((args: { dimensionKey: string | number; value: string }[]) => IHeaderTreeDefine[]);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vtable",
3
- "version": "0.13.1-alpha.0",
3
+ "version": "0.13.1",
4
4
  "description": "canvas table width high performance",
5
5
  "keywords": [
6
6
  "grid",
@@ -35,8 +35,8 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@visactor/vrender": "0.16.2",
39
- "@visactor/vrender-components": "0.16.2",
38
+ "@visactor/vrender": "0.16.9-alpha.1",
39
+ "@visactor/vrender-components": "0.16.9-alpha.1",
40
40
  "@visactor/vutils-extension": "1.5.1-alpha.0",
41
41
  "@visactor/vutils": "0.16.1",
42
42
  "@visactor/vscale": "0.16.0",
@@ -44,7 +44,7 @@
44
44
  "cssfontparser": "^1.2.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@visactor/vchart": "1.4.3",
47
+ "@visactor/vchart": "1.5.3",
48
48
  "@rushstack/eslint-patch": "~1.1.4",
49
49
  "react": "^18.0.0",
50
50
  "react-dom": "^18.0.0",
@@ -88,11 +88,13 @@
88
88
  "d3-geo": "^3.0.1",
89
89
  "d3-hexbin": "^0.2.2",
90
90
  "d3-hierarchy": "^3.1.1",
91
- "canvas": "^2.11.2",
92
91
  "@resvg/resvg-js": "^2.5.0",
92
+ "@internal/ts-config": "0.0.1",
93
93
  "@internal/bundler": "0.0.1",
94
- "@internal/eslint-config": "0.0.1",
95
- "@internal/ts-config": "0.0.1"
94
+ "@internal/eslint-config": "0.0.1"
95
+ },
96
+ "peerDependencies": {
97
+ "canvas": "^2.11.2"
96
98
  },
97
99
  "unpkg": "latest",
98
100
  "unpkgFiles": [