componenteshospitais 2.0.4 → 2.0.5

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.
@@ -5,7 +5,7 @@ interface InputFieldProps {
5
5
  id: string;
6
6
  placeholder: string;
7
7
  value: string;
8
- onChange?: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
8
+ onChange?: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
9
9
  largura?: string;
10
10
  readonly?: boolean;
11
11
  disabled?: boolean;
@@ -13,8 +13,8 @@ interface InputFieldProps {
13
13
  checked?: boolean;
14
14
  maxLength?: number;
15
15
  maskType?: 'cpf' | 'phone' | 'time' | 'date' | 'cep' | 'telefone';
16
- onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
17
- onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
16
+ onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
17
+ onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
18
18
  corFundo?: string;
19
19
  corLabel?: string;
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "componenteshospitais",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -9,7 +9,7 @@ interface InputFieldProps {
9
9
  id: string;
10
10
  placeholder: string;
11
11
  value: string;
12
- onChange?: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
12
+ onChange?: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
13
13
  largura?: string;
14
14
  readonly?: boolean;
15
15
  disabled?: boolean;
@@ -17,8 +17,8 @@ interface InputFieldProps {
17
17
  checked?: boolean;
18
18
  maxLength?: number;
19
19
  maskType?: 'cpf' | 'phone' | 'time' | 'date' | 'cep' | 'telefone';
20
- onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
21
- onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
20
+ onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
21
+ onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
22
22
  corFundo?: string;
23
23
  corLabel?: string;
24
24
  }
@@ -50,12 +50,12 @@ const InputField: React.FC<InputFieldProps> = ({
50
50
 
51
51
  const appliedMaxLength = maxLength !== undefined ? maxLength : 524288;
52
52
 
53
- const handleChange = (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
53
+ const handleChange = (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
54
54
  if (type === 'number' && e.target.value.length > appliedMaxLength) {
55
55
  e.target.value = e.target.value.slice(0, appliedMaxLength);
56
56
  }
57
57
  if (onChange) {
58
- onChange(e);
58
+ onChange(e);
59
59
  }
60
60
  };
61
61