import{c as b,g as i,A as a,j as n,J as u,P as g,O as m,B as s,C as k,a8 as r,H as B,r as w}from"./index-DOFLUERq.js";import{d as V}from"./vuedraggable.umd-CrsnNXKf.js";import x from"./Field-DRxYLPpS.js";import h from"./AddFieldButton-DEq3S2HV.js";import{u as F,i as M}from"./utils-DMBE_oxT.js";import{u as O}from"./index-CRx3oDcD.js";import{_ as A}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{h as N}from"./index-DuPUrsw1.js";import"./_commonjsHelpers-CE1G-McA.js";import"./EditableInput-DhGmkLrc.js";import"./iconify-p99pbjf9.js";import"./Autocomplete-SEbcHX6m.js";const S=["title"],U=["hidden"],D={class:"column-label"},I={key:1,class:"column-description"},P=["hidden"],$={key:2,class:"add-new-field-btn"},j={__name:"Column",props:["section","column"],setup(e){const f=e,l=F(),{Backspace:p}=O();N(p,o=>{o&&v.value&&l.notUsingInput});const c=w(!1),v=b(()=>l.selected(f.column.df.name));function y(o){o.target.closest(".add-field-btn, .add-field-wrapper")||(l.form.selected_field=f.column.df)}function C(o){o.target.closest(".add-field-btn, .add-field-wrapper")||o.stopPropagation()}return(o,t)=>(i(),a("div",{class:B(["column",v.value?"selected":c.value?"hovered":""]),title:e.column.df.fieldname,onClick:r(y,["stop"]),onMouseover:t[1]||(t[1]=r(d=>c.value=!0,["stop"])),onMouseout:t[2]||(t[2]=r(d=>c.value=!1,["stop"]))},[e.column.df.label?(i(),a("div",{key:0,class:"column-header",hidden:!e.column.df.label&&n(l).readOnly},[u("div",D,[u("span",null,g(e.column.df.label),1)])],8,U)):m("",!0),e.column.df.description?(i(),a("div",I,g(e.column.df.description),1)):m("",!0),s(n(V),{class:"column-container",modelValue:e.column.fields,"onUpdate:modelValue":t[0]||(t[0]=d=>e.column.fields=d),group:"fields",delay:n(M)()?200:0,animation:200,easing:n(l).getAnimation,"item-key":"id",disabled:n(l).readOnly,onClick:C},{item:k(({element:d})=>[s(x,{column:e.column,field:d,"data-is-user-generated":n(l).isUserGeneratedField(d)},null,8,["column","field","data-is-user-generated"])]),_:1},8,["modelValue","delay","easing","disabled"]),u("div",{class:"empty-column",hidden:n(l).readOnly},[s(h,{column:e.column},null,8,["column"])],8,P),e.column.fields.length?(i(),a("div",$,[s(h,{field:e.column.fields[e.column.fields.length-1],column:e.column},null,8,["field","column"])])):m("",!0)],42,S))}},X=A(j,[["__scopeId","data-v-c56e0b7d"]]);export{X as default};
