@m4l/components 9.3.9 → 9.3.10-JT220825.beta.1
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/@types/types.d.ts +9 -0
- package/components/DataGrid/contexts/DataGridContext/index.js +3 -3
- package/components/DataGrid/types.d.ts +1 -2
- package/components/DynamicFilter/types.d.ts +1 -0
- package/components/FormContainer/FormContainer.d.ts +7 -0
- package/components/FormContainer/FormContainer.js +38 -0
- package/components/FormContainer/FormContainer.styles.d.ts +2 -0
- package/components/FormContainer/FormContainer.styles.js +27 -0
- package/components/FormContainer/constants.d.ts +2 -0
- package/components/FormContainer/constants.js +8 -0
- package/components/FormContainer/index.d.ts +1 -0
- package/components/FormContainer/index.js +1 -0
- package/components/FormContainer/slots/FormContainerEnum.d.ts +5 -0
- package/components/FormContainer/slots/FormContainerEnum.js +9 -0
- package/components/FormContainer/slots/FormContainerSlots.d.ts +9 -0
- package/components/FormContainer/slots/FormContainerSlots.js +21 -0
- package/components/FormContainer/test/FormContainer.test.d.ts +1 -0
- package/components/FormContainer/types.d.ts +11 -0
- package/components/PaperForm/PaperForm.js +6 -4
- package/components/PaperForm/index.js +1 -0
- package/components/PaperForm/styles.js +31 -13
- package/components/PaperForm/types.d.ts +3 -2
- package/components/PropertyValue/PropertyValue.styles.js +1 -0
- package/components/index.d.ts +2 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +2 -1
- package/index.js +4 -2
- package/package.json +1 -1
- package/storybook/components/DataGrid/subcomponents/DataGridRender.d.ts +0 -2
- package/storybook/components/FormContainer/FormContainer.stories.d.ts +9 -0
- package/storybook/components/{paperForm → PaperForm}/PaperForm.stories.d.ts +5 -0
package/@types/types.d.ts
CHANGED
|
@@ -153,6 +153,8 @@ import { CardOwnerState, CardSlotsType } from '../components/Card/types';
|
|
|
153
153
|
import { ContainerFlowOwnerState, ContainerFlowSlotsType } from '../components/ContainerFlow/types';
|
|
154
154
|
import { NoItemPrivilegesOwnerState, NoItemPrivilegesSlotsType } from '../components/NoItemPrivileges/types';
|
|
155
155
|
import { ImageTextOwnerState, ImageTextSlotsType } from '../components/ImageText/types';
|
|
156
|
+
import { FormContainerOwnerState, FormContainerSlotsType } from '../components/FormContainer/types';
|
|
157
|
+
|
|
156
158
|
declare module '@mui/material/styles' {
|
|
157
159
|
// Define the slots in the theme
|
|
158
160
|
interface ComponentNameToClassKey {
|
|
@@ -238,6 +240,7 @@ declare module '@mui/material/styles' {
|
|
|
238
240
|
M4LNoItemPrivileges: NoItemPrivilegesSlotsType;
|
|
239
241
|
M4LSettingsLayoutBase: SettingsLayoutSlotsType;
|
|
240
242
|
M4LImageText: ImageTextSlotsType;
|
|
243
|
+
M4LFormContainer: FormContainerSlotsType;
|
|
241
244
|
}
|
|
242
245
|
interface ComponentsPropsList {
|
|
243
246
|
// Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
|
|
@@ -323,6 +326,7 @@ declare module '@mui/material/styles' {
|
|
|
323
326
|
M4LNoItemPrivileges: Partial<NoItemPrivilegesOwnerState>;
|
|
324
327
|
M4LSettingsLayoutBase: Partial<SettingsLayoutOwnerState>;
|
|
325
328
|
M4LImageText: Partial<ImageTextOwnerState>;
|
|
329
|
+
M4LFormContainer: Partial<FormContainerOwnerState>;
|
|
326
330
|
}
|
|
327
331
|
interface Components {
|
|
328
332
|
M4LDynamicFilter?: {
|
|
@@ -745,5 +749,10 @@ declare module '@mui/material/styles' {
|
|
|
745
749
|
styleOverrides?: ComponentsOverrides<Theme>['M4LImageText'];
|
|
746
750
|
variants?: ComponentsVariants['M4LImageText'];
|
|
747
751
|
};
|
|
752
|
+
M4LFormContainer?: {
|
|
753
|
+
defaultProps?: ComponentsPropsList['M4LFormContainer'];
|
|
754
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LFormContainer'];
|
|
755
|
+
variants?: ComponentsVariants['M4LFormContainer'];
|
|
756
|
+
};
|
|
748
757
|
}
|
|
749
758
|
}
|
|
@@ -166,7 +166,7 @@ function DataGridProvider(props) {
|
|
|
166
166
|
});
|
|
167
167
|
useEffect(() => {
|
|
168
168
|
const keys = new Set(columns.map((c) => c.key));
|
|
169
|
-
if (sortSettings?.sortsColumns
|
|
169
|
+
if (sortSettings?.sortsColumns) {
|
|
170
170
|
for (const sort of sortSettings.sortsColumns) {
|
|
171
171
|
if (!keys.has(sort)) {
|
|
172
172
|
throw new Error(
|
|
@@ -175,9 +175,9 @@ function DataGridProvider(props) {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
if (filterSettings?.filterColumns
|
|
178
|
+
if (filterSettings?.filterColumns) {
|
|
179
179
|
for (const filterField of filterSettings.filterColumns) {
|
|
180
|
-
if (!keys.has(filterField.name)) {
|
|
180
|
+
if (!filterField.skipColumnValidation && !keys.has(filterField.name)) {
|
|
181
181
|
throw new Error(
|
|
182
182
|
`DataGridProvider: Fields incluye "${filterField.name}", pero no existe ninguna columna con key="${filterField.name}".`
|
|
183
183
|
);
|
|
@@ -88,7 +88,6 @@ export interface SortSettings {
|
|
|
88
88
|
sortsColumns: string[];
|
|
89
89
|
sortsApplied: SortApplied[];
|
|
90
90
|
onChange: (event: SortChangeEvent) => void;
|
|
91
|
-
skipColumnValidation?: boolean;
|
|
92
91
|
}
|
|
93
92
|
/**---------------------------------------------------------------- */
|
|
94
93
|
export type FilterChangeAdd = {
|
|
@@ -102,6 +101,7 @@ export type FilterChangeEvent = FilterChangeAdd | FilterChangeOpenPopover;
|
|
|
102
101
|
interface FilterColumn {
|
|
103
102
|
name: string;
|
|
104
103
|
multiple: boolean;
|
|
104
|
+
skipColumnValidation?: boolean;
|
|
105
105
|
}
|
|
106
106
|
export type FilterApplied = {
|
|
107
107
|
columnKey: string;
|
|
@@ -111,7 +111,6 @@ export interface FilterSettings {
|
|
|
111
111
|
filterColumns: FilterColumn[];
|
|
112
112
|
filtersApplied: FilterApplied[];
|
|
113
113
|
onChange: (event: FilterChangeEvent) => void;
|
|
114
|
-
skipColumnValidation?: boolean;
|
|
115
114
|
}
|
|
116
115
|
/**--------------------Termina tipado de filtros-------------------------------------------- */
|
|
117
116
|
export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Omit<NativeDataGridProps<TRow, TSummaryRow>, 'rowKeyGetter' | 'rows' | 'columns' | 'onRowsChange' | 'selectedRows' | 'onSelectedRowsChange' | 'renderers'> {
|
|
@@ -46,6 +46,7 @@ export interface FieldBase<T extends FieldType = FieldType, TOption = any> {
|
|
|
46
46
|
defaultOperandsArray?: Maybe<FieldTypeOperandsArray<T>>;
|
|
47
47
|
selectOptions?: SelectOptions;
|
|
48
48
|
selectAsyncOptions?: SelectAsyncOptions<TOption>;
|
|
49
|
+
skipColumnValidation?: boolean;
|
|
49
50
|
}
|
|
50
51
|
export interface FieldWithSelectAsync<T extends 'selectAsync', TOption = any> extends FieldBase<T, TOption> {
|
|
51
52
|
selectAsyncOptions: SelectAsyncOptions<TOption>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FormContainerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente que contiene un formulario y un grupo de botones.
|
|
4
|
+
* @param props - Propiedades del componente.
|
|
5
|
+
* @returns Componente FormContainer.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FormContainer: (props: FormContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { R as RootStyled, F as FormContainerStyled } from "./slots/FormContainerSlots.js";
|
|
3
|
+
import { F as FORM_CONTAINER_CLASSES } from "./constants.js";
|
|
4
|
+
import React, { useMemo } from "react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { A as ActionsContainer } from "../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
7
|
+
const FormContainer = (props) => {
|
|
8
|
+
const { children, className } = props;
|
|
9
|
+
const { fields, footer } = useMemo(() => {
|
|
10
|
+
const fields2 = [];
|
|
11
|
+
let footer2 = null;
|
|
12
|
+
React.Children.forEach(children, (child) => {
|
|
13
|
+
if (React.isValidElement(child)) {
|
|
14
|
+
if (child.type === ActionsContainer) {
|
|
15
|
+
footer2 = child;
|
|
16
|
+
} else {
|
|
17
|
+
fields2.push(child);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return { fields: fields2, footer: footer2 };
|
|
22
|
+
}, [children]);
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
RootStyled,
|
|
25
|
+
{
|
|
26
|
+
role: "region",
|
|
27
|
+
"aria-label": "formContainer",
|
|
28
|
+
className: clsx(FORM_CONTAINER_CLASSES.root, className),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(FormContainerStyled, { children: fields }),
|
|
31
|
+
footer
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
FormContainer as F
|
|
38
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const formContainerStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Estilos para el contenedor principal.
|
|
4
|
+
*/
|
|
5
|
+
root: () => ({
|
|
6
|
+
display: "flex",
|
|
7
|
+
width: "100%",
|
|
8
|
+
height: "100%",
|
|
9
|
+
overflow: "auto",
|
|
10
|
+
flexDirection: "column"
|
|
11
|
+
}),
|
|
12
|
+
/**
|
|
13
|
+
* Estilos para el contenedor del formulario.
|
|
14
|
+
*/
|
|
15
|
+
formContainer: ({ theme }) => ({
|
|
16
|
+
display: "flex",
|
|
17
|
+
width: "100%",
|
|
18
|
+
flexGrow: 1,
|
|
19
|
+
overflow: "auto",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
gap: theme.vars.size.baseSpacings.sp4
|
|
22
|
+
}),
|
|
23
|
+
buttonGroup: {}
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
formContainerStyles as f
|
|
27
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { F as FormContainerSlots } from "./slots/FormContainerEnum.js";
|
|
3
|
+
const FORM_CONTAINER_COMPONENT_KEY = "M4LFormContainer";
|
|
4
|
+
const FORM_CONTAINER_CLASSES = getComponentClasses(FORM_CONTAINER_COMPONENT_KEY, FormContainerSlots);
|
|
5
|
+
export {
|
|
6
|
+
FORM_CONTAINER_CLASSES as F,
|
|
7
|
+
FORM_CONTAINER_COMPONENT_KEY as a
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormContainer } from './FormContainer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var FormContainerSlots = /* @__PURE__ */ ((FormContainerSlots2) => {
|
|
2
|
+
FormContainerSlots2["root"] = "root";
|
|
3
|
+
FormContainerSlots2["formContainer"] = "formContainer";
|
|
4
|
+
FormContainerSlots2["buttonGroup"] = "buttonGroup";
|
|
5
|
+
return FormContainerSlots2;
|
|
6
|
+
})(FormContainerSlots || {});
|
|
7
|
+
export {
|
|
8
|
+
FormContainerSlots as F
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: (Partial<import('../types').FormContainerOwnerState> & Record<string, unknown>) | undefined;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const FormContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('../types').FormContainerOwnerState> & Record<string, unknown>) | undefined;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
7
|
+
export declare const ButtonGroupStyled: import('@emotion/styled').StyledComponent<Pick<import('../../CommonActions/components/ActionsContainer').ActionsContainerProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../CommonActions/components/ActionsContainer').ActionsContainerProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState?: (Partial<import('../types').FormContainerOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import { a as FORM_CONTAINER_COMPONENT_KEY } from "../constants.js";
|
|
3
|
+
import { F as FormContainerSlots } from "./FormContainerEnum.js";
|
|
4
|
+
import { f as formContainerStyles } from "../FormContainer.styles.js";
|
|
5
|
+
import { A as ActionsContainer } from "../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
6
|
+
const RootStyled = styled("div", {
|
|
7
|
+
name: FORM_CONTAINER_COMPONENT_KEY,
|
|
8
|
+
slot: FormContainerSlots.root
|
|
9
|
+
})(formContainerStyles?.root);
|
|
10
|
+
const FormContainerStyled = styled("div", {
|
|
11
|
+
name: FORM_CONTAINER_COMPONENT_KEY,
|
|
12
|
+
slot: FormContainerSlots.formContainer
|
|
13
|
+
})(formContainerStyles?.formContainer);
|
|
14
|
+
styled(ActionsContainer, {
|
|
15
|
+
name: FORM_CONTAINER_COMPONENT_KEY,
|
|
16
|
+
slot: FormContainerSlots.buttonGroup
|
|
17
|
+
})(formContainerStyles?.buttonGroup);
|
|
18
|
+
export {
|
|
19
|
+
FormContainerStyled as F,
|
|
20
|
+
RootStyled as R
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
2
|
+
import { FormContainerSlots } from './slots/FormContainerEnum';
|
|
3
|
+
import { FORM_CONTAINER_COMPONENT_KEY } from './constants';
|
|
4
|
+
import { Theme } from '@mui/material/styles';
|
|
5
|
+
export interface FormContainerProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export type FormContainerOwnerState = {};
|
|
10
|
+
export type FormContainerSlotsType = keyof typeof FormContainerSlots;
|
|
11
|
+
export type FormContainerStyles = M4LOverridesStyleRules<FormContainerSlotsType, typeof FORM_CONTAINER_COMPONENT_KEY, Theme>;
|
|
@@ -24,7 +24,8 @@ function PaperForm(props) {
|
|
|
24
24
|
color = "default",
|
|
25
25
|
size = "medium",
|
|
26
26
|
isForm = false,
|
|
27
|
-
variant = "standard"
|
|
27
|
+
variant = "standard",
|
|
28
|
+
height = "auto"
|
|
28
29
|
} = props;
|
|
29
30
|
const { currentSize } = useComponentSize(size);
|
|
30
31
|
const paperFormRef = useRef(null);
|
|
@@ -33,7 +34,8 @@ function PaperForm(props) {
|
|
|
33
34
|
size: currentSize,
|
|
34
35
|
color,
|
|
35
36
|
isForm,
|
|
36
|
-
paperFormVariant: variant
|
|
37
|
+
paperFormVariant: variant,
|
|
38
|
+
height
|
|
37
39
|
};
|
|
38
40
|
return /* @__PURE__ */ jsxs(
|
|
39
41
|
PaperFormRootStyled,
|
|
@@ -43,8 +45,8 @@ function PaperForm(props) {
|
|
|
43
45
|
ownerState: { ...ownerState },
|
|
44
46
|
...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {},
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
|
|
47
|
-
/* @__PURE__ */ jsx(ContentStyled, { ownerState: {
|
|
48
|
+
variant !== "text" && /* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
|
|
49
|
+
/* @__PURE__ */ jsx(ContentStyled, { ownerState: { ...ownerState }, children: renderChildren(children) })
|
|
48
50
|
]
|
|
49
51
|
}
|
|
50
52
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
2
|
const paperFormStyles = {
|
|
3
3
|
/**
|
|
4
4
|
*************************************************************
|
|
@@ -6,14 +6,26 @@ const paperFormStyles = {
|
|
|
6
6
|
* @param theme
|
|
7
7
|
***********************************************************
|
|
8
8
|
*/
|
|
9
|
-
paperFormRoot: ({ theme }) => ({
|
|
10
|
-
borderRadius: theme.size.borderRadius.r1,
|
|
9
|
+
paperFormRoot: ({ theme, ownerState }) => ({
|
|
11
10
|
background: theme.vars.palette.background.default,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
...ownerState?.paperFormVariant !== "text" && {
|
|
12
|
+
borderRadius: theme.size.borderRadius.r1,
|
|
13
|
+
border: `${theme.size.borderStroke.container}`,
|
|
14
|
+
borderColor: theme.vars.palette.border.default
|
|
15
|
+
},
|
|
15
16
|
width: "100%",
|
|
16
|
-
|
|
17
|
+
overflow: "auto",
|
|
18
|
+
...ownerState?.height === "full" && {
|
|
19
|
+
flexGrow: 1,
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
flexShrink: 1,
|
|
23
|
+
minHeight: "200px"
|
|
24
|
+
},
|
|
25
|
+
...ownerState?.height === "auto" && {
|
|
26
|
+
height: "auto",
|
|
27
|
+
flexShrink: 0
|
|
28
|
+
},
|
|
17
29
|
container: "container / inline-size"
|
|
18
30
|
}),
|
|
19
31
|
/**
|
|
@@ -32,10 +44,14 @@ const paperFormStyles = {
|
|
|
32
44
|
borderRadius: `${theme.vars.size.borderRadius.r1} ${theme.vars.size.borderRadius.r1} 0 0`,
|
|
33
45
|
background: theme.vars.palette[ownerState?.color ?? "default"].hoverOpacity,
|
|
34
46
|
alignSelf: "stretch",
|
|
35
|
-
...
|
|
36
|
-
theme
|
|
47
|
+
...getSizeStyles(
|
|
48
|
+
theme,
|
|
37
49
|
ownerState?.size || "medium",
|
|
38
|
-
"container"
|
|
50
|
+
"container",
|
|
51
|
+
(size) => ({
|
|
52
|
+
height: size,
|
|
53
|
+
minHeight: size
|
|
54
|
+
})
|
|
39
55
|
)
|
|
40
56
|
}),
|
|
41
57
|
/**
|
|
@@ -67,15 +83,17 @@ const paperFormStyles = {
|
|
|
67
83
|
*/
|
|
68
84
|
containerContent: ({ theme, ownerState }) => ({
|
|
69
85
|
width: "100%",
|
|
70
|
-
height: "auto",
|
|
86
|
+
height: ownerState?.height === "full" ? "100%" : "auto",
|
|
71
87
|
display: "flex",
|
|
72
88
|
flexDirection: ownerState?.isForm ? "row" : "column",
|
|
73
89
|
alignItems: ownerState?.isForm ? "flex-start" : "center",
|
|
74
90
|
justifyContent: ownerState?.isForm ? "flex-start" : "center",
|
|
75
91
|
gap: ownerState?.isForm ? theme.vars.size.baseSpacings.sp3 : theme.vars.size.baseSpacings.sp0,
|
|
76
92
|
flexWrap: ownerState?.isForm ? "wrap" : "nowrap",
|
|
77
|
-
padding: theme.vars.size.baseSpacings.sp3,
|
|
78
|
-
background: theme.vars.palette.background.default
|
|
93
|
+
padding: ownerState?.paperFormVariant === "text" ? "0px" : theme.vars.size.baseSpacings.sp3,
|
|
94
|
+
background: theme.vars.palette.background.default,
|
|
95
|
+
flex: 1,
|
|
96
|
+
overflow: "auto"
|
|
79
97
|
})
|
|
80
98
|
};
|
|
81
99
|
export {
|
|
@@ -9,11 +9,12 @@ export interface PaperFormProps {
|
|
|
9
9
|
urlIcon?: string;
|
|
10
10
|
title: string;
|
|
11
11
|
children?: ReactNode | PropertyValueProps[];
|
|
12
|
-
variant?: 'standard';
|
|
12
|
+
variant?: 'standard' | 'text';
|
|
13
13
|
color?: Extract<ComponentPalletColor, 'default'>;
|
|
14
14
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
15
15
|
isForm?: boolean;
|
|
16
16
|
dataTestId?: string;
|
|
17
|
+
height?: 'auto' | 'full';
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* ***************************************
|
|
@@ -25,7 +26,7 @@ interface CommonsProps {
|
|
|
25
26
|
paperFormVariant?: PaperFormProps['variant'];
|
|
26
27
|
}
|
|
27
28
|
export type HeaderProps = Omit<PaperFormProps, 'children' | 'isForm' | 'variant'> & CommonsProps;
|
|
28
|
-
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size'> & CommonsProps;
|
|
29
|
+
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size' | 'height'> & CommonsProps;
|
|
29
30
|
/**
|
|
30
31
|
* ***********************************
|
|
31
32
|
* Slots para los estilos utilizados
|
|
@@ -48,6 +48,7 @@ const propertyValueStyles = {
|
|
|
48
48
|
alignItems: "center",
|
|
49
49
|
gap: theme.vars.size.baseSpacings["sp1"],
|
|
50
50
|
width: ownerState?.semanticWidth ? "auto" : "200px",
|
|
51
|
+
height: ownerState?.valueHeight ? ownerState?.valueHeight : "auto",
|
|
51
52
|
overflow: "hidden",
|
|
52
53
|
color: theme.vars.palette.text.primary,
|
|
53
54
|
paddingTop: !ownerState?.isForm ? theme.vars.size.baseSpacings.sp1 : void 0,
|
package/components/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './mui_extended';
|
|
|
18
18
|
export * from './formatters';
|
|
19
19
|
export * from './formatters/dictionary';
|
|
20
20
|
export * from './formatters/types';
|
|
21
|
+
export * from './FormContainer';
|
|
21
22
|
export * from './GridLayout';
|
|
22
23
|
export * from './HelmetPage';
|
|
23
24
|
export * from './HelperError';
|
|
@@ -36,7 +37,7 @@ export * from './ImageText';
|
|
|
36
37
|
export * from './NoItemSelected';
|
|
37
38
|
export * from './NoItemPrivileges';
|
|
38
39
|
export * from './ObjectLogs';
|
|
39
|
-
export * from './PaperForm
|
|
40
|
+
export * from './PaperForm';
|
|
40
41
|
export * from './PDFViewer';
|
|
41
42
|
export * from './popups';
|
|
42
43
|
export * from './PrintingSystem';
|
|
@@ -389,7 +389,8 @@ const useDynamicFilterAndSort = (props) => {
|
|
|
389
389
|
return {
|
|
390
390
|
filterColumns: fields.map((filter) => ({
|
|
391
391
|
name: filter.name,
|
|
392
|
-
multiple: filter.multiple || false
|
|
392
|
+
multiple: filter.multiple || false,
|
|
393
|
+
skipColumnValidation: filter.skipColumnValidation || false
|
|
393
394
|
})),
|
|
394
395
|
filtersApplied: getCurrentFilters().map((filter) => ({
|
|
395
396
|
columnKey: filter.field.name,
|
package/index.js
CHANGED
|
@@ -122,6 +122,7 @@ import { C as C17 } from "./components/formatters/ChipStatusFormatter/ChipStatus
|
|
|
122
122
|
import { g as g17 } from "./components/formatters/DistanceToNowFormatter/dictionary.js";
|
|
123
123
|
import { D as D9 } from "./components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js";
|
|
124
124
|
import { g as g18 } from "./components/formatters/dictionary.js";
|
|
125
|
+
import { F as F2 } from "./components/FormContainer/FormContainer.js";
|
|
125
126
|
import { G } from "./components/GridLayout/GridLayout.js";
|
|
126
127
|
import { R as R4 } from "./components/GridLayout/subcomponents/Responsive/index.js";
|
|
127
128
|
import { c as c2, e as e2, d as d3 } from "./components/GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
@@ -193,7 +194,7 @@ import { a as a14, g as g28 } from "./components/ModalDialog/dictionary.js";
|
|
|
193
194
|
import { M as M8 } from "./components/ModalDialog/ModalDialog.js";
|
|
194
195
|
import { S as S10 } from "./components/SettingsLayout/SettingsLayout.js";
|
|
195
196
|
import { P as P13 } from "./components/Pager/Pager.js";
|
|
196
|
-
import { F as
|
|
197
|
+
import { F as F3, R as R23, u as u16 } from "./components/hook-form/RHFormContext/index.js";
|
|
197
198
|
import { g as g29 } from "./components/hook-form/RHFormContext/dictionary.js";
|
|
198
199
|
import { u as u17 } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
|
|
199
200
|
import { A as A16 } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
@@ -282,7 +283,8 @@ export {
|
|
|
282
283
|
a13 as DynamicMFParmsProvider,
|
|
283
284
|
D5 as DynamicSort,
|
|
284
285
|
F as FixedSizeList,
|
|
285
|
-
F2 as
|
|
286
|
+
F2 as FormContainer,
|
|
287
|
+
F3 as FormProviderCustom,
|
|
286
288
|
G as GridLayout,
|
|
287
289
|
H as HamburgerMenu,
|
|
288
290
|
H2 as HelmetPage,
|
package/package.json
CHANGED
|
@@ -10,8 +10,6 @@ interface DataGridRenderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> {
|
|
|
10
10
|
visibleRefreshFilterSort?: boolean;
|
|
11
11
|
withExternalSortSettings?: boolean;
|
|
12
12
|
withExternalFilterSettings?: boolean;
|
|
13
|
-
skipSortValidation?: boolean;
|
|
14
|
-
skipFilterValidation?: boolean;
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
15
|
* Componente que renderiza el DataGrid para el storybook
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FormContainer } from '../../../src/components/FormContainer';
|
|
3
|
+
declare const meta: Meta<typeof FormContainer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FormContainer>;
|
|
6
|
+
/**
|
|
7
|
+
* Componente FormContainer por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const Default: Story;
|
|
@@ -19,6 +19,11 @@ export declare const WithChildren: Story;
|
|
|
19
19
|
********************************************************/
|
|
20
20
|
export declare const WithPropertyValues: Story;
|
|
21
21
|
export declare const WithSimpleContent: Story;
|
|
22
|
+
/********************************************************
|
|
23
|
+
* PaperForm con variant text
|
|
24
|
+
********************************************************/
|
|
25
|
+
export declare const WithTextVariant: Story;
|
|
26
|
+
export declare const WithFullHeight: Story;
|
|
22
27
|
/**
|
|
23
28
|
* State Skeleton
|
|
24
29
|
*/
|