@conduction/components 2.0.21 → 2.0.22
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/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- **Version 2**
|
|
6
6
|
|
|
7
|
+
- 2.0.22: Refactor InputNumber and InputFloat to return number type.
|
|
7
8
|
- 2.0.21: Add InputDateTime component.
|
|
8
9
|
- 2.0.20: Bugfix Textarea component to include correct field validation.
|
|
9
10
|
- 2.0.19: Add disabled state to Textarea and InputCheckbox components.
|
|
@@ -10,6 +10,6 @@ export const InputText = ({ disabled, name, defaultValue, validation, register,
|
|
|
10
10
|
export const InputEmail = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "email", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
11
11
|
export const InputDate = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "date", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
12
12
|
export const InputDateTime = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "datetime-local", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
13
|
-
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
14
|
-
export const InputFloat = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", step: ".01", ...{ disabled, placeholder, icon, defaultValue }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
13
|
+
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation, valueAsNumber: true }), invalid: errors[name] }));
|
|
14
|
+
export const InputFloat = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", step: ".01", ...{ disabled, placeholder, icon, defaultValue }, ...register(name, { ...validation, valueAsNumber: true }), invalid: errors[name] }));
|
|
15
15
|
export const InputFile = ({ disabled, name, accept, defaultValue, validation, register, }) => (_jsx("input", { className: "denhaag-textfield__input", type: "file", ...{ defaultValue, disabled, accept }, ...register(name, { ...validation }) }));
|
package/package.json
CHANGED
|
@@ -113,7 +113,7 @@ export const InputNumber: React.FC<IInputProps & IReactHookFormProps> = ({
|
|
|
113
113
|
<TextField
|
|
114
114
|
type="number"
|
|
115
115
|
{...{ defaultValue, disabled, placeholder, icon }}
|
|
116
|
-
{...register(name, { ...validation })}
|
|
116
|
+
{...register(name, { ...validation, valueAsNumber: true })}
|
|
117
117
|
invalid={errors[name]}
|
|
118
118
|
/>
|
|
119
119
|
);
|
|
@@ -132,7 +132,7 @@ export const InputFloat: React.FC<IInputProps & IReactHookFormProps> = ({
|
|
|
132
132
|
type="number"
|
|
133
133
|
step=".01"
|
|
134
134
|
{...{ disabled, placeholder, icon, defaultValue }}
|
|
135
|
-
{...register(name, { ...validation })}
|
|
135
|
+
{...register(name, { ...validation, valueAsNumber: true })}
|
|
136
136
|
invalid={errors[name]}
|
|
137
137
|
/>
|
|
138
138
|
);
|