mtxuilib 0.0.382 → 0.0.384

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,11 +5,12 @@ export declare function ConnectEsUpdateForm<I extends Message<I>, O extends Mess
5
5
  defaultValues?: any;
6
6
  mutationMethodSig: MethodUnaryDescriptor<any, any>;
7
7
  } & Omit<ComponentProps<typeof FormInnerWithSuspenseQuery>, "onSubmit">): import("react").JSX.Element;
8
- export declare function FormInner(props: {
8
+ declare function FormInner(props: {
9
9
  defaultValues: any;
10
10
  onSubmit: (values: any) => void;
11
11
  } & PropsWithChildren): import("react").JSX.Element;
12
- export declare function FormInnerWithSuspenseQuery<I extends Message<I>, O extends Message<O>>(props: {
12
+ declare function FormInnerWithSuspenseQuery<I extends Message<I>, O extends Message<O>>(props: {
13
13
  methodQuerySig: MethodUnaryDescriptor<I, O>;
14
14
  params: PartialMessage<I>;
15
15
  } & Omit<ComponentProps<typeof FormInner>, "defaultValues">): import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1 @@
1
+ "use client";var b=Object.defineProperty,g=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var p=(e,t,n)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&p(e,n,t[n]);if(a)for(var n of a(t))f.call(t,n)&&p(e,n,t[n]);return e},y=(e,t)=>g(e,M(t));var S=(e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&a)for(var o of a(e))t.indexOf(o)<0&&f.call(e,o)&&(n[o]=e[o]);return n};import{Fragment as O,jsx as s}from"react/jsx-runtime";import{Suspense as I}from"react";import{useMutation as F,useSuspenseQuery as P}from"gomtm/connectquery";import{FormProvider as Q,useForm as V}from"react-hook-form";function k(e){const{defaultValues:t,methodQuerySig:n,params:o,children:r,mutationMethodSig:i}=e,u=F(i),d=h=>{u.mutateAsync(h)};return t?s(c,{defaultValues:t,onSubmit:d,children:r}):s(I,{fallback:s(O,{children:"ConnectEsUpdateForm loading"}),children:s(C,{methodQuerySig:n,params:o,onSubmit:d,children:r})})}function c(e){const{defaultValues:t,onSubmit:n,children:o}=e,r=V({defaultValues:t});return s(Q,y(m({},r),{children:s("form",{onSubmit:r.handleSubmit(n),children:o})}))}function C(e){const u=e,{methodQuerySig:t,params:n,onSubmit:o}=u,r=S(u,["methodQuerySig","params","onSubmit"]),i=P(t,n);return s(c,m({defaultValues:i.data,onSubmit:o},r))}export{k as ConnectEsUpdateForm};