@visactor/vtable 0.15.5-alpha.1 → 0.15.5-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/core/BaseTable.js +2 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +9 -8
- package/cjs/layout/pivot-header-layout.js +38 -132
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/pivot-layout-helper.d.ts +10 -2
- package/cjs/layout/pivot-layout-helper.js +108 -6
- package/cjs/layout/pivot-layout-helper.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +1 -0
- package/cjs/layout/simple-header-layout.js +5 -7
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/group.js +5 -3
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +21 -7
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +26 -12
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/dist/vtable.js +263 -177
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.js +2 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +9 -8
- package/es/layout/pivot-header-layout.js +37 -129
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/pivot-layout-helper.d.ts +10 -2
- package/es/layout/pivot-layout-helper.js +107 -5
- package/es/layout/pivot-layout-helper.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +1 -0
- package/es/layout/simple-header-layout.js +5 -7
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/group.js +5 -3
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +21 -7
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +25 -11
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/graphic/group.ts"],"names":[],"mappings":";;;AACA,+CAA0D;AAK1D,MAAa,KAAM,SAAQ,eAAY;IAmBrC,KAAK;QACH,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,cAAc,CAAC,IAAY,EAAE,IAAc;QAMzC,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YACvC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;gBACvB,MAAM,GAAG,KAAK,CAAC;gBACf,OAAO,IAAI,CAAC;aACb;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,EAAE;YAcR,IAAI,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;gBACvC,IAAK,KAAe,CAAC,cAAc,EAAE;oBACnC,MAAM,MAAM,GAAI,KAAe,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBAC3D,IAAI,MAAM,EAAE;wBACV,MAAM,GAAG,MAAM,CAAC;wBAChB,OAAO,IAAI,CAAC;qBACb;iBACF;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,KAAK;;QACP,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU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AC9C,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QAC7C,OAAO;KACR;IAED,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,UAAU,EAAE;QACpC,OAAO;KACR;IACD,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC","file":"group.js","sourcesContent":["import type { IGraphic, IColor, IRect, INode } from '@visactor/vrender';\nimport { Group as VRenderGroup } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { InteractionState } from '../../ts-types';\nimport type { AABBBounds } from '@visactor/vutils';\n\nexport class Group extends VRenderGroup {\n role?: string;\n col?: number;\n row?: number;\n mergeStartCol?: number;\n mergeStartRow?: number;\n mergeEndCol?: number;\n mergeEndRow?: number;\n contentWidth?: number;\n contentHeight?: number;\n rowNumber?: number; // row number of the column group\n colHeight?: number; // current height of the column group\n border?: IRect; // table/header/body的border mark,挂载在这里方便更新\n needUpdate?: boolean;\n\n /**\n * @description: 清空Group下全部子元素\n * @return {*}\n */\n clear() {\n this.removeAllChild();\n }\n\n getChildByName(name: string, deep?: boolean): any {\n // for (let i = 0, j = this.children.length; i < j; i++) {\n // if (this.children[i].name === name) {\n // return this.children[i] as unknown as T;\n // }\n // }\n let result = null;\n this.forEachChildren((child: IGraphic) => {\n if (child.name === name) {\n result = child;\n return true; // 提前退出循环\n }\n return false;\n });\n\n if (deep) {\n // for (let i = 0, j = this.children.length; i < j; i++) {\n // const child = this.children[i] as Group;\n\n // if (!child.getChildByName) {\n // continue;\n // }\n\n // const target = child.getChildByName(name, true);\n\n // if (target) {\n // return target;\n // }\n // }\n this.forEachChildren((child: IGraphic) => {\n if ((child as Group).getChildByName) {\n const target = (child as Group).getChildByName(name, true);\n if (target) {\n result = target;\n return true;\n }\n }\n return false;\n });\n }\n\n return result;\n }\n\n get width() {\n let width = this.AABBBounds.width();\n if (width === Infinity || width === -Infinity) {\n width = 0;\n }\n return Math.max(width, this.attribute.width ?? 0);\n }\n\n get height() {\n let height = this.AABBBounds.height();\n if (height === Infinity || height === -Infinity) {\n height = 0;\n }\n return Math.max(height, this.attribute.height ?? 0);\n }\n\n setDeltaWidth(deltaX: number) {\n if (deltaX === 0) {\n return;\n }\n this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);\n if (this.border) {\n this.border.setAttribute('width', this.border.attribute.width + deltaX);\n }\n }\n\n setDeltaHeight(deltaY: number) {\n if (deltaY === 0) {\n return;\n }\n this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);\n if (this.border) {\n this.border.setAttribute('height', this.border.attribute.height + deltaY);\n }\n }\n\n setDeltaX(deltaX: number) {\n if (deltaX === 0) {\n return;\n }\n this.setAttribute('x', this.attribute.x + deltaX);\n }\n\n setDeltaY(deltaY: number) {\n if (deltaY === 0) {\n return;\n }\n this.setAttribute('y', this.attribute.y + deltaY);\n }\n\n /**\n * @description: 遍历所有子节点,跳过部分节点,默认跳过group的border\n * @return {*}\n */\n forEachChildrenSkipChild<T extends INode = INode>(\n cb: (item: T, index: number) => void | boolean,\n skipChildName = 'border-rect',\n reverse = false\n ) {\n if (reverse) {\n let child = this._lastChild;\n let i = 0;\n while (child) {\n if (child.name !== skipChildName) {\n const breakTag = cb(child as T, i++);\n if (breakTag) {\n return;\n }\n }\n child = child._prev;\n }\n } else {\n let child = this._firstChild;\n let i = 0;\n while (child) {\n if (child.name !== skipChildName) {\n const breakTag = cb(child as T, i++);\n if (breakTag) {\n return;\n }\n }\n child = child._next;\n }\n }\n }\n\n getColGroup(col: number) {\n let c = this._firstChild as Group;\n if (!c) {\n return null;\n }\n for (let i = 0; i < this.childrenCount; i++) {\n if (c.col === col) {\n return c;\n }\n c = c._next as Group;\n }\n return null;\n }\n\n getRowGroup(row: number) {\n let c = this._firstChild as Group;\n if (!c) {\n return null;\n }\n for (let i = 0; i < this.childrenCount; i++) {\n if (c.row === row) {\n return c;\n }\n c = c._next as Group;\n }\n return null;\n }\n\n getChildAt(index: number) {\n const child = super.getChildAt(index);\n if (child && child.name === 'border-rect') {\n return child._next;\n }\n return child;\n }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n if (this.role === 'cell') {\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n // application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const selfChange = this.shouldSelfChangeUpdateAABBBounds();\n // const selfChange = true;\n const bounds = this.doUpdateAABBBounds();\n this.addUpdateLayoutTag();\n // application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);\n after(this, selfChange);\n\n return bounds;\n }\n return super.tryUpdateAABBBounds();\n }\n\n // 目前优化方案会导致合并单元格无法正常更新列宽(因为合并单元格更新bounds不会触发父节点bounds更新),暂时关闭优化方案\n // shouldUpdateAABBBoundsForRowMerge(): boolean {\n\n // }\n\n // shouldUpdateAABBBounds(): boolean {\n // return this.shouldSelfChangeUpdateAABBBounds();\n // // // 检索自己是否需要更新\n // // if (super.shouldUpdateAABBBounds()) {\n // // return true;\n // // }\n // // // 检索叶子节点是否有更新(如果children是叶子节点的话)\n // // if (this._childUpdateTag & UpdateTag.UPDATE_BOUNDS) {\n // // return true;\n // // }\n // // // 检索是否子group需要更新\n // // let needUpdate = false;\n // // this.forEachChildren((node: IGraphic) => {\n // // // 只查找group层级\n // // if (node.isContainer && (node as Group).shouldUpdateAABBBounds()) {\n // // needUpdate = true;\n // // return true;\n // // }\n // // return false;\n // // });\n // // return needUpdate;\n // }\n\n protected doUpdateAABBBounds(): any {\n // const groupTheme = getTheme(this).group;\n // debugger;\n if (this.role === 'cell') {\n const attribute = this.attribute;\n const { x, y, width, height } = attribute;\n this._AABBBounds.setValue(x, y, x + width, y + height);\n // 更新bounds之后需要设置父节点,否则tag丢失\n this.parent && this.parent.addChildUpdateBoundTag();\n this.clearUpdateBoundTag();\n return this._AABBBounds;\n }\n return super.doUpdateAABBBounds();\n // _AABBBounds\n // const bounds = graphicService.updateGroupAABBBounds(\n // attribute,\n // getTheme(this).group,\n // this._AABBBounds,\n // this\n // ) as AABBBounds;\n\n // const { boundsPadding = groupTheme.boundsPadding } = attribute;\n // const paddingArray = parsePadding(boundsPadding);\n // if (paddingArray) {\n // bounds.expand(paddingArray);\n // }\n // // 更新bounds之后需要设置父节点,否则tag丢失\n // this.parent && this.parent.addChildUpdateBoundTag();\n // this.clearUpdateBoundTag();\n\n // this.emit('AAABBBoundsChange');\n }\n\n // update column group row number\n updateColumnRowNumber(row: number) {\n if (!this.rowNumber) {\n this.rowNumber = row;\n } else {\n this.rowNumber = Math.max(this.rowNumber, row);\n }\n }\n\n // update column height\n updateColumnHeight(cellHeight: number) {\n if (!this.colHeight) {\n this.colHeight = cellHeight;\n } else {\n this.colHeight += cellHeight;\n }\n }\n}\n\nfunction after(group: Group, selfChange: boolean) {\n if (!(group.stage && group.stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (group.isContainer && !selfChange) {\n return;\n }\n group.stage.dirty(group.globalAABBBounds);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/graphic/group.ts"],"names":[],"mappings":";;;AACA,+CAA0D;AAK1D,MAAa,KAAM,SAAQ,eAAY;IAmBrC,KAAK;QACH,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,cAAc,CAAC,IAAY,EAAE,IAAc;QAMzC,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YACvC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;gBACvB,MAAM,GAAG,KAAK,CAAC;gBACf,OAAO,IAAI,CAAC;aACb;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,EAAE;YAcR,IAAI,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE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,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;YAEvD,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;YACpD,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC;SACzB;QACD,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAC;IAmBpC,CAAC;IAGD,qBAAqB,CAAC,GAAW;QAC/B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;SAChD;IACH,CAAC;IAGD,kBAAkB,CAAC,UAAkB;QACnC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;SAC7B;aAAM;YACL,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC;SAC9B;IACH,CAAC;CACF;AA1SD,sBA0SC;AAED,SAAS,KAAK,CAAC,KAAY,EAAE,UAAmB;IAC9C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;QAC5B,OAAO;KACR;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QAC7C,OAAO;KACR;IAED,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,UAAU,EAAE;QACpC,OAAO;KACR;IACD,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC","file":"group.js","sourcesContent":["import type { IGraphic, IColor, IRect, INode } from '@visactor/vrender';\nimport { Group as VRenderGroup } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { InteractionState } from '../../ts-types';\nimport type { AABBBounds } from '@visactor/vutils';\n\nexport class Group extends VRenderGroup {\n role?: string;\n col?: number;\n row?: number;\n mergeStartCol?: number;\n mergeStartRow?: number;\n mergeEndCol?: number;\n mergeEndRow?: number;\n contentWidth?: number;\n contentHeight?: number;\n rowNumber?: number; // row number of the column group\n colHeight?: number; // current height of the column group\n border?: IRect; // table/header/body的border mark,挂载在这里方便更新\n needUpdate?: boolean;\n\n /**\n * @description: 清空Group下全部子元素\n * @return {*}\n */\n clear() {\n this.removeAllChild();\n }\n\n getChildByName(name: string, deep?: boolean): any {\n // for (let i = 0, j = this.children.length; i < j; i++) {\n // if (this.children[i].name === name) {\n // return this.children[i] as unknown as T;\n // }\n // }\n let result = null;\n this.forEachChildren((child: IGraphic) => {\n if (child.name === name) {\n result = child;\n return true; // 提前退出循环\n }\n return false;\n });\n\n if (deep) {\n // for (let i = 0, j = this.children.length; i < j; i++) {\n // const child = this.children[i] as Group;\n\n // if (!child.getChildByName) {\n // continue;\n // }\n\n // const target = child.getChildByName(name, true);\n\n // if (target) {\n // return target;\n // }\n // }\n this.forEachChildren((child: IGraphic) => {\n if ((child as Group).getChildByName) {\n const target = (child as Group).getChildByName(name, true);\n if (target) {\n result = target;\n return true;\n }\n }\n return false;\n });\n }\n\n return result;\n }\n\n get width() {\n let width = this.AABBBounds.width();\n if (width === Infinity || width === -Infinity) {\n width = 0;\n }\n return Math.max(width, this.attribute.width ?? 0);\n }\n\n get height() {\n let height = this.AABBBounds.height();\n if (height === Infinity || height === -Infinity) {\n height = 0;\n }\n return Math.max(height, this.attribute.height ?? 0);\n }\n\n setDeltaWidth(deltaX: number) {\n if (deltaX === 0) {\n return;\n }\n this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);\n if (this.border) {\n this.border.setAttribute('width', this.border.attribute.width + deltaX);\n\n if (this.border.type === 'group') {\n (this.border.firstChild as IRect).setAttribute(\n 'width',\n (this.border.firstChild as IRect).attribute.width + deltaX\n );\n }\n }\n }\n\n setDeltaHeight(deltaY: number) {\n if (deltaY === 0) {\n return;\n }\n this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);\n if (this.border) {\n this.border.setAttribute('height', this.border.attribute.height + deltaY);\n if (this.border.type === 'group') {\n (this.border.firstChild as IRect).setAttribute(\n 'width',\n (this.border.firstChild as IRect).attribute.height + deltaY\n );\n }\n }\n }\n\n setDeltaX(deltaX: number) {\n if (deltaX === 0) {\n return;\n }\n this.setAttribute('x', this.attribute.x + deltaX);\n }\n\n setDeltaY(deltaY: number) {\n if (deltaY === 0) {\n return;\n }\n this.setAttribute('y', this.attribute.y + deltaY);\n }\n\n /**\n * @description: 遍历所有子节点,跳过部分节点,默认跳过group的border\n * @return {*}\n */\n forEachChildrenSkipChild<T extends INode = INode>(\n cb: (item: T, index: number) => void | boolean,\n skipChildName = 'border-rect',\n reverse = false\n ) {\n if (reverse) {\n let child = this._lastChild;\n let i = 0;\n while (child) {\n if (child.name !== skipChildName) {\n const breakTag = cb(child as T, i++);\n if (breakTag) {\n return;\n }\n }\n child = child._prev;\n }\n } else {\n let child = this._firstChild;\n let i = 0;\n while (child) {\n if (child.name !== skipChildName) {\n const breakTag = cb(child as T, i++);\n if (breakTag) {\n return;\n }\n }\n child = child._next;\n }\n }\n }\n\n getColGroup(col: number) {\n let c = this._firstChild as Group;\n if (!c) {\n return null;\n }\n for (let i = 0; i < this.childrenCount; i++) {\n if (c.col === col) {\n return c;\n }\n c = c._next as Group;\n }\n return null;\n }\n\n getRowGroup(row: number) {\n let c = this._firstChild as Group;\n if (!c) {\n return null;\n }\n for (let i = 0; i < this.childrenCount; i++) {\n if (c.row === row) {\n return c;\n }\n c = c._next as Group;\n }\n return null;\n }\n\n getChildAt(index: number) {\n const child = super.getChildAt(index);\n if (child && child.name === 'border-rect') {\n return child._next;\n }\n return child;\n }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n if (this.role === 'cell') {\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n // application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const selfChange = this.shouldSelfChangeUpdateAABBBounds();\n // const selfChange = true;\n const bounds = this.doUpdateAABBBounds();\n this.addUpdateLayoutTag();\n // application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);\n after(this, selfChange);\n\n return bounds;\n }\n return super.tryUpdateAABBBounds();\n }\n\n // 目前优化方案会导致合并单元格无法正常更新列宽(因为合并单元格更新bounds不会触发父节点bounds更新),暂时关闭优化方案\n // shouldUpdateAABBBoundsForRowMerge(): boolean {\n\n // }\n\n // shouldUpdateAABBBounds(): boolean {\n // return this.shouldSelfChangeUpdateAABBBounds();\n // // // 检索自己是否需要更新\n // // if (super.shouldUpdateAABBBounds()) {\n // // return true;\n // // }\n // // // 检索叶子节点是否有更新(如果children是叶子节点的话)\n // // if (this._childUpdateTag & UpdateTag.UPDATE_BOUNDS) {\n // // return true;\n // // }\n // // // 检索是否子group需要更新\n // // let needUpdate = false;\n // // this.forEachChildren((node: IGraphic) => {\n // // // 只查找group层级\n // // if (node.isContainer && (node as Group).shouldUpdateAABBBounds()) {\n // // needUpdate = true;\n // // return true;\n // // }\n // // return false;\n // // });\n // // return needUpdate;\n // }\n\n protected doUpdateAABBBounds(): any {\n // const groupTheme = getTheme(this).group;\n // debugger;\n if (this.role === 'cell') {\n const attribute = this.attribute;\n const { x, y, width, height } = attribute;\n this._AABBBounds.setValue(x, y, x + width, y + height);\n // 更新bounds之后需要设置父节点,否则tag丢失\n this.parent && this.parent.addChildUpdateBoundTag();\n this.clearUpdateBoundTag();\n return this._AABBBounds;\n }\n return super.doUpdateAABBBounds();\n // _AABBBounds\n // const bounds = graphicService.updateGroupAABBBounds(\n // attribute,\n // getTheme(this).group,\n // this._AABBBounds,\n // this\n // ) as AABBBounds;\n\n // const { boundsPadding = groupTheme.boundsPadding } = attribute;\n // const paddingArray = parsePadding(boundsPadding);\n // if (paddingArray) {\n // bounds.expand(paddingArray);\n // }\n // // 更新bounds之后需要设置父节点,否则tag丢失\n // this.parent && this.parent.addChildUpdateBoundTag();\n // this.clearUpdateBoundTag();\n\n // this.emit('AAABBBoundsChange');\n }\n\n // update column group row number\n updateColumnRowNumber(row: number) {\n if (!this.rowNumber) {\n this.rowNumber = row;\n } else {\n this.rowNumber = Math.max(this.rowNumber, row);\n }\n }\n\n // update column height\n updateColumnHeight(cellHeight: number) {\n if (!this.colHeight) {\n this.colHeight = cellHeight;\n } else {\n this.colHeight += cellHeight;\n }\n }\n}\n\nfunction after(group: Group, selfChange: boolean) {\n if (!group.stage.dirtyBounds) {\n return;\n }\n if (!(group.stage && group.stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (group.isContainer && !selfChange) {\n return;\n }\n group.stage.dirty(group.globalAABBBounds);\n}\n"]}
|
|
@@ -22,9 +22,13 @@ function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeightsMap =
|
|
|
22
22
|
if (isAllRowsAuto || isDefaultHeaderHasAuto) {
|
|
23
23
|
rowStart = null != rowStart ? rowStart : 0, rowEnd = null != rowEnd ? rowEnd : table.rowCount - 1,
|
|
24
24
|
(0 === rowStart && rowEnd === table.rowCount - 1 || isClearRowRangeHeightsMap) && table._clearRowRangeHeightsMap();
|
|
25
|
-
for (let row = rowStart; row < table.columnHeaderLevelCount; row++)
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {
|
|
26
|
+
let startCol = 0, endCol = table.colCount - 1;
|
|
27
|
+
if ((table.isPivotTable() || table.isPivotChart()) && checkPivotFixedStyleAndNoWrap(table, row) && (startCol = 0,
|
|
28
|
+
endCol = table.rowHeaderLevelCount), isAllRowsAuto || "auto" === table.getDefaultRowHeight(row)) {
|
|
29
|
+
const height = computeRowHeight(row, startCol, endCol, table);
|
|
30
|
+
update ? newHeights[row] = height : table._setRowHeight(row, height);
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) if (isAllRowsAuto || "auto" === table.getDefaultRowHeight(row)) {
|
|
30
34
|
const height = computeRowHeight(row, 0, table.colCount - 1, table);
|
|
@@ -117,12 +121,12 @@ function computeRowHeight(row, startCol, endCol, table) {
|
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
function checkFixedStyleAndNoWrap(table) {
|
|
120
|
-
var _a, _b;
|
|
124
|
+
var _a, _b, _c;
|
|
121
125
|
const {layoutMap: layoutMap} = table.internalProps, row = table.columnHeaderLevelCount;
|
|
122
126
|
if ((table.internalProps.autoWrapText || table.isPivotChart()) && ("autoHeight" === table.options.heightMode || "adaptive" === table.options.heightMode)) return !1;
|
|
123
127
|
for (let col = 0; col < table.colCount; col++) {
|
|
124
128
|
const cellDefine = layoutMap.getBody(col, row);
|
|
125
|
-
if ("function" == typeof cellDefine.style || "function" == typeof cellDefine.icon || (null === (_a = cellDefine.define) || void 0 === _a ? void 0 : _a.customRender) || "function" == typeof (null === (
|
|
129
|
+
if ("function" == typeof cellDefine.style || "function" == typeof cellDefine.icon || (null === (_a = cellDefine.define) || void 0 === _a ? void 0 : _a.customRender) || (null === (_b = cellDefine.define) || void 0 === _b ? void 0 : _b.customLayout) || "function" == typeof (null === (_c = cellDefine.define) || void 0 === _c ? void 0 : _c.icon)) return !1;
|
|
126
130
|
const cellStyle = table._getCellStyle(col, row);
|
|
127
131
|
if ("function" == typeof cellStyle.padding || "function" == typeof cellStyle.fontSize || "function" == typeof cellStyle.lineHeight || !0 === cellStyle.autoWrapText) return !1;
|
|
128
132
|
}
|
|
@@ -130,15 +134,25 @@ function checkFixedStyleAndNoWrap(table) {
|
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
function checkFixedStyleAndNoWrapForTranspose(table, row) {
|
|
133
|
-
var _a, _b;
|
|
137
|
+
var _a, _b, _c;
|
|
134
138
|
const {layoutMap: layoutMap} = table.internalProps;
|
|
135
139
|
if (table.internalProps.autoWrapText && ("autoHeight" === table.options.heightMode || "adaptive" === table.options.heightMode)) return !1;
|
|
136
140
|
const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);
|
|
137
|
-
if ("function" == typeof cellDefine.style || "function" == typeof cellDefine.icon || (null === (_a = cellDefine.define) || void 0 === _a ? void 0 : _a.customRender) || "function" == typeof (null === (
|
|
141
|
+
if ("function" == typeof cellDefine.style || "function" == typeof cellDefine.icon || (null === (_a = cellDefine.define) || void 0 === _a ? void 0 : _a.customRender) || (null === (_b = cellDefine.define) || void 0 === _b ? void 0 : _b.customLayout) || "function" == typeof (null === (_c = cellDefine.define) || void 0 === _c ? void 0 : _c.icon)) return !1;
|
|
138
142
|
const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);
|
|
139
143
|
return "function" != typeof cellStyle.padding && "function" != typeof cellStyle.fontSize && "function" != typeof cellStyle.lineHeight && !0 !== cellStyle.autoWrapText;
|
|
140
144
|
}
|
|
141
145
|
|
|
146
|
+
function checkPivotFixedStyleAndNoWrap(table, row) {
|
|
147
|
+
var _a, _b, _c;
|
|
148
|
+
const {layoutMap: layoutMap} = table.internalProps;
|
|
149
|
+
if (table.internalProps.autoWrapText && ("autoHeight" === table.options.heightMode || "adaptive" === table.options.heightMode)) return !1;
|
|
150
|
+
const headerDefine = layoutMap.getHeader(table.rowHeaderLevelCount, row);
|
|
151
|
+
if ("function" == typeof headerDefine.style || "function" == typeof headerDefine.icons || (null === (_a = headerDefine.define) || void 0 === _a ? void 0 : _a.headerCustomRender) || (null === (_b = headerDefine.define) || void 0 === _b ? void 0 : _b.headerCustomLayout) || "function" == typeof (null === (_c = headerDefine.define) || void 0 === _c ? void 0 : _c.icon)) return !1;
|
|
152
|
+
const headerStyle = table._getCellStyle(table.rowHeaderLevelCount, row);
|
|
153
|
+
return "function" != typeof headerStyle.padding && "function" != typeof headerStyle.fontSize && "function" != typeof headerStyle.lineHeight && !0 !== headerStyle.autoWrapText;
|
|
154
|
+
}
|
|
155
|
+
|
|
142
156
|
function fillRowsHeight(height, startRow, endRow, table, newHeights) {
|
|
143
157
|
for (let row = startRow; row <= endRow; row++) newHeights ? newHeights[row] = height : table._setRowHeight(row, height);
|
|
144
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAE9D,2CAAiD;AAEjD,6CAA8C;AAG9C,0CAA2C;AAC3C,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAiE;AACjE,+EAAsF;AACtF,2FAA2F;AAC3F,6CAA+D;AAC/D,qEAAwD;AACxD,gDAAsE;AAEtE,MAAM,YAAY,GAAG,IAAI,eAAQ,CAAC;IAChC,SAAS,EAAE,IAAI;CAEhB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,kBAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,EAAE;CACf,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,6BAAQ,CAAC,EAAE,CAAC,CAAC;AAE1C,SAAgB,iBAAiB,CAC/B,KAAmB,EACnB,QAAiB,EACjB,MAAe,EACf,4BAAqC,IAAI,EACzC,MAAgB;;IAEhB,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1E,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,MAAM,EAAE;QACV,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;YAE7C,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;SAC9C;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AgB,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAalD;SAAM,IAAI,YAAY,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 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 // 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\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 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 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 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 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 } 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 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
|
+
{"version":3,"sources":["../src/scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAE9D,2CAAiD;AAEjD,6CAA8C;AAG9C,0CAA2C;AAC3C,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAiE;AACjE,+EAAsF;AACtF,2FAA2F;AAC3F,6CAA+D;AAC/D,qEAAwD;AACxD,gDAAsE;AAEtE,MAAM,YAAY,GAAG,IAAI,eAAQ,CAAC;IAChC,SAAS,EAAE,IAAI;CAEhB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,kBAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,EAAE;CACf,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,6BAAQ,CAAC,EAAE,CAAC,CAAC;AAE1C,SAAgB,iBAAiB,CAC/B,KAAmB,EACnB,QAAiB,EACjB,MAAe,EACf,4BAAqC,IAAI,EACzC,MAAgB;;IAEhB,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1E,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,MAAM,EAAE;QACV,KAAK,IAAI,GA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C,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\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 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 } 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 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"]}
|
|
@@ -9,27 +9,38 @@ const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vu
|
|
|
9
9
|
function createFrameBorder(group, frameTheme, role, strokeArray, justForXYPosition) {
|
|
10
10
|
var _a, _b, _c, _d;
|
|
11
11
|
if (!frameTheme) return;
|
|
12
|
-
const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme
|
|
12
|
+
const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme;
|
|
13
|
+
let hasShadow = !1;
|
|
14
|
+
const groupAttributes = {}, rectAttributes = {
|
|
13
15
|
pickable: !1
|
|
14
16
|
};
|
|
15
17
|
shadowBlur && isTableGroup && (rectAttributes.shadowBlur = shadowBlur, rectAttributes.shadowOffsetX = shadowOffsetX,
|
|
16
18
|
rectAttributes.shadowOffsetY = shadowOffsetY, rectAttributes.shadowColor = shadowColor,
|
|
17
19
|
rectAttributes.stroke = !0, rectAttributes.stroke = shadowColor, rectAttributes.lineWidth = 1,
|
|
18
|
-
|
|
19
|
-
rectAttributes.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
hasShadow = !0), borderLineWidth && (rectAttributes.stroke = !0, rectAttributes.fill = !1,
|
|
21
|
+
rectAttributes.stroke = getStroke(borderColor, strokeArray), rectAttributes.lineWidth = borderLineWidth,
|
|
22
|
+
borderLineDash && (rectAttributes.lineDash = borderLineDash), rectAttributes.lineCap = "square"),
|
|
23
|
+
Array.isArray(borderColor) && (rectAttributes.strokeArrayColor = (0, padding_1.getQuadProps)(borderColor)),
|
|
24
|
+
Array.isArray(borderLineWidth) && (rectAttributes.strokeArrayWidth = (0, padding_1.getQuadProps)(borderLineWidth),
|
|
25
|
+
rectAttributes.lineWidth = 1), cornerRadius && (rectAttributes.cornerRadius = cornerRadius,
|
|
24
26
|
groupAttributes.cornerRadius = cornerRadius);
|
|
25
27
|
const borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_a = rectAttributes.lineWidth) && void 0 !== _a ? _a : 0, borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_b = rectAttributes.lineWidth) && void 0 !== _b ? _b : 0, borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_c = rectAttributes.lineWidth) && void 0 !== _c ? _c : 0, borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0;
|
|
26
28
|
if (group.setAttributes(groupAttributes), !justForXYPosition && rectAttributes.stroke) if (rectAttributes.x = borderLeft / 2,
|
|
27
29
|
rectAttributes.y = borderTop / 2, rectAttributes.pickable = !1, isTableGroup) {
|
|
28
|
-
|
|
29
|
-
rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
30
|
-
rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
let shadowRect, borderRect;
|
|
31
|
+
rectAttributes.x = -borderLeft / 2, rectAttributes.y = -borderTop / 2, rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
32
|
+
rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2,
|
|
33
|
+
hasShadow ? (rectAttributes.fill = "white", rectAttributes.notAdjustPos = !0, shadowRect = (0,
|
|
34
|
+
vrender_1.createRect)(rectAttributes), borderRect = (0, vrender_1.createGroup)({
|
|
35
|
+
x: group.attribute.x,
|
|
36
|
+
y: group.attribute.y,
|
|
37
|
+
width: group.attribute.width,
|
|
38
|
+
height: group.attribute.height,
|
|
39
|
+
fill: "red",
|
|
40
|
+
cornerRadius: group.attribute.cornerRadius,
|
|
41
|
+
globalCompositeOperation: "destination-out"
|
|
42
|
+
}), borderRect.name = "table-border-rect", borderRect.addChild(shadowRect)) : (borderRect = (0,
|
|
43
|
+
vrender_1.createRect)(rectAttributes), borderRect.name = "table-border-rect"), group.parent.insertBefore(borderRect, group),
|
|
33
44
|
group.border = borderRect;
|
|
34
45
|
} else {
|
|
35
46
|
rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
@@ -59,6 +70,9 @@ function updateFrameBorderSize(group) {
|
|
|
59
70
|
group.border.setAttributes({
|
|
60
71
|
width: group.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
61
72
|
height: group.attribute.height - borderTop / 2 - borderBottom / 2
|
|
73
|
+
}), "group" === group.border.type && group.border.firstChild.setAttributes({
|
|
74
|
+
width: group.attribute.width,
|
|
75
|
+
height: group.attribute.height
|
|
62
76
|
});
|
|
63
77
|
}
|
|
64
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/style/frame-border.ts"],"names":[],"mappings":";;;AACA,+CAA+C;AAG/C,6CAA2C;AAC3C,8CAAgD;AAUhD,SAAgB,iBAAiB,CAC/B,KAAY,EACZ,UAAuC,EACvC,IAAY,EACZ,WAA6D,EAC7D,iBAA2B;;IAE3B,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,CAAC;IAEtC,MAAM,EACJ,UAAU,EACV,aAAa,E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AAI,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB;QACnE,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IACtD,MAAM,UAAU,GAAI,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB;QACjE,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IAEtD,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC;KAClE,CAAC,CAAC;AACL,CAAC;AArBD,sDAqBC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRectGraphicAttribute } from '@visactor/vrender';\nimport { createRect } from '@visactor/vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n\n rectAttributes.fill = true;\n rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'square';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n // if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n // const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n // const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n // groupAttributes.x = deltaX;\n // groupAttributes.y = deltaY;\n // // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n // }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n rectAttributes.x = group.attribute.x - borderLeft / 2;\n rectAttributes.y = group.attribute.y - borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n group.parent.insertBefore(borderRect, group);\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nexport function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/style/frame-border.ts"],"names":[],"mappings":";;;AACA,+CAA4D;AAG5D,6CAA2C;AAC3C,8CAAgD;AAUhD,SAAgB,iBAAiB,CAC/B,KAAY,EACZ,UAAuC,EACvC,IAAY,EACZ,WAA6D,EAC7D,iBAA2B;;IAE3B,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,CAAC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AAG,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC;KAClE,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAChC,KAAK,CAAC,MAAM,CAAC,UAAoB,CAAC,aAAa,CAAC;YAC/C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK;YAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;SAC/B,CAAC,CAAC;KACJ;AACH,CAAC;AA5BD,sDA4BC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRect, IRectGraphicAttribute } from '@visactor/vrender';\nimport { createGroup, createRect } from '@visactor/vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n let hasShadow = false;\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n hasShadow = true;\n\n // rectAttributes.fill = true;\n // rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'square';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n // if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n // const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n // const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n // groupAttributes.x = deltaX;\n // groupAttributes.y = deltaY;\n // // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n // }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n rectAttributes.x = -borderLeft / 2;\n rectAttributes.y = -borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n\n let shadowRect;\n let borderRect;\n if (hasShadow) {\n rectAttributes.fill = 'white';\n (rectAttributes as any).notAdjustPos = true;\n // first draw\n shadowRect = createRect(rectAttributes);\n // second draw\n borderRect = createGroup({\n x: group.attribute.x,\n y: group.attribute.y,\n width: group.attribute.width,\n height: group.attribute.height,\n fill: 'red',\n cornerRadius: group.attribute.cornerRadius,\n globalCompositeOperation: 'destination-out'\n });\n borderRect.name = 'table-border-rect';\n borderRect.addChild(shadowRect);\n } else {\n borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n }\n\n group.parent.insertBefore(borderRect, group);\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nexport function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n\n if (group.border.type === 'group') {\n (group.border.firstChild as IRect).setAttributes({\n width: group.attribute.width,\n height: group.attribute.height\n });\n }\n}\n"]}
|