@monolith-forensics/monolith-ui 1.2.47 → 1.2.49
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.
|
@@ -171,6 +171,8 @@ const resolveValue = (value, data) => {
|
|
|
171
171
|
let foundOption;
|
|
172
172
|
if (value === undefined)
|
|
173
173
|
return undefined;
|
|
174
|
+
if (value === null)
|
|
175
|
+
return null;
|
|
174
176
|
if (typeof value === "string") {
|
|
175
177
|
foundOption = data.find((item) => item.value === value);
|
|
176
178
|
}
|
|
@@ -345,7 +347,7 @@ DropDownProps = {}, debounceTime = 150, sort = false, }) => {
|
|
|
345
347
|
};
|
|
346
348
|
const handleChangeSelection = useCallback((option) => {
|
|
347
349
|
!isControlled && setValueState(option);
|
|
348
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
350
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(option === null || option === void 0 ? void 0 : option.value, option);
|
|
349
351
|
}, [onChange]);
|
|
350
352
|
const handleAddItem = useCallback((newItem) => {
|
|
351
353
|
const newValue = { label: newItem, value: newItem };
|
|
@@ -8,8 +8,8 @@ export type Option = {
|
|
|
8
8
|
export type Value = number | boolean | string | Option;
|
|
9
9
|
export interface SelectBoxProps {
|
|
10
10
|
className?: string;
|
|
11
|
-
defaultValue?: Option | string;
|
|
12
|
-
value?: Option | string;
|
|
11
|
+
defaultValue?: Option | string | number;
|
|
12
|
+
value?: Option | string | number;
|
|
13
13
|
data?: Option[] | string[];
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
arrow?: boolean;
|