@conduction/components 2.1.6 → 2.1.7

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,7 @@
4
4
 
5
5
  - **Version 2.1 (breaking changes from 2.0.x)**
6
6
 
7
+ - 2.1.7: Add disabled placholders to all Select elements.
7
8
  - 2.1.6: Add disabled state to CreateKeyValue component
8
9
  - 2.1.4 & 2.1.5: Remove IInputProps from CreateKeyValue to undo duplicate defaultValue prop
9
10
  - 2.1.3: Export IKeyValue from CreateKeyValue component.
@@ -6,16 +6,16 @@ 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
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 }) } }));
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 }) }, placeholder: disabled ? "Disabled..." : "Select one or more options..." }));
10
10
  } }));
11
11
  };
12
12
  export const SelectCreate = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
13
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 }) } }));
14
+ return (_jsx(CreatableSelect, { value: value ?? "", placeholder: disabled ? "Disabled..." : "Select or create one or multiple options...", 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, }) => {
18
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 }) } }));
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 }) }, placeholder: disabled ? "Disabled..." : "Select an option..." }));
20
20
  } }));
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -38,6 +38,7 @@ export const SelectMultiple: React.FC<ISelectProps & IReactHookFormProps> = ({
38
38
  {...{ options, onChange, errors }}
39
39
  menuPortalTarget={document.body}
40
40
  styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
41
+ placeholder={disabled ? "Disabled..." : "Select one or more options..."}
41
42
  />
42
43
  );
43
44
  }}
@@ -62,7 +63,7 @@ export const SelectCreate: React.FC<ISelectProps & IReactHookFormProps> = ({
62
63
  return (
63
64
  <CreatableSelect
64
65
  value={value ?? ""}
65
- placeholder="Select existing or create new entries"
66
+ placeholder={disabled ? "Disabled..." : "Select or create one or multiple options..."}
66
67
  className={clsx(styles.select, errors[name] && styles.error)}
67
68
  isMulti
68
69
  isDisabled={disabled}
@@ -99,6 +100,7 @@ export const SelectSingle: React.FC<ISelectProps & IReactHookFormProps> = ({
99
100
  {...{ options, onChange, errors, isClearable }}
100
101
  menuPortalTarget={document.body}
101
102
  styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
103
+ placeholder={disabled ? "Disabled..." : "Select an option..."}
102
104
  />
103
105
  );
104
106
  }}