import _ from"./SearchBox-DzuF0DHo.js";import{u as y,a as r,L as v,e as L,N as C}from"./utils-DMBE_oxT.js";import{I as V}from"./iconify-p99pbjf9.js";import{g as s,A as i,J as n,B as f,R as k,j as a,t as h,K as x,L as g,i as B,Z as b,O as D,r as F,c as N}from"./index-DOFLUERq.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-CRx3oDcD.js";import"./index-DuPUrsw1.js";const S={class:"field-properties"},T={class:"header"},U=["title"],w={class:"control-data"},A={key:0},E={__name:"FieldProperties",setup(I){let l=y(),o=F(""),m=N(()=>[...l.getPagefields.map(e=>({...e})).filter(e=>r(v,e.fieldtype)||e.hidden||e.depends_on&&!L(e.depends_on,l.form.selected_field,l.pg)||r(["fetch_from","fetch_if_empty"],e.fieldname)&&r(C,l.form.selected_field.fieldtype)||e.fieldname==="reqd"&&l.form.selected_field.fieldtype==="Check"||(e.fieldname==="options"&&(e.fieldtype="Small Text",e.options="",r(["Table","Link"],l.form.selected_field.fieldtype)&&(e.fieldtype="Data")),e.fieldname==="link_filters"&&l.form.selected_field.fieldtype!=="Link")?!1:o.value?!!(e.label.toLowerCase().includes(o.value.toLowerCase())||e.fieldname.toLowerCase().includes(o.value.toLowerCase())):!0)]);function c(d){return d.replaceAll(" ","")+"Control"}return(d,e)=>(s(),i("div",S,[n("div",T,[f(_,{class:"flex-1",modelValue:a(o),"onUpdate:modelValue":e[0]||(e[0]=t=>k(o)?o.value=t:o=t)},null,8,["modelValue"]),n("button",{class:"close-btn btn btn-xs",title:a(h)("Close properties"),onClick:e[1]||(e[1]=t=>a(l).form.selected_field=null)},[f(a(V),{icon:"mdi:close",class:"icon-sm"})],8,U)]),n("div",w,[a(l).form.selected_field?(s(),i("div",A,[(s(!0),i(x,null,g(a(m),(t,p)=>(s(),i("div",{class:"field",key:p},[(s(),B(b(c(t.fieldtype)),{df:t,read_only:a(l).readOnly,value:a(l).form.selected_field[t.fieldname],modelValue:a(l).form.selected_field[t.fieldname],"onUpdate:modelValue":u=>a(l).form.selected_field[t.fieldname]=u,"data-fieldname":t.fieldname,"data-fieldtype":t.fieldtype},null,8,["df","read_only","value","modelValue","onUpdate:modelValue","data-fieldname","data-fieldtype"]))]))),128))])):D("",!0)])]))}},Z=O(E,[["__scopeId","data-v-fdad068f"]]);export{Z as default};
