akeyless-client-commons 1.0.33 → 1.0.34
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/index.js
CHANGED
|
@@ -4216,10 +4216,9 @@ function SearchSelect(param) {
|
|
|
4216
4216
|
var options = param.options, name = param.name, _param_selectPlaceholder = param.selectPlaceholder, selectPlaceholder = _param_selectPlaceholder === void 0 ? "Select" : _param_selectPlaceholder, defaultValue = param.defaultValue, _param_searchPlaceholder = param.searchPlaceholder, searchPlaceholder = _param_searchPlaceholder === void 0 ? "Search" : _param_searchPlaceholder, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, notFoundLabel = param.notFoundLabel, notFoundLabelClassName = param.notFoundLabelClassName, elementClassName = param.elementClassName, searchClassName = param.searchClassName, selectButtonClassName = param.selectButtonClassName, value = param.value, disabled = param.disabled, onChange = param.onChange, direction = param.direction, createNewOptionLabel = param.createNewOptionLabel;
|
|
4217
4217
|
var id = (0, import_react6.useId)();
|
|
4218
4218
|
var _ref = _sliced_to_array((0, import_react6.useState)(false), 2), open = _ref[0], setOpen = _ref[1];
|
|
4219
|
-
var _ref1;
|
|
4220
|
-
var _ref2 = _sliced_to_array((0, import_react6.useState)(
|
|
4221
|
-
var _ref3 = _sliced_to_array((0, import_react6.useState)(
|
|
4222
|
-
var _ref4 = _sliced_to_array((0, import_react6.useState)([]), 2), newOptions = _ref4[0], setNewOptions = _ref4[1];
|
|
4219
|
+
var _ref1 = _sliced_to_array((0, import_react6.useState)(value || defaultValue || ""), 2), selectedValue = _ref1[0], setSelectedValue = _ref1[1];
|
|
4220
|
+
var _ref2 = _sliced_to_array((0, import_react6.useState)(""), 2), searchQuery = _ref2[0], setSearchQuery = _ref2[1];
|
|
4221
|
+
var _ref3 = _sliced_to_array((0, import_react6.useState)([]), 2), newOptions = _ref3[0], setNewOptions = _ref3[1];
|
|
4223
4222
|
var allOptions = (0, import_react6.useMemo)(function() {
|
|
4224
4223
|
return _to_consumable_array(options).concat(_to_consumable_array(newOptions));
|
|
4225
4224
|
}, [
|
|
@@ -4313,8 +4312,7 @@ function SearchSelect(param) {
|
|
|
4313
4312
|
return setSearchQuery(val);
|
|
4314
4313
|
},
|
|
4315
4314
|
onKeyDown: function(e) {
|
|
4316
|
-
|
|
4317
|
-
if (e.key === "Enter" && searchQuery) {
|
|
4315
|
+
if (e.key === "Enter" && searchQuery && filteredOptions.length === 0 && createNewOptionLabel) {
|
|
4318
4316
|
addNewOption();
|
|
4319
4317
|
}
|
|
4320
4318
|
}
|
|
@@ -4021,8 +4021,7 @@ function SearchSelect(param) {
|
|
|
4021
4021
|
var options = param.options, name = param.name, _param_selectPlaceholder = param.selectPlaceholder, selectPlaceholder = _param_selectPlaceholder === void 0 ? "Select" : _param_selectPlaceholder, defaultValue = param.defaultValue, _param_searchPlaceholder = param.searchPlaceholder, searchPlaceholder = _param_searchPlaceholder === void 0 ? "Search" : _param_searchPlaceholder, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, notFoundLabel = param.notFoundLabel, notFoundLabelClassName = param.notFoundLabelClassName, elementClassName = param.elementClassName, searchClassName = param.searchClassName, selectButtonClassName = param.selectButtonClassName, value = param.value, disabled = param.disabled, onChange = param.onChange, direction = param.direction, createNewOptionLabel = param.createNewOptionLabel;
|
|
4022
4022
|
var id = useId();
|
|
4023
4023
|
var _useState5 = _sliced_to_array(useState5(false), 2), open = _useState5[0], setOpen = _useState5[1];
|
|
4024
|
-
var
|
|
4025
|
-
var _useState51 = _sliced_to_array(useState5((_ref = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref !== void 0 ? _ref : ""), 2), selectedValue = _useState51[0], setSelectedValue = _useState51[1];
|
|
4024
|
+
var _useState51 = _sliced_to_array(useState5(value || defaultValue || ""), 2), selectedValue = _useState51[0], setSelectedValue = _useState51[1];
|
|
4026
4025
|
var _useState52 = _sliced_to_array(useState5(""), 2), searchQuery = _useState52[0], setSearchQuery = _useState52[1];
|
|
4027
4026
|
var _useState53 = _sliced_to_array(useState5([]), 2), newOptions = _useState53[0], setNewOptions = _useState53[1];
|
|
4028
4027
|
var allOptions = useMemo5(function() {
|
|
@@ -4118,8 +4117,7 @@ function SearchSelect(param) {
|
|
|
4118
4117
|
return setSearchQuery(val);
|
|
4119
4118
|
},
|
|
4120
4119
|
onKeyDown: function(e) {
|
|
4121
|
-
|
|
4122
|
-
if (e.key === "Enter" && searchQuery) {
|
|
4120
|
+
if (e.key === "Enter" && searchQuery && filteredOptions.length === 0 && createNewOptionLabel) {
|
|
4123
4121
|
addNewOption();
|
|
4124
4122
|
}
|
|
4125
4123
|
}
|