import{_n as e,mr as t}from"./common.js";import{Fragment as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,reactive as u,renderList as d,unref as f,watch as p,withCtx as m}from"vue";import{RadioButton as h,Tooltip as g}from"ant-design-vue";import{useDesign as _}from"@mfish/core/hooks";import{Icon as v}from"@mfish/core/components/Icon";var y=t(s({__name:`TextFontStyle`,props:{bold:{type:Boolean,default:!1},italic:{type:Boolean,default:!1},strikethrough:{type:Boolean,default:!1},underline:{type:Boolean,default:!1},hide:{type:Array,default:()=>[]}},emits:[`fontStyleChange`],setup(t,{emit:s}){let y=t,b=s,x=u({[e.Bold]:{name:`加粗`,icon:`carbon:text-bold`,value:!1},[e.Italic]:{name:`斜体`,icon:`carbon:text-italic`,value:!1},[e.Underline]:{name:`下划线`,icon:`carbon:text-underline`,value:!1},[e.Strikethrough]:{name:`删除线`,icon:`carbon:text-strikethrough`,value:!1}}),S=e=>!y.hide.includes(e);p([()=>y.bold,()=>y.italic,()=>y.strikethrough,()=>y.underline],([e,t,n,r])=>{x.bold.value=e,x.italic.value=t,x.strikethrough.value=n,x.underline.value=r},{immediate:!0,deep:!0});let{prefixCls:C}=_(`font-style`);function w(t){if(t){x[t].value=!x[t].value,x[t].value&&(t===e.Underline&&(x[e.Strikethrough].value=!1),t===e.Strikethrough&&(x[e.Underline].value=!1));let n={};Object.keys(x).forEach(e=>{n[e]=x[e].value}),b(`fontStyleChange`,n)}}return(e,t)=>(l(),a(`div`,{class:c(f(C))},[(l(!0),a(n,null,d(Object.keys(x),e=>(l(),a(n,{key:e},[S(e)?(l(),r(f(g),{key:0,placement:`bottom`,title:`${x[e].value?`关闭`:`打开`}${x[e].name}`},{default:m(()=>[o(f(h),{class:`radio-button`,checked:x[e].value,onMousedown:t=>w(e)},{default:m(()=>[o(f(v),{icon:x[e].icon},null,8,[`icon`])]),_:2},1032,[`checked`,`onMousedown`])]),_:2},1032,[`title`])):i(``,!0)],64))),128))],2))}}),[[`__scopeId`,`data-v-0aa6420d`]]);export{y as t};