@m4l/components 8.2.4 → 9.1.0
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/export.d.ts +0 -6
- package/@types/types.d.ts +119 -100
- package/components/AccountPopover/classes/index.d.ts +1 -1
- package/components/CommonActions/components/ActionsContainer/ActionsContainer.d.ts +11 -0
- package/components/CommonActions/components/ActionsContainer/ActionsContainer.js +23 -0
- package/components/CommonActions/components/ActionsContainer/ActionsContainer.test.d.ts +1 -0
- package/components/CommonActions/components/ActionsContainer/ActionsContainerStyles.d.ts +2 -0
- package/components/CommonActions/components/ActionsContainer/ActionsContainerStyles.js +26 -0
- package/components/CommonActions/components/ActionsContainer/constans.d.ts +8 -0
- package/components/CommonActions/components/ActionsContainer/constans.js +4 -0
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerEnum.d.ts +3 -0
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerEnum.js +7 -0
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +4 -0
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.js +12 -0
- package/components/CommonActions/components/ActionsContainer/slots/index.d.ts +2 -0
- package/components/CommonActions/components/ActionsContainer/slots/index.js +1 -0
- package/components/CommonActions/components/ActionsContainer/types.d.ts +20 -0
- package/components/CommonActions/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.js +3 -3
- package/components/DataGrid/subcomponents/Actions/subcomponents/MobileMenuActions/index.js +10 -10
- package/components/DataGrid/subcomponents/Actions/subcomponents/hooks/useModalSettings/index.d.ts +4 -0
- package/components/DataGrid/subcomponents/Actions/subcomponents/hooks/useModalSettings/index.js +2 -2
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +2 -2
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +1 -1
- package/components/SideBar/classes/index.d.ts +1 -1
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/index.d.ts +5 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/index.js +2 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.js +2 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.d.ts +4 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +2 -2
- package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.js +3 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.js +3 -3
- package/components/extended/react-resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
- package/components/extended/react-resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/subcomponents/ComponentTypeImage/index.js +1 -1
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.d.ts +5 -0
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.styles.d.ts +8 -0
- package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +4 -0
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerEnum.d.ts +10 -0
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerSlots.d.ts +28 -0
- package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.defaultProps.stories.d.ts +26 -0
- package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.error.stories.d.ts +13 -0
- package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.variants.stories.d.ts +23 -0
- package/components/hook-form/RHFInputNumberSpinner/types.d.ts +71 -0
- package/components/hook-form/RHFTextField/RHFTextField.js +13 -23
- package/components/hook-form/RHFTextField/RHFTextField.styles.js +104 -157
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/stories/Error/RHFTextFieldErrorOutlined.stories.d.ts +29 -0
- package/components/hook-form/RHFTextField/stories/Error/RHFTextFieldErrorText.stories.d.ts +29 -0
- package/components/hook-form/RHFTextField/stories/Primary/RHFTextFieldOutlined.stories.d.ts +29 -0
- package/components/hook-form/RHFTextField/stories/Primary/RHFTextFieldText.stories.d.ts +32 -0
- package/components/hook-form/RHFTextField/types.d.ts +3 -0
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.js +2 -2
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MyActions/index.d.ts +4 -0
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MyActions/index.js +2 -2
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/index.js +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.d.ts +4 -0
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.js +2 -2
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.js +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.js +5 -5
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/index.d.ts +4 -0
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/index.js +2 -2
- package/components/modal/WindowConfirm/index.d.ts +5 -0
- package/components/modal/WindowConfirm/index.js +2 -2
- package/components/modal/classes/index.d.ts +2 -2
- package/components/mui_extended/MenuActions/MenuActions.d.ts +8 -1
- package/components/mui_extended/MenuActions/MenuActions.js +55 -77
- package/components/mui_extended/MenuActions/MenuActions.styles.d.ts +4 -0
- package/components/mui_extended/MenuActions/MenuActions.styles.js +11 -38
- package/components/mui_extended/MenuActions/constants.d.ts +17 -0
- package/components/mui_extended/MenuActions/constants.js +6 -2
- package/components/mui_extended/MenuActions/dictionary.d.ts +15 -0
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum.d.ts +8 -5
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum.js +1 -4
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +29 -16
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots.js +16 -33
- package/components/mui_extended/MenuActions/stories/MenuActions.default.stories.d.ts +25 -0
- package/components/mui_extended/MenuActions/stories/MenuActions.othersProps.stories.d.ts +13 -0
- package/components/mui_extended/MenuActions/types.d.ts +80 -18
- package/components/mui_extended/MenuItem/MenuItem.js +85 -0
- package/components/mui_extended/MenuItem/MenuItem.styles.js +121 -0
- package/components/mui_extended/MenuItem/constants.js +4 -0
- package/components/mui_extended/MenuItem/index.js +1 -0
- package/components/mui_extended/MenuItem/slots/MenuItemEnum.js +9 -0
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +24 -0
- package/components/mui_extended/MenuItem/types.js +1 -0
- package/components/mui_extended/Pager/classes/index.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +1 -1
- package/components/mui_extended/Tab/Slots/TabEnum.d.ts +9 -0
- package/components/mui_extended/Tab/Slots/TabEnum.js +9 -0
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +26 -0
- package/components/mui_extended/Tab/Slots/TabSlots.js +24 -0
- package/components/mui_extended/Tab/Slots/index.d.ts +2 -0
- package/components/mui_extended/Tab/Slots/index.js +1 -0
- package/components/mui_extended/Tab/Tab.d.ts +5 -0
- package/components/mui_extended/Tab/Tab.js +67 -0
- package/components/mui_extended/Tab/Tab.styles.d.ts +5 -0
- package/components/mui_extended/Tab/Tab.styles.js +147 -0
- package/components/mui_extended/Tab/constants.d.ts +14 -0
- package/components/mui_extended/Tab/constants.js +10 -0
- package/components/mui_extended/Tab/index.d.ts +1 -5
- package/components/mui_extended/Tab/types.d.ts +53 -2
- package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +6 -6
- package/components/mui_extended/TextField/types.d.ts +54 -10
- package/components/mui_extended/index.d.ts +1 -1
- package/index.js +3 -3
- package/package.json +1 -1
- package/storybook/components/commonActions/components/ActionsContainer/ActionsContainer.stories.d.ts +13 -0
- package/storybook/components/extended/mui/Tab/stories/Tab.disable.stories.d.ts +36 -0
- package/storybook/components/extended/mui/Tab/stories/Tab.enable.stories.d.ts +36 -0
- package/storybook/components/extended/mui/Tab/stories/Tab.sizes.stories.d.ts +28 -0
- package/storybook/components/extended/mui/Tab/stories/Tab.skeleton.stories.d.ts +32 -0
- package/components/CommonActions/components/Actions/index.d.ts +0 -2
- package/components/CommonActions/components/Actions/index.js +0 -24
- package/components/CommonActions/components/Actions/styles.d.ts +0 -1
- package/components/CommonActions/components/Actions/styles.js +0 -14
- package/components/CommonActions/components/Actions/types.d.ts +0 -4
- package/components/CommonActions/tests/constants.js +0 -4
- package/components/CommonActions/tests/utils.js +0 -7
- package/components/hook-form/RHFTextField/stories/Error/TextFieldErrorOutlined.stories.d.ts +0 -9
- package/components/hook-form/RHFTextField/stories/Error/TextFieldErrorText.stories.d.ts +0 -9
- package/components/hook-form/RHFTextField/stories/Primary/TextFieldOutlined.stories.d.ts +0 -9
- package/components/hook-form/RHFTextField/stories/Primary/TextFieldText.stories.d.ts +0 -9
- package/components/mui_extended/MenuActions/MenuActions.stories.d.ts +0 -25
- package/components/mui_extended/Tab/classes/constants.d.ts +0 -1
- package/components/mui_extended/Tab/classes/constants.js +0 -4
- package/components/mui_extended/Tab/classes/index.d.ts +0 -10
- package/components/mui_extended/Tab/classes/index.js +0 -25
- package/components/mui_extended/Tab/classes/types.d.ts +0 -7
- package/components/mui_extended/Tab/constant.d.ts +0 -1
- package/components/mui_extended/Tab/constant.js +0 -4
- package/components/mui_extended/Tab/index.js +0 -40
- package/components/mui_extended/Tab/styles.d.ts +0 -2
- package/components/mui_extended/Tab/styles.js +0 -11
- package/components/mui_extended/Tab/tests/utils.d.ts +0 -2
- /package/components/{mui_extended/Tab/tests/index.test.d.ts → CommonActions/components/ActionsContainer/ActionsContainer.integration.test.d.ts} +0 -0
|
@@ -16,7 +16,7 @@ import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButt
|
|
|
16
16
|
import { R as RHFormProvider } from "../../../../../hook-form/RHFormContext/index.js";
|
|
17
17
|
import { T as Typography } from "../../../../../mui_extended/Typography/Typography.js";
|
|
18
18
|
import { R as RHFTextField } from "../../../../../hook-form/RHFTextField/RHFTextField.js";
|
|
19
|
-
import { A as
|
|
19
|
+
import { A as ActionsContainer } from "../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
20
20
|
import { A as ActionCancel } from "../../../../../CommonActions/components/ActionCancel/index.js";
|
|
21
21
|
import { A as ActionIntro } from "../../../../../CommonActions/components/ActionIntro/index.js";
|
|
22
22
|
import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
|
|
@@ -182,7 +182,7 @@ const AreaChip = (props) => {
|
|
|
182
182
|
sx: { mt: "20px" }
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
/* @__PURE__ */ jsxs(
|
|
185
|
+
/* @__PURE__ */ jsxs(ActionsContainer, { children: [
|
|
186
186
|
/* @__PURE__ */ jsx(
|
|
187
187
|
ActionCancel,
|
|
188
188
|
{
|
|
@@ -14,14 +14,14 @@ const ChipActionsMobile = (props) => {
|
|
|
14
14
|
const { getLabel } = useModuleDictionary();
|
|
15
15
|
const menuActions = [
|
|
16
16
|
{
|
|
17
|
-
|
|
17
|
+
startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
|
|
18
18
|
onClick: handlerOpenPopoverEditArea,
|
|
19
19
|
label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area))
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
22
|
if (listAreas.length > 1) {
|
|
23
23
|
menuActions.push({
|
|
24
|
-
|
|
24
|
+
startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
|
|
25
25
|
/**
|
|
26
26
|
* OnClick
|
|
27
27
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AreaChipProps } from '../../../AreaChip/types';
|
|
2
2
|
/**
|
|
3
3
|
* TODO: Documentar
|
|
4
|
+
* @author SebastianM - automatic
|
|
5
|
+
* @createdAt 2024-11-01 12:34:48 - automatic
|
|
6
|
+
* @updatedAt 2024-11-01 12:34:49 - automatic
|
|
7
|
+
* @updatedUser SebastianM - automatic
|
|
4
8
|
*/
|
|
5
9
|
export declare const ChipMobile: {
|
|
6
10
|
(props: AreaChipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ import { E as EditAreaHeader } from "../../../AreaChip/styles.js";
|
|
|
16
16
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
17
17
|
import { R as RHFormProvider } from "../../../../../../../hook-form/RHFormContext/index.js";
|
|
18
18
|
import { T as Typography } from "../../../../../../../mui_extended/Typography/Typography.js";
|
|
19
|
-
import { A as
|
|
19
|
+
import { A as ActionsContainer } from "../../../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
20
20
|
import { A as ActionCancel } from "../../../../../../../CommonActions/components/ActionCancel/index.js";
|
|
21
21
|
import { A as ActionIntro } from "../../../../../../../CommonActions/components/ActionIntro/index.js";
|
|
22
22
|
import { P as Popover } from "../../../../../../../mui_extended/Popover/Popover.js";
|
|
@@ -182,7 +182,7 @@ const ChipMobile = (props) => {
|
|
|
182
182
|
sx: { mt: "20px" }
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
/* @__PURE__ */ jsxs(
|
|
185
|
+
/* @__PURE__ */ jsxs(ActionsContainer, { children: [
|
|
186
186
|
/* @__PURE__ */ jsx(
|
|
187
187
|
ActionCancel,
|
|
188
188
|
{
|
|
@@ -8,5 +8,5 @@ export declare const areasViewerClasses: AreasViewerClasses;
|
|
|
8
8
|
* @updatedAt 2024-10-22 19:27:23 - automatic
|
|
9
9
|
* @updatedUser Bruce Escobar - automatic
|
|
10
10
|
*/
|
|
11
|
-
export declare const useAreasViewerUtilityClasses: (ownerState: OwnerState) => Record<"root" | "areaRoot" | "areaGridLayoutPanelContainer" | "areaGridLayout" | "areaGridLayoutPopupsContainer" | "areasWindowPopUpList" | "windowRoot" | "windowHeader" | "windowHeaderTitle" | "windowHeaderMainActions" | "windowHeaderCancelHandle" | "
|
|
11
|
+
export declare const useAreasViewerUtilityClasses: (ownerState: OwnerState) => Record<"root" | "windowContent" | "areaRoot" | "areaGridLayoutPanelContainer" | "areaGridLayout" | "areaGridLayoutPopupsContainer" | "areasWindowPopUpList" | "windowRoot" | "windowHeader" | "windowHeaderTitle" | "windowHeaderMainActions" | "windowHeaderCancelHandle" | "windowRootContainer" | "windowLinearProgressRoot" | "windowLinearProgressBar" | "windowPopupRoot" | "windowModalRoot" | "panelWindowsRoot" | "panelWindowsButtonContainer" | "panelWindowsSeparator" | "loaderContainer" | "containerComponent" | "selectedWindow" | "areasLoadingErrorRoot" | "areasLoadingErrorLoading" | "areasLoadingError" | "areasLoadingErrorIcon" | "areasLoadingErrorTitle" | "areasLoadingErrorDescription" | "areasLoadingErrorDivider", string>;
|
|
12
12
|
export type ViwerClasses = ReturnType<typeof useAreasViewerUtilityClasses>;
|
|
@@ -26,7 +26,7 @@ function getMenuActions(options) {
|
|
|
26
26
|
}
|
|
27
27
|
if (windowOptions.allowPersistCookies) {
|
|
28
28
|
const saveCookiesAction = {
|
|
29
|
-
|
|
29
|
+
startIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.SAVE_COOKIES}`,
|
|
30
30
|
onClick: () => saveModuleCookies(windowId),
|
|
31
31
|
disabled: false,
|
|
32
32
|
visibility: "normal",
|
|
@@ -36,7 +36,7 @@ function getMenuActions(options) {
|
|
|
36
36
|
};
|
|
37
37
|
menuActions.push(saveCookiesAction);
|
|
38
38
|
const resetCookiesAction = {
|
|
39
|
-
|
|
39
|
+
startIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.RESET_COOKIES}`,
|
|
40
40
|
onClick: () => resetModuleCookies(windowId),
|
|
41
41
|
disabled: false,
|
|
42
42
|
visibility: "normal",
|
|
@@ -48,7 +48,7 @@ function getMenuActions(options) {
|
|
|
48
48
|
}
|
|
49
49
|
if (version) {
|
|
50
50
|
const versionAction = {
|
|
51
|
-
|
|
51
|
+
startIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.VERSION}`,
|
|
52
52
|
onClick: () => {
|
|
53
53
|
},
|
|
54
54
|
disabled: true,
|
|
@@ -20,15 +20,15 @@ function MainActions(props) {
|
|
|
20
20
|
return getMainActions(isDesktop, moduleActions);
|
|
21
21
|
}, [moduleActions, isDesktop]);
|
|
22
22
|
return /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderMainActions, children: mainActions.map((mainAction) => {
|
|
23
|
-
const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.
|
|
23
|
+
const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.label || "");
|
|
24
24
|
const onClick = (e) => {
|
|
25
|
-
mainAction.onClick(e);
|
|
25
|
+
mainAction.onClick && mainAction.onClick(e);
|
|
26
26
|
e.stopPropagation();
|
|
27
27
|
};
|
|
28
28
|
return /* @__PURE__ */ jsx(
|
|
29
29
|
IconButton,
|
|
30
30
|
{
|
|
31
|
-
src: mainAction.
|
|
31
|
+
src: mainAction.startIcon || "",
|
|
32
32
|
className: clsx(mainAction.className, "m4l_draggableCancel"),
|
|
33
33
|
onClick,
|
|
34
34
|
"aria-label": mainAction.label,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Resizable } from 'react-resizable';
|
|
2
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableProps, "children" | "width" | "height" | "className" | "onResize" | "
|
|
2
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableProps, "children" | "width" | "height" | "className" | "onResize" | "handle" | "handleSize" | "lockAspectRatio" | "minConstraints" | "maxConstraints" | "onResizeStop" | "onResizeStart" | "draggableOpts" | "resizeHandles" | "transformScale" | "axis"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {
|
|
3
3
|
ref?: import('react').Ref<Resizable> | undefined;
|
|
4
4
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ResizableBox } from 'react-resizable';
|
|
2
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableBoxProps, "children" | "style" | "width" | "height" | "className" | "onResize" | "
|
|
2
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableBoxProps, "children" | "style" | "width" | "height" | "className" | "onResize" | "handle" | "handleSize" | "lockAspectRatio" | "minConstraints" | "maxConstraints" | "onResizeStop" | "onResizeStart" | "draggableOpts" | "resizeHandles" | "transformScale" | "axis"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {
|
|
3
3
|
ref?: import('react').Ref<ResizableBox> | undefined;
|
|
4
4
|
}>;
|
|
@@ -14,9 +14,9 @@ import { w as withRenderOption } from "../RenderOption/index.js";
|
|
|
14
14
|
import { S as SkeletonRHFAutocomplete } from "../Skeleton/index.js";
|
|
15
15
|
import { L as Label } from "../../../../Label/Label.js";
|
|
16
16
|
import { T as Typography } from "../../../../mui_extended/Typography/Typography.js";
|
|
17
|
-
import { I as Image } from "../../../../Image/Image.js";
|
|
18
17
|
import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
|
|
19
18
|
import { H as HelperError } from "../../../../HelperError/HelperError.js";
|
|
19
|
+
import { I as Image } from "../../../../Image/Image.js";
|
|
20
20
|
function ComponentTypeImage(props) {
|
|
21
21
|
const {
|
|
22
22
|
name: nameRHF,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RHFInputNumberSpinnerStyles } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Estilos para el componente `RHFInputNumberSpinner`.
|
|
4
|
+
*
|
|
5
|
+
* Este objeto contiene los estilos para los diferentes slots del componente,
|
|
6
|
+
* permitiendo personalizar su apariencia a través de las propiedades definidas.
|
|
7
|
+
*/
|
|
8
|
+
export declare const rhfInputNumberSpinnerStyles: RHFInputNumberSpinnerStyles;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define los nombres de los slots de estilo para el componente `RHFInputNumberSpinner`. Estos slots se utilizan para
|
|
3
|
+
* aplicar estilos específicos y crear clases CSS únicas para los distintos elementos del componente.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RHFInputNumberSpinnerSlots {
|
|
6
|
+
root = "root",
|
|
7
|
+
label = "label",
|
|
8
|
+
inputNumberSpinner = "inputNumberSpinner",
|
|
9
|
+
helperError = "helperError"
|
|
10
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Este componente utiliza el slot `root` para aplicar estilos personalizados
|
|
3
|
+
* al contenedor principal del `RHFInputNumberSpinner`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
6
|
+
ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
7
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
8
|
+
/**
|
|
9
|
+
* Este componente utiliza el slot `label` para aplicar estilos personalizados
|
|
10
|
+
* a la etiqueta que acompaña al campo de entrada.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LabelStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Label').LabelProps, keyof import('../../../Label').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
13
|
+
ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
/**
|
|
16
|
+
* Este componente utiliza el slot `inputNumberSpinner` para aplicar estilos
|
|
17
|
+
* personalizados al campo de entrada numérica del spinner.
|
|
18
|
+
*/
|
|
19
|
+
export declare const InputNumberSpinnerStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../InputNumberSpinner/types').InputNumberSpinnerProps, keyof import('../../../InputNumberSpinner/types').InputNumberSpinnerProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
20
|
+
ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
/**
|
|
23
|
+
* Este componente utiliza el slot `inputNumberSpinner` para aplicar estilos
|
|
24
|
+
* personalizados al campo de entrada numérica del spinner.
|
|
25
|
+
*/
|
|
26
|
+
export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps, keyof import('../../../HelperError').HelperErrorProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
27
|
+
ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
28
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RHFInputNumberSpinner } from '../RHFInputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof RHFInputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/**
|
|
6
|
+
* Tipo de historia para `RHFInputNumberSpinner`.
|
|
7
|
+
*/
|
|
8
|
+
type Story = StoryObj<typeof RHFInputNumberSpinner>;
|
|
9
|
+
/**
|
|
10
|
+
* Historia base para el componente `RHFInputNumberSpinner`.
|
|
11
|
+
* Esta historia muestra la funcionalidad básica del componente.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Base: Story;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const DefaultDisabled: Story;
|
|
16
|
+
/**
|
|
17
|
+
* Historia base para el componente `RHFInputNumberSpinner`.
|
|
18
|
+
* Esta historia muestra la funcionalidad básica del componente.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SinLabel: Story;
|
|
21
|
+
export declare const SinLabelDisabled: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Historia en Skeleton para el componente `RHFInputNumberSpinner`.
|
|
24
|
+
* Esta historia muestra la funcionalidad del componente en modo Skeleton.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Skeleton: Story;
|
package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.error.stories.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RHFInputNumberSpinner } from '../RHFInputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof RHFInputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/**
|
|
6
|
+
* Tipo de historia para `RHFInputNumberSpinner`.
|
|
7
|
+
*/
|
|
8
|
+
type Story = StoryObj<typeof RHFInputNumberSpinner>;
|
|
9
|
+
/**
|
|
10
|
+
* Historia base para el componente `RHFInputNumberSpinner`.
|
|
11
|
+
* Esta historia muestra la funcionalidad básica del componente.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Base: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RHFInputNumberSpinner } from '../RHFInputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof RHFInputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/**
|
|
6
|
+
* Tipo de historia para `RHFInputNumberSpinner`.
|
|
7
|
+
*/
|
|
8
|
+
type Story = StoryObj<typeof RHFInputNumberSpinner>;
|
|
9
|
+
/**
|
|
10
|
+
* Historia base para el componente `RHFInputNumberSpinner`.
|
|
11
|
+
* Esta historia muestra la funcionalidad básica del componente.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Base: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Historia base para el componente `RHFInputNumberSpinner`.
|
|
16
|
+
* Esta historia muestra la funcionalidad básica del componente.
|
|
17
|
+
*/
|
|
18
|
+
export declare const OutlinedWithLabel: Story;
|
|
19
|
+
/**
|
|
20
|
+
* Historia base para el componente `RHFInputNumberSpinner`.
|
|
21
|
+
* Esta historia muestra la funcionalidad básica del componente.
|
|
22
|
+
*/
|
|
23
|
+
export declare const TextWithLabel: Story;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
|
+
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
4
|
+
import { LabelProps } from '../../Label';
|
|
5
|
+
import { RHFInputNumberSpinnerSlots } from './slots/RHFInputNumberSpinnerEnum';
|
|
6
|
+
import { RHFINPUTNUMBER_SPINNER_KEY_COMPONENT } from './constants';
|
|
7
|
+
/**
|
|
8
|
+
* Props para el componente RHPInputNumberSpinner
|
|
9
|
+
*/
|
|
10
|
+
export interface RHFInputNumberSpinnerProps extends Omit<LabelProps, 'label'> {
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Cantidad de números por los que se incrementará o disminuirá el valor.
|
|
14
|
+
*/
|
|
15
|
+
steps: number;
|
|
16
|
+
/**
|
|
17
|
+
* Tipo de dato del valor, puede ser 'pt' (puntos), '%' (porcentaje) o vacio.
|
|
18
|
+
*/
|
|
19
|
+
valueType?: 'pt' | '%';
|
|
20
|
+
/**
|
|
21
|
+
* Indica si el componente está deshabilitado.
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Tamaño del componente, puede ser uno de los valores definidos en 'small' , 'medium' , 'large'.
|
|
26
|
+
*/
|
|
27
|
+
sizes?: Extract<Sizes, 'small' | 'medium'>;
|
|
28
|
+
/**
|
|
29
|
+
* Valor máximo permitido para el componente.
|
|
30
|
+
*/
|
|
31
|
+
maxValue: number;
|
|
32
|
+
/**
|
|
33
|
+
* Valor mínimo permitido para el componente.
|
|
34
|
+
*/
|
|
35
|
+
minValue: number;
|
|
36
|
+
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
37
|
+
/**
|
|
38
|
+
* Prop Para el testeo del componente
|
|
39
|
+
*/
|
|
40
|
+
instaceDataTestId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Variante de estilos
|
|
43
|
+
*/
|
|
44
|
+
variants?: 'Outlined' | 'Text';
|
|
45
|
+
/**
|
|
46
|
+
* label para informar sobre el campo
|
|
47
|
+
*/
|
|
48
|
+
label?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Define las claves del objeto `RHFInputNumberSpinnerSlots`, que se utilizan para
|
|
52
|
+
* hacer referencia a los diferentes slots disponibles para estilizar el componente
|
|
53
|
+
* `RHFInputNumberSpinner`.
|
|
54
|
+
*/
|
|
55
|
+
export type RHFInputNumberSpinnerSlotsType = keyof typeof RHFInputNumberSpinnerSlots;
|
|
56
|
+
/**
|
|
57
|
+
* Representa las propiedades de estado específicas del componente `RHFInputNumberSpinner`.
|
|
58
|
+
*/
|
|
59
|
+
export interface RHFInputNumberSpinnerOwnerState {
|
|
60
|
+
/**
|
|
61
|
+
* Valor para definir el tamaño del icono.
|
|
62
|
+
*/
|
|
63
|
+
iconSize: Sizes;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Define los estilos del componente `RHFInputNumberSpinner`. Permite la personalización parcial
|
|
67
|
+
* de las reglas de estilo mediante `OverridesStyleRules`.
|
|
68
|
+
*
|
|
69
|
+
* Puede ser parcial o estar indefinido.
|
|
70
|
+
*/
|
|
71
|
+
export type RHFInputNumberSpinnerStyles = Partial<OverridesStyleRules<RHFInputNumberSpinnerSlots, typeof RHFINPUTNUMBER_SPINNER_KEY_COMPONENT, Theme>> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
3
|
import { useFormContext, Controller } from "react-hook-form";
|
|
4
4
|
import { useTheme, InputAdornment } from "@mui/material";
|
|
5
5
|
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
@@ -13,7 +13,7 @@ import { R as RHFTextFieldSlots } from "./slots/RHFTextFieldEnum.js";
|
|
|
13
13
|
import { H as HelperError } from "../../HelperError/HelperError.js";
|
|
14
14
|
const RHFTextField = forwardRef((props, ref) => {
|
|
15
15
|
const {
|
|
16
|
-
name
|
|
16
|
+
name,
|
|
17
17
|
autoComplete = "off",
|
|
18
18
|
skeletonWidth = "100%",
|
|
19
19
|
skeletonHeight = "18px",
|
|
@@ -30,42 +30,32 @@ const RHFTextField = forwardRef((props, ref) => {
|
|
|
30
30
|
color = "primary",
|
|
31
31
|
isInteger = true,
|
|
32
32
|
mandatoryMessage,
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34
33
|
helperText = true,
|
|
35
34
|
...other
|
|
36
35
|
} = props;
|
|
37
|
-
const ariaLabelledById = `field-label-${
|
|
36
|
+
const ariaLabelledById = `field-label-${name}`;
|
|
38
37
|
const {
|
|
39
38
|
control,
|
|
40
39
|
formState: { errors }
|
|
41
40
|
} = useFormContext();
|
|
42
|
-
const [currentVariant, setCurrentVariant] = useState(null);
|
|
43
41
|
const { handlerFocus, handlerOnKeyUp, handlerOnBlur } = useFormFocus();
|
|
44
42
|
const isDesktop = useResponsiveDesktop();
|
|
45
43
|
const isSkeleton = useModuleSkeleton();
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (errors[nameRHF]) {
|
|
48
|
-
setCurrentVariant("error");
|
|
49
|
-
} else if (variant) {
|
|
50
|
-
setCurrentVariant(variant);
|
|
51
|
-
} else {
|
|
52
|
-
setCurrentVariant(null);
|
|
53
|
-
}
|
|
54
|
-
}, [errors[nameRHF], variant, control]);
|
|
55
44
|
const theme = useTheme();
|
|
56
45
|
const paletteColor = getPropertyByString(
|
|
57
46
|
theme.palette,
|
|
58
|
-
disabled ? "default" : color,
|
|
47
|
+
disabled ? "default" : errors ? "error" : color,
|
|
59
48
|
theme.palette.default
|
|
60
49
|
);
|
|
61
50
|
const ownerState = {
|
|
62
|
-
name
|
|
51
|
+
name,
|
|
63
52
|
isInteger,
|
|
64
53
|
paletteColor,
|
|
65
54
|
type: type ?? "text",
|
|
66
55
|
size: !isDesktop ? "medium" : size,
|
|
67
56
|
disabled,
|
|
68
|
-
variantRHFTextField: RHFvariants
|
|
57
|
+
variantRHFTextField: RHFvariants,
|
|
58
|
+
RHFtextFieldError: !!errors[name]
|
|
69
59
|
};
|
|
70
60
|
return (
|
|
71
61
|
/* RHFTextFieldRoot: Contenedor principal del componente, es usado para aplicar los estilos css de los overrides
|
|
@@ -79,14 +69,14 @@ const RHFTextField = forwardRef((props, ref) => {
|
|
|
79
69
|
onBlur: handlerOnBlur,
|
|
80
70
|
onKeyUp: handlerOnKeyUp,
|
|
81
71
|
role: "textbox",
|
|
82
|
-
htmlFor:
|
|
72
|
+
htmlFor: name,
|
|
83
73
|
...getPropDataTestId(RHF_TEXT_FIELD_KEY_COMPONENT, RHFTextFieldSlots.root),
|
|
84
74
|
children: !isSkeleton ? (
|
|
85
75
|
/* controller: Componente usado para suscribir el componente al contexto de hook-form */
|
|
86
76
|
/* @__PURE__ */ jsx(
|
|
87
77
|
Controller,
|
|
88
78
|
{
|
|
89
|
-
name
|
|
79
|
+
name,
|
|
90
80
|
control,
|
|
91
81
|
render: ({ field: { onChange, value, ref: inputRef }, fieldState: { error } }) => {
|
|
92
82
|
const onInternalChange = (event) => {
|
|
@@ -128,8 +118,8 @@ const RHFTextField = forwardRef((props, ref) => {
|
|
|
128
118
|
className: "rhf-text-field-root",
|
|
129
119
|
value: type === "number" ? isNaN(parseFloat(value)) ? "" : value : value || "",
|
|
130
120
|
inputProps: {
|
|
131
|
-
name
|
|
132
|
-
id:
|
|
121
|
+
name,
|
|
122
|
+
id: name,
|
|
133
123
|
"aria-labelledby": ariaLabelledById,
|
|
134
124
|
...getPropDataTestId(RHF_TEXT_FIELD_KEY_COMPONENT, RHFTextFieldSlots.textField)
|
|
135
125
|
},
|
|
@@ -151,10 +141,10 @@ const RHFTextField = forwardRef((props, ref) => {
|
|
|
151
141
|
...other
|
|
152
142
|
}
|
|
153
143
|
),
|
|
154
|
-
|
|
144
|
+
error?.message ? /* @__PURE__ */ jsx(
|
|
155
145
|
HelperError,
|
|
156
146
|
{
|
|
157
|
-
message:
|
|
147
|
+
message: error.message
|
|
158
148
|
}
|
|
159
149
|
) : null
|
|
160
150
|
] });
|