@rubenpazch/date-input 3.0.0 → 3.1.1

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/dist/index.d.ts CHANGED
@@ -1,19 +1,50 @@
1
1
  import React from 'react';
2
2
 
3
+ /** Textos del calendario (accesibilidad y botones). */
4
+ interface DateInputLabels {
5
+ openCalendar: string;
6
+ previousMonth: string;
7
+ nextMonth: string;
8
+ today: string;
9
+ clear: string;
10
+ calendar: string;
11
+ }
3
12
  interface DateInputProps {
13
+ /** id del input; si no se pasa se genera uno (la etiqueta se asocia sola). */
14
+ id?: string;
15
+ /** name del input (formularios nativos, react-hook-form…). */
16
+ name?: string;
17
+ /** Etiqueta visible. */
4
18
  label?: string;
19
+ /** Fecha en formato ISO `AAAA-MM-DD`, o cadena vacía. */
5
20
  value: string;
21
+ /** Recibe la fecha en ISO `AAAA-MM-DD` (o "" al limpiar). */
6
22
  onChange: (date: string) => void;
23
+ /** Por defecto el formato del idioma: "DD/MM/AAAA" en español. */
7
24
  placeholder?: string;
25
+ /** Mensaje de error; marca el campo como inválido. */
8
26
  error?: string;
27
+ /** Campo obligatorio. */
9
28
  required?: boolean;
29
+ /** Campo deshabilitado. */
10
30
  disabled?: boolean;
31
+ /** Fecha mínima seleccionable (ISO). */
11
32
  minDate?: string;
33
+ /** Fecha máxima seleccionable (ISO). */
12
34
  maxDate?: string;
35
+ /** Clase extra para el contenedor. */
13
36
  className?: string;
37
+ /** Texto de ayuda. */
14
38
  hint?: string;
39
+ /** Idioma: `es` (por defecto, día/mes) o `en` (mes/día). */
15
40
  locale?: string;
41
+ /** Textos del calendario; por defecto en el idioma de `locale`. */
42
+ labels?: Partial<DateInputLabels>;
16
43
  }
17
- declare const DateInput: React.FC<DateInputProps>;
44
+ /**
45
+ * Campo de fecha con calendario desplegable. Se escribe en el formato del idioma
46
+ * (DD/MM/AAAA en español) y devuelve siempre ISO `AAAA-MM-DD`, en hora local.
47
+ */
48
+ declare const DateInput: React.ForwardRefExoticComponent<DateInputProps & React.RefAttributes<HTMLInputElement>>;
18
49
 
19
50
  export { DateInput as default };