@conduction/components 2.0.32 → 2.0.34
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 +2 -0
- package/lib/components/formFields/index.d.ts +2 -2
- package/lib/components/formFields/index.js +2 -2
- package/lib/components/formFields/select/select.js +4 -4
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.module.css +1 -0
- package/package.json +1 -1
- package/src/components/formFields/index.tsx +2 -1
- package/src/components/formFields/select/select.tsx +6 -4
- package/src/components/topNav/primaryTopNav/PrimaryTopNav.module.css +1 -0
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
- **Version 2**
|
|
6
6
|
|
|
7
|
+
- 2.0.34: SelectMultiple and SelectCreate update to include defaultValue in react-hook-form controller.
|
|
8
|
+
- 2.0.33: PrimaryTopNav sub items doesn't overlap main navbar anymore
|
|
7
9
|
- 2.0.32:
|
|
8
10
|
- SelectSingle update to include defaultValue in react-hook-form controller.
|
|
9
11
|
- 2.0.31:
|
|
@@ -2,6 +2,6 @@ import { InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTim
|
|
|
2
2
|
import { Textarea } from "./textarea";
|
|
3
3
|
import { InputCheckbox } from "./checkbox";
|
|
4
4
|
import { InputRadio } from "./radio";
|
|
5
|
-
import { SelectSingle, SelectMultiple } from "./select/select";
|
|
5
|
+
import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
|
|
6
6
|
import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
|
|
7
|
-
export { InputRadio, InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, CreateKeyValue, };
|
|
7
|
+
export { InputRadio, InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, SelectCreate, CreateKeyValue, };
|
|
@@ -2,6 +2,6 @@ import { InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTim
|
|
|
2
2
|
import { Textarea } from "./textarea";
|
|
3
3
|
import { InputCheckbox } from "./checkbox";
|
|
4
4
|
import { InputRadio } from "./radio";
|
|
5
|
-
import { SelectSingle, SelectMultiple } from "./select/select";
|
|
5
|
+
import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
|
|
6
6
|
import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
|
|
7
|
-
export { InputRadio, InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, CreateKeyValue, };
|
|
7
|
+
export { InputRadio, InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, SelectCreate, CreateKeyValue, };
|
|
@@ -5,13 +5,13 @@ import ReactSelect from "react-select";
|
|
|
5
5
|
import CreatableSelect from "react-select/creatable";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
export const SelectMultiple = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
|
|
8
|
-
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
9
|
-
return (_jsx(ReactSelect, { className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options,
|
|
8
|
+
return (_jsx(Controller, { ...{ control, name, defaultValue }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
9
|
+
return (_jsx(ReactSelect, { value: value ?? "", className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options, onChange, errors }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
|
|
10
10
|
} }));
|
|
11
11
|
};
|
|
12
12
|
export const SelectCreate = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
|
|
13
|
-
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
14
|
-
return (_jsx(CreatableSelect, { placeholder: "Select existing or create new entries", className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options,
|
|
13
|
+
return (_jsx(Controller, { ...{ control, name, defaultValue }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
14
|
+
return (_jsx(CreatableSelect, { value: value ?? "", placeholder: "Select existing or create new entries", className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options, onChange, errors }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
|
|
15
15
|
} }));
|
|
16
16
|
};
|
|
17
17
|
export const SelectSingle = ({ name, options, errors, control, validation, isClearable, defaultValue, disabled, }) => {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { Textarea } from "./textarea";
|
|
12
12
|
import { InputCheckbox } from "./checkbox";
|
|
13
13
|
import { InputRadio } from "./radio";
|
|
14
|
-
import { SelectSingle, SelectMultiple } from "./select/select";
|
|
14
|
+
import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
|
|
15
15
|
import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
|
|
16
16
|
|
|
17
17
|
export {
|
|
@@ -28,5 +28,6 @@ export {
|
|
|
28
28
|
Textarea,
|
|
29
29
|
SelectSingle,
|
|
30
30
|
SelectMultiple,
|
|
31
|
+
SelectCreate,
|
|
31
32
|
CreateKeyValue,
|
|
32
33
|
};
|
|
@@ -26,15 +26,16 @@ export const SelectMultiple: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
26
26
|
}) => {
|
|
27
27
|
return (
|
|
28
28
|
<Controller
|
|
29
|
-
{...{ control, name }}
|
|
29
|
+
{...{ control, name, defaultValue }}
|
|
30
30
|
rules={validation}
|
|
31
31
|
render={({ field: { onChange, value } }) => {
|
|
32
32
|
return (
|
|
33
33
|
<ReactSelect
|
|
34
|
+
value={value ?? ""}
|
|
34
35
|
className={clsx(styles.select, errors[name] && styles.error)}
|
|
35
36
|
isMulti
|
|
36
37
|
isDisabled={disabled}
|
|
37
|
-
{...{ options,
|
|
38
|
+
{...{ options, onChange, errors }}
|
|
38
39
|
menuPortalTarget={document.body}
|
|
39
40
|
styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
|
|
40
41
|
/>
|
|
@@ -55,16 +56,17 @@ export const SelectCreate: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
55
56
|
}) => {
|
|
56
57
|
return (
|
|
57
58
|
<Controller
|
|
58
|
-
{...{ control, name }}
|
|
59
|
+
{...{ control, name, defaultValue }}
|
|
59
60
|
rules={validation}
|
|
60
61
|
render={({ field: { onChange, value } }) => {
|
|
61
62
|
return (
|
|
62
63
|
<CreatableSelect
|
|
64
|
+
value={value ?? ""}
|
|
63
65
|
placeholder="Select existing or create new entries"
|
|
64
66
|
className={clsx(styles.select, errors[name] && styles.error)}
|
|
65
67
|
isMulti
|
|
66
68
|
isDisabled={disabled}
|
|
67
|
-
{...{ options,
|
|
69
|
+
{...{ options, onChange, errors }}
|
|
68
70
|
menuPortalTarget={document.body}
|
|
69
71
|
styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
|
|
70
72
|
/>
|