@m4l/components 9.3.13 → 9.3.15
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 +207 -61
- package/components/MenuActions/MenuActions.js +3 -2
- package/components/MenuActions/MenuActions.styles.js +1 -1
- package/components/MenuActions/constants.d.ts +1 -0
- package/components/MenuActions/constants.js +12 -1
- package/components/MenuActions/slots/MenuActionsSlots.js +1 -1
- package/components/Stepper/Stepper.d.ts +8 -0
- package/components/Stepper/Stepper.js +70 -0
- package/components/Stepper/Stepper.styles.d.ts +2 -0
- package/components/Stepper/Stepper.styles.js +298 -0
- package/components/Stepper/constants.d.ts +2 -0
- package/components/Stepper/constants.js +6 -0
- package/components/Stepper/dictionary.d.ts +8 -0
- package/components/Stepper/dictionary.js +14 -0
- package/components/Stepper/helpers/evaluateVisibilityStepCondition/index.d.ts +9 -0
- package/components/Stepper/helpers/evaluateVisibilityStepCondition/index.js +17 -0
- package/components/Stepper/helpers/findNextVisibleValidStep/index.d.ts +10 -0
- package/components/Stepper/helpers/findNextVisibleValidStep/index.js +13 -0
- package/components/Stepper/helpers/findPrevVisibleValidStep/index.d.ts +10 -0
- package/components/Stepper/helpers/findPrevVisibleValidStep/index.js +13 -0
- package/components/Stepper/helpers/index.d.ts +4 -0
- package/components/Stepper/helpers/index.js +1 -0
- package/components/Stepper/helpers/isLastVisibleValidStep/index.d.ts +10 -0
- package/components/Stepper/helpers/isLastVisibleValidStep/index.js +16 -0
- package/components/Stepper/hooks/useIsLastVisibleValidStep/index.d.ts +6 -0
- package/components/Stepper/hooks/useIsLastVisibleValidStep/index.js +25 -0
- package/components/Stepper/hooks/useStepper/index.d.ts +5 -0
- package/components/Stepper/hooks/useStepper/index.js +14 -0
- package/components/Stepper/hooks/useStepperActions/index.d.ts +8 -0
- package/components/Stepper/hooks/useStepperActions/index.js +76 -0
- package/components/Stepper/icons.d.ts +9 -0
- package/components/Stepper/icons.js +12 -0
- package/components/Stepper/index.d.ts +14 -0
- package/components/Stepper/index.js +1 -0
- package/components/Stepper/slots/StepperEnum.d.ts +28 -0
- package/components/Stepper/slots/StepperEnum.js +38 -0
- package/components/Stepper/slots/StepperSlot.d.ts +63 -0
- package/components/Stepper/slots/StepperSlot.js +107 -0
- package/components/Stepper/store/StepperContext/index.d.ts +17 -0
- package/components/Stepper/store/StepperContext/index.js +91 -0
- package/components/Stepper/store/StepperStore/index.d.ts +16 -0
- package/components/Stepper/store/StepperStore/index.js +133 -0
- package/components/Stepper/store/types.d.ts +63 -0
- package/components/Stepper/subcomponents/ContentArea/index.d.ts +6 -0
- package/components/Stepper/subcomponents/ContentArea/index.js +24 -0
- package/components/Stepper/subcomponents/ContentArea/subcomponents/WrapperIcon/index.d.ts +4 -0
- package/components/Stepper/subcomponents/ContentArea/subcomponents/WrapperIcon/index.js +26 -0
- package/components/Stepper/subcomponents/ContentArea/subcomponents/WrapperTitle/index.d.ts +4 -0
- package/components/Stepper/subcomponents/ContentArea/subcomponents/WrapperTitle/index.js +23 -0
- package/components/Stepper/subcomponents/StepArea/index.d.ts +6 -0
- package/components/Stepper/subcomponents/StepArea/index.js +149 -0
- package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.d.ts +5 -0
- package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.js +82 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +4 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +25 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.d.ts +4 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +42 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.d.ts +4 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +49 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.d.ts +4 -0
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +20 -0
- package/components/Stepper/subcomponents/StepperButtons/index.d.ts +4 -0
- package/components/Stepper/subcomponents/StepperButtons/index.js +1 -0
- package/components/Stepper/subcomponents/StepperContent/index.d.ts +7 -0
- package/components/Stepper/subcomponents/StepperContent/index.js +23 -0
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.d.ts +6 -0
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +41 -0
- package/components/Stepper/subcomponents/StepperFooter/index.d.ts +6 -0
- package/components/Stepper/subcomponents/StepperFooter/index.js +48 -0
- package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterLeftActions/index.d.ts +6 -0
- package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterLeftActions/index.js +9 -0
- package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterRightActions/index.d.ts +6 -0
- package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterRightActions/index.js +33 -0
- package/components/Stepper/types.d.ts +165 -0
- package/components/WindowBase/WindowBase.styles.js +1 -1
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/hook-form/RHFormContext/index.js +5 -4
- package/components/hook-form/RHFormContext/types.d.ts +3 -1
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/types.d.ts +45 -2
- package/components/mui_extended/Badge/Badge.styles.js +4 -2
- package/components/mui_extended/IconButton/IconButton.js +12 -2
- package/components/mui_extended/IconButton/IconButton.styles.js +7 -7
- package/components/mui_extended/IconButton/constants.js +8 -1
- package/helpers/getStepsAndValidationSchema/getStepsAndValidationSchema.d.ts +11 -0
- package/helpers/getStepsAndValidationSchema/getStepsAndValidationSchema.js +44 -0
- package/helpers/getStepsAndValidationSchema/index.d.ts +2 -0
- package/helpers/getStepsAndValidationSchema/index.js +1 -0
- package/helpers/getStepsAndValidationSchema/types.d.ts +21 -0
- package/helpers/getStepsAndValidationSchema/types.js +1 -0
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +80 -52
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare enum StepperSlots {
|
|
2
|
+
stepperRoot = "stepperRoot"
|
|
3
|
+
}
|
|
4
|
+
export declare enum ContentSlots {
|
|
5
|
+
contentSection = "contentSection",
|
|
6
|
+
stepArea = "stepArea",
|
|
7
|
+
step = "step",
|
|
8
|
+
stepName = "stepName",
|
|
9
|
+
indicator = "indicator",
|
|
10
|
+
textNumber = "textNumber"
|
|
11
|
+
}
|
|
12
|
+
export declare enum ContentAreaSlots {
|
|
13
|
+
contentArea = "contentArea",
|
|
14
|
+
stepContent = "stepContent",
|
|
15
|
+
contentAreaHeader = "contentAreaHeader",
|
|
16
|
+
contentAreaBody = "contentAreaBody",
|
|
17
|
+
wrapperIcon = "wrapperIcon",
|
|
18
|
+
wrapperTitle = "wrapperTitle",
|
|
19
|
+
icon = "icon",
|
|
20
|
+
title = "title",
|
|
21
|
+
description = "description"
|
|
22
|
+
}
|
|
23
|
+
export declare enum StepperFooterSlots {
|
|
24
|
+
stepperFooterSection = "stepperFooterSection",
|
|
25
|
+
stepperFooterLeftActions = "stepperFooterLeftActions",
|
|
26
|
+
stepperFooterRightActions = "stepperFooterRightActions",
|
|
27
|
+
wrapperButtons = "wrapperButtons"
|
|
28
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var StepperSlots = /* @__PURE__ */ ((StepperSlots2) => {
|
|
2
|
+
StepperSlots2["stepperRoot"] = "stepperRoot";
|
|
3
|
+
return StepperSlots2;
|
|
4
|
+
})(StepperSlots || {});
|
|
5
|
+
var ContentSlots = /* @__PURE__ */ ((ContentSlots2) => {
|
|
6
|
+
ContentSlots2["contentSection"] = "contentSection";
|
|
7
|
+
ContentSlots2["stepArea"] = "stepArea";
|
|
8
|
+
ContentSlots2["step"] = "step";
|
|
9
|
+
ContentSlots2["stepName"] = "stepName";
|
|
10
|
+
ContentSlots2["indicator"] = "indicator";
|
|
11
|
+
ContentSlots2["textNumber"] = "textNumber";
|
|
12
|
+
return ContentSlots2;
|
|
13
|
+
})(ContentSlots || {});
|
|
14
|
+
var ContentAreaSlots = /* @__PURE__ */ ((ContentAreaSlots2) => {
|
|
15
|
+
ContentAreaSlots2["contentArea"] = "contentArea";
|
|
16
|
+
ContentAreaSlots2["stepContent"] = "stepContent";
|
|
17
|
+
ContentAreaSlots2["contentAreaHeader"] = "contentAreaHeader";
|
|
18
|
+
ContentAreaSlots2["contentAreaBody"] = "contentAreaBody";
|
|
19
|
+
ContentAreaSlots2["wrapperIcon"] = "wrapperIcon";
|
|
20
|
+
ContentAreaSlots2["wrapperTitle"] = "wrapperTitle";
|
|
21
|
+
ContentAreaSlots2["icon"] = "icon";
|
|
22
|
+
ContentAreaSlots2["title"] = "title";
|
|
23
|
+
ContentAreaSlots2["description"] = "description";
|
|
24
|
+
return ContentAreaSlots2;
|
|
25
|
+
})(ContentAreaSlots || {});
|
|
26
|
+
var StepperFooterSlots = /* @__PURE__ */ ((StepperFooterSlots2) => {
|
|
27
|
+
StepperFooterSlots2["stepperFooterSection"] = "stepperFooterSection";
|
|
28
|
+
StepperFooterSlots2["stepperFooterLeftActions"] = "stepperFooterLeftActions";
|
|
29
|
+
StepperFooterSlots2["stepperFooterRightActions"] = "stepperFooterRightActions";
|
|
30
|
+
StepperFooterSlots2["wrapperButtons"] = "wrapperButtons";
|
|
31
|
+
return StepperFooterSlots2;
|
|
32
|
+
})(StepperFooterSlots || {});
|
|
33
|
+
export {
|
|
34
|
+
ContentSlots as C,
|
|
35
|
+
StepperSlots as S,
|
|
36
|
+
ContentAreaSlots as a,
|
|
37
|
+
StepperFooterSlots as b
|
|
38
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slots Stepper
|
|
3
|
+
*/
|
|
4
|
+
export declare const StepperRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & 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 ContentSectionStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, keyof import('react').HTMLAttributes<HTMLElement> | keyof import('react').ClassAttributes<HTMLElement>>, {}>;
|
|
10
|
+
export declare const StepAreaStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
11
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
12
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
13
|
+
export declare const ContentAreaStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
14
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
15
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
16
|
+
export declare const StepContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
17
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
18
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
19
|
+
export declare const StepStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
20
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
21
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
22
|
+
export declare const StepNameStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
23
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
24
|
+
}, {}, {}>;
|
|
25
|
+
export declare const IndicatorStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
26
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
27
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
28
|
+
export declare const TextNumberStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
29
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
30
|
+
}, {}, {}>;
|
|
31
|
+
export declare const ContentAreaBodyStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
32
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
33
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
34
|
+
export declare const ContentAreaHeaderStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
35
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
36
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
37
|
+
export declare const WrapperIconStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
38
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
39
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
40
|
+
export declare const WrapperTitleStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
41
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
42
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
43
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon/types').IconProps, keyof import('../../Icon/types').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
44
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
45
|
+
}, {}, {}>;
|
|
46
|
+
export declare const TitleStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
47
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
48
|
+
}, {}, {}>;
|
|
49
|
+
export declare const DescriptionStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
50
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
51
|
+
}, {}, {}>;
|
|
52
|
+
export declare const StepperFooterSectionStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
53
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
54
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, keyof import('react').HTMLAttributes<HTMLElement> | keyof import('react').ClassAttributes<HTMLElement>>, {}>;
|
|
55
|
+
export declare const StepperFooterLeftActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
56
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
57
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
58
|
+
export declare const StepperFooterRightActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
59
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
60
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
61
|
+
export declare const WrapperButtonsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
62
|
+
ownerState?: (Partial<import('../types').StepperOwnerState> & Record<string, unknown>) | undefined;
|
|
63
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { S as STEPPER_PREFIX_NAME } from "../constants.js";
|
|
3
|
+
import { S as StepperSlots, C as ContentSlots, a as ContentAreaSlots, b as StepperFooterSlots } from "./StepperEnum.js";
|
|
4
|
+
import { s as stepperStyles } from "../Stepper.styles.js";
|
|
5
|
+
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
6
|
+
import { I as Icon } from "../../Icon/Icon.js";
|
|
7
|
+
const StepperRootStyled = styled("div", {
|
|
8
|
+
name: STEPPER_PREFIX_NAME,
|
|
9
|
+
slot: StepperSlots.stepperRoot
|
|
10
|
+
})(stepperStyles.stepperRoot);
|
|
11
|
+
const ContentSectionStyled = styled("section", {
|
|
12
|
+
name: STEPPER_PREFIX_NAME,
|
|
13
|
+
slot: ContentSlots.contentSection
|
|
14
|
+
})(stepperStyles.contentSection);
|
|
15
|
+
const StepAreaStyled = styled("div", {
|
|
16
|
+
name: STEPPER_PREFIX_NAME,
|
|
17
|
+
slot: ContentSlots.stepArea
|
|
18
|
+
})(stepperStyles.stepArea);
|
|
19
|
+
const ContentAreaStyled = styled("div", {
|
|
20
|
+
name: STEPPER_PREFIX_NAME,
|
|
21
|
+
slot: ContentAreaSlots.contentArea
|
|
22
|
+
})(stepperStyles.contentArea);
|
|
23
|
+
const StepContentStyled = styled("div", {
|
|
24
|
+
name: STEPPER_PREFIX_NAME,
|
|
25
|
+
slot: ContentAreaSlots.stepContent
|
|
26
|
+
})(stepperStyles.stepContent);
|
|
27
|
+
const StepStyled = styled("div", {
|
|
28
|
+
name: STEPPER_PREFIX_NAME,
|
|
29
|
+
slot: ContentSlots.step
|
|
30
|
+
})(stepperStyles.step);
|
|
31
|
+
const StepNameStyled = styled(Typography, {
|
|
32
|
+
name: STEPPER_PREFIX_NAME,
|
|
33
|
+
slot: ContentSlots.stepName
|
|
34
|
+
})(stepperStyles.stepName);
|
|
35
|
+
const IndicatorStyled = styled("div", {
|
|
36
|
+
name: STEPPER_PREFIX_NAME,
|
|
37
|
+
slot: ContentSlots.indicator
|
|
38
|
+
})(stepperStyles.indicator);
|
|
39
|
+
const TextNumberStyled = styled(Typography, {
|
|
40
|
+
name: STEPPER_PREFIX_NAME,
|
|
41
|
+
slot: ContentSlots.textNumber
|
|
42
|
+
})(stepperStyles.textNumber);
|
|
43
|
+
const ContentAreaBodyStyled = styled("div", {
|
|
44
|
+
name: STEPPER_PREFIX_NAME,
|
|
45
|
+
slot: ContentAreaSlots.contentAreaBody
|
|
46
|
+
})(stepperStyles.contentAreaBody);
|
|
47
|
+
const ContentAreaHeaderStyled = styled("div", {
|
|
48
|
+
name: STEPPER_PREFIX_NAME,
|
|
49
|
+
slot: ContentAreaSlots.contentAreaHeader
|
|
50
|
+
})(stepperStyles.contentAreaHeader);
|
|
51
|
+
const WrapperIconStyled = styled("div", {
|
|
52
|
+
name: STEPPER_PREFIX_NAME,
|
|
53
|
+
slot: ContentAreaSlots.wrapperIcon
|
|
54
|
+
})(stepperStyles.wrapperIcon);
|
|
55
|
+
const WrapperTitleStyled = styled("div", {
|
|
56
|
+
name: STEPPER_PREFIX_NAME,
|
|
57
|
+
slot: ContentAreaSlots.wrapperTitle
|
|
58
|
+
})(stepperStyles.wrapperTitle);
|
|
59
|
+
const IconStyled = styled(Icon, {
|
|
60
|
+
name: STEPPER_PREFIX_NAME,
|
|
61
|
+
slot: ContentAreaSlots.icon
|
|
62
|
+
})(stepperStyles.icon);
|
|
63
|
+
const TitleStyled = styled(Typography, {
|
|
64
|
+
name: STEPPER_PREFIX_NAME,
|
|
65
|
+
slot: ContentAreaSlots.title
|
|
66
|
+
})(stepperStyles.title);
|
|
67
|
+
const DescriptionStyled = styled(Typography, {
|
|
68
|
+
name: STEPPER_PREFIX_NAME,
|
|
69
|
+
slot: ContentAreaSlots.description
|
|
70
|
+
})(stepperStyles.description);
|
|
71
|
+
const StepperFooterSectionStyled = styled("section", {
|
|
72
|
+
name: STEPPER_PREFIX_NAME,
|
|
73
|
+
slot: StepperFooterSlots.stepperFooterSection
|
|
74
|
+
})(stepperStyles.stepperFooterSection);
|
|
75
|
+
const StepperFooterLeftActionsStyled = styled("div", {
|
|
76
|
+
name: STEPPER_PREFIX_NAME,
|
|
77
|
+
slot: StepperFooterSlots.stepperFooterLeftActions
|
|
78
|
+
})(stepperStyles.stepperFooterLeftActions);
|
|
79
|
+
const StepperFooterRightActionsStyled = styled("div", {
|
|
80
|
+
name: STEPPER_PREFIX_NAME,
|
|
81
|
+
slot: StepperFooterSlots.stepperFooterRightActions
|
|
82
|
+
})(stepperStyles.stepperFooterRightActions);
|
|
83
|
+
styled("div", {
|
|
84
|
+
name: STEPPER_PREFIX_NAME,
|
|
85
|
+
slot: StepperFooterSlots.wrapperButtons
|
|
86
|
+
})(stepperStyles.wrapperButtons);
|
|
87
|
+
export {
|
|
88
|
+
ContentSectionStyled as C,
|
|
89
|
+
DescriptionStyled as D,
|
|
90
|
+
IconStyled as I,
|
|
91
|
+
StepperRootStyled as S,
|
|
92
|
+
TitleStyled as T,
|
|
93
|
+
WrapperIconStyled as W,
|
|
94
|
+
ContentAreaStyled as a,
|
|
95
|
+
ContentAreaHeaderStyled as b,
|
|
96
|
+
ContentAreaBodyStyled as c,
|
|
97
|
+
WrapperTitleStyled as d,
|
|
98
|
+
StepAreaStyled as e,
|
|
99
|
+
StepStyled as f,
|
|
100
|
+
StepNameStyled as g,
|
|
101
|
+
IndicatorStyled as h,
|
|
102
|
+
TextNumberStyled as i,
|
|
103
|
+
StepContentStyled as j,
|
|
104
|
+
StepperFooterSectionStyled as k,
|
|
105
|
+
StepperFooterLeftActionsStyled as l,
|
|
106
|
+
StepperFooterRightActionsStyled as m
|
|
107
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StepperContextProps } from '../types';
|
|
2
|
+
declare const StepperContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('../types').StepperStateWithActions>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: unknown;
|
|
5
|
+
}>(partial: import('../types').StepperStateWithActions | Partial<import('../types').StepperStateWithActions> | ((state: import('../types').StepperStateWithActions) => import('../types').StepperStateWithActions | Partial<import('../types').StepperStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "setState"> & {
|
|
7
|
+
setState(nextStateOrUpdater: import('../types').StepperStateWithActions | Partial<import('../types').StepperStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('../types').StepperStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
+
type: unknown;
|
|
9
|
+
} | undefined): void;
|
|
10
|
+
}) | null>;
|
|
11
|
+
/**
|
|
12
|
+
* Contexto que crea y da alcance al Store (Zustand) para ser usado desde cualquier parte del componente.
|
|
13
|
+
* @param props StepperProps
|
|
14
|
+
* @returns Proveedor de contexto, y el contexto
|
|
15
|
+
*/
|
|
16
|
+
declare const StepperProvider: (props: StepperContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { StepperProvider, StepperContext };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useRef, useEffect } from "react";
|
|
3
|
+
import { c as createStepperStore } from "../StepperStore/index.js";
|
|
4
|
+
import { f as findNextVisibleValidStep } from "../../helpers/findNextVisibleValidStep/index.js";
|
|
5
|
+
const StepperContext = createContext(null);
|
|
6
|
+
const StepperProvider = (props) => {
|
|
7
|
+
const {
|
|
8
|
+
storeId,
|
|
9
|
+
storeDevtoolsEnabled,
|
|
10
|
+
steps,
|
|
11
|
+
visibleTitle = true,
|
|
12
|
+
indicatorType = "number",
|
|
13
|
+
orientation = "horizontal",
|
|
14
|
+
visibilityData,
|
|
15
|
+
children
|
|
16
|
+
} = props;
|
|
17
|
+
const stepperStoreRef = useRef();
|
|
18
|
+
const prevVisibilityDataRef = useRef(visibilityData);
|
|
19
|
+
if (!stepperStoreRef.current) {
|
|
20
|
+
stepperStoreRef.current = createStepperStore(
|
|
21
|
+
{
|
|
22
|
+
storeId,
|
|
23
|
+
steps,
|
|
24
|
+
visibleTitle,
|
|
25
|
+
ownerState: {},
|
|
26
|
+
indicatorType,
|
|
27
|
+
orientation,
|
|
28
|
+
visibilityData
|
|
29
|
+
},
|
|
30
|
+
storeDevtoolsEnabled
|
|
31
|
+
);
|
|
32
|
+
stepperStoreRef.current.getState().actions.init(steps);
|
|
33
|
+
}
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (stepperStoreRef.current) {
|
|
36
|
+
const currentState = stepperStoreRef.current.getState();
|
|
37
|
+
if (currentState.visibleTitle !== visibleTitle) {
|
|
38
|
+
stepperStoreRef.current.setState((state) => ({
|
|
39
|
+
...state,
|
|
40
|
+
visibleTitle
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
if (currentState.orientation !== orientation) {
|
|
44
|
+
stepperStoreRef.current.setState((state) => ({
|
|
45
|
+
...state,
|
|
46
|
+
orientation
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
if (currentState.indicatorType !== indicatorType) {
|
|
50
|
+
stepperStoreRef.current.setState((state) => ({
|
|
51
|
+
...state,
|
|
52
|
+
indicatorType
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
if (currentState.visibilityData !== visibilityData) {
|
|
56
|
+
stepperStoreRef.current.setState((state) => ({
|
|
57
|
+
...state,
|
|
58
|
+
visibilityData
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, [visibleTitle, orientation, indicatorType, visibilityData]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (stepperStoreRef.current && steps) {
|
|
65
|
+
const store = stepperStoreRef.current;
|
|
66
|
+
const currentState = store.getState();
|
|
67
|
+
store.getState().actions.init(steps, true);
|
|
68
|
+
if (visibilityData) {
|
|
69
|
+
const hasVisibilityDataChanged = JSON.stringify(prevVisibilityDataRef.current) !== JSON.stringify(visibilityData);
|
|
70
|
+
if (hasVisibilityDataChanged) {
|
|
71
|
+
const nextStepIndex = findNextVisibleValidStep(
|
|
72
|
+
currentState.currentStep,
|
|
73
|
+
steps,
|
|
74
|
+
{},
|
|
75
|
+
visibilityData
|
|
76
|
+
);
|
|
77
|
+
if (nextStepIndex < steps.length && nextStepIndex !== currentState.currentStep) {
|
|
78
|
+
store.getState().actions.setCurrentStep(nextStepIndex);
|
|
79
|
+
store.getState().actions.setStepValidationStatus(currentState.currentStep, true);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
prevVisibilityDataRef.current = visibilityData;
|
|
85
|
+
}, [steps, visibilityData]);
|
|
86
|
+
return /* @__PURE__ */ jsx(StepperContext.Provider, { value: stepperStoreRef.current, children });
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
StepperProvider as S,
|
|
90
|
+
StepperContext as a
|
|
91
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InitialStoreProps, StepperStateWithActions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Crea el store de zustand para el componente Stepper
|
|
4
|
+
* @param initProps Variables iniciales que necesita store para poder inicializarlo
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const createStepperStore: (initProps: InitialStoreProps, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<StepperStateWithActions>, "setState"> & {
|
|
8
|
+
setState<A extends string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
}>(partial: StepperStateWithActions | Partial<StepperStateWithActions> | ((state: StepperStateWithActions) => StepperStateWithActions | Partial<StepperStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
11
|
+
}, "setState"> & {
|
|
12
|
+
setState(nextStateOrUpdater: StepperStateWithActions | Partial<StepperStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<StepperStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
13
|
+
type: unknown;
|
|
14
|
+
} | undefined): void;
|
|
15
|
+
};
|
|
16
|
+
export type StepperStore = ReturnType<typeof createStepperStore>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createStore } from "zustand";
|
|
2
|
+
import { devtools } from "zustand/middleware";
|
|
3
|
+
import { immer } from "zustand/middleware/immer";
|
|
4
|
+
import { a as STEPPER_STORE_ID } from "../../constants.js";
|
|
5
|
+
import { f as findNextVisibleValidStep } from "../../helpers/findNextVisibleValidStep/index.js";
|
|
6
|
+
import { f as findPrevVisibleValidStep } from "../../helpers/findPrevVisibleValidStep/index.js";
|
|
7
|
+
const createDevtools = (immerMiddlewere, config) => {
|
|
8
|
+
const { enabled = false } = config;
|
|
9
|
+
if (enabled && process.env.NODE_ENV === "development") {
|
|
10
|
+
return devtools(immerMiddlewere, config);
|
|
11
|
+
}
|
|
12
|
+
return immerMiddlewere;
|
|
13
|
+
};
|
|
14
|
+
const createStepperStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
15
|
+
const startProps = {
|
|
16
|
+
currentStep: 0,
|
|
17
|
+
stepValidationStatus: {},
|
|
18
|
+
isValidating: false,
|
|
19
|
+
...initProps
|
|
20
|
+
};
|
|
21
|
+
return createStore(
|
|
22
|
+
createDevtools(
|
|
23
|
+
/**
|
|
24
|
+
* immer es un middleware de Zustand que permite trabajar con el estado de manera inmutable
|
|
25
|
+
*/
|
|
26
|
+
immer((set, get) => ({
|
|
27
|
+
...startProps,
|
|
28
|
+
actions: {
|
|
29
|
+
/**
|
|
30
|
+
* init es la acción que se ejecuta al inicializar el store
|
|
31
|
+
*/
|
|
32
|
+
init: (steps, preserveStepValidationStatus = false) => {
|
|
33
|
+
set((state) => {
|
|
34
|
+
state.steps = steps;
|
|
35
|
+
if (!preserveStepValidationStatus) {
|
|
36
|
+
state.stepValidationStatus = {};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* setCurrentStep es la acción que se ejecuta para cambiar el step actual
|
|
42
|
+
*/
|
|
43
|
+
setCurrentStep: (currentStep) => {
|
|
44
|
+
set((state) => {
|
|
45
|
+
state.currentStep = currentStep;
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* setStepValidationStatus es la acción que se ejecuta para establecer el estado de validación de un paso
|
|
50
|
+
* @param stepIndex
|
|
51
|
+
* @param isValid
|
|
52
|
+
*/
|
|
53
|
+
setStepValidationStatus: (stepIndex, isValid) => {
|
|
54
|
+
set((state) => {
|
|
55
|
+
state.stepValidationStatus[stepIndex] = isValid;
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* prevStep - Función que retrocede al paso anterior válido del Stepper.
|
|
60
|
+
* @param formData Datos del formulario actual para evaluar las conditions de los pasos
|
|
61
|
+
* @param visibilityData Datos adicionales para evaluar las conditions (opcional, usa el del store si no se proporciona)
|
|
62
|
+
*/
|
|
63
|
+
prevStep: (formData = {}, visibilityData) => {
|
|
64
|
+
const state = get();
|
|
65
|
+
const { currentStep, steps } = state;
|
|
66
|
+
const dataForVisibility = visibilityData ?? state.visibilityData;
|
|
67
|
+
const prevValidStepIndex = findPrevVisibleValidStep(
|
|
68
|
+
currentStep,
|
|
69
|
+
steps,
|
|
70
|
+
formData,
|
|
71
|
+
dataForVisibility
|
|
72
|
+
);
|
|
73
|
+
if (prevValidStepIndex < 0) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
set((draft) => {
|
|
77
|
+
draft.currentStep = prevValidStepIndex;
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* nextStep - Función que valida el paso actual y avanza al siguiente paso del Stepper.
|
|
82
|
+
* @param validateFn Función de validación externa que debe retornar una promesa que resuelve a true o false
|
|
83
|
+
* @param formData Datos del formulario actual para evaluar las conditions de los pasos
|
|
84
|
+
* @param visibilityData Datos adicionales para evaluar las conditions (opcional, usa el del store si no se proporciona)
|
|
85
|
+
* @returns Promise<boolean> Retorna true si se avanzó al siguiente paso, false en caso contrario
|
|
86
|
+
*/
|
|
87
|
+
nextStep: async (validateFn, formData = {}, visibilityData) => {
|
|
88
|
+
const state = get();
|
|
89
|
+
const { currentStep, steps } = state;
|
|
90
|
+
const dataForVisibility = visibilityData ?? state.visibilityData;
|
|
91
|
+
const isValid = await validateFn();
|
|
92
|
+
const nextValidStepIndex = findNextVisibleValidStep(
|
|
93
|
+
currentStep,
|
|
94
|
+
steps,
|
|
95
|
+
formData,
|
|
96
|
+
dataForVisibility
|
|
97
|
+
);
|
|
98
|
+
if (!isValid) {
|
|
99
|
+
set((draft) => {
|
|
100
|
+
draft.isValidating = false;
|
|
101
|
+
draft.stepValidationStatus[currentStep] = false;
|
|
102
|
+
});
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
set((draft) => {
|
|
106
|
+
draft.isValidating = false;
|
|
107
|
+
draft.stepValidationStatus[currentStep] = true;
|
|
108
|
+
draft.currentStep = nextValidStepIndex;
|
|
109
|
+
});
|
|
110
|
+
return true;
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* resetStepper - Resetea el Stepper a su estado inicial
|
|
114
|
+
*/
|
|
115
|
+
resetStepper: () => {
|
|
116
|
+
set((state) => {
|
|
117
|
+
state.currentStep = 0;
|
|
118
|
+
state.stepValidationStatus = {};
|
|
119
|
+
state.isValidating = false;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
})),
|
|
124
|
+
{
|
|
125
|
+
name: `${STEPPER_STORE_ID}: ${initProps.storeId}`,
|
|
126
|
+
enabled: storeDevtoolsEnabled
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
export {
|
|
132
|
+
createStepperStore as c
|
|
133
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Step, StepperOwnerState, StepperProps } from '../types';
|
|
3
|
+
export interface StepperState extends Pick<StepperProps, 'storeId' | 'visibleTitle' | 'steps' | 'indicatorType' | 'orientation' | 'size' | 'visibilityData'> {
|
|
4
|
+
/**
|
|
5
|
+
* "ownerState" estado a nivel de clases del componente
|
|
6
|
+
*/
|
|
7
|
+
ownerState: StepperOwnerState;
|
|
8
|
+
/**
|
|
9
|
+
* "currentStep" step actual
|
|
10
|
+
*/
|
|
11
|
+
currentStep: number;
|
|
12
|
+
/**
|
|
13
|
+
* "stepValidationStatus" estado de validación por cada step
|
|
14
|
+
* - true: el paso es válido
|
|
15
|
+
*/
|
|
16
|
+
stepValidationStatus: Record<number, boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* "isValidating" indica si el stepper está en proceso de validación
|
|
19
|
+
*/
|
|
20
|
+
isValidating: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface StepperStateWithActions extends StepperState {
|
|
23
|
+
actions: {
|
|
24
|
+
/**
|
|
25
|
+
* inicializa el estado del componente con los steps que provienen desde afuera,
|
|
26
|
+
* @param steps - Array de steps
|
|
27
|
+
* @param preserveStepValidationStatus - Indica si se debe preservar el estado de validación de los pasos, por defecto es false
|
|
28
|
+
*/
|
|
29
|
+
init: (steps: Array<Step>, preserveStepValidationStatus?: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Establece el paso actual
|
|
32
|
+
* @param currentStep - Índice del paso actual
|
|
33
|
+
*/
|
|
34
|
+
setCurrentStep: (currentStep: number) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Establece el estado de validación de un paso
|
|
37
|
+
* @param stepIndex - Índice del paso
|
|
38
|
+
* @param isValid - Estado de validación del paso
|
|
39
|
+
*/
|
|
40
|
+
setStepValidationStatus: (stepIndex: number, isValid: boolean) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Retrocede al paso anterior válido
|
|
43
|
+
* @param formData - Datos del formulario para evaluar conditions
|
|
44
|
+
* @param visibilityData - Datos adicionales para evaluar conditions
|
|
45
|
+
*/
|
|
46
|
+
prevStep: (formData?: Record<string, any>, visibilityData?: any) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Valida el paso actual y avanza al siguiente si es válido
|
|
49
|
+
* @param validateFn - Función de validación
|
|
50
|
+
* @param formData - Datos del formulario para evaluar conditions
|
|
51
|
+
* @param visibilityData - Datos adicionales para evaluar conditions
|
|
52
|
+
*/
|
|
53
|
+
nextStep: (validateFn: () => Promise<boolean>, formData?: Record<string, any>, visibilityData?: any) => Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* resetStepper - Resetea el Stepper a su estado inicial
|
|
56
|
+
*/
|
|
57
|
+
resetStepper: () => void;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface StepperContextProps extends StepperProps {
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
}
|
|
63
|
+
export type InitialStoreProps = Pick<StepperState, 'ownerState' | 'storeId' | 'steps' | 'visibleTitle' | 'indicatorType' | 'orientation' | 'visibilityData'>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContentAreaProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* El componente ContentArea renderiza el área de contenido del Stepper.
|
|
4
|
+
* Contiene el encabezado con un icono, titulo y descripción, y el contenido del step actual.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ContentArea(props: ContentAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { u as useStepper } from "../../hooks/useStepper/index.js";
|
|
3
|
+
import { a as ContentAreaStyled, b as ContentAreaHeaderStyled, c as ContentAreaBodyStyled } from "../../slots/StepperSlot.js";
|
|
4
|
+
import { W as WrapperIcon } from "./subcomponents/WrapperIcon/index.js";
|
|
5
|
+
import { W as WrapperTitle } from "./subcomponents/WrapperTitle/index.js";
|
|
6
|
+
function ContentArea(props) {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
const { orientation } = useStepper((state) => ({
|
|
9
|
+
orientation: state.orientation
|
|
10
|
+
}));
|
|
11
|
+
const ownerState = {
|
|
12
|
+
orientation
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ jsxs(ContentAreaStyled, { ownerState, children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(ContentAreaHeaderStyled, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx(WrapperIcon, {}),
|
|
17
|
+
/* @__PURE__ */ jsx(WrapperTitle, {})
|
|
18
|
+
] }),
|
|
19
|
+
/* @__PURE__ */ jsx(ContentAreaBodyStyled, { children })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
ContentArea as C
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { W as WrapperIconStyled, I as IconStyled } from "../../../../slots/StepperSlot.js";
|
|
4
|
+
import { p as pathIcons } from "../../../../icons.js";
|
|
5
|
+
import { u as useStepper } from "../../../../hooks/useStepper/index.js";
|
|
6
|
+
import { useEnvironment } from "@m4l/core";
|
|
7
|
+
function WrapperIcon() {
|
|
8
|
+
const { steps, currentStep } = useStepper((state) => ({
|
|
9
|
+
steps: state.steps,
|
|
10
|
+
currentStep: state.currentStep
|
|
11
|
+
}));
|
|
12
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
13
|
+
const currentStepConfig = useMemo(() => {
|
|
14
|
+
return steps[currentStep];
|
|
15
|
+
}, [steps, currentStep]);
|
|
16
|
+
return /* @__PURE__ */ jsx(WrapperIconStyled, { children: /* @__PURE__ */ jsx(
|
|
17
|
+
IconStyled,
|
|
18
|
+
{
|
|
19
|
+
color: "primary.enabled",
|
|
20
|
+
src: currentStepConfig.icon ? currentStepConfig.icon : `${host_static_assets}/${environment_assets}/${pathIcons.patronum}`
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
WrapperIcon as W
|
|
26
|
+
};
|