"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("./index.vue.js"),h=require("./types.js"),l=require("../../form-fileds/index.js"),f=require("./base/dependency.js"),v=e.defineComponent({name:"WetSchemaForm",__name:"schema",props:h.wetSchemaProps,setup(a,{expose:i}){const d=e.useSlots(),n=e.shallowRef(),u=a,p=e.computed(()=>u.properties?u.properties.filter(o=>!o.hideInRender).map(o=>({value:{...o,renderFormItem:null,valueEnum:null,hideInForm:null,property:null,valueType:null,prop:o.property||o.prop,label:o.title||o.label,formInputProps:{options:o.valueEnum,...o.formInputProps}},other:{key:Array.isArray(o.property)?o.property.join("."):o.property,renderFormItem:o.renderFormItem,dependency:o.dependency,hideInForm:o.hideInForm,valueType:o.valueType}})):[]),m=e.computed(()=>{const r={...u};return delete r.properties,r}),c=(r,t)=>t||(r==="autocomplete"?l.WetFormAutocompleter:r==="cascader"?l.WetFormCascader:r==="select"?l.WetFormSelect:r==="checkbox"?l.WetFormCheckbox:r==="color"?l.WetFormColorPicker:r==="date"?l.WetFormDatePicker:r==="number"?l.WetFormNumber:r==="radio"?l.WetFormRadio:r==="slider"?l.WetFormSlider:r==="switch"?l.WetFormSwitch:r==="time-picker"?l.WetFormTimePicker:r==="time-select"?l.WetFormTimeSelect:r==="rate"?l.WetFormRate:r==="array"?l.WetFormArray:l.WetFormText);return i({submit:()=>{var r;return(r=n.value)==null?void 0:r.submit()},reset:()=>{var r;return(r=n.value)==null?void 0:r.reset()},validateField:r=>{var t;return(t=n.value)==null?void 0:t.validateField(r)},clearValidate:r=>{var t;return(t=n.value)==null?void 0:t.clearValidate(r)},getFieldsValue:r=>{var t;return(t=n.value)==null?void 0:t.getFieldsValue(r)},setFieldsValue:(r,t)=>{var o;return(o=n.value)==null?void 0:o.setFieldsValue(r,t)},scrollToField:r=>{var t;return(t=n.value)==null?void 0:t.scrollToField(r)}}),(r,t)=>(e.openBlock(),e.createBlock(F.default,e.mergeProps(m.value,{ref_key:"formIns",ref:n}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.other.key},[o.other.dependency?(e.openBlock(),e.createBlock(e.unref(f.default),{key:0,relyprops:o.other.dependency.relyprops,"dependency-change":o.other.dependency.dependencyChange},{default:e.withCtx(({parames:s})=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(c((s==null?void 0:s.valueType)||o.other.valueType,o.other.renderFormItem)),e.normalizeProps(e.guardReactiveProps({...o.value,...s})),null,16)),[[e.vShow,!o.other.hideInForm]])]),_:2},1032,["relyprops","dependency-change"])):e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(c(o.other.valueType,o.other.renderFormItem)),e.normalizeProps(e.mergeProps({key:1},o.value)),null,16)),[[e.vShow,!o.other.hideInForm]])],64))),128))]),_:2},[e.unref(d).actions?{name:"actions",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"actions")]),key:"0"}:void 0]),1040))}});exports.default=v;
