import{d as E,an as y,ap as F,r as q,w as S,o as t,f as i,D as k,x as o,z as u,J as W,a3 as C,g as f,A as c,t as d,S as l,b as p,y as v,W as m,_ as $}from"./index-D8-yxEbK.js";const M={class:"WdsFieldWrapper colorTransformer"},z={class:"temporaryMissingBar"},I={key:0,class:"WdsFieldWrapper__title"},N={key:0,class:"WdsFieldWrapper__title__label"},V={key:0,class:"WdsFieldWrapper__title__label__unit"},A={class:"WdsFieldWrapper__slot"},D={key:1,class:"WdsFieldWrapper__error"},O={key:2,class:"WdsFieldWrapper__hint"},T=E({__name:"WdsFieldWrapper",props:y({label:{type:String,required:!1,default:void 0},unit:{type:String,required:!1,default:void 0},hint:{type:String,required:!1,default:void 0},error:{type:String,required:!1,default:void 0},isExpansible:{type:Boolean,required:!1,default:!1},isBindingButtonShown:{type:Boolean,required:!1,default:!1},shouldExpand:{type:Boolean,required:!1,default:!1},helpButton:{type:[String,Boolean],required:!1,default:void 0}},{isBindingEnabled:{type:Boolean,required:!1,default:!1},isBindingEnabledModifiers:{}}),emits:y({helpClick:()=>!0,expand:()=>!0,shrink:()=>!0},["update:isBindingEnabled"]),setup(e,{emit:b}){const r=F(e,"isBindingEnabled"),g=e,B=b,n=q(!1);function h(){B("expand"),n.value=!0}S(()=>g.shouldExpand&&!n.value,s=>{s&&h()});const w={desc:"OK",fn:()=>{n.value=!1,B("shrink")}};return(s,a)=>(t(),i("div",M,[n.value?(t(),i(k,{key:0},[o(C,{actions:[w],description:e.hint,title:e.label},{default:u(()=>[W(s.$slots,"default",{},void 0,!0)]),_:3},8,["actions","description","title"]),f("div",z,[a[2]||(a[2]=c(" Field ")),f("strong",null,d(e.label),1),a[3]||(a[3]=c(" is open in a new window. "))])],64)):(t(),i(k,{key:1},[!n.value&&(e.label||e.helpButton)?(t(),i("div",I,[e.label?(t(),i("label",N,[c(d(e.label),1),e.unit?(t(),i("span",V," : "+d(e.unit),1)):l("",!0)])):l("",!0),e.isExpansible?(t(),p(m,{key:1,variant:"neutral",size:"smallIcon","data-writer-tooltip":"Expand",onClick:h},{default:u(()=>[o(v,{name:"expand"})]),_:1})):l("",!0),e.helpButton?(t(),p(m,{key:2,variant:"neutral",size:"smallIcon","data-writer-tooltip":typeof e.helpButton=="string"?e.helpButton:void 0,onClick:a[0]||(a[0]=x=>s.$emit("helpClick"))},{default:u(()=>[o(v,{name:"circle-question-mark"})]),_:1},8,["data-writer-tooltip"])):l("",!0),e.isBindingButtonShown?(t(),p(m,{key:3,variant:"neutral",size:"smallIcon","data-writer-tooltip-placement":"left","data-writer-tooltip":r.value?"Unbind from variable":"Bind to a variable",onClick:a[1]||(a[1]=x=>r.value=!r.value)},{default:u(()=>[o(v,{name:r.value?"wds-at-sign-slash":"at-sign"},null,8,["name"])]),_:1},8,["data-writer-tooltip"])):l("",!0)])):l("",!0),f("div",A,[W(s.$slots,"default",{},void 0,!0)]),e.error?(t(),i("p",D,d(e.error),1)):l("",!0),e.hint?(t(),i("p",O,d(e.hint),1)):l("",!0)],64))]))}}),J=$(T,[["__scopeId","data-v-3dad4fb3"]]);export{J as W};
//# sourceMappingURL=WdsFieldWrapper-mkHlJLp3.js.map
