@indico-data/design-system 3.10.0 → 3.11.0
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/lib/components/forms/select/Select.d.ts +3 -1
- package/lib/components/forms/select/types.d.ts +2 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.esm.js +3 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/forms/select/Select.tsx +30 -22
- package/src/components/forms/select/types.ts +3 -1
package/package.json
CHANGED
|
@@ -34,30 +34,38 @@ const OptionComponent = <OptionType extends SelectOption>({
|
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const Select =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
const Select = React.forwardRef(
|
|
38
|
+
<OptionType extends SelectOption>(
|
|
39
|
+
{
|
|
40
|
+
classNamePrefix = 'select',
|
|
41
|
+
className,
|
|
42
|
+
components: customComponents,
|
|
43
|
+
label,
|
|
44
|
+
hasHiddenLabel,
|
|
45
|
+
name,
|
|
46
|
+
...props
|
|
47
|
+
}: SelectProps<OptionType>,
|
|
48
|
+
ref: React.Ref<any>,
|
|
49
|
+
) => {
|
|
50
|
+
const defaultComponents = {
|
|
51
|
+
Option: OptionComponent as React.ComponentType<OptionProps<OptionType>>,
|
|
52
|
+
};
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
const mergedComponents = { ...defaultComponents, ...customComponents };
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
return (
|
|
57
|
+
<ReactSelect
|
|
58
|
+
ref={ref}
|
|
59
|
+
classNamePrefix={classNamePrefix}
|
|
60
|
+
className={classNames('select-wrapper', className)}
|
|
61
|
+
components={mergedComponents}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
) as <OptionType extends SelectOption>(
|
|
67
|
+
props: SelectProps<OptionType> & { ref?: React.Ref<any> },
|
|
68
|
+
) => React.ReactElement;
|
|
61
69
|
|
|
62
70
|
const LabeledSelect = withLabel(Select);
|
|
63
71
|
|