UNPKG

@progress/kendo-vue-charts

Version:
108 lines (107 loc) 2.48 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as l, createVNode as o } from "vue"; import { InstanceObserver as i } from "@progress/kendo-charts"; import { hasParent as u } from "../utils/main.mjs"; import { Popup as c } from "@progress/kendo-vue-popup"; import { getRef as f, getDefaultSlots as h, setRef as d } from "@progress/kendo-vue-common"; const m = { horizontal: "fit", vertical: "fit" }, v = "k-chart-tooltip", O = "k-chart-tooltip-wrapper", C = /* @__PURE__ */ l({ name: "KendoTooltipPopup", props: { className: String, popupShown: Boolean, popupAlign: { type: Object, default: function() { } }, popupOffset: { type: Object }, popupStyles: { type: Object }, popupContent: Function }, inject: { options: { default: { state: {} } }, dispatchOptions: { default: null }, observersState: { default: null }, dispatchObservers: { default: null }, childrenObserver: { default: null } }, created() { this.chartObserver = new i(this, { onMouseLeave: "onChartMouseLeave" }), this.dispatchObservers({ type: "add", payload: this.chartObserver }); }, mounted() { this.element = f(this, "element"); }, unmounted() { this.dispatchObservers({ type: "remove", payload: this.chartObserver }); }, render() { const e = h(this), { popupShown: t, popupAlign: s, popupOffset: p, popupStyles: r, className: n } = this.$props, a = [v, n].join(" ").trim(); return o(c, { animate: !1, popupAlign: s, offset: p, show: t, collision: m, class: O }, { default: () => [o("div", { class: a, style: r, onMouseleave: this.onMouseLeave, ref: d(this, "element") }, [e])] }); }, methods: { onChartMouseLeave(e) { const { event: t } = e; return !!u(t.relatedTarget, this.element); }, onMouseLeave(e) { } } }); export { C as TooltipPopup };