Comparing version 0.1.0-beta.13 to 0.1.0-beta.14
import { StyleSheet, css } from 'aphrodite/no-important.js'; | ||
import { get, isBoolean, isFunction, isString } from 'lodash'; | ||
import { get, isBoolean, isElement, isFunction, isString } from 'lodash'; | ||
import placement from 'placement.js'; | ||
@@ -62,6 +62,8 @@ import { ChartEvent, } from '../types/index.js'; | ||
if (!isBoolean(this.option)) { | ||
const overlay = document.createElement('div'); | ||
overlay.className = `${generateName('tooltip')} ${css(styles.overlay)}`; | ||
document.body.append(overlay); | ||
this.container = overlay; | ||
if (!this.container) { | ||
const overlay = document.createElement('div'); | ||
overlay.className = `${generateName('tooltip')} ${css(styles.overlay)}`; | ||
document.body.append(overlay); | ||
this.container = overlay; | ||
} | ||
this.createItem(); | ||
@@ -78,9 +80,9 @@ this.eventListener(); | ||
const itemTpl = this.getTooltipItem(values); | ||
const isString = typeof itemTpl === 'string'; | ||
const isEl = isElement(itemTpl); | ||
const list = `<ul class="${css(styles['tooltip-list'])}">${itemTpl}</ul>`; | ||
this.container.innerHTML = ` | ||
${this.getTooltipTitle(title)} | ||
${isString ? list : ''} | ||
${isEl ? '' : list} | ||
`; | ||
!isString && this.container.append(itemTpl); | ||
isEl && this.container.append(itemTpl); | ||
} | ||
@@ -87,0 +89,0 @@ getTooltipTitle(title) { |
@@ -238,2 +238,5 @@ import { merge, mergeWith } from 'lodash'; | ||
const x = u.data[0][idx]; | ||
const bbox = over.getBoundingClientRect(); | ||
bLeft = bbox.left; | ||
bTop = bbox.top; | ||
const anchor = { left: left + bLeft, top: top + bTop }; | ||
@@ -240,0 +243,0 @@ const data = this.ctrl.getData(); |
{ | ||
"name": "zz-chart", | ||
"version": "0.1.0-beta.13", | ||
"version": "0.1.0-beta.14", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "author": "Alauda", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
449982
11922