@visactor/vtable 1.6.3-alpha.1 → 1.6.3-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.
Files changed (41) hide show
  1. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +4 -4
  2. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  3. package/cjs/core/BaseTable.js +3 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/index.d.ts +1 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/index.js.map +1 -1
  8. package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
  9. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  10. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +2 -2
  11. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +2 -3
  12. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  13. package/cjs/scenegraph/layout/update-height.js +2 -5
  14. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  15. package/cjs/scenegraph/layout/update-width.js +1 -6
  16. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  17. package/cjs/ts-types/base-table.d.ts +2 -0
  18. package/cjs/ts-types/base-table.js.map +1 -1
  19. package/cjs/vrender.js.map +1 -1
  20. package/dist/vtable.js +14 -28
  21. package/dist/vtable.min.js +2 -2
  22. package/es/components/tooltip/logic/BubbleTooltipElement.js +4 -4
  23. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  24. package/es/core/BaseTable.js +3 -1
  25. package/es/core/BaseTable.js.map +1 -1
  26. package/es/index.d.ts +1 -1
  27. package/es/index.js +1 -1
  28. package/es/index.js.map +1 -1
  29. package/es/scenegraph/group-creater/cell-helper.js +1 -1
  30. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  31. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +2 -2
  32. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +2 -3
  33. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  34. package/es/scenegraph/layout/update-height.js +2 -5
  35. package/es/scenegraph/layout/update-height.js.map +1 -1
  36. package/es/scenegraph/layout/update-width.js +1 -6
  37. package/es/scenegraph/layout/update-width.js.map +1 -1
  38. package/es/ts-types/base-table.d.ts +2 -0
  39. package/es/ts-types/base-table.js.map +1 -1
  40. package/es/vrender.js.map +1 -1
  41. package/package.json +4 -4
@@ -89,7 +89,7 @@ class BubbleTooltipElement {
89
89
  const rootElement = this._rootElement, rect = table.getCellRangeRelativeRect({
90
90
  col: col,
91
91
  row: row
92
- }), element = table.getElement(), containerWidth = table.internalProps.element.offsetWidth, {width: width} = rect;
92
+ }), element = table.internalProps.tooltip.parentElement, containerWidth = table.internalProps.element.offsetWidth, {width: width} = rect;
93
93
  if (rootElement) {
94
94
  let tooltipY, tooltipX;
95
95
  rootElement.parentElement !== element && element.appendChild(rootElement), rootElement.style.left = "0px";
@@ -113,7 +113,7 @@ class BubbleTooltipElement {
113
113
  const rootElement = this._rootElement, rect = table.getCellRangeRelativeRect({
114
114
  col: col,
115
115
  row: row
116
- }), {width: containerWidth, height: containerHeight} = table.internalProps.element.getBoundingClientRect(), {width: width} = rect;
116
+ }), {x: parentX, y: parentY} = table.internalProps.tooltip.parentElement.getBoundingClientRect(), {width: containerWidth, height: containerHeight, x: x, y: y} = table.internalProps.element.getBoundingClientRect(), {width: width} = rect;
117
117
  let tooltipY, tooltipX;
118
118
  const maxWidth = Math.min(.8 * containerWidth, 4 * width);
119
119
  rootElement.style.maxWidth = `${maxWidth}px`;
@@ -144,8 +144,8 @@ class BubbleTooltipElement {
144
144
  }
145
145
  return confine && (tooltipX < 0 ? tooltipX = 0 : tooltipX + rootElement.offsetWidth > containerWidth && (tooltipX = containerWidth - rootElement.offsetWidth)),
146
146
  {
147
- x: tooltipX,
148
- y: tooltipY
147
+ x: tooltipX + x - parentX,
148
+ y: tooltipY + y - parentY
149
149
  };
150
150
  }
151
151
  removeStyleFromTriangle() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElement.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAE3D,gDAA8C;AAC9C,4CAAmD;AACnD,2EAA0D;AAC1D,8CAA8D;AAG9D,IAAA,uCAAW,GAAE,CAAC;AACd,MAAM,aAAa,GAAG,gCAAgC,CAAC;AACvD,MAAM,aAAa,GAAG,GAAG,aAAa,WAAW,CAAC;AAClD,MAAM,cAAc,GAAG,GAAG,aAAa,YAAY,CAAC;AACpD,MAAM,YAAY,GAAG,GAAG,aAAa,UAAU,CAAC;AAChD,MAAM,WAAW,GAAG,GAAG,aAAa,SAAS,CAAC;AAE9C,MAAa,oBAAoB;IAO/B;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,2BAAY,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,IAAA,mBAAa,EAAC,KAAK,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9F,MAAM,cAAc,GAAG,IAAA,mBAAa,EAAC,KAAK,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;QAC7D,MAAM,QAAQ,GAAG,IAAA,mBAAa,EAAC,MAAM,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzD,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAClC,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,eAAe,GAAgB,WAAW,CAAC,aAAa,CAAC,IAAI,aAAa,EAAE,CAAC,IAAI,SAAS,CAAC;QAChG,IAAI,CAAC,gBAAgB,GAAgB,WAAW,CAAC,aAAa,CAAC,IAAI,cAAc,EAAE,CAAC,IAAI,SAAS,CAAC;QAElG,WAAW,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE;YAC7C,IAAI,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,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QACxC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC;QAC5C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,CACL,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,QAAmC,EACnC,iBAGC,EACD,OAAiB;QAEjB,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACxG,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,IAAI,CAAC;QAC/C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,IAAI,CAAC;IAChD,CAAC;CACF;AAvXD,oDAuXC","file":"BubbleTooltipElement.js","sourcesContent":["import { EventHandler } from '../../../event/EventHandler';\nimport type { RectProps } from '../../../ts-types';\nimport { Placement } from '../../../ts-types';\nimport { createElement } from '../../../tools/dom';\nimport { importStyle } from './BubbleTooltipElementStyle';\nimport { isDivSelected, isMobile } from '../../../tools/util';\nimport type { TooltipOptions } from '../../../ts-types/tooltip';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimportStyle();\nconst TOOLTIP_CLASS = 'vtable__bubble-tooltip-element';\nconst CONTENT_CLASS = `${TOOLTIP_CLASS}__content`;\nconst TRIANGLE_CLASS = `${TOOLTIP_CLASS}__triangle`;\nconst HIDDEN_CLASS = `${TOOLTIP_CLASS}--hidden`;\nconst SHOWN_CLASS = `${TOOLTIP_CLASS}--shown`;\n\nexport class BubbleTooltipElement {\n private _handler: EventHandler;\n private _rootElement?: HTMLElement;\n private _messageElement?: HTMLElement;\n private _triangleElement?: HTMLElement;\n private _disappearDelay?: number; // 提示框延迟多久消失\n private _disappearDelayId?: any;\n constructor() {\n this._handler = new EventHandler();\n const rootElement = (this._rootElement = createElement('div', [TOOLTIP_CLASS, HIDDEN_CLASS]));\n const messageElement = createElement('div', [CONTENT_CLASS]);\n const triangle = createElement('span', [TRIANGLE_CLASS]);\n rootElement.appendChild(triangle);\n rootElement.appendChild(messageElement);\n this._messageElement = <HTMLElement>rootElement.querySelector(`.${CONTENT_CLASS}`) || undefined;\n this._triangleElement = <HTMLElement>rootElement.querySelector(`.${TRIANGLE_CLASS}`) || undefined;\n\n rootElement.addEventListener('mousemove', () => {\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n });\n rootElement.addEventListener('mouseleave', () => {\n this._disappearDelay = undefined;\n this.unbindFromCell();\n });\n\n messageElement.addEventListener('wheel', e => {\n e.stopPropagation();\n });\n messageElement.addEventListener('copy', e => {\n const isSelected = isDivSelected(messageElement as HTMLDivElement); // 判断tooltip弹框内容是否有选中\n if (isSelected) {\n e.stopPropagation();\n }\n });\n }\n bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n tooltipInstanceInfo: TooltipOptions,\n confine: boolean\n ): boolean {\n this._disappearDelay = tooltipInstanceInfo?.disappearDelay;\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n const rootElement = this._rootElement;\n const messageElement = this._messageElement;\n const triangle = this._triangleElement;\n\n rootElement?.classList.remove(SHOWN_CLASS);\n rootElement?.classList.add(HIDDEN_CLASS);\n if (this._canBindToCell(table, col, row)) {\n //设置style及类名\n messageElement.setAttribute('style', '');\n triangle.setAttribute('style', '');\n tooltipInstanceInfo?.className && rootElement.classList.add(tooltipInstanceInfo.className);\n tooltipInstanceInfo?.style?.bgColor &&\n (messageElement.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n tooltipInstanceInfo?.style?.bgColor && (triangle.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n triangle.style.display = tooltipInstanceInfo?.style?.arrowMark === true ? 'block' : 'none';\n tooltipInstanceInfo?.style?.fontSize &&\n (messageElement.style.fontSize = (tooltipInstanceInfo?.style?.fontSize ?? 12) + 'px');\n tooltipInstanceInfo?.style?.fontFamily &&\n (messageElement.style.fontFamily = tooltipInstanceInfo?.style?.fontFamily);\n tooltipInstanceInfo?.style?.color && (messageElement.style.color = tooltipInstanceInfo?.style?.color);\n tooltipInstanceInfo?.style?.padding &&\n (messageElement.style.padding = `${tooltipInstanceInfo?.style?.padding.join('px ')}px`);\n tooltipInstanceInfo?.style?.maxHeight &&\n (messageElement.style.maxHeight = `${tooltipInstanceInfo?.style?.maxHeight}px`);\n tooltipInstanceInfo?.style?.maxWidth &&\n (messageElement.style.maxWidth = `${tooltipInstanceInfo?.style?.maxWidth}px`);\n messageElement && (messageElement.textContent = tooltipInstanceInfo?.content);\n const binded = this._bindToCell(\n table,\n col,\n row,\n tooltipInstanceInfo?.position,\n tooltipInstanceInfo?.referencePosition,\n confine,\n tooltipInstanceInfo?.style?.arrowMark\n );\n if (binded) {\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n return true;\n }\n } else {\n this.unbindFromCell();\n }\n return false;\n }\n release(): void {\n this.unbindFromCell();\n\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.parentElement.removeChild(rootElement);\n }\n\n this._handler?.release?.();\n delete this._rootElement;\n delete this._messageElement;\n }\n move(table: BaseTableAPI, col: number, row: number, tooltipOptions?: TooltipOptions, confine?: boolean): void {\n const rootElement = this._rootElement;\n if (this._canBindToCell(table, col, row)) {\n this._bindToCell(table, col, row, tooltipOptions?.position, tooltipOptions?.referencePosition, confine);\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n } else {\n this.unbindFromCell();\n }\n }\n unbindFromCell(): void {\n if (this._disappearDelay) {\n this._disappearDelayId = setTimeout(() => {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }, this._disappearDelay ?? 0);\n } else {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }\n }\n _canBindToCell(table: BaseTableAPI, col: number, row: number): boolean {\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const { bottom, left, right, top } = rect;\n // const { frozenRowCount, frozenColCount } = table;\n // if (row >= frozenRowCount && frozenRowCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col, row: frozenRowCount - 1 });\n // if (bottom < frozenRect.bottom) {\n // // 范围外\n // return false;\n // }\n // } else if (bottom < 0) {\n // // 范围外\n // return false;\n // }\n // if (col >= frozenColCount && frozenColCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col: frozenColCount - 1, row });\n // if (right < frozenRect.right) {\n // //整个是被冻结列盖住的 不需要提示toolTip\n // return false;\n // }\n // } else if (left < 0) {\n // return false;\n // }\n\n if (table.isFrozenCell(col, row)) {\n return true;\n } else if (\n bottom < table.getFrozenRowsHeight() ||\n right < table.getFrozenColsWidth() ||\n left > table.tableNoFrameWidth - table.getRightFrozenColsWidth() ||\n top > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight()\n ) {\n // 范围外\n return false;\n }\n const { offsetHeight, offsetWidth } = element;\n if (top > offsetHeight) {\n return false;\n }\n if (left > offsetWidth) {\n return false;\n }\n return true;\n }\n _bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ): boolean {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const containerWidth = table.internalProps.element.offsetWidth;\n const { width } = rect;\n if (rootElement) {\n if (rootElement.parentElement !== element) {\n element.appendChild(rootElement);\n }\n rootElement.style.left = `0px`;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n if (position || referencePosition) {\n const tooltipPosition = this.getComputedPosition(\n table,\n col,\n row,\n position,\n referencePosition,\n confine,\n arrowMark\n );\n tooltipX = tooltipPosition.x;\n tooltipY = tooltipPosition.y;\n } else {\n return false;\n }\n\n rootElement.style.left = `${tooltipX}px`;\n rootElement.style.top = `${tooltipY}px`;\n // rootElement.style.width=rootElementWidth+'px';\n if (isMobile()) {\n rootElement.style.fontSize = '11px';\n }\n\n // 判断当前tooltip范围是否与tooltip重合\n const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.stateManager.menu.bounds;\n const tooltipLeft = tooltipX;\n const tooltipRight = tooltipLeft + rootElementWidth;\n const tooltipTop = tooltipY;\n const tooltipBottom = tooltipLeft + rootElementHeight;\n if (\n table.stateManager.menu.isShow &&\n menuLeft < tooltipRight &&\n menuRight > tooltipLeft &&\n menuBottom > tooltipTop &&\n menuTop < tooltipBottom\n ) {\n return false;\n }\n return true;\n }\n return false;\n }\n private getComputedPosition(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ) {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const { width: containerWidth, height: containerHeight } = table.internalProps.element.getBoundingClientRect();\n const { width } = rect;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n // this._triangleElement.setAttribute('style', '');\n const triangleHeight = arrowMark ? 6 : 0;\n if (position) {\n tooltipX = position.x;\n tooltipY = position.y + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n } else if (referencePosition) {\n let placement = referencePosition.placement ?? Placement.bottom;\n const referenceXMiddle = referencePosition.rect.left + referencePosition.rect.width / 2;\n const referenceYMiddle = referencePosition.rect.top + referencePosition.rect.height / 2;\n const referenceTop = referencePosition.rect.top;\n const referenceBottom = referencePosition.rect.bottom;\n const referenceLeft = referencePosition.rect.left;\n const referenceRight = referencePosition.rect.right;\n\n let callCount = 0;\n /** 根据placement计算弹出框的位置 躲避策略[dom的这块先去除 dom可以超出显示]:根据顺时针方向依次检测placement */\n const adjustPosition = () => {\n callCount++;\n if (callCount >= 4) {\n return;\n }\n this.removeStyleFromTriangle();\n if (placement === Placement.top) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceTop - rootElementHeight - triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.bottom = '-5px';\n\n // 判断如果超出左右范围则靠边显示\n if (confine && tooltipY < 0) {\n placement = Placement.right;\n adjustPosition();\n }\n } else if (placement === Placement.bottom) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceBottom + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n if (confine && tooltipY + rootElementHeight > containerHeight) {\n placement = Placement.left;\n adjustPosition();\n }\n } else if (placement === Placement.left) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceLeft - rootElementWidth - triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.right = '-5px';\n if (confine && tooltipX < 0) {\n placement = Placement.top;\n adjustPosition();\n }\n } else if (placement === Placement.right) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceRight + triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.left = '-5px';\n if (confine && tooltipX + rootElementWidth > containerWidth) {\n placement = Placement.bottom;\n adjustPosition();\n }\n }\n };\n adjustPosition();\n }\n // 判断如果超出左右范围则靠边显示\n if (confine) {\n if (tooltipX < 0) {\n tooltipX = 0;\n } else if (tooltipX + rootElement.offsetWidth > containerWidth) {\n tooltipX = containerWidth - rootElement.offsetWidth;\n }\n }\n return {\n x: tooltipX,\n y: tooltipY\n };\n }\n private removeStyleFromTriangle() {\n this._triangleElement.style.left = '';\n this._triangleElement.style.right = '';\n this._triangleElement.style.top = '';\n this._triangleElement.style.bottom = '';\n this._triangleElement.style.marginLeft = '';\n this._triangleElement.style.marginTop = '';\n }\n _locate(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: {\n rect: RectProps;\n placement?: Placement;\n },\n confine?: boolean\n ) {\n const tooltipPosition = this.getComputedPosition(table, col, row, position, referencePosition, confine);\n const tooltipX = tooltipPosition.x;\n const tooltipY = tooltipPosition.y;\n this._rootElement.style.left = `${tooltipX}px`;\n this._rootElement.style.top = `${tooltipY}px`;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElement.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAE3D,gDAA8C;AAC9C,4CAAmD;AACnD,2EAA0D;AAC1D,8CAA8D;AAG9D,IAAA,uCAAW,GAAE,CAAC;AACd,MAAM,aAAa,GAAG,gCAAgC,CAAC;AACvD,MAAM,aAAa,GAAG,GAAG,aAAa,WAAW,CAAC;AAClD,MAAM,cAAc,GAAG,GAAG,aAAa,YAA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KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,CACL,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,QAAmC,EACnC,iBAGC,EACD,OAAiB;QAEjB,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACxG,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,IAAI,CAAC;QAC/C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,IAAI,CAAC;IAChD,CAAC;CACF;AA9XD,oDA8XC","file":"BubbleTooltipElement.js","sourcesContent":["import { EventHandler } from '../../../event/EventHandler';\nimport type { RectProps } from '../../../ts-types';\nimport { Placement } from '../../../ts-types';\nimport { createElement } from '../../../tools/dom';\nimport { importStyle } from './BubbleTooltipElementStyle';\nimport { isDivSelected, isMobile } from '../../../tools/util';\nimport type { TooltipOptions } from '../../../ts-types/tooltip';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimportStyle();\nconst TOOLTIP_CLASS = 'vtable__bubble-tooltip-element';\nconst CONTENT_CLASS = `${TOOLTIP_CLASS}__content`;\nconst TRIANGLE_CLASS = `${TOOLTIP_CLASS}__triangle`;\nconst HIDDEN_CLASS = `${TOOLTIP_CLASS}--hidden`;\nconst SHOWN_CLASS = `${TOOLTIP_CLASS}--shown`;\n\nexport class BubbleTooltipElement {\n private _handler: EventHandler;\n private _rootElement?: HTMLElement;\n private _messageElement?: HTMLElement;\n private _triangleElement?: HTMLElement;\n private _disappearDelay?: number; // 提示框延迟多久消失\n private _disappearDelayId?: any;\n constructor() {\n this._handler = new EventHandler();\n const rootElement = (this._rootElement = createElement('div', [TOOLTIP_CLASS, HIDDEN_CLASS]));\n const messageElement = createElement('div', [CONTENT_CLASS]);\n const triangle = createElement('span', [TRIANGLE_CLASS]);\n rootElement.appendChild(triangle);\n rootElement.appendChild(messageElement);\n this._messageElement = <HTMLElement>rootElement.querySelector(`.${CONTENT_CLASS}`) || undefined;\n this._triangleElement = <HTMLElement>rootElement.querySelector(`.${TRIANGLE_CLASS}`) || undefined;\n\n rootElement.addEventListener('mousemove', () => {\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n });\n rootElement.addEventListener('mouseleave', () => {\n this._disappearDelay = undefined;\n this.unbindFromCell();\n });\n\n messageElement.addEventListener('wheel', e => {\n e.stopPropagation();\n });\n messageElement.addEventListener('copy', e => {\n const isSelected = isDivSelected(messageElement as HTMLDivElement); // 判断tooltip弹框内容是否有选中\n if (isSelected) {\n e.stopPropagation();\n }\n });\n }\n bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n tooltipInstanceInfo: TooltipOptions,\n confine: boolean\n ): boolean {\n this._disappearDelay = tooltipInstanceInfo?.disappearDelay;\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n const rootElement = this._rootElement;\n const messageElement = this._messageElement;\n const triangle = this._triangleElement;\n\n rootElement?.classList.remove(SHOWN_CLASS);\n rootElement?.classList.add(HIDDEN_CLASS);\n if (this._canBindToCell(table, col, row)) {\n //设置style及类名\n messageElement.setAttribute('style', '');\n triangle.setAttribute('style', '');\n tooltipInstanceInfo?.className && rootElement.classList.add(tooltipInstanceInfo.className);\n tooltipInstanceInfo?.style?.bgColor &&\n (messageElement.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n tooltipInstanceInfo?.style?.bgColor && (triangle.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n triangle.style.display = tooltipInstanceInfo?.style?.arrowMark === true ? 'block' : 'none';\n tooltipInstanceInfo?.style?.fontSize &&\n (messageElement.style.fontSize = (tooltipInstanceInfo?.style?.fontSize ?? 12) + 'px');\n tooltipInstanceInfo?.style?.fontFamily &&\n (messageElement.style.fontFamily = tooltipInstanceInfo?.style?.fontFamily);\n tooltipInstanceInfo?.style?.color && (messageElement.style.color = tooltipInstanceInfo?.style?.color);\n tooltipInstanceInfo?.style?.padding &&\n (messageElement.style.padding = `${tooltipInstanceInfo?.style?.padding.join('px ')}px`);\n tooltipInstanceInfo?.style?.maxHeight &&\n (messageElement.style.maxHeight = `${tooltipInstanceInfo?.style?.maxHeight}px`);\n tooltipInstanceInfo?.style?.maxWidth &&\n (messageElement.style.maxWidth = `${tooltipInstanceInfo?.style?.maxWidth}px`);\n messageElement && (messageElement.textContent = tooltipInstanceInfo?.content);\n const binded = this._bindToCell(\n table,\n col,\n row,\n tooltipInstanceInfo?.position,\n tooltipInstanceInfo?.referencePosition,\n confine,\n tooltipInstanceInfo?.style?.arrowMark\n );\n if (binded) {\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n return true;\n }\n } else {\n this.unbindFromCell();\n }\n return false;\n }\n release(): void {\n this.unbindFromCell();\n\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.parentElement.removeChild(rootElement);\n }\n\n this._handler?.release?.();\n delete this._rootElement;\n delete this._messageElement;\n }\n move(table: BaseTableAPI, col: number, row: number, tooltipOptions?: TooltipOptions, confine?: boolean): void {\n const rootElement = this._rootElement;\n if (this._canBindToCell(table, col, row)) {\n this._bindToCell(table, col, row, tooltipOptions?.position, tooltipOptions?.referencePosition, confine);\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n } else {\n this.unbindFromCell();\n }\n }\n unbindFromCell(): void {\n if (this._disappearDelay) {\n this._disappearDelayId = setTimeout(() => {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }, this._disappearDelay ?? 0);\n } else {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }\n }\n _canBindToCell(table: BaseTableAPI, col: number, row: number): boolean {\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const { bottom, left, right, top } = rect;\n // const { frozenRowCount, frozenColCount } = table;\n // if (row >= frozenRowCount && frozenRowCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col, row: frozenRowCount - 1 });\n // if (bottom < frozenRect.bottom) {\n // // 范围外\n // return false;\n // }\n // } else if (bottom < 0) {\n // // 范围外\n // return false;\n // }\n // if (col >= frozenColCount && frozenColCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col: frozenColCount - 1, row });\n // if (right < frozenRect.right) {\n // //整个是被冻结列盖住的 不需要提示toolTip\n // return false;\n // }\n // } else if (left < 0) {\n // return false;\n // }\n\n if (table.isFrozenCell(col, row)) {\n return true;\n } else if (\n bottom < table.getFrozenRowsHeight() ||\n right < table.getFrozenColsWidth() ||\n left > table.tableNoFrameWidth - table.getRightFrozenColsWidth() ||\n top > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight()\n ) {\n // 范围外\n return false;\n }\n const { offsetHeight, offsetWidth } = element;\n if (top > offsetHeight) {\n return false;\n }\n if (left > offsetWidth) {\n return false;\n }\n return true;\n }\n _bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ): boolean {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.internalProps.tooltip.parentElement;\n const containerWidth = table.internalProps.element.offsetWidth;\n const { width } = rect;\n if (rootElement) {\n if (rootElement.parentElement !== element) {\n element.appendChild(rootElement);\n }\n rootElement.style.left = `0px`;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n if (position || referencePosition) {\n const tooltipPosition = this.getComputedPosition(\n table,\n col,\n row,\n position,\n referencePosition,\n confine,\n arrowMark\n );\n tooltipX = tooltipPosition.x;\n tooltipY = tooltipPosition.y;\n } else {\n return false;\n }\n\n rootElement.style.left = `${tooltipX}px`;\n rootElement.style.top = `${tooltipY}px`;\n // rootElement.style.width=rootElementWidth+'px';\n if (isMobile()) {\n rootElement.style.fontSize = '11px';\n }\n\n // 判断当前tooltip范围是否与tooltip重合\n const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.stateManager.menu.bounds;\n const tooltipLeft = tooltipX;\n const tooltipRight = tooltipLeft + rootElementWidth;\n const tooltipTop = tooltipY;\n const tooltipBottom = tooltipLeft + rootElementHeight;\n if (\n table.stateManager.menu.isShow &&\n menuLeft < tooltipRight &&\n menuRight > tooltipLeft &&\n menuBottom > tooltipTop &&\n menuTop < tooltipBottom\n ) {\n return false;\n }\n return true;\n }\n return false;\n }\n private getComputedPosition(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ) {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const { x: parentX, y: parentY } = table.internalProps.tooltip.parentElement.getBoundingClientRect();\n const {\n width: containerWidth,\n height: containerHeight,\n x,\n y\n } = table.internalProps.element.getBoundingClientRect();\n // const { width: containerWidth, height: containerHeight } = document.body.getBoundingClientRect();\n const { width } = rect;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n // this._triangleElement.setAttribute('style', '');\n const triangleHeight = arrowMark ? 6 : 0;\n if (position) {\n tooltipX = position.x;\n tooltipY = position.y + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n } else if (referencePosition) {\n let placement = referencePosition.placement ?? Placement.bottom;\n const referenceXMiddle = referencePosition.rect.left + referencePosition.rect.width / 2;\n const referenceYMiddle = referencePosition.rect.top + referencePosition.rect.height / 2;\n const referenceTop = referencePosition.rect.top;\n const referenceBottom = referencePosition.rect.bottom;\n const referenceLeft = referencePosition.rect.left;\n const referenceRight = referencePosition.rect.right;\n\n let callCount = 0;\n /** 根据placement计算弹出框的位置 躲避策略[dom的这块先去除 dom可以超出显示]:根据顺时针方向依次检测placement */\n const adjustPosition = () => {\n callCount++;\n if (callCount >= 4) {\n return;\n }\n this.removeStyleFromTriangle();\n if (placement === Placement.top) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceTop - rootElementHeight - triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.bottom = '-5px';\n\n // 判断如果超出左右范围则靠边显示\n if (confine && tooltipY < 0) {\n placement = Placement.right;\n adjustPosition();\n }\n } else if (placement === Placement.bottom) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceBottom + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n if (confine && tooltipY + rootElementHeight > containerHeight) {\n placement = Placement.left;\n adjustPosition();\n }\n } else if (placement === Placement.left) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceLeft - rootElementWidth - triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.right = '-5px';\n if (confine && tooltipX < 0) {\n placement = Placement.top;\n adjustPosition();\n }\n } else if (placement === Placement.right) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceRight + triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.left = '-5px';\n if (confine && tooltipX + rootElementWidth > containerWidth) {\n placement = Placement.bottom;\n adjustPosition();\n }\n }\n };\n adjustPosition();\n }\n // 判断如果超出左右范围则靠边显示\n if (confine) {\n if (tooltipX < 0) {\n tooltipX = 0;\n } else if (tooltipX + rootElement.offsetWidth > containerWidth) {\n tooltipX = containerWidth - rootElement.offsetWidth;\n }\n }\n return {\n x: tooltipX + x - parentX,\n y: tooltipY + y - parentY\n };\n }\n private removeStyleFromTriangle() {\n this._triangleElement.style.left = '';\n this._triangleElement.style.right = '';\n this._triangleElement.style.top = '';\n this._triangleElement.style.bottom = '';\n this._triangleElement.style.marginLeft = '';\n this._triangleElement.style.marginTop = '';\n }\n _locate(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: {\n rect: RectProps;\n placement?: Placement;\n },\n confine?: boolean\n ) {\n const tooltipPosition = this.getComputedPosition(table, col, row, position, referencePosition, confine);\n const tooltipX = tooltipPosition.x;\n const tooltipY = tooltipPosition.y;\n this._rootElement.style.left = `${tooltipX}px`;\n this._rootElement.style.top = `${tooltipY}px`;\n }\n}\n"]}
@@ -43,7 +43,7 @@ class BaseTable extends EventTarget_1.EventTarget {
43
43
  }
44
44
  constructor(container, options = {}) {
45
45
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
46
- if (super(), this.showFrozenIcon = !0, this.version = "1.6.3-alpha.1", this.id = `VTable${Date.now()}`,
46
+ if (super(), this.showFrozenIcon = !0, this.version = "1.6.3-alpha.2", this.id = `VTable${Date.now()}`,
47
47
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
48
48
  !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49
49
  const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
@@ -119,6 +119,7 @@ class BaseTable extends EventTarget_1.EventTarget {
119
119
  });
120
120
  }
121
121
  if (internalProps.tooltip = Object.assign({
122
+ parentElement: this.getElement(),
122
123
  renderMode: "html",
123
124
  isShowOverflowTextTooltip: !1,
124
125
  confine: !0
@@ -837,6 +838,7 @@ class BaseTable extends EventTarget_1.EventTarget {
837
838
  });
838
839
  }
839
840
  if (internalProps.tooltip = Object.assign({
841
+ parentElement: this.getElement(),
840
842
  renderMode: "html",
841
843
  isShowOverflowTextTooltip: !1,
842
844
  confine: !0