mtxuilib 0.0.508 → 0.0.511
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.
- package/dist/esm/__registry__/index.js +1 -1
- package/dist/esm/curd/curd-detail.js +1 -1
- package/dist/esm/form/TrpcUpdateForm.d.ts +4 -4
- package/dist/esm/form/TrpcUpdateForm.js +1 -1
- package/dist/esm/lib/blocks.d.ts +1 -1
- package/dist/esm/registry/blocks.d.ts +1 -1
- package/dist/esm/registry/default/example/card-demo.d.ts +1 -1
- package/dist/esm/registry/default/example/slider-demo.d.ts +1 -1
- package/dist/esm/registry/default/ui/carousel.d.ts +2 -2
- package/dist/esm/registry/default/ui/pagination.d.ts +1 -1
- package/dist/esm/registry/default/ui/use-toast.d.ts +1 -1
- package/dist/esm/registry/examples.d.ts +1 -1
- package/dist/esm/registry/new-york/example/card-demo.d.ts +1 -1
- package/dist/esm/registry/new-york/example/slider-demo.d.ts +1 -1
- package/dist/esm/registry/new-york/ui/carousel.d.ts +2 -2
- package/dist/esm/registry/new-york/ui/pagination.d.ts +1 -1
- package/dist/esm/registry/new-york/ui/use-toast.d.ts +1 -1
- package/dist/esm/registry/registry.d.ts +1 -1
- package/dist/esm/registry/ui.d.ts +1 -1
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.config.dev.d.cts +1 -1
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.plugins.d.cts +1 -1
- package/dist/esm/webpack/webpack-clibin/webpack.config.d.cts +1 -1
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as V,jsx as e,jsxs as
|
|
1
|
+
"use client";import{Fragment as V,jsx as e,jsxs as a}from"react/jsx-runtime";import{useAtom as u}from"jotai";import{useSearchParams as p}from"next/navigation";import{createContext as c,useMemo as l,useState as D}from"react";import{Icons as m}from"../icons/icons";import{DropdownMenu as w,DropdownMenuContent as C,DropdownMenuGroup as f,DropdownMenuLabel as h,DropdownMenuSeparator as s,DropdownMenuTrigger as M}from"../ui/dropdown-menu";import{MtButton as P}from"../ui/ui-mt/Button";import{activateIdAtom as v,useCurdView as S}from"./CurdViewView";const b=c(void 0);function x(t){const[r,o]=D(!1);return e(b.Provider,{value:{isOpenEdit:r,setIsOpenEdit:o},children:t.children})}function L(t){const{children:r}=t,[o,n]=u(v),i=p();return l(()=>{const d=i.get("id");d&&n(d)},[i,n]),o?e(V,{children:e(x,{})}):null}const N=()=>{const t=S();return a(w,{children:[e(M,{asChild:!0,children:e(P,{variant:"ghost",className:"m-0 flex h-10 w-10 items-center justify-center border p-0 shadow-sm backdrop-blur",children:e(m.ellipsis,{})})}),a(C,{className:"w-56",children:[e(h,{children:"Edit"}),e(s,{}),e(f,{}),e(s,{})]})]})};export{L as CurdViewShow,N as DetailViewActions};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ComponentProps, PropsWithChildren } from "react";
|
|
2
1
|
import type { Message, PartialMessage } from "@bufbuild/protobuf";
|
|
3
2
|
import { DecoratedMutation, DecoratedQuery } from "@trpc/react-query/dist/createTRPCReact";
|
|
3
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
4
4
|
import { UseFormProps } from "react-hook-form";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { ResolverDef } from "../lib/trpc/types";
|
|
7
|
-
export declare function TrpcUpdateForm<TDef extends ResolverDef>(props: {
|
|
8
|
-
defaultValues?:
|
|
7
|
+
export declare function TrpcUpdateForm<TDef extends ResolverDef, TGetDef extends ResolverDef>(props: {
|
|
8
|
+
defaultValues?: TDef["input"];
|
|
9
9
|
mutationUpdate: DecoratedMutation<TDef>;
|
|
10
|
-
queryMethod?: DecoratedQuery<
|
|
10
|
+
queryMethod?: DecoratedQuery<TGetDef>;
|
|
11
11
|
} & Omit<ComponentProps<typeof FormInnerWithSuspenseQuery>, "onSubmit" | "queryMethod">): import("react").JSX.Element;
|
|
12
12
|
export declare function useTrpcUpdateForm<TSchema extends z.ZodType>(props: Omit<UseFormProps<TSchema['_input']>, 'resolver'> & {
|
|
13
13
|
schema?: TSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var
|
|
1
|
+
"use client";var g=Object.defineProperty,P=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var S=(e,t,o)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,c=(e,t)=>{for(var o in t||(t={}))h.call(t,o)&&S(e,o,t[o]);if(d)for(var o of d(t))b.call(t,o)&&S(e,o,t[o]);return e},F=(e,t)=>P(e,v(t));var M=(e,t)=>{var o={};for(var r in e)h.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&d)for(var r of d(e))t.indexOf(r)<0&&b.call(e,r)&&(o[r]=e[r]);return o};var p=(e,t,o)=>new Promise((r,n)=>{var l=a=>{try{m(o.next(a))}catch(u){n(u)}},s=a=>{try{m(o.throw(a))}catch(u){n(u)}},m=a=>a.done?r(a.value):Promise.resolve(a.value).then(l,s);m((o=o.apply(e,t)).next())});import{Fragment as T,jsx as i}from"react/jsx-runtime";import{atom as C,useAtom as I}from"jotai";import{Suspense as V,useCallback as k,useMemo as q}from"react";import{FormProvider as x,useForm as O,useFormContext as Q}from"react-hook-form";import{toast as U}from"sonner";import{useMtRouter as W}from"../hooks/use-router";const R=C(void 0);function ee(e){const{defaultValues:t,params:o,children:r,mutationUpdate:n,queryMethod:l}=e,s=n.useMutation(),m=k(a=>p(this,null,function*(){try{const u=yield s.mutateAsync(a);U("ok",{description:JSON.stringify(u,null,2),action:{label:"Undo",onClick:()=>console.log("Undo")}})}catch(u){U("error",{description:JSON.stringify(u,null,2),action:{label:"Undo",onClick:()=>console.log("Undo")}}),console.log("\u51FA\u9519",u)}}),[s]);return i(T,{children:!t&&l?i(V,{fallback:i(T,{children:"UpdateForm loading"}),children:i(w,{queryMethod:l,params:o,onSubmit:m,children:r})}):i(D,{defaultValues:t,onSubmit:m,children:r})})}function te(e){const[t,o]=I(R),r=Q(),n=W();return{handleSubmit:r.handleSubmit(l=>p(this,null,function*(){yield t(l),n.back()})),onCancel:()=>{n.back()},form:r}}function D(e){const{defaultValues:t,onSubmit:o,children:r}=e,n=O({defaultValues:t});return i(x,F(c({},n),{children:i("form",{onSubmit:n.handleSubmit(o),children:r})}))}function w(e){const a=e,{queryMethod:t,params:o,onSubmit:r}=a,n=M(a,["queryMethod","params","onSubmit"]),[l,s]=t.useSuspenseQuery(o),m=q(()=>{var f,y;const u=s.data;return(f=u.item)!=null&&f.value?(y=u.item)==null?void 0:y.value:s.data},[s.data]);return i(D,c({defaultValues:m,onSubmit:r},n))}export{ee as TrpcUpdateForm,te as useTrpcUpdateForm};
|
package/dist/esm/lib/blocks.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Registry } from "
|
|
1
|
+
import { Registry } from "../registry/schema";
|
|
2
2
|
export declare const blocks: Registry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Card } from "
|
|
2
|
+
import { Card } from "../../../registry/default/ui/card";
|
|
3
3
|
type CardProps = React.ComponentProps<typeof Card>;
|
|
4
4
|
export default function CardDemo({ className, ...props }: CardProps): import("react").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Slider } from "
|
|
2
|
+
import { Slider } from "../../../registry/default/ui/slider";
|
|
3
3
|
type SliderProps = React.ComponentProps<typeof Slider>;
|
|
4
4
|
export default function SliderDemo({ className, ...props }: SliderProps): import("react").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -14,6 +14,6 @@ type CarouselProps = {
|
|
|
14
14
|
declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("
|
|
18
|
-
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("
|
|
17
|
+
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../../../registry/default/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../../../registry/default/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
19
|
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react/experimental" />
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { ButtonProps } from "
|
|
3
|
+
import { ButtonProps } from "../../../registry/default/ui/button";
|
|
4
4
|
declare const Pagination: {
|
|
5
5
|
({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
6
6
|
displayName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ToastActionElement, ToastProps } from "
|
|
2
|
+
import type { ToastActionElement, ToastProps } from "../../../registry/default/ui/toast";
|
|
3
3
|
type ToasterToast = ToastProps & {
|
|
4
4
|
id: string;
|
|
5
5
|
title?: React.ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Registry } from "
|
|
1
|
+
import { Registry } from "../registry/schema";
|
|
2
2
|
export declare const examples: Registry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Card } from "
|
|
2
|
+
import { Card } from "../../../registry/new-york/ui/card";
|
|
3
3
|
type CardProps = React.ComponentProps<typeof Card>;
|
|
4
4
|
export default function CardDemo({ className, ...props }: CardProps): import("react").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Slider } from "
|
|
2
|
+
import { Slider } from "../../../registry/new-york/ui/slider";
|
|
3
3
|
type SliderProps = React.ComponentProps<typeof Slider>;
|
|
4
4
|
export default function SliderDemo({ className, ...props }: SliderProps): import("react").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -14,6 +14,6 @@ type CarouselProps = {
|
|
|
14
14
|
declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("
|
|
18
|
-
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("
|
|
17
|
+
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../../../registry/new-york/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../../../registry/new-york/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
19
|
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react/experimental" />
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { ButtonProps } from "
|
|
3
|
+
import { ButtonProps } from "../../../registry/new-york/ui/button";
|
|
4
4
|
declare const Pagination: {
|
|
5
5
|
({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
6
6
|
displayName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ToastActionElement, ToastProps } from "
|
|
2
|
+
import type { ToastActionElement, ToastProps } from "../../../registry/new-york/ui/toast";
|
|
3
3
|
type ToasterToast = ToastProps & {
|
|
4
4
|
id: string;
|
|
5
5
|
title?: React.ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Registry } from "
|
|
1
|
+
import { Registry } from "../registry/schema";
|
|
2
2
|
export declare const registry: Registry;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Registry } from "
|
|
1
|
+
import { Registry } from "../registry/schema";
|
|
2
2
|
export declare const ui: Registry;
|
|
@@ -7,7 +7,7 @@ export namespace output {
|
|
|
7
7
|
let filename: string;
|
|
8
8
|
let chunkFilename: string;
|
|
9
9
|
}
|
|
10
|
-
export let plugins: import("webpack").BannerPlugin[];
|
|
10
|
+
export let plugins: import("../../../webpack").BannerPlugin[];
|
|
11
11
|
export namespace resolve {
|
|
12
12
|
let extensions: string[];
|
|
13
13
|
let alias: any;
|