@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
@@ -4,6 +4,10 @@
4
4
 
5
5
  - **Version 2**
6
6
 
7
+ - 2.0.11:
8
+ - Added disabled state to SelectSingle component;
9
+ - 2.0.10:
10
+ - Added InputFloat (.00 decimals) component;
7
11
  - 2.0.9:
8
12
  - Added optional defaultChecked to InputCheckbox;
9
13
  - Added CreateKeyValue input;
@@ -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", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -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 className={styles.select} {...{ options, onChange, value, errors, isClearable, defaultValue }} />
87
+ <ReactSelect
88
+ className={styles.select}
89
+ isDisabled={disabled}
90
+ {...{ options, onChange, value, errors, isClearable, defaultValue }}
91
+ />
87
92
  );
88
93
  }}
89
94
  />