59966335991ebbb2c54da1a47ddf7735b65a2288b8d972c3f8274bbe15e303ebf228619672d0dd68fba5eb0696dd905d4750a07b88b3f2893076b0e719c0b2 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { defineComponent, inject, computed, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass } from 'vue';
  2. import { tooltipV2RootKey, tooltipV2ContentKey } from './constants.mjs';
  3. import { tooltipV2ArrowProps, tooltipV2ArrowSpecialProps } from './arrow.mjs';
  4. import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
  5. const __default__ = defineComponent({
  6. name: "ElTooltipV2Arrow"
  7. });
  8. const _sfc_main = /* @__PURE__ */ defineComponent({
  9. ...__default__,
  10. props: {
  11. ...tooltipV2ArrowProps,
  12. ...tooltipV2ArrowSpecialProps
  13. },
  14. setup(__props) {
  15. const props = __props;
  16. const { ns } = inject(tooltipV2RootKey);
  17. const { arrowRef } = inject(tooltipV2ContentKey);
  18. const arrowStyle = computed(() => {
  19. const { style, width, height } = props;
  20. const namespace = ns.namespace.value;
  21. return {
  22. [`--${namespace}-tooltip-v2-arrow-width`]: `${width}px`,
  23. [`--${namespace}-tooltip-v2-arrow-height`]: `${height}px`,
  24. [`--${namespace}-tooltip-v2-arrow-border-width`]: `${width / 2}px`,
  25. [`--${namespace}-tooltip-v2-arrow-cover-width`]: width / 2 - 1,
  26. ...style || {}
  27. };
  28. });
  29. return (_ctx, _cache) => {
  30. return openBlock(), createElementBlock("span", {
  31. ref_key: "arrowRef",
  32. ref: arrowRef,
  33. style: normalizeStyle(unref(arrowStyle)),
  34. class: normalizeClass(unref(ns).e("arrow"))
  35. }, null, 6);
  36. };
  37. }
  38. });
  39. var TooltipV2Arrow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "arrow.vue"]]);
  40. export { TooltipV2Arrow as default };
  41. //# sourceMappingURL=arrow2.mjs.map