@visactor/vtable 0.15.3 → 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.
- package/cjs/ListTable.js +11 -6
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +24 -20
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +8 -5
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/EventHandler.js +4 -0
- package/cjs/event/EventHandler.js.map +1 -1
- package/cjs/event/media-click.js +2 -1
- package/cjs/event/scroll.js +0 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +3 -3
- package/cjs/layout/pivot-header-layout.js +6 -7
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +16 -13
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +12 -9
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.js +2 -2
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/themes/ARCO.js +2 -1
- package/cjs/themes/BRIGHT.js +1 -2
- package/cjs/themes/theme.js +5 -5
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/Rect.js +1 -1
- package/cjs/ts-types/base-table.d.ts +5 -5
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/index.d.ts +3 -1
- package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +6 -6
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +99 -31
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +14 -9
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +24 -20
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +8 -5
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/EventHandler.js +4 -0
- package/es/event/EventHandler.js.map +1 -1
- package/es/event/media-click.js +2 -1
- package/es/event/scroll.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +3 -3
- package/es/layout/pivot-header-layout.js +6 -7
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +16 -13
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +12 -9
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/state/hover/is-cell-hover.js +2 -2
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/themes/ARCO.js +2 -1
- package/es/themes/BRIGHT.js +1 -2
- package/es/themes/theme.js +5 -5
- package/es/themes/theme.js.map +1 -1
- package/es/tools/Rect.js +1 -1
- package/es/ts-types/base-table.d.ts +5 -5
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/index.d.ts +3 -1
- package/es/ts-types/pivot-table/dimension/index.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +6 -6
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +4 -4
- package/cjs/event/VChartEventProxy.d.ts +0 -1
- package/cjs/event/VChartEventProxy.js +0 -1
- package/cjs/event/VChartEventProxy.js.map +0 -1
- package/es/event/VChartEventProxy.d.ts +0 -1
- package/es/event/VChartEventProxy.js +0 -1
- 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
|
@@ -3573,6 +3573,10 @@
|
|
|
3573
3573
|
listener.target.removeEventListener(listener.type, listener.listener, ...listener.options);
|
|
3574
3574
|
}
|
|
3575
3575
|
}
|
|
3576
|
+
for (const key in this.reseizeListeners) {
|
|
3577
|
+
const resizeObserver = this.reseizeListeners[key];
|
|
3578
|
+
resizeObserver?.disConnect();
|
|
3579
|
+
}
|
|
3576
3580
|
this.listeners = {};
|
|
3577
3581
|
}
|
|
3578
3582
|
release() {
|
|
@@ -4347,7 +4351,7 @@
|
|
|
4347
4351
|
get cornerRightTopCellStyle() {
|
|
4348
4352
|
if (!this._cornerRightTopCell) {
|
|
4349
4353
|
const { obj, superTheme } = this.internalTheme;
|
|
4350
|
-
if (!superTheme.cornerRightTopCellStyle
|
|
4354
|
+
if (!superTheme.cornerRightTopCellStyle && !obj.cornerRightTopCellStyle) {
|
|
4351
4355
|
return this._cornerRightTopCell;
|
|
4352
4356
|
}
|
|
4353
4357
|
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.cornerRightTopCellStyle, obj.cornerRightTopCellStyle);
|
|
@@ -4358,7 +4362,7 @@
|
|
|
4358
4362
|
get cornerLeftBottomCellStyle() {
|
|
4359
4363
|
if (!this._cornerLeftBottomCell) {
|
|
4360
4364
|
const { obj, superTheme } = this.internalTheme;
|
|
4361
|
-
if (!superTheme.cornerLeftBottomCellStyle
|
|
4365
|
+
if (!superTheme.cornerLeftBottomCellStyle && !obj.cornerLeftBottomCellStyle) {
|
|
4362
4366
|
return this._cornerLeftBottomCell;
|
|
4363
4367
|
}
|
|
4364
4368
|
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.cornerLeftBottomCellStyle, obj.cornerLeftBottomCellStyle);
|
|
@@ -4369,7 +4373,7 @@
|
|
|
4369
4373
|
get cornerRightBottomCellStyle() {
|
|
4370
4374
|
if (!this._cornerRightBottomCell) {
|
|
4371
4375
|
const { obj, superTheme } = this.internalTheme;
|
|
4372
|
-
if (!superTheme.cornerRightBottomCellStyle
|
|
4376
|
+
if (!superTheme.cornerRightBottomCellStyle && !obj.cornerRightBottomCellStyle) {
|
|
4373
4377
|
return this._cornerRightBottomCell;
|
|
4374
4378
|
}
|
|
4375
4379
|
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.cornerRightBottomCellStyle, obj.cornerRightBottomCellStyle);
|
|
@@ -4380,7 +4384,7 @@
|
|
|
4380
4384
|
get rightFrozenStyle() {
|
|
4381
4385
|
if (!this._rightFrozen) {
|
|
4382
4386
|
const { obj, superTheme } = this.internalTheme;
|
|
4383
|
-
if (!superTheme.rightFrozenStyle
|
|
4387
|
+
if (!superTheme.rightFrozenStyle && !obj.rightFrozenStyle) {
|
|
4384
4388
|
return this._rightFrozen;
|
|
4385
4389
|
}
|
|
4386
4390
|
const header = ingoreNoneValueMerge({}, this.defaultStyle, this.rowHeaderStyle, superTheme.rightFrozenStyle, obj.rightFrozenStyle);
|
|
@@ -4391,7 +4395,7 @@
|
|
|
4391
4395
|
get bottomFrozenStyle() {
|
|
4392
4396
|
if (!this._bottomFrozen) {
|
|
4393
4397
|
const { obj, superTheme } = this.internalTheme;
|
|
4394
|
-
if (!superTheme.bottomFrozenStyle
|
|
4398
|
+
if (!superTheme.bottomFrozenStyle && !obj.bottomFrozenStyle) {
|
|
4395
4399
|
return this._bottomFrozen;
|
|
4396
4400
|
}
|
|
4397
4401
|
const header = ingoreNoneValueMerge({}, this.defaultStyle, this.headerStyle, superTheme.bottomFrozenStyle, obj.bottomFrozenStyle);
|
|
@@ -39001,9 +39005,11 @@
|
|
|
39001
39005
|
}
|
|
39002
39006
|
for (let col = startCol; col <= endCol; col++) {
|
|
39003
39007
|
const customHeight = computeCustomRenderHeight(col, row, table);
|
|
39004
|
-
if (
|
|
39005
|
-
maxHeight = Math.max(customHeight, maxHeight);
|
|
39006
|
-
|
|
39008
|
+
if (customHeight) {
|
|
39009
|
+
maxHeight = Math.max(customHeight.height, maxHeight);
|
|
39010
|
+
if (!customHeight.renderDefault) {
|
|
39011
|
+
continue;
|
|
39012
|
+
}
|
|
39007
39013
|
}
|
|
39008
39014
|
if (table.isPivotChart()) {
|
|
39009
39015
|
const layout = table.internalProps.layoutMap;
|
|
@@ -39092,6 +39098,7 @@
|
|
|
39092
39098
|
if (customRender || customLayout) {
|
|
39093
39099
|
let spanRow = 1;
|
|
39094
39100
|
let height = 0;
|
|
39101
|
+
let renderDefault = false;
|
|
39095
39102
|
if (table.isHeader(col, row) || table.getBodyColumnDefine(col, row)?.mergeCell) {
|
|
39096
39103
|
const cellRange = table.getCellRange(col, row);
|
|
39097
39104
|
spanRow = cellRange.end.row - cellRange.start.row + 1;
|
|
@@ -39111,6 +39118,7 @@
|
|
|
39111
39118
|
dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0);
|
|
39112
39119
|
customLayoutObj.rootContainer.setStage(table.scenegraph.stage);
|
|
39113
39120
|
height = customLayoutObj.rootContainer.AABBBounds.height() ?? 0;
|
|
39121
|
+
renderDefault = customLayoutObj.renderDefault;
|
|
39114
39122
|
}
|
|
39115
39123
|
else {
|
|
39116
39124
|
height = 0;
|
|
@@ -39119,11 +39127,16 @@
|
|
|
39119
39127
|
else if (typeof customRender === 'function') {
|
|
39120
39128
|
const customRenderObj = customRender(arg);
|
|
39121
39129
|
height = customRenderObj?.expectedHeight ?? 0;
|
|
39130
|
+
renderDefault = customRenderObj?.renderDefault;
|
|
39122
39131
|
}
|
|
39123
39132
|
else {
|
|
39124
39133
|
height = customRender?.expectedHeight ?? 0;
|
|
39134
|
+
renderDefault = customRender?.renderDefault;
|
|
39125
39135
|
}
|
|
39126
|
-
return
|
|
39136
|
+
return {
|
|
39137
|
+
height: height / spanRow,
|
|
39138
|
+
renderDefault
|
|
39139
|
+
};
|
|
39127
39140
|
}
|
|
39128
39141
|
return undefined;
|
|
39129
39142
|
}
|
|
@@ -40966,7 +40979,7 @@
|
|
|
40966
40979
|
let hoverStyle;
|
|
40967
40980
|
const layout = table.internalProps.layoutMap;
|
|
40968
40981
|
if (layout.isCornerHeader(cellGroup.col, cellGroup.row)) {
|
|
40969
|
-
hoverStyle = table.theme.cornerHeaderStyle?.hover;
|
|
40982
|
+
hoverStyle = table.theme.cornerHeaderStyle?.hover || table.theme.headerStyle?.hover;
|
|
40970
40983
|
}
|
|
40971
40984
|
else if (layout.isColumnHeader(cellGroup.col, cellGroup.row)) {
|
|
40972
40985
|
hoverStyle = table.theme.headerStyle?.hover;
|
|
@@ -40975,10 +40988,14 @@
|
|
|
40975
40988
|
hoverStyle = table.theme.rowHeaderStyle?.hover;
|
|
40976
40989
|
}
|
|
40977
40990
|
else if (layout.isBottomFrozenRow(cellGroup.col, cellGroup.row)) {
|
|
40978
|
-
hoverStyle =
|
|
40991
|
+
hoverStyle =
|
|
40992
|
+
table.theme.bottomFrozenStyle?.hover ||
|
|
40993
|
+
(table.isListTable() ? table.theme.bodyStyle?.hover : table.theme.headerStyle?.hover);
|
|
40979
40994
|
}
|
|
40980
40995
|
else if (layout.isRightFrozenColumn(cellGroup.col, cellGroup.row)) {
|
|
40981
|
-
hoverStyle =
|
|
40996
|
+
hoverStyle =
|
|
40997
|
+
table.theme.rightFrozenStyle?.hover ||
|
|
40998
|
+
(table.isListTable() ? table.theme.bodyStyle?.hover : table.theme.rowHeaderStyle?.hover);
|
|
40982
40999
|
}
|
|
40983
41000
|
else if (!table.isHeader(cellGroup.col, cellGroup.row)) {
|
|
40984
41001
|
hoverStyle = table.theme.bodyStyle?.hover;
|
|
@@ -41495,7 +41512,7 @@
|
|
|
41495
41512
|
'showHeader' in table.internalProps.layoutMap) {
|
|
41496
41513
|
const temp = table.internalProps.layoutMap.showHeader;
|
|
41497
41514
|
table.internalProps.layoutMap.showHeader = true;
|
|
41498
|
-
maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount, table);
|
|
41515
|
+
maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount - 1, table);
|
|
41499
41516
|
table.internalProps.layoutMap.showHeader = temp;
|
|
41500
41517
|
}
|
|
41501
41518
|
else if (!table.internalProps.transpose &&
|
|
@@ -41511,7 +41528,7 @@
|
|
|
41511
41528
|
table._clearColRangeWidthsMap(col);
|
|
41512
41529
|
}
|
|
41513
41530
|
if (update) {
|
|
41514
|
-
newWidths[col] = maxWidth;
|
|
41531
|
+
newWidths[col] = table._adjustColWidth(col, maxWidth);
|
|
41515
41532
|
}
|
|
41516
41533
|
else {
|
|
41517
41534
|
table._setColWidth(col, maxWidth, false, true);
|
|
@@ -41547,7 +41564,7 @@
|
|
|
41547
41564
|
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41548
41565
|
}
|
|
41549
41566
|
if (update) {
|
|
41550
|
-
newWidths[col] = colWidth;
|
|
41567
|
+
newWidths[col] = table._adjustColWidth(col, colWidth);
|
|
41551
41568
|
}
|
|
41552
41569
|
else {
|
|
41553
41570
|
table._setColWidth(col, colWidth, false, true);
|
|
@@ -41587,7 +41604,7 @@
|
|
|
41587
41604
|
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41588
41605
|
}
|
|
41589
41606
|
if (update) {
|
|
41590
|
-
newWidths[col] = colWidth;
|
|
41607
|
+
newWidths[col] = table._adjustColWidth(col, colWidth);
|
|
41591
41608
|
}
|
|
41592
41609
|
else {
|
|
41593
41610
|
table._setColWidth(col, colWidth, false, true);
|
|
@@ -41654,9 +41671,11 @@
|
|
|
41654
41671
|
}
|
|
41655
41672
|
}
|
|
41656
41673
|
const customWidth = computeCustomRenderWidth(col, row, table);
|
|
41657
|
-
if (
|
|
41658
|
-
maxWidth = Math.max(customWidth, maxWidth);
|
|
41659
|
-
|
|
41674
|
+
if (customWidth) {
|
|
41675
|
+
maxWidth = Math.max(customWidth.width, maxWidth);
|
|
41676
|
+
if (!customWidth.renderDefault) {
|
|
41677
|
+
continue;
|
|
41678
|
+
}
|
|
41660
41679
|
}
|
|
41661
41680
|
const indicatorWidth = widthDeifne;
|
|
41662
41681
|
if (typeof indicatorWidth === 'number' && table.widthMode === 'standard' && !forceCompute) {
|
|
@@ -41719,6 +41738,7 @@
|
|
|
41719
41738
|
if (customRender || customLayout) {
|
|
41720
41739
|
let spanCol = 1;
|
|
41721
41740
|
let width = 0;
|
|
41741
|
+
let renderDefault = false;
|
|
41722
41742
|
if (table.isHeader(col, row) || table.getBodyColumnDefine(col, row)?.mergeCell) {
|
|
41723
41743
|
const cellRange = table.getCellRange(col, row);
|
|
41724
41744
|
spanCol = cellRange.end.col - cellRange.start.col + 1;
|
|
@@ -41738,6 +41758,7 @@
|
|
|
41738
41758
|
dealPercentCalc(customLayoutObj.rootContainer, 0, table.getRowHeight(row));
|
|
41739
41759
|
customLayoutObj.rootContainer.setStage(table.scenegraph.stage);
|
|
41740
41760
|
width = customLayoutObj.rootContainer.AABBBounds.width() ?? 0;
|
|
41761
|
+
renderDefault = customLayoutObj.renderDefault;
|
|
41741
41762
|
}
|
|
41742
41763
|
else {
|
|
41743
41764
|
width = 0;
|
|
@@ -41746,11 +41767,16 @@
|
|
|
41746
41767
|
else if (typeof customRender === 'function') {
|
|
41747
41768
|
const customRenderObj = customRender(arg);
|
|
41748
41769
|
width = customRenderObj?.expectedWidth ?? 0;
|
|
41770
|
+
renderDefault = customRenderObj?.renderDefault;
|
|
41749
41771
|
}
|
|
41750
41772
|
else {
|
|
41751
41773
|
width = customRender?.expectedWidth ?? 0;
|
|
41774
|
+
renderDefault = customRender?.renderDefault;
|
|
41752
41775
|
}
|
|
41753
|
-
return
|
|
41776
|
+
return {
|
|
41777
|
+
width: width / spanCol,
|
|
41778
|
+
renderDefault
|
|
41779
|
+
};
|
|
41754
41780
|
}
|
|
41755
41781
|
return undefined;
|
|
41756
41782
|
}
|
|
@@ -51679,7 +51705,7 @@
|
|
|
51679
51705
|
return TABLE_EVENT_TYPE;
|
|
51680
51706
|
}
|
|
51681
51707
|
options;
|
|
51682
|
-
version = "0.15.
|
|
51708
|
+
version = "0.15.4";
|
|
51683
51709
|
pagination;
|
|
51684
51710
|
id = `VTable${Date.now()}`;
|
|
51685
51711
|
headerStyleCache;
|
|
@@ -52321,15 +52347,33 @@
|
|
|
52321
52347
|
}
|
|
52322
52348
|
getCellRect(col, row) {
|
|
52323
52349
|
const isFrozenCell = this.isFrozenCell(col, row);
|
|
52324
|
-
let absoluteLeft
|
|
52350
|
+
let absoluteLeft;
|
|
52325
52351
|
const width = this.getColWidth(col);
|
|
52326
52352
|
if (isFrozenCell && isFrozenCell.col) {
|
|
52327
|
-
|
|
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
|
+
}
|
|
52328
52360
|
}
|
|
52329
|
-
|
|
52361
|
+
else {
|
|
52362
|
+
absoluteLeft = this.getColsWidth(0, col - 1) || 0;
|
|
52363
|
+
}
|
|
52364
|
+
let absoluteTop;
|
|
52330
52365
|
const height = this.getRowHeight(row);
|
|
52331
52366
|
if (isFrozenCell && isFrozenCell.row) {
|
|
52332
|
-
|
|
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);
|
|
52333
52377
|
}
|
|
52334
52378
|
return new Rect$2(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
|
|
52335
52379
|
}
|
|
@@ -55206,6 +55250,11 @@
|
|
|
55206
55250
|
: options.header
|
|
55207
55251
|
? cloneDeep$1(options.header)
|
|
55208
55252
|
: [];
|
|
55253
|
+
options.columns.forEach((colDefine, index) => {
|
|
55254
|
+
if (colDefine.editor) {
|
|
55255
|
+
internalProps.columns[index].editor = colDefine.editor;
|
|
55256
|
+
}
|
|
55257
|
+
});
|
|
55209
55258
|
this.showHeader = options.showHeader ?? true;
|
|
55210
55259
|
this.transpose = options.transpose ?? false;
|
|
55211
55260
|
if (Env.mode !== 'node') {
|
|
@@ -55244,6 +55293,11 @@
|
|
|
55244
55293
|
updateColumns(columns) {
|
|
55245
55294
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
55246
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
|
+
});
|
|
55247
55301
|
this.options.columns = columns;
|
|
55248
55302
|
this.refreshHeader();
|
|
55249
55303
|
this.scenegraph.clearCells();
|
|
@@ -55380,6 +55434,11 @@
|
|
|
55380
55434
|
: options.header
|
|
55381
55435
|
? cloneDeep$1(options.header)
|
|
55382
55436
|
: [];
|
|
55437
|
+
options.columns.forEach((colDefine, index) => {
|
|
55438
|
+
if (colDefine.editor) {
|
|
55439
|
+
internalProps.columns[index].editor = colDefine.editor;
|
|
55440
|
+
}
|
|
55441
|
+
});
|
|
55383
55442
|
this.transpose = options.transpose ?? false;
|
|
55384
55443
|
this.refreshHeader();
|
|
55385
55444
|
if (internalProps.releaseList) {
|
|
@@ -57091,7 +57150,7 @@
|
|
|
57091
57150
|
getBody(_col, _row) {
|
|
57092
57151
|
const paths = this.getCellHeaderPaths(_col, _row);
|
|
57093
57152
|
if (this.indicatorsAsCol) {
|
|
57094
|
-
const indicatorKey = paths.colHeaderPaths
|
|
57153
|
+
const indicatorKey = paths.colHeaderPaths?.find(colPath => colPath.indicatorKey)?.indicatorKey;
|
|
57095
57154
|
return (this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey) ??
|
|
57096
57155
|
this._indicators[0] ?? {
|
|
57097
57156
|
id: '',
|
|
@@ -57101,7 +57160,7 @@
|
|
|
57101
57160
|
define: undefined
|
|
57102
57161
|
});
|
|
57103
57162
|
}
|
|
57104
|
-
const indicatorKey = paths.rowHeaderPaths
|
|
57163
|
+
const indicatorKey = paths.rowHeaderPaths?.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
|
|
57105
57164
|
return (this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey) ??
|
|
57106
57165
|
this._indicators[0] ?? {
|
|
57107
57166
|
id: '',
|
|
@@ -57202,8 +57261,8 @@
|
|
|
57202
57261
|
}
|
|
57203
57262
|
const recordCol = this.getBodyIndexByCol(col);
|
|
57204
57263
|
const recordRow = this.getBodyIndexByRow(row) + this.currentPageStartIndex;
|
|
57205
|
-
let colPath;
|
|
57206
|
-
let rowPath;
|
|
57264
|
+
let colPath = [];
|
|
57265
|
+
let rowPath = [];
|
|
57207
57266
|
if (row >= 0 && recordCol >= 0) {
|
|
57208
57267
|
colPath = this.columnDimensionTree.getTreePath(recordCol, this.showHeader && this.showColumnHeader
|
|
57209
57268
|
? row - (this.columnHeaderTitle ? 1 : 0)
|
|
@@ -57211,7 +57270,6 @@
|
|
|
57211
57270
|
}
|
|
57212
57271
|
if (col >= 0 && recordRow >= 0) {
|
|
57213
57272
|
if (this.rowHierarchyType === 'tree') {
|
|
57214
|
-
rowPath = [];
|
|
57215
57273
|
const row_pathIds = this._rowHeaderCellIds[recordRow];
|
|
57216
57274
|
let findTree = this.rowDimensionTree;
|
|
57217
57275
|
let level = 0;
|
|
@@ -59778,6 +59836,11 @@
|
|
|
59778
59836
|
this.internalProps.columns = cloneDeep$1(options.columns);
|
|
59779
59837
|
this.internalProps.rows = cloneDeep$1(options.rows);
|
|
59780
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
|
+
});
|
|
59781
59844
|
this.internalProps.columnTree =
|
|
59782
59845
|
options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep$1(options.columnTree);
|
|
59783
59846
|
this.internalProps.rowTree =
|
|
@@ -59882,6 +59945,11 @@
|
|
|
59882
59945
|
this.internalProps.columns = cloneDeep$1(options.columns);
|
|
59883
59946
|
this.internalProps.rows = cloneDeep$1(options.rows);
|
|
59884
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
|
+
});
|
|
59885
59953
|
this.internalProps.columnTree =
|
|
59886
59954
|
options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep$1(options.columnTree);
|
|
59887
59955
|
this.internalProps.rowTree =
|
|
@@ -61773,7 +61841,7 @@
|
|
|
61773
61841
|
return new Tag$1(params ? params.attribute : {});
|
|
61774
61842
|
}
|
|
61775
61843
|
|
|
61776
|
-
const version = "0.15.
|
|
61844
|
+
const version = "0.15.4";
|
|
61777
61845
|
function getIcons() {
|
|
61778
61846
|
return get$2();
|
|
61779
61847
|
}
|