@conduction/components 2.0.31 → 2.0.32

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.32:
8
+ - SelectSingle update to include defaultValue in react-hook-form controller.
7
9
  - 2.0.31:
8
10
  - PrimaryTopNav clickbox now includes padding of nav items.
9
11
  - 2.0.30:
@@ -15,7 +15,7 @@ export const SelectCreate = ({ name, options, errors, control, validation, defau
15
15
  } }));
16
16
  };
17
17
  export const SelectSingle = ({ name, options, errors, control, validation, isClearable, defaultValue, disabled, }) => {
18
- return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
19
- return (_jsx(ReactSelect, { value: value || "", className: clsx(styles.select, errors[name] && styles.error), isDisabled: disabled, ...{ options, onChange, errors, isClearable, defaultValue }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
18
+ return (_jsx(Controller, { ...{ control, name, defaultValue }, rules: validation, render: ({ field: { onChange, value } }) => {
19
+ return (_jsx(ReactSelect, { value: value ?? "", className: clsx(styles.select, errors[name] && styles.error), isDisabled: disabled, ...{ options, onChange, errors, isClearable }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
20
20
  } }));
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.0.31",
3
+ "version": "2.0.32",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -86,15 +86,15 @@ export const SelectSingle: React.FC<ISelectProps & IReactHookFormProps> = ({
86
86
  }) => {
87
87
  return (
88
88
  <Controller
89
- {...{ control, name }}
89
+ {...{ control, name, defaultValue }}
90
90
  rules={validation}
91
91
  render={({ field: { onChange, value } }) => {
92
92
  return (
93
93
  <ReactSelect
94
- value={value || ""}
94
+ value={value ?? ""}
95
95
  className={clsx(styles.select, errors[name] && styles.error)}
96
96
  isDisabled={disabled}
97
- {...{ options, onChange, errors, isClearable, defaultValue }}
97
+ {...{ options, onChange, errors, isClearable }}
98
98
  menuPortalTarget={document.body}
99
99
  styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
100
100
  />