UNPKG

various-ui

Version:

This is a test version of the Vue 3 component library

97 lines (92 loc) 3.27 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); require('../../../utils/index.js'); var index = require('./index.js'); var composable = require('./src/composable.js'); var index$1 = require('../../../utils/src/node/index.js'); const _hoisted_1 = { class: "ui-tooltip-content" }; const __default__ = vue.defineComponent({ name: "UiTooltip" }); var _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: index.UiTooltipPropsOption, emits: index.UiTooltipEmits, setup(__props, { expose: __expose, emit: __emit }) { const emits = __emit; const define = __props; const { ons, vars, refs, nodes, methods, computeds } = composable.useComposable(define, emits); const { active, visible } = refs; const { container, triangle, tooltip } = nodes; const { show, hidden } = methods; const { style } = computeds; vue.onBeforeUnmount(() => { var _a; tooltip.value && index$1.remove(document.body, tooltip.value); (_a = vars.observer) == null ? void 0 : _a.disconnect(); }); ; __expose({ show, hidden }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock( "div", vue.mergeProps({ class: ["ui-tooltip-container", { "ui-active": vue.unref(active) }], ref_key: "container", ref: container }, vue.toHandlers(vue.unref(ons).container, true)), [ vue.renderSlot(_ctx.$slots, "default"), vue.createVNode( vue.Transition, vue.toHandlers(vue.unref(ons).animation), { default: vue.withCtx(() => [ vue.unref(visible) ? (vue.openBlock(), vue.createElementBlock( "div", vue.mergeProps({ key: 0 }, vue.toHandlers(vue.unref(ons).content, true), { class: ["ui-tooltip", _ctx.classExtraName], ref_key: "tooltip", ref: tooltip, style: vue.unref(style) }), [ vue.createElementVNode( "div", { class: "ui-tooltip-triangle", ref_key: "triangle", ref: triangle }, null, 512 /* NEED_PATCH */ ), vue.createElementVNode("div", _hoisted_1, [ vue.renderSlot(_ctx.$slots, "content", {}, () => [ vue.createTextVNode( vue.toDisplayString(_ctx.content), 1 /* TEXT */ ) ]) ]) ], 16 /* FULL_PROPS */ )) : vue.createCommentVNode("v-if", true) ]), _: 3 /* FORWARDED */ }, 16 /* FULL_PROPS */ ) ], 16 /* FULL_PROPS */ ); }; } }); exports.default = _sfc_main; //# sourceMappingURL=index.vue2.js.map