@visactor/vtable 1.4.0-alpha.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable.js +38 -26
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -3
- package/cjs/PivotChart.js +5 -15
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -1
- package/cjs/PivotTable.js +40 -18
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/axis/axis.js +2 -3
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/empty-tip/empty-tip.js +2 -2
- package/cjs/components/empty-tip/empty-tip.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -2
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/react/react-custom-layout.d.ts +21 -0
- package/cjs/components/react/react-custom-layout.js +48 -0
- package/cjs/components/react/react-custom-layout.js.map +1 -0
- package/cjs/components/tooltip/TooltipHandler.js +1 -3
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +7 -3
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +10 -28
- package/cjs/core/BaseTable.js +88 -75
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.d.ts +0 -1
- package/cjs/core/FouseInput.js +2 -5
- package/cjs/core/FouseInput.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/data/DataSource.d.ts +6 -1
- package/cjs/data/DataSource.js +12 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +17 -2
- package/cjs/dataset/dataset.js +195 -79
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +43 -3
- package/cjs/dataset/statistics-helper.js +61 -26
- package/cjs/dataset/statistics-helper.js.map +1 -1
- package/cjs/event/event.js +1 -2
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +4 -3
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +7 -5
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/util.js +2 -2
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +13 -4
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -0
- package/cjs/layout/pivot-header-layout.js +66 -39
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/row-height-map.js +1 -0
- package/cjs/layout/row-height-map.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +6 -4
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +0 -1
- package/cjs/scenegraph/graphic/chart.js +20 -34
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +6 -2
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +3 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js +10 -10
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -14
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +2 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +7 -4
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +12 -4
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +3 -0
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -1
- package/cjs/scenegraph/scenegraph.js +18 -15
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/cell-move/index.js +1 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/sort/index.js +2 -2
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/themes/theme.js +6 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +20 -40
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/customLayout.d.ts +1 -1
- package/cjs/ts-types/customLayout.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +2 -0
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +9 -1
- package/cjs/ts-types/new-data-set.js +1 -1
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/pivot-table/corner.d.ts +12 -0
- package/cjs/ts-types/pivot-table/corner.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +12 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/ts-types/tooltip.d.ts +2 -0
- package/cjs/ts-types/tooltip.js.map +1 -1
- package/cjs/vrender.d.ts +4 -0
- package/cjs/vrender.js +39 -11
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +25679 -9801
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +34 -23
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -3
- package/es/PivotChart.js +8 -17
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -1
- package/es/PivotTable.js +41 -19
- package/es/PivotTable.js.map +1 -1
- package/es/components/axis/axis.js +1 -3
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/empty-tip/empty-tip.js +2 -2
- package/es/components/empty-tip/empty-tip.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -2
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/react/react-custom-layout.d.ts +21 -0
- package/es/components/react/react-custom-layout.js +38 -0
- package/es/components/react/react-custom-layout.js.map +1 -0
- package/es/components/tooltip/TooltipHandler.js +1 -3
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js +7 -3
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/es/core/BaseTable.d.ts +10 -28
- package/es/core/BaseTable.js +90 -74
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.d.ts +0 -1
- package/es/core/FouseInput.js +2 -5
- package/es/core/FouseInput.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/data/DataSource.d.ts +6 -1
- package/es/data/DataSource.js +12 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.d.ts +17 -2
- package/es/dataset/dataset.js +195 -80
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +43 -3
- package/es/dataset/statistics-helper.js +55 -23
- package/es/dataset/statistics-helper.js.map +1 -1
- package/es/event/event.js +1 -2
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +4 -3
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +7 -5
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/util.js +2 -2
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +5 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -0
- package/es/layout/pivot-header-layout.js +65 -37
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/row-height-map.js +1 -0
- package/es/layout/row-height-map.js.map +1 -1
- package/es/scenegraph/component/custom.js +7 -3
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +1 -4
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +0 -1
- package/es/scenegraph/graphic/chart.js +21 -33
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +6 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +3 -2
- package/es/scenegraph/group-creater/progress/proxy.js +10 -10
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -13
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +3 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +8 -5
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +12 -4
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +3 -0
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
- package/es/scenegraph/refresh-node/update-chart.js +0 -6
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -1
- package/es/scenegraph/scenegraph.js +18 -15
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/cell-move/index.js +1 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/sort/index.js +2 -2
- package/es/state/sort/index.js.map +1 -1
- package/es/themes/theme.js +6 -0
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/base-table.d.ts +20 -40
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/customLayout.d.ts +1 -1
- package/es/ts-types/customLayout.js.map +1 -1
- package/es/ts-types/icon.d.ts +2 -0
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +9 -1
- package/es/ts-types/new-data-set.js +1 -1
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/pivot-table/corner.d.ts +12 -0
- package/es/ts-types/pivot-table/corner.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +12 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/ts-types/tooltip.d.ts +2 -0
- package/es/ts-types/tooltip.js.map +1 -1
- package/es/vrender.d.ts +4 -0
- package/es/vrender.js +9 -3
- package/es/vrender.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElement.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAE3D,gDAA8C;AAC9C,4CAAmD;AACnD,2EAA0D;AAC1D,8CAA+C;AAG/C,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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AE,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;AAzWD,oDAyWC","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 { 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('span', [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 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 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,8CAA+C;AAG/C,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,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IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QACtC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC;QACrC,IAAI,CAAC,gBAAgB,CAAC,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;AAjXD,oDAiXC","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 { 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 }\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"]}
|
|
@@ -9,7 +9,7 @@ const env_1 = require("../../../tools/env");
|
|
|
9
9
|
function importStyle() {
|
|
10
10
|
if ("node" === env_1.Env.mode) return;
|
|
11
11
|
const styleElement = document.createElement("style");
|
|
12
|
-
styleElement.id = "vtable-tooltip-styleSheet", styleElement.textContent = "\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow:
|
|
12
|
+
styleElement.id = "vtable-tooltip-styleSheet", styleElement.textContent = "\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",
|
|
13
13
|
document.head.appendChild(styleElement);
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElementStyle.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAEzC,SAAgB,WAAW;IACzB,IAAI,SAAG,CAAC,IAAI,KAAK,MAAM,EAAE;QACvB,OAAO;KACR;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,GAAG,2BAA2B,CAAC;IAC9C,YAAY,CAAC,WAAW,GAAG
|
|
1
|
+
{"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElementStyle.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAEzC,SAAgB,WAAW;IACzB,IAAI,SAAG,CAAC,IAAI,KAAK,MAAM,EAAE;QACvB,OAAO;KACR;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,GAAG,2BAA2B,CAAC;IAC9C,YAAY,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoF5B,CAAC;IAEA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC;AA7FD,kCA6FC","file":"BubbleTooltipElementStyle.js","sourcesContent":["import { Env } from '../../../tools/env';\n\nexport function importStyle() {\n if (Env.mode === 'node') {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.id = 'vtable-tooltip-styleSheet';\n styleElement.textContent = `\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n`;\n\n document.head.appendChild(styleElement);\n}\n"]}
|
package/cjs/core/BaseTable.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CellAddress, type CellRange, type TableEventHandlersEventArgumentMap, type TableEventHandlersReturnMap, type TableKeyboardOptions, type DropDownMenuHighlightInfo, type MenuListItem, type WidthModeDef, type ICustomRender, type ICellHeaderPaths, type HeaderData, type FullExtendStyle, type FieldDef, type ColumnTypeOption, type SortState, type IPagination, type ICustomLayout, type CellInfo, type CellStyle, type DropDownMenuOptions, type FieldData, type MaybePromiseOrUndefined, type MousePointerCellEvent, type DropDownMenuEventInfo, type HierarchyState, type FieldKeyDef, type CellLocation, type LayoutObjectId, type HeightModeDef, type ITableThemeDefine } from '../ts-types';
|
|
2
|
-
import type { AnyFunction, CellAddressWithBound, ColumnIconOption, ColumnSeriesNumber, IRowSeriesNumber, ColumnStyleOption, TableEventOptions, WidthAdaptiveModeDef, HeightAdaptiveModeDef } from '../ts-types';
|
|
2
|
+
import type { AnyFunction, CellAddressWithBound, ColumnIconOption, ColumnSeriesNumber, IRowSeriesNumber, ColumnStyleOption, TableEventOptions, WidthAdaptiveModeDef, HeightAdaptiveModeDef, ColumnInfo, RowInfo } from '../ts-types';
|
|
3
3
|
import { TABLE_EVENT_TYPE } from './TABLE_EVENT_TYPE';
|
|
4
4
|
import { EventTarget } from '../event/EventTarget';
|
|
5
5
|
import { NumberMap } from '../tools/NumberMap';
|
|
@@ -9,7 +9,6 @@ import { Scenegraph } from '../scenegraph/scenegraph';
|
|
|
9
9
|
import { StateManager } from '../state/state';
|
|
10
10
|
import { EventManager } from '../event/event';
|
|
11
11
|
import type { CachedDataSource, DataSource } from '../data';
|
|
12
|
-
import type { IBoundsLike } from '@visactor/vutils';
|
|
13
12
|
import { AABBBounds, type ITextSize } from '@visactor/vutils';
|
|
14
13
|
import type { ColumnData, ColumnDefine, ColumnsDefine, IndicatorData, SeriesNumberColumnData } from '../ts-types/list-table/layout-map/api';
|
|
15
14
|
import type { TooltipOptions } from '../ts-types/tooltip';
|
|
@@ -18,6 +17,7 @@ import { DataSet } from '@visactor/vdataset';
|
|
|
18
17
|
import { NumberRangeMap } from '../layout/row-height-map';
|
|
19
18
|
import { CustomCellStylePlugin } from '../plugins/custom-cell-style';
|
|
20
19
|
import type { ITextGraphicAttribute } from './../vrender';
|
|
20
|
+
import { ReactCustomLayout } from '../components/react/react-custom-layout';
|
|
21
21
|
import type { ISortedMapItem } from '../data/DataSource';
|
|
22
22
|
export declare abstract class BaseTable extends EventTarget implements BaseTableAPI {
|
|
23
23
|
internalProps: IBaseTableProtected;
|
|
@@ -63,6 +63,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
63
63
|
}[]>;
|
|
64
64
|
customCellStylePlugin: CustomCellStylePlugin;
|
|
65
65
|
columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';
|
|
66
|
+
reactCustomLayout?: ReactCustomLayout;
|
|
66
67
|
_hasAutoImageColumn?: boolean;
|
|
67
68
|
constructor(container: HTMLElement, options?: BaseTableConstructorOptions);
|
|
68
69
|
throttleInvalidate: (this: any, ...args: any[]) => void;
|
|
@@ -136,8 +137,6 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
136
137
|
_adjustColWidth(col: number, orgWidth: number): number;
|
|
137
138
|
setPixelRatio(pixelRatio: number): void;
|
|
138
139
|
_updateSize(): void;
|
|
139
|
-
updateViewBox(newViewBox: IBoundsLike): void;
|
|
140
|
-
setViewBoxTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
141
140
|
get rowHierarchyType(): 'grid' | 'tree';
|
|
142
141
|
getColsWidth(startCol: number, endCol: number): number;
|
|
143
142
|
getRowHeight(row: number): number;
|
|
@@ -239,30 +238,10 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
239
238
|
inTable: boolean;
|
|
240
239
|
};
|
|
241
240
|
getTheme(): TableTheme;
|
|
242
|
-
getTargetColAt(absoluteX: number):
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
width: number;
|
|
247
|
-
} | null;
|
|
248
|
-
getTargetRowAt(absoluteY: number): {
|
|
249
|
-
row: number;
|
|
250
|
-
top: number;
|
|
251
|
-
bottom: number;
|
|
252
|
-
height: number;
|
|
253
|
-
} | null;
|
|
254
|
-
getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean): {
|
|
255
|
-
col: number;
|
|
256
|
-
left: number;
|
|
257
|
-
right: number;
|
|
258
|
-
width: number;
|
|
259
|
-
} | null;
|
|
260
|
-
getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean): {
|
|
261
|
-
row: number;
|
|
262
|
-
top: number;
|
|
263
|
-
bottom: number;
|
|
264
|
-
height: number;
|
|
265
|
-
} | null;
|
|
241
|
+
getTargetColAt(absoluteX: number): ColumnInfo | null;
|
|
242
|
+
getTargetRowAt(absoluteY: number): RowInfo | null;
|
|
243
|
+
getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean): ColumnInfo | null;
|
|
244
|
+
getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean): RowInfo | null;
|
|
266
245
|
private computeTargetRowByY;
|
|
267
246
|
private computeTargetColByX;
|
|
268
247
|
clearSelected(): void;
|
|
@@ -419,4 +398,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
419
398
|
get leftRowSeriesNumberCount(): number;
|
|
420
399
|
setMinMaxLimitWidth(setWidth?: boolean): void;
|
|
421
400
|
setSortedIndexMap(field: FieldDef, filedMap: ISortedMapItem): void;
|
|
401
|
+
checkReactCustomLayout(): void;
|
|
402
|
+
get bodyDomContainer(): HTMLElement;
|
|
403
|
+
get headerDomContainer(): HTMLElement;
|
|
422
404
|
}
|