@conduction/components 2.0.9 → 2.0.11
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
|
@@ -12,6 +12,7 @@ export declare const InputText: React.FC<IInputProps & IReactHookFormProps>;
|
|
|
12
12
|
export declare const InputEmail: React.FC<IInputProps & IReactHookFormProps>;
|
|
13
13
|
export declare const InputDate: React.FC<IInputProps & IReactHookFormProps>;
|
|
14
14
|
export declare const InputNumber: React.FC<IInputProps & IReactHookFormProps>;
|
|
15
|
+
export declare const InputFloat: React.FC<IInputProps & IReactHookFormProps>;
|
|
15
16
|
interface IInputFileProps {
|
|
16
17
|
accept?: string;
|
|
17
18
|
}
|
|
@@ -9,5 +9,6 @@ export const InputPassword = ({ disabled, name, validation, register, placeholde
|
|
|
9
9
|
export const InputText = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "text", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
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
|
-
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{
|
|
12
|
+
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{ disabled, placeholder, icon, defaultValue }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
13
|
+
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
14
|
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
|
@@ -102,6 +102,25 @@ export const InputNumber: React.FC<IInputProps & IReactHookFormProps> = ({
|
|
|
102
102
|
/>
|
|
103
103
|
);
|
|
104
104
|
|
|
105
|
+
export const InputFloat: React.FC<IInputProps & IReactHookFormProps> = ({
|
|
106
|
+
disabled,
|
|
107
|
+
name,
|
|
108
|
+
defaultValue,
|
|
109
|
+
validation,
|
|
110
|
+
register,
|
|
111
|
+
icon,
|
|
112
|
+
placeholder,
|
|
113
|
+
errors,
|
|
114
|
+
}) => (
|
|
115
|
+
<TextField
|
|
116
|
+
type="number"
|
|
117
|
+
step=".01"
|
|
118
|
+
{...{ disabled, placeholder, icon, defaultValue }}
|
|
119
|
+
{...register(name, { ...validation })}
|
|
120
|
+
invalid={errors[name]}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
|
|
105
124
|
interface IInputFileProps {
|
|
106
125
|
accept?: string;
|
|
107
126
|
}
|
|
@@ -76,6 +76,7 @@ export const SelectSingle: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
76
76
|
validation,
|
|
77
77
|
isClearable,
|
|
78
78
|
defaultValue,
|
|
79
|
+
disabled,
|
|
79
80
|
}) => {
|
|
80
81
|
return (
|
|
81
82
|
<Controller
|
|
@@ -83,7 +84,11 @@ export const SelectSingle: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
83
84
|
rules={validation}
|
|
84
85
|
render={({ field: { onChange, value } }) => {
|
|
85
86
|
return (
|
|
86
|
-
<ReactSelect
|
|
87
|
+
<ReactSelect
|
|
88
|
+
className={styles.select}
|
|
89
|
+
isDisabled={disabled}
|
|
90
|
+
{...{ options, onChange, value, errors, isClearable, defaultValue }}
|
|
91
|
+
/>
|
|
87
92
|
);
|
|
88
93
|
}}
|
|
89
94
|
/>
|