@m4l/components 8.2.0-beta.devDaniel.RHFInputNumberSpinner → 8.2.0-beta.devDaniel.Tab
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 -3
- package/@types/types.d.ts +11 -8
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/index.js +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.js +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/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- 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/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.d.ts +0 -5
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.styles.d.ts +0 -8
- package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +0 -4
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerEnum.d.ts +0 -10
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerSlots.d.ts +0 -28
- package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.defaultProps.stories.d.ts +0 -26
- package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.error.stories.d.ts +0 -13
- package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.variants.stories.d.ts +0 -23
- package/components/hook-form/RHFInputNumberSpinner/types.d.ts +0 -71
- 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/index.test.d.ts +0 -1
- package/components/mui_extended/Tab/tests/utils.d.ts +0 -2
package/@types/export.d.ts
CHANGED
|
@@ -158,9 +158,6 @@ declare module '@mui/material/styles' {
|
|
|
158
158
|
M4LAccordion?: {
|
|
159
159
|
styleOverrides?: ComponentsOverrides<Theme>['M4LAccordion'];
|
|
160
160
|
};
|
|
161
|
-
M4LTab?: {
|
|
162
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LTab'];
|
|
163
|
-
};
|
|
164
161
|
M4LRHFormProvider?: {
|
|
165
162
|
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFormProvider'];
|
|
166
163
|
};
|
package/@types/types.d.ts
CHANGED
|
@@ -52,7 +52,8 @@ import type {
|
|
|
52
52
|
} from '../components/mui_extended/MenuItem/types';
|
|
53
53
|
|
|
54
54
|
import { SelectOwnerState, SelectSlotsType } from '../components/mui_extended/Select/types';
|
|
55
|
-
import {
|
|
55
|
+
import { TabOwnerState, TabSlotsType } from '../components/mui_extended/Tab/types';
|
|
56
|
+
|
|
56
57
|
|
|
57
58
|
declare module '@mui/material/styles' {
|
|
58
59
|
// Define the slots in the theme
|
|
@@ -77,7 +78,8 @@ declare module '@mui/material/styles' {
|
|
|
77
78
|
M4LSkeleton: SkeletonSlotsType;
|
|
78
79
|
M4LSelect: SelectSlotsType;
|
|
79
80
|
M4LTypography: TypographySlotsType;
|
|
80
|
-
|
|
81
|
+
M4LTab: TabSlotsType;
|
|
82
|
+
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
interface ComponentsPropsList {
|
|
@@ -102,7 +104,8 @@ declare module '@mui/material/styles' {
|
|
|
102
104
|
M4LSkeleton: Partial<SkeletonOwnerState>;
|
|
103
105
|
M4LSelect: Partial<SelectOwnerState>;
|
|
104
106
|
M4LTypography: Partial<TypographyOwnerState>;
|
|
105
|
-
|
|
107
|
+
M4LTab: Partial<TabOwnerState>;
|
|
108
|
+
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
interface Components {
|
|
@@ -185,6 +188,7 @@ declare module '@mui/material/styles' {
|
|
|
185
188
|
defaultProps?: ComponentsPropsList['M4LControlIncrement'];
|
|
186
189
|
styleOverrides?: ComponentsOverrides<Theme>['M4LControlIncrement'];
|
|
187
190
|
variants?: ComponentsVariants['M4LControlIncrement'];
|
|
191
|
+
}
|
|
188
192
|
M4LMenuItem?: {
|
|
189
193
|
defaultProps?: ComponentsPropsList['M4LMenuItem'];
|
|
190
194
|
styleOverrides?: ComponentsOverrides<Theme>['M4LMenuItem'];
|
|
@@ -205,11 +209,10 @@ declare module '@mui/material/styles' {
|
|
|
205
209
|
styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
|
|
206
210
|
variants?: ComponentsVariants['M4LTypography'];
|
|
207
211
|
};
|
|
208
|
-
|
|
209
|
-
defaultProps?: ComponentsPropsList['
|
|
210
|
-
styleOverrides?: ComponentsOverrides<Theme>['
|
|
211
|
-
variants?: ComponentsVariants['
|
|
212
|
+
M4LTab?: {
|
|
213
|
+
defaultProps?: ComponentsPropsList['M4LTab'];
|
|
214
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTab'];
|
|
215
|
+
variants?: ComponentsVariants['M4LTab'];
|
|
212
216
|
};
|
|
213
217
|
}
|
|
214
|
-
}
|
|
215
218
|
}
|
|
@@ -7,7 +7,7 @@ import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css";
|
|
|
7
7
|
import "@geoman-io/leaflet-geoman-free";
|
|
8
8
|
import clsx from "clsx";
|
|
9
9
|
import { D as DivTabGpsToolsRoot } from "../../styles.js";
|
|
10
|
-
import { T as Tab } from "../../../../../mui_extended/Tab/
|
|
10
|
+
import { T as Tab } from "../../../../../mui_extended/Tab/Tab.js";
|
|
11
11
|
import { G as GeofencesList } from "./subcomponents/GeofencesList/index.js";
|
|
12
12
|
import { u as useLayers } from "../../hooks/useLayers/index.js";
|
|
13
13
|
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../dictionary.js";
|
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { T as Tab } from "../../../../../../../../../mui_extended/Tab/
|
|
5
|
+
import { T as Tab } from "../../../../../../../../../mui_extended/Tab/Tab.js";
|
|
6
6
|
import { G as GeneralData } from "../GeneralData/index.js";
|
|
7
7
|
import { C as ConfigData } from "../ConfigData/index.js";
|
|
8
8
|
import { S as StyleData } from "../StyleData/index.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define los nombres de los slots de estilo para el componente `Tab`. 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 TabSlots {
|
|
6
|
+
root = "root",
|
|
7
|
+
icon = "icon",
|
|
8
|
+
tipography = "tipography"
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RootStyled`:
|
|
3
|
+
* Componente personalizado de pestaña (`MuiTab`) basado en el componente de pestañas de Material-UI.
|
|
4
|
+
* Utiliza el slot `root` para agregar estilos específicos al botón de la pestaña en la interfaz.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').TabOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
8
|
+
}, "children" | "value" | "action" | "style" | "icon" | "disabled" | "sx" | "classes" | "className" | "tabIndex" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "label" | "iconPosition" | "wrapped">, "children" | "value" | "ref" | "title" | "id" | "action" | "hidden" | "color" | "content" | "style" | "icon" | "disabled" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "label" | "key" | "iconPosition" | "wrapped"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabOwnerState> & Record<string, unknown> & {
|
|
9
|
+
ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
|
|
10
|
+
}, {}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* `TypographyStyled`:
|
|
13
|
+
* Componente de texto estilizado basado en `Typography`, se usa para mostrar texto en cada pestaña.
|
|
14
|
+
* El slot `tipography` permite la personalización del estilo tipográfico de las pestañas.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TypographyStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Typography/types').TypographyProps, keyof import('../../Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabOwnerState> & Record<string, unknown> & {
|
|
17
|
+
ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
|
|
18
|
+
}, {}, {}>;
|
|
19
|
+
/**
|
|
20
|
+
* `IconStyled`:
|
|
21
|
+
* Componente de ícono estilizado basado en `Icon`, utilizado para mostrar un ícono en cada pestaña.
|
|
22
|
+
* Usa el slot `icon` para modificar o añadir estilos específicos a los íconos en las pestañas.
|
|
23
|
+
*/
|
|
24
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabOwnerState> & Record<string, unknown> & {
|
|
25
|
+
ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
|
|
26
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { Tab } from "@mui/material";
|
|
3
|
+
import { t as tabStyles } from "../Tab.styles.js";
|
|
4
|
+
import { T as TAB_KEY_COMPONENT } from "../constants.js";
|
|
5
|
+
import { T as TabSlots } from "./TabEnum.js";
|
|
6
|
+
import { T as Typography } from "../../Typography/Typography.js";
|
|
7
|
+
import { I as Icon } from "../../../Icon/Icon.js";
|
|
8
|
+
const RootStyled = styled(Tab, {
|
|
9
|
+
name: TAB_KEY_COMPONENT,
|
|
10
|
+
slot: TabSlots.root
|
|
11
|
+
})(tabStyles?.root);
|
|
12
|
+
const TypographyStyled = styled(Typography, {
|
|
13
|
+
name: TAB_KEY_COMPONENT,
|
|
14
|
+
slot: TabSlots.tipography
|
|
15
|
+
})(tabStyles?.tipography);
|
|
16
|
+
const IconStyled = styled(Icon, {
|
|
17
|
+
name: TAB_KEY_COMPONENT,
|
|
18
|
+
slot: TabSlots.icon
|
|
19
|
+
})(tabStyles?.icon);
|
|
20
|
+
export {
|
|
21
|
+
IconStyled as I,
|
|
22
|
+
RootStyled as R,
|
|
23
|
+
TypographyStyled as T
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
4
|
+
import { useTheme } from "@mui/material";
|
|
5
|
+
import { a as TYPOGRAPHY_KEY, b as TAB_SPECIFY, I as ICON_KEY } from "./constants.js";
|
|
6
|
+
import { useRef, useMemo } from "react";
|
|
7
|
+
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
|
+
import { R as RootStyled, T as TypographyStyled, I as IconStyled } from "./Slots/TabSlots.js";
|
|
9
|
+
function Tab(props) {
|
|
10
|
+
const {
|
|
11
|
+
SKTWidth,
|
|
12
|
+
SKTHeight,
|
|
13
|
+
size = "medium",
|
|
14
|
+
// Tamaño del tab, por defecto 'medium'.
|
|
15
|
+
disabled,
|
|
16
|
+
// Indica si el tab está deshabilitado.
|
|
17
|
+
label,
|
|
18
|
+
// Texto que se muestra en el tab.
|
|
19
|
+
urlIcon,
|
|
20
|
+
// URL del icono a mostrar en el tab.
|
|
21
|
+
value,
|
|
22
|
+
...other
|
|
23
|
+
// Otras propiedades que se pasan al componente.
|
|
24
|
+
} = props;
|
|
25
|
+
const refMuiTab = useRef(null);
|
|
26
|
+
const isSelected = useMemo(() => {
|
|
27
|
+
if (refMuiTab.current) {
|
|
28
|
+
return refMuiTab.current?.classList?.contains("Mui-selected");
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}, [refMuiTab.current]);
|
|
32
|
+
const { currentSize } = useComponentSize(size);
|
|
33
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
34
|
+
const isSkeleton = useModuleSkeleton();
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
const paletteColor = getPropertyByString(theme.vars.palette, disabled || !isSelected || isSkeleton ? "default" : "primary", theme.vars.palette.default);
|
|
37
|
+
const OwnerState = {
|
|
38
|
+
paletteColor,
|
|
39
|
+
size: adjustedSize,
|
|
40
|
+
disabled,
|
|
41
|
+
skeleton: isSkeleton
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
RootStyled,
|
|
45
|
+
{
|
|
46
|
+
ref: refMuiTab,
|
|
47
|
+
label: label ? /* @__PURE__ */ jsx(TypographyStyled, { className: clsx(TYPOGRAPHY_KEY, TAB_SPECIFY), skeletonWidth: 40, ownerState: { OwnerState }, variant: "body", children: label }) : void 0,
|
|
48
|
+
disabled,
|
|
49
|
+
ownerState: { ...OwnerState },
|
|
50
|
+
icon: urlIcon ? /* @__PURE__ */ jsx(
|
|
51
|
+
IconStyled,
|
|
52
|
+
{
|
|
53
|
+
className: clsx(ICON_KEY, TAB_SPECIFY),
|
|
54
|
+
ownerState: { OwnerState },
|
|
55
|
+
src: urlIcon,
|
|
56
|
+
size
|
|
57
|
+
}
|
|
58
|
+
) : void 0,
|
|
59
|
+
value,
|
|
60
|
+
tabIndex: 0,
|
|
61
|
+
...other
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
Tab as T
|
|
67
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
const tabStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Slot Raíz: Estilos para el contenedor principal del componente Tab.
|
|
4
|
+
*/
|
|
5
|
+
root: ({ theme, ownerState }) => ({
|
|
6
|
+
// Estructura y layout básico
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
width: "fit-content",
|
|
11
|
+
minHeight: "fit-content",
|
|
12
|
+
minWidth: "fit-content",
|
|
13
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
14
|
+
opacity: 1,
|
|
15
|
+
overflow: "visible",
|
|
16
|
+
// Bordes y radio de borde
|
|
17
|
+
border: theme.vars.size.borderStroke.container,
|
|
18
|
+
borderColor: "transparent",
|
|
19
|
+
borderBottom: 0,
|
|
20
|
+
borderTopLeftRadius: `calc(${theme.vars.size.borderRadius.r1} - 1px)`,
|
|
21
|
+
borderTopRightRadius: `calc(${theme.vars.size.borderRadius.r1} - 1px)`,
|
|
22
|
+
boxSizing: "border-box",
|
|
23
|
+
// Padding
|
|
24
|
+
paddingTop: 0,
|
|
25
|
+
paddingBottom: 0,
|
|
26
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
27
|
+
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
28
|
+
position: "relative",
|
|
29
|
+
// Altura para vista móvil y de escritorio basada en el tamaño
|
|
30
|
+
...theme.generalSettings.isMobile ? {
|
|
31
|
+
...ownerState.size === "medium" && {
|
|
32
|
+
height: theme.vars.size.mobile.medium.container
|
|
33
|
+
},
|
|
34
|
+
...ownerState.size === "small" && {
|
|
35
|
+
height: theme.vars.size.mobile.small.container
|
|
36
|
+
}
|
|
37
|
+
} : {
|
|
38
|
+
...ownerState.size === "medium" && {
|
|
39
|
+
height: theme.vars.size.desktop.medium.container
|
|
40
|
+
},
|
|
41
|
+
...ownerState.size === "small" && {
|
|
42
|
+
height: theme.vars.size.desktop.small.container
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
// Ajuste de alineación del icono
|
|
46
|
+
"& .MuiTab-iconWrapper": {
|
|
47
|
+
marginBottom: 1
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* **Pseudoclases**:
|
|
51
|
+
* - Estilos para los estados hover, focus-visible y active.
|
|
52
|
+
*/
|
|
53
|
+
"&:hover": {
|
|
54
|
+
background: theme.vars.palette.background.hover
|
|
55
|
+
},
|
|
56
|
+
"&:focus-visible": {
|
|
57
|
+
background: ownerState.paletteColor?.hoverOpacity,
|
|
58
|
+
"&::before": {
|
|
59
|
+
content: '""',
|
|
60
|
+
position: "absolute",
|
|
61
|
+
top: `-${theme.size.baseSpacings.sp1}`,
|
|
62
|
+
left: `-${theme.size.baseSpacings.sp1}`,
|
|
63
|
+
right: `-${theme.size.baseSpacings.sp1}`,
|
|
64
|
+
bottom: 0,
|
|
65
|
+
boxSizing: "border-box",
|
|
66
|
+
border: theme.vars.size.borderStroke.container,
|
|
67
|
+
borderBottom: 0,
|
|
68
|
+
borderColor: theme.vars.palette.border.main,
|
|
69
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
70
|
+
borderBottomRightRadius: 0,
|
|
71
|
+
borderBottomLeftRadius: 0
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"&:active": {
|
|
75
|
+
background: ownerState.paletteColor?.activeOpacity
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* **Estado Seleccionado**:
|
|
79
|
+
* - Estilos aplicados cuando la pestaña está en estado seleccionado (`.Mui-selected`).
|
|
80
|
+
* - Incluye estilos específicos para el icono y la tipografía.
|
|
81
|
+
*/
|
|
82
|
+
"&.Mui-selected": {
|
|
83
|
+
border: theme.vars.size.borderStroke.container,
|
|
84
|
+
borderColor: theme.vars.palette.border.secondary,
|
|
85
|
+
borderBottom: 0,
|
|
86
|
+
".icon.M4lclassCssSpecificity div": {
|
|
87
|
+
backgroundColor: !ownerState.disabled ? ownerState.paletteColor?.main : theme.vars.palette.text.secondary
|
|
88
|
+
},
|
|
89
|
+
"span": {
|
|
90
|
+
color: !ownerState.disabled ? ownerState.paletteColor?.main : theme.vars.palette.text.secondary
|
|
91
|
+
},
|
|
92
|
+
// Efecto ripple en estado seleccionado
|
|
93
|
+
"& .MuiTouchRipple-root": {
|
|
94
|
+
borderTopLeftRadius: theme.vars.size.baseSpacings["sp0-5"],
|
|
95
|
+
borderTopRightRadius: theme.vars.size.baseSpacings["sp0-5"]
|
|
96
|
+
},
|
|
97
|
+
"&::after": {
|
|
98
|
+
content: '""',
|
|
99
|
+
width: "70%",
|
|
100
|
+
transform: "translateX(20%)",
|
|
101
|
+
height: theme.vars.size.borderRadius["r0-5"],
|
|
102
|
+
left: 0,
|
|
103
|
+
top: -1,
|
|
104
|
+
backgroundColor: ownerState.skeleton ? theme.vars.palette.background.surface : ownerState.disabled ? theme.vars.palette.background.surface : ownerState.paletteColor?.main,
|
|
105
|
+
borderEndStartRadius: theme.vars.size.borderRadius["r0-5"],
|
|
106
|
+
borderEndEndRadius: theme.vars.size.borderRadius["r0-5"],
|
|
107
|
+
position: "absolute"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"&.Mui-selected:hover": {
|
|
111
|
+
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
112
|
+
},
|
|
113
|
+
"&.Mui-selected:active": {
|
|
114
|
+
background: ownerState.paletteColor?.activeOpacity,
|
|
115
|
+
".icon.M4lclassCssSpecificity div": {
|
|
116
|
+
backgroundColor: ownerState.paletteColor?.active
|
|
117
|
+
},
|
|
118
|
+
"span": {
|
|
119
|
+
color: ownerState.paletteColor?.active
|
|
120
|
+
},
|
|
121
|
+
"&::after": {
|
|
122
|
+
background: ownerState.paletteColor?.active
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
* Slot de Icono:
|
|
128
|
+
* - **Estilos Generales**: Configura el color base del ícono, con especificidad adicional para clases específicas.
|
|
129
|
+
*/
|
|
130
|
+
icon: ({ theme }) => ({
|
|
131
|
+
"&.M4lclassCssSpecificity div": {
|
|
132
|
+
backgroundColor: theme.vars.palette.text.secondary
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
/**
|
|
136
|
+
* Slot de Tipografía:
|
|
137
|
+
* - **Estilos Generales**: Configura el color base del texto, aplicando especificidad para clases específicas.
|
|
138
|
+
*/
|
|
139
|
+
tipography: ({ theme }) => ({
|
|
140
|
+
"&.M4lclassCssSpecificity": {
|
|
141
|
+
color: theme.vars.palette.text.secondary
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
};
|
|
145
|
+
export {
|
|
146
|
+
tabStyles as t
|
|
147
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nombre de clase que se usa para dar identidad a los slots del componente.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TAB_KEY_COMPONENT = "M4LTab";
|
|
5
|
+
/**
|
|
6
|
+
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
7
|
+
* tener la necesidad de agregar valores en !important.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TAB_SPECIFY = "M4lclassCssSpecificity";
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare const TYPOGRAPHY_KEY = "tipography";
|
|
14
|
+
export declare const ICON_KEY = "icon";
|
|
@@ -1,6 +1,57 @@
|
|
|
1
|
-
import { TabProps as MUITabProps } from '@mui/material';
|
|
2
|
-
|
|
1
|
+
import { TabProps as MUITabProps, PaletteColor, Theme } from '@mui/material';
|
|
2
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
3
|
+
import { Sizes } from '@m4l/styles';
|
|
4
|
+
import { TabSlots } from './Slots/TabEnum';
|
|
5
|
+
import { TAB_KEY_COMPONENT } from './constants';
|
|
6
|
+
/**
|
|
7
|
+
* Propiedades personalizadas para el componente `Tab`, extendiendo algunas propiedades de MUI.
|
|
8
|
+
*/
|
|
9
|
+
export interface TabProps extends Omit<MUITabProps, 'size' | 'label' | 'color'> {
|
|
10
|
+
/**
|
|
11
|
+
* Anchura del componente en estado Skeleton.
|
|
12
|
+
* Puede ser un valor numérico o un string con unidades CSS (por ejemplo, `px`, `%`, etc.).
|
|
13
|
+
*/
|
|
3
14
|
SKTWidth: string | number;
|
|
15
|
+
/**
|
|
16
|
+
* Altura del componente en estado Skeleton.
|
|
17
|
+
* Puede ser un valor numérico o un string con unidades CSS (por ejemplo, `px`, `%`, etc.).
|
|
18
|
+
*/
|
|
4
19
|
SKTHeight: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* Identificador único para pruebas unitarias.
|
|
22
|
+
*/
|
|
5
23
|
dataTestId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Tamaño del `Tab`, limitado a los valores `small` o `medium`.
|
|
26
|
+
*/
|
|
27
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
28
|
+
/**
|
|
29
|
+
* URL del icono a mostrar en el `Tab`.
|
|
30
|
+
*/
|
|
31
|
+
urlIcon?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Texto a mostrar en el `Tab`.
|
|
34
|
+
*/
|
|
35
|
+
label?: string;
|
|
6
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Tipo de slot del `Tab`, basado en las opciones definidas en `TabSlots`.
|
|
39
|
+
*/
|
|
40
|
+
export type TabSlotsType = keyof typeof TabSlots;
|
|
41
|
+
/**
|
|
42
|
+
* Estado interno del propietario del `Tab`.
|
|
43
|
+
*/
|
|
44
|
+
export interface TabOwnerState extends Pick<TabProps, 'size' | 'disabled'> {
|
|
45
|
+
/**
|
|
46
|
+
* Indica si el `Tab` está en estado Skeleton.
|
|
47
|
+
*/
|
|
48
|
+
skeleton: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Color de la paleta asociado al `Tab`.
|
|
51
|
+
*/
|
|
52
|
+
paletteColor: PaletteColor;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Estilos personalizados para el `Tab`, sobreescribiendo las reglas de estilo.
|
|
56
|
+
*/
|
|
57
|
+
export type TabStyles = Partial<OverridesStyleRules<TabSlots, typeof TAB_KEY_COMPONENT, Theme> | undefined> | undefined;
|
|
@@ -24,7 +24,7 @@ export * from './TabContent';
|
|
|
24
24
|
export { Pager } from './Pager';
|
|
25
25
|
export type { PagerProps } from './Pager/types';
|
|
26
26
|
export { getPagerComponentsDictionary } from './Pager/dicctionary';
|
|
27
|
-
export { Tab } from './Tab';
|
|
27
|
+
export { Tab } from './Tab/Tab';
|
|
28
28
|
export * from './TabContext';
|
|
29
29
|
export * from './Typography/Typography';
|
|
30
30
|
export * from './ToggleButton';
|
package/index.js
CHANGED
|
@@ -151,7 +151,7 @@ import { L as L9 } from "./components/mui_extended/LinkWithRoute/index.js";
|
|
|
151
151
|
import { L as L10 } from "./components/mui_extended/LoadingButton/index.js";
|
|
152
152
|
import { P as P13 } from "./components/mui_extended/Pager/index.js";
|
|
153
153
|
import { g as g26 } from "./components/mui_extended/Pager/dicctionary.js";
|
|
154
|
-
import { T as T5 } from "./components/mui_extended/Tab/
|
|
154
|
+
import { T as T5 } from "./components/mui_extended/Tab/Tab.js";
|
|
155
155
|
import { a as a9 } from "./components/mui_extended/MenuActions/dictionary.js";
|
|
156
156
|
import { a as a10, M as M11 } from "./components/mui_extended/MenuActions/MenuActions.js";
|
|
157
157
|
import { T as T6 } from "./components/mui_extended/Tooltip/Tooltip.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Tab } from '../../../../../../src/components/mui_extended/Tab';
|
|
3
|
+
/**
|
|
4
|
+
* Información meta para Storybook del componente `Tab`, en la variante deshabilitada.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Tab>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof Tab>;
|
|
9
|
+
/**
|
|
10
|
+
* Historia `Base`: Tab deshabilitado con icono, texto, y sin efecto ripple.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Base: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Historia `DisabledActiveWithIconAndText`: Tab activo, deshabilitado, con icono y texto.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DisabledActiveWithIconAndText: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Historia `DisabledActiveWithText`: Tab activo, deshabilitado, solo con texto.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DisabledActiveWithText: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Historia `DisabledActiveWithIcon`: Tab activo, deshabilitado, solo con icono.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DisabledActiveWithIcon: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Historia `DisabledDefaultWithIconAndText`: Tab por defecto, deshabilitado, con icono y texto.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DisabledDefaultWithIconAndText: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Historia `DisabledDefaultActiveWithText`: Tab por defecto activo, deshabilitado, solo con texto.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DisabledDefaultActiveWithText: Story;
|
|
33
|
+
/**
|
|
34
|
+
* Historia `DisabledDefaultActiveWithIcon`: Tab por defecto activo, deshabilitado, solo con icono.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DisabledDefaultActiveWithIcon: Story;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Tab } from '../../../../../../src/components/mui_extended/Tab';
|
|
3
|
+
/**
|
|
4
|
+
* The Tab component groups related content, enabling navigation without leaving the page.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Tab>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof Tab>;
|
|
9
|
+
/**
|
|
10
|
+
* Base tab component with icon and text
|
|
11
|
+
*/
|
|
12
|
+
export declare const Base: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Active Tab with icon and text
|
|
15
|
+
*/
|
|
16
|
+
export declare const ActiveWithIconAndText: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Active Tab with text only
|
|
19
|
+
*/
|
|
20
|
+
export declare const ActiveWithText: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Active Tab with icon only
|
|
23
|
+
*/
|
|
24
|
+
export declare const ActiveWithIcon: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Default Tab with icon and text
|
|
27
|
+
*/
|
|
28
|
+
export declare const DefaultWithIconAndText: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Default active Tab with text only
|
|
31
|
+
*/
|
|
32
|
+
export declare const DefaultActiveWithText: Story;
|
|
33
|
+
/**
|
|
34
|
+
* Default active Tab with icon only
|
|
35
|
+
*/
|
|
36
|
+
export declare const DefaultActiveWithIcon: Story;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Tab } from '../../../../../../src/components/mui_extended/Tab';
|
|
3
|
+
/**
|
|
4
|
+
* El componente Tab agrupa contenido relacionado y permite la navegación sin salir de la página.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Tab>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof Tab>;
|
|
9
|
+
/**
|
|
10
|
+
* Tab base con icono y tamaño mediano, estilo seleccionado (activo).
|
|
11
|
+
*/
|
|
12
|
+
export declare const Base: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Tab activo de tamaño pequeño con icono.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SmallActive: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Tab activo de tamaño mediano con icono.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MediumActive: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Tab por defecto de tamaño pequeño con icono.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SmallDefault: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Tab por defecto de tamaño mediano con icono.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MediumDefault: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Tab } from '../../../../../../src/components/mui_extended/Tab';
|
|
3
|
+
/**
|
|
4
|
+
* El componente Tab agrupa contenido relacionado y permite la navegación sin salir de la página.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Tab>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof Tab>;
|
|
9
|
+
/**
|
|
10
|
+
* Tab en estado Skeleton cuando está activo, con icono y texto.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SkeletonActiveWithIconAndText: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Tab en estado Skeleton cuando está activo, con solo texto.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SkeletonActiveWithText: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Tab en estado Skeleton cuando está activo, con solo icono.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SkeletonActiveWithIcon: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Tab en estado Skeleton por defecto, con icono y texto.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SkeletonDefaultWithIconAndText: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Tab en estado Skeleton por defecto, con solo texto.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SkeletonDefaultWithText: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Tab en estado Skeleton por defecto, con solo icono.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SkeletonDefaultWithIcon: Story;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}, {}, {}>;
|
|
@@ -1,26 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,23 +0,0 @@
|
|
|
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;
|
|
@@ -1,71 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export declare const componentName = "M4LTab";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TabClassesType } from './types';
|
|
2
|
-
export declare const tabClasses: TabClassesType;
|
|
3
|
-
export declare function getTabUtilityClass(slot: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* TODO: Documentar
|
|
6
|
-
*/
|
|
7
|
-
export declare const tabUtilityClasses: () => {
|
|
8
|
-
skeleton: string;
|
|
9
|
-
root: string;
|
|
10
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
-
import { c as componentName } from "./constants.js";
|
|
4
|
-
generateUtilityClasses(componentName, [
|
|
5
|
-
/* elements */
|
|
6
|
-
"root",
|
|
7
|
-
"skeleton"
|
|
8
|
-
/* states or variants of elements */
|
|
9
|
-
]);
|
|
10
|
-
function getTabUtilityClass(slot) {
|
|
11
|
-
return generateUtilityClass(componentName, slot);
|
|
12
|
-
}
|
|
13
|
-
const tabUtilityClasses = () => {
|
|
14
|
-
const slots = {
|
|
15
|
-
root: ["root"],
|
|
16
|
-
skeleton: ["skeleton"]
|
|
17
|
-
};
|
|
18
|
-
const composedClasses = unstable_composeClasses(slots, getTabUtilityClass, {});
|
|
19
|
-
return {
|
|
20
|
-
...composedClasses
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
tabUtilityClasses as t
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const COMPONENT_PREFIX = "m4l-tab";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useModuleSkeleton } from "@m4l/core";
|
|
3
|
-
import { Tab as Tab$1, Skeleton } from "@mui/material";
|
|
4
|
-
import { T as TabRoot, S as SKTTabWrapper } from "./styles.js";
|
|
5
|
-
import { t as tabUtilityClasses } from "./classes/index.js";
|
|
6
|
-
import clsx from "clsx";
|
|
7
|
-
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.js";
|
|
8
|
-
import { g as getNameDataTestId } from "../../../test/getNameDataTestId.js";
|
|
9
|
-
import { C as COMPONENT_PREFIX } from "./constant.js";
|
|
10
|
-
function Tab(props) {
|
|
11
|
-
const { SKTWidth, SKTHeight, className, dataTestId = "", ...other } = props;
|
|
12
|
-
const isSkeleton = useModuleSkeleton();
|
|
13
|
-
const classes = tabUtilityClasses();
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
TabRoot,
|
|
16
|
-
{
|
|
17
|
-
className: clsx(classes.root, className),
|
|
18
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
19
|
-
[TEST_PROP_ID]: getNameDataTestId(COMPONENT_PREFIX, "root", dataTestId)
|
|
20
|
-
} : {},
|
|
21
|
-
children: !isSkeleton ? /* @__PURE__ */ jsx(Tab$1, { ...other }) : /* @__PURE__ */ jsx(
|
|
22
|
-
SKTTabWrapper,
|
|
23
|
-
{
|
|
24
|
-
className: classes.skeleton,
|
|
25
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
26
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
27
|
-
COMPONENT_PREFIX,
|
|
28
|
-
"skeleton",
|
|
29
|
-
dataTestId
|
|
30
|
-
)
|
|
31
|
-
} : {},
|
|
32
|
-
children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: SKTWidth, height: SKTHeight })
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
Tab as T
|
|
40
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const TabRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
-
export declare const SKTTabWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { styled } from "@mui/material/styles";
|
|
2
|
-
const TabRoot = styled("div")(({ theme }) => ({
|
|
3
|
-
...theme.components?.M4LTab?.styleOverrides || {}
|
|
4
|
-
}));
|
|
5
|
-
const SKTTabWrapper = styled("div")(({ theme }) => ({
|
|
6
|
-
padding: theme.spacing(1.5, 2)
|
|
7
|
-
}));
|
|
8
|
-
export {
|
|
9
|
-
SKTTabWrapper as S,
|
|
10
|
-
TabRoot as T
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|