next-helios-fe 1.8.30 → 1.8.31
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/package.json
CHANGED
@@ -6,7 +6,7 @@ import { Icon } from "@iconify/react";
|
|
6
6
|
export interface MultipleSelectProps
|
7
7
|
extends Omit<
|
8
8
|
React.HTMLAttributes<HTMLDivElement>,
|
9
|
-
"defaultvalue" | "value" | "onChange"
|
9
|
+
"defaultvalue" | "value" | "onChange" | "onSelect"
|
10
10
|
> {
|
11
11
|
menus: {
|
12
12
|
label: string;
|
@@ -29,6 +29,8 @@ export interface MultipleSelectProps
|
|
29
29
|
value: string[];
|
30
30
|
};
|
31
31
|
}) => void;
|
32
|
+
onSelect?: (menu: string) => void;
|
33
|
+
onRemove?: (menu: string) => void;
|
32
34
|
}
|
33
35
|
|
34
36
|
export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
@@ -42,6 +44,8 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
42
44
|
value,
|
43
45
|
onClick,
|
44
46
|
onChange,
|
47
|
+
onSelect,
|
48
|
+
onRemove,
|
45
49
|
...rest
|
46
50
|
}) => {
|
47
51
|
const [tempValue, setTempValue] = useState<string[]>([]);
|
@@ -201,6 +205,9 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
201
205
|
},
|
202
206
|
} as any);
|
203
207
|
}
|
208
|
+
if (onRemove) {
|
209
|
+
onRemove(item);
|
210
|
+
}
|
204
211
|
}
|
205
212
|
}}
|
206
213
|
>
|
@@ -254,6 +261,9 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
254
261
|
target: { value: [...tempValue, item.value] },
|
255
262
|
} as any);
|
256
263
|
}
|
264
|
+
if (onSelect) {
|
265
|
+
onSelect(item.value);
|
266
|
+
}
|
257
267
|
}}
|
258
268
|
>
|
259
269
|
{item.label}
|