@visactor/vtable 0.17.5-alpha.2 → 0.17.5

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 (69) hide show
  1. package/cjs/ListTable.js +8 -6
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/core/BaseTable.js +1 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/edit/edit-manager.js +6 -4
  6. package/cjs/edit/edit-manager.js.map +1 -1
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/layout/simple-header-layout.d.ts +1 -0
  11. package/cjs/layout/simple-header-layout.js +4 -0
  12. package/cjs/layout/simple-header-layout.js.map +1 -1
  13. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +15 -0
  14. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +58 -3
  15. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  16. package/cjs/scenegraph/graphic/contributions/index.js +5 -1
  17. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  18. package/cjs/scenegraph/graphic/group.js +3 -1
  19. package/cjs/scenegraph/graphic/group.js.map +1 -1
  20. package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
  21. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  22. package/cjs/scenegraph/group-creater/init-scenegraph.js +11 -11
  23. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  24. package/cjs/scenegraph/group-creater/progress/proxy.js +4 -4
  25. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  26. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -1
  27. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  28. package/cjs/themes/BRIGHT.js +1 -2
  29. package/cjs/themes/DARK.js +2 -1
  30. package/cjs/ts-types/list-table/define/basic-define.d.ts +3 -0
  31. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  32. package/cjs/ts-types/table-engine.d.ts +3 -0
  33. package/cjs/ts-types/table-engine.js.map +1 -1
  34. package/dist/vtable.js +179 -35
  35. package/dist/vtable.min.js +2 -2
  36. package/es/ListTable.js +8 -6
  37. package/es/ListTable.js.map +1 -1
  38. package/es/core/BaseTable.js +1 -1
  39. package/es/core/BaseTable.js.map +1 -1
  40. package/es/edit/edit-manager.js +6 -4
  41. package/es/edit/edit-manager.js.map +1 -1
  42. package/es/index.d.ts +1 -1
  43. package/es/index.js +1 -1
  44. package/es/index.js.map +1 -1
  45. package/es/layout/simple-header-layout.d.ts +1 -0
  46. package/es/layout/simple-header-layout.js +4 -0
  47. package/es/layout/simple-header-layout.js.map +1 -1
  48. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +15 -0
  49. package/es/scenegraph/graphic/contributions/group-contribution-render.js +55 -0
  50. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  51. package/es/scenegraph/graphic/contributions/index.js +4 -2
  52. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  53. package/es/scenegraph/graphic/group.js +3 -1
  54. package/es/scenegraph/graphic/group.js.map +1 -1
  55. package/es/scenegraph/group-creater/cell-helper.js +1 -1
  56. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  57. package/es/scenegraph/group-creater/init-scenegraph.js +11 -11
  58. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  59. package/es/scenegraph/group-creater/progress/proxy.js +4 -4
  60. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  61. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -1
  62. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  63. package/es/themes/BRIGHT.js +1 -2
  64. package/es/themes/DARK.js +2 -1
  65. package/es/ts-types/list-table/define/basic-define.d.ts +3 -0
  66. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  67. package/es/ts-types/table-engine.d.ts +3 -0
  68. package/es/ts-types/table-engine.js.map +1 -1
  69. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":";;;AA8WA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,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 } from './base-table';\nimport type { IDataConfig } 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';\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';\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}\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 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 /** 全局设置编辑器 */\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 编辑触发时机 双击事件 单击事件 api手动开启编辑。默认为双击'doubleclick' */\n editCellTrigger?: 'doubleclick' | 'click' | 'api';\n}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\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 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}\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?: IDataConfig;\n /**\n * 透视表是否开启数据分析 默认false\n * 如果传入数据是明细数据需要聚合分析则开启 赋值为true\n * 如传入数据是经过聚合好的为了提升性能这里设为false即可,同时呢需要传入自己组织好的行头树结构columnTree和rowTree\n */\n enableDataAnalysis?: boolean;\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}\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};\n"]}
1
+ {"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":";;;AAgXA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,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 } from './base-table';\nimport type { IDataConfig } 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';\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';\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}\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 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 /** 全局设置表头编辑器 */\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}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\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 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}\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?: IDataConfig;\n /**\n * 透视表是否开启数据分析 默认false\n * 如果传入数据是明细数据需要聚合分析则开启 赋值为true\n * 如传入数据是经过聚合好的为了提升性能这里设为false即可,同时呢需要传入自己组织好的行头树结构columnTree和rowTree\n */\n enableDataAnalysis?: boolean;\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}\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};\n"]}
package/dist/vtable.js CHANGED
@@ -49414,6 +49414,20 @@
49414
49414
  this.clearUpdateBoundTag();
49415
49415
  return this._AABBBounds;
49416
49416
  }
49417
+ else if (this.role === 'body' ||
49418
+ this.role === 'row-header' ||
49419
+ this.role === 'col-header' ||
49420
+ this.role === 'right-frozen' ||
49421
+ this.role === 'bottom-frozen' ||
49422
+ this.role === 'corner-header' ||
49423
+ this.role === 'corner-right-top-header' ||
49424
+ this.role === 'corner-right-bottom-header' ||
49425
+ this.role === 'corner-left-bottom-header') {
49426
+ this._AABBBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
49427
+ this.parent && this.parent.addChildUpdateBoundTag();
49428
+ this.clearUpdateBoundTag();
49429
+ return this._AABBBounds;
49430
+ }
49417
49431
  return super.doUpdateAABBBounds();
49418
49432
  }
49419
49433
  updateColumnRowNumber(row) {
@@ -51724,7 +51738,9 @@
51724
51738
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
51725
51739
  value = customMergeText;
51726
51740
  customStyle = customMergeStyle;
51727
- cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;
51741
+ if (customStyle) {
51742
+ cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;
51743
+ }
51728
51744
  }
51729
51745
  }
51730
51746
  let newCellGroup;
@@ -55643,6 +55659,100 @@
55643
55659
  AdjustColorGroupAfterRenderContribution = __decorate([
55644
55660
  injectable$1()
55645
55661
  ], AdjustColorGroupAfterRenderContribution);
55662
+ let ClipBodyGroupBeforeRenderContribution = class ClipBodyGroupBeforeRenderContribution {
55663
+ time = BaseRenderContributionTime$1.beforeFillStroke;
55664
+ useStyle = true;
55665
+ order = 0;
55666
+ drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
55667
+ const table = group.stage.table;
55668
+ if (group.role === 'body') {
55669
+ const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();
55670
+ const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();
55671
+ const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();
55672
+ const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
55673
+ context.beginPath();
55674
+ context.rect(x, y, width, height);
55675
+ }
55676
+ else if (group.role === 'row-header') {
55677
+ const x = 0;
55678
+ const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();
55679
+ const width = table.getFrozenColsWidth();
55680
+ const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
55681
+ context.beginPath();
55682
+ context.rect(x, y, width, height);
55683
+ }
55684
+ else if (group.role === 'col-header') {
55685
+ const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();
55686
+ const y = 0;
55687
+ const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();
55688
+ const height = table.getFrozenRowsHeight();
55689
+ context.beginPath();
55690
+ context.rect(x, y, width, height);
55691
+ }
55692
+ else if (group.role === 'right-frozen') {
55693
+ const x = 0;
55694
+ const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();
55695
+ const width = table.getRightFrozenColsWidth();
55696
+ const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
55697
+ context.beginPath();
55698
+ context.rect(x, y, width, height);
55699
+ }
55700
+ else if (group.role === 'bottom-frozen') {
55701
+ const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();
55702
+ const y = 0;
55703
+ const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();
55704
+ const height = table.getBottomFrozenRowsHeight();
55705
+ context.beginPath();
55706
+ context.rect(x, y, width, height);
55707
+ }
55708
+ else if (group.role === 'corner-header') {
55709
+ const x = 0;
55710
+ const y = 0;
55711
+ const width = table.getFrozenColsWidth();
55712
+ const height = table.getFrozenRowsHeight();
55713
+ context.beginPath();
55714
+ context.rect(x, y, width, height);
55715
+ }
55716
+ else if (group.role === 'corner-right-top-header') {
55717
+ const x = 0;
55718
+ const y = 0;
55719
+ const width = table.getRightFrozenColsWidth();
55720
+ const height = table.getFrozenRowsHeight();
55721
+ context.beginPath();
55722
+ context.rect(x, y, width, height);
55723
+ }
55724
+ else if (group.role === 'corner-right-bottom-header') {
55725
+ const x = 0;
55726
+ const y = 0;
55727
+ const width = table.getRightFrozenColsWidth();
55728
+ const height = table.getBottomFrozenRowsHeight();
55729
+ context.beginPath();
55730
+ context.rect(x, y, width, height);
55731
+ }
55732
+ else if (group.role === 'corner-left-bottom-header') {
55733
+ const x = 0;
55734
+ const y = 0;
55735
+ const width = table.getFrozenColsWidth();
55736
+ const height = table.getBottomFrozenRowsHeight();
55737
+ context.beginPath();
55738
+ context.rect(x, y, width, height);
55739
+ }
55740
+ }
55741
+ };
55742
+ ClipBodyGroupBeforeRenderContribution = __decorate([
55743
+ injectable$1()
55744
+ ], ClipBodyGroupBeforeRenderContribution);
55745
+ let ClipBodyGroupAfterRenderContribution = class ClipBodyGroupAfterRenderContribution {
55746
+ time = BaseRenderContributionTime$1.afterFillStroke;
55747
+ useStyle = true;
55748
+ order = 0;
55749
+ drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
55750
+ if (group.role === 'body') ;
55751
+ }
55752
+ };
55753
+ ClipBodyGroupAfterRenderContribution = __decorate([
55754
+ injectable$1()
55755
+ ], ClipBodyGroupAfterRenderContribution);
55646
55756
  function getCellSizeForDraw(group, width, height) {
55647
55757
  const table = group.stage.table;
55648
55758
  if (group.role === 'cell') {
@@ -55752,6 +55862,10 @@
55752
55862
  bind(GroupRenderContribution$1).toService(AdjustPosGroupBeforeRenderContribution);
55753
55863
  bind(AdjustPosGroupAfterRenderContribution).toSelf().inSingletonScope();
55754
55864
  bind(GroupRenderContribution$1).toService(AdjustPosGroupAfterRenderContribution);
55865
+ bind(ClipBodyGroupBeforeRenderContribution).toSelf().inSingletonScope();
55866
+ bind(GroupRenderContribution$1).toService(ClipBodyGroupBeforeRenderContribution);
55867
+ bind(ClipBodyGroupAfterRenderContribution).toSelf().inSingletonScope();
55868
+ bind(GroupRenderContribution$1).toService(ClipBodyGroupAfterRenderContribution);
55755
55869
  });
55756
55870
 
55757
55871
  function computeColsWidth(table, colStart, colEnd, update) {
@@ -56720,15 +56834,17 @@
56720
56834
  }
56721
56835
  }
56722
56836
  function updateCellGroupPosition(colGroup, direction, proxy) {
56723
- if (direction === 'up') {
56724
- const cellGroup = colGroup.firstChild;
56725
- proxy.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + proxy.table.getRowHeight(colGroup.lastChild.row));
56726
- colGroup.appendChild(cellGroup);
56727
- }
56728
- else {
56729
- const cellGroup = colGroup.lastChild;
56730
- proxy.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - proxy.table.getRowHeight(cellGroup.row));
56731
- colGroup.insertBefore(cellGroup, colGroup.firstChild);
56837
+ if (colGroup.childrenCount >= 1) {
56838
+ if (direction === 'up') {
56839
+ const cellGroup = colGroup.firstChild;
56840
+ proxy.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + proxy.table.getRowHeight(colGroup.lastChild.row));
56841
+ colGroup.appendChild(cellGroup);
56842
+ }
56843
+ else {
56844
+ const cellGroup = colGroup.lastChild;
56845
+ proxy.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - proxy.table.getRowHeight(cellGroup.row));
56846
+ colGroup.insertBefore(cellGroup, colGroup.firstChild);
56847
+ }
56732
56848
  }
56733
56849
  }
56734
56850
  function updateAllRowPosition(distStartRowY, count, direction, proxy) {
@@ -57095,7 +57211,7 @@
57095
57211
  this.table.scenegraph.updateBorderSizeAndPosition();
57096
57212
  }
57097
57213
  async setY(y) {
57098
- const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + this.totalActualBodyRowCount) / 2;
57214
+ const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + (this.rowEnd - this.rowStart + 1)) / 2;
57099
57215
  const yLimitBottom = this.table.getAllRowsHeight() - yLimitTop;
57100
57216
  if (y < yLimitTop && this.rowStart === this.bodyTopRow) {
57101
57217
  this.table.scenegraph.setBodyAndRowHeaderY(-y);
@@ -57103,12 +57219,16 @@
57103
57219
  else if (y > yLimitBottom && this.rowEnd === this.bodyBottomRow) {
57104
57220
  this.table.scenegraph.setBodyAndRowHeaderY(-y);
57105
57221
  }
57222
+ else if (!this.table.scenegraph.bodyGroup.firstChild ||
57223
+ this.table.scenegraph.bodyGroup.firstChild.childrenCount === 0) {
57224
+ this.table.scenegraph.setBodyAndRowHeaderY(-y);
57225
+ }
57106
57226
  else {
57107
57227
  this.dynamicSetY(y);
57108
57228
  }
57109
57229
  }
57110
57230
  async setX(x) {
57111
- const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + this.totalActualBodyColCount) / 2;
57231
+ const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + (this.colEnd - this.colStart + 1)) / 2;
57112
57232
  const xLimitRight = this.table.getAllColsWidth() - xLimitLeft;
57113
57233
  if (x < xLimitLeft && this.colStart === this.bodyLeftCol) {
57114
57234
  this.table.scenegraph.setBodyAndColHeaderX(-x);
@@ -57116,6 +57236,10 @@
57116
57236
  else if (x > xLimitRight && this.colEnd === this.bodyRightCol) {
57117
57237
  this.table.scenegraph.setBodyAndColHeaderX(-x);
57118
57238
  }
57239
+ else if (this.table.scenegraph.bodyGroup.firstChild &&
57240
+ this.table.scenegraph.bodyGroup.firstChild.childrenCount === 0) {
57241
+ this.table.scenegraph.setBodyAndColHeaderX(-x);
57242
+ }
57119
57243
  else {
57120
57244
  this.dynamicSetX(x);
57121
57245
  }
@@ -58772,34 +58896,34 @@
58772
58896
  const height = scene.table.tableNoFrameHeight;
58773
58897
  scene.tableGroup = new Group$1({ x: 0, y: 0, width, height, clip: true, pickable: false });
58774
58898
  scene.tableGroup.role = 'table';
58775
- const colHeaderGroup = createContainerGroup(0, 0);
58899
+ const colHeaderGroup = createContainerGroup(0, 0, true);
58776
58900
  colHeaderGroup.role = 'col-header';
58777
58901
  scene.colHeaderGroup = colHeaderGroup;
58778
- const cornerHeaderGroup = createContainerGroup(0, 0);
58902
+ const cornerHeaderGroup = createContainerGroup(0, 0, true);
58779
58903
  cornerHeaderGroup.role = 'corner-header';
58780
58904
  scene.cornerHeaderGroup = cornerHeaderGroup;
58781
- const rowHeaderGroup = createContainerGroup(0, 0);
58905
+ const rowHeaderGroup = createContainerGroup(0, 0, true);
58782
58906
  rowHeaderGroup.role = 'row-header';
58783
58907
  scene.rowHeaderGroup = rowHeaderGroup;
58784
- const bodyGroup = createContainerGroup(width, 0);
58908
+ const bodyGroup = createContainerGroup(width, 0, true);
58785
58909
  bodyGroup.role = 'body';
58786
58910
  scene.bodyGroup = bodyGroup;
58787
- const rightFrozenGroup = createContainerGroup(0, 0);
58911
+ const rightFrozenGroup = createContainerGroup(0, 0, true);
58788
58912
  rightFrozenGroup.role = 'right-frozen';
58789
58913
  scene.rightFrozenGroup = rightFrozenGroup;
58790
- const bottomFrozenGroup = createContainerGroup(0, 0);
58914
+ const bottomFrozenGroup = createContainerGroup(0, 0, true);
58791
58915
  bottomFrozenGroup.role = 'bottom-frozen';
58792
58916
  scene.bottomFrozenGroup = bottomFrozenGroup;
58793
58917
  const componentGroup = createContainerGroup(0, 0);
58794
58918
  componentGroup.role = 'component';
58795
58919
  scene.componentGroup = componentGroup;
58796
- const rightTopCornerGroup = createContainerGroup(0, 0);
58920
+ const rightTopCornerGroup = createContainerGroup(0, 0, true);
58797
58921
  rightTopCornerGroup.role = 'corner-right-top-header';
58798
58922
  scene.rightTopCornerGroup = rightTopCornerGroup;
58799
- const rightBottomCornerGroup = createContainerGroup(0, 0);
58923
+ const rightBottomCornerGroup = createContainerGroup(0, 0, true);
58800
58924
  rightBottomCornerGroup.role = 'corner-right-bottom-header';
58801
58925
  scene.rightBottomCornerGroup = rightBottomCornerGroup;
58802
- const leftBottomCornerGroup = createContainerGroup(0, 0);
58926
+ const leftBottomCornerGroup = createContainerGroup(0, 0, true);
58803
58927
  leftBottomCornerGroup.role = 'corner-left-bottom-header';
58804
58928
  scene.leftBottomCornerGroup = leftBottomCornerGroup;
58805
58929
  scene.tableGroup.addChild(bodyGroup);
@@ -58813,13 +58937,13 @@
58813
58937
  scene.tableGroup.addChild(cornerHeaderGroup);
58814
58938
  scene.tableGroup.addChild(componentGroup);
58815
58939
  }
58816
- function createContainerGroup(width, height) {
58940
+ function createContainerGroup(width, height, clip) {
58817
58941
  return new Group$1({
58818
58942
  x: 0,
58819
58943
  y: 0,
58820
58944
  width,
58821
58945
  height,
58822
- clip: false,
58946
+ clip: clip ?? false,
58823
58947
  pickable: false
58824
58948
  });
58825
58949
  }
@@ -66823,7 +66947,7 @@
66823
66947
  return TABLE_EVENT_TYPE;
66824
66948
  }
66825
66949
  options;
66826
- version = "0.17.5-alpha.2";
66950
+ version = "0.17.5";
66827
66951
  pagination;
66828
66952
  id = `VTable${Date.now()}`;
66829
66953
  headerStyleCache;
@@ -70259,6 +70383,11 @@
70259
70383
  clearCellRangeMap() {
70260
70384
  this._cellRangeMap.clear();
70261
70385
  }
70386
+ updateColumnTitle(col, row, title) {
70387
+ const define = this._table.internalProps.layoutMap.getHeader(col, row);
70388
+ define.title = title;
70389
+ define.define.title = title;
70390
+ }
70262
70391
  }
70263
70392
 
70264
70393
  class Title {
@@ -70430,7 +70559,7 @@
70430
70559
  });
70431
70560
  }
70432
70561
  startEditCell(col, row) {
70433
- if (this.table.isHeader(col, row)) {
70562
+ if (this.table.isPivotTable() && this.table.isHeader(col, row)) {
70434
70563
  return;
70435
70564
  }
70436
70565
  const editor = this.table.getEditor(col, row);
@@ -70438,10 +70567,12 @@
70438
70567
  if (this.table.getCustomRender(col, row) || this.table.getCustomLayout(col, row)) {
70439
70568
  return;
70440
70569
  }
70441
- const range = this.table.getCellRange(col, row);
70442
- const isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
70443
- if (isMerge) {
70444
- return;
70570
+ if (!this.table.isHeader(col, row)) {
70571
+ const range = this.table.getCellRange(col, row);
70572
+ const isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
70573
+ if (isMerge) {
70574
+ return;
70575
+ }
70445
70576
  }
70446
70577
  editor.bindSuccessCallback?.(() => {
70447
70578
  this.completeEdit();
@@ -70449,7 +70580,7 @@
70449
70580
  this.editingEditor = editor;
70450
70581
  this.editCell = { col, row };
70451
70582
  const dataValue = this.table.getCellOriginValue(col, row);
70452
- const rect = this.table.getCellRelativeRect(col, row);
70583
+ const rect = this.table.getCellRangeRelativeRect(this.table.getCellRange(col, row));
70453
70584
  editor.beginEditing(this.table.getElement(), { rect: { left: rect.left, top: rect.top, width: rect.width, height: rect.height } }, dataValue);
70454
70585
  }
70455
70586
  }
@@ -71113,7 +71244,9 @@
71113
71244
  }
71114
71245
  getEditor(col, row) {
71115
71246
  const define = this.getBodyColumnDefine(col, row);
71116
- let editorDefine = define?.editor ?? this.options.editor;
71247
+ let editorDefine = this.isHeader(col, row)
71248
+ ? define?.headerEditor ?? this.options.headerEditor
71249
+ : define?.editor ?? this.options.editor;
71117
71250
  if (typeof editorDefine === 'function') {
71118
71251
  const arg = {
71119
71252
  col,
@@ -71132,8 +71265,19 @@
71132
71265
  changeCellValue(col, row, value) {
71133
71266
  const recordIndex = this.getRecordShowIndexByCell(col, row);
71134
71267
  const { field } = this.internalProps.layoutMap.getBody(col, row);
71135
- this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
71136
- this.scenegraph.updateCellContent(col, row);
71268
+ const beforeChangeValue = this.getCellRawValue(col, row);
71269
+ if (this.isHeader(col, row)) {
71270
+ this.internalProps.layoutMap.updateColumnTitle(col, row, value);
71271
+ }
71272
+ else {
71273
+ this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
71274
+ }
71275
+ const range = this.getCellRange(col, row);
71276
+ for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {
71277
+ for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {
71278
+ this.scenegraph.updateCellContent(sCol, sRow);
71279
+ }
71280
+ }
71137
71281
  if (this.widthMode === 'adaptive' || (this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth)) {
71138
71282
  if (this.internalProps._widthResizedColMap.size === 0) {
71139
71283
  this.scenegraph.recalculateColWidths();
@@ -71157,7 +71301,7 @@
71157
71301
  this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
71158
71302
  col,
71159
71303
  row,
71160
- rawValue: this.getCellRawValue(col, row),
71304
+ rawValue: beforeChangeValue,
71161
71305
  changedValue: this.getCellOriginValue(col, row)
71162
71306
  });
71163
71307
  this.scenegraph.updateNextFrame();
@@ -77546,7 +77690,7 @@
77546
77690
  return new Tag$1(params ? params.attribute : {});
77547
77691
  }
77548
77692
 
77549
- const version = "0.17.5-alpha.2";
77693
+ const version = "0.17.5";
77550
77694
  function getIcons() {
77551
77695
  return get$2();
77552
77696
  }