@acvl/frontend-components 0.0.40 → 0.0.41

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.
Files changed (36) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/src/components/index.d.ts +2 -1
  4. package/dist/cjs/types/src/components/v1/layout/shared/Tabs/index.d.ts +5 -1
  5. package/dist/cjs/types/src/components/v2/index.d.ts +2 -0
  6. package/dist/cjs/types/src/components/v2/layout/index.d.ts +1 -0
  7. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Field/DetailField.d.ts +4 -0
  8. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Field/EditField.d.ts +4 -0
  9. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Field/index.d.ts +25 -0
  10. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Section/index.d.ts +13 -0
  11. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Subsection/index.d.ts +18 -0
  12. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/index.d.ts +51 -0
  13. package/dist/cjs/types/src/components/v2/layout/pages/index.d.ts +1 -0
  14. package/dist/cjs/types/src/components/v2/lib/hooks/index.d.ts +1 -0
  15. package/dist/cjs/types/src/components/v2/lib/hooks/useMutationHandler.d.ts +23 -0
  16. package/dist/cjs/types/src/components/v2/lib/index.d.ts +1 -0
  17. package/dist/cjs/types/src/index.d.ts +1 -1
  18. package/dist/esm/index.js +1 -1
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/types/src/components/index.d.ts +2 -1
  21. package/dist/esm/types/src/components/v1/layout/shared/Tabs/index.d.ts +5 -1
  22. package/dist/esm/types/src/components/v2/index.d.ts +2 -0
  23. package/dist/esm/types/src/components/v2/layout/index.d.ts +1 -0
  24. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Field/DetailField.d.ts +4 -0
  25. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Field/EditField.d.ts +4 -0
  26. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Field/index.d.ts +25 -0
  27. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Section/index.d.ts +13 -0
  28. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Subsection/index.d.ts +18 -0
  29. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/index.d.ts +51 -0
  30. package/dist/esm/types/src/components/v2/layout/pages/index.d.ts +1 -0
  31. package/dist/esm/types/src/components/v2/lib/hooks/index.d.ts +1 -0
  32. package/dist/esm/types/src/components/v2/lib/hooks/useMutationHandler.d.ts +23 -0
  33. package/dist/esm/types/src/components/v2/lib/index.d.ts +1 -0
  34. package/dist/esm/types/src/index.d.ts +1 -1
  35. package/dist/index.d.ts +127 -9
  36. package/package.json +104 -104
@@ -1 +1,2 @@
1
- export * from './v1';
1
+ export * from "./v1";
2
+ export * from "./v2";
@@ -1,4 +1,5 @@
1
1
  import React, { ReactNode } from "react";
2
+ import { BoxProps } from "@mui/material";
2
3
  import { PageType } from "../../../types";
3
4
  export interface MyTab {
4
5
  value: string;
@@ -7,10 +8,13 @@ export interface MyTab {
7
8
  children: ReactNode;
8
9
  }
9
10
  export interface MyTabProps {
10
- pathname: string;
11
11
  tabs: MyTab[];
12
12
  initialValue?: string;
13
13
  type?: PageType;
14
+ slotProps?: {
15
+ mainContainer?: BoxProps;
16
+ contentContainer?: BoxProps;
17
+ };
14
18
  }
15
19
  /**
16
20
  * Pestañas customizables
@@ -0,0 +1,2 @@
1
+ export * from "./layout";
2
+ export * from "./lib";
@@ -0,0 +1 @@
1
+ export * from "./pages";
@@ -0,0 +1,4 @@
1
+ import { type FieldProps } from "./index";
2
+ type Props = Partial<FieldProps>;
3
+ declare const DetailField: (props: Props) => import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
4
+ export default DetailField;
@@ -0,0 +1,4 @@
1
+ import { type FieldProps } from "./index";
2
+ type Props = Partial<FieldProps>;
3
+ declare const EditField: (props: Props) => any;
4
+ export default EditField;
@@ -0,0 +1,25 @@
1
+ import { type GridProps } from "@mui/material";
2
+ import { type PageType } from "../../../../../v1";
3
+ export interface FieldProps {
4
+ pageType?: PageType;
5
+ fieldData?: any;
6
+ name: string;
7
+ detail_name?: string;
8
+ label: string;
9
+ type: any;
10
+ gridProps?: GridProps;
11
+ fieldProps?: object;
12
+ extraProps?: any;
13
+ detailFieldProps?: {
14
+ preValue?: string;
15
+ postValue?: string;
16
+ };
17
+ navigation?: {
18
+ url: string;
19
+ permission: string;
20
+ };
21
+ permission?: string;
22
+ display?: boolean;
23
+ }
24
+ declare const Field: (props: FieldProps) => import("react/jsx-runtime").JSX.Element | undefined;
25
+ export default Field;
@@ -0,0 +1,13 @@
1
+ import { type MyTab, type PageType } from "../../../../../v1";
2
+ import type { SubsectionProps } from "../Subsection";
3
+ export interface SectionProps extends Omit<MyTab, "children"> {
4
+ pageType?: PageType;
5
+ display?: boolean;
6
+ subsections: SubsectionProps[];
7
+ historial?: {
8
+ endpoint?: string;
9
+ };
10
+ data?: any;
11
+ }
12
+ declare const Section: (props: SectionProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export default Section;
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from "react";
2
+ import { type PageType } from "../../../../../v1";
3
+ import { type FieldProps } from "../Field";
4
+ import { ArrayFieldProps } from "../../../../../v1/layout/pages/DetailPage/FieldArrayField";
5
+ export interface SubsectionProps {
6
+ display?: boolean;
7
+ pageType?: PageType;
8
+ data?: any;
9
+ bgColor?: string;
10
+ title?: string;
11
+ description?: string;
12
+ first?: boolean;
13
+ fields?: FieldProps[];
14
+ arrayFields?: ArrayFieldProps[];
15
+ content?: (data: any) => ReactNode;
16
+ }
17
+ declare const Subsection: (props: SubsectionProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default Subsection;
@@ -0,0 +1,51 @@
1
+ import { type ReactNode } from "react";
2
+ import { type JSONFormProps, type PageType } from "../../../../v1";
3
+ import { type ButtonProps } from "@mui/material";
4
+ import { type SectionProps } from "./Section";
5
+ export interface DetailPageV2Props {
6
+ api: {
7
+ data: {
8
+ query: any;
9
+ args?: any;
10
+ skipToken?: boolean;
11
+ };
12
+ mutate: {
13
+ mutation: any;
14
+ args?: any;
15
+ };
16
+ delete?: {
17
+ mutation: any;
18
+ };
19
+ };
20
+ form: Pick<JSONFormProps, "props" | "type" | "useLabel"> & {
21
+ schema: any;
22
+ defaultValues: {
23
+ [k: string]: any;
24
+ };
25
+ };
26
+ sections: (form: any) => SectionProps[];
27
+ pageType: PageType;
28
+ slots?: {
29
+ button?: ReactNode;
30
+ extraButtons?: ((id: number) => ReactNode)[];
31
+ badge?: string;
32
+ };
33
+ slotProps?: {
34
+ button?: {
35
+ save?: {
36
+ type: "onClick";
37
+ disableNavBack?: boolean;
38
+ onClick?: () => void;
39
+ };
40
+ cancel?: Partial<ButtonProps>;
41
+ };
42
+ historial?: {
43
+ endpoint?: string;
44
+ };
45
+ permissionsPath?: string;
46
+ deleteButton?: {
47
+ disableNavBack?: boolean;
48
+ };
49
+ };
50
+ }
51
+ export default function DetailPage(props: DetailPageV2Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default as DetailPage_v2 } from "./DetailPage";
@@ -0,0 +1 @@
1
+ export { default as useMutationHandler } from "./useMutationHandler";
@@ -0,0 +1,23 @@
1
+ import { type UseFormReturn } from "react-hook-form";
2
+ import { type JSONFormProps } from "../../../v1";
3
+ interface MutationHandlerOptions {
4
+ mutationFn: (data: any) => {
5
+ unwrap: () => Promise<any>;
6
+ };
7
+ form?: UseFormReturn<any>;
8
+ onSuccess: () => void;
9
+ onValidationError?: () => void;
10
+ successTitle?: string;
11
+ successMessage?: string;
12
+ onInvalidParams?: (error: any) => boolean;
13
+ }
14
+ declare const useMutationHandler: ({ mutationFn, form, onSuccess, onValidationError, successMessage, onInvalidParams, }: MutationHandlerOptions) => {
15
+ submit: ({ submitData, formProps, args, }: {
16
+ submitData: any;
17
+ formProps: Partial<JSONFormProps>;
18
+ args?: {
19
+ [k: string]: any;
20
+ };
21
+ }) => void;
22
+ };
23
+ export default useMutationHandler;
@@ -0,0 +1 @@
1
+ export * from "./hooks";
@@ -1 +1 @@
1
- export * from './components';
1
+ export * from "./components";