@hyphen/hyphen-components 2.16.2 → 2.16.3
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/dist/components/SelectInput/SelectInput.d.ts +8 -0
- package/dist/hyphen-components.cjs.development.js +6 -5
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +6 -5
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SelectInput/SelectInput.tsx +13 -1
|
@@ -29,6 +29,10 @@ export interface SelectInputProps {
|
|
|
29
29
|
* The value(s) of select.
|
|
30
30
|
*/
|
|
31
31
|
value: any | any[];
|
|
32
|
+
/**
|
|
33
|
+
* Options for dropdown list.
|
|
34
|
+
*/
|
|
35
|
+
options: SelectInputOptions | AsyncOptions;
|
|
32
36
|
/**
|
|
33
37
|
* Autofocus select input on render.
|
|
34
38
|
*/
|
|
@@ -50,6 +54,10 @@ export interface SelectInputProps {
|
|
|
50
54
|
* Visually hide the label.
|
|
51
55
|
*/
|
|
52
56
|
hideLabel?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Load the input asynchronously.
|
|
59
|
+
*/
|
|
60
|
+
isAsync?: boolean;
|
|
53
61
|
/**
|
|
54
62
|
* If the input value is clearable programmatically.
|
|
55
63
|
*/
|
|
@@ -2304,14 +2304,15 @@ function SelectInput(props) {
|
|
|
2304
2304
|
}));
|
|
2305
2305
|
};
|
|
2306
2306
|
var Component = isCreatable && isAsync ? AsyncCreatableSelect : isCreatable ? CreatableSelect : isAsync ? AsyncSelect : Select;
|
|
2307
|
-
|
|
2308
|
-
width: "100%",
|
|
2309
|
-
className: wrapperClasses
|
|
2310
|
-
}, label && !hideLabel && React.createElement(FormLabel, _extends({}, labelProps), label), React.createElement(Component, _extends({}, restProps, isAsync ? {
|
|
2307
|
+
var selectOptions = isAsync ? {
|
|
2311
2308
|
loadOptions: options
|
|
2312
2309
|
} : {
|
|
2313
2310
|
options: options
|
|
2314
|
-
}
|
|
2311
|
+
};
|
|
2312
|
+
return React.createElement(Box, {
|
|
2313
|
+
width: "100%",
|
|
2314
|
+
className: wrapperClasses
|
|
2315
|
+
}, label && !hideLabel && React.createElement(FormLabel, _extends({}, labelProps), label), React.createElement(Component, _extends({}, restProps, selectOptions, {
|
|
2315
2316
|
inputId: id,
|
|
2316
2317
|
"aria-label": label,
|
|
2317
2318
|
components: {
|