UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

34 lines (33 loc) 1.41 kB
import { toCamelCase } from "../../util/format.mjs"; import env from "../../../../zrender/lib/core/env.mjs"; function shouldTooltipConfine(tooltipModel) { var confineOption = tooltipModel.get("confine"); return confineOption != null ? !!confineOption : tooltipModel.get("renderMode") === "richText"; } function testStyle(styleProps) { if (!env.domSupported) { return; } var style = document.documentElement.style; for (var i = 0, len = styleProps.length; i < len; i++) { if (styleProps[i] in style) { return styleProps[i]; } } } var TRANSFORM_VENDOR = testStyle(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]); var TRANSITION_VENDOR = testStyle(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]); function toCSSVendorPrefix(styleVendor, styleProp) { if (!styleVendor) { return styleProp; } styleProp = toCamelCase(styleProp, true); var idx = styleVendor.indexOf(styleProp); styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp; return styleVendor.toLowerCase(); } function getComputedStyle(el, style) { var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el); return stl ? style ? stl[style] : stl : null; } export { TRANSFORM_VENDOR, TRANSITION_VENDOR, getComputedStyle, shouldTooltipConfine, toCSSVendorPrefix };