@m4l/components 9.1.68 → 9.1.69

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.
Files changed (51) hide show
  1. package/@types/types.d.ts +17 -120
  2. package/components/NumberInput/NumberInput.d.ts +5 -0
  3. package/components/{InputNumberSpinner/InputNumberSpinner.styles.d.ts → NumberInput/NumberInput.styles.d.ts} +2 -2
  4. package/components/NumberInput/NumberInput.test.d.ts +1 -0
  5. package/components/NumberInput/constants.d.ts +4 -0
  6. package/components/NumberInput/hooks/useNumberInput/NumberInputActions.d.ts +42 -0
  7. package/components/NumberInput/hooks/useNumberInput/NumberInputReducer.d.ts +5 -0
  8. package/components/NumberInput/hooks/useNumberInput/types.d.ts +126 -0
  9. package/components/NumberInput/hooks/useNumberInput/useNumberInput.d.ts +26 -0
  10. package/components/NumberInput/slots/NumberInputEnum.d.ts +9 -0
  11. package/components/NumberInput/slots/NumberInputSlots.d.ts +21 -0
  12. package/components/NumberInput/types.d.ts +48 -0
  13. package/components/NumberInput/utils.d.ts +6 -0
  14. package/components/hook-form/{RHFInputNumberSpinner/RHFInputNumberSpinner.d.ts → RHFNumberInput/RHFNumberInput.d.ts} +2 -2
  15. package/components/hook-form/{RHFInputNumberSpinner/RHFInputNumberSpinner.styles.d.ts → RHFNumberInput/RHFNumberInput.styles.d.ts} +2 -2
  16. package/components/hook-form/RHFNumberInput/RHFNumberInput.test.d.ts +1 -0
  17. package/components/hook-form/RHFNumberInput/constants.d.ts +4 -0
  18. package/components/hook-form/{RHFInputNumberSpinner/slots/RHFInputNumberSpinnerEnum.d.ts → RHFNumberInput/slots/RHFNumberInputEnum.d.ts} +2 -5
  19. package/components/hook-form/RHFNumberInput/slots/RHFNumberInputSlots.d.ts +7 -0
  20. package/components/hook-form/RHFNumberInput/types.d.ts +47 -0
  21. package/package.json +1 -1
  22. package/utils/getHeightSizeStyles.d.ts +12 -0
  23. package/components/ControlIncrement/ControlIncrement.d.ts +0 -9
  24. package/components/ControlIncrement/ControlIncrement.styles.d.ts +0 -8
  25. package/components/ControlIncrement/constants.d.ts +0 -25
  26. package/components/ControlIncrement/slots/ControlIncrementEnum.d.ts +0 -6
  27. package/components/ControlIncrement/slots/ControltrolIncrementSlots.d.ts +0 -14
  28. package/components/ControlIncrement/slots/index.d.ts +0 -2
  29. package/components/ControlIncrement/stories/ControlClick/ControlIncrement.controlclick.stories.d.ts +0 -13
  30. package/components/ControlIncrement/stories/DefaultAndDisabled/ControlIncrement.defaultanddisabled.stories.d.ts +0 -17
  31. package/components/ControlIncrement/stories/Sizes/ControlIncrement.sizes.stories.d.ts +0 -21
  32. package/components/ControlIncrement/types.d.ts +0 -56
  33. package/components/InputNumberSpinner/InputNumberSpinner.d.ts +0 -9
  34. package/components/InputNumberSpinner/constants.d.ts +0 -9
  35. package/components/InputNumberSpinner/hooks/types.d.ts +0 -13
  36. package/components/InputNumberSpinner/hooks/useInputNumberSpinner.d.ts +0 -19
  37. package/components/InputNumberSpinner/index.d.ts +0 -2
  38. package/components/InputNumberSpinner/slots/InputNumberSpinnerEnum.d.ts +0 -7
  39. package/components/InputNumberSpinner/slots/InputNumberSpinnerSlots.d.ts +0 -15
  40. package/components/InputNumberSpinner/slots/index.d.ts +0 -2
  41. package/components/InputNumberSpinner/stories/Default/InputNumberSpinner.default.stories.d.ts +0 -25
  42. package/components/InputNumberSpinner/stories/Error/InputNumberSpinner.error.stories.d.ts +0 -25
  43. package/components/InputNumberSpinner/stories/Sizes/InputNumberSpinner.sizes.stories.d.ts +0 -41
  44. package/components/InputNumberSpinner/stories/Variants/InputNumberSpinner.variants.stories.d.ts +0 -25
  45. package/components/InputNumberSpinner/types.d.ts +0 -64
  46. package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +0 -4
  47. package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerSlots.d.ts +0 -28
  48. package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.defaultProps.stories.d.ts +0 -26
  49. package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.error.stories.d.ts +0 -13
  50. package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.variants.stories.d.ts +0 -23
  51. package/components/hook-form/RHFInputNumberSpinner/types.d.ts +0 -71
package/@types/types.d.ts CHANGED
@@ -53,9 +53,7 @@ import type {
53
53
  } from '../components/mui_extended/IconButton/types';
54
54
 
55
55
  import type { BadgeSlotsType, BadgeOwnerState } from '../components/mui_extended/Badge/types';
56
- import { ControlIncrementOwnerState, ControlIncrementSlotsType } from '../components/ControlIncrement/types';
57
56
  import { SkeletonOwnerState, SkeletonSlotsType } from '../components/mui_extended/Skeleton/types';
58
- import { InputNumberSpinnerOwnerState, InputNumberSpinnerSlotsType } from '../components/InputNumberSpinner/types';
59
57
  import { TypographyOwnerState, TypographySlotsType } from '../components/mui_extended/Typography/types';
60
58
  import { ColorOwnerState, ColorSlotsType } from '../components/Color/types';
61
59
  import { RHFColorPickerOwnerState, RHFColorPickerSlotsType } from '../components/hook-form/RHFColorPicker/types';
@@ -75,9 +73,9 @@ import {
75
73
  } from '../components/mui_extended/CheckBox/types';
76
74
 
77
75
  import {
78
- RHFInputNumberSpinnerOwnerState,
79
- RHFInputNumberSpinnerSlotsType,
80
- } from '../components/hook-form/RHFInputNumberSpinner/types';
76
+ RHFNumberInputOwnerState,
77
+ RHFNumberInputSlotsType,
78
+ } from '../components/hook-form/RHFNumberInput/types';
81
79
 
82
80
  import {
83
81
  TabOwnerState,
@@ -135,6 +133,7 @@ import { ToggleIconButtonOwnerState, ToggleIconButtonSlotsType } from '../compon
135
133
  import { TabsSlotsType,TabsOwnerState } from '../components/mui_extended/Tabs/types';
136
134
 
137
135
  import { PopoverOwnerState, PopoverSlotsType } from '../components/mui_extended/Popover/types';
136
+ import { NumberInputOwnerState,NumberInputSlotsType } from '../components/NumberInput/types';
138
137
  import { AccountPopoverOwnerState, AccountPopoverSlotsType } from '../components/AccountPopover/types';
139
138
  import { PropertyVaLueOwnerState, PropertyValueType } from '../components/PropertyValue/types';
140
139
  import { RHFTextFieldPasswordOwnerState, RHFTextFieldPasswordType } from '../components/hook-form/RHFTextFieldPassword/types';
@@ -149,7 +148,6 @@ declare module '@mui/material/styles' {
149
148
  RHFTextField: RHFTextFieldSlotsType;
150
149
  M4LDynamicSort: DynamicSortSlotsType;
151
150
  M4LMenuActions: MenuActionsSlotsType;
152
- M4LInputNumberSpinner: InputNumberSpinnerSlotsType;
153
151
  M4LPopupsViewer: PopupViewerSlotsType;
154
152
  M4LIcon: IconSlotsType;
155
153
  M4LDragResizeWindow: DragResizeWindowSlotsType;
@@ -160,13 +158,12 @@ declare module '@mui/material/styles' {
160
158
  M4LIconButton: IconButtonSlotsType;
161
159
  M4LTextField: TextFieldSlotsType;
162
160
  M4LBadge: BadgeSlotsType;
163
- M4LControlIncrement: ControlIncrementSlotsType;
164
161
  M4LMenuItem: MenuItemSlotsType;
165
162
  M4LSkeleton: SkeletonSlotsType;
166
163
  M4LSelect: SelectSlotsType;
167
164
  M4LTypography: TypographySlotsType;
168
165
  M4LCheckBox: CheckBoxSlotsType;
169
- M4LRHFInputNumberSpinner: RHFInputNumberSpinnerSlotsType;
166
+ M4LRHFNumberInput: RHFNumberInputSlotsType;
170
167
  M4LTab: TabSlotsType;
171
168
  M4LButton: ButtonSlotsType;
172
169
  M4LActionIntro: ActionIntroSlotsType;
@@ -185,6 +182,7 @@ declare module '@mui/material/styles' {
185
182
  M4LAppBar: AppBarSlotsType;
186
183
  M4LWiDialog: DialogType;
187
184
  M4LLoadingButton: LoadingButtonSlotsType;
185
+ M4LNumberInput: NumberInputSlotsType;
188
186
  M4LAccordion: AccordionSlotsType;
189
187
  M4LPopper: PopperSlotsType;
190
188
  M4LAvatar: AvatarSlotsType;
@@ -206,7 +204,6 @@ declare module '@mui/material/styles' {
206
204
  RHFTextField: Partial<RHFTextFieldOwnerState>;
207
205
  M4LDynamicSort: Partial<DynamicSortOwnerState>;
208
206
  M4LMenuActions: Partial<MenuActionsOwnerState>;
209
- M4LInputNumberSpinner: Partial<InputNumberSpinnerOwnerState>;
210
207
  M4LPopupsViewer: Partial<PopupsViewerOwnerState>;
211
208
  M4LIcon: Partial<IconOwnerState>;
212
209
  M4LDragResizeWindow: Partial<DragResizeWindowOwnerState>;
@@ -217,13 +214,12 @@ declare module '@mui/material/styles' {
217
214
  M4LTextField: Partial<TextFieldOwnerState>;
218
215
  M4LIconButton: Partial<IconButtonOwnerState>;
219
216
  M4LBadge: Partial<BadgeOwnerState>;
220
- M4LControlIncrement: Partial<ControlIncrementOwnerState>;
221
217
  M4LMenuItem: Partial<MenuItemOwnerState>;
222
218
  M4LSkeleton: Partial<SkeletonOwnerState>;
223
219
  M4LSelect: Partial<SelectOwnerState>;
224
220
  M4LTypography: Partial<TypographyOwnerState>;
225
221
  M4LCheckBox: Partial<CheckBoxOwnerState>;
226
- M4LRHFInputNumberSpinner: Partial<RHFInputNumberSpinnerOwnerState>;
222
+ M4LRHFNumberInput: Partial<RHFNumberInputOwnerState>;
227
223
  M4LTab: Partial<TabOwnerState>;
228
224
  M4LButton: Partial<ButtonOwnerState>;
229
225
  M4LActionIntro: Partial<ActionIntroOwnerState>;
@@ -240,6 +236,7 @@ declare module '@mui/material/styles' {
240
236
  M4LAppBar: Partial<AppBarOwnerState>;
241
237
  M4LWiDialog: Partial<DialogOwnerState>;
242
238
  M4LLoadingButton: Partial<LoadingButtonOwnerState>;
239
+ M4LNumberInput: Partial<NumberInputOwnerState>;
243
240
  M4LAccordion: Partial<AccordionOwnerState>;
244
241
  M4LPopper: Partial<PopperOwnerState>;
245
242
  M4LAvatar: Partial<AvatarOwnerState>;
@@ -278,11 +275,6 @@ declare module '@mui/material/styles' {
278
275
  styleOverrides?: ComponentsOverrides<Theme>['M4LMenuActions'];
279
276
  variants?: ComponentsVariants['M4LMenuActions'];
280
277
  };
281
- M4LInputNumberSpinner?: {
282
- defaultProps?: ComponentsPropsList['M4LInputNumberSpinner'];
283
- styleOverrides?: ComponentsOverrides<Theme>['M4LInputNumberSpinner'];
284
- variants?: ComponentsVariants['M4LInputNumberSpinner'];
285
- };
286
278
  M4LPopupsViewer?: {
287
279
  defaultProps?: ComponentsPropsList['M4LPopupsViewer'];
288
280
  styleOverrides?: ComponentsOverrides<Theme>['M4LPopupsViewer'];
@@ -318,26 +310,6 @@ declare module '@mui/material/styles' {
318
310
  styleOverrides?: ComponentsOverrides<Theme>['M4LTooltip'];
319
311
  variants?: ComponentsVariants['M4LTooltip'];
320
312
  };
321
- M4LTextField?: {
322
- defaultProps?: ComponentsPropsList['M4LTextField'];
323
- styleOverrides?: ComponentsOverrides<Theme>['M4LTextField'];
324
- variants?: ComponentsVariants['M4LTextField'];
325
- };
326
- M4LIconButton?: {
327
- defaultProps?: ComponentsPropsList['M4LIconButton'];
328
- styleOverrides?: ComponentsOverrides<Theme>['M4LIconButton'];
329
- variants?: ComponentsVariants['M4LIconButton'];
330
- };
331
- M4LBadge?: {
332
- defaultProps?: ComponentsPropsList['M4LBadge'];
333
- styleOverrides?: ComponentsOverrides<Theme>['M4LBadge'];
334
- variants?: ComponentsVariants['M4LBadge'];
335
- };
336
- M4LControlIncrement?: {
337
- defaultProps?: ComponentsPropsList['M4LControlIncrement'];
338
- styleOverrides?: ComponentsOverrides<Theme>['M4LControlIncrement'];
339
- variants?: ComponentsVariants['M4LControlIncrement'];
340
- };
341
313
  M4LMenuItem?: {
342
314
  defaultProps?: ComponentsPropsList['M4LMenuItem'];
343
315
  styleOverrides?: ComponentsOverrides<Theme>['M4LMenuItem'];
@@ -358,10 +330,10 @@ declare module '@mui/material/styles' {
358
330
  styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
359
331
  variants?: ComponentsVariants['M4LTypography'];
360
332
  };
361
- M4LRHFInputNumberSpinner?: {
362
- defaultProps?: ComponentsPropsList['M4LRHFInputNumberSpinner'];
363
- styleOverrides?: ComponentsOverrides<Theme>['M4LRHFInputNumberSpinner'];
364
- variants?: ComponentsVariants['M4LRHFInputNumberSpinner'];
333
+ M4LRHFNumberInput?: {
334
+ defaultProps?: ComponentsPropsList['M4LRHFNumberInput'];
335
+ styleOverrides?: ComponentsOverrides<Theme>['M4LRHFNumberInput'];
336
+ variants?: ComponentsVariants['M4LRHFNumberInput'];
365
337
  };
366
338
  M4LTab?: {
367
339
  defaultProps?: ComponentsPropsList['M4LTab'];
@@ -378,56 +350,6 @@ declare module '@mui/material/styles' {
378
350
  styleOverrides?: ComponentsOverrides<Theme>['M4LActionIntro'];
379
351
  variants?: ComponentsVariants['M4LActionIntro'];
380
352
  };
381
- M4LDynamicSort?: {
382
- defaultProps?: ComponentsPropsList['M4LDynamicSort'];
383
- styleOverrides?: ComponentsOverrides<Theme>['M4LDynamicSort'];
384
- variants?: ComponentsVariants['M4LDynamicSort'];
385
- };
386
- M4LMenuActions?: {
387
- defaultProps?: ComponentsPropsList['M4LMenuActions'];
388
- styleOverrides?: ComponentsOverrides<Theme>['M4LMenuActions'];
389
- variants?: ComponentsVariants['M4LMenuActions'];
390
- };
391
- M4LInputNumberSpinner?: {
392
- defaultProps?: ComponentsPropsList['M4LInputNumberSpinner'];
393
- styleOverrides?: ComponentsOverrides<Theme>['M4LInputNumberSpinner'];
394
- variants?: ComponentsVariants['M4LInputNumberSpinner'];
395
- };
396
- M4LPopupsViewer?: {
397
- defaultProps?: ComponentsPropsList['M4LPopupsViewer'];
398
- styleOverrides?: ComponentsOverrides<Theme>['M4LPopupsViewer'];
399
- variants?: ComponentsVariants['M4LPopupsViewer'];
400
- };
401
- M4LDragResizeWindow?: {
402
- defaultProps?: ComponentsPropsList['M4LDragResizeWindow'];
403
- styleOverrides?: ComponentsOverrides<Theme>['M4LDragResizeWindow'];
404
- variants?: ComponentsVariants['M4LDragResizeWindow'];
405
- };
406
- M4LToastContainer?: {
407
- defaultProps?: ComponentsPropsList['M4LToastContainer'];
408
- styleOverrides?: ComponentsOverrides<Theme>['M4LToastContainer'];
409
- variants?: ComponentsVariants['M4LToastContainer'];
410
- };
411
- M4LHelperError?: {
412
- defaultProps?: ComponentsPropsList['M4LHelperError'];
413
- styleOverrides?: ComponentsOverrides<Theme>['M4LHelperError'];
414
- variants?: ComponentsVariants['M4LHelperError'];
415
- };
416
- M4LLabel?: {
417
- defaultProps?: ComponentsPropsList['M4LLabel'];
418
- styleOverrides?: ComponentsOverrides<Theme>['M4LLabel'];
419
- variants?: ComponentsVariants['M4LLabel'];
420
- };
421
- M4LIcon?: {
422
- defaultProps?: ComponentsPropsList['M4LIcon'];
423
- styleOverrides?: ComponentsOverrides<Theme>['M4LIcon'];
424
- variants?: ComponentsVariants['M4LIcon'];
425
- };
426
- M4LTooltip?: {
427
- defaultProps?: ComponentsPropsList['M4LTooltip'];
428
- styleOverrides?: ComponentsOverrides<Theme>['M4LTooltip'];
429
- variants?: ComponentsVariants['M4LTooltip'];
430
- };
431
353
  M4LTextField?: {
432
354
  defaultProps?: ComponentsPropsList['M4LTextField'];
433
355
  styleOverrides?: ComponentsOverrides<Theme>['M4LTextField'];
@@ -443,31 +365,6 @@ declare module '@mui/material/styles' {
443
365
  styleOverrides?: ComponentsOverrides<Theme>['M4LBadge'];
444
366
  variants?: ComponentsVariants['M4LBadge'];
445
367
  };
446
- M4LControlIncrement?: {
447
- defaultProps?: ComponentsPropsList['M4LControlIncrement'];
448
- styleOverrides?: ComponentsOverrides<Theme>['M4LControlIncrement'];
449
- variants?: ComponentsVariants['M4LControlIncrement'];
450
- };
451
- M4LMenuItem?: {
452
- defaultProps?: ComponentsPropsList['M4LMenuItem'];
453
- styleOverrides?: ComponentsOverrides<Theme>['M4LMenuItem'];
454
- variants?: ComponentsVariants['M4LMenuItem'];
455
- };
456
- M4LSkeleton?: {
457
- defaultProps?: ComponentsPropsList['M4LSkeleton'];
458
- styleOverrides?: ComponentsOverrides<Theme>['M4LSkeleton'];
459
- variants?: ComponentsVariants['M4LSkeleton'];
460
- };
461
- M4LSelect: {
462
- defaultProps?: ComponentsPropsList['M4LSelect'];
463
- styleOverrides?: ComponentsOverrides<Theme>['M4LSelect'];
464
- variants?: ComponentsVariants['M4LSelect'];
465
- };
466
- M4LTypography?: {
467
- defaultProps?: ComponentsPropsList['M4LTypography'];
468
- styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
469
- variants?: ComponentsVariants['M4LTypography'];
470
- };
471
368
  M4LCheckBox?: {
472
369
  defaultProps?: ComponentsPropsList['M4LCheckBox'];
473
370
  styleOverrides?: ComponentsOverrides<Theme>['M4LCheckBox'];
@@ -488,11 +385,6 @@ declare module '@mui/material/styles' {
488
385
  styleOverrides?: ComponentsOverrides<Theme>['M4LImage'];
489
386
  variants?: ComponentsVariants['M4LImage'];
490
387
  };
491
- M4LActionCancel?: {
492
- defaultProps?: ComponentsPropsList['M4LActionCancel'];
493
- styleOverrides?: ComponentsOverrides<Theme>['M4LActionCancel'];
494
- variants?: ComponentsVariants['M4LActionCancel'];
495
- };
496
388
  M4LAutocomplete?: {
497
389
  defaultProps?: ComponentsPropsList['M4LAutocomplete'];
498
390
  styleOverrides?: ComponentsOverrides<Theme>['M4LAutocomplete'];
@@ -543,6 +435,11 @@ declare module '@mui/material/styles' {
543
435
  styleOverrides?: ComponentsOverrides<Theme>['M4LLoadingButton'];
544
436
  variants?: ComponentsVariants['M4LLoadingButton'];
545
437
  };
438
+ M4LNumberInput?: {
439
+ defaultProps?: ComponentsPropsList['M4LNumberInput'];
440
+ styleOverrides?: ComponentsOverrides<Theme>['M4LNumberInput'];
441
+ variants?: ComponentsVariants['M4LNumberInput'];
442
+ }
546
443
  M4LAvatar?: {
547
444
  defaultProps?: ComponentsPropsList['M4LAvatar'];
548
445
  styleOverrides?: ComponentsOverrides<Theme>['M4LAvatar'];
@@ -0,0 +1,5 @@
1
+ import { NumberInputProps } from './types';
2
+ /**
3
+ * Componente NumberInput de entrada de texto solo números con botonera de incremento o decremento
4
+ */
5
+ export declare const NumberInput: import('react').ForwardRefExoticComponent<NumberInputProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,8 +1,8 @@
1
- import { InputNumberSpinnerStyles } from './types';
1
+ import { NumberInputStyles } from './types';
2
2
  /**
3
3
  * Estilos utilizados para el componente `InputNumberSpinner`.
4
4
  * Este objeto define los estilos para los diferentes "slots" (partes) del componente,
5
5
  * como el contenedor principal (`root`), el campo de entrada (`input`), el símbolo (`simbol`),
6
6
  * el controlador de botones de incremento/decremento (`controlIncrement`), y el esqueleto (`skeleton`).
7
7
  */
8
- export declare const inputNumberSpinnerStyles: InputNumberSpinnerStyles;
8
+ export declare const numberInputStyles: NumberInputStyles;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Nombre de clase que se usa para dar identidad a los slots del componente.
3
+ */
4
+ export declare const NUMBER_INPUT_KEY_COMPONENT = "M4LNumberInput";
@@ -0,0 +1,42 @@
1
+ export declare const NumberInputActionTypes: {
2
+ readonly clamp: "numberInput:clamp";
3
+ readonly inputChange: "numberInput:inputChange";
4
+ readonly increment: "numberInput:increment";
5
+ readonly decrement: "numberInput:decrement";
6
+ readonly decrementToMin: "numberInput:decrementToMin";
7
+ readonly incrementToMax: "numberInput:incrementToMax";
8
+ readonly resetInputValue: "numberInput:resetInputValue";
9
+ };
10
+ interface NumberInputClampAction {
11
+ type: typeof NumberInputActionTypes.clamp;
12
+ event: React.FocusEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>;
13
+ inputValue: string;
14
+ }
15
+ interface NumberInputInputChangeAction {
16
+ type: typeof NumberInputActionTypes.inputChange;
17
+ event: React.ChangeEvent<HTMLInputElement>;
18
+ inputValue: string;
19
+ }
20
+ interface NumberInputIncrementAction {
21
+ type: typeof NumberInputActionTypes.increment;
22
+ event: React.PointerEvent | React.KeyboardEvent;
23
+ applyMultiplier: boolean;
24
+ }
25
+ interface NumberInputDecrementAction {
26
+ type: typeof NumberInputActionTypes.decrement;
27
+ event: React.PointerEvent | React.KeyboardEvent;
28
+ applyMultiplier: boolean;
29
+ }
30
+ interface NumberInputIncrementToMaxAction {
31
+ type: typeof NumberInputActionTypes.incrementToMax;
32
+ event: React.KeyboardEvent;
33
+ }
34
+ interface NumberInputDecrementToMinAction {
35
+ type: typeof NumberInputActionTypes.decrementToMin;
36
+ event: React.KeyboardEvent;
37
+ }
38
+ interface NumberInputResetInputValueAction {
39
+ type: typeof NumberInputActionTypes.resetInputValue;
40
+ }
41
+ export type NumberInputAction = NumberInputClampAction | NumberInputInputChangeAction | NumberInputIncrementAction | NumberInputDecrementAction | NumberInputIncrementToMaxAction | NumberInputDecrementToMinAction | NumberInputResetInputValueAction;
42
+ export {};
@@ -0,0 +1,5 @@
1
+ import { NumberInputReducerAction, NumberInputState } from './types';
2
+ /**
3
+ * Reducer para el componente NumberInput.
4
+ */
5
+ export declare function numberInputReducer(state: NumberInputState, action: NumberInputReducerAction): NumberInputState;
@@ -0,0 +1,126 @@
1
+ import { ActionWithContext } from '@mui/base/utils/useControllableReducer.types';
2
+ import { NumberInputAction } from './NumberInputActions';
3
+ export type StepDirection = 'up' | 'down';
4
+ /**
5
+ * The internal state of the NumberInput.
6
+ * Modify via the reducer only.
7
+ */
8
+ export interface NumberInputState {
9
+ /**
10
+ * The clamped `value` of the `input` element.
11
+ */
12
+ value: number | null;
13
+ /**
14
+ * The dirty `value` of the `input` element when it is in focus.
15
+ */
16
+ inputValue: string;
17
+ /**
18
+ * como el useReducerController da prioridad al valor controlado, se agrega esta propiedad para poder comparar el value con el inputValue, antes de que se actualice el value por las props.
19
+ */
20
+ noControlledValue: number | null;
21
+ }
22
+ /**
23
+ * Additional props passed to the number input reducer actions.
24
+ */
25
+ export type NumberInputActionContext = {
26
+ min?: number;
27
+ max?: number;
28
+ step?: number;
29
+ withDecimal?: boolean;
30
+ shiftMultiplier: number;
31
+ /**
32
+ * A function that parses the raw input value
33
+ */
34
+ getInputValueAsString: (val: string) => string;
35
+ };
36
+ export type NumberInputReducerAction = ActionWithContext<NumberInputAction, NumberInputActionContext>;
37
+ export interface UseNumberInputParameters {
38
+ /**
39
+ * The minimum value.
40
+ */
41
+ min?: number;
42
+ /**
43
+ * The maximum value.
44
+ */
45
+ max?: number;
46
+ /**
47
+ * The amount that the value changes on each increment or decrement.
48
+ */
49
+ step?: number;
50
+ /**
51
+ * Multiplier applied to `step` if the shift key is held while incrementing
52
+ * or decrementing the value. Defaults to `10`.
53
+ */
54
+ shiftMultiplier?: number;
55
+ /**
56
+ * The default value. Use when the component is not controlled.
57
+ */
58
+ defaultValue?: number | null;
59
+ /**
60
+ * If `true`, the component is disabled.
61
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
62
+ */
63
+ disabled?: boolean;
64
+ /**
65
+ * Indica mientras se esta digitando el valor está en error
66
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
67
+ */
68
+ unsavedValueError?: boolean;
69
+ /**
70
+ * If `true`, the `input` will indicate an error by setting the `aria-invalid` attribute.
71
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
72
+ */
73
+ error?: boolean;
74
+ onBlur?: (event?: React.FocusEvent<HTMLInputElement>) => void;
75
+ onClick?: React.MouseEventHandler;
76
+ /**
77
+ * Callback fired when the `input` value changes after each keypress, before clamping is applied.
78
+ * Note that `event.target.value` may contain values that fall outside of `min` and `max` or
79
+ * are otherwise "invalid".
80
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
81
+ */
82
+ onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
83
+ onFocus?: React.FocusEventHandler;
84
+ /**
85
+ * Callback fired after the value is clamped and changes - when the `input` is blurred or when
86
+ * the stepper buttons are triggered.
87
+ * Called with `undefined` when the value is unset.
88
+ * @param {React.FocusEvent<HTMLInputElement>|React.PointerEvent|React.KeyboardEvent} event The event source of the callback
89
+ * @param {number|undefined} value The new value of the component
90
+ */
91
+ onChange?: (event: React.FocusEvent<HTMLInputElement> | React.PointerEvent | React.KeyboardEvent, value: number | null) => void;
92
+ /**
93
+ * The `id` attribute of the input element.
94
+ */
95
+ inputId?: string;
96
+ /**
97
+ * The ref of the input element.
98
+ */
99
+ inputRef?: React.Ref<HTMLInputElement>;
100
+ /**
101
+ * If `true`, the `input` element is required.
102
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
103
+ */
104
+ required?: boolean;
105
+ /**
106
+ * If `true`, the `input` element becomes read-only. The stepper buttons remain active,
107
+ * with the addition that they are now keyboard focusable.
108
+ * @default false
109
+ */
110
+ readOnly?: boolean;
111
+ /**
112
+ * The current value. Use when the component is controlled.
113
+ * @default null
114
+ */
115
+ value?: number | null;
116
+ /**
117
+ * The name of the component using useNumberInput.
118
+ * For debugging purposes.
119
+ * @default 'useNumberInput'
120
+ */
121
+ componentName?: string;
122
+ /**
123
+ * Cuando puede soportar decimales
124
+ */
125
+ withDecimal?: boolean;
126
+ }
@@ -0,0 +1,26 @@
1
+ import { FormControlState, UseNumberInputRootSlotProps, UseNumberInputInputSlotProps, UseNumberInputIncrementButtonSlotProps, UseNumberInputDecrementButtonSlotProps } from '@mui/base';
2
+ import { UseNumberInputParameters } from './types';
3
+ /**
4
+ * Funcion asegura que el valor pasado sea procesado como una cadena limpia
5
+ * (sin espacios innecesarios) y devuelve siempre una representación de texto
6
+ */
7
+ export declare function getInputValueAsString(v: string): string;
8
+ /**
9
+ * hook para el manejo de los eventos del componente NumberInput
10
+ */
11
+ export declare const useNumberInput: (parameters: UseNumberInputParameters) => {
12
+ disabled: boolean;
13
+ error: boolean;
14
+ focused: boolean;
15
+ formControlContext: FormControlState | undefined;
16
+ getInputProps: <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseNumberInputInputSlotProps<ExternalProps>;
17
+ getIncrementButtonProps: <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseNumberInputIncrementButtonSlotProps<ExternalProps>;
18
+ getDecrementButtonProps: <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseNumberInputDecrementButtonSlotProps<ExternalProps>;
19
+ getRootProps: <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseNumberInputRootSlotProps<ExternalProps>;
20
+ required: boolean;
21
+ value: number | null;
22
+ inputValue: string;
23
+ isIncrementDisabled: boolean;
24
+ isDecrementDisabled: boolean;
25
+ focusError: boolean;
26
+ };
@@ -0,0 +1,9 @@
1
+ export declare enum NumberInputSlots {
2
+ root = "root",
3
+ input = "input",
4
+ containButtonsAdornment = "ContainButtonsAdornment",
5
+ containerButtons = "containerButtons",
6
+ increment = "increment",
7
+ decrement = "decrement",
8
+ skeleton = "skeleton"
9
+ }
@@ -0,0 +1,21 @@
1
+ export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').NumberInputOwnerState> & Record<string, unknown> & {
2
+ ownerState: Partial<import('../types').NumberInputOwnerState> & 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').NumberInputOwnerState> & Record<string, unknown> & {
5
+ ownerState: Partial<import('../types').NumberInputOwnerState> & 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 ContainerButtonsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').NumberInputOwnerState> & Record<string, unknown> & {
8
+ ownerState: Partial<import('../types').NumberInputOwnerState> & Record<string, unknown>;
9
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
10
+ export declare const ContainButtonsAdornmentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').NumberInputOwnerState> & Record<string, unknown> & {
11
+ ownerState: Partial<import('../types').NumberInputOwnerState> & Record<string, unknown>;
12
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
13
+ export declare const IncrementButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "children" | "value" | "title" | "component" | "size" | "name" | "id" | "type" | "selected" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "disabled" | "variant" | "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" | "placement" | "form" | "src" | "rotationAngle" | "tooltipContent" | "instaceDataTestId" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "componentPaletteColor" | "badgeContent" | "dictionaryTooltipId" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').NumberInputOwnerState> & Record<string, unknown> & {
14
+ ownerState: Partial<import('../types').NumberInputOwnerState> & Record<string, unknown>;
15
+ }, {}, {}>;
16
+ export declare const DecrementButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "children" | "value" | "title" | "component" | "size" | "name" | "id" | "type" | "selected" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "disabled" | "variant" | "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" | "placement" | "form" | "src" | "rotationAngle" | "tooltipContent" | "instaceDataTestId" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "componentPaletteColor" | "badgeContent" | "dictionaryTooltipId" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').NumberInputOwnerState> & Record<string, unknown> & {
17
+ ownerState: Partial<import('../types').NumberInputOwnerState> & Record<string, unknown>;
18
+ }, {}, {}>;
19
+ 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').NumberInputOwnerState> & Record<string, unknown> & {
20
+ ownerState: Partial<import('../types').NumberInputOwnerState> & Record<string, unknown>;
21
+ }, {}, {}>;
@@ -0,0 +1,48 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ import { Theme } from '@mui/material';
3
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
4
+ import { NumberInputSlots as Slots } from './slots/NumberInputEnum';
5
+ import { NUMBER_INPUT_KEY_COMPONENT } from './constants';
6
+ import { UseNumberInputParameters } from './hooks/useNumberInput/types';
7
+ export interface NumberInputOwnProps extends Omit<UseNumberInputParameters, 'error' | 'inputId' | 'inputRef' | 'focusError'> {
8
+ /**
9
+ * Clase
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Trailing adornment for this input.
14
+ */
15
+ endAdornment?: React.ReactNode;
16
+ /**
17
+ * If `true`, the `input` will indicate an error by setting the `aria-invalid` attribute on the input and the `baseui--error` class on the root element.
18
+ */
19
+ error?: boolean;
20
+ /**
21
+ * The id of the `input` element.
22
+ */
23
+ id?: string;
24
+ /**
25
+ * The short hint displayed in the `input` before the user enters a value.
26
+ */
27
+ placeholder?: React.InputHTMLAttributes<HTMLInputElement>['placeholder'];
28
+ /**
29
+ * Leading adornment for this input.
30
+ */
31
+ startAdornment?: React.ReactNode;
32
+ }
33
+ export interface NumberInputProps extends NumberInputOwnProps {
34
+ size?: Extract<Sizes, 'small' | 'medium'>;
35
+ variant?: 'outlined' | 'text';
36
+ withDecimal?: boolean;
37
+ dataTestId?: string;
38
+ }
39
+ export type NumberInputOwnerState = {
40
+ disabled?: boolean;
41
+ size?: Extract<Sizes, 'small' | 'medium'>;
42
+ variant?: 'outlined' | 'text';
43
+ error?: boolean;
44
+ focusError?: boolean;
45
+ noButtons?: boolean;
46
+ };
47
+ export type NumberInputSlotsType = keyof typeof Slots;
48
+ export type NumberInputStyles = OverridesStyleRules<Slots, typeof NUMBER_INPUT_KEY_COMPONENT, Theme>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * ajusta un valor de manera controlada dentro de un rango y en pasos definidos,
3
+ * y isNumber verifica si un valor es un número válido
4
+ */
5
+ export declare function clampStepwise(val: number, min?: number, max?: number, stepProp?: number, withDecimal?: boolean): number;
6
+ export declare function isNumber(val: unknown): val is number;
@@ -1,4 +1,4 @@
1
- import { RHFInputNumberSpinnerProps } from './types';
1
+ import { RHFNumberInputProps } from './types';
2
2
  /**
3
3
  * Componente RHFInputNumberSpinner
4
4
  * @author Andrés Quintero - automatic
@@ -6,4 +6,4 @@ import { RHFInputNumberSpinnerProps } from './types';
6
6
  * @updatedAt 2024-12-30 14:36:10 - automatic
7
7
  * @updatedUser Andrés Quintero - automatic
8
8
  */
9
- export declare const RHFInputNumberSpinner: (props: RHFInputNumberSpinnerProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const RHFNumberInput: (props: RHFNumberInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
- import { RHFInputNumberSpinnerStyles } from './types';
1
+ import { RHFNumberInputStyles } from './types';
2
2
  /**
3
3
  * Estilos para el componente `RHFInputNumberSpinner`.
4
4
  *
5
5
  * Este objeto contiene los estilos para los diferentes slots del componente,
6
6
  * permitiendo personalizar su apariencia a través de las propiedades definidas.
7
7
  */
8
- export declare const rhfInputNumberSpinnerStyles: RHFInputNumberSpinnerStyles;
8
+ export declare const rhfNumberInputStyles: RHFNumberInputStyles;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Nombre de clase que se usa para dar identidad a los slots del componente.
3
+ */
4
+ export declare const RHF_NUMBER_INPUT_KEY_COMPONENT = "M4LRHFNumberInput";