8787a3df7cf30220fda78af36bd5b89da4858288dbc5f50fa1e13f001111ba8446467ab41fb111f0580c8f3d7191411234189bf3659d1c11d0c3f64069897b 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { defineComponent, toRefs, reactive, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, renderSlot, unref, Transition, createCommentVNode, createElementBlock, Fragment } from 'vue';
  2. import { pick } from 'lodash-unified';
  3. import { ElTeleport } from '../../teleport/index.mjs';
  4. import { tooltipV2ArrowProps } from './arrow.mjs';
  5. import { tooltipV2ContentProps } from './content.mjs';
  6. import { tooltipV2RootProps } from './root.mjs';
  7. import { tooltipV2Props } from './tooltip.mjs';
  8. import { tooltipV2TriggerProps } from './trigger.mjs';
  9. import TooltipV2Root from './root2.mjs';
  10. import TooltipV2Arrow from './arrow2.mjs';
  11. import TooltipV2Content from './content2.mjs';
  12. import TooltipV2Trigger from './trigger2.mjs';
  13. import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
  14. const __default__ = defineComponent({
  15. name: "ElTooltipV2"
  16. });
  17. const _sfc_main = /* @__PURE__ */ defineComponent({
  18. ...__default__,
  19. props: tooltipV2Props,
  20. setup(__props) {
  21. const props = __props;
  22. const refedProps = toRefs(props);
  23. const arrowProps = reactive(pick(refedProps, Object.keys(tooltipV2ArrowProps)));
  24. const contentProps = reactive(pick(refedProps, Object.keys(tooltipV2ContentProps)));
  25. const rootProps = reactive(pick(refedProps, Object.keys(tooltipV2RootProps)));
  26. const triggerProps = reactive(pick(refedProps, Object.keys(tooltipV2TriggerProps)));
  27. return (_ctx, _cache) => {
  28. return openBlock(), createBlock(TooltipV2Root, normalizeProps(guardReactiveProps(rootProps)), {
  29. default: withCtx(({ open }) => [
  30. createVNode(TooltipV2Trigger, mergeProps(triggerProps, { nowrap: "" }), {
  31. default: withCtx(() => [
  32. renderSlot(_ctx.$slots, "trigger")
  33. ]),
  34. _: 3
  35. }, 16),
  36. createVNode(unref(ElTeleport), {
  37. to: _ctx.to,
  38. disabled: !_ctx.teleported
  39. }, {
  40. default: withCtx(() => [
  41. _ctx.fullTransition ? (openBlock(), createBlock(Transition, normalizeProps(mergeProps({ key: 0 }, _ctx.transitionProps)), {
  42. default: withCtx(() => [
  43. _ctx.alwaysOn || open ? (openBlock(), createBlock(TooltipV2Content, normalizeProps(mergeProps({ key: 0 }, contentProps)), {
  44. arrow: withCtx(({ style, side }) => [
  45. _ctx.showArrow ? (openBlock(), createBlock(TooltipV2Arrow, mergeProps({ key: 0 }, arrowProps, {
  46. style,
  47. side
  48. }), null, 16, ["style", "side"])) : createCommentVNode("v-if", true)
  49. ]),
  50. default: withCtx(() => [
  51. renderSlot(_ctx.$slots, "default")
  52. ]),
  53. _: 3
  54. }, 16)) : createCommentVNode("v-if", true)
  55. ]),
  56. _: 2
  57. }, 1040)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
  58. _ctx.alwaysOn || open ? (openBlock(), createBlock(TooltipV2Content, normalizeProps(mergeProps({ key: 0 }, contentProps)), {
  59. arrow: withCtx(({ style, side }) => [
  60. _ctx.showArrow ? (openBlock(), createBlock(TooltipV2Arrow, mergeProps({ key: 0 }, arrowProps, {
  61. style,
  62. side
  63. }), null, 16, ["style", "side"])) : createCommentVNode("v-if", true)
  64. ]),
  65. default: withCtx(() => [
  66. renderSlot(_ctx.$slots, "default")
  67. ]),
  68. _: 3
  69. }, 16)) : createCommentVNode("v-if", true)
  70. ], 64))
  71. ]),
  72. _: 2
  73. }, 1032, ["to", "disabled"])
  74. ]),
  75. _: 3
  76. }, 16);
  77. };
  78. }
  79. });
  80. var TooltipV2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "tooltip.vue"]]);
  81. export { TooltipV2 as default };
  82. //# sourceMappingURL=tooltip2.mjs.map