@conduction/components 2.0.19 → 2.0.21

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,8 @@
4
4
 
5
5
  - **Version 2**
6
6
 
7
+ - 2.0.21: Add InputDateTime component.
8
+ - 2.0.20: Bugfix Textarea component to include correct field validation.
7
9
  - 2.0.19: Add disabled state to Textarea and InputCheckbox components.
8
10
  - 2.0.17 & 2.0.18: Refactor PrimaryTopNav styling.
9
11
  - 2.0.16: Remove styling warnings.
@@ -1,7 +1,7 @@
1
- import { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile } from "./input";
1
+ import { InputText, InputPassword, InputEmail, InputDate, InputDateTime, InputNumber, InputFile } from "./input";
2
2
  import { Textarea } from "./textarea";
3
3
  import { InputCheckbox } from "./checkbox";
4
4
  import { InputRadio } from "./radio";
5
5
  import { SelectSingle, SelectMultiple } from "./select/select";
6
6
  import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
7
- export { InputRadio, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, CreateKeyValue, };
7
+ export { InputRadio, InputText, InputPassword, InputEmail, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, CreateKeyValue, };
@@ -1,7 +1,7 @@
1
- import { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile } from "./input";
1
+ import { InputText, InputPassword, InputEmail, InputDate, InputDateTime, InputNumber, InputFile } from "./input";
2
2
  import { Textarea } from "./textarea";
3
3
  import { InputCheckbox } from "./checkbox";
4
4
  import { InputRadio } from "./radio";
5
5
  import { SelectSingle, SelectMultiple } from "./select/select";
6
6
  import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
7
- export { InputRadio, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, CreateKeyValue, };
7
+ export { InputRadio, InputText, InputPassword, InputEmail, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, CreateKeyValue, };
@@ -11,6 +11,7 @@ export declare const InputPassword: React.FC<IInputProps & IReactHookFormProps>;
11
11
  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
+ export declare const InputDateTime: React.FC<IInputProps & IReactHookFormProps>;
14
15
  export declare const InputNumber: React.FC<IInputProps & IReactHookFormProps>;
15
16
  export declare const InputFloat: React.FC<IInputProps & IReactHookFormProps>;
16
17
  interface IInputFileProps {
@@ -9,6 +9,7 @@ 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 InputDateTime = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "datetime-local", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
12
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] }));
13
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] }));
14
15
  export const InputFile = ({ disabled, name, accept, defaultValue, validation, register, }) => (_jsx("input", { className: "denhaag-textfield__input", type: "file", ...{ defaultValue, disabled, accept }, ...register(name, { ...validation }) }));
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TextArea } from "@gemeente-denhaag/textarea";
3
- export const Textarea = ({ name, validation, register, errors, disabled, }) => _jsx(TextArea, { ...(register(name, { ...validation }), { disabled }), invalid: errors[name] });
3
+ export const Textarea = ({ name, validation, register, errors, disabled, }) => _jsx(TextArea, { ...register(name, { ...validation }), ...{ disabled }, invalid: errors[name] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile } from "./input";
1
+ import { InputText, InputPassword, InputEmail, InputDate, InputDateTime, InputNumber, InputFile } from "./input";
2
2
  import { Textarea } from "./textarea";
3
3
  import { InputCheckbox } from "./checkbox";
4
4
  import { InputRadio } from "./radio";
@@ -11,6 +11,7 @@ export {
11
11
  InputPassword,
12
12
  InputEmail,
13
13
  InputDate,
14
+ InputDateTime,
14
15
  InputNumber,
15
16
  InputCheckbox,
16
17
  InputFile,
@@ -84,6 +84,22 @@ export const InputDate: React.FC<IInputProps & IReactHookFormProps> = ({
84
84
  />
85
85
  );
86
86
 
87
+ export const InputDateTime: React.FC<IInputProps & IReactHookFormProps> = ({
88
+ disabled,
89
+ name,
90
+ defaultValue,
91
+ validation,
92
+ register,
93
+ errors,
94
+ }) => (
95
+ <TextField
96
+ type="datetime-local"
97
+ {...{ defaultValue, disabled }}
98
+ {...register(name, { ...validation })}
99
+ invalid={errors[name]}
100
+ />
101
+ );
102
+
87
103
  export const InputNumber: React.FC<IInputProps & IReactHookFormProps> = ({
88
104
  disabled,
89
105
  name,
@@ -14,4 +14,4 @@ export const Textarea: React.FC<ITextAreaProps & IReactHookFormProps> = ({
14
14
  register,
15
15
  errors,
16
16
  disabled,
17
- }) => <TextArea {...(register(name, { ...validation }), { disabled })} invalid={errors[name]} />;
17
+ }) => <TextArea {...register(name, { ...validation })} {...{ disabled }} invalid={errors[name]} />;