@visactor/vtable 0.15.4-alpha.0 → 0.15.4

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 (67) hide show
  1. package/cjs/ListTable.js +11 -6
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +24 -20
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.js +8 -5
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/event/media-click.js +2 -1
  8. package/cjs/event/scroll.js +0 -1
  9. package/cjs/index.d.ts +1 -1
  10. package/cjs/index.js +1 -1
  11. package/cjs/index.js.map +1 -1
  12. package/cjs/layout/pivot-header-layout.d.ts +3 -3
  13. package/cjs/layout/pivot-header-layout.js +6 -7
  14. package/cjs/layout/pivot-header-layout.js.map +1 -1
  15. package/cjs/scenegraph/layout/compute-col-width.js +16 -13
  16. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  17. package/cjs/scenegraph/layout/compute-row-height.js +12 -9
  18. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  19. package/cjs/state/hover/is-cell-hover.js +2 -2
  20. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  21. package/cjs/themes/theme.js +5 -5
  22. package/cjs/themes/theme.js.map +1 -1
  23. package/cjs/tools/Rect.js +1 -1
  24. package/cjs/ts-types/base-table.d.ts +5 -5
  25. package/cjs/ts-types/base-table.js.map +1 -1
  26. package/cjs/ts-types/pivot-table/dimension/index.d.ts +3 -1
  27. package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -1
  28. package/cjs/ts-types/table-engine.d.ts +6 -6
  29. package/cjs/ts-types/table-engine.js.map +1 -1
  30. package/dist/vtable.js +95 -31
  31. package/dist/vtable.min.js +2 -2
  32. package/es/ListTable.js +14 -9
  33. package/es/ListTable.js.map +1 -1
  34. package/es/PivotTable.js +24 -20
  35. package/es/PivotTable.js.map +1 -1
  36. package/es/core/BaseTable.js +8 -5
  37. package/es/core/BaseTable.js.map +1 -1
  38. package/es/event/media-click.js +2 -1
  39. package/es/event/scroll.js +1 -2
  40. package/es/index.d.ts +1 -1
  41. package/es/index.js +1 -1
  42. package/es/index.js.map +1 -1
  43. package/es/layout/pivot-header-layout.d.ts +3 -3
  44. package/es/layout/pivot-header-layout.js +6 -7
  45. package/es/layout/pivot-header-layout.js.map +1 -1
  46. package/es/scenegraph/layout/compute-col-width.js +16 -13
  47. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  48. package/es/scenegraph/layout/compute-row-height.js +12 -9
  49. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  50. package/es/state/hover/is-cell-hover.js +2 -2
  51. package/es/state/hover/is-cell-hover.js.map +1 -1
  52. package/es/themes/theme.js +5 -5
  53. package/es/themes/theme.js.map +1 -1
  54. package/es/tools/Rect.js +1 -1
  55. package/es/ts-types/base-table.d.ts +5 -5
  56. package/es/ts-types/base-table.js.map +1 -1
  57. package/es/ts-types/pivot-table/dimension/index.d.ts +3 -1
  58. package/es/ts-types/pivot-table/dimension/index.js.map +1 -1
  59. package/es/ts-types/table-engine.d.ts +6 -6
  60. package/es/ts-types/table-engine.js.map +1 -1
  61. package/package.json +3 -3
  62. package/cjs/event/VChartEventProxy.d.ts +0 -1
  63. package/cjs/event/VChartEventProxy.js +0 -1
  64. package/cjs/event/VChartEventProxy.js.map +0 -1
  65. package/es/event/VChartEventProxy.d.ts +0 -1
  66. package/es/event/VChartEventProxy.js +0 -1
  67. package/es/event/VChartEventProxy.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":";;;AA8VA,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 { IChartIndicator, ICornerDefine, IDimension, IIndicator, ITitleDefine } 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';\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 // 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 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 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}\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 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?: (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\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":";;;AAsWA,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';\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 // 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 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 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}\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 * 透视表是否开启数据分析\n * 如果传入数据是明细数据需要聚合分析则开启\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 // 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
@@ -4351,7 +4351,7 @@
4351
4351
  get cornerRightTopCellStyle() {
4352
4352
  if (!this._cornerRightTopCell) {
4353
4353
  const { obj, superTheme } = this.internalTheme;
4354
- if (!superTheme.cornerRightTopCellStyle || !obj.cornerRightTopCellStyle) {
4354
+ if (!superTheme.cornerRightTopCellStyle && !obj.cornerRightTopCellStyle) {
4355
4355
  return this._cornerRightTopCell;
4356
4356
  }
4357
4357
  const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.cornerRightTopCellStyle, obj.cornerRightTopCellStyle);
@@ -4362,7 +4362,7 @@
4362
4362
  get cornerLeftBottomCellStyle() {
4363
4363
  if (!this._cornerLeftBottomCell) {
4364
4364
  const { obj, superTheme } = this.internalTheme;
4365
- if (!superTheme.cornerLeftBottomCellStyle || !obj.cornerLeftBottomCellStyle) {
4365
+ if (!superTheme.cornerLeftBottomCellStyle && !obj.cornerLeftBottomCellStyle) {
4366
4366
  return this._cornerLeftBottomCell;
4367
4367
  }
4368
4368
  const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.cornerLeftBottomCellStyle, obj.cornerLeftBottomCellStyle);
@@ -4373,7 +4373,7 @@
4373
4373
  get cornerRightBottomCellStyle() {
4374
4374
  if (!this._cornerRightBottomCell) {
4375
4375
  const { obj, superTheme } = this.internalTheme;
4376
- if (!superTheme.cornerRightBottomCellStyle || !obj.cornerRightBottomCellStyle) {
4376
+ if (!superTheme.cornerRightBottomCellStyle && !obj.cornerRightBottomCellStyle) {
4377
4377
  return this._cornerRightBottomCell;
4378
4378
  }
4379
4379
  const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.cornerRightBottomCellStyle, obj.cornerRightBottomCellStyle);
@@ -4384,7 +4384,7 @@
4384
4384
  get rightFrozenStyle() {
4385
4385
  if (!this._rightFrozen) {
4386
4386
  const { obj, superTheme } = this.internalTheme;
4387
- if (!superTheme.rightFrozenStyle || !obj.rightFrozenStyle) {
4387
+ if (!superTheme.rightFrozenStyle && !obj.rightFrozenStyle) {
4388
4388
  return this._rightFrozen;
4389
4389
  }
4390
4390
  const header = ingoreNoneValueMerge({}, this.defaultStyle, this.rowHeaderStyle, superTheme.rightFrozenStyle, obj.rightFrozenStyle);
@@ -4395,7 +4395,7 @@
4395
4395
  get bottomFrozenStyle() {
4396
4396
  if (!this._bottomFrozen) {
4397
4397
  const { obj, superTheme } = this.internalTheme;
4398
- if (!superTheme.bottomFrozenStyle || !obj.bottomFrozenStyle) {
4398
+ if (!superTheme.bottomFrozenStyle && !obj.bottomFrozenStyle) {
4399
4399
  return this._bottomFrozen;
4400
4400
  }
4401
4401
  const header = ingoreNoneValueMerge({}, this.defaultStyle, this.headerStyle, superTheme.bottomFrozenStyle, obj.bottomFrozenStyle);
@@ -39005,9 +39005,11 @@
39005
39005
  }
39006
39006
  for (let col = startCol; col <= endCol; col++) {
39007
39007
  const customHeight = computeCustomRenderHeight(col, row, table);
39008
- if (typeof customHeight === 'number') {
39009
- maxHeight = Math.max(customHeight, maxHeight);
39010
- continue;
39008
+ if (customHeight) {
39009
+ maxHeight = Math.max(customHeight.height, maxHeight);
39010
+ if (!customHeight.renderDefault) {
39011
+ continue;
39012
+ }
39011
39013
  }
39012
39014
  if (table.isPivotChart()) {
39013
39015
  const layout = table.internalProps.layoutMap;
@@ -39096,6 +39098,7 @@
39096
39098
  if (customRender || customLayout) {
39097
39099
  let spanRow = 1;
39098
39100
  let height = 0;
39101
+ let renderDefault = false;
39099
39102
  if (table.isHeader(col, row) || table.getBodyColumnDefine(col, row)?.mergeCell) {
39100
39103
  const cellRange = table.getCellRange(col, row);
39101
39104
  spanRow = cellRange.end.row - cellRange.start.row + 1;
@@ -39115,6 +39118,7 @@
39115
39118
  dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0);
39116
39119
  customLayoutObj.rootContainer.setStage(table.scenegraph.stage);
39117
39120
  height = customLayoutObj.rootContainer.AABBBounds.height() ?? 0;
39121
+ renderDefault = customLayoutObj.renderDefault;
39118
39122
  }
39119
39123
  else {
39120
39124
  height = 0;
@@ -39123,11 +39127,16 @@
39123
39127
  else if (typeof customRender === 'function') {
39124
39128
  const customRenderObj = customRender(arg);
39125
39129
  height = customRenderObj?.expectedHeight ?? 0;
39130
+ renderDefault = customRenderObj?.renderDefault;
39126
39131
  }
39127
39132
  else {
39128
39133
  height = customRender?.expectedHeight ?? 0;
39134
+ renderDefault = customRender?.renderDefault;
39129
39135
  }
39130
- return height / spanRow;
39136
+ return {
39137
+ height: height / spanRow,
39138
+ renderDefault
39139
+ };
39131
39140
  }
39132
39141
  return undefined;
39133
39142
  }
@@ -40970,7 +40979,7 @@
40970
40979
  let hoverStyle;
40971
40980
  const layout = table.internalProps.layoutMap;
40972
40981
  if (layout.isCornerHeader(cellGroup.col, cellGroup.row)) {
40973
- hoverStyle = table.theme.cornerHeaderStyle?.hover;
40982
+ hoverStyle = table.theme.cornerHeaderStyle?.hover || table.theme.headerStyle?.hover;
40974
40983
  }
40975
40984
  else if (layout.isColumnHeader(cellGroup.col, cellGroup.row)) {
40976
40985
  hoverStyle = table.theme.headerStyle?.hover;
@@ -40979,10 +40988,14 @@
40979
40988
  hoverStyle = table.theme.rowHeaderStyle?.hover;
40980
40989
  }
40981
40990
  else if (layout.isBottomFrozenRow(cellGroup.col, cellGroup.row)) {
40982
- hoverStyle = table.theme.bottomFrozenStyle?.hover || table.theme.headerStyle?.hover;
40991
+ hoverStyle =
40992
+ table.theme.bottomFrozenStyle?.hover ||
40993
+ (table.isListTable() ? table.theme.bodyStyle?.hover : table.theme.headerStyle?.hover);
40983
40994
  }
40984
40995
  else if (layout.isRightFrozenColumn(cellGroup.col, cellGroup.row)) {
40985
- hoverStyle = table.theme.rightFrozenStyle?.hover || table.theme.rowHeaderStyle?.hover;
40996
+ hoverStyle =
40997
+ table.theme.rightFrozenStyle?.hover ||
40998
+ (table.isListTable() ? table.theme.bodyStyle?.hover : table.theme.rowHeaderStyle?.hover);
40986
40999
  }
40987
41000
  else if (!table.isHeader(cellGroup.col, cellGroup.row)) {
40988
41001
  hoverStyle = table.theme.bodyStyle?.hover;
@@ -41499,7 +41512,7 @@
41499
41512
  'showHeader' in table.internalProps.layoutMap) {
41500
41513
  const temp = table.internalProps.layoutMap.showHeader;
41501
41514
  table.internalProps.layoutMap.showHeader = true;
41502
- maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount, table);
41515
+ maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount - 1, table);
41503
41516
  table.internalProps.layoutMap.showHeader = temp;
41504
41517
  }
41505
41518
  else if (!table.internalProps.transpose &&
@@ -41515,7 +41528,7 @@
41515
41528
  table._clearColRangeWidthsMap(col);
41516
41529
  }
41517
41530
  if (update) {
41518
- newWidths[col] = maxWidth;
41531
+ newWidths[col] = table._adjustColWidth(col, maxWidth);
41519
41532
  }
41520
41533
  else {
41521
41534
  table._setColWidth(col, maxWidth, false, true);
@@ -41551,7 +41564,7 @@
41551
41564
  colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
41552
41565
  }
41553
41566
  if (update) {
41554
- newWidths[col] = colWidth;
41567
+ newWidths[col] = table._adjustColWidth(col, colWidth);
41555
41568
  }
41556
41569
  else {
41557
41570
  table._setColWidth(col, colWidth, false, true);
@@ -41591,7 +41604,7 @@
41591
41604
  colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
41592
41605
  }
41593
41606
  if (update) {
41594
- newWidths[col] = colWidth;
41607
+ newWidths[col] = table._adjustColWidth(col, colWidth);
41595
41608
  }
41596
41609
  else {
41597
41610
  table._setColWidth(col, colWidth, false, true);
@@ -41658,9 +41671,11 @@
41658
41671
  }
41659
41672
  }
41660
41673
  const customWidth = computeCustomRenderWidth(col, row, table);
41661
- if (typeof customWidth === 'number') {
41662
- maxWidth = Math.max(customWidth, maxWidth);
41663
- continue;
41674
+ if (customWidth) {
41675
+ maxWidth = Math.max(customWidth.width, maxWidth);
41676
+ if (!customWidth.renderDefault) {
41677
+ continue;
41678
+ }
41664
41679
  }
41665
41680
  const indicatorWidth = widthDeifne;
41666
41681
  if (typeof indicatorWidth === 'number' && table.widthMode === 'standard' && !forceCompute) {
@@ -41723,6 +41738,7 @@
41723
41738
  if (customRender || customLayout) {
41724
41739
  let spanCol = 1;
41725
41740
  let width = 0;
41741
+ let renderDefault = false;
41726
41742
  if (table.isHeader(col, row) || table.getBodyColumnDefine(col, row)?.mergeCell) {
41727
41743
  const cellRange = table.getCellRange(col, row);
41728
41744
  spanCol = cellRange.end.col - cellRange.start.col + 1;
@@ -41742,6 +41758,7 @@
41742
41758
  dealPercentCalc(customLayoutObj.rootContainer, 0, table.getRowHeight(row));
41743
41759
  customLayoutObj.rootContainer.setStage(table.scenegraph.stage);
41744
41760
  width = customLayoutObj.rootContainer.AABBBounds.width() ?? 0;
41761
+ renderDefault = customLayoutObj.renderDefault;
41745
41762
  }
41746
41763
  else {
41747
41764
  width = 0;
@@ -41750,11 +41767,16 @@
41750
41767
  else if (typeof customRender === 'function') {
41751
41768
  const customRenderObj = customRender(arg);
41752
41769
  width = customRenderObj?.expectedWidth ?? 0;
41770
+ renderDefault = customRenderObj?.renderDefault;
41753
41771
  }
41754
41772
  else {
41755
41773
  width = customRender?.expectedWidth ?? 0;
41774
+ renderDefault = customRender?.renderDefault;
41756
41775
  }
41757
- return width / spanCol;
41776
+ return {
41777
+ width: width / spanCol,
41778
+ renderDefault
41779
+ };
41758
41780
  }
41759
41781
  return undefined;
41760
41782
  }
@@ -51683,7 +51705,7 @@
51683
51705
  return TABLE_EVENT_TYPE;
51684
51706
  }
51685
51707
  options;
51686
- version = "0.15.4-alpha.0";
51708
+ version = "0.15.4";
51687
51709
  pagination;
51688
51710
  id = `VTable${Date.now()}`;
51689
51711
  headerStyleCache;
@@ -52325,15 +52347,33 @@
52325
52347
  }
52326
52348
  getCellRect(col, row) {
52327
52349
  const isFrozenCell = this.isFrozenCell(col, row);
52328
- let absoluteLeft = this.getColsWidth(0, col - 1) || 0;
52350
+ let absoluteLeft;
52329
52351
  const width = this.getColWidth(col);
52330
52352
  if (isFrozenCell && isFrozenCell.col) {
52331
- absoluteLeft += this.scrollLeft;
52353
+ if (this.isRightFrozenColumn(col, row)) {
52354
+ absoluteLeft = this.tableNoFrameWidth - (this.getColsWidth(col, this.colCount - 1) ?? 0);
52355
+ }
52356
+ else {
52357
+ absoluteLeft = this.getColsWidth(0, col - 1) || 0;
52358
+ absoluteLeft += this.scrollLeft;
52359
+ }
52332
52360
  }
52333
- let absoluteTop = this.getRowsHeight(0, row - 1);
52361
+ else {
52362
+ absoluteLeft = this.getColsWidth(0, col - 1) || 0;
52363
+ }
52364
+ let absoluteTop;
52334
52365
  const height = this.getRowHeight(row);
52335
52366
  if (isFrozenCell && isFrozenCell.row) {
52336
- absoluteTop += this.scrollTop;
52367
+ if (this.isBottomFrozenRow(col, row)) {
52368
+ absoluteLeft = this.tableNoFrameHeight - (this.getRowsHeight(row, this.rowCount - 1) ?? 0);
52369
+ }
52370
+ else {
52371
+ absoluteTop = this.getRowsHeight(0, row - 1);
52372
+ absoluteTop += this.scrollTop;
52373
+ }
52374
+ }
52375
+ else {
52376
+ absoluteTop = this.getRowsHeight(0, row - 1);
52337
52377
  }
52338
52378
  return new Rect$2(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
52339
52379
  }
@@ -55210,6 +55250,11 @@
55210
55250
  : options.header
55211
55251
  ? cloneDeep$1(options.header)
55212
55252
  : [];
55253
+ options.columns.forEach((colDefine, index) => {
55254
+ if (colDefine.editor) {
55255
+ internalProps.columns[index].editor = colDefine.editor;
55256
+ }
55257
+ });
55213
55258
  this.showHeader = options.showHeader ?? true;
55214
55259
  this.transpose = options.transpose ?? false;
55215
55260
  if (Env.mode !== 'node') {
@@ -55248,6 +55293,11 @@
55248
55293
  updateColumns(columns) {
55249
55294
  const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
55250
55295
  this.internalProps.columns = cloneDeep$1(columns);
55296
+ columns.forEach((colDefine, index) => {
55297
+ if (colDefine.editor) {
55298
+ this.internalProps.columns[index].editor = colDefine.editor;
55299
+ }
55300
+ });
55251
55301
  this.options.columns = columns;
55252
55302
  this.refreshHeader();
55253
55303
  this.scenegraph.clearCells();
@@ -55384,6 +55434,11 @@
55384
55434
  : options.header
55385
55435
  ? cloneDeep$1(options.header)
55386
55436
  : [];
55437
+ options.columns.forEach((colDefine, index) => {
55438
+ if (colDefine.editor) {
55439
+ internalProps.columns[index].editor = colDefine.editor;
55440
+ }
55441
+ });
55387
55442
  this.transpose = options.transpose ?? false;
55388
55443
  this.refreshHeader();
55389
55444
  if (internalProps.releaseList) {
@@ -57095,7 +57150,7 @@
57095
57150
  getBody(_col, _row) {
57096
57151
  const paths = this.getCellHeaderPaths(_col, _row);
57097
57152
  if (this.indicatorsAsCol) {
57098
- const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;
57153
+ const indicatorKey = paths.colHeaderPaths?.find(colPath => colPath.indicatorKey)?.indicatorKey;
57099
57154
  return (this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey) ??
57100
57155
  this._indicators[0] ?? {
57101
57156
  id: '',
@@ -57105,7 +57160,7 @@
57105
57160
  define: undefined
57106
57161
  });
57107
57162
  }
57108
- const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
57163
+ const indicatorKey = paths.rowHeaderPaths?.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
57109
57164
  return (this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey) ??
57110
57165
  this._indicators[0] ?? {
57111
57166
  id: '',
@@ -57206,8 +57261,8 @@
57206
57261
  }
57207
57262
  const recordCol = this.getBodyIndexByCol(col);
57208
57263
  const recordRow = this.getBodyIndexByRow(row) + this.currentPageStartIndex;
57209
- let colPath;
57210
- let rowPath;
57264
+ let colPath = [];
57265
+ let rowPath = [];
57211
57266
  if (row >= 0 && recordCol >= 0) {
57212
57267
  colPath = this.columnDimensionTree.getTreePath(recordCol, this.showHeader && this.showColumnHeader
57213
57268
  ? row - (this.columnHeaderTitle ? 1 : 0)
@@ -57215,7 +57270,6 @@
57215
57270
  }
57216
57271
  if (col >= 0 && recordRow >= 0) {
57217
57272
  if (this.rowHierarchyType === 'tree') {
57218
- rowPath = [];
57219
57273
  const row_pathIds = this._rowHeaderCellIds[recordRow];
57220
57274
  let findTree = this.rowDimensionTree;
57221
57275
  let level = 0;
@@ -59782,6 +59836,11 @@
59782
59836
  this.internalProps.columns = cloneDeep$1(options.columns);
59783
59837
  this.internalProps.rows = cloneDeep$1(options.rows);
59784
59838
  this.internalProps.indicators = cloneDeep$1(options.indicators);
59839
+ options.indicators?.forEach((indicatorDefine, index) => {
59840
+ if (typeof indicatorDefine === 'object' && indicatorDefine?.editor) {
59841
+ this.internalProps.indicators[index].editor = indicatorDefine.editor;
59842
+ }
59843
+ });
59785
59844
  this.internalProps.columnTree =
59786
59845
  options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep$1(options.columnTree);
59787
59846
  this.internalProps.rowTree =
@@ -59886,6 +59945,11 @@
59886
59945
  this.internalProps.columns = cloneDeep$1(options.columns);
59887
59946
  this.internalProps.rows = cloneDeep$1(options.rows);
59888
59947
  this.internalProps.indicators = !options.indicators?.length ? [] : cloneDeep$1(options.indicators);
59948
+ options.indicators?.forEach((indicatorDefine, index) => {
59949
+ if (typeof indicatorDefine === 'object' && indicatorDefine?.editor) {
59950
+ this.internalProps.indicators[index].editor = indicatorDefine.editor;
59951
+ }
59952
+ });
59889
59953
  this.internalProps.columnTree =
59890
59954
  options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep$1(options.columnTree);
59891
59955
  this.internalProps.rowTree =
@@ -61777,7 +61841,7 @@
61777
61841
  return new Tag$1(params ? params.attribute : {});
61778
61842
  }
61779
61843
 
61780
- const version = "0.15.4-alpha.0";
61844
+ const version = "0.15.4";
61781
61845
  function getIcons() {
61782
61846
  return get$2();
61783
61847
  }