@acvl/frontend-components 0.0.46 → 0.0.48

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 (84) 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/v1/buttons/SaveCancelButton/SaveCancelButton.d.ts +3 -3
  4. package/dist/cjs/types/src/components/v1/cards/ModuleCard/ModuleCard.d.ts +0 -1
  5. package/dist/cjs/types/src/components/v1/datagrids/custom_slots/CustomToolbar/slots/FiltersButton/index.d.ts +1 -1
  6. package/dist/cjs/types/src/components/v1/datagrids/custom_slots/CustomToolbar/slots/FiltersButton/utils.d.ts +1 -1
  7. package/dist/cjs/types/src/components/v1/datagrids/custom_slots/index.d.ts +2 -1
  8. package/dist/cjs/types/src/components/v1/datagrids/filter_inputs/TrueFalse.d.ts +1 -1
  9. package/dist/cjs/types/src/components/v1/datagrids/wrappers/CreateGridWrapper.d.ts +2 -0
  10. package/dist/cjs/types/src/components/v1/datagrids/wrappers/EditGridWrapper.d.ts +1 -1
  11. package/dist/cjs/types/src/components/v1/forms/CSVUpload/index.d.ts +1 -1
  12. package/dist/cjs/types/src/components/v1/icons/ActiveIcon.d.ts +6 -0
  13. package/dist/cjs/types/src/components/v1/icons/index.d.ts +1 -0
  14. package/dist/cjs/types/src/components/v1/index.d.ts +1 -0
  15. package/dist/cjs/types/src/components/v1/inputs/controlled/ControlledDropdown/index.d.ts +1 -1
  16. package/dist/cjs/types/src/components/v1/inputs/controlled/ControlledSelect/index.d.ts +1 -1
  17. package/dist/cjs/types/src/components/v1/inputs/controlled/CrudDropdown/index.d.ts +1 -1
  18. package/dist/cjs/types/src/components/v1/layout/layouts/ContentLayout/index.d.ts +1 -1
  19. package/dist/cjs/types/src/components/v1/layout/pages/CoverPage/index.d.ts +1 -1
  20. package/dist/cjs/types/src/components/v1/layout/pages/DetailPage/Field/index.d.ts +1 -1
  21. package/dist/cjs/types/src/components/v1/layout/pages/DetailPage/FieldArrayField/index.d.ts +3 -3
  22. package/dist/cjs/types/src/components/v1/layout/pages/DetailPage/Section/index.d.ts +1 -1
  23. package/dist/cjs/types/src/components/v1/layout/pages/DetailPage/index.d.ts +1 -1
  24. package/dist/cjs/types/src/components/v1/layout/pages/ListPage/index.d.ts +1 -1
  25. package/dist/cjs/types/src/components/v1/layout/shared/Tabs/index.d.ts +1 -1
  26. package/dist/cjs/types/src/components/v2/index.d.ts +1 -0
  27. package/dist/cjs/types/src/components/v2/inputs/controlled/ControlledAddressAutocomplete/index.d.ts +46 -0
  28. package/dist/cjs/types/src/components/v2/inputs/controlled/ControlledAmountWithCurrency/index.d.ts +49 -0
  29. package/dist/cjs/types/src/components/v2/inputs/controlled/index.d.ts +3 -0
  30. package/dist/cjs/types/src/components/v2/inputs/index.d.ts +1 -0
  31. package/dist/cjs/types/src/components/v2/layout/index.d.ts +1 -0
  32. package/dist/cjs/types/src/components/v2/layout/layouts/MainLayout/PageHeader.d.ts +24 -0
  33. package/dist/cjs/types/src/components/v2/layout/layouts/MainLayout/ProgressStatus.d.ts +10 -0
  34. package/dist/cjs/types/src/components/v2/layout/layouts/MainLayout/SidebarFooter.d.ts +12 -0
  35. package/dist/cjs/types/src/components/v2/layout/layouts/MainLayout/index.d.ts +60 -0
  36. package/dist/cjs/types/src/components/v2/layout/layouts/index.d.ts +5 -0
  37. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Field/index.d.ts +5 -1
  38. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Section/index.d.ts +2 -2
  39. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/Subsection/index.d.ts +6 -2
  40. package/dist/cjs/types/src/components/v2/layout/pages/DetailPage/index.d.ts +5 -2
  41. package/dist/cjs/types/src/components/v2/lib/hooks/useMutationHandler.d.ts +1 -1
  42. package/dist/esm/index.js +1 -1
  43. package/dist/esm/index.js.map +1 -1
  44. package/dist/esm/types/src/components/v1/buttons/SaveCancelButton/SaveCancelButton.d.ts +3 -3
  45. package/dist/esm/types/src/components/v1/cards/ModuleCard/ModuleCard.d.ts +0 -1
  46. package/dist/esm/types/src/components/v1/datagrids/custom_slots/CustomToolbar/slots/FiltersButton/index.d.ts +1 -1
  47. package/dist/esm/types/src/components/v1/datagrids/custom_slots/CustomToolbar/slots/FiltersButton/utils.d.ts +1 -1
  48. package/dist/esm/types/src/components/v1/datagrids/custom_slots/index.d.ts +2 -1
  49. package/dist/esm/types/src/components/v1/datagrids/filter_inputs/TrueFalse.d.ts +1 -1
  50. package/dist/esm/types/src/components/v1/datagrids/wrappers/CreateGridWrapper.d.ts +2 -0
  51. package/dist/esm/types/src/components/v1/datagrids/wrappers/EditGridWrapper.d.ts +1 -1
  52. package/dist/esm/types/src/components/v1/forms/CSVUpload/index.d.ts +1 -1
  53. package/dist/esm/types/src/components/v1/icons/ActiveIcon.d.ts +6 -0
  54. package/dist/esm/types/src/components/v1/icons/index.d.ts +1 -0
  55. package/dist/esm/types/src/components/v1/index.d.ts +1 -0
  56. package/dist/esm/types/src/components/v1/inputs/controlled/ControlledDropdown/index.d.ts +1 -1
  57. package/dist/esm/types/src/components/v1/inputs/controlled/ControlledSelect/index.d.ts +1 -1
  58. package/dist/esm/types/src/components/v1/inputs/controlled/CrudDropdown/index.d.ts +1 -1
  59. package/dist/esm/types/src/components/v1/layout/layouts/ContentLayout/index.d.ts +1 -1
  60. package/dist/esm/types/src/components/v1/layout/pages/CoverPage/index.d.ts +1 -1
  61. package/dist/esm/types/src/components/v1/layout/pages/DetailPage/Field/index.d.ts +1 -1
  62. package/dist/esm/types/src/components/v1/layout/pages/DetailPage/FieldArrayField/index.d.ts +3 -3
  63. package/dist/esm/types/src/components/v1/layout/pages/DetailPage/Section/index.d.ts +1 -1
  64. package/dist/esm/types/src/components/v1/layout/pages/DetailPage/index.d.ts +1 -1
  65. package/dist/esm/types/src/components/v1/layout/pages/ListPage/index.d.ts +1 -1
  66. package/dist/esm/types/src/components/v1/layout/shared/Tabs/index.d.ts +1 -1
  67. package/dist/esm/types/src/components/v2/index.d.ts +1 -0
  68. package/dist/esm/types/src/components/v2/inputs/controlled/ControlledAddressAutocomplete/index.d.ts +46 -0
  69. package/dist/esm/types/src/components/v2/inputs/controlled/ControlledAmountWithCurrency/index.d.ts +49 -0
  70. package/dist/esm/types/src/components/v2/inputs/controlled/index.d.ts +3 -0
  71. package/dist/esm/types/src/components/v2/inputs/index.d.ts +1 -0
  72. package/dist/esm/types/src/components/v2/layout/index.d.ts +1 -0
  73. package/dist/esm/types/src/components/v2/layout/layouts/MainLayout/PageHeader.d.ts +24 -0
  74. package/dist/esm/types/src/components/v2/layout/layouts/MainLayout/ProgressStatus.d.ts +10 -0
  75. package/dist/esm/types/src/components/v2/layout/layouts/MainLayout/SidebarFooter.d.ts +12 -0
  76. package/dist/esm/types/src/components/v2/layout/layouts/MainLayout/index.d.ts +60 -0
  77. package/dist/esm/types/src/components/v2/layout/layouts/index.d.ts +5 -0
  78. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Field/index.d.ts +5 -1
  79. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Section/index.d.ts +2 -2
  80. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/Subsection/index.d.ts +6 -2
  81. package/dist/esm/types/src/components/v2/layout/pages/DetailPage/index.d.ts +5 -2
  82. package/dist/esm/types/src/components/v2/lib/hooks/useMutationHandler.d.ts +1 -1
  83. package/dist/index.d.ts +220 -11
  84. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { ButtonGroupProps, ButtonProps } from "@mui/material";
1
+ import { ButtonGroupProps, IconButtonProps } from "@mui/material";
2
2
  export interface SaveCancelButtonProps {
3
3
  slotProps?: {
4
4
  buttonGroup?: Partial<ButtonGroupProps>;
5
- saveBtn?: Partial<ButtonProps>;
6
- cancelBtn?: Partial<ButtonProps>;
5
+ saveBtn?: Partial<IconButtonProps>;
6
+ cancelBtn?: Partial<IconButtonProps>;
7
7
  };
8
8
  }
9
9
  declare const SaveCancelButton: (props: SaveCancelButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,6 @@ import React, { ReactNode } from "react";
2
2
  export interface CoverPageCardProps {
3
3
  title: string;
4
4
  description?: string;
5
- permission: string;
6
5
  url: string;
7
6
  icon: ReactNode;
8
7
  }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { MyGridFilterModel } from "../../../../types";
2
+ import { MyGridFilterModel } from "@v1/datagrids/types";
3
3
  export interface FiltersButtonProps {
4
4
  filters: {
5
5
  filterModel: MyGridFilterModel;
@@ -1,2 +1,2 @@
1
- import { GridColDefPropsOverrides } from '../../../../types';
1
+ import { GridColDefPropsOverrides } from '@v1/datagrids/types';
2
2
  export declare const generateSchema: (columns: GridColDefPropsOverrides[], columnsFilter?: string, id?: any) => any[];
@@ -1 +1,2 @@
1
- export { default as ExportCSV } from './CustomToolbar/slots/ExportButton/ExportCSV';
1
+ export { default as ExportCSV } from "./CustomToolbar/slots/ExportButton/ExportCSV";
2
+ export { default as CustomNoRows } from "./CustomNoRows";
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- import { BaseControlledFieldProps } from "../../inputs/controlled/types";
2
+ import { BaseControlledFieldProps } from "@v1/inputs/controlled/types";
3
3
  declare const TrueFalse: React.FC<BaseControlledFieldProps>;
4
4
  export default TrueFalse;
@@ -1,5 +1,6 @@
1
1
  import { JSX } from "react";
2
2
  import { MyDataGridProps } from "../types";
3
+ import { NavigateOptions } from "react-router-dom";
3
4
  export interface CSVMenuOptionProps {
4
5
  endpoint: string;
5
6
  title?: string;
@@ -17,6 +18,7 @@ export interface CreateGridAPIProps {
17
18
  enable: boolean;
18
19
  extraOptions?: CSVMenuOptionProps[];
19
20
  };
21
+ navigationOptions?: NavigateOptions;
20
22
  }
21
23
  export interface CreateGridWrapperProps extends CreateGridAPIProps {
22
24
  permission: boolean;
@@ -1,6 +1,6 @@
1
1
  import { JSX, RefObject } from "react";
2
2
  import { GridApi } from "@mui/x-data-grid";
3
- import { JSONParserProps } from "../../forms";
3
+ import { JSONParserProps } from "@v1/forms";
4
4
  import { GridColDefPropsOverrides } from "../types";
5
5
  import { BaseGridProps } from "../Base";
6
6
  import { EditGridColumnsProps } from "../columns";
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { CSVMenuOptionProps } from "../../buttons/CreateButton/CreateButtonWithMenuOptions";
2
+ import { CSVMenuOptionProps } from "@v1/buttons/CreateButton/CreateButtonWithMenuOptions";
3
3
  interface CSVUploadProps {
4
4
  postAction?: (response: any) => void;
5
5
  open: boolean;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface ActiveIconProps {
3
+ value?: boolean;
4
+ }
5
+ declare const ActiveIcon: React.FC<ActiveIconProps>;
6
+ export default ActiveIcon;
@@ -0,0 +1 @@
1
+ export { default as ActiveIcon } from './ActiveIcon';
@@ -3,6 +3,7 @@ export * from './badges';
3
3
  export * from './cards';
4
4
  export * from './datagrids';
5
5
  export * from './forms';
6
+ export * from './icons';
6
7
  export * from './inputs';
7
8
  export * from './layout';
8
9
  export * from './lib';
@@ -1,7 +1,7 @@
1
1
  import { AutocompleteProps } from "@mui/material";
2
2
  import React from "react";
3
3
  import { BaseControlledFieldProps } from "../types";
4
- import { ComoOpcionesProps } from "../../../types";
4
+ import { ComoOpcionesProps } from "@v1/types";
5
5
  export interface ControlledDropdownProps extends BaseControlledFieldProps {
6
6
  fieldProps?: Partial<AutocompleteProps<any, any, any, any>>;
7
7
  extraProps: {
@@ -1,6 +1,6 @@
1
1
  import { AutocompleteProps } from "@mui/material";
2
2
  import React from "react";
3
- import { ComoOpcionesProps } from "../../../types";
3
+ import { ComoOpcionesProps } from "@v1/types";
4
4
  import { BaseControlledFieldProps } from "../types";
5
5
  interface ControlledSelectProps extends BaseControlledFieldProps {
6
6
  fieldProps?: Partial<AutocompleteProps<any, any, any, any>>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { AutocompleteProps } from "@mui/material";
3
- import { ComoOpcionesProps } from "../../../types";
3
+ import { ComoOpcionesProps } from "@v1/types";
4
4
  export interface CrudDropdownProps {
5
5
  name: string;
6
6
  label?: string;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- export default function ContentLayout({ children, button, badge }: {
2
+ export default function ContentLayout({ children, button, badge, }: {
3
3
  children: ReactNode;
4
4
  button: ReactNode;
5
5
  badge?: ReactNode;
@@ -2,7 +2,7 @@ import React, { ReactNode } from "react";
2
2
  export interface CoverPageCardProps {
3
3
  title: string;
4
4
  description?: string;
5
- permission: string;
5
+ permission: string | boolean;
6
6
  url: string;
7
7
  icon: ReactNode;
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import { GridProps } from "@mui/material";
2
- import { PageType } from "../../../../types";
2
+ import { PageType } from "@v1/types";
3
3
  import { FieldFilter } from "../types";
4
4
  export interface FieldProps {
5
5
  data?: any;
@@ -1,9 +1,9 @@
1
1
  import { DataGridProps } from "@mui/x-data-grid";
2
2
  import { GridProps } from "@mui/material";
3
- import { PageType } from "../../../../types";
4
- import { JSONParserProps } from "../../../../forms";
3
+ import { PageType } from "@v1/types";
4
+ import { JSONParserProps } from "@v1/forms";
5
5
  import { FieldProps } from "../Field";
6
- import { MainDrawerProps } from "../../../../drawers/MainDrawer";
6
+ import { MainDrawerProps } from "@v1/drawers/MainDrawer";
7
7
  declare module "@mui/x-data-grid" {
8
8
  interface ToolbarPropsOverrides {
9
9
  handleClick: () => void;
@@ -2,7 +2,7 @@ import { FieldProps } from "../Field";
2
2
  import { ArrayFieldProps } from "../FieldArrayField";
3
3
  import { ReactNode } from "react";
4
4
  import { FieldValidationProps, EditReadOnlyFields } from "../types";
5
- import { PageType } from "../../../../types";
5
+ import { PageType } from "@v1/types";
6
6
  export interface SectionProps {
7
7
  display?: boolean | FieldValidationProps | FieldValidationProps[];
8
8
  data?: any;
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps } from "@mui/material";
2
2
  import { ReactNode, RefObject } from "react";
3
3
  import { SectionProps } from "./Section";
4
- import { PageType } from "../../../types";
4
+ import { PageType } from "@v1/types";
5
5
  export interface DetailPageProps {
6
6
  object: {
7
7
  name: string;
@@ -1,4 +1,4 @@
1
- import { MyTabProps } from "../../shared";
1
+ import { MyTabProps } from "@v1/layout/shared";
2
2
  import { ReactNode } from "react";
3
3
  export interface ListPageProps {
4
4
  tabs?: MyTabProps;
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import { BoxProps } from "@mui/material";
3
- import { PageType } from "../../../types";
3
+ import { PageType } from "@v1/types";
4
4
  export interface MyTab {
5
5
  value: string;
6
6
  label: string;
@@ -1,2 +1,3 @@
1
+ export * from "./inputs";
1
2
  export * from "./layout";
2
3
  export * from "./lib";
@@ -0,0 +1,46 @@
1
+ import { type TextFieldProps } from "@mui/material";
2
+ /**
3
+ * Forma JSON que se guarda en el formulario / se envía al backend.
4
+ * Para direcciones escritas a mano solo viene `formatted_address`.
5
+ */
6
+ export interface AddressValue {
7
+ formatted_address: string;
8
+ place_id?: string | null;
9
+ lat?: number | null;
10
+ lng?: number | null;
11
+ street_number?: string;
12
+ route?: string | null;
13
+ neighborhood?: string | null;
14
+ locality?: string | null;
15
+ administrative_area_level_1?: string | null;
16
+ postal_code?: string | null;
17
+ country?: string | null;
18
+ country_code?: string | null;
19
+ }
20
+ interface ControlledAddressAutocompleteProps {
21
+ name: string;
22
+ label?: string;
23
+ control: any;
24
+ fieldProps?: TextFieldProps;
25
+ extraProps?: {
26
+ /**
27
+ * API key de Google Maps. Si no se pasa, se intenta leer
28
+ * `VITE_GOOGLE_MAPS_API_KEY` de `import.meta.env`.
29
+ */
30
+ apiKey?: string;
31
+ /** Restringe los resultados a estos países, p.ej. ["mx", "us"]. */
32
+ countries?: string[];
33
+ /** Idioma de los resultados, p.ej. "es". */
34
+ language?: string;
35
+ /**
36
+ * Callback opcional con el `Place` resuelto (con addressComponents,
37
+ * location, etc.) por si la pantalla necesita autollenar otros campos.
38
+ */
39
+ onResolved?: (place: any) => void;
40
+ };
41
+ }
42
+ declare const ControlledAddressAutocomplete: {
43
+ ({ name, label, control, fieldProps, extraProps, }: ControlledAddressAutocompleteProps): import("react/jsx-runtime").JSX.Element;
44
+ displayName: string;
45
+ };
46
+ export default ControlledAddressAutocomplete;
@@ -0,0 +1,49 @@
1
+ import { type InputBaseProps } from "@mui/material";
2
+ import { type NumericFormatProps } from "react-number-format";
3
+ import { type ComoOpcionesProps } from "@v1";
4
+ /** Opción de un desplegable: `{ value, label }`. */
5
+ interface Opciones {
6
+ value: string;
7
+ label: string;
8
+ }
9
+ interface ControlledAmountWithCurrencyProps {
10
+ /** Ruta del monto en el formulario, p.ej. "valores_de_factura.subtotal". */
11
+ name: string;
12
+ /** Control de react-hook-form (lo inyecta el `EditField` de la página). */
13
+ control?: any;
14
+ fieldProps?: Partial<NumericFormatProps<InputBaseProps>>;
15
+ extraProps?: {
16
+ /**
17
+ * Ruta de la moneda en el formulario. Por defecto `${name}_moneda`,
18
+ * de modo que "valores_de_factura.subtotal" usa
19
+ * "valores_de_factura.subtotal_moneda".
20
+ */
21
+ currencyName?: string;
22
+ /** Origen de las opciones de moneda (endpoint `como_opciones`). */
23
+ queryArgs?: ComoOpcionesProps;
24
+ /** Opciones estáticas de moneda (alternativa a `queryArgs`). */
25
+ options?: Opciones[];
26
+ };
27
+ }
28
+ /**
29
+ * Campo compuesto de monto + moneda que se muestra como una sola fila con
30
+ * borde: importe alineado a la derecha y un selector de moneda compacto al
31
+ * final.
32
+ *
33
+ * Está pensado para usarse como `type` de un campo de una página de detalle.
34
+ * La etiqueta la aporta el `Field` contenedor (no el propio campo):
35
+ *
36
+ * ```ts
37
+ * {
38
+ * name: "valores_de_factura.subtotal",
39
+ * label: "Subtotal",
40
+ * type: ControlledAmountWithCurrency,
41
+ * gridProps: { size: 12 },
42
+ * }
43
+ * ```
44
+ */
45
+ declare const ControlledAmountWithCurrency: {
46
+ ({ name, control, fieldProps, extraProps, }: ControlledAmountWithCurrencyProps): import("react/jsx-runtime").JSX.Element;
47
+ displayName: string;
48
+ };
49
+ export default ControlledAmountWithCurrency;
@@ -0,0 +1,3 @@
1
+ export { default as ControlledAddressAutocomplete } from "./ControlledAddressAutocomplete";
2
+ export type { AddressValue } from "./ControlledAddressAutocomplete";
3
+ export { default as ControlledAmountWithCurrency } from "./ControlledAmountWithCurrency";
@@ -0,0 +1 @@
1
+ export * from "./controlled";
@@ -1 +1,2 @@
1
1
  export * from "./pages";
2
+ export * from "./layouts";
@@ -0,0 +1,24 @@
1
+ import { type Breadcrumb, type PageHeaderProps } from "@toolpad/core";
2
+ /**
3
+ * Encabezado por defecto del `PageContainer`: resuelve título y breadcrumbs a
4
+ * partir de `useActivePage`, con soporte para páginas "sueltas" (rutas que ya no
5
+ * viven en la navegación pero cuyo crear/editar/detalle sigue existiendo).
6
+ *
7
+ * El título se lee de `state.header.title` (slice `headerReducer` de la librería)
8
+ * cuando hay un id en la ruta; de lo contrario se deriva del título de la página.
9
+ **/
10
+ /**
11
+ * Página sin entrada en la navegación de Toolpad. Como `useActivePage` no la
12
+ * resuelve, el proyecto puede declarar aquí su título y breadcrumbs.
13
+ **/
14
+ export interface DetachedPage {
15
+ title: string;
16
+ path: string;
17
+ breadcrumbs: Breadcrumb[];
18
+ }
19
+ export interface MainLayoutPageHeaderProps extends PageHeaderProps {
20
+ fullScreen?: boolean;
21
+ detachedPages?: DetachedPage[];
22
+ documentTitleSuffix?: string;
23
+ }
24
+ export default function PageHeader(props: MainLayoutPageHeaderProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Contenido por defecto de cada snack dentro de `ObjectProgressStack`.
3
+ * Muestra una barra de progreso (determinada si `progress` viene definido,
4
+ * indeterminada en caso contrario) y el porcentaje.
5
+ **/
6
+ export interface ProgressStatusProps {
7
+ progress?: number;
8
+ }
9
+ declare const ProgressStatus: (props: ProgressStatusProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default ProgressStatus;
@@ -0,0 +1,12 @@
1
+ import type { SidebarFooterProps } from "@toolpad/core/DashboardLayout";
2
+ /**
3
+ * Pie por defecto del sidebar: versión del sistema y aviso de copyright.
4
+ * La versión y el texto de copyright se reciben por props porque dependen
5
+ * del proyecto que consume el layout (no se leen de `import.meta.env` aquí).
6
+ **/
7
+ export interface MainLayoutSidebarFooterProps extends SidebarFooterProps {
8
+ version?: string;
9
+ copyright?: string;
10
+ }
11
+ declare const SidebarFooter: ({ mini, version, copyright }: MainLayoutSidebarFooterProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default SidebarFooter;
@@ -0,0 +1,60 @@
1
+ import { type ElementType, type JSXElementConstructor, type ReactNode } from "react";
2
+ import { type Authentication, type Branding, type DashboardHeaderProps, type Navigation, type Session } from "@toolpad/core";
3
+ import type { SidebarFooterProps } from "@toolpad/core/DashboardLayout";
4
+ import type { Theme } from "@mui/material/styles";
5
+ import { type DetachedPage } from "./PageHeader";
6
+ /**
7
+ * Cascarón de la aplicación construido sobre Toolpad: barra superior, menú de
8
+ * navegación, alertas, tema y el `PageContainer` que renderiza el `Outlet`.
9
+ *
10
+ * Todo lo específico del proyecto (navegación, branding, sesión, autenticación,
11
+ * páginas sueltas, slots del header) se recibe por props. Reutiliza la
12
+ * infraestructura de la librería: `theme`, `ObjectProgressStack` y el slice
13
+ * `header` (leído por el `PageHeader` por defecto).
14
+ *
15
+ * Atajo Shift+F: alterna pantalla completa (oculta navegación y encabezados).
16
+ **/
17
+ export interface MainLayoutProps {
18
+ /** Definición de navegación de Toolpad (items del sidebar). */
19
+ navigation: Navigation;
20
+ /** Branding de Toolpad (logo, título, homeUrl). */
21
+ branding?: Branding | null;
22
+ /** Sesión activa; se pasa tal cual al `AppProvider`. */
23
+ session?: Session | null;
24
+ /** Handlers de inicio/cierre de sesión. */
25
+ authentication?: Authentication;
26
+ /** Tema MUI ya construido. Por defecto el tema de la librería. */
27
+ theme?: Theme;
28
+ /** Páginas fuera de la navegación cuyo título/breadcrumbs debe resolver el `PageHeader`. */
29
+ detachedPages?: DetachedPage[];
30
+ /** Sufijo del `document.title` (ej. "Embarques" => "Título | Embarques"). */
31
+ documentTitleSuffix?: string;
32
+ /** Configuración del pie del sidebar por defecto. */
33
+ footer?: {
34
+ version?: string;
35
+ copyright?: string;
36
+ };
37
+ /** Ancho del sidebar expandido. */
38
+ sidebarExpandedWidth?: number;
39
+ /**
40
+ * Color de fondo del área de contenido. Se aplica al scroll container
41
+ * (`<main>`) para que cubra toda la altura scrolleable y no se corte cuando
42
+ * la página es más larga que el viewport.
43
+ */
44
+ pageBackgroundColor?: string;
45
+ /** Overrides de slots del layout. */
46
+ slots?: {
47
+ /** Barra superior del dashboard. Por defecto la de Toolpad. */
48
+ header?: JSXElementConstructor<DashboardHeaderProps>;
49
+ /** Pie del sidebar. Por defecto muestra versión y copyright. */
50
+ sidebarFooter?: ElementType<SidebarFooterProps>;
51
+ /** Encabezado de página. Por defecto resuelve título/breadcrumbs. */
52
+ pageHeader?: ElementType;
53
+ /** Contenido de cada snack de progreso. Por defecto una barra de progreso. */
54
+ progressStatus?: (data: any) => ReactNode;
55
+ };
56
+ /** Contenido a renderizar; por defecto el `<Outlet />` del router. */
57
+ children?: ReactNode;
58
+ }
59
+ declare const MainLayout: (props: MainLayoutProps) => import("react/jsx-runtime").JSX.Element;
60
+ export default MainLayout;
@@ -0,0 +1,5 @@
1
+ export { default as MainLayout } from "./MainLayout";
2
+ export type { MainLayoutProps } from "./MainLayout";
3
+ export type { DetachedPage, MainLayoutPageHeaderProps } from "./MainLayout/PageHeader";
4
+ export type { MainLayoutSidebarFooterProps } from "./MainLayout/SidebarFooter";
5
+ export type { ProgressStatusProps } from "./MainLayout/ProgressStatus";
@@ -1,11 +1,15 @@
1
1
  import { type GridProps } from "@mui/material";
2
- import { type PageType } from "../../../../../v1";
2
+ import { type PageType } from "@v1";
3
3
  export interface FieldProps {
4
4
  pageType?: PageType;
5
5
  fieldData?: any;
6
+ /** Registro completo de la página; permite a los campos leer valores hermanos. */
7
+ data?: any;
6
8
  name: string;
7
9
  detail_name?: string;
8
10
  label: string;
11
+ /** Ubicación de la etiqueta respecto al campo. Por defecto `"top"`. */
12
+ labelPosition?: "top" | "left";
9
13
  type: any;
10
14
  gridProps?: GridProps;
11
15
  fieldProps?: object;
@@ -1,6 +1,6 @@
1
- import { type MyTab, type PageType } from "../../../../../v1";
1
+ import { type MyTab, type PageType } from "@v1";
2
2
  import type { SubsectionProps } from "../Subsection";
3
- export interface SectionProps extends Omit<MyTab, "children"> {
3
+ export interface SectionProps extends Partial<Omit<MyTab, "children">> {
4
4
  pageType?: PageType;
5
5
  display?: boolean;
6
6
  subsections: SubsectionProps[];
@@ -1,7 +1,8 @@
1
+ import { GridProps } from "@mui/material";
1
2
  import { type ReactNode } from "react";
2
- import { type PageType } from "../../../../../v1";
3
+ import { type PageType } from "@v1";
3
4
  import { type FieldProps } from "../Field";
4
- import { ArrayFieldProps } from "../../../../../v1/layout/pages/DetailPage/FieldArrayField";
5
+ import { ArrayFieldProps } from "@v1/layout/pages/DetailPage/FieldArrayField";
5
6
  export interface SubsectionProps {
6
7
  display?: boolean;
7
8
  pageType?: PageType;
@@ -10,6 +11,9 @@ export interface SubsectionProps {
10
11
  title?: string;
11
12
  description?: string;
12
13
  first?: boolean;
14
+ slotProps?: {
15
+ parentGrid?: Partial<GridProps>;
16
+ };
13
17
  fields?: FieldProps[];
14
18
  arrayFields?: ArrayFieldProps[];
15
19
  content?: (data: any) => ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import { type JSONFormProps, type PageType } from "../../../../v1";
2
+ import { type JSONFormProps, type PageType } from "@v1";
3
3
  import { type ButtonProps } from "@mui/material";
4
4
  import { type SectionProps } from "./Section";
5
5
  export interface DetailPageV2Props {
@@ -27,7 +27,10 @@ export interface DetailPageV2Props {
27
27
  pageType: PageType;
28
28
  slots?: {
29
29
  button?: ReactNode;
30
- extraButtons?: ((id: number) => ReactNode)[];
30
+ extraButtons?: {
31
+ pageType: PageType | "all";
32
+ render: (id: number) => ReactNode;
33
+ }[];
31
34
  badge?: string;
32
35
  };
33
36
  slotProps?: {
@@ -1,5 +1,5 @@
1
1
  import { type UseFormReturn } from "react-hook-form";
2
- import { type JSONFormProps } from "../../../v1";
2
+ import { type JSONFormProps } from "@v1";
3
3
  interface MutationHandlerOptions {
4
4
  mutationFn: (data: any) => {
5
5
  unwrap: () => Promise<any>;