"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),s=require("./context.js"),F=i.defineComponent({name:"ApFormProvider",__name:"index",props:{onFormChange:{type:Function},onFormFinish:{type:Function}},setup(u){const t=u,o=i.ref({}),n=s.useInjectFormProvider();return s.useProvideFormProvider({triggerFormChange(e,r){t?.onFormChange&&t.onFormChange(e,{changedFields:r,forms:o.value}),n?.triggerFormChange(e,r)},triggerFormFinish:(e,r)=>{t?.onFormFinish&&t.onFormFinish(e,{values:r,forms:o.value}),n?.triggerFormFinish(e,r)},registerForm:(e,r)=>{e&&(o.value={...o.value,[e]:r}),n?.registerForm(e,r)},unregisterForm:e=>{const r={...o.value};delete r[e],o.value=r,n?.unregisterForm(e)}}),(e,r)=>i.renderSlot(e.$slots,"default")}});exports.default=F;
