@m4l/components 8.1.0-beta.devDaniel.inputNumberSpinner → 8.1.0-beta.devLeury.Select
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 +35 -16
- package/components/HelperError/HelperError.js +1 -2
- package/components/HelperError/types.d.ts +0 -4
- package/components/Label/Label.js +1 -9
- package/components/Label/types.d.ts +0 -4
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.d.ts +5 -0
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.stories.d.ts +21 -0
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.styles.d.ts +2 -0
- package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +1 -0
- package/components/hook-form/RHFInputNumberSpinner/index.d.ts +1 -0
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerSlots.d.ts +23 -0
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnnerEnum.d.ts +9 -0
- package/components/hook-form/RHFInputNumberSpinner/slots/index.d.ts +2 -0
- package/components/hook-form/RHFInputNumberSpinner/subcomponents/SkeletonSpinner/index.d.ts +4 -0
- package/components/hook-form/RHFInputNumberSpinner/types.d.ts +21 -0
- package/components/hook-form/RHFInputNumberSpinner/useRHFInputNumberSpinner.d.ts +13 -0
- package/components/mui_extended/MenuItem/MenuItem.d.ts +11 -0
- package/components/mui_extended/MenuItem/MenuItem.stories.d.ts +37 -0
- package/components/mui_extended/MenuItem/MenuItem.styles.d.ts +2 -0
- package/components/mui_extended/MenuItem/constants.d.ts +8 -0
- package/components/mui_extended/MenuItem/index.d.ts +2 -0
- package/components/mui_extended/MenuItem/slots/MenuItemEnum.d.ts +5 -0
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +11 -0
- package/components/mui_extended/MenuItem/slots/index.d.ts +2 -0
- package/components/mui_extended/MenuItem/types.d.ts +41 -0
- package/components/mui_extended/Select/Select.d.ts +9 -0
- package/components/mui_extended/Select/Select.styles.d.ts +2 -0
- package/components/mui_extended/Select/constants.d.ts +8 -0
- package/components/mui_extended/Select/index.d.ts +2 -0
- package/components/mui_extended/Select/slots/SelectEnum.d.ts +6 -0
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +12 -0
- package/components/mui_extended/Select/slots/index.d.ts +2 -0
- package/components/mui_extended/Select/stories/SelectOutlied.stories.d.ts +74 -0
- package/components/mui_extended/Select/stories/SelectStandar.stories.d.ts +25 -0
- package/components/mui_extended/Select/types.d.ts +66 -0
- package/package.json +1 -1
- package/components/ControlIncrement/ControlIncrement.d.ts +0 -5
- package/components/ControlIncrement/ControlIncrement.styles.d.ts +0 -8
- package/components/ControlIncrement/constants.d.ts +0 -25
- package/components/ControlIncrement/slots/ControlIncrementEnum.d.ts +0 -6
- package/components/ControlIncrement/slots/ControltrolIncrementSlots.d.ts +0 -14
- package/components/ControlIncrement/slots/index.d.ts +0 -2
- package/components/ControlIncrement/stories/ControlClick/ControlIncrement.controlclick.stories.d.ts +0 -13
- package/components/ControlIncrement/stories/DefaultAndDisabled/ControlIncrement.defaultanddisabled.stories.d.ts +0 -17
- package/components/ControlIncrement/stories/Sizes/ControlIncrement.sizes.stories.d.ts +0 -21
- package/components/ControlIncrement/types.d.ts +0 -56
- package/components/InputNumberSpinner/InputNumberSpinner.d.ts +0 -5
- package/components/InputNumberSpinner/InputNumberSpinner.styles.d.ts +0 -8
- package/components/InputNumberSpinner/constants.d.ts +0 -9
- package/components/InputNumberSpinner/hooks/types.d.ts +0 -13
- package/components/InputNumberSpinner/hooks/useInputNumberSpinner.d.ts +0 -19
- package/components/InputNumberSpinner/index.d.ts +0 -2
- package/components/InputNumberSpinner/slots/InputNumberSpinnerEnum.d.ts +0 -7
- package/components/InputNumberSpinner/slots/InputNumberSpinnerSlots.d.ts +0 -15
- package/components/InputNumberSpinner/slots/index.d.ts +0 -2
- package/components/InputNumberSpinner/stories/Default/InputNumberSpinner.default.stories.d.ts +0 -25
- package/components/InputNumberSpinner/stories/Error/InputNumberSpinner.error.stories.d.ts +0 -25
- package/components/InputNumberSpinner/stories/Sizes/InputNumberSpinner.sizes.stories.d.ts +0 -41
- package/components/InputNumberSpinner/stories/Variants/InputNumberSpinner.variants.stories.d.ts +0 -25
- package/components/InputNumberSpinner/types.d.ts +0 -64
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Select } from '../Select';
|
|
3
|
+
declare const meta: Meta<typeof Select>;
|
|
4
|
+
type Story = StoryObj<typeof Select>;
|
|
5
|
+
/**
|
|
6
|
+
* Base Select component
|
|
7
|
+
*/
|
|
8
|
+
export declare const Base: Story;
|
|
9
|
+
export declare const SelectWithoutIcon: Story;
|
|
10
|
+
export declare const SelectWithIcon: Story;
|
|
11
|
+
export declare const SelectWithHoverWithoutIcon: Story;
|
|
12
|
+
export declare const SelectWithHoverWithIcon: Story;
|
|
13
|
+
export declare const SelectWithFocusWithoutIcon: Story;
|
|
14
|
+
export declare const SelectWithFocusWithIcon: Story;
|
|
15
|
+
export declare const SelectWithErrorWithoutIcon: Story;
|
|
16
|
+
export declare const SelectWithErrorWithIcon: Story;
|
|
17
|
+
export declare const SelectErrorWithHoverWithoutIcon: Story;
|
|
18
|
+
export declare const SelectErrorWithHoverWithIcon: Story;
|
|
19
|
+
export declare const SelectDisabledWithoutIcon: Story;
|
|
20
|
+
export declare const SelectDisabledWithIcon: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Select in skeleton mode
|
|
23
|
+
*/
|
|
24
|
+
export declare const WithSkeleton: Story;
|
|
25
|
+
export default meta;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SelectProps as MUISelectProps } from '@mui/material/Select';
|
|
2
|
+
import { Theme, PaletteColor } from '@mui/material';
|
|
3
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
4
|
+
import { Sizes, ComponentPalletColor } from '@m4l/styles';
|
|
5
|
+
import { SELECT_KEY_COMPONENT } from './constants';
|
|
6
|
+
import { SelectSlots } from './slots';
|
|
7
|
+
/**
|
|
8
|
+
* Representa una opción dentro del Select.
|
|
9
|
+
* id - Identificador único de la opción. Puede ser número o string.
|
|
10
|
+
* label - Texto que representa la opción.
|
|
11
|
+
* [icon] - (Opcional) URL del ícono asociado a la opción.
|
|
12
|
+
* @createdAt 2024-10-22 10:30:26 - automatic
|
|
13
|
+
*/
|
|
14
|
+
export type selectOption = {
|
|
15
|
+
id: number | string;
|
|
16
|
+
label: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Propiedades que acepta el componente `Select`, extendiendo las propiedades de Material-UI `SelectProps`.
|
|
21
|
+
* [id] - Identificador opcional del componente.
|
|
22
|
+
* [size] - Tamaño del Select, valores posibles: 'small', 'medium', etc.
|
|
23
|
+
* [src] - Fuente opcional, si es aplicable.
|
|
24
|
+
* options - Array de opciones que recibirá el Select.
|
|
25
|
+
* value - Valor o valores seleccionados.
|
|
26
|
+
* onChange - Función que se ejecuta al cambiar la selección.
|
|
27
|
+
* [multiple] - Define si el Select es de selección múltiple.
|
|
28
|
+
* [disabled] - Establece si el Select está deshabilitado.
|
|
29
|
+
* [error] - Define si el Select está en estado de error.
|
|
30
|
+
* [componentPaletteColor] - Personaliza el color del componente.
|
|
31
|
+
* [color] - Define el color del Select.
|
|
32
|
+
* variant - Variante del Select.
|
|
33
|
+
* @author Bruce Escobar - automatic
|
|
34
|
+
* @createdAt 2024-10-22 10:30:26 - automatic
|
|
35
|
+
* @updatedAt 2024-10-22 10:31:36 - automatic
|
|
36
|
+
* @updatedUser Bruce Escobar - automatic
|
|
37
|
+
*/
|
|
38
|
+
export interface SelectProps extends Omit<MUISelectProps, 'size' | 'onChange' | 'value' | 'error'> {
|
|
39
|
+
id?: string;
|
|
40
|
+
size?: Sizes;
|
|
41
|
+
src?: string;
|
|
42
|
+
options: Array<selectOption>;
|
|
43
|
+
value: number | string | string[] | number[];
|
|
44
|
+
onChange: (options: selectOption | selectOption[]) => void;
|
|
45
|
+
multiple?: boolean;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
error?: boolean;
|
|
48
|
+
componentPaletteColor?: ComponentPalletColor;
|
|
49
|
+
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
50
|
+
variant: 'standard' | 'outlined';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Propiedades internas que definen el estado del componente `Select`.
|
|
54
|
+
* paletteColor - Color de la paleta aplicado al Select.
|
|
55
|
+
*/
|
|
56
|
+
export interface SelectOwnerState extends Pick<SelectProps, 'classes' | 'size' | 'error' | 'componentPaletteColor' | 'variant' | 'disabled'> {
|
|
57
|
+
paletteColor: PaletteColor;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Define los tipos de slots disponibles en el Select.
|
|
61
|
+
*/
|
|
62
|
+
export type SelectSlotsType = keyof typeof SelectSlots;
|
|
63
|
+
/**
|
|
64
|
+
* Estilos aplicables al componente Select.
|
|
65
|
+
*/
|
|
66
|
+
export type SelectStyles = Partial<OverridesStyleRules<SelectSlotsType, typeof SELECT_KEY_COMPONENT, Theme> | undefined> | undefined;
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ControlIncrementStyles } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Estilos utilizados para el componente `ControlIncrement`.
|
|
4
|
-
* Este objeto define los estilos para los diferentes "slots" (partes) del componente,
|
|
5
|
-
* como el contenedor principal (`root`), los botones de incremento (`iconButtonUp`) y decremento (`iconButtonDown`),
|
|
6
|
-
* y el esqueleto (`controlIncrementSkeleton`).
|
|
7
|
-
*/
|
|
8
|
-
export declare const controlIncrementStyles: ControlIncrementStyles;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nombre de clase que se usa para dar identidad a los slots del componente.
|
|
3
|
-
*/
|
|
4
|
-
export declare const CONTROL_INCREMENT_KEY_COMPONENT = "M4LControlIncrement";
|
|
5
|
-
/**
|
|
6
|
-
* Constante para la url del icono arrow up
|
|
7
|
-
*/
|
|
8
|
-
export declare const ICON_INCREMENT = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/ControlIncrement/assets/icons/chevron_up_sm.svg";
|
|
9
|
-
/**
|
|
10
|
-
* Constante para la url del icono arrow down
|
|
11
|
-
*/
|
|
12
|
-
export declare const ICON_DECREMENT = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/ControlIncrement/assets/icons/chevron_down_sm.svg";
|
|
13
|
-
/**
|
|
14
|
-
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
15
|
-
* tener la necesidad de agregar valores en !important.
|
|
16
|
-
*/
|
|
17
|
-
export declare const CONTROL_INCREMENT_SPECIFY = "M4lclassCssSpecificity";
|
|
18
|
-
/**
|
|
19
|
-
* Cosntante para su uso en una clase para mas especificidad y evitar el uso de important
|
|
20
|
-
*/
|
|
21
|
-
export declare const BUTTON_UP = "button-up";
|
|
22
|
-
/**
|
|
23
|
-
* Cosntante para su uso en una clase para mas especificidad y evitar el uso de important
|
|
24
|
-
*/
|
|
25
|
-
export declare const BUTTON_DOWN = "button-down";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown> & {
|
|
2
|
-
ownerState: Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown>;
|
|
3
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
-
export declare const IconButtonUpStyles: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/IconButton/types').IconButtonProps, keyof import('../../mui_extended/IconButton/types').IconButtonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown> & {
|
|
5
|
-
ownerState: Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown>;
|
|
6
|
-
}, {}, {}>;
|
|
7
|
-
export declare const IconButtonDownStyles: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/IconButton/types').IconButtonProps, keyof import('../../mui_extended/IconButton/types').IconButtonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown> & {
|
|
8
|
-
ownerState: Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown>;
|
|
9
|
-
}, {}, {}>;
|
|
10
|
-
export declare const ControlIncrementSkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
11
|
-
ref?: ((instance: HTMLSpanElement | 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<HTMLSpanElement> | null | undefined;
|
|
12
|
-
}, "height" | "width" | "animation" | "sx" | "classes" | "className" | "style" | "children" | "variant">, "color" | "content" | "height" | "translate" | "width" | "animation" | "sx" | "classes" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "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" | "children" | "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" | "ref" | "key" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown> & {
|
|
13
|
-
ownerState: Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown>;
|
|
14
|
-
}, {}, {}>;
|
package/components/ControlIncrement/stories/ControlClick/ControlIncrement.controlclick.stories.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
-
import { ControlIncrement } from '../../ControlIncrement';
|
|
3
|
-
declare const meta: Meta<typeof ControlIncrement>;
|
|
4
|
-
type Story = StoryObj<typeof ControlIncrement>;
|
|
5
|
-
/**
|
|
6
|
-
* ControlIncrement en modo Base
|
|
7
|
-
*/
|
|
8
|
-
export declare const Base: Story;
|
|
9
|
-
/**
|
|
10
|
-
* ControlIncrement Tiene la particularidad de que cuando le des click a up o down este ejecute una funcion
|
|
11
|
-
*/
|
|
12
|
-
export declare const Click: Story;
|
|
13
|
-
export default meta;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
-
import { ControlIncrement } from '../../ControlIncrement';
|
|
3
|
-
declare const meta: Meta<typeof ControlIncrement>;
|
|
4
|
-
type Story = StoryObj<typeof ControlIncrement>;
|
|
5
|
-
/**
|
|
6
|
-
* ControlIncrement en modo Base
|
|
7
|
-
*/
|
|
8
|
-
export declare const Base: Story;
|
|
9
|
-
/**
|
|
10
|
-
* ControlIncrement cuando esta en modo default
|
|
11
|
-
*/
|
|
12
|
-
export declare const Default: Story;
|
|
13
|
-
/**
|
|
14
|
-
* ControlIncrement cuando esta en modo disabled
|
|
15
|
-
*/
|
|
16
|
-
export declare const Disabled: Story;
|
|
17
|
-
export default meta;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
-
import { ControlIncrement } from '../../ControlIncrement';
|
|
3
|
-
declare const meta: Meta<typeof ControlIncrement>;
|
|
4
|
-
type Story = StoryObj<typeof ControlIncrement>;
|
|
5
|
-
/**
|
|
6
|
-
* ControlIncrement en modo Base
|
|
7
|
-
*/
|
|
8
|
-
export declare const Base: Story;
|
|
9
|
-
/**
|
|
10
|
-
* CrontrolIncrement cuando esta en el sizes de small
|
|
11
|
-
*/
|
|
12
|
-
export declare const SizesSmall: Story;
|
|
13
|
-
/**
|
|
14
|
-
* CrontrolIncrement cuando esta en el sizes de medium
|
|
15
|
-
*/
|
|
16
|
-
export declare const SizesMedium: Story;
|
|
17
|
-
/**
|
|
18
|
-
* ControlIncrement cuando esta en modo Skeleton
|
|
19
|
-
*/
|
|
20
|
-
export declare const skeletonMode: Story;
|
|
21
|
-
export default meta;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { PaletteColor, Theme } from '@mui/material/styles';
|
|
2
|
-
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
3
|
-
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
4
|
-
import { ControlIncrementSlots } from './slots/ControlIncrementEnum';
|
|
5
|
-
import { CONTROL_INCREMENT_KEY_COMPONENT } from './constants';
|
|
6
|
-
/**
|
|
7
|
-
* Interfaz que define las propiedades del componente `ControlIncrement`.
|
|
8
|
-
*/
|
|
9
|
-
export interface ControlIncrementProps {
|
|
10
|
-
/**
|
|
11
|
-
* Tamaño del componente. Acepta valores: 'small', 'medium' o 'large'.
|
|
12
|
-
*/
|
|
13
|
-
sizes?: Sizes;
|
|
14
|
-
/**
|
|
15
|
-
* Color del componente. Solo se acepta el valor 'default'.
|
|
16
|
-
*/
|
|
17
|
-
color?: Extract<ComponentPalletColor, 'default'>;
|
|
18
|
-
/**
|
|
19
|
-
* Indica si el componente está deshabilitado.
|
|
20
|
-
*/
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Función que se ejecuta cuando se acciona el IconButton superior.
|
|
24
|
-
*/
|
|
25
|
-
onChangeUp: () => void;
|
|
26
|
-
/**
|
|
27
|
-
* Función que se ejecuta cuando se acciona el IconButton inferior.
|
|
28
|
-
*/
|
|
29
|
-
onChangeDown: () => void;
|
|
30
|
-
/**
|
|
31
|
-
* Clase CSS adicional para aplicar estilos personalizados al componente.
|
|
32
|
-
*/
|
|
33
|
-
className?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Interfaz que define el estado propietario de `ControlIncrement`, excluyendo algunas propiedades
|
|
37
|
-
* del componente base y añadiendo una propiedad de paletteColor.
|
|
38
|
-
*/
|
|
39
|
-
export interface ControlIncrementOwnerState extends Omit<ControlIncrementProps, 'handleButtonChange' | 'setMouseDownDirection' | 'onChangeUp' | 'onChangeDown'> {
|
|
40
|
-
/**
|
|
41
|
-
* Color de la paleta utilizado para el componente.
|
|
42
|
-
*/
|
|
43
|
-
paletteColor: PaletteColor;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Tipo que representa las claves de los slots del componente `ControlIncrement`.
|
|
47
|
-
* Este tipo se genera a partir de las claves del objeto `ControlIncrementSlots`.
|
|
48
|
-
*/
|
|
49
|
-
export type ControlIncrementSlotsType = keyof typeof ControlIncrementSlots;
|
|
50
|
-
/**
|
|
51
|
-
* Define los estilos personalizados para el componente `ControlIncrement`.
|
|
52
|
-
*
|
|
53
|
-
* Este tipo se utiliza para sobrescribir las reglas de estilo (OverridesStyleRules) aplicables a los slots del componente.
|
|
54
|
-
* @see OverridesStyleRules
|
|
55
|
-
*/
|
|
56
|
-
export type ControlIncrementStyles = Partial<OverridesStyleRules<ControlIncrementSlots, typeof CONTROL_INCREMENT_KEY_COMPONENT, Theme> | undefined> | undefined;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InputNumberSpinnerProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Componente que permite la selección de un número a través de un input y dos botones de incremento y decremento.
|
|
4
|
-
*/
|
|
5
|
-
export declare const InputNumberSpinner: (props: InputNumberSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { InputNumberSpinnerStyles } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Estilos utilizados para el componente `InputNumberSpinner`.
|
|
4
|
-
* Este objeto define los estilos para los diferentes "slots" (partes) del componente,
|
|
5
|
-
* como el contenedor principal (`root`), el campo de entrada (`input`), el símbolo (`simbol`),
|
|
6
|
-
* el controlador de botones de incremento/decremento (`controlIncrement`), y el esqueleto (`skeleton`).
|
|
7
|
-
*/
|
|
8
|
-
export declare const inputNumberSpinnerStyles: InputNumberSpinnerStyles;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nombre de clase que se usa para dar identidad a los slots del componente.
|
|
3
|
-
*/
|
|
4
|
-
export declare const INPUTNUMBER_SPINNER_KEY_COMPONENT = "M4LInputNumberSpinner";
|
|
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 INPUTNUMBER_SPINNER_SPECIFY = "M4lclassCssSpecificity";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { InputNumberSpinnerProps } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Props utilizadas para el hook `useInputNumberSpinner`, que maneja la lógica interna del componente `InputNumberSpinner`.
|
|
4
|
-
*
|
|
5
|
-
* Esta interfaz extiende parcialmente las propiedades de `InputNumberSpinnerProps`, seleccionando
|
|
6
|
-
* solo las propiedades relacionadas con los valores máximo y mínimo, los pasos, y el valor actual.
|
|
7
|
-
*/
|
|
8
|
-
export interface UseInputNumberSpinnerProps extends Pick<InputNumberSpinnerProps, 'maxValue' | 'minValue' | 'steps' | 'value'> {
|
|
9
|
-
/**
|
|
10
|
-
* Función opcional para establecer el valor del campo externamente (como en react-hook-form)
|
|
11
|
-
*/
|
|
12
|
-
onChange?: (...event: any[]) => void;
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { UseInputNumberSpinnerProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* customHook que permite la validacion de el incremento y decremento del input.
|
|
4
|
-
* @param maxValue Permite fijar un maximo valor para el input
|
|
5
|
-
* @param minValue Permite fijar un minimo valor para el input
|
|
6
|
-
* @param steps Permite definir de cuanto aumenta el input
|
|
7
|
-
* @param value Valor inicial del input
|
|
8
|
-
* @param setValue Función opcional para establecer el valor externamente (como en react-hook-form)
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare const useInputNumberSpinner: (props: UseInputNumberSpinnerProps) => {
|
|
12
|
-
onChangeUp: () => void;
|
|
13
|
-
onChangeDown: () => void;
|
|
14
|
-
evalsetInternalValue: (val: number, operation?: "increase" | "decrease") => void;
|
|
15
|
-
handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
-
isSkeleton: boolean;
|
|
17
|
-
internalValue: number;
|
|
18
|
-
theme: import('@mui/material').Theme;
|
|
19
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
2
|
-
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
3
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
-
export declare const InputStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
5
|
-
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
6
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import('react').ClassAttributes<HTMLInputElement> | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, {}>;
|
|
7
|
-
export declare const SimbolStyled: 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> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
8
|
-
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
9
|
-
}, {}, {}>;
|
|
10
|
-
export declare const ControlIncrementStyles: import('@emotion/styled').StyledComponent<Pick<import('../../ControlIncrement/types').ControlIncrementProps, keyof import('../../ControlIncrement/types').ControlIncrementProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
11
|
-
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
12
|
-
}, {}, {}>;
|
|
13
|
-
export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Skeleton/types').SkeletonProps, keyof import('../../mui_extended/Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
14
|
-
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
15
|
-
}, {}, {}>;
|
package/components/InputNumberSpinner/stories/Default/InputNumberSpinner.default.stories.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
-
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
-
/**
|
|
7
|
-
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
-
*/
|
|
9
|
-
export declare const Base: Story;
|
|
10
|
-
/**
|
|
11
|
-
* Componente InputNumberSpinner en su modo por defecto combinado con un icono
|
|
12
|
-
*/
|
|
13
|
-
export declare const DefaultWidthIcon: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Componente InputNumberSpinner en su modo por Disabled
|
|
16
|
-
*/
|
|
17
|
-
export declare const Disabled: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Componente InputNumberSpinner en su modo por Disabled combinado con un icono
|
|
20
|
-
*/
|
|
21
|
-
export declare const DisabledWidthIcon: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Componente InputNumberSpinner en su modo de carga (Skeleton)
|
|
24
|
-
*/
|
|
25
|
-
export declare const WithSkeleton: Story;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
-
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
-
/**
|
|
7
|
-
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
-
*/
|
|
9
|
-
export declare const Base: Story;
|
|
10
|
-
/**
|
|
11
|
-
* Componente InputNumberSpinner en su modo por Error con la variante Outlined
|
|
12
|
-
*/
|
|
13
|
-
export declare const ErrorInOutlined: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Componente InputNumberSpinner en su modo por Error con la variante Outlined combinado con un icono
|
|
16
|
-
*/
|
|
17
|
-
export declare const ErrorInOutlinedWidthIcon: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Componente InputNumberSpinner en su modo por Error con la variante Text
|
|
20
|
-
*/
|
|
21
|
-
export declare const ErrorInText: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Componente InputNumberSpinner en su modo por Error con la variante Text combinado con un icono
|
|
24
|
-
*/
|
|
25
|
-
export declare const ErrorInTextWidthIcon: Story;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
-
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
-
/**
|
|
7
|
-
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
-
*/
|
|
9
|
-
export declare const Base: Story;
|
|
10
|
-
/**
|
|
11
|
-
* Componente InputNumberSpinner en su variante Outlined
|
|
12
|
-
*/
|
|
13
|
-
export declare const OutlinedInSmallSize: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Componente InputNumberSpinner en su variante Outlined combinado con icono
|
|
16
|
-
*/
|
|
17
|
-
export declare const OutlinedInSmallSizeWidthIcon: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Componente InputNumberSpinner en su variante Outlined
|
|
20
|
-
*/
|
|
21
|
-
export declare const OutlinedInMediumSize: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Componente InputNumberSpinner en su variante Outlined combinado con icono
|
|
24
|
-
*/
|
|
25
|
-
export declare const OutlinedInMediumSizeWidthIcon: Story;
|
|
26
|
-
/**
|
|
27
|
-
* Componente InputNumberSpinner en su variante Text
|
|
28
|
-
*/
|
|
29
|
-
export declare const TextInSmallSize: Story;
|
|
30
|
-
/**
|
|
31
|
-
* Componente InputNumberSpinner en su variante Text combinado con icono
|
|
32
|
-
*/
|
|
33
|
-
export declare const TextInSmallSizeWidthIcon: Story;
|
|
34
|
-
/**
|
|
35
|
-
* Componente InputNumberSpinner en su variante Text
|
|
36
|
-
*/
|
|
37
|
-
export declare const TextInMediumSize: Story;
|
|
38
|
-
/**
|
|
39
|
-
* Componente InputNumberSpinner en su variante Text
|
|
40
|
-
*/
|
|
41
|
-
export declare const TextInMediumSizeWidthIcon: Story;
|
package/components/InputNumberSpinner/stories/Variants/InputNumberSpinner.variants.stories.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
-
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
-
/**
|
|
7
|
-
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
-
*/
|
|
9
|
-
export declare const Base: Story;
|
|
10
|
-
/**
|
|
11
|
-
* Componente InputNumberSpinner en su variante Outlined
|
|
12
|
-
*/
|
|
13
|
-
export declare const Outlined: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Componente InputNumberSpinner en su variante Outlined combinado con icono
|
|
16
|
-
*/
|
|
17
|
-
export declare const OutlinedWidthIcon: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Componente InputNumberSpinner en su variante Text
|
|
20
|
-
*/
|
|
21
|
-
export declare const Text: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Componente InputNumberSpinner en su variante Text combinado con icono
|
|
24
|
-
*/
|
|
25
|
-
export declare const TextWidthIcon: Story;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
2
|
-
import { PaletteColor, Theme } from '@mui/material/styles';
|
|
3
|
-
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
4
|
-
import { InputNumberSpinnerSlots } from './slots/InputNumberSpinnerEnum';
|
|
5
|
-
import { INPUTNUMBER_SPINNER_KEY_COMPONENT } from './constants';
|
|
6
|
-
import { InputHTMLAttributes } from 'react';
|
|
7
|
-
export interface InputNumberSpinnerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'disabled' | 'number'> {
|
|
8
|
-
/**
|
|
9
|
-
* Cantidad de números por los que se incrementará o disminuirá el valor.
|
|
10
|
-
*/
|
|
11
|
-
steps: number;
|
|
12
|
-
/**
|
|
13
|
-
* Tipo de dato del valor, puede ser 'pt' (puntos), '%' (porcentaje).
|
|
14
|
-
*/
|
|
15
|
-
valueType?: 'pt' | '%';
|
|
16
|
-
/**
|
|
17
|
-
* Función de callback que se ejecuta cuando el valor cambia.
|
|
18
|
-
* @param value - El nuevo valor numérico.
|
|
19
|
-
*/
|
|
20
|
-
onChange?: (value: number | null) => void;
|
|
21
|
-
/**
|
|
22
|
-
* Indica si el componente está deshabilitado.
|
|
23
|
-
*/
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Tamaño del componente, puede ser uno de los valores definidos en 'small' , 'medium' , 'large'.
|
|
27
|
-
*/
|
|
28
|
-
sizes?: Sizes;
|
|
29
|
-
/**
|
|
30
|
-
* Valor máximo permitido para el componente.
|
|
31
|
-
*/
|
|
32
|
-
maxValue: number;
|
|
33
|
-
/**
|
|
34
|
-
* Valor mínimo permitido para el componente.
|
|
35
|
-
*/
|
|
36
|
-
minValue: number;
|
|
37
|
-
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
38
|
-
/**
|
|
39
|
-
* Prop Para el testeo del componente
|
|
40
|
-
*/
|
|
41
|
-
instaceDataTestId?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Representa el estado de error del componente.
|
|
44
|
-
*/
|
|
45
|
-
error?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Representa el valor del componente controlado aportado desde las props.
|
|
48
|
-
*/
|
|
49
|
-
value?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Variante de estilos
|
|
52
|
-
*/
|
|
53
|
-
variants?: 'Outlined' | 'Text';
|
|
54
|
-
/**
|
|
55
|
-
* Variante de estilos
|
|
56
|
-
*/
|
|
57
|
-
src?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface InputNumberSpinnerOwnerState extends Pick<InputNumberSpinnerProps, 'sizes' | 'color' | 'disabled' | 'error' | 'variants'> {
|
|
60
|
-
isValid?: boolean;
|
|
61
|
-
paletteColor: PaletteColor;
|
|
62
|
-
}
|
|
63
|
-
export type InputNumberSpinnerSlotsType = keyof typeof InputNumberSpinnerSlots;
|
|
64
|
-
export type InputNumberSpinnerStyles = Partial<OverridesStyleRules<InputNumberSpinnerSlots, typeof INPUTNUMBER_SPINNER_KEY_COMPONENT, Theme> | undefined> | undefined;
|