@visactor/vtable 1.6.1 → 1.7.0-alpha.0
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/core/BaseTable.d.ts +2 -0
- package/cjs/core/BaseTable.js +8 -4
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +1 -1
- package/cjs/core/tableHelper.js +5 -4
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/event/listener/table-group.js +6 -4
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +18 -14
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js +9 -14
- package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/cjs/state/state.d.ts +2 -2
- package/cjs/state/state.js +4 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +6 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/style.d.ts +2 -1
- package/cjs/tools/style.js +9 -3
- package/cjs/tools/style.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +46 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +105 -43
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.d.ts +2 -0
- package/es/core/BaseTable.js +9 -6
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/core/tableHelper.d.ts +1 -1
- package/es/core/tableHelper.js +5 -3
- package/es/core/tableHelper.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +1 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/event/listener/table-group.js +6 -4
- package/es/event/listener/table-group.js.map +1 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/component/table-component.js +18 -14
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js +6 -9
- package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/es/state/state.d.ts +2 -2
- package/es/state/state.js +4 -4
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +6 -0
- package/es/themes/theme.js.map +1 -1
- package/es/tools/style.d.ts +2 -1
- package/es/tools/style.js +7 -2
- package/es/tools/style.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +46 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":";;;AA8fA,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, CellInfo } from './common';\nimport type { ColumnIconOption, 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, ListTableProtected } from './base-table';\nimport type {\n Aggregation,\n AggregationType,\n CustomAggregation,\n FilterRules,\n IPivotTableDataConfig\n} 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 { 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';\nimport type { ICustomRender } from './customElement';\nimport type { ICustomLayout } from './customLayout';\nimport type { StylePropertyFunctionArg } from './style-define';\n\nexport interface CellAddress {\n col: number;\n row: number;\n}\nexport interface CellAddressWithBound {\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 WidthAdaptiveModeDef = 'only-body' | 'all';\nexport type HeightAdaptiveModeDef = 'only-body' | 'all';\nexport type ShowColumnRowType = 'column' | 'row' | 'none' | 'all';\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 | 'rowSeriesNumber'\n | 'colSeriesNumber';\n\nexport interface SelectAllOnCtrlAOption {\n disableHeaderSelect?: boolean;\n disableRowSeriesNumberSelect?: boolean;\n}\n\nexport interface TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格按下enter键进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** enter键 默认fasle 按下enter键选择下一个单元格。和editCellOnEnter互斥,同设置为true优先级高于editCellOnEnter */\n moveFocusCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean | SelectAllOnCtrlAOption;\n /** 快捷键复制 默认:false*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n /** 快捷键粘贴,默认:false 。粘贴内容到指定位置(即粘贴前要有选中的单元格);支持批量粘贴;粘贴生效仅针对配置了编辑 editor 的单元格;*/\n pasteValueToCell?: boolean; //paste是和浏览器的快捷键一致的\n}\nexport interface TableEventOptions {\n /** 是否阻止右键的默认行为, 默认为true。*/\n preventDefaultContextMenu?: boolean;\n}\n\nexport interface IRowSeriesNumber {\n width?: number | 'auto';\n // align?: 'left' | 'right';\n // span?: number | 'dependOnNear';\n title?: string;\n // field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerIcon?: string | ColumnIconOption | (string | ColumnIconOption)[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n // /** 选中整行或者全选时 是否包括序号部分 */\n // selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否禁止列宽调整 */\n disableColumnResize?: boolean;\n}\n\nexport interface ColumnSeriesNumber {\n enable: boolean;\n align?: 'top' | 'bottom';\n span?: number | 'dependOnNear';\n title?: string;\n field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n /** 选中整行或者全选时 是否包括序号部分 */\n selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否显示调换顺序的图标 */\n showDragOrderIcon?: boolean;\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 hierarchyExpandLevel: number;\n\n getGroupLength?: () => number;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\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 /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n hierarchyTextStartAlignment?: boolean;\n /** 分页配置 */\n pagination?: IPagination;\n\n /**\n * 排序状态\n */\n sortState?: SortState | SortState[];\n\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' | 'keydown' | ('doubleclick' | 'click' | 'api' | 'keydown')[];\n /** 拖拽表头移动位置 针对冻结部分的规则 默认为fixedFrozenCount\n * \"disabled\"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。\n * \"adjustFrozenCount\"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。\n * \"fixedFrozenCount\"(可调整冻结列,并维持冻结数量不变):允许自由拖拽其他列的表头移入或移出冻结列位置,同时保持冻结列的数量不变。\n */\n frozenColDragHeaderMode?: 'disabled' | 'adjustFrozenCount' | 'fixedFrozenCount';\n aggregation?:\n | Aggregation\n | CustomAggregation\n | (Aggregation | CustomAggregation)[]\n | ((args: {\n col: number;\n field: string;\n }) => Aggregation | CustomAggregation | (Aggregation | CustomAggregation)[] | null);\n\n enableTreeNodeMerge?: boolean;\n groupBy?: GroupByOption;\n groupTitleCustomLayout?: ICustomLayout;\n\n enableTreeStickCell?: boolean;\n}\n\nexport type GroupByOption = string | string[] | GroupConfig | GroupConfig[];\n\nexport type GroupConfig = {\n key: string;\n sort?: SortOrder;\n};\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\n // /** 数据分析相关配置 */\n // dataConfig?: IListTableDataConfig;\n internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell?: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n * @param workOnEditableCell 是否仅更改可编辑单元格\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell?: boolean) => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n //#region 编辑器相关demo\n /** 获取单元格配置的编辑器 */\n getEditor: (col: number, row: number) => IEditor;\n /**\n * 开启单元格编辑\n * @param col\n * @param row\n * @param value 如果想要改变显示到编辑框中的值 可以value来设置改变\n * @returns\n */\n startEditCell: (col?: number, row?: number, value?: string | 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 updateRecords: (records: any[], recordIndexs: number[]) => void;\n updateFilterRules: (filterRules: FilterRules) => void;\n getAggregateValuesByField: (field: string | number) => {\n col: number;\n aggregateValue: { aggregationType: AggregationType; value: number | string }[];\n }[];\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 rowResizeType?: 'row' | '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 /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n rowHierarchyTextStartAlignment?: boolean;\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 /** 数据分析相关配置 */\n dataConfig?: IPivotTableDataConfig;\n\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 是否需要补充指标节点到对应的自定义表头中如rowTree或者columnTree. 默认为true */\n supplementIndicatorNodes?: boolean;\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 rowResizeType?: 'row' | '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: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n isListTable: () => false;\n isPivotTable: () => true;\n getPivotSortState: (col: number, row: number) => SortOrder;\n toggleHierarchyState: (col: number, row: number) => void;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => 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[] | true;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\n /** 是否为虚拟节点 在基于records数据做分析时忽略该维度字段 */\n virtual?: boolean;\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 customLayout?: ICustomLayout;\n customRender?: ICustomRender;\n};\n\nexport type ColumnInfo = { col: number; left: number; right: number; width: number };\nexport type RowInfo = { row: number; top: number; bottom: number; height: number };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":";;;AAigBA,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, CellInfo } from './common';\nimport type { ColumnIconOption, 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, ListTableProtected } from './base-table';\nimport type {\n Aggregation,\n AggregationType,\n CustomAggregation,\n FilterRules,\n IPivotTableDataConfig\n} 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';\n\nimport type { ColumnDefine, ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\n\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';\nimport type { ICustomRender } from './customElement';\nimport type { ICustomLayout } from './customLayout';\nimport type { ColorPropertyDefine, StylePropertyFunctionArg } from './style-define';\nimport type { TableTheme } from '../themes/theme';\n\nexport interface CellAddress {\n col: number;\n row: number;\n}\nexport interface CellAddressWithBound {\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 WidthAdaptiveModeDef = 'only-body' | 'all';\nexport type HeightAdaptiveModeDef = 'only-body' | 'all';\nexport type ShowColumnRowType = 'column' | 'row' | 'none' | 'all';\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 | 'rowSeriesNumber'\n | 'colSeriesNumber';\n\nexport interface SelectAllOnCtrlAOption {\n disableHeaderSelect?: boolean;\n disableRowSeriesNumberSelect?: boolean;\n}\n\nexport interface TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格按下enter键进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** enter键 默认fasle 按下enter键选择下一个单元格。和editCellOnEnter互斥,同设置为true优先级高于editCellOnEnter */\n moveFocusCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean | SelectAllOnCtrlAOption;\n /** 快捷键复制 默认:false*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n /** 快捷键粘贴,默认:false 。粘贴内容到指定位置(即粘贴前要有选中的单元格);支持批量粘贴;粘贴生效仅针对配置了编辑 editor 的单元格;*/\n pasteValueToCell?: boolean; //paste是和浏览器的快捷键一致的\n}\nexport interface TableEventOptions {\n /** 是否阻止右键的默认行为, 默认为true。*/\n preventDefaultContextMenu?: boolean;\n}\n\nexport interface IRowSeriesNumber {\n width?: number | 'auto';\n // align?: 'left' | 'right';\n // span?: number | 'dependOnNear';\n title?: string;\n // field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerIcon?: string | ColumnIconOption | (string | ColumnIconOption)[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n // /** 选中整行或者全选时 是否包括序号部分 */\n // selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否禁止列宽调整 */\n disableColumnResize?: boolean;\n}\n\nexport interface ColumnSeriesNumber {\n enable: boolean;\n align?: 'top' | 'bottom';\n span?: number | 'dependOnNear';\n title?: string;\n field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n /** 选中整行或者全选时 是否包括序号部分 */\n selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否显示调换顺序的图标 */\n showDragOrderIcon?: boolean;\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 hierarchyExpandLevel: number;\n\n getGroupLength?: () => number;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\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 /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n hierarchyTextStartAlignment?: boolean;\n /** 分页配置 */\n pagination?: IPagination;\n\n /**\n * 排序状态\n */\n sortState?: SortState | SortState[];\n\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' | 'keydown' | ('doubleclick' | 'click' | 'api' | 'keydown')[];\n /** 拖拽表头移动位置 针对冻结部分的规则 默认为fixedFrozenCount\n * \"disabled\"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。\n * \"adjustFrozenCount\"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。\n * \"fixedFrozenCount\"(可调整冻结列,并维持冻结数量不变):允许自由拖拽其他列的表头移入或移出冻结列位置,同时保持冻结列的数量不变。\n */\n frozenColDragHeaderMode?: 'disabled' | 'adjustFrozenCount' | 'fixedFrozenCount';\n aggregation?:\n | Aggregation\n | CustomAggregation\n | (Aggregation | CustomAggregation)[]\n | ((args: {\n col: number;\n field: string;\n }) => Aggregation | CustomAggregation | (Aggregation | CustomAggregation)[] | null);\n\n enableTreeNodeMerge?: boolean;\n groupBy?: GroupByOption;\n groupTitleCustomLayout?: ICustomLayout;\n\n enableTreeStickCell?: boolean;\n}\n\nexport type GroupByOption = string | string[] | GroupConfig | GroupConfig[];\n\nexport type GroupConfig = {\n key: string;\n sort?: SortOrder;\n};\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\n // /** 数据分析相关配置 */\n // dataConfig?: IListTableDataConfig;\n internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell?: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n * @param workOnEditableCell 是否仅更改可编辑单元格\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell?: boolean) => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n //#region 编辑器相关demo\n /** 获取单元格配置的编辑器 */\n getEditor: (col: number, row: number) => IEditor;\n /**\n * 开启单元格编辑\n * @param col\n * @param row\n * @param value 如果想要改变显示到编辑框中的值 可以value来设置改变\n * @returns\n */\n startEditCell: (col?: number, row?: number, value?: string | 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 updateRecords: (records: any[], recordIndexs: number[]) => void;\n updateFilterRules: (filterRules: FilterRules) => void;\n getAggregateValuesByField: (field: string | number) => {\n col: number;\n aggregateValue: { aggregationType: AggregationType; value: number | string }[];\n }[];\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 rowResizeType?: 'row' | '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 /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n rowHierarchyTextStartAlignment?: boolean;\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 /** 数据分析相关配置 */\n dataConfig?: IPivotTableDataConfig;\n\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 是否需要补充指标节点到对应的自定义表头中如rowTree或者columnTree. 默认为true */\n supplementIndicatorNodes?: boolean;\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 rowResizeType?: 'row' | '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: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n isListTable: () => false;\n isPivotTable: () => true;\n getPivotSortState: (col: number, row: number) => SortOrder;\n toggleHierarchyState: (col: number, row: number) => void;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => 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[] | true;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\n /** 是否为虚拟节点 在基于records数据做分析时忽略该维度字段 */\n virtual?: boolean;\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 customLayout?: ICustomLayout;\n customRender?: ICustomRender;\n};\n\nexport type ColumnInfo = { col: number; left: number; right: number; width: number };\nexport type RowInfo = { row: number; top: number; bottom: number; height: number };\n\n//#region gantt\nexport interface GanttConstructorOptions {\n container?: HTMLElement;\n /**\n * 数据集合\n */\n records?: any[];\n /** 时间刻度 */\n timelineScales: {\n unit: 'day' | 'week' | 'month' | 'quarter' | 'year';\n step: number;\n format: (date: Date) => string;\n // 时间刻度对应的字段名\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n }[];\n /** 定义列 */\n infoTableColumns?: ColumnsDefine; // (string | IDimension)[];\n infoTableWidth?: 'auto' | number;\n gridStyle?: {\n vertical: {\n lineColor?: string;\n lineWidth?: number;\n };\n horizontal: {\n lineColor?: string;\n lineWidth?: number;\n };\n };\n timelineStyle?: {} | {}[];\n /** 时间刻度对应的字段名 */\n startField: string;\n /** 时间刻度对应的字段名 */\n endField: string;\n /** 指定整个甘特图的最小日期 */\n minDate?: string;\n /** 指定整个甘特图的最大日期 不设置的话用默认规则*/\n maxDate?: string;\n\n /** 设置的表格主题 */\n theme?: TableTheme;\n /** 设置任务条样式 可以设置多组 依次循环使用 */\n barStyle?: IBarStyleOption[];\n defaultHeaderRowHeight?: number;\n defaultRowHeight?: number;\n timelineColWidth?: number;\n\n rowSeriesNumber?: IRowSeriesNumber;\n dragHeader?: boolean;\n\n /**\n * 'auto':和浏览器滚动行为一致 表格滚动到顶部/底部时 触发浏览器默认行为;\n * 设置为 'none' 时, 表格滚动到顶部/底部时, 不再触发父容器滚动\n * */\n overscrollBehavior?: 'auto' | 'none';\n\n // infoTableTheme?: ITableThemeDefine;\n}\n\nexport type IBarStyleOption = {\n /** 任务条的颜色 */\n barColor?: ColorPropertyDefine;\n /** 已完成部分任务条的颜色 */\n barColor2?: ColorPropertyDefine;\n /** 任务条的宽度 */\n width?: number;\n /** 任务条的圆角 */\n cornerRadius?: number;\n /** 任务条的边框 */\n borderWidth?: number;\n /** 边框颜色 */\n borderColor?: ColorPropertyDefine;\n font?: ITextStyleOption;\n};\n//#endregion\n"]}
|
package/cjs/ts-types/theme.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export type ScrollStyle = {
|
|
|
48
48
|
scrollSliderCornerRadius?: number;
|
|
49
49
|
width?: number;
|
|
50
50
|
visible?: 'always' | 'scrolling' | 'none' | 'focus';
|
|
51
|
+
horizontalVisible?: 'always' | 'scrolling' | 'none' | 'focus';
|
|
52
|
+
verticalVisible?: 'always' | 'scrolling' | 'none' | 'focus';
|
|
51
53
|
hoverOn?: boolean;
|
|
52
54
|
barToSide?: boolean;
|
|
53
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine, LineDashsPropertyDefine } from '.';\nimport type { CheckboxStyle, ITextStyleOption, RadioStyle } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from '@visactor/vrender-components';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n select?: {\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n };\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number | [number, number, number, number]; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条滑块的圆角半径 */\n scrollSliderCornerRadius?: number;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 */\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n /** 是否显示到容器的边缘 尽管内容没有撑满的情况下 默认false */\n barToSide?: boolean;\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n maxWidth?: number;\n maxHeight?: number;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n groupTitleStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n inlineRowBgColor?: string; //交互所在整行的背景颜色\n inlineColumnBgColor?: string; //交互所在整列的背景颜色\n selectionFillMode?: 'overlay' | 'replace'; //选择框填充模式,overlay表示选择框背景色覆盖在表格上(需要配饰透明度),replace表示背景色替换原有单元格的背景色\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n };\n\n checkboxStyle?: CheckboxStyle;\n radioStyle?: RadioStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 表格四侧单元格,靠近边缘的border是否需要再绘制;如配置false的话,当表格左侧frame未设置情况下左侧单元格不显示左边框,其他方向同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine, LineDashsPropertyDefine } from '.';\nimport type { CheckboxStyle, ITextStyleOption, RadioStyle } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from '@visactor/vrender-components';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n select?: {\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n };\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number | [number, number, number, number]; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条滑块的圆角半径 */\n scrollSliderCornerRadius?: number;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 */\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n horizontalVisible?: 'always' | 'scrolling' | 'none' | 'focus';\n verticalVisible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n /** 是否显示到容器的边缘 尽管内容没有撑满的情况下 默认false */\n barToSide?: boolean;\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n maxWidth?: number;\n maxHeight?: number;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n groupTitleStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n inlineRowBgColor?: string; //交互所在整行的背景颜色\n inlineColumnBgColor?: string; //交互所在整列的背景颜色\n selectionFillMode?: 'overlay' | 'replace'; //选择框填充模式,overlay表示选择框背景色覆盖在表格上(需要配饰透明度),replace表示背景色替换原有单元格的背景色\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n };\n\n checkboxStyle?: CheckboxStyle;\n radioStyle?: RadioStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 表格四侧单元格,靠近边缘的border是否需要再绘制;如配置false的话,当表格左侧frame未设置情况下左侧单元格不显示左边框,其他方向同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
|
package/cjs/vrender.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAA0D;AAC1D,kCAAgC;AAChC,yDAA8F;AAC9F,yDAqBgC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,SAAgB,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,IAAA,+BAAgB,GAAE,CAAC;IAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;QAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;QACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;KACxB;IACD,IAAA,0BAAW,GAAE,CAAC;IAGd,IAAA,6BAAc,GAAE,CAAC;IAEjB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IAIf,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,iCAAkB,GAAE,CAAC;IACrB,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAA0D;AAC1D,kCAAgC;AAChC,yDAA8F;AAC9F,yDAqBgC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,SAAgB,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,IAAA,+BAAgB,GAAE,CAAC;IAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;QAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;QACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;KACxB;IACD,IAAA,0BAAW,GAAE,CAAC;IAGd,IAAA,6BAAc,GAAE,CAAC;IAEjB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IAIf,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,iCAAkB,GAAE,CAAC;IACrB,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAU,GAAE,CAAC;AACf,CAAC;AAhCD,gDAgCC;AAED,uDAA6D;AAApD,yGAAA,SAAS,OAAA;AAClB,uDAAqD;AAA5C,2GAAA,WAAW,OAAA;AACpB,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AAErB,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.7.0-alpha.0\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n // registerArc3d();\n // registerArea();\n registerCircle();\n // registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n // registerPath();\n // registerPolygon();\n // registerPyramid3d();\n registerRect();\n // registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n // registerWrapText();\n loadPoptip();\n}\n\nexport { Direction, Timeline } from '@visactor/vrender-core';\nexport { GroupFadeIn } from '@visactor/vrender-core';\nexport { GroupFadeOut } from '@visactor/vrender-core';\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-components';\n"]}
|
package/dist/vtable.js
CHANGED
|
@@ -44102,6 +44102,18 @@
|
|
|
44102
44102
|
|
|
44103
44103
|
overflow: hidden; // for react-vtable dom custom element
|
|
44104
44104
|
}
|
|
44105
|
+
|
|
44106
|
+
.vtable-gantt {
|
|
44107
|
+
/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */
|
|
44108
|
+
/* overflow: auto; */
|
|
44109
|
+
position: absolute;
|
|
44110
|
+
width: 100%;
|
|
44111
|
+
height: 100%;
|
|
44112
|
+
text-align: left;
|
|
44113
|
+
-webkit-font-smoothing:auto;
|
|
44114
|
+
|
|
44115
|
+
overflow: hidden; // for react-vtable dom custom element
|
|
44116
|
+
}
|
|
44105
44117
|
.vtable .table-component-container {
|
|
44106
44118
|
pointer-events: none;
|
|
44107
44119
|
overflow: hidden;
|
|
@@ -44139,8 +44151,18 @@
|
|
|
44139
44151
|
document.head.appendChild(styleElement);
|
|
44140
44152
|
}
|
|
44141
44153
|
|
|
44142
|
-
function
|
|
44143
|
-
if (scrollStyle?.hoverOn ||
|
|
44154
|
+
function getHorizontalScrollBarSize(scrollStyle) {
|
|
44155
|
+
if (scrollStyle?.hoverOn ||
|
|
44156
|
+
(scrollStyle?.horizontalVisible && scrollStyle?.horizontalVisible === 'none') ||
|
|
44157
|
+
(!scrollStyle?.horizontalVisible && scrollStyle?.visible === 'none')) {
|
|
44158
|
+
return 0;
|
|
44159
|
+
}
|
|
44160
|
+
return scrollStyle?.width ?? 7;
|
|
44161
|
+
}
|
|
44162
|
+
function getVerticalScrollBarSize(scrollStyle) {
|
|
44163
|
+
if (scrollStyle?.hoverOn ||
|
|
44164
|
+
(scrollStyle?.verticalVisible && scrollStyle?.verticalVisible === 'none') ||
|
|
44165
|
+
(!scrollStyle?.verticalVisible && scrollStyle?.visible === 'none')) {
|
|
44144
44166
|
return 0;
|
|
44145
44167
|
}
|
|
44146
44168
|
return scrollStyle?.width ?? 7;
|
|
@@ -46012,6 +46034,12 @@
|
|
|
46012
46034
|
get visible() {
|
|
46013
46035
|
return scroll.visible ?? 'scrolling';
|
|
46014
46036
|
},
|
|
46037
|
+
get verticalVisible() {
|
|
46038
|
+
return scroll.verticalVisible;
|
|
46039
|
+
},
|
|
46040
|
+
get horizontalVisible() {
|
|
46041
|
+
return scroll.horizontalVisible;
|
|
46042
|
+
},
|
|
46015
46043
|
get width() {
|
|
46016
46044
|
return scroll.width ?? 7;
|
|
46017
46045
|
},
|
|
@@ -48802,10 +48830,10 @@
|
|
|
48802
48830
|
return couldBeValidNumber(v.substring(0, v.length - 1));
|
|
48803
48831
|
}
|
|
48804
48832
|
|
|
48805
|
-
function createRootElement(padding) {
|
|
48833
|
+
function createRootElement(padding, className = 'vtable') {
|
|
48806
48834
|
const element = document.createElement('div');
|
|
48807
48835
|
element.setAttribute('tabindex', '0');
|
|
48808
|
-
element.classList.add(
|
|
48836
|
+
element.classList.add(className);
|
|
48809
48837
|
element.style.outline = 'none';
|
|
48810
48838
|
element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
48811
48839
|
const width = (element.offsetWidth || element.parentElement?.offsetWidth || 1) - 1;
|
|
@@ -49021,7 +49049,13 @@
|
|
|
49021
49049
|
underlineDash,
|
|
49022
49050
|
underlineOffset,
|
|
49023
49051
|
lineThrough: lineThrough ? textDecorationWidth : undefined,
|
|
49024
|
-
ellipsis:
|
|
49052
|
+
ellipsis: textOverflow === 'clip'
|
|
49053
|
+
? ''
|
|
49054
|
+
: textOverflow === 'ellipsis'
|
|
49055
|
+
? '...'
|
|
49056
|
+
: isValid$3(textOverflow)
|
|
49057
|
+
? textOverflow
|
|
49058
|
+
: undefined
|
|
49025
49059
|
},
|
|
49026
49060
|
group: {
|
|
49027
49061
|
fill: bgColor,
|
|
@@ -50458,12 +50492,11 @@
|
|
|
50458
50492
|
}
|
|
50459
50493
|
|
|
50460
50494
|
function getCellBorderStrokeWidth(col, row, cellTheme, table) {
|
|
50461
|
-
const frameBorderLineWidths = style.toBoxArray(table.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
50462
50495
|
let strokeArrayWidth = cellTheme?.group?.strokeArrayWidth ?? undefined;
|
|
50463
50496
|
if (table.theme.cellInnerBorder) {
|
|
50464
50497
|
return strokeArrayWidth;
|
|
50465
50498
|
}
|
|
50466
|
-
if (col === 0
|
|
50499
|
+
if (col === 0) {
|
|
50467
50500
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
50468
50501
|
cellTheme?.group?.lineWidth,
|
|
50469
50502
|
cellTheme?.group?.lineWidth,
|
|
@@ -50472,7 +50505,7 @@
|
|
|
50472
50505
|
];
|
|
50473
50506
|
strokeArrayWidth[3] = 0;
|
|
50474
50507
|
}
|
|
50475
|
-
if (col === table.colCount - 1
|
|
50508
|
+
if (col === table.colCount - 1) {
|
|
50476
50509
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
50477
50510
|
cellTheme?.group?.lineWidth,
|
|
50478
50511
|
cellTheme?.group?.lineWidth,
|
|
@@ -50481,7 +50514,7 @@
|
|
|
50481
50514
|
];
|
|
50482
50515
|
strokeArrayWidth[1] = 0;
|
|
50483
50516
|
}
|
|
50484
|
-
if (row === 0
|
|
50517
|
+
if (row === 0) {
|
|
50485
50518
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
50486
50519
|
cellTheme?.group?.lineWidth,
|
|
50487
50520
|
cellTheme?.group?.lineWidth,
|
|
@@ -50490,7 +50523,7 @@
|
|
|
50490
50523
|
];
|
|
50491
50524
|
strokeArrayWidth[0] = 0;
|
|
50492
50525
|
}
|
|
50493
|
-
if (row === table.rowCount - 1
|
|
50526
|
+
if (row === table.rowCount - 1) {
|
|
50494
50527
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
50495
50528
|
cellTheme?.group?.lineWidth,
|
|
50496
50529
|
cellTheme?.group?.lineWidth,
|
|
@@ -54390,7 +54423,9 @@
|
|
|
54390
54423
|
const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;
|
|
54391
54424
|
const theme = this.table.theme;
|
|
54392
54425
|
const width = theme.scrollStyle?.width;
|
|
54393
|
-
const
|
|
54426
|
+
const visible1 = theme.scrollStyle?.visible;
|
|
54427
|
+
const horizontalVisible = theme.scrollStyle?.horizontalVisible ?? visible1;
|
|
54428
|
+
const verticalVisible = theme.scrollStyle?.verticalVisible ?? visible1;
|
|
54394
54429
|
const tableWidth = Math.ceil(this.table.scenegraph.tableGroup.attribute.width);
|
|
54395
54430
|
const tableHeight = Math.ceil(this.table.scenegraph.tableGroup.attribute.height);
|
|
54396
54431
|
const totalHeight = this.table.getAllRowsHeight();
|
|
@@ -54419,14 +54454,14 @@
|
|
|
54419
54454
|
y: attrY,
|
|
54420
54455
|
width: tableWidth - frozenColsWidth - rightFrozenColsWidth,
|
|
54421
54456
|
range: [0, rangeEnd],
|
|
54422
|
-
visible:
|
|
54457
|
+
visible: horizontalVisible === 'always'
|
|
54423
54458
|
});
|
|
54424
54459
|
const bounds = this.hScrollBar.AABBBounds && this.hScrollBar.globalAABBBounds;
|
|
54425
54460
|
this.hScrollBar._viewPosition = {
|
|
54426
54461
|
x: bounds.x1,
|
|
54427
54462
|
y: bounds.y1
|
|
54428
54463
|
};
|
|
54429
|
-
if (
|
|
54464
|
+
if (horizontalVisible === 'always') {
|
|
54430
54465
|
this.hScrollBar.showAll();
|
|
54431
54466
|
}
|
|
54432
54467
|
}
|
|
@@ -54457,14 +54492,14 @@
|
|
|
54457
54492
|
y: frozenRowsHeight + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.y : 0),
|
|
54458
54493
|
height: tableHeight - frozenRowsHeight - bottomFrozenRowsHeight,
|
|
54459
54494
|
range: [0, rangeEnd],
|
|
54460
|
-
visible:
|
|
54495
|
+
visible: verticalVisible === 'always'
|
|
54461
54496
|
});
|
|
54462
54497
|
const bounds = this.vScrollBar.AABBBounds && this.vScrollBar.globalAABBBounds;
|
|
54463
54498
|
this.vScrollBar._viewPosition = {
|
|
54464
54499
|
x: bounds.x1,
|
|
54465
54500
|
y: bounds.y1
|
|
54466
54501
|
};
|
|
54467
|
-
if (
|
|
54502
|
+
if (verticalVisible === 'always') {
|
|
54468
54503
|
this.vScrollBar.showAll();
|
|
54469
54504
|
}
|
|
54470
54505
|
}
|
|
@@ -54627,8 +54662,9 @@
|
|
|
54627
54662
|
}
|
|
54628
54663
|
}
|
|
54629
54664
|
hideVerticalScrollBar() {
|
|
54630
|
-
const
|
|
54631
|
-
|
|
54665
|
+
const visible1 = this.table.theme.scrollStyle.visible;
|
|
54666
|
+
const verticalVisible = this.table.theme.scrollStyle.verticalVisible ?? visible1;
|
|
54667
|
+
if (verticalVisible !== 'focus' && verticalVisible !== 'scrolling') {
|
|
54632
54668
|
return;
|
|
54633
54669
|
}
|
|
54634
54670
|
this.vScrollBar.setAttribute('visible', false);
|
|
@@ -54636,8 +54672,9 @@
|
|
|
54636
54672
|
this.table.scenegraph.updateNextFrame();
|
|
54637
54673
|
}
|
|
54638
54674
|
showVerticalScrollBar() {
|
|
54639
|
-
const
|
|
54640
|
-
|
|
54675
|
+
const visible1 = this.table.theme.scrollStyle.visible;
|
|
54676
|
+
const verticalVisible = this.table.theme.scrollStyle.verticalVisible ?? visible1;
|
|
54677
|
+
if (verticalVisible !== 'focus' && verticalVisible !== 'scrolling') {
|
|
54641
54678
|
return;
|
|
54642
54679
|
}
|
|
54643
54680
|
this.vScrollBar.setAttribute('visible', true);
|
|
@@ -54645,8 +54682,9 @@
|
|
|
54645
54682
|
this.table.scenegraph.updateNextFrame();
|
|
54646
54683
|
}
|
|
54647
54684
|
hideHorizontalScrollBar() {
|
|
54648
|
-
const
|
|
54649
|
-
|
|
54685
|
+
const visible1 = this.table.theme.scrollStyle.visible;
|
|
54686
|
+
const horizontalVisible = this.table.theme.scrollStyle.horizontalVisible ?? visible1;
|
|
54687
|
+
if (horizontalVisible !== 'focus' && horizontalVisible !== 'scrolling') {
|
|
54650
54688
|
return;
|
|
54651
54689
|
}
|
|
54652
54690
|
this.hScrollBar.setAttribute('visible', false);
|
|
@@ -54654,8 +54692,9 @@
|
|
|
54654
54692
|
this.table.scenegraph.updateNextFrame();
|
|
54655
54693
|
}
|
|
54656
54694
|
showHorizontalScrollBar() {
|
|
54657
|
-
const
|
|
54658
|
-
|
|
54695
|
+
const visible1 = this.table.theme.scrollStyle.visible;
|
|
54696
|
+
const horizontalVisible = this.table.theme.scrollStyle.horizontalVisible ?? visible1;
|
|
54697
|
+
if (horizontalVisible !== 'focus' && horizontalVisible !== 'scrolling') {
|
|
54659
54698
|
return;
|
|
54660
54699
|
}
|
|
54661
54700
|
this.hScrollBar.setAttribute('visible', true);
|
|
@@ -65103,7 +65142,7 @@
|
|
|
65103
65142
|
this.checkHorizontalScrollBarEnd();
|
|
65104
65143
|
}
|
|
65105
65144
|
}
|
|
65106
|
-
setScrollTop(top) {
|
|
65145
|
+
setScrollTop(top, triggerEvent = true) {
|
|
65107
65146
|
const totalHeight = this.table.getAllRowsHeight();
|
|
65108
65147
|
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
65109
65148
|
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance));
|
|
@@ -65119,7 +65158,7 @@
|
|
|
65119
65158
|
this.table.scenegraph.setY(-top);
|
|
65120
65159
|
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
65121
65160
|
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
65122
|
-
if (oldVerticalBarPos !== top) {
|
|
65161
|
+
if (oldVerticalBarPos !== top && triggerEvent) {
|
|
65123
65162
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
65124
65163
|
scrollTop: this.scroll.verticalBarPos,
|
|
65125
65164
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -65133,7 +65172,7 @@
|
|
|
65133
65172
|
this.checkVerticalScrollBarEnd();
|
|
65134
65173
|
}
|
|
65135
65174
|
}
|
|
65136
|
-
setScrollLeft(left) {
|
|
65175
|
+
setScrollLeft(left, triggerEvent = true) {
|
|
65137
65176
|
this.table.scrollLeft;
|
|
65138
65177
|
const totalWidth = this.table.getAllColsWidth();
|
|
65139
65178
|
this.table.getFrozenColsWidth();
|
|
@@ -65151,7 +65190,7 @@
|
|
|
65151
65190
|
this.table.scenegraph.setX(-left);
|
|
65152
65191
|
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
65153
65192
|
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
65154
|
-
if (oldHorizontalBarPos !== left) {
|
|
65193
|
+
if (oldHorizontalBarPos !== left && triggerEvent) {
|
|
65155
65194
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
65156
65195
|
scrollTop: this.scroll.verticalBarPos,
|
|
65157
65196
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -65766,8 +65805,12 @@
|
|
|
65766
65805
|
}
|
|
65767
65806
|
});
|
|
65768
65807
|
table.scenegraph.tableGroup.addEventListener('pointerenter', (e) => {
|
|
65769
|
-
if (table.theme.scrollStyle.
|
|
65808
|
+
if ((table.theme.scrollStyle.horizontalVisible && table.theme.scrollStyle.horizontalVisible === 'focus') ||
|
|
65809
|
+
(!table.theme.scrollStyle.horizontalVisible && table.theme.scrollStyle.visible === 'focus')) {
|
|
65770
65810
|
stateManager.showHorizontalScrollBar();
|
|
65811
|
+
}
|
|
65812
|
+
if ((table.theme.scrollStyle.verticalVisible && table.theme.scrollStyle.verticalVisible === 'focus') ||
|
|
65813
|
+
(!table.theme.scrollStyle.verticalVisible && table.theme.scrollStyle.visible === 'focus')) {
|
|
65771
65814
|
stateManager.showVerticalScrollBar();
|
|
65772
65815
|
}
|
|
65773
65816
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_TABLE)) {
|
|
@@ -65781,8 +65824,12 @@
|
|
|
65781
65824
|
stateManager.updateInteractionState(InteractionState.default);
|
|
65782
65825
|
stateManager.updateCursor();
|
|
65783
65826
|
}
|
|
65784
|
-
if (table.theme.scrollStyle.
|
|
65827
|
+
if ((table.theme.scrollStyle.horizontalVisible && table.theme.scrollStyle.horizontalVisible === 'focus') ||
|
|
65828
|
+
(!table.theme.scrollStyle.horizontalVisible && table.theme.scrollStyle.visible === 'focus')) {
|
|
65785
65829
|
stateManager.hideHorizontalScrollBar();
|
|
65830
|
+
}
|
|
65831
|
+
if ((table.theme.scrollStyle.verticalVisible && table.theme.scrollStyle.verticalVisible === 'focus') ||
|
|
65832
|
+
(!table.theme.scrollStyle.verticalVisible && table.theme.scrollStyle.visible === 'focus')) {
|
|
65786
65833
|
stateManager.hideVerticalScrollBar();
|
|
65787
65834
|
}
|
|
65788
65835
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
|
|
@@ -71923,11 +71970,12 @@
|
|
|
71923
71970
|
eventManager;
|
|
71924
71971
|
editorManager;
|
|
71925
71972
|
_pixelRatio;
|
|
71973
|
+
canvasSizeSeted;
|
|
71926
71974
|
static get EVENT_TYPE() {
|
|
71927
71975
|
return TABLE_EVENT_TYPE;
|
|
71928
71976
|
}
|
|
71929
71977
|
options;
|
|
71930
|
-
version = "1.
|
|
71978
|
+
version = "1.7.0-alpha.0";
|
|
71931
71979
|
pagination;
|
|
71932
71980
|
id = `VTable${Date.now()}`;
|
|
71933
71981
|
headerStyleCache;
|
|
@@ -71971,6 +72019,9 @@
|
|
|
71971
72019
|
padding.right && (this.padding.right = padding.right);
|
|
71972
72020
|
}
|
|
71973
72021
|
}
|
|
72022
|
+
if (isValid$3(canvasHeight) && isValid$3(canvasWidth)) {
|
|
72023
|
+
this.canvasSizeSeted = true;
|
|
72024
|
+
}
|
|
71974
72025
|
this.tableNoFrameWidth = 0;
|
|
71975
72026
|
this.tableNoFrameHeight = 0;
|
|
71976
72027
|
this.canvasWidth = canvasWidth;
|
|
@@ -72141,6 +72192,11 @@
|
|
|
72141
72192
|
get canvas() {
|
|
72142
72193
|
return this.internalProps.canvas;
|
|
72143
72194
|
}
|
|
72195
|
+
setCanvasSize(canvasWidth, canvasHeight) {
|
|
72196
|
+
this.canvasWidth = canvasWidth;
|
|
72197
|
+
this.canvasHeight = canvasHeight;
|
|
72198
|
+
this.resize();
|
|
72199
|
+
}
|
|
72144
72200
|
resize() {
|
|
72145
72201
|
this._updateSize();
|
|
72146
72202
|
this.internalProps.legends?.forEach(legend => {
|
|
@@ -72415,16 +72471,22 @@
|
|
|
72415
72471
|
const element = this.getElement();
|
|
72416
72472
|
let widthWithoutPadding = 0;
|
|
72417
72473
|
let heightWithoutPadding = 0;
|
|
72418
|
-
if (
|
|
72419
|
-
|
|
72420
|
-
|
|
72421
|
-
|
|
72422
|
-
|
|
72423
|
-
|
|
72424
|
-
|
|
72425
|
-
|
|
72426
|
-
|
|
72427
|
-
|
|
72474
|
+
if (this.canvasSizeSeted) {
|
|
72475
|
+
widthWithoutPadding = this.canvasWidth;
|
|
72476
|
+
heightWithoutPadding = this.canvasHeight;
|
|
72477
|
+
}
|
|
72478
|
+
else {
|
|
72479
|
+
if (element.parentElement) {
|
|
72480
|
+
const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement);
|
|
72481
|
+
widthWithoutPadding =
|
|
72482
|
+
element.parentElement.offsetWidth -
|
|
72483
|
+
parseInt(computedStyle.paddingLeft || '0px', 10) -
|
|
72484
|
+
parseInt(computedStyle.paddingRight || '0px', 10);
|
|
72485
|
+
heightWithoutPadding =
|
|
72486
|
+
element.parentElement.offsetHeight -
|
|
72487
|
+
parseInt(computedStyle.paddingTop || '0px', 10) -
|
|
72488
|
+
parseInt(computedStyle.paddingBottom || '0px', 20);
|
|
72489
|
+
}
|
|
72428
72490
|
}
|
|
72429
72491
|
const width1 = widthWithoutPadding ?? 1 - 1;
|
|
72430
72492
|
const height1 = heightWithoutPadding ?? 1 - 1;
|
|
@@ -72457,8 +72519,8 @@
|
|
|
72457
72519
|
widthP = this.canvasWidth - 1;
|
|
72458
72520
|
heightP = this.canvasHeight - 1;
|
|
72459
72521
|
}
|
|
72460
|
-
const width = Math.floor(widthP -
|
|
72461
|
-
const height = Math.floor(heightP -
|
|
72522
|
+
const width = Math.floor(widthP - getVerticalScrollBarSize(this.getTheme().scrollStyle));
|
|
72523
|
+
const height = Math.floor(heightP - getHorizontalScrollBarSize(this.getTheme().scrollStyle));
|
|
72462
72524
|
if (this.internalProps.theme?.frameStyle) {
|
|
72463
72525
|
const lineWidths = toBoxArray(this.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
72464
72526
|
const shadowWidths = toBoxArray(this.internalProps.theme.frameStyle?.shadowBlur ?? [0]);
|
|
@@ -92419,7 +92481,7 @@
|
|
|
92419
92481
|
}
|
|
92420
92482
|
|
|
92421
92483
|
registerForVrender();
|
|
92422
|
-
const version = "1.
|
|
92484
|
+
const version = "1.7.0-alpha.0";
|
|
92423
92485
|
function getIcons() {
|
|
92424
92486
|
return get$2();
|
|
92425
92487
|
}
|