"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),v=300,h=s.shallowRef(!1),W=(l,c,f)=>{const a=s.ref({}),u=s.shallowRef(),n=s.computed(()=>{if(l.search){const r={span:6,labelWidth:70,collapsed:!0};if(typeof l.search=="boolean"){const t=v+r.labelWidth,o=Math.ceil(f.value/t);return o<4&&(r.span=24/o),r}else{const t={...r,...l.search},o=v+t.labelWidth,e=Math.ceil(f.value/o);return e<4&&(t.span=24/e),t}}else return!1}),m=async()=>{var t;const r=await((t=u.value)==null?void 0:t.submit());a.value=r},b=()=>{var t;const r=(t=u.value)==null?void 0:t.reset();a.value=r},I=s.computed(()=>{let r=[];if(c.value&&n.value){const t=c.value.filter(e=>e.search),o=24/n.value.span;r=t.map((e,P)=>{var p,i,d;return{valueType:e.valueType,valueEnum:e.valueEnum,...e.formItemProps,fixedWidth:!0,label:e.title||((p=e.formItemProps)==null?void 0:p.label),property:e.dataIndex||((i=e.formItemProps)==null?void 0:i.prop),hideInForm:!h.value&&P+1>=o,formInputProps:{...e.fieldProps,...(d=e.formItemProps)==null?void 0:d.formInputProps}}})}return r});return{formState:a,formPorps:n,formIns:u,getSearchValue:m,resetForm:b,properties:I,collapsed:h}};exports.default=W;
