@m4l/components 9.3.19-BE093025-beta.1 → 9.3.19-BE101025-beta.2
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 +8 -0
- package/components/Card/constants.d.ts +1 -1
- package/components/Chip/constants.d.ts +1 -1
- package/components/ContainerFlow/constants.d.ts +1 -1
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/formatter.d.ts +8 -0
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/index.d.ts +3 -0
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/types.d.ts +5 -0
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/useColumnEditLabel.d.ts +9 -0
- package/components/DataGrid/tests/helpers/types.d.ts +2 -0
- package/components/EditLabel/EditLabel.d.ts +7 -0
- package/components/EditLabel/EditLabel.styles.d.ts +2 -0
- package/components/EditLabel/constants.d.ts +2 -0
- package/components/EditLabel/hooks/useEditLabel.d.ts +23 -0
- package/components/EditLabel/icons.d.ts +5 -0
- package/components/EditLabel/index.d.ts +2 -0
- package/components/EditLabel/slots/EditLabelEnum.d.ts +8 -0
- package/components/EditLabel/slots/EditLabelSlots.d.ts +18 -0
- package/components/EditLabel/test/EditLabel.test.d.ts +1 -0
- package/components/EditLabel/types.d.ts +43 -0
- package/components/FormContainer/constants.d.ts +1 -1
- package/components/GridLayout/subcomponents/GridItem/index.js +2 -2
- package/components/Image/constant.d.ts +1 -1
- package/components/ImageText/ImageText.styles.js +1 -1
- package/components/ImageText/constants.d.ts +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +13 -5
- package/components/MFIsolationApp/icons.d.ts +3 -0
- package/components/MFIsolationApp/icons.js +6 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/index.d.ts +1 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/index.js +1 -0
- package/components/MFIsolationApp/types.d.ts +1 -0
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.d.ts +5 -0
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.js +154 -0
- package/components/MFIsolationAppStorybook/constants.d.ts +1 -0
- package/components/MFIsolationAppStorybook/icons.d.ts +3 -0
- package/components/MFIsolationAppStorybook/icons.js +6 -0
- package/components/MFIsolationAppStorybook/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.d.ts +5 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js +44 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/types.d.ts +4 -0
- package/components/MFIsolationAppStorybook/types.d.ts +31 -0
- package/components/MenuActions/constants.d.ts +1 -1
- package/components/ModalDialog/ModalDialog.js +1 -0
- package/components/NoItemSelected/constant.d.ts +1 -1
- package/components/Stepper/Stepper.styles.js +17 -14
- package/components/Stepper/helpers/getInitialFieldValues/index.d.ts +12 -0
- package/components/Stepper/helpers/getInitialFieldValues/index.js +14 -0
- package/components/Stepper/helpers/index.d.ts +2 -0
- package/components/Stepper/helpers/parseWatchedValues/index.d.ts +17 -0
- package/components/Stepper/helpers/parseWatchedValues/index.js +12 -0
- package/components/Stepper/hooks/useDynamicValidation/index.d.ts +11 -0
- package/components/Stepper/hooks/useDynamicValidation/index.js +69 -0
- package/components/Stepper/hooks/useStepperActions/index.js +19 -3
- package/components/Stepper/store/StepperStore/index.js +20 -1
- package/components/Stepper/subcomponents/StepArea/index.js +45 -25
- package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.js +18 -10
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +38 -5
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +5 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +5 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -3
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +30 -11
- package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterRightActions/index.js +20 -10
- package/components/Stepper/types.d.ts +7 -0
- package/components/WindowBase/constants.d.ts +1 -1
- package/components/extended/React-Json-Viewer/constants.d.ts +1 -1
- package/components/extended/React-resizable-panels/SplitLayout.js +1 -1
- package/components/formatters/ChipStatusFormatter/constants.d.ts +1 -1
- package/components/formatters/EditLabelFormatter/EditLabelFormatter.d.ts +5 -0
- package/components/formatters/EditLabelFormatter/EditLabelFormatter.styles.d.ts +2 -0
- package/components/formatters/EditLabelFormatter/constants.d.ts +5 -0
- package/components/formatters/EditLabelFormatter/index.d.ts +2 -0
- package/components/formatters/EditLabelFormatter/slots/EditLabelFormatterEnum.d.ts +4 -0
- package/components/formatters/EditLabelFormatter/slots/EditLabelFormatterSlots.d.ts +5 -0
- package/components/formatters/EditLabelFormatter/test/EditLabelFormatter.test.d.ts +1 -0
- package/components/formatters/EditLabelFormatter/types.d.ts +23 -0
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +8 -2
- package/components/hook-form/RHFAutocomplete/types.d.ts +13 -0
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +8 -2
- package/components/hook-form/RHFCheckbox/constants.d.ts +1 -1
- package/components/hook-form/RHFSelect/constants.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +25 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.js +5 -1
- package/components/hook-form/RHFormContext/index.d.ts +110 -10
- package/components/hook-form/RHFormContext/index.js +35 -8
- package/components/hook-form/RHFormContext/types.d.ts +64 -1
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +6 -2
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +3 -1
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +9 -3
- package/components/mui_extended/Autocomplete/types.d.ts +8 -0
- package/components/mui_extended/Button/Button.js +15 -4
- package/components/mui_extended/Button/ButtonStyles.js +155 -82
- package/components/mui_extended/Button/{constans.d.ts → constants.d.ts} +1 -0
- package/components/mui_extended/Button/constants.js +8 -0
- package/components/mui_extended/Button/slots/ButtonSlots.js +1 -1
- package/components/mui_extended/Button/types.d.ts +1 -1
- package/components/mui_extended/IconButton/constants.d.ts +1 -1
- package/components/mui_extended/IconButton/constants.js +4 -1
- package/components/mui_extended/MenuItem/MenuItem.js +1 -1
- package/components/mui_extended/MenuItem/constants.d.ts +1 -1
- package/components/mui_extended/NavLink/constants.d.ts +1 -1
- package/components/mui_extended/Select/Select.js +2 -2
- package/components/mui_extended/Select/constants.d.ts +1 -1
- package/components/mui_extended/TextField/constants.d.ts +1 -1
- package/components/mui_extended/Tooltip/Tooltip.styles.js +8 -1
- package/components/mui_extended/Tooltip/constants.d.ts +1 -1
- package/components/mui_extended/Typography/constants.d.ts +1 -1
- package/components/mui_extended/Typography/types.d.ts +1 -1
- package/contexts/AppearanceComponentContext/AppearanceComponentContext.js +6 -1
- package/index.js +12 -10
- package/package.json +1 -1
- package/utils/getComponentSlotRoot.d.ts +3 -1
- package/components/mui_extended/Button/constans.js +0 -4
|
@@ -21,15 +21,6 @@ function Indicator(props) {
|
|
|
21
21
|
);
|
|
22
22
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
23
23
|
const { currentSize } = useComponentSize(size);
|
|
24
|
-
const ownerState = {
|
|
25
|
-
size: currentSize,
|
|
26
|
-
currentStep,
|
|
27
|
-
step,
|
|
28
|
-
totalSteps,
|
|
29
|
-
orientation,
|
|
30
|
-
indicatorType,
|
|
31
|
-
stepValidationStatus
|
|
32
|
-
};
|
|
33
24
|
const isMobile = useIsMobile();
|
|
34
25
|
const effectiveIndicatorType = useMemo(() => {
|
|
35
26
|
return isMobile ? "dot" : indicatorType;
|
|
@@ -45,6 +36,20 @@ function Indicator(props) {
|
|
|
45
36
|
hasBeenValidated: validated
|
|
46
37
|
};
|
|
47
38
|
}, [currentStep, originalStepIndex, stepValidationStatus]);
|
|
39
|
+
const ownerState = {
|
|
40
|
+
size: currentSize,
|
|
41
|
+
currentStep,
|
|
42
|
+
step,
|
|
43
|
+
totalSteps,
|
|
44
|
+
orientation,
|
|
45
|
+
indicatorType,
|
|
46
|
+
stepValidationStatus,
|
|
47
|
+
originalStepIndex,
|
|
48
|
+
isCompleted,
|
|
49
|
+
isCurrent: currentStep === originalStepIndex,
|
|
50
|
+
isValidStep,
|
|
51
|
+
hasBeenValidated
|
|
52
|
+
};
|
|
48
53
|
return /* @__PURE__ */ jsx(IndicatorStyled, { ownerState, children: hasBeenValidated && !isValidStep ? (
|
|
49
54
|
// Mostrar error solo si ha sido validado y es inválido
|
|
50
55
|
/* @__PURE__ */ jsx(
|
|
@@ -67,7 +72,10 @@ function Indicator(props) {
|
|
|
67
72
|
)
|
|
68
73
|
) : (
|
|
69
74
|
// Mostrar estado normal (número o dot) para pasos no validados o actuales
|
|
70
|
-
/* @__PURE__ */ jsx(TextNumberStyled, { variant: "body", ownerState
|
|
75
|
+
/* @__PURE__ */ jsx(TextNumberStyled, { variant: "body", ownerState, children: effectiveIndicatorType === "number" ? (
|
|
76
|
+
// Solo mostrar número si el step es visible (step >= 0)
|
|
77
|
+
step >= 0 ? step + 1 : ""
|
|
78
|
+
) : /* @__PURE__ */ jsx(
|
|
71
79
|
Icon,
|
|
72
80
|
{
|
|
73
81
|
src: `${host_static_assets}/${environment_assets}/${currentStep === originalStepIndex ? pathIcons.dotSelected : pathIcons.dotOutline}`,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { StepperButtonProps } from '../../../types';
|
|
1
2
|
/**
|
|
2
3
|
* Botón modular para cancelar el proceso del Stepper
|
|
3
4
|
*/
|
|
4
|
-
export declare function StepperCancelButton(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function StepperCancelButton(props: StepperButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,55 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useFormContext, useFormState } from "react-hook-form";
|
|
2
4
|
import { u as useStepperActions } from "../../../hooks/useStepperActions/index.js";
|
|
3
|
-
import { D as DICTIONARY } from "../../../dictionary.js";
|
|
5
|
+
import { D as DICTIONARY$1 } from "../../../dictionary.js";
|
|
6
|
+
import { D as DICTIONARY } from "../../../../CommonActions/dictionary.js";
|
|
4
7
|
import { useModuleDictionary } from "@m4l/core";
|
|
8
|
+
import { u as useModal } from "../../../../../hooks/useModal/index.js";
|
|
9
|
+
import { u as useWindowToolsMF } from "../../../../WindowBase/hooks/useWindowToolsMF/index.js";
|
|
10
|
+
import { W as WindowConfirm } from "../../../../WindowConfirm/WindowConfirm.js";
|
|
5
11
|
import { B as Button } from "../../../../mui_extended/Button/Button.js";
|
|
6
|
-
function StepperCancelButton() {
|
|
12
|
+
function StepperCancelButton(props) {
|
|
13
|
+
const { label, ...rest } = props;
|
|
7
14
|
const { getLabel } = useModuleDictionary();
|
|
8
15
|
const { cancelAction } = useStepperActions();
|
|
9
|
-
const
|
|
16
|
+
const { openModal } = useModal();
|
|
17
|
+
const { close: closeWindow } = useWindowToolsMF();
|
|
18
|
+
const { control } = useFormContext();
|
|
19
|
+
const { isDirty } = useFormState({
|
|
20
|
+
control
|
|
21
|
+
});
|
|
22
|
+
const onConfirmQuit = useCallback(() => {
|
|
10
23
|
cancelAction();
|
|
11
|
-
|
|
24
|
+
closeWindow();
|
|
25
|
+
}, [cancelAction, closeWindow]);
|
|
26
|
+
const handleCancel = useCallback(() => {
|
|
27
|
+
if (isDirty) {
|
|
28
|
+
openModal({
|
|
29
|
+
window: /* @__PURE__ */ jsx(
|
|
30
|
+
WindowConfirm,
|
|
31
|
+
{
|
|
32
|
+
variant: "warning",
|
|
33
|
+
title: getLabel(DICTIONARY.CONFIRM_QUIT_TITLE),
|
|
34
|
+
msg: getLabel(DICTIONARY.CONFIRM_QUIT_MSG),
|
|
35
|
+
onClickIntro: onConfirmQuit
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
variant: "warning"
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
onConfirmQuit();
|
|
42
|
+
}
|
|
43
|
+
}, [getLabel, isDirty, openModal, onConfirmQuit]);
|
|
12
44
|
return /* @__PURE__ */ jsx(
|
|
13
45
|
Button,
|
|
14
46
|
{
|
|
15
47
|
type: "button",
|
|
16
|
-
label: getLabel(DICTIONARY.LABEL_CANCEL_BUTTON),
|
|
48
|
+
label: label || getLabel(DICTIONARY$1.LABEL_CANCEL_BUTTON),
|
|
17
49
|
variant: "outlined",
|
|
18
50
|
color: "default",
|
|
19
51
|
onClick: handleCancel,
|
|
52
|
+
...rest,
|
|
20
53
|
"data-testid": "stepper-cancel-button"
|
|
21
54
|
}
|
|
22
55
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { StepperButtonProps } from '../../../types';
|
|
1
2
|
/**
|
|
2
3
|
* Botón modular para avanzar al siguiente step del Stepper
|
|
3
4
|
*/
|
|
4
|
-
export declare function StepperNextButton(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function StepperNextButton(props: StepperButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,8 @@ import { D as DICTIONARY } from "../../../dictionary.js";
|
|
|
6
6
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
7
7
|
import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
|
|
8
8
|
import { B as Button } from "../../../../mui_extended/Button/Button.js";
|
|
9
|
-
function StepperNextButton() {
|
|
9
|
+
function StepperNextButton(props) {
|
|
10
|
+
const { label, ...rest } = props;
|
|
10
11
|
const { nextStepAction } = useStepperActions();
|
|
11
12
|
const isMobile = useIsMobile();
|
|
12
13
|
const { getLabel } = useModuleDictionary();
|
|
@@ -28,12 +29,13 @@ function StepperNextButton() {
|
|
|
28
29
|
Button,
|
|
29
30
|
{
|
|
30
31
|
type: "button",
|
|
31
|
-
label: getLabel(DICTIONARY.LABEL_NEXT_BUTTON),
|
|
32
|
+
label: label || getLabel(DICTIONARY.LABEL_NEXT_BUTTON),
|
|
32
33
|
variant: "contained",
|
|
33
34
|
color: "primary",
|
|
34
35
|
onClick: handleNext,
|
|
35
36
|
endIcon: `${host_static_assets}/${environment_assets}/${pathIcons.arrowRight}`,
|
|
36
|
-
"data-testid": "stepper-next-button"
|
|
37
|
+
"data-testid": "stepper-next-button",
|
|
38
|
+
...rest
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { StepperButtonProps } from '../../../types';
|
|
1
2
|
/**
|
|
2
3
|
* Botón modular para ir al step anterior del Stepper
|
|
3
4
|
*/
|
|
4
|
-
export declare function StepperPrevButton(): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
+
export declare function StepperPrevButton(props: StepperButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -7,7 +7,8 @@ import { useIsMobile } from "@m4l/graphics";
|
|
|
7
7
|
import { D as DICTIONARY } from "../../../dictionary.js";
|
|
8
8
|
import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
|
|
9
9
|
import { B as Button } from "../../../../mui_extended/Button/Button.js";
|
|
10
|
-
function StepperPrevButton() {
|
|
10
|
+
function StepperPrevButton(props) {
|
|
11
|
+
const { label, ...rest } = props;
|
|
11
12
|
const { currentStep } = useStepper((state) => ({
|
|
12
13
|
currentStep: state.currentStep
|
|
13
14
|
}));
|
|
@@ -35,12 +36,13 @@ function StepperPrevButton() {
|
|
|
35
36
|
Button,
|
|
36
37
|
{
|
|
37
38
|
type: "button",
|
|
38
|
-
label:
|
|
39
|
+
label: label || getLabel(DICTIONARY.LABEL_PREV_BUTTON),
|
|
39
40
|
variant: "outlined",
|
|
40
41
|
color: "default",
|
|
41
42
|
onClick: handlePrev,
|
|
42
43
|
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.arrowLeft}`,
|
|
43
|
-
"data-testid": "stepper-prev-button"
|
|
44
|
+
"data-testid": "stepper-prev-button",
|
|
45
|
+
...rest
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
48
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { StepperButtonProps } from '../../../types';
|
|
1
2
|
/**
|
|
2
3
|
* Botón modular para finalizar el Stepper y ejecutar onFinalSubmit
|
|
3
4
|
*/
|
|
4
|
-
export declare function StepperSubmitButton(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function StepperSubmitButton(props: StepperButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,16 +2,18 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { D as DICTIONARY } from "../../../dictionary.js";
|
|
3
3
|
import { useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { B as Button } from "../../../../mui_extended/Button/Button.js";
|
|
5
|
-
function StepperSubmitButton() {
|
|
5
|
+
function StepperSubmitButton(props) {
|
|
6
|
+
const { label, ...rest } = props;
|
|
6
7
|
const { getLabel } = useModuleDictionary();
|
|
7
8
|
return /* @__PURE__ */ jsx(
|
|
8
9
|
Button,
|
|
9
10
|
{
|
|
10
11
|
type: "submit",
|
|
11
|
-
label: getLabel(DICTIONARY.LABEL_SUBMIT_BUTTON),
|
|
12
|
+
label: label || getLabel(DICTIONARY.LABEL_SUBMIT_BUTTON),
|
|
12
13
|
variant: "contained",
|
|
13
14
|
color: "primary",
|
|
14
|
-
"data-testid": "stepper-submit-button"
|
|
15
|
+
"data-testid": "stepper-submit-button",
|
|
16
|
+
...rest
|
|
15
17
|
}
|
|
16
18
|
);
|
|
17
19
|
}
|
|
@@ -12,28 +12,47 @@ function Step(props) {
|
|
|
12
12
|
steps: state.steps,
|
|
13
13
|
visibilityData: state.visibilityData
|
|
14
14
|
}));
|
|
15
|
-
const currentStepConfig = useMemo(() => {
|
|
16
|
-
return steps[currentStep];
|
|
17
|
-
}, [steps, currentStep]);
|
|
18
15
|
const stepConfig = useMemo(() => {
|
|
19
16
|
return steps.find((step) => step.key === stepKey);
|
|
20
17
|
}, [steps, stepKey]);
|
|
21
18
|
const isStepVisible = useMemo(() => {
|
|
22
|
-
if (!
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
if (stepKey !== currentStepConfig.key) {
|
|
19
|
+
if (!stepConfig) {
|
|
26
20
|
return false;
|
|
27
21
|
}
|
|
28
|
-
|
|
22
|
+
const meetsVisibilityCondition = evaluateVisibilityStepCondition(
|
|
29
23
|
stepConfig,
|
|
30
24
|
formValues || {},
|
|
31
25
|
visibilityData
|
|
32
|
-
)
|
|
26
|
+
);
|
|
27
|
+
if (!meetsVisibilityCondition) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const currentStepConfig = steps[currentStep];
|
|
31
|
+
if (!currentStepConfig) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (evaluateVisibilityStepCondition(currentStepConfig, formValues || {}, visibilityData)) {
|
|
35
|
+
return stepKey === currentStepConfig.key;
|
|
36
|
+
}
|
|
37
|
+
const visibleStepsUpToCurrent = [];
|
|
38
|
+
for (let i = 0; i <= currentStep; i++) {
|
|
39
|
+
const step = steps[i];
|
|
40
|
+
if (evaluateVisibilityStepCondition(step, formValues || {}, visibilityData)) {
|
|
41
|
+
visibleStepsUpToCurrent.push(step);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (visibleStepsUpToCurrent.length === 0) {
|
|
45
|
+
for (let i = currentStep + 1; i < steps.length; i++) {
|
|
46
|
+
const step = steps[i];
|
|
47
|
+
if (evaluateVisibilityStepCondition(step, formValues || {}, visibilityData)) {
|
|
48
|
+
return stepKey === step.key;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
33
51
|
return false;
|
|
34
52
|
}
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
const activeVisibleStep = visibleStepsUpToCurrent[visibleStepsUpToCurrent.length - 1];
|
|
54
|
+
return stepKey === activeVisibleStep.key;
|
|
55
|
+
}, [currentStep, stepKey, stepConfig, steps, formValues, visibilityData]);
|
|
37
56
|
return /* @__PURE__ */ jsx(StepContentStyled, { ownerState: { isStepVisible }, children });
|
|
38
57
|
}
|
|
39
58
|
export {
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useMemo } from "react";
|
|
2
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
3
3
|
import { u as useIsLastVisibleValidStep } from "../../../../hooks/useIsLastVisibleValidStep/index.js";
|
|
4
4
|
import { m as StepperFooterRightActionsStyled } from "../../../../slots/StepperSlot.js";
|
|
5
|
-
import { S as StepperNextButton } from "../../../StepperButtons/StepperNextButton/index.js";
|
|
6
5
|
import { S as StepperSubmitButton } from "../../../StepperButtons/StepperSubmitButton/index.js";
|
|
6
|
+
import { S as StepperNextButton } from "../../../StepperButtons/StepperNextButton/index.js";
|
|
7
7
|
function StepperFooterRightActions(props) {
|
|
8
8
|
const { children } = props;
|
|
9
9
|
const isLastVisibleValidStep = useIsLastVisibleValidStep();
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const [hasCustomSubmitButton, setHasCustomSubmitButton] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const hasCustomButton = React.Children.toArray(children).some((child) => {
|
|
13
|
+
if (React.isValidElement(child)) {
|
|
14
|
+
return child.type === StepperSubmitButton;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
});
|
|
18
|
+
setHasCustomSubmitButton(hasCustomButton);
|
|
19
|
+
}, [children]);
|
|
20
|
+
const filteredChildren = useMemo(() => {
|
|
14
21
|
return React.Children.toArray(children).filter((child) => {
|
|
15
22
|
if (React.isValidElement(child)) {
|
|
16
|
-
if (child.type ===
|
|
23
|
+
if (!isLastVisibleValidStep && child.type === StepperSubmitButton) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (isLastVisibleValidStep && child.type === StepperNextButton) {
|
|
17
27
|
return false;
|
|
18
28
|
}
|
|
19
29
|
}
|
|
@@ -21,10 +31,10 @@ function StepperFooterRightActions(props) {
|
|
|
21
31
|
});
|
|
22
32
|
}, [children, isLastVisibleValidStep]);
|
|
23
33
|
const submitButton = useMemo(() => {
|
|
24
|
-
return isLastVisibleValidStep ? /* @__PURE__ */ jsx(StepperSubmitButton, {}) : null;
|
|
25
|
-
}, [isLastVisibleValidStep]);
|
|
34
|
+
return isLastVisibleValidStep && !hasCustomSubmitButton ? /* @__PURE__ */ jsx(StepperSubmitButton, {}) : null;
|
|
35
|
+
}, [isLastVisibleValidStep, hasCustomSubmitButton]);
|
|
26
36
|
return /* @__PURE__ */ jsxs(StepperFooterRightActionsStyled, { children: [
|
|
27
|
-
|
|
37
|
+
filteredChildren,
|
|
28
38
|
submitButton
|
|
29
39
|
] });
|
|
30
40
|
}
|
|
@@ -5,6 +5,7 @@ import { ContentAreaSlots, ContentSlots, StepperFooterSlots, StepperSlots } from
|
|
|
5
5
|
import { STEPPER_PREFIX_NAME } from './constants';
|
|
6
6
|
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
7
7
|
import { Step as StepComponent } from './subcomponents/StepperContent/subcomponents/Step';
|
|
8
|
+
import { ButtonProps } from '../mui_extended/Button';
|
|
8
9
|
export type Orientation = 'horizontal' | 'vertical';
|
|
9
10
|
export type IndicatorType = 'number' | 'dot';
|
|
10
11
|
export type FormData = Record<string, string | number | boolean | null | undefined>;
|
|
@@ -145,6 +146,12 @@ export interface StepperFooterProps {
|
|
|
145
146
|
export interface StepperFooterLeftActionsProps {
|
|
146
147
|
children?: ReactNode;
|
|
147
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Props para los botones del Stepper que extienden las props de Button de mui_extended
|
|
151
|
+
*/
|
|
152
|
+
export interface StepperButtonProps extends Omit<ButtonProps, 'label'> {
|
|
153
|
+
label?: string;
|
|
154
|
+
}
|
|
148
155
|
/**
|
|
149
156
|
* Props del StepperFooterRightActions
|
|
150
157
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WINDOW_BASE_KEY_COMPONENT = "M4LWindowBase";
|
|
2
|
-
export declare const WINDOW_BASE_CLASSES: Record<
|
|
2
|
+
export declare const WINDOW_BASE_CLASSES: Record<"wrapperWindowBase" | "contentWindowBase" | "headerContentWindowBase" | "headerTitleWindowBase" | "headerSubTitleWindowBase" | "pointIcon" | "containerTitleSubtitle" | "headerIconWindowBase" | "menuActionsWindowBase" | "iconsWrapperWindowBase" | "headerWindowComponent" | "linearProgressIndeterminate" | "contentEditionInfo" | "windowContainerComponent" | "toastContainer" | "containerLeftActions", string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const REACT_JSON_VIEWER_KEY_COMPONENT = "M4LReactJsonViewer";
|
|
2
|
-
export declare const REACT_JSON_VIEWER_CLASSES: Record<
|
|
2
|
+
export declare const REACT_JSON_VIEWER_CLASSES: Record<"root", string>;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Clave del componente ChipStatusFormatter
|
|
3
3
|
*/
|
|
4
4
|
export declare const CHIP_STATUS_FORMATTER_KEY_COMPONENT = "M4LChipStatusFormatter";
|
|
5
|
-
export declare const CHIP_STATUS_FORMATTER_CLASSES: Record<
|
|
5
|
+
export declare const CHIP_STATUS_FORMATTER_CLASSES: Record<"root" | "columnWrapper", string>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* componente root del ChipStatusFormatter
|
|
3
|
+
*/
|
|
4
|
+
export declare const EditLabelFormatterRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../EditLabel').EditLabelProps, keyof import('../../../EditLabel').EditLabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
|
|
5
|
+
export declare const EditLabelFormatterColumnWrapperStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
2
|
+
import { EDIT_LABEL_FORMATTER_KEY_COMPONENT } from './constants';
|
|
3
|
+
import { EditLabelFormatterSlots as Slots } from './slots/EditLabelFormatterEnum';
|
|
4
|
+
import { Theme } from '@mui/material';
|
|
5
|
+
import { EditLabelProps } from '../../EditLabel/types';
|
|
6
|
+
export type ChipStatusKey = string | number;
|
|
7
|
+
export interface EditLabelFormatterProps extends Pick<EditLabelProps, 'label' | 'onChange' | 'size' | 'fieldWidth' | 'className'> {
|
|
8
|
+
/**
|
|
9
|
+
* Componente personalizado
|
|
10
|
+
*/
|
|
11
|
+
Component?: React.ElementType;
|
|
12
|
+
/**
|
|
13
|
+
* Clase CSS del componente root
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* ID de prueba del componente
|
|
18
|
+
*/
|
|
19
|
+
dataTestid?: string;
|
|
20
|
+
}
|
|
21
|
+
export type EditLabelFormatterOwnerState = {};
|
|
22
|
+
export type EditLabelFormatterSlotsType = keyof typeof Slots;
|
|
23
|
+
export type EditLabelFormatterStyles = M4LOverridesStyleRules<keyof typeof Slots, typeof EDIT_LABEL_FORMATTER_KEY_COMPONENT, Theme>;
|
|
@@ -21,7 +21,10 @@ function RHFAutocomplete(props) {
|
|
|
21
21
|
mandatory,
|
|
22
22
|
mandatoryMessage,
|
|
23
23
|
multiple,
|
|
24
|
-
refresh
|
|
24
|
+
refresh,
|
|
25
|
+
startAdornment,
|
|
26
|
+
getOptionalStartAdornment,
|
|
27
|
+
getOptionalEndAdornment
|
|
25
28
|
// onChange: onChangeRHF,
|
|
26
29
|
} = props;
|
|
27
30
|
const htmlForId = useId();
|
|
@@ -112,7 +115,10 @@ function RHFAutocomplete(props) {
|
|
|
112
115
|
onClose: onCloseLocal,
|
|
113
116
|
size,
|
|
114
117
|
value,
|
|
115
|
-
htmlFor: htmlForId
|
|
118
|
+
htmlFor: htmlForId,
|
|
119
|
+
startAdornment,
|
|
120
|
+
getOptionalStartAdornment: getOptionalStartAdornment ? (option) => getOptionalStartAdornment(option) : () => null,
|
|
121
|
+
getOptionalEndAdornment: getOptionalEndAdornment ? (option) => getOptionalEndAdornment(option) : () => null
|
|
116
122
|
}
|
|
117
123
|
),
|
|
118
124
|
error?.message ? /* @__PURE__ */ jsx(HelperError, { message: error?.message }) : null
|
|
@@ -5,6 +5,7 @@ import { RFHAUTOCOMPLETE_KEY_COMPONENT } from './constants';
|
|
|
5
5
|
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
6
6
|
import { RFHAutocompleteSlots } from './slots';
|
|
7
7
|
import { LabelProps } from '../../Label/types';
|
|
8
|
+
import { AutocompleteProps } from '../../mui_extended/Autocomplete/types';
|
|
8
9
|
export type GetOptionString<T> = (option: T | null) => string;
|
|
9
10
|
export type RHFAutocompleteVariants = 'outlined' | 'text';
|
|
10
11
|
export type RHFAutocompleteType = 'text' | 'image';
|
|
@@ -46,6 +47,18 @@ export interface RHFAutocompleteProps<T = any, Multiple extends boolean | undefi
|
|
|
46
47
|
message: string;
|
|
47
48
|
};
|
|
48
49
|
renderInput?: MUIAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>['renderInput'];
|
|
50
|
+
/**
|
|
51
|
+
* Icono o adorno que se muestra al inicio del autocomplete.
|
|
52
|
+
*/
|
|
53
|
+
startAdornment?: AutocompleteProps<T, Multiple>['startAdornment'];
|
|
54
|
+
/**
|
|
55
|
+
* Icono o adorno inicial que se muestra en cada opción del autocomplete.
|
|
56
|
+
*/
|
|
57
|
+
getOptionalEndAdornment?: AutocompleteProps<T, Multiple>['getOptionalEndAdornment'];
|
|
58
|
+
/**
|
|
59
|
+
* Icono o adorno final que se muestra en cada opción del autocomplete.
|
|
60
|
+
*/
|
|
61
|
+
getOptionalStartAdornment?: AutocompleteProps<T, Multiple>['getOptionalStartAdornment'];
|
|
49
62
|
}
|
|
50
63
|
/**
|
|
51
64
|
* Represents the owner state of the Autocomplete component for styling purposes.
|
|
@@ -22,7 +22,10 @@ function RHFAutocompleteAsync(props) {
|
|
|
22
22
|
multiple,
|
|
23
23
|
disabled,
|
|
24
24
|
skeletonWidth,
|
|
25
|
-
responseToCamelCase
|
|
25
|
+
responseToCamelCase,
|
|
26
|
+
startAdornment,
|
|
27
|
+
getOptionalStartAdornment,
|
|
28
|
+
getOptionalEndAdornment
|
|
26
29
|
} = props;
|
|
27
30
|
const [state, dispatch] = useReducer(
|
|
28
31
|
RHFAutocompleteAsyncReducer(onChangeFilterParms),
|
|
@@ -87,7 +90,10 @@ function RHFAutocompleteAsync(props) {
|
|
|
87
90
|
multiple,
|
|
88
91
|
disabled,
|
|
89
92
|
onClose: onCloseLocal,
|
|
90
|
-
skeletonWidth
|
|
93
|
+
skeletonWidth,
|
|
94
|
+
startAdornment,
|
|
95
|
+
getOptionalStartAdornment,
|
|
96
|
+
getOptionalEndAdornment
|
|
91
97
|
}
|
|
92
98
|
);
|
|
93
99
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const RHF_CHECKBOX_KEY_COMPONENT = "M4LRHFCheckbox";
|
|
2
|
-
export declare const TEXT_FIELD_CLASSES: Record<
|
|
2
|
+
export declare const TEXT_FIELD_CLASSES: Record<"root" | "checkBox" | "containerCheckTypography" | "labelComponent", string>;
|
|
@@ -5,4 +5,4 @@ export declare const RHFSELECT_COMPONENT_KEY = "RHFSelect";
|
|
|
5
5
|
/**
|
|
6
6
|
* Clases CSS generadas dinámicamente para el componente RHFSelect.
|
|
7
7
|
*/
|
|
8
|
-
export declare const RHFSELECT_CLASSES: Record<
|
|
8
|
+
export declare const RHFSELECT_CLASSES: Record<"select" | "root" | "label" | "helperError", string>;
|
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
import { RHFUploadSingleFileSlots } from './slots/RHFUploadSingleFileEnum';
|
|
1
2
|
export declare const RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT = "M4LRHFUploadSingleFile";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const RHF_UPLOAD_SINGLE_FILE_COMPLEMENTARY_CLASSES: {
|
|
4
|
+
root: RHFUploadSingleFileSlots.root;
|
|
5
|
+
label: RHFUploadSingleFileSlots.label;
|
|
6
|
+
helperError: RHFUploadSingleFileSlots.helperError;
|
|
7
|
+
containerDropZone: RHFUploadSingleFileSlots.containerDropZone;
|
|
8
|
+
dropZone: RHFUploadSingleFileSlots.dropZone;
|
|
9
|
+
image: RHFUploadSingleFileSlots.image;
|
|
10
|
+
containerBlockContent: RHFUploadSingleFileSlots.containerBlockContent;
|
|
11
|
+
blockContentGroup: RHFUploadSingleFileSlots.blockContentGroup;
|
|
12
|
+
illustrationUpload: RHFUploadSingleFileSlots.illustrationUpload;
|
|
13
|
+
title: RHFUploadSingleFileSlots.title;
|
|
14
|
+
description: RHFUploadSingleFileSlots.description;
|
|
15
|
+
divider: RHFUploadSingleFileSlots.divider;
|
|
16
|
+
dividerText: RHFUploadSingleFileSlots.dividerText;
|
|
17
|
+
button: RHFUploadSingleFileSlots.button;
|
|
18
|
+
containerPreview: RHFUploadSingleFileSlots.containerPreview;
|
|
19
|
+
containerNameSize: RHFUploadSingleFileSlots.containerNameSize;
|
|
20
|
+
imagePreview: RHFUploadSingleFileSlots.imagePreview;
|
|
21
|
+
namePreview: RHFUploadSingleFileSlots.namePreview;
|
|
22
|
+
sizePreview: RHFUploadSingleFileSlots.sizePreview;
|
|
23
|
+
closePreview: RHFUploadSingleFileSlots.closePreview;
|
|
24
|
+
linearProgress: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const RHF_UPLOAD_SINGLE_FILE_CLASSES: Record<"title" | "divider" | "button" | "root" | "label" | "image" | "description" | "helperError" | "containerDropZone" | "dropZone" | "containerBlockContent" | "blockContentGroup" | "illustrationUpload" | "dividerText" | "containerPreview" | "containerNameSize" | "imagePreview" | "namePreview" | "sizePreview" | "closePreview" | "linearProgress", string>;
|
|
3
27
|
export declare const DEFAULT_MAX_FILE_SIZE: number;
|
|
4
28
|
export declare const FILES_ICONS: {
|
|
5
29
|
readonly 'application/pdf': "frontend/components/RHF_upload_single_file/assets/icons/application_pdf.svg";
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { g as getComponentClasses } from "../../../../utils/getComponentSlotRoot.js";
|
|
2
2
|
import { R as RHFUploadSingleFileSlots } from "./slots/RHFUploadSingleFileEnum.js";
|
|
3
3
|
const RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT = "M4LRHFUploadSingleFile";
|
|
4
|
-
const
|
|
4
|
+
const RHF_UPLOAD_SINGLE_FILE_COMPLEMENTARY_CLASSES = {
|
|
5
|
+
linearProgress: "linearProgress-linearProgress",
|
|
6
|
+
...RHFUploadSingleFileSlots
|
|
7
|
+
};
|
|
8
|
+
const RHF_UPLOAD_SINGLE_FILE_CLASSES = getComponentClasses(RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT, RHF_UPLOAD_SINGLE_FILE_COMPLEMENTARY_CLASSES);
|
|
5
9
|
const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024;
|
|
6
10
|
const PATH_ICONS = "frontend/components/RHF_upload_single_file/assets/icons";
|
|
7
11
|
const FILES_ICONS = {
|