@visactor/vtable 0.16.3 → 0.16.4-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/cjs/core/BaseTable.js +1 -1
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/data/DataSource.js +2 -1
  4. package/cjs/data/DataSource.js.map +1 -1
  5. package/cjs/event/scroll.js +0 -1
  6. package/cjs/event/util.js +1 -0
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  11. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  12. package/cjs/state/hover/is-cell-hover.d.ts +1 -1
  13. package/cjs/state/hover/is-cell-hover.js +8 -5
  14. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  15. package/cjs/tools/diff-cell.d.ts +1 -1
  16. package/cjs/tools/diff-cell.js +32 -2
  17. package/cjs/tools/diff-cell.js.map +1 -1
  18. package/cjs/ts-types/base-table.d.ts +1 -0
  19. package/cjs/ts-types/base-table.js.map +1 -1
  20. package/dist/vtable.js +51 -41
  21. package/dist/vtable.min.js +2 -2
  22. package/es/core/BaseTable.js +1 -1
  23. package/es/core/BaseTable.js.map +1 -1
  24. package/es/data/DataSource.js +3 -2
  25. package/es/data/DataSource.js.map +1 -1
  26. package/es/event/scroll.js +1 -2
  27. package/es/event/util.js +2 -1
  28. package/es/index.d.ts +1 -1
  29. package/es/index.js +1 -1
  30. package/es/index.js.map +1 -1
  31. package/es/scenegraph/layout/compute-row-height.js +1 -1
  32. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  33. package/es/state/hover/is-cell-hover.d.ts +1 -1
  34. package/es/state/hover/is-cell-hover.js +8 -5
  35. package/es/state/hover/is-cell-hover.js.map +1 -1
  36. package/es/tools/diff-cell.d.ts +1 -1
  37. package/es/tools/diff-cell.js +31 -1
  38. package/es/tools/diff-cell.js.map +1 -1
  39. package/es/ts-types/base-table.d.ts +1 -0
  40. package/es/ts-types/base-table.js.map +1 -1
  41. package/package.json +4 -4
@@ -8,7 +8,7 @@ import { EventTarget } from "../event/EventTarget";
8
8
 
9
9
  import { getValueByPath, isAllDigits } from "../tools/util";
10
10
 
11
- import { diffCellIndices } from "../tools/diff-cell";
11
+ import { calculateArrayDiff } from "../tools/diff-cell";
12
12
 
13
13
  import { cloneDeep, isValid } from "@visactor/vutils";
14
14
 
@@ -165,7 +165,8 @@ export class DataSource extends EventTarget {
165
165
  computeChildrenNodeLength(indexed, state, data), this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexed) + 1, childrenLength),
166
166
  this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(",") : indexed, HierarchyState.collapse);
167
167
  }
168
- return this.updatePagerData(), diffCellIndices(oldIndexedData, this.currentIndexedData);
168
+ this.updatePagerData();
169
+ return calculateArrayDiff(oldIndexedData, this.currentIndexedData);
169
170
  }
170
171
  pushChildrenNode(indexKey, hierarchyState, nodeData) {
171
172
  if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) return 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data/DataSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAYtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAStD,SAAS,eAAe,CAAC,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3D,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IACS,gBAAgB,CAAC,KAAwB,EAAE,KAAe;QAClE,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,MAAM,IAAK,KAAa,IAAK,MAAc,CAAC,CAAC;IAC9D,CAAC;IAES,oBAAoB,CAC5B,MAAyB,EACzB,MAAuC,EACvC,MAA+B;IAGjC,CAAC;IACS,qBAAqB,CAAC,MAAyB,EAAE,OAAgC;IAE3F,CAAC;;AAEM,gBAAK,GAAG,IAAI,UAAU,CAAC;IAC5B,GAAG;IAEH,CAAC;IACD,MAAM,EAAE,CAAC;CACV,CAAC,CAAC","file":"DataSource.js","sourcesContent":["import * as sort from '../tools/sort';\nimport type {\n DataSourceAPI,\n FieldAssessor,\n FieldData,\n FieldDef,\n FieldFormat,\n IPagination,\n MaybePromiseOrCallOrUndefined,\n MaybePromiseOrUndefined,\n SortOrder\n} from '../ts-types';\nimport { HierarchyState } from '../ts-types';\nimport { applyChainSafe, getOrApply, obj, isPromise, emptyFn } from '../tools/helper';\nimport { EventTarget } from '../event/EventTarget';\nimport { getValueByPath, isAllDigits } from '../tools/util';\nimport { diffCellIndices } from '../tools/diff-cell';\nimport { cloneDeep, isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport { TABLE_EVENT_TYPE } from '../core/TABLE_EVENT_TYPE';\n\n/**\n * 判断字段数据是否为访问器的格式\n * @param field\n * @returns boolean\n */\nfunction isFieldAssessor(field: FieldDef | FieldFormat | number): field is FieldAssessor {\n if (obj.isObject(field)) {\n const a = field as FieldAssessor;\n if (isValid(a.get) && isValid(a.set)) {\n return true;\n }\n }\n return false;\n}\nconst EVENT_TYPE = {\n SOURCE_LENGTH_UPDATE: 'source_length_update',\n CHANGE_ORDER: 'change_order'\n} as const;\ntype PromiseBack = (value: MaybePromiseOrUndefined) => void;\n\n/**\n * 获取到的某个filed的值 处理可能为promise的情况\n * @param value\n * @param promiseCallBack\n * @returns\n */\nfunction getValue(value: MaybePromiseOrCallOrUndefined, promiseCallBack: PromiseBack): MaybePromiseOrUndefined {\n const maybePromiseOrValue = getOrApply(value);\n if (isPromise(maybePromiseOrValue)) {\n const promiseValue = maybePromiseOrValue.then((r: any) => {\n promiseCallBack(r);\n return r;\n });\n\n promiseCallBack(promiseValue);\n return promiseValue;\n }\n return maybePromiseOrValue;\n}\n/**\n * 根据field获取数据源record对应的值 获取到的可能是个异步Promise 需要设置回调处理逻辑\n * @param record\n * @param field\n * @param promiseCallBack\n * @returns\n */\nexport function getField(\n record: MaybePromiseOrUndefined,\n field: FieldDef | FieldFormat | number,\n col: number,\n row: number,\n table: BaseTableAPI,\n promiseCallBack: PromiseBack\n): FieldData {\n if (record === null || record === undefined) {\n return undefined;\n }\n if (isPromise(record)) {\n return record.then((r: any) => getField(r, field, col, row, table, promiseCallBack));\n }\n const fieldGet: any = isFieldAssessor(field) ? field.get : field;\n if (fieldGet in (record as any)) {\n const fieldResult = (record as any)[fieldGet];\n\n return getValue(fieldResult, promiseCallBack);\n }\n if (typeof fieldGet === 'function') {\n const fieldResult = fieldGet(record, col, row, table);\n return getValue(fieldResult, promiseCallBack);\n }\n if (Array.isArray(fieldGet)) {\n const fieldResult = getValueByPath(record, [...fieldGet]);\n return getValue(fieldResult, promiseCallBack);\n }\n const fieldArray = `${fieldGet}`.split('.');\n if (fieldArray.length <= 1) {\n const fieldResult = (record as any)[fieldGet];\n return getValue(fieldResult, promiseCallBack);\n }\n const fieldResult = applyChainSafe(\n record,\n (val, name) => getField(val, name, col, row, table, emptyFn as any),\n ...fieldArray\n );\n return getValue(fieldResult, promiseCallBack);\n}\n\nfunction _getIndex(sortedIndexMap: null | (number | number[])[], index: number): number | number[] {\n if (!sortedIndexMap) {\n return index;\n }\n const mapIndex = sortedIndexMap[index];\n return isValid(mapIndex) ? mapIndex : index;\n}\n\nexport interface DataSourceParam {\n get: (index: number) => any;\n length: number;\n source?: any;\n}\nexport interface ISortedMapItem {\n asc?: (number | number[])[];\n desc?: (number | number[])[];\n normal?: (number | number[])[];\n}\n\nexport class DataSource extends EventTarget implements DataSourceAPI {\n private _get: (index: number | number[]) => any;\n /** 数据条目数 如果是树形结构的数据 则是第一层父节点的数量 */\n private _sourceLength: number;\n\n private readonly _source: any;\n /**\n * 缓存按字段进行排序的结果\n */\n protected sortedIndexMap: Map<FieldDef, ISortedMapItem>;\n /**\n * 记录最近一次排序规则 当展开树形结构的节点时需要用到\n */\n private lastOrder: SortOrder;\n private lastOrderFn: (a: any, b: any, order: string) => number;\n private lastOrderField: FieldDef;\n /** 每一行对应源数据的索引 */\n protected currentIndexedData: (number | number[])[] | null = [];\n protected userPagination: IPagination;\n protected pagination: IPagination;\n /** 当前页每一行对应源数据的索引 */\n protected _currentPagerIndexedData: (number | number[])[];\n // 当前是否为层级的树形结构 排序时判断该值确实是否继续进行子节点排序\n enableHierarchyState = false;\n static get EVENT_TYPE(): typeof EVENT_TYPE {\n return EVENT_TYPE;\n }\n protected treeDataHierarchyState: Map<number | string, HierarchyState> = new Map();\n beforeChangedRecordsMap: Record<number, any>[] = [];\n constructor(obj?: DataSourceParam | DataSource, pagination?: IPagination, hierarchyExpandLevel?: number) {\n super();\n\n this._get = obj?.get.bind(obj) || (undefined as any);\n this._sourceLength = obj?.length || 0;\n this._source = obj?.source ?? obj;\n this.sortedIndexMap = new Map<string, ISortedMapItem>();\n\n this._currentPagerIndexedData = [];\n this.userPagination = pagination;\n this.pagination = pagination || {\n totalCount: this._sourceLength,\n perPageCount: this._sourceLength,\n currentPage: 0\n };\n if (hierarchyExpandLevel >= 1) {\n this.enableHierarchyState = true;\n }\n // 初始化currentIndexedData 正常未排序。设置其状态\n this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);\n if (this.enableHierarchyState) {\n for (let i = 0; i < this._sourceLength; i++) {\n //expandLevel为有效值即需要按tree分析展示数据\n const nodeData = this.getOriginalRecord(i);\n (nodeData as any).children && this.treeDataHierarchyState.set(i, HierarchyState.collapse);\n }\n }\n if (hierarchyExpandLevel > 1) {\n let nodeLength = this._sourceLength;\n for (let i = 0; i < nodeLength; i++) {\n const indexKey = this.currentIndexedData[i];\n const nodeData = this.getOriginalRecord(indexKey);\n if ((nodeData as any).children?.length > 0) {\n this.treeDataHierarchyState.set(\n Array.isArray(indexKey) ? indexKey.join(',') : indexKey,\n HierarchyState.expand\n );\n const childrenLength = this.initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, 2, nodeData);\n i += childrenLength;\n nodeLength += childrenLength;\n }\n }\n }\n this.updatePagerData();\n }\n /**\n * 初始化子节点的层次信息\n * @param indexKey 父节点的indexKey 即currentLevel-1的节点\n * @param hierarchyExpandLevel 需要展开层级数\n * @param currentLevel 当前要展开的是第几层\n * @param nodeData 父节点数据 即currentLevel-1的节点\n * @returns\n */\n initChildrenNodeHierarchy(\n indexKey: number | number[],\n // subNodeIndex:number,\n hierarchyExpandLevel: number,\n currentLevel: number,\n nodeData: any\n ): number {\n if (currentLevel > hierarchyExpandLevel) {\n return 0;\n }\n let childTotalLength = 0;\n const nodeLength = nodeData.children?.length ?? 0;\n for (let j = 0; j < nodeLength; j++) {\n childTotalLength += 1;\n const childNodeData = nodeData.children[j];\n const childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [indexKey, j];\n this.currentIndexedData.splice(\n this.currentIndexedData.indexOf(indexKey) + childTotalLength,\n // childTotalLength,\n 0,\n childIndexKey\n );\n if (childNodeData.children?.length > 0) {\n if (currentLevel < hierarchyExpandLevel) {\n this.treeDataHierarchyState.set(\n Array.isArray(childIndexKey) ? childIndexKey.join(',') : childIndexKey,\n HierarchyState.expand\n );\n } else {\n this.treeDataHierarchyState.set(\n Array.isArray(childIndexKey) ? childIndexKey.join(',') : childIndexKey,\n HierarchyState.collapse\n );\n }\n }\n\n childTotalLength += this.initChildrenNodeHierarchy(\n childIndexKey,\n hierarchyExpandLevel,\n currentLevel + 1,\n childNodeData\n );\n }\n return childTotalLength;\n }\n updatePagination(pagination?: IPagination): void {\n this.pagination = pagination || {\n totalCount: this._sourceLength,\n perPageCount: this._sourceLength,\n currentPage: 0\n };\n this.updatePagerData();\n }\n protected updatePagerData(): void {\n const { currentIndexedData } = this;\n const { perPageCount, currentPage } = this.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n this._currentPagerIndexedData.length = 0;\n if (currentIndexedData && currentIndexedData.length > 0) {\n // this._currentPagerIndexedData = currentIndexedData.slice(startIndex, endIndex);\n let firstLevelIndex = -1;\n for (let i = 0; i < currentIndexedData.length; i++) {\n //计算第一层父级节点数量\n if (\n (Array.isArray(currentIndexedData[i]) && (currentIndexedData[i] as Array<number>).length === 1) ||\n !Array.isArray(currentIndexedData[i])\n ) {\n firstLevelIndex++;\n }\n if (firstLevelIndex >= startIndex && firstLevelIndex < endIndex) {\n this._currentPagerIndexedData.push(currentIndexedData[i]);\n } else if (firstLevelIndex >= endIndex) {\n break;\n }\n }\n } else if (this._sourceLength > 0) {\n throw new Error(`currentIndexedData should has values!`);\n }\n }\n\n get source(): any {\n return this._source;\n }\n get(index: number): MaybePromiseOrUndefined {\n return this.getOriginalRecord(_getIndex(this.currentPagerIndexedData, index));\n }\n getRaw(index: number): MaybePromiseOrUndefined {\n return this.getRawRecord(_getIndex(this.currentPagerIndexedData, index) as number);\n }\n getIndexKey(index: number): number | number[] {\n return _getIndex(this.currentPagerIndexedData, index);\n }\n getTableIndex(colOrRow: number): number {\n return this.currentPagerIndexedData.findIndex(value => value === colOrRow);\n }\n /** 获取数据源中第index位置的field字段数据。传入col row是因为后面的format函数参数使用*/\n getField(\n index: number,\n field: FieldDef | FieldFormat | number,\n col: number,\n row: number,\n table: BaseTableAPI\n ): FieldData {\n return this.getOriginalField(_getIndex(this.currentPagerIndexedData, index), field, col, row, table);\n }\n\n getRawField(\n index: number,\n field: FieldDef | FieldFormat | number,\n col: number,\n row: number,\n table: BaseTableAPI\n ): FieldData {\n return this.getRawFieldData(_getIndex(this.currentPagerIndexedData, index) as number, field, col, row, table);\n }\n\n hasField(index: number, field: FieldDef): boolean {\n return this.hasOriginalField(_getIndex(this.currentPagerIndexedData, index), field);\n }\n /**\n * 获取第index条数据的展示收起状态\n * @param index\n * @returns\n */\n getHierarchyState(index: number): HierarchyState {\n const indexed = this.getIndexKey(index);\n return this.treeDataHierarchyState.get(Array.isArray(indexed) ? indexed.join(',') : indexed) ?? null;\n }\n /**\n * 展开或者收起数据index\n * @param index\n */\n toggleHierarchyState(index: number) {\n const oldIndexedData = this.currentIndexedData.slice(0);\n const indexed = this.getIndexKey(index);\n const state = this.getHierarchyState(index);\n const data = this.getOriginalRecord(indexed);\n\n this.clearSortedIndexMap();\n if (state === HierarchyState.collapse) {\n // 将节点状态置为expand\n this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(',') : indexed, HierarchyState.expand);\n this.pushChildrenNode(indexed, HierarchyState.expand, data);\n } else if (state === HierarchyState.expand) {\n // 记录状态变化影响的子节点行数\n let childrenLength = 0;\n /**\n * 当某个节点由展开变为折叠,需要计算出影响的节点数量 使用childrenLength来标记。同样需递归\n * @param indexKey\n * @param hierarchyState\n * @param nodeData\n * @returns\n */\n const computeChildrenNodeLength = (\n indexKey: number | number[],\n hierarchyState: HierarchyState,\n nodeData: any\n ) => {\n if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) {\n return;\n }\n if (nodeData.children) {\n for (let i = 0; i < nodeData.children.length; i++) {\n childrenLength += 1;\n const childIndex = Array.isArray(indexKey) ? indexKey.concat([i]) : [indexKey, i];\n\n computeChildrenNodeLength(\n childIndex,\n this.treeDataHierarchyState.get(childIndex.join(',')),\n nodeData.children[i]\n );\n }\n }\n };\n computeChildrenNodeLength(indexed, state, data);\n\n this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexed) + 1, childrenLength);\n this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(',') : indexed, HierarchyState.collapse);\n }\n // 变更了pagerConfig所以需要更新分页数据 TODO待定 因为只关注根节点的数量的话 可能不会影响到\n this.updatePagerData();\n\n return diffCellIndices(oldIndexedData, this.currentIndexedData);\n }\n /**\n * 某个节点状态由折叠变为展开,往this.currentIndexedData中插入展开后的新增节点,注意需要递归,因为展开节点下面的子节点也能是展开状态\n * @param recordRowIndex 要计算节点的行号(从body部分开始计算)\n * @param indexKey 需要判断节点的index\n * @param hierarchyState 当前节点状态\n * @param nodeData 当前节点数据 取children时用\n * @returns\n */\n pushChildrenNode(indexKey: number | number[], hierarchyState: HierarchyState, nodeData: any): number {\n if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) {\n return 0;\n }\n let childrenLength = 0;\n if (nodeData.children) {\n const subNodeSortedIndexArray: Array<number> = Array.from({ length: nodeData.children.length }, (_, i) => i);\n this.lastOrder &&\n this.lastOrder !== 'normal' &&\n this.lastOrderField &&\n sort.sort(\n index =>\n isValid(subNodeSortedIndexArray[index])\n ? subNodeSortedIndexArray[index]\n : (subNodeSortedIndexArray[index] = index),\n (index, rel) => {\n subNodeSortedIndexArray[index] = rel;\n },\n nodeData.children.length,\n this.lastOrderFn,\n this.lastOrder,\n index =>\n this.getOriginalField(\n Array.isArray(indexKey) ? indexKey.concat([index]) : [indexKey, index],\n this.lastOrderField\n )\n );\n for (let i = 0; i < subNodeSortedIndexArray.length; i++) {\n childrenLength += 1;\n const childIndex = Array.isArray(indexKey)\n ? indexKey.concat([subNodeSortedIndexArray[i]])\n : [indexKey, subNodeSortedIndexArray[i]];\n this.currentIndexedData.splice(\n this.currentIndexedData.indexOf(indexKey) + childrenLength,\n // this.pagination.currentPage * this.pagination.perPageCount +\n // recordRowIndex +\n // childrenLength,\n 0,\n childIndex\n );\n const preChildState = this.treeDataHierarchyState.get(childIndex.join(','));\n const childData = this.getOriginalRecord(childIndex);\n if (!preChildState && (childData as any).children) {\n this.treeDataHierarchyState.set(childIndex.join(','), HierarchyState.collapse);\n }\n childrenLength += this.pushChildrenNode(\n childIndex,\n this.treeDataHierarchyState.get(childIndex.join(',')),\n nodeData.children[subNodeSortedIndexArray[i]]\n );\n }\n }\n return childrenLength;\n }\n changeFieldValue(\n value: FieldData,\n index: number,\n field: FieldDef,\n col?: number,\n row?: number,\n table?: BaseTableAPI\n ): FieldData {\n if (field === null) {\n return undefined;\n }\n if (index >= 0) {\n const dataIndex = this.getIndexKey(index) as number;\n\n if (!this.beforeChangedRecordsMap[dataIndex]) {\n const originRecord = this.getOriginalRecord(dataIndex);\n this.beforeChangedRecordsMap[dataIndex] = cloneDeep(originRecord);\n }\n if (typeof field === 'string' || typeof field === 'number') {\n const beforeChangedValue = this.beforeChangedRecordsMap[dataIndex][field]; // this.getOriginalField(index, field, col, row, table);\n const record = this.getOriginalRecord(dataIndex);\n if (typeof beforeChangedValue === 'number' && isAllDigits(value)) {\n record[field] = parseFloat(value);\n } else {\n record[field] = value;\n }\n }\n }\n // return getField(record, field);\n }\n /**\n * 将数据record 替换到index位置处\n * @param record\n * @param index\n */\n setRecord(record: any, index: number) {\n const indexed = this.getIndexKey(index);\n if (!Array.isArray(indexed)) {\n this.source.splice(indexed, 1, record);\n } else {\n const c_node_index = (indexed as Array<any>)[indexed.length - 1];\n const p_node = this.getOriginalRecord(indexed.slice(0, indexed.length - 1));\n (p_node as any).children.splice(c_node_index, 1, record);\n }\n }\n /**\n * 将单条数据record 添加到index位置处\n * @param record 被添加的单条数据\n * @param index 代表的数据源中的index\n */\n addRecord(record: any, index: number) {\n this.source.splice(index, 0, record);\n this.currentIndexedData.push(this.currentIndexedData.length);\n this._sourceLength += 1;\n\n if (this.userPagination) {\n //如果用户配置了分页\n this.pagination.totalCount = this._sourceLength;\n const { perPageCount, currentPage } = this.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (index < endIndex) {\n this.updatePagerData();\n }\n } else {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n this.updatePagerData();\n }\n }\n /**\n * 将多条数据recordArr 依次添加到index位置处\n * @param recordArr\n * @param index 代表的数据源中的index\n */\n addRecords(recordArr: any, index: number) {\n if (Array.isArray(recordArr)) {\n this.source.splice(index, 0, ...recordArr);\n for (let i = 0; i < recordArr.length; i++) {\n this.currentIndexedData.push(this.currentIndexedData.length);\n }\n this._sourceLength += recordArr.length;\n }\n\n if (this.userPagination) {\n //如果用户配置了分页\n this.pagination.totalCount = this._sourceLength;\n const { perPageCount, currentPage } = this.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (index < endIndex) {\n this.updatePagerData();\n }\n } else {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n this.updatePagerData();\n }\n }\n\n /**\n * 将单条数据record 添加到index位置处\n * @param record 被添加的单条数据\n * @param index 代表的数据源中的index\n */\n addRecordForSorted(record: any) {\n this.source.push(record);\n this.currentIndexedData.push(this.currentIndexedData.length);\n this._sourceLength += 1;\n this.sortedIndexMap.clear();\n if (!this.userPagination) {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n }\n }\n /**\n * 将多条数据recordArr 依次添加到index位置处\n * @param recordArr\n * @param index 代表的数据源中的index\n */\n addRecordsForSorted(recordArr: any) {\n if (Array.isArray(recordArr)) {\n this.source.push(...recordArr);\n for (let i = 0; i < recordArr.length; i++) {\n this.currentIndexedData.push(this.currentIndexedData.length);\n }\n this._sourceLength += recordArr.length;\n this.sortedIndexMap.clear();\n }\n if (!this.userPagination) {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n }\n }\n /**\n * 删除多条数据recordIndexs\n */\n deleteRecordsForSorted(recordIndexs: number[]) {\n const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);\n for (let index = 0; index < recordIndexsMaxToMin.length; index++) {\n const recordIndex = recordIndexsMaxToMin[index];\n if (recordIndex >= this._sourceLength || recordIndex < 0) {\n continue;\n }\n const rawIndex = this.currentIndexedData[recordIndex];\n this.source.splice(rawIndex, 1);\n this._sourceLength -= 1;\n }\n this.sortedIndexMap.clear();\n if (!this.userPagination) {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n }\n }\n\n /**\n * 删除多条数据recordIndexs\n */\n deleteRecords(recordIndexs: number[]) {\n const realDeletedRecordIndexs = [];\n const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);\n for (let index = 0; index < recordIndexsMaxToMin.length; index++) {\n const recordIndex = recordIndexsMaxToMin[index];\n if (recordIndex >= this._sourceLength || recordIndex < 0) {\n continue;\n }\n realDeletedRecordIndexs.push(recordIndex);\n this.source.splice(recordIndex, 1);\n this.currentIndexedData.pop();\n this._sourceLength -= 1;\n }\n if (this.userPagination) {\n // 如果用户配置了分页\n this.updatePagerData();\n } else {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n this.updatePagerData();\n }\n return realDeletedRecordIndexs;\n }\n\n sort(\n field: FieldDef,\n order: SortOrder,\n orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1 = order !== 'desc'\n ? (v1: any, v2: any): -1 | 0 | 1 => (v1 === v2 ? 0 : v1 > v2 ? 1 : -1)\n : (v1: any, v2: any): -1 | 0 | 1 => (v1 === v2 ? 0 : v1 < v2 ? 1 : -1)\n ): void {\n this.lastOrderField = field;\n this.lastOrder = order;\n this.lastOrderFn = orderFn;\n let filedMap = this.sortedIndexMap.get(field);\n let orderedData;\n\n if (filedMap) {\n orderedData = filedMap[order];\n if (orderedData && orderedData.length > 0) {\n this.currentIndexedData = orderedData;\n this.updatePagerData();\n this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);\n return;\n }\n }\n const sortedIndexArray = [] as number[];\n if (order === 'normal') {\n for (let i = 0; i < this._sourceLength; i++) {\n sortedIndexArray[i] = i;\n }\n } else {\n sort.sort(\n index => (isValid(sortedIndexArray[index]) ? sortedIndexArray[index] : (sortedIndexArray[index] = index)),\n (index, rel) => {\n sortedIndexArray[index] = rel;\n },\n this._sourceLength,\n orderFn,\n order,\n index => this.getOriginalField(index, field)\n );\n }\n this.currentIndexedData = sortedIndexArray;\n if (this.enableHierarchyState) {\n let nodeLength = sortedIndexArray.length;\n const t0 = window.performance.now();\n for (let i = 0; i < nodeLength; i++) {\n const subNodeLength = this.pushChildrenNode(\n sortedIndexArray[i],\n this.treeDataHierarchyState.get(sortedIndexArray[i]),\n this.getOriginalRecord(sortedIndexArray[i]) // ?sortedIndexArray 在这个过程中不是变化了吗 通过i取id还是对的吗? 对哦!因为i和nodeLength都+subNodeLength 来动态调整过了!\n );\n nodeLength += subNodeLength;\n i += subNodeLength;\n }\n }\n if (!filedMap) {\n filedMap = { asc: [], desc: [], normal: [] };\n this.sortedIndexMap.set(field, filedMap);\n }\n filedMap[order] = sortedIndexArray;\n this.updatePagerData();\n this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);\n }\n /**\n * 当节点折叠或者展开时 将排序缓存清空(非当前排序规则的缓存)\n */\n clearSortedIndexMap() {\n if (this.lastOrderField && this.lastOrder) {\n this.sortedIndexMap.forEach((sortMap, key) => {\n if (key !== this.lastOrderField) {\n this.sortedIndexMap.delete(key);\n } else if (this.lastOrder === 'asc') {\n sortMap.desc = [];\n sortMap.normal = [];\n } else if (this.lastOrder === 'desc') {\n sortMap.asc = [];\n sortMap.normal = [];\n } else {\n sortMap.desc = [];\n sortMap.asc = [];\n }\n });\n }\n }\n get sourceLength(): number {\n return this._sourceLength;\n }\n set sourceLength(sourceLen: number) {\n if (this._sourceLength === sourceLen) {\n return;\n }\n this._sourceLength = sourceLen;\n this.fireListeners(EVENT_TYPE.SOURCE_LENGTH_UPDATE, this._sourceLength);\n }\n get length(): number {\n return this.currentPagerIndexedData.length;\n }\n get dataSource(): DataSource {\n return this;\n }\n get currentPagerIndexedData(): (number | number[])[] {\n if (this._currentPagerIndexedData.length > 0) {\n return this._currentPagerIndexedData;\n }\n return []; //this.currentIndexedData || [];\n }\n release(): void {\n super.release?.();\n }\n clearSortedMap() {\n this.currentIndexedData && (this.currentIndexedData.length = 0);\n this.currentIndexedData = null;\n this.sortedIndexMap.forEach(item => {\n item.asc && (item.asc.length = 0);\n item.desc && (item.desc.length = 0);\n });\n this.sortedIndexMap.clear();\n }\n clearCurrentIndexedData(): void {\n this.currentIndexedData = null;\n this.currentPagerIndexedData.length = 0;\n }\n protected getOriginalRecord(dataIndex: number | number[]): MaybePromiseOrUndefined {\n return getValue(this._get(dataIndex), (val: MaybePromiseOrUndefined) => {\n this.recordPromiseCallBack(dataIndex, val);\n });\n }\n protected getRawRecord(dataIndex: number): MaybePromiseOrUndefined {\n if (this.beforeChangedRecordsMap?.[dataIndex as number]) {\n return this.beforeChangedRecordsMap[dataIndex as number];\n }\n return getValue(this._get(dataIndex), (val: MaybePromiseOrUndefined) => {\n this.recordPromiseCallBack(dataIndex, val);\n });\n }\n protected getOriginalField(\n index: number | number[],\n field: FieldDef | FieldFormat | number,\n col?: number,\n row?: number,\n table?: BaseTableAPI\n ): FieldData {\n if (field === null) {\n return undefined;\n }\n const record = this.getOriginalRecord(index);\n // return getField(record, field);\n return getField(record, field, col, row, table, (val: any) => {\n this.fieldPromiseCallBack(index, field, val);\n });\n }\n protected getRawFieldData(\n index: number,\n field: FieldDef | FieldFormat | number,\n col?: number,\n row?: number,\n table?: BaseTableAPI\n ): FieldData {\n if (field === null) {\n return undefined;\n }\n const record = this.getRawRecord(index);\n // return getField(record, field);\n return getField(record, field, col, row, table, (val: any) => {\n this.fieldPromiseCallBack(index, field, val);\n });\n }\n protected hasOriginalField(index: number | number[], field: FieldDef): boolean {\n if (field === null) {\n return false;\n }\n if (typeof field === 'function') {\n return true;\n }\n const record = this.getOriginalRecord(index);\n return Boolean(record && (field as any) in (record as any));\n }\n\n protected fieldPromiseCallBack(\n _index: number | number[],\n _field: FieldDef | FieldFormat | number,\n _value: MaybePromiseOrUndefined\n ): void {\n //\n }\n protected recordPromiseCallBack(_index: number | number[], _record: MaybePromiseOrUndefined): void {\n //\n }\n /** 静态变量 代表数据为空 */\n static EMPTY = new DataSource({\n get() {\n /* noop */\n },\n length: 0\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/data/DataSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAYtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAStD,SAAS,eAAe,CAAC,KAAsC;IAC7D,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACvB,MAAM,CAAC,GAAG,KAAsB,CAAC;QACjC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACpC,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM,UAAU,GAAG;IACjB,oBAAoB,EAAE,sBAAsB;IAC5C,YAAY,EAAE,cAAc;CACpB,CAAC;AASX,SAAS,QAAQ,CA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AK,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,MAAM,IAAK,KAAa,IAAK,MAAc,CAAC,CAAC;IAC9D,CAAC;IAES,oBAAoB,CAC5B,MAAyB,EACzB,MAAuC,EACvC,MAA+B;IAGjC,CAAC;IACS,qBAAqB,CAAC,MAAyB,EAAE,OAAgC;IAE3F,CAAC;;AAEM,gBAAK,GAAG,IAAI,UAAU,CAAC;IAC5B,GAAG;IAEH,CAAC;IACD,MAAM,EAAE,CAAC;CACV,CAAC,CAAC","file":"DataSource.js","sourcesContent":["import * as sort from '../tools/sort';\nimport type {\n DataSourceAPI,\n FieldAssessor,\n FieldData,\n FieldDef,\n FieldFormat,\n IPagination,\n MaybePromiseOrCallOrUndefined,\n MaybePromiseOrUndefined,\n SortOrder\n} from '../ts-types';\nimport { HierarchyState } from '../ts-types';\nimport { applyChainSafe, getOrApply, obj, isPromise, emptyFn } from '../tools/helper';\nimport { EventTarget } from '../event/EventTarget';\nimport { getValueByPath, isAllDigits } from '../tools/util';\nimport { calculateArrayDiff } from '../tools/diff-cell';\nimport { cloneDeep, isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport { TABLE_EVENT_TYPE } from '../core/TABLE_EVENT_TYPE';\n\n/**\n * 判断字段数据是否为访问器的格式\n * @param field\n * @returns boolean\n */\nfunction isFieldAssessor(field: FieldDef | FieldFormat | number): field is FieldAssessor {\n if (obj.isObject(field)) {\n const a = field as FieldAssessor;\n if (isValid(a.get) && isValid(a.set)) {\n return true;\n }\n }\n return false;\n}\nconst EVENT_TYPE = {\n SOURCE_LENGTH_UPDATE: 'source_length_update',\n CHANGE_ORDER: 'change_order'\n} as const;\ntype PromiseBack = (value: MaybePromiseOrUndefined) => void;\n\n/**\n * 获取到的某个filed的值 处理可能为promise的情况\n * @param value\n * @param promiseCallBack\n * @returns\n */\nfunction getValue(value: MaybePromiseOrCallOrUndefined, promiseCallBack: PromiseBack): MaybePromiseOrUndefined {\n const maybePromiseOrValue = getOrApply(value);\n if (isPromise(maybePromiseOrValue)) {\n const promiseValue = maybePromiseOrValue.then((r: any) => {\n promiseCallBack(r);\n return r;\n });\n\n promiseCallBack(promiseValue);\n return promiseValue;\n }\n return maybePromiseOrValue;\n}\n/**\n * 根据field获取数据源record对应的值 获取到的可能是个异步Promise 需要设置回调处理逻辑\n * @param record\n * @param field\n * @param promiseCallBack\n * @returns\n */\nexport function getField(\n record: MaybePromiseOrUndefined,\n field: FieldDef | FieldFormat | number,\n col: number,\n row: number,\n table: BaseTableAPI,\n promiseCallBack: PromiseBack\n): FieldData {\n if (record === null || record === undefined) {\n return undefined;\n }\n if (isPromise(record)) {\n return record.then((r: any) => getField(r, field, col, row, table, promiseCallBack));\n }\n const fieldGet: any = isFieldAssessor(field) ? field.get : field;\n if (fieldGet in (record as any)) {\n const fieldResult = (record as any)[fieldGet];\n\n return getValue(fieldResult, promiseCallBack);\n }\n if (typeof fieldGet === 'function') {\n const fieldResult = fieldGet(record, col, row, table);\n return getValue(fieldResult, promiseCallBack);\n }\n if (Array.isArray(fieldGet)) {\n const fieldResult = getValueByPath(record, [...fieldGet]);\n return getValue(fieldResult, promiseCallBack);\n }\n const fieldArray = `${fieldGet}`.split('.');\n if (fieldArray.length <= 1) {\n const fieldResult = (record as any)[fieldGet];\n return getValue(fieldResult, promiseCallBack);\n }\n const fieldResult = applyChainSafe(\n record,\n (val, name) => getField(val, name, col, row, table, emptyFn as any),\n ...fieldArray\n );\n return getValue(fieldResult, promiseCallBack);\n}\n\nfunction _getIndex(sortedIndexMap: null | (number | number[])[], index: number): number | number[] {\n if (!sortedIndexMap) {\n return index;\n }\n const mapIndex = sortedIndexMap[index];\n return isValid(mapIndex) ? mapIndex : index;\n}\n\nexport interface DataSourceParam {\n get: (index: number) => any;\n length: number;\n source?: any;\n}\nexport interface ISortedMapItem {\n asc?: (number | number[])[];\n desc?: (number | number[])[];\n normal?: (number | number[])[];\n}\n\nexport class DataSource extends EventTarget implements DataSourceAPI {\n private _get: (index: number | number[]) => any;\n /** 数据条目数 如果是树形结构的数据 则是第一层父节点的数量 */\n private _sourceLength: number;\n\n private readonly _source: any;\n /**\n * 缓存按字段进行排序的结果\n */\n protected sortedIndexMap: Map<FieldDef, ISortedMapItem>;\n /**\n * 记录最近一次排序规则 当展开树形结构的节点时需要用到\n */\n private lastOrder: SortOrder;\n private lastOrderFn: (a: any, b: any, order: string) => number;\n private lastOrderField: FieldDef;\n /** 每一行对应源数据的索引 */\n protected currentIndexedData: (number | number[])[] | null = [];\n protected userPagination: IPagination;\n protected pagination: IPagination;\n /** 当前页每一行对应源数据的索引 */\n protected _currentPagerIndexedData: (number | number[])[];\n // 当前是否为层级的树形结构 排序时判断该值确实是否继续进行子节点排序\n enableHierarchyState = false;\n static get EVENT_TYPE(): typeof EVENT_TYPE {\n return EVENT_TYPE;\n }\n protected treeDataHierarchyState: Map<number | string, HierarchyState> = new Map();\n beforeChangedRecordsMap: Record<number, any>[] = [];\n constructor(obj?: DataSourceParam | DataSource, pagination?: IPagination, hierarchyExpandLevel?: number) {\n super();\n\n this._get = obj?.get.bind(obj) || (undefined as any);\n this._sourceLength = obj?.length || 0;\n this._source = obj?.source ?? obj;\n this.sortedIndexMap = new Map<string, ISortedMapItem>();\n\n this._currentPagerIndexedData = [];\n this.userPagination = pagination;\n this.pagination = pagination || {\n totalCount: this._sourceLength,\n perPageCount: this._sourceLength,\n currentPage: 0\n };\n if (hierarchyExpandLevel >= 1) {\n this.enableHierarchyState = true;\n }\n // 初始化currentIndexedData 正常未排序。设置其状态\n this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);\n if (this.enableHierarchyState) {\n for (let i = 0; i < this._sourceLength; i++) {\n //expandLevel为有效值即需要按tree分析展示数据\n const nodeData = this.getOriginalRecord(i);\n (nodeData as any).children && this.treeDataHierarchyState.set(i, HierarchyState.collapse);\n }\n }\n if (hierarchyExpandLevel > 1) {\n let nodeLength = this._sourceLength;\n for (let i = 0; i < nodeLength; i++) {\n const indexKey = this.currentIndexedData[i];\n const nodeData = this.getOriginalRecord(indexKey);\n if ((nodeData as any).children?.length > 0) {\n this.treeDataHierarchyState.set(\n Array.isArray(indexKey) ? indexKey.join(',') : indexKey,\n HierarchyState.expand\n );\n const childrenLength = this.initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, 2, nodeData);\n i += childrenLength;\n nodeLength += childrenLength;\n }\n }\n }\n this.updatePagerData();\n }\n /**\n * 初始化子节点的层次信息\n * @param indexKey 父节点的indexKey 即currentLevel-1的节点\n * @param hierarchyExpandLevel 需要展开层级数\n * @param currentLevel 当前要展开的是第几层\n * @param nodeData 父节点数据 即currentLevel-1的节点\n * @returns\n */\n initChildrenNodeHierarchy(\n indexKey: number | number[],\n // subNodeIndex:number,\n hierarchyExpandLevel: number,\n currentLevel: number,\n nodeData: any\n ): number {\n if (currentLevel > hierarchyExpandLevel) {\n return 0;\n }\n let childTotalLength = 0;\n const nodeLength = nodeData.children?.length ?? 0;\n for (let j = 0; j < nodeLength; j++) {\n childTotalLength += 1;\n const childNodeData = nodeData.children[j];\n const childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [indexKey, j];\n this.currentIndexedData.splice(\n this.currentIndexedData.indexOf(indexKey) + childTotalLength,\n // childTotalLength,\n 0,\n childIndexKey\n );\n if (childNodeData.children?.length > 0) {\n if (currentLevel < hierarchyExpandLevel) {\n this.treeDataHierarchyState.set(\n Array.isArray(childIndexKey) ? childIndexKey.join(',') : childIndexKey,\n HierarchyState.expand\n );\n } else {\n this.treeDataHierarchyState.set(\n Array.isArray(childIndexKey) ? childIndexKey.join(',') : childIndexKey,\n HierarchyState.collapse\n );\n }\n }\n\n childTotalLength += this.initChildrenNodeHierarchy(\n childIndexKey,\n hierarchyExpandLevel,\n currentLevel + 1,\n childNodeData\n );\n }\n return childTotalLength;\n }\n updatePagination(pagination?: IPagination): void {\n this.pagination = pagination || {\n totalCount: this._sourceLength,\n perPageCount: this._sourceLength,\n currentPage: 0\n };\n this.updatePagerData();\n }\n protected updatePagerData(): void {\n const { currentIndexedData } = this;\n const { perPageCount, currentPage } = this.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n this._currentPagerIndexedData.length = 0;\n if (currentIndexedData && currentIndexedData.length > 0) {\n // this._currentPagerIndexedData = currentIndexedData.slice(startIndex, endIndex);\n let firstLevelIndex = -1;\n for (let i = 0; i < currentIndexedData.length; i++) {\n //计算第一层父级节点数量\n if (\n (Array.isArray(currentIndexedData[i]) && (currentIndexedData[i] as Array<number>).length === 1) ||\n !Array.isArray(currentIndexedData[i])\n ) {\n firstLevelIndex++;\n }\n if (firstLevelIndex >= startIndex && firstLevelIndex < endIndex) {\n this._currentPagerIndexedData.push(currentIndexedData[i]);\n } else if (firstLevelIndex >= endIndex) {\n break;\n }\n }\n } else if (this._sourceLength > 0) {\n throw new Error(`currentIndexedData should has values!`);\n }\n }\n\n get source(): any {\n return this._source;\n }\n get(index: number): MaybePromiseOrUndefined {\n return this.getOriginalRecord(_getIndex(this.currentPagerIndexedData, index));\n }\n getRaw(index: number): MaybePromiseOrUndefined {\n return this.getRawRecord(_getIndex(this.currentPagerIndexedData, index) as number);\n }\n getIndexKey(index: number): number | number[] {\n return _getIndex(this.currentPagerIndexedData, index);\n }\n getTableIndex(colOrRow: number): number {\n return this.currentPagerIndexedData.findIndex(value => value === colOrRow);\n }\n /** 获取数据源中第index位置的field字段数据。传入col row是因为后面的format函数参数使用*/\n getField(\n index: number,\n field: FieldDef | FieldFormat | number,\n col: number,\n row: number,\n table: BaseTableAPI\n ): FieldData {\n return this.getOriginalField(_getIndex(this.currentPagerIndexedData, index), field, col, row, table);\n }\n\n getRawField(\n index: number,\n field: FieldDef | FieldFormat | number,\n col: number,\n row: number,\n table: BaseTableAPI\n ): FieldData {\n return this.getRawFieldData(_getIndex(this.currentPagerIndexedData, index) as number, field, col, row, table);\n }\n\n hasField(index: number, field: FieldDef): boolean {\n return this.hasOriginalField(_getIndex(this.currentPagerIndexedData, index), field);\n }\n /**\n * 获取第index条数据的展示收起状态\n * @param index\n * @returns\n */\n getHierarchyState(index: number): HierarchyState {\n const indexed = this.getIndexKey(index);\n return this.treeDataHierarchyState.get(Array.isArray(indexed) ? indexed.join(',') : indexed) ?? null;\n }\n /**\n * 展开或者收起数据index\n * @param index\n */\n toggleHierarchyState(index: number) {\n const oldIndexedData = this.currentIndexedData.slice(0);\n const indexed = this.getIndexKey(index);\n const state = this.getHierarchyState(index);\n const data = this.getOriginalRecord(indexed);\n\n this.clearSortedIndexMap();\n if (state === HierarchyState.collapse) {\n // 将节点状态置为expand\n this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(',') : indexed, HierarchyState.expand);\n this.pushChildrenNode(indexed, HierarchyState.expand, data);\n } else if (state === HierarchyState.expand) {\n // 记录状态变化影响的子节点行数\n let childrenLength = 0;\n /**\n * 当某个节点由展开变为折叠,需要计算出影响的节点数量 使用childrenLength来标记。同样需递归\n * @param indexKey\n * @param hierarchyState\n * @param nodeData\n * @returns\n */\n const computeChildrenNodeLength = (\n indexKey: number | number[],\n hierarchyState: HierarchyState,\n nodeData: any\n ) => {\n if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) {\n return;\n }\n if (nodeData.children) {\n for (let i = 0; i < nodeData.children.length; i++) {\n childrenLength += 1;\n const childIndex = Array.isArray(indexKey) ? indexKey.concat([i]) : [indexKey, i];\n\n computeChildrenNodeLength(\n childIndex,\n this.treeDataHierarchyState.get(childIndex.join(',')),\n nodeData.children[i]\n );\n }\n }\n };\n computeChildrenNodeLength(indexed, state, data);\n\n this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexed) + 1, childrenLength);\n this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(',') : indexed, HierarchyState.collapse);\n }\n // 变更了pagerConfig所以需要更新分页数据 TODO待定 因为只关注根节点的数量的话 可能不会影响到\n this.updatePagerData();\n\n const newDiff = calculateArrayDiff(oldIndexedData, this.currentIndexedData);\n // const oldDiff = diffCellIndices(oldIndexedData, this.currentIndexedData);\n\n // return oldDiff;\n return newDiff;\n }\n /**\n * 某个节点状态由折叠变为展开,往this.currentIndexedData中插入展开后的新增节点,注意需要递归,因为展开节点下面的子节点也能是展开状态\n * @param recordRowIndex 要计算节点的行号(从body部分开始计算)\n * @param indexKey 需要判断节点的index\n * @param hierarchyState 当前节点状态\n * @param nodeData 当前节点数据 取children时用\n * @returns\n */\n pushChildrenNode(indexKey: number | number[], hierarchyState: HierarchyState, nodeData: any): number {\n if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) {\n return 0;\n }\n let childrenLength = 0;\n if (nodeData.children) {\n const subNodeSortedIndexArray: Array<number> = Array.from({ length: nodeData.children.length }, (_, i) => i);\n this.lastOrder &&\n this.lastOrder !== 'normal' &&\n this.lastOrderField &&\n sort.sort(\n index =>\n isValid(subNodeSortedIndexArray[index])\n ? subNodeSortedIndexArray[index]\n : (subNodeSortedIndexArray[index] = index),\n (index, rel) => {\n subNodeSortedIndexArray[index] = rel;\n },\n nodeData.children.length,\n this.lastOrderFn,\n this.lastOrder,\n index =>\n this.getOriginalField(\n Array.isArray(indexKey) ? indexKey.concat([index]) : [indexKey, index],\n this.lastOrderField\n )\n );\n for (let i = 0; i < subNodeSortedIndexArray.length; i++) {\n childrenLength += 1;\n const childIndex = Array.isArray(indexKey)\n ? indexKey.concat([subNodeSortedIndexArray[i]])\n : [indexKey, subNodeSortedIndexArray[i]];\n this.currentIndexedData.splice(\n this.currentIndexedData.indexOf(indexKey) + childrenLength,\n // this.pagination.currentPage * this.pagination.perPageCount +\n // recordRowIndex +\n // childrenLength,\n 0,\n childIndex\n );\n const preChildState = this.treeDataHierarchyState.get(childIndex.join(','));\n const childData = this.getOriginalRecord(childIndex);\n if (!preChildState && (childData as any).children) {\n this.treeDataHierarchyState.set(childIndex.join(','), HierarchyState.collapse);\n }\n childrenLength += this.pushChildrenNode(\n childIndex,\n this.treeDataHierarchyState.get(childIndex.join(',')),\n nodeData.children[subNodeSortedIndexArray[i]]\n );\n }\n }\n return childrenLength;\n }\n changeFieldValue(\n value: FieldData,\n index: number,\n field: FieldDef,\n col?: number,\n row?: number,\n table?: BaseTableAPI\n ): FieldData {\n if (field === null) {\n return undefined;\n }\n if (index >= 0) {\n const dataIndex = this.getIndexKey(index) as number;\n\n if (!this.beforeChangedRecordsMap[dataIndex]) {\n const originRecord = this.getOriginalRecord(dataIndex);\n this.beforeChangedRecordsMap[dataIndex] = cloneDeep(originRecord);\n }\n if (typeof field === 'string' || typeof field === 'number') {\n const beforeChangedValue = this.beforeChangedRecordsMap[dataIndex][field]; // this.getOriginalField(index, field, col, row, table);\n const record = this.getOriginalRecord(dataIndex);\n if (typeof beforeChangedValue === 'number' && isAllDigits(value)) {\n record[field] = parseFloat(value);\n } else {\n record[field] = value;\n }\n }\n }\n // return getField(record, field);\n }\n /**\n * 将数据record 替换到index位置处\n * @param record\n * @param index\n */\n setRecord(record: any, index: number) {\n const indexed = this.getIndexKey(index);\n if (!Array.isArray(indexed)) {\n this.source.splice(indexed, 1, record);\n } else {\n const c_node_index = (indexed as Array<any>)[indexed.length - 1];\n const p_node = this.getOriginalRecord(indexed.slice(0, indexed.length - 1));\n (p_node as any).children.splice(c_node_index, 1, record);\n }\n }\n /**\n * 将单条数据record 添加到index位置处\n * @param record 被添加的单条数据\n * @param index 代表的数据源中的index\n */\n addRecord(record: any, index: number) {\n this.source.splice(index, 0, record);\n this.currentIndexedData.push(this.currentIndexedData.length);\n this._sourceLength += 1;\n\n if (this.userPagination) {\n //如果用户配置了分页\n this.pagination.totalCount = this._sourceLength;\n const { perPageCount, currentPage } = this.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (index < endIndex) {\n this.updatePagerData();\n }\n } else {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n this.updatePagerData();\n }\n }\n /**\n * 将多条数据recordArr 依次添加到index位置处\n * @param recordArr\n * @param index 代表的数据源中的index\n */\n addRecords(recordArr: any, index: number) {\n if (Array.isArray(recordArr)) {\n this.source.splice(index, 0, ...recordArr);\n for (let i = 0; i < recordArr.length; i++) {\n this.currentIndexedData.push(this.currentIndexedData.length);\n }\n this._sourceLength += recordArr.length;\n }\n\n if (this.userPagination) {\n //如果用户配置了分页\n this.pagination.totalCount = this._sourceLength;\n const { perPageCount, currentPage } = this.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (index < endIndex) {\n this.updatePagerData();\n }\n } else {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n this.updatePagerData();\n }\n }\n\n /**\n * 将单条数据record 添加到index位置处\n * @param record 被添加的单条数据\n * @param index 代表的数据源中的index\n */\n addRecordForSorted(record: any) {\n this.source.push(record);\n this.currentIndexedData.push(this.currentIndexedData.length);\n this._sourceLength += 1;\n this.sortedIndexMap.clear();\n if (!this.userPagination) {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n }\n }\n /**\n * 将多条数据recordArr 依次添加到index位置处\n * @param recordArr\n * @param index 代表的数据源中的index\n */\n addRecordsForSorted(recordArr: any) {\n if (Array.isArray(recordArr)) {\n this.source.push(...recordArr);\n for (let i = 0; i < recordArr.length; i++) {\n this.currentIndexedData.push(this.currentIndexedData.length);\n }\n this._sourceLength += recordArr.length;\n this.sortedIndexMap.clear();\n }\n if (!this.userPagination) {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n }\n }\n /**\n * 删除多条数据recordIndexs\n */\n deleteRecordsForSorted(recordIndexs: number[]) {\n const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);\n for (let index = 0; index < recordIndexsMaxToMin.length; index++) {\n const recordIndex = recordIndexsMaxToMin[index];\n if (recordIndex >= this._sourceLength || recordIndex < 0) {\n continue;\n }\n const rawIndex = this.currentIndexedData[recordIndex];\n this.source.splice(rawIndex, 1);\n this._sourceLength -= 1;\n }\n this.sortedIndexMap.clear();\n if (!this.userPagination) {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n }\n }\n\n /**\n * 删除多条数据recordIndexs\n */\n deleteRecords(recordIndexs: number[]) {\n const realDeletedRecordIndexs = [];\n const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);\n for (let index = 0; index < recordIndexsMaxToMin.length; index++) {\n const recordIndex = recordIndexsMaxToMin[index];\n if (recordIndex >= this._sourceLength || recordIndex < 0) {\n continue;\n }\n realDeletedRecordIndexs.push(recordIndex);\n this.source.splice(recordIndex, 1);\n this.currentIndexedData.pop();\n this._sourceLength -= 1;\n }\n if (this.userPagination) {\n // 如果用户配置了分页\n this.updatePagerData();\n } else {\n this.pagination.perPageCount = this._sourceLength;\n this.pagination.totalCount = this._sourceLength;\n this.updatePagerData();\n }\n return realDeletedRecordIndexs;\n }\n\n sort(\n field: FieldDef,\n order: SortOrder,\n orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1 = order !== 'desc'\n ? (v1: any, v2: any): -1 | 0 | 1 => (v1 === v2 ? 0 : v1 > v2 ? 1 : -1)\n : (v1: any, v2: any): -1 | 0 | 1 => (v1 === v2 ? 0 : v1 < v2 ? 1 : -1)\n ): void {\n this.lastOrderField = field;\n this.lastOrder = order;\n this.lastOrderFn = orderFn;\n let filedMap = this.sortedIndexMap.get(field);\n let orderedData;\n\n if (filedMap) {\n orderedData = filedMap[order];\n if (orderedData && orderedData.length > 0) {\n this.currentIndexedData = orderedData;\n this.updatePagerData();\n this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);\n return;\n }\n }\n const sortedIndexArray = [] as number[];\n if (order === 'normal') {\n for (let i = 0; i < this._sourceLength; i++) {\n sortedIndexArray[i] = i;\n }\n } else {\n sort.sort(\n index => (isValid(sortedIndexArray[index]) ? sortedIndexArray[index] : (sortedIndexArray[index] = index)),\n (index, rel) => {\n sortedIndexArray[index] = rel;\n },\n this._sourceLength,\n orderFn,\n order,\n index => this.getOriginalField(index, field)\n );\n }\n this.currentIndexedData = sortedIndexArray;\n if (this.enableHierarchyState) {\n let nodeLength = sortedIndexArray.length;\n const t0 = window.performance.now();\n for (let i = 0; i < nodeLength; i++) {\n const subNodeLength = this.pushChildrenNode(\n sortedIndexArray[i],\n this.treeDataHierarchyState.get(sortedIndexArray[i]),\n this.getOriginalRecord(sortedIndexArray[i]) // ?sortedIndexArray 在这个过程中不是变化了吗 通过i取id还是对的吗? 对哦!因为i和nodeLength都+subNodeLength 来动态调整过了!\n );\n nodeLength += subNodeLength;\n i += subNodeLength;\n }\n }\n if (!filedMap) {\n filedMap = { asc: [], desc: [], normal: [] };\n this.sortedIndexMap.set(field, filedMap);\n }\n filedMap[order] = sortedIndexArray;\n this.updatePagerData();\n this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);\n }\n /**\n * 当节点折叠或者展开时 将排序缓存清空(非当前排序规则的缓存)\n */\n clearSortedIndexMap() {\n if (this.lastOrderField && this.lastOrder) {\n this.sortedIndexMap.forEach((sortMap, key) => {\n if (key !== this.lastOrderField) {\n this.sortedIndexMap.delete(key);\n } else if (this.lastOrder === 'asc') {\n sortMap.desc = [];\n sortMap.normal = [];\n } else if (this.lastOrder === 'desc') {\n sortMap.asc = [];\n sortMap.normal = [];\n } else {\n sortMap.desc = [];\n sortMap.asc = [];\n }\n });\n }\n }\n get sourceLength(): number {\n return this._sourceLength;\n }\n set sourceLength(sourceLen: number) {\n if (this._sourceLength === sourceLen) {\n return;\n }\n this._sourceLength = sourceLen;\n this.fireListeners(EVENT_TYPE.SOURCE_LENGTH_UPDATE, this._sourceLength);\n }\n get length(): number {\n return this.currentPagerIndexedData.length;\n }\n get dataSource(): DataSource {\n return this;\n }\n get currentPagerIndexedData(): (number | number[])[] {\n if (this._currentPagerIndexedData.length > 0) {\n return this._currentPagerIndexedData;\n }\n return []; //this.currentIndexedData || [];\n }\n release(): void {\n super.release?.();\n }\n clearSortedMap() {\n this.currentIndexedData && (this.currentIndexedData.length = 0);\n this.currentIndexedData = null;\n this.sortedIndexMap.forEach(item => {\n item.asc && (item.asc.length = 0);\n item.desc && (item.desc.length = 0);\n });\n this.sortedIndexMap.clear();\n }\n clearCurrentIndexedData(): void {\n this.currentIndexedData = null;\n this.currentPagerIndexedData.length = 0;\n }\n protected getOriginalRecord(dataIndex: number | number[]): MaybePromiseOrUndefined {\n return getValue(this._get(dataIndex), (val: MaybePromiseOrUndefined) => {\n this.recordPromiseCallBack(dataIndex, val);\n });\n }\n protected getRawRecord(dataIndex: number): MaybePromiseOrUndefined {\n if (this.beforeChangedRecordsMap?.[dataIndex as number]) {\n return this.beforeChangedRecordsMap[dataIndex as number];\n }\n return getValue(this._get(dataIndex), (val: MaybePromiseOrUndefined) => {\n this.recordPromiseCallBack(dataIndex, val);\n });\n }\n protected getOriginalField(\n index: number | number[],\n field: FieldDef | FieldFormat | number,\n col?: number,\n row?: number,\n table?: BaseTableAPI\n ): FieldData {\n if (field === null) {\n return undefined;\n }\n const record = this.getOriginalRecord(index);\n // return getField(record, field);\n return getField(record, field, col, row, table, (val: any) => {\n this.fieldPromiseCallBack(index, field, val);\n });\n }\n protected getRawFieldData(\n index: number,\n field: FieldDef | FieldFormat | number,\n col?: number,\n row?: number,\n table?: BaseTableAPI\n ): FieldData {\n if (field === null) {\n return undefined;\n }\n const record = this.getRawRecord(index);\n // return getField(record, field);\n return getField(record, field, col, row, table, (val: any) => {\n this.fieldPromiseCallBack(index, field, val);\n });\n }\n protected hasOriginalField(index: number | number[], field: FieldDef): boolean {\n if (field === null) {\n return false;\n }\n if (typeof field === 'function') {\n return true;\n }\n const record = this.getOriginalRecord(index);\n return Boolean(record && (field as any) in (record as any));\n }\n\n protected fieldPromiseCallBack(\n _index: number | number[],\n _field: FieldDef | FieldFormat | number,\n _value: MaybePromiseOrUndefined\n ): void {\n //\n }\n protected recordPromiseCallBack(_index: number | number[], _record: MaybePromiseOrUndefined): void {\n //\n }\n /** 静态变量 代表数据为空 */\n static EMPTY = new DataSource({\n get() {\n /* noop */\n },\n length: 0\n });\n}\n"]}
@@ -43,5 +43,4 @@ function isScrollToLeft(deltaX, state) {
43
43
  function isScrollToRight(deltaX, state) {
44
44
  const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
45
45
  return 0 !== totalWidth && deltaX >= 0 && Math.abs(state.scroll.horizontalBarPos - totalWidth) < 1;
46
- }
47
- //# sourceMappingURL=scroll.js.map
46
+ }
package/es/event/util.js CHANGED
@@ -20,4 +20,5 @@ function getTargetCell(target) {
20
20
  target = target.parent;
21
21
  }
22
22
  return null;
23
- }
23
+ }
24
+ //# sourceMappingURL=util.js.map
package/es/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import type { MousePointerCellEvent } from './ts-types/events';
12
12
  import * as CustomLayout from './render/layout';
13
13
  export { getDataCellPath } from './tools/get-data-path';
14
14
  export * from './render/jsx';
15
- export declare const version = "0.16.3";
15
+ export declare const version = "0.16.4-alpha.1";
16
16
  export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, IIndicator, ITitleDefine, ICornerDefine, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
17
17
  declare function getIcons(): {
18
18
  [key: string]: TYPES.ColumnIconOption;
package/es/index.js CHANGED
@@ -24,7 +24,7 @@ export { getDataCellPath } from "./tools/get-data-path";
24
24
 
25
25
  export * from "./render/jsx";
26
26
 
27
- export const version = "0.16.3";
27
+ export const version = "0.16.4-alpha.1";
28
28
 
29
29
  export { TYPES, core, ListTable, PivotTable, PivotChart, themes, data, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
30
30
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAsB3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAIhC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAiBV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACb,CAAC;AAGF,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AACD,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\n// import { container, loadCanvasPicker } from '@visactor/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.16.3\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAsB3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAiBV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACb,CAAC;AAGF,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AACD,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\n// import { container, loadCanvasPicker } from '@visactor/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.16.4-alpha.1\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
@@ -42,7 +42,7 @@ export function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeight
42
42
  (0 === rowStart && rowEnd === table.rowCount - 1 || isClearRowRangeHeightsMap) && table._clearRowRangeHeightsMap();
43
43
  for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {
44
44
  let startCol = 0, endCol = table.colCount - 1;
45
- if ((table.isPivotTable() || table.isPivotChart()) && checkPivotFixedStyleAndNoWrap(table, row) && (startCol = 0,
45
+ if ((table.isPivotTable() && !table.isPivotChart() || table.isPivotChart() && !table.internalProps.layoutMap.indicatorsAsCol) && checkPivotFixedStyleAndNoWrap(table, row) && (startCol = 0,
46
46
  endCol = table.rowHeaderLevelCount), isAllRowsAuto || "auto" === table.getDefaultRowHeight(row)) {
47
47
  const height = computeRowHeight(row, startCol, endCol, table);
48
48
  update ? newHeights[row] = height : table._setRowHeight(row, height);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC;IAChC,SAAS,EAAE,IAAI;CAEhB,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Y,EAAE;QACvB,MAAM,YAAY,GAAG,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;QACvE,YAAY,CAAC,aAAa,CAAC;YACzB,YAAY;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ;YACR,SAAS;YACT,UAAU;YACV,UAAU;YACV,UAAU;YACV,SAAS,EAAE,YAAY;SACxB,CAAC,CAAC;QACH,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption, ColumnTypeOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\nimport { isArray, isNumber, isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { decodeReactDom, dealPercentCalc } from '../component/custom';\n\nconst utilTextMark = new WrapText({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\nconst utilCheckBoxMark = new CheckBox({});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n table.defaultHeaderRowHeight;\n table.defaultHeaderColWidth;\n const isDefaultHeaderHasAuto =\n table.defaultHeaderRowHeight === 'auto' ||\n (isArray(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));\n const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';\n\n if (isAllRowsAuto || isDefaultHeaderHasAuto) {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n let startCol = 0;\n let endCol = table.colCount - 1;\n if ((table.isPivotTable() || table.isPivotChart()) && checkPivotFixedStyleAndNoWrap(table, row)) {\n // 列表头样式一致,只计算第一列行高,作为整行行高\n startCol = 0;\n endCol = table.rowHeaderLevelCount;\n }\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, startCol, endCol, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n // compute bottom frozen row\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) {\n // do nothing\n } else {\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n }\n }\n\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);\n const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;\n const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;\n const startRow = table.columnHeaderLevelCount;\n const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;\n let actualHeight = 0;\n for (let row = startRow; row < endRow; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = startRow; row < endRow; row++) {\n let rowHeight;\n if (row === endRow - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= startRow && index <= endRow - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(startRow, endRow - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n table.scenegraph._dealAutoFillHeightOriginRowsHeight = actualHeight;\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n // if (update) {\n // newHeights[row] = newHeights[row] * factor;\n // } else {\n // table.setRowHeight(row, table.getRowHeight(row) * factor);\n // }\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n canvasHeight -\n actualHeaderHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n const defaultHeight = table.getDefaultRowHeight(row);\n if (isNumber(defaultHeight)) {\n return defaultHeight;\n }\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (customHeight) {\n maxHeight = Math.max(customHeight.height, maxHeight);\n if (!customHeight.renderDefault) {\n continue;\n }\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n const defaultHeight = table.getDefaultRowHeight(row);\n maxHeight = Math.max(maxHeight, isNumber(defaultHeight) ? defaultHeight : table.defaultRowHeight);\n continue;\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, cellType, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n (table.internalProps.autoWrapText || table.isPivotChart()) &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction checkPivotFixedStyleAndNoWrap(table: BaseTableAPI, row: number) {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const headerDefine = layoutMap.getHeader(table.rowHeaderLevelCount, row);\n if (\n typeof headerDefine.style === 'function' ||\n typeof (headerDefine as HeaderData).icons === 'function' ||\n headerDefine.define?.headerCustomRender ||\n headerDefine.define?.headerCustomLayout ||\n typeof headerDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const headerStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof headerStyle.padding === 'function' ||\n typeof headerStyle.fontSize === 'function' ||\n typeof headerStyle.lineHeight === 'function' ||\n headerStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI) {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n let renderDefault = false;\n let enableCellPadding = false;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0);\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n renderDefault = customLayoutObj.renderDefault;\n enableCellPadding = customLayoutObj.enableCellPadding;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n renderDefault = customRenderObj?.renderDefault;\n } else {\n height = customRender?.expectedHeight ?? 0;\n renderDefault = customRender?.renderDefault;\n }\n if (enableCellPadding) {\n const actStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n height += padding[0] + padding[2];\n }\n return {\n height: height / spanRow,\n renderDefault\n };\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, cellType: ColumnTypeOption, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n let text;\n if (cellType === 'checkbox') {\n text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n } else {\n text = cellValue;\n }\n const lines = validToString(text).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (cellType === 'checkbox') {\n const size = getProp('size', actStyle, col, row, table);\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;\n utilCheckBoxMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n },\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon\n });\n utilCheckBoxMark.render();\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n } else if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
1
+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SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption, ColumnTypeOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\nimport { isArray, isNumber, isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { decodeReactDom, dealPercentCalc } from '../component/custom';\n\nconst utilTextMark = new WrapText({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\nconst utilCheckBoxMark = new CheckBox({});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n table.defaultHeaderRowHeight;\n table.defaultHeaderColWidth;\n const isDefaultHeaderHasAuto =\n table.defaultHeaderRowHeight === 'auto' ||\n (isArray(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));\n const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';\n\n if (isAllRowsAuto || isDefaultHeaderHasAuto) {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n let startCol = 0;\n let endCol = table.colCount - 1;\n if (\n ((table.isPivotTable() && !table.isPivotChart()) ||\n (table.isPivotChart() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) && // no top axis\n checkPivotFixedStyleAndNoWrap(table, row)\n ) {\n // 列表头样式一致,只计算第一列行高,作为整行行高\n startCol = 0;\n endCol = table.rowHeaderLevelCount;\n }\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, startCol, endCol, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n // compute bottom frozen row\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) {\n // do nothing\n } else {\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n }\n }\n\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);\n const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;\n const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;\n const startRow = table.columnHeaderLevelCount;\n const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;\n let actualHeight = 0;\n for (let row = startRow; row < endRow; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = startRow; row < endRow; row++) {\n let rowHeight;\n if (row === endRow - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= startRow && index <= endRow - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(startRow, endRow - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n table.scenegraph._dealAutoFillHeightOriginRowsHeight = actualHeight;\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n // if (update) {\n // newHeights[row] = newHeights[row] * factor;\n // } else {\n // table.setRowHeight(row, table.getRowHeight(row) * factor);\n // }\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n canvasHeight -\n actualHeaderHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n const defaultHeight = table.getDefaultRowHeight(row);\n if (isNumber(defaultHeight)) {\n return defaultHeight;\n }\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (customHeight) {\n maxHeight = Math.max(customHeight.height, maxHeight);\n if (!customHeight.renderDefault) {\n continue;\n }\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n const defaultHeight = table.getDefaultRowHeight(row);\n maxHeight = Math.max(maxHeight, isNumber(defaultHeight) ? defaultHeight : table.defaultRowHeight);\n continue;\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, cellType, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n (table.internalProps.autoWrapText || table.isPivotChart()) &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction checkPivotFixedStyleAndNoWrap(table: BaseTableAPI, row: number) {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const headerDefine = layoutMap.getHeader(table.rowHeaderLevelCount, row);\n if (\n typeof headerDefine.style === 'function' ||\n typeof (headerDefine as HeaderData).icons === 'function' ||\n headerDefine.define?.headerCustomRender ||\n headerDefine.define?.headerCustomLayout ||\n typeof headerDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const headerStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof headerStyle.padding === 'function' ||\n typeof headerStyle.fontSize === 'function' ||\n typeof headerStyle.lineHeight === 'function' ||\n headerStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI) {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n let renderDefault = false;\n let enableCellPadding = false;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0);\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n renderDefault = customLayoutObj.renderDefault;\n enableCellPadding = customLayoutObj.enableCellPadding;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n renderDefault = customRenderObj?.renderDefault;\n } else {\n height = customRender?.expectedHeight ?? 0;\n renderDefault = customRender?.renderDefault;\n }\n if (enableCellPadding) {\n const actStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n height += padding[0] + padding[2];\n }\n return {\n height: height / spanRow,\n renderDefault\n };\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, cellType: ColumnTypeOption, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n let text;\n if (cellType === 'checkbox') {\n text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n } else {\n text = cellValue;\n }\n const lines = validToString(text).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (cellType === 'checkbox') {\n const size = getProp('size', actStyle, col, row, table);\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;\n utilCheckBoxMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n },\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon\n });\n utilCheckBoxMark.render();\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n } else if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
@@ -2,4 +2,4 @@ import type { StateManager } from '../state';
2
2
  import type { Group } from '../../scenegraph/graphic/group';
3
3
  import type { BaseTableAPI } from '../../ts-types/base-table';
4
4
  export declare function getCellHoverColor(cellGroup: Group, table: BaseTableAPI): string | undefined;
5
- export declare function isCellHover(state: StateManager, col: number, row: number): string | undefined;
5
+ export declare function isCellHover(state: StateManager, col: number, row: number, cellGroup: Group): string | undefined;