import{defineComponent as B,ref as g,computed as x,createVNode as o}from"vue";import b from"../_util/classNames.mjs";import S from"../_util/props-util/initDefaultProps.mjs";import"../badge/index.mjs";import $ from"../config-provider/hooks/useConfigInject.mjs";import y from"../tooltip/index.mjs";import P from"./FloatButtonContent.mjs";import{useInjectFloatButtonGroupContext as F}from"./context.mjs";import{floatButtonProps as I}from"./interface.mjs";import N from"./style/index.mjs";import j from"../badge/Badge.mjs";const A="float-btn",J=B({compatConfig:{MODE:3},name:"AFloatButton",inheritAttrs:!1,props:S(I(),{type:"default",shape:"circle"}),setup(r,{attrs:l,slots:e}){const{prefixCls:t,direction:s}=$(A,r),[f,c]=N(t),{shape:m}=F(),a=g(null),d=x(()=>m?.value||r.shape);return()=>{const{prefixCls:D,type:v="default",shape:R="circle",description:h=e.description?.(),tooltip:n,badge:C={},...i}=r,p=b(t.value,`${t.value}-${v}`,`${t.value}-${d.value}`,{[`${t.value}-rtl`]:s.value==="rtl"},l.class,c.value),u=o(y,{placement:"left"},{title:e.tooltip||n?()=>e.tooltip&&e.tooltip()||n:void 0,default:()=>o(j,C,{default:()=>[o("div",{class:`${t.value}-body`},[o(P,{prefixCls:t.value},{icon:e.icon,description:()=>h})])]})});return f(r.href?o("a",{ref:a,...l,...i,class:p},[u]):o("button",{ref:a,...l,...i,class:p,type:"button"},[u]))}}});export{J as default,A as floatButtonPrefixCls};
