@visactor/vtable 0.17.5-alpha.1 → 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.
- package/cjs/ListTable.js +11 -9
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +0 -4
- package/cjs/PivotChart.js +0 -16
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +10 -1
- package/cjs/core/BaseTable.js +28 -11
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/edit/edit-manager.js +6 -4
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +1 -0
- package/cjs/layout/simple-header-layout.js +4 -0
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +15 -0
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +58 -3
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/index.js +5 -1
- package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
- package/cjs/scenegraph/graphic/group.js +3 -1
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js +11 -11
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +4 -4
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +3 -0
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +3 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +238 -74
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +11 -9
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +0 -4
- package/es/PivotChart.js +0 -16
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.d.ts +10 -1
- package/es/core/BaseTable.js +28 -11
- package/es/core/BaseTable.js.map +1 -1
- package/es/edit/edit-manager.js +6 -4
- package/es/edit/edit-manager.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +1 -0
- package/es/layout/simple-header-layout.js +4 -0
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +15 -0
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +55 -0
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/index.js +4 -2
- package/es/scenegraph/graphic/contributions/index.js.map +1 -1
- package/es/scenegraph/graphic/group.js +3 -1
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js +11 -11
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +4 -4
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +3 -0
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +3 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +5 -5
|
@@ -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
|
-
|
|
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 (
|
|
56724
|
-
|
|
56725
|
-
|
|
56726
|
-
|
|
56727
|
-
|
|
56728
|
-
|
|
56729
|
-
|
|
56730
|
-
|
|
56731
|
-
|
|
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.
|
|
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.
|
|
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,13 +66947,15 @@
|
|
|
66823
66947
|
return TABLE_EVENT_TYPE;
|
|
66824
66948
|
}
|
|
66825
66949
|
options;
|
|
66826
|
-
version = "0.17.5
|
|
66950
|
+
version = "0.17.5";
|
|
66827
66951
|
pagination;
|
|
66828
66952
|
id = `VTable${Date.now()}`;
|
|
66829
66953
|
headerStyleCache;
|
|
66830
66954
|
bodyStyleCache;
|
|
66955
|
+
bodyBottomStyleCache;
|
|
66831
66956
|
container;
|
|
66832
66957
|
isReleased = false;
|
|
66958
|
+
_chartEventMap = {};
|
|
66833
66959
|
constructor(container, options = {}) {
|
|
66834
66960
|
super();
|
|
66835
66961
|
if (!container && options.mode !== 'node') {
|
|
@@ -66964,6 +67090,7 @@
|
|
|
66964
67090
|
}
|
|
66965
67091
|
this.headerStyleCache = new Map();
|
|
66966
67092
|
this.bodyStyleCache = new Map();
|
|
67093
|
+
this.bodyBottomStyleCache = new Map();
|
|
66967
67094
|
internalProps.stick = { changedCells: [] };
|
|
66968
67095
|
internalProps.customMergeCell = options.customMergeCell;
|
|
66969
67096
|
}
|
|
@@ -68538,14 +68665,24 @@
|
|
|
68538
68665
|
else {
|
|
68539
68666
|
cacheKey = row;
|
|
68540
68667
|
}
|
|
68541
|
-
let cacheStyle
|
|
68668
|
+
let cacheStyle;
|
|
68669
|
+
if (layoutMap.isBottomFrozenRow(row)) {
|
|
68670
|
+
cacheStyle = this.bodyBottomStyleCache.get(cacheKey);
|
|
68671
|
+
}
|
|
68672
|
+
else {
|
|
68673
|
+
cacheStyle = this.bodyStyleCache.get(cacheKey);
|
|
68674
|
+
}
|
|
68542
68675
|
if (cacheStyle) {
|
|
68543
68676
|
return cacheStyle;
|
|
68544
68677
|
}
|
|
68545
68678
|
const column = layoutMap.getBody(col, row);
|
|
68546
68679
|
const styleClass = this.internalProps.bodyHelper.getStyleClass(column.cellType);
|
|
68547
68680
|
const style = column?.style;
|
|
68548
|
-
cacheStyle = of$2(style, this.theme.
|
|
68681
|
+
cacheStyle = of$2(style, layoutMap.isBottomFrozenRow(row) && this.theme.bottomFrozenStyle
|
|
68682
|
+
? this.theme.bottomFrozenStyle
|
|
68683
|
+
: layoutMap.isRightFrozenColumn(col) && this.theme.rightFrozenStyle
|
|
68684
|
+
? this.theme.rightFrozenStyle
|
|
68685
|
+
: this.theme.bodyStyle, {
|
|
68549
68686
|
col,
|
|
68550
68687
|
row,
|
|
68551
68688
|
table: this,
|
|
@@ -68554,13 +68691,19 @@
|
|
|
68554
68691
|
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
68555
68692
|
}, styleClass, this.options.autoWrapText);
|
|
68556
68693
|
if (!isFunction$3(style)) {
|
|
68557
|
-
|
|
68694
|
+
if (layoutMap.isBottomFrozenRow(row)) {
|
|
68695
|
+
this.bodyBottomStyleCache.set(cacheKey, cacheStyle);
|
|
68696
|
+
}
|
|
68697
|
+
else {
|
|
68698
|
+
this.bodyStyleCache.set(cacheKey, cacheStyle);
|
|
68699
|
+
}
|
|
68558
68700
|
}
|
|
68559
68701
|
return cacheStyle;
|
|
68560
68702
|
}
|
|
68561
68703
|
clearCellStyleCache() {
|
|
68562
68704
|
this.headerStyleCache.clear();
|
|
68563
68705
|
this.bodyStyleCache.clear();
|
|
68706
|
+
this.bodyBottomStyleCache.clear();
|
|
68564
68707
|
}
|
|
68565
68708
|
clearRowHeightCache() {
|
|
68566
68709
|
this.internalProps._rowHeightsMap.clear();
|
|
@@ -69063,6 +69206,42 @@
|
|
|
69063
69206
|
row: row + this.columnHeaderLevelCount
|
|
69064
69207
|
};
|
|
69065
69208
|
}
|
|
69209
|
+
onVChartEvent(type, query, callback) {
|
|
69210
|
+
if (!this._chartEventMap[type]) {
|
|
69211
|
+
this._chartEventMap[type] = [];
|
|
69212
|
+
}
|
|
69213
|
+
if (typeof query === 'function') {
|
|
69214
|
+
this._chartEventMap[type].push({ callback: query });
|
|
69215
|
+
}
|
|
69216
|
+
else {
|
|
69217
|
+
this._chartEventMap[type].push({ callback, query });
|
|
69218
|
+
}
|
|
69219
|
+
}
|
|
69220
|
+
offVChartEvent(type, callback) {
|
|
69221
|
+
if (!this._chartEventMap[type]) {
|
|
69222
|
+
return;
|
|
69223
|
+
}
|
|
69224
|
+
if (callback) {
|
|
69225
|
+
this._chartEventMap[type] = this._chartEventMap[type].filter(e => e.callback !== callback);
|
|
69226
|
+
}
|
|
69227
|
+
else {
|
|
69228
|
+
this._chartEventMap[type] = [];
|
|
69229
|
+
}
|
|
69230
|
+
}
|
|
69231
|
+
_bindChartEvent(activeChartInstance) {
|
|
69232
|
+
if (activeChartInstance) {
|
|
69233
|
+
for (const key in this._chartEventMap) {
|
|
69234
|
+
(this._chartEventMap[key] || []).forEach(e => {
|
|
69235
|
+
if (e.query) {
|
|
69236
|
+
activeChartInstance.on(key, e.query, e.callback);
|
|
69237
|
+
}
|
|
69238
|
+
else {
|
|
69239
|
+
activeChartInstance.on(key, e.callback);
|
|
69240
|
+
}
|
|
69241
|
+
});
|
|
69242
|
+
}
|
|
69243
|
+
}
|
|
69244
|
+
}
|
|
69066
69245
|
}
|
|
69067
69246
|
|
|
69068
69247
|
var core = /*#__PURE__*/Object.freeze({
|
|
@@ -70204,6 +70383,11 @@
|
|
|
70204
70383
|
clearCellRangeMap() {
|
|
70205
70384
|
this._cellRangeMap.clear();
|
|
70206
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
|
+
}
|
|
70207
70391
|
}
|
|
70208
70392
|
|
|
70209
70393
|
class Title {
|
|
@@ -70375,7 +70559,7 @@
|
|
|
70375
70559
|
});
|
|
70376
70560
|
}
|
|
70377
70561
|
startEditCell(col, row) {
|
|
70378
|
-
if (this.table.isHeader(col, row)) {
|
|
70562
|
+
if (this.table.isPivotTable() && this.table.isHeader(col, row)) {
|
|
70379
70563
|
return;
|
|
70380
70564
|
}
|
|
70381
70565
|
const editor = this.table.getEditor(col, row);
|
|
@@ -70383,10 +70567,12 @@
|
|
|
70383
70567
|
if (this.table.getCustomRender(col, row) || this.table.getCustomLayout(col, row)) {
|
|
70384
70568
|
return;
|
|
70385
70569
|
}
|
|
70386
|
-
|
|
70387
|
-
|
|
70388
|
-
|
|
70389
|
-
|
|
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
|
+
}
|
|
70390
70576
|
}
|
|
70391
70577
|
editor.bindSuccessCallback?.(() => {
|
|
70392
70578
|
this.completeEdit();
|
|
@@ -70394,7 +70580,7 @@
|
|
|
70394
70580
|
this.editingEditor = editor;
|
|
70395
70581
|
this.editCell = { col, row };
|
|
70396
70582
|
const dataValue = this.table.getCellOriginValue(col, row);
|
|
70397
|
-
const rect = this.table.
|
|
70583
|
+
const rect = this.table.getCellRangeRelativeRect(this.table.getCellRange(col, row));
|
|
70398
70584
|
editor.beginEditing(this.table.getElement(), { rect: { left: rect.left, top: rect.top, width: rect.width, height: rect.height } }, dataValue);
|
|
70399
70585
|
}
|
|
70400
70586
|
}
|
|
@@ -70488,6 +70674,7 @@
|
|
|
70488
70674
|
this.scenegraph.clearCells();
|
|
70489
70675
|
this.headerStyleCache = new Map();
|
|
70490
70676
|
this.bodyStyleCache = new Map();
|
|
70677
|
+
this.bodyBottomStyleCache = new Map();
|
|
70491
70678
|
this.scenegraph.createSceneGraph();
|
|
70492
70679
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
70493
70680
|
this.renderAsync();
|
|
@@ -71057,7 +71244,9 @@
|
|
|
71057
71244
|
}
|
|
71058
71245
|
getEditor(col, row) {
|
|
71059
71246
|
const define = this.getBodyColumnDefine(col, row);
|
|
71060
|
-
let editorDefine =
|
|
71247
|
+
let editorDefine = this.isHeader(col, row)
|
|
71248
|
+
? define?.headerEditor ?? this.options.headerEditor
|
|
71249
|
+
: define?.editor ?? this.options.editor;
|
|
71061
71250
|
if (typeof editorDefine === 'function') {
|
|
71062
71251
|
const arg = {
|
|
71063
71252
|
col,
|
|
@@ -71076,8 +71265,19 @@
|
|
|
71076
71265
|
changeCellValue(col, row, value) {
|
|
71077
71266
|
const recordIndex = this.getRecordShowIndexByCell(col, row);
|
|
71078
71267
|
const { field } = this.internalProps.layoutMap.getBody(col, row);
|
|
71079
|
-
this.
|
|
71080
|
-
this.
|
|
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
|
+
}
|
|
71081
71281
|
if (this.widthMode === 'adaptive' || (this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth)) {
|
|
71082
71282
|
if (this.internalProps._widthResizedColMap.size === 0) {
|
|
71083
71283
|
this.scenegraph.recalculateColWidths();
|
|
@@ -71101,7 +71301,7 @@
|
|
|
71101
71301
|
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
71102
71302
|
col,
|
|
71103
71303
|
row,
|
|
71104
|
-
rawValue:
|
|
71304
|
+
rawValue: beforeChangeValue,
|
|
71105
71305
|
changedValue: this.getCellOriginValue(col, row)
|
|
71106
71306
|
});
|
|
71107
71307
|
this.scenegraph.updateNextFrame();
|
|
@@ -76837,42 +77037,6 @@
|
|
|
76837
77037
|
}
|
|
76838
77038
|
});
|
|
76839
77039
|
}
|
|
76840
|
-
onVChartEvent(type, query, callback) {
|
|
76841
|
-
if (!this._chartEventMap[type]) {
|
|
76842
|
-
this._chartEventMap[type] = [];
|
|
76843
|
-
}
|
|
76844
|
-
if (typeof query === 'function') {
|
|
76845
|
-
this._chartEventMap[type].push({ callback: query });
|
|
76846
|
-
}
|
|
76847
|
-
else {
|
|
76848
|
-
this._chartEventMap[type].push({ callback, query });
|
|
76849
|
-
}
|
|
76850
|
-
}
|
|
76851
|
-
offVChartEvent(type, callback) {
|
|
76852
|
-
if (!this._chartEventMap[type]) {
|
|
76853
|
-
return;
|
|
76854
|
-
}
|
|
76855
|
-
if (callback) {
|
|
76856
|
-
this._chartEventMap[type] = this._chartEventMap[type].filter(e => e.callback !== callback);
|
|
76857
|
-
}
|
|
76858
|
-
else {
|
|
76859
|
-
this._chartEventMap[type] = [];
|
|
76860
|
-
}
|
|
76861
|
-
}
|
|
76862
|
-
_bindChartEvent(activeChartInstance) {
|
|
76863
|
-
if (activeChartInstance) {
|
|
76864
|
-
for (const key in this._chartEventMap) {
|
|
76865
|
-
(this._chartEventMap[key] || []).forEach(e => {
|
|
76866
|
-
if (e.query) {
|
|
76867
|
-
activeChartInstance.on(key, e.query, e.callback);
|
|
76868
|
-
}
|
|
76869
|
-
else {
|
|
76870
|
-
activeChartInstance.on(key, e.callback);
|
|
76871
|
-
}
|
|
76872
|
-
});
|
|
76873
|
-
}
|
|
76874
|
-
}
|
|
76875
|
-
}
|
|
76876
77040
|
updateFilterRules(filterRules) {
|
|
76877
77041
|
this.internalProps.dataConfig.filterRules = filterRules;
|
|
76878
77042
|
this.dataset.updateFilterRules(filterRules);
|
|
@@ -77526,7 +77690,7 @@
|
|
|
77526
77690
|
return new Tag$1(params ? params.attribute : {});
|
|
77527
77691
|
}
|
|
77528
77692
|
|
|
77529
|
-
const version = "0.17.5
|
|
77693
|
+
const version = "0.17.5";
|
|
77530
77694
|
function getIcons() {
|
|
77531
77695
|
return get$2();
|
|
77532
77696
|
}
|