ab-ui-library 1.49.5 → 1.49.6
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.
|
@@ -126,7 +126,8 @@ var Select = function Select(props) {
|
|
|
126
126
|
labelAddons = props.labelAddons,
|
|
127
127
|
tooltipAddons = props.tooltipAddons,
|
|
128
128
|
renderOptions = props.renderOptions,
|
|
129
|
-
isAllowed = props.isAllowed
|
|
129
|
+
isAllowed = props.isAllowed,
|
|
130
|
+
defaultValue = props.defaultValue;
|
|
130
131
|
var scrollRef = useRef(null);
|
|
131
132
|
var inputRef = useRef(null);
|
|
132
133
|
var containerRef = useRef(null);
|
|
@@ -292,6 +293,16 @@ var Select = function Select(props) {
|
|
|
292
293
|
}
|
|
293
294
|
}, selectRightIconProps);
|
|
294
295
|
}, [selectRightIconProps]);
|
|
296
|
+
useEffect(function () {
|
|
297
|
+
if (defaultValue && isCreateOnOutsideClick) {
|
|
298
|
+
setSelectedOption({
|
|
299
|
+
label: defaultValue,
|
|
300
|
+
value: defaultValue
|
|
301
|
+
});
|
|
302
|
+
setSearchValue(defaultValue);
|
|
303
|
+
onItemSelect(defaultValue);
|
|
304
|
+
}
|
|
305
|
+
}, [defaultValue, isCreateOnOutsideClick]);
|
|
295
306
|
return /*#__PURE__*/React.createElement("div", {
|
|
296
307
|
"data-id": "".concat(dataId, "-content"),
|
|
297
308
|
className: classNames("select select--".concat(size), className, {
|
|
@@ -139,6 +139,7 @@ export interface TSingleSelectPropTypes extends IFormCompProps, TSelectBaseProps
|
|
|
139
139
|
floatValue: number | undefined;
|
|
140
140
|
}) => boolean;
|
|
141
141
|
renderOptions?: (props: IRenderOptionItemProps) => JSX.Element;
|
|
142
|
+
defaultValue?: string;
|
|
142
143
|
}
|
|
143
144
|
export type TSelectFooterPropTypes = {
|
|
144
145
|
checkboxInfo?: TCheckboxInfo;
|