@trackunit/react-components 0.0.125 → 0.0.126
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/components/Select/Select.d.ts +1 -1
- package/index.js +34 -29
- package/package.json +1 -1
|
@@ -132,6 +132,6 @@ export interface SelectProps<Option, IsAsync extends boolean, IsMulti extends bo
|
|
|
132
132
|
* @returns {JSX.Element} Select component
|
|
133
133
|
*/
|
|
134
134
|
export declare const Select: {
|
|
135
|
-
<Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, className, dataTestId, prefix, async, dropdownIcon, maxMenuHeight, label, hasError, disabled, isMulti, components, value, options, onChange, isLoading, classNamePrefix, onMenuOpen, onMenuClose, maxSelectedDisplayCount, isClearable, isSearchable, onMenuScrollToBottom, styles, filterOption, onInputChange, }: SelectProps<Option, IsAsync, IsMulti, Group>): JSX.Element;
|
|
135
|
+
<Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, className, dataTestId, prefix, async, dropdownIcon, maxMenuHeight, label, hasError, disabled, isMulti, components, value, options, onChange, isLoading, classNamePrefix, onMenuOpen, onMenuClose, maxSelectedDisplayCount, isClearable, isSearchable, onMenuScrollToBottom, styles, filterOption, onInputChange, ...props }: SelectProps<Option, IsAsync, IsMulti, Group>): JSX.Element;
|
|
136
136
|
displayName: string;
|
|
137
137
|
};
|
package/index.js
CHANGED
|
@@ -4209,40 +4209,45 @@ const CreatableSelect = _a => {
|
|
|
4209
4209
|
* @returns {JSX.Element} Select component
|
|
4210
4210
|
*/
|
|
4211
4211
|
|
|
4212
|
-
const Select =
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4212
|
+
const Select = _a => {
|
|
4213
|
+
var _b;
|
|
4214
|
+
|
|
4215
|
+
var {
|
|
4216
|
+
id,
|
|
4217
|
+
className,
|
|
4218
|
+
dataTestId = "select",
|
|
4219
|
+
prefix,
|
|
4220
|
+
async,
|
|
4221
|
+
dropdownIcon,
|
|
4222
|
+
maxMenuHeight = 200,
|
|
4223
|
+
label,
|
|
4224
|
+
hasError,
|
|
4225
|
+
disabled,
|
|
4226
|
+
isMulti,
|
|
4227
|
+
components,
|
|
4228
|
+
value,
|
|
4229
|
+
options,
|
|
4230
|
+
onChange,
|
|
4231
|
+
isLoading,
|
|
4232
|
+
classNamePrefix = "",
|
|
4233
|
+
onMenuOpen,
|
|
4234
|
+
onMenuClose,
|
|
4235
|
+
maxSelectedDisplayCount = undefined,
|
|
4236
|
+
isClearable = false,
|
|
4237
|
+
isSearchable = true,
|
|
4238
|
+
onMenuScrollToBottom,
|
|
4239
|
+
styles,
|
|
4240
|
+
filterOption,
|
|
4241
|
+
onInputChange
|
|
4242
|
+
} = _a,
|
|
4243
|
+
props = __rest(_a, ["id", "className", "dataTestId", "prefix", "async", "dropdownIcon", "maxMenuHeight", "label", "hasError", "disabled", "isMulti", "components", "value", "options", "onChange", "isLoading", "classNamePrefix", "onMenuOpen", "onMenuClose", "maxSelectedDisplayCount", "isClearable", "isSearchable", "onMenuScrollToBottom", "styles", "filterOption", "onInputChange"]);
|
|
4244
|
+
|
|
4240
4245
|
const refContainer = React.useRef(null);
|
|
4241
4246
|
const refPrefix = React.useRef(null);
|
|
4242
4247
|
const {
|
|
4243
4248
|
customStyles
|
|
4244
4249
|
} = useCustomStyles(refContainer, refPrefix, maxSelectedDisplayCount, styles);
|
|
4245
|
-
const [menuIsOpen, setMenuIsOpen] = React.useState(false);
|
|
4250
|
+
const [menuIsOpen, setMenuIsOpen] = React.useState((_b = props.menuIsOpen) !== null && _b !== void 0 ? _b : false);
|
|
4246
4251
|
const [menuIsClosing, setMenuIsClosing] = React.useState(true);
|
|
4247
4252
|
const refMenuIsEnabled = React.useRef(true);
|
|
4248
4253
|
const customComponents = useCustomComponents(components, disabled || false, menuIsClosing, refMenuIsEnabled, dataTestId, maxSelectedDisplayCount, dropdownIcon);
|