next-helios-fe 1.8.30 → 1.8.32
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,16 @@ export interface MultipleSelectProps
|
|
29
29
|
value: string[];
|
30
30
|
};
|
31
31
|
}) => void;
|
32
|
+
onSelect?: (e: {
|
33
|
+
target: {
|
34
|
+
value: string;
|
35
|
+
};
|
36
|
+
}) => void;
|
37
|
+
onRemove?: (e: {
|
38
|
+
target: {
|
39
|
+
value: string;
|
40
|
+
};
|
41
|
+
}) => void;
|
32
42
|
}
|
33
43
|
|
34
44
|
export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
@@ -42,6 +52,8 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
42
52
|
value,
|
43
53
|
onClick,
|
44
54
|
onChange,
|
55
|
+
onSelect,
|
56
|
+
onRemove,
|
45
57
|
...rest
|
46
58
|
}) => {
|
47
59
|
const [tempValue, setTempValue] = useState<string[]>([]);
|
@@ -201,6 +213,13 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
201
213
|
},
|
202
214
|
} as any);
|
203
215
|
}
|
216
|
+
if (onRemove) {
|
217
|
+
onRemove({
|
218
|
+
target: {
|
219
|
+
value: item,
|
220
|
+
},
|
221
|
+
});
|
222
|
+
}
|
204
223
|
}
|
205
224
|
}}
|
206
225
|
>
|
@@ -254,6 +273,11 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
254
273
|
target: { value: [...tempValue, item.value] },
|
255
274
|
} as any);
|
256
275
|
}
|
276
|
+
if (onSelect) {
|
277
|
+
onSelect({
|
278
|
+
target: { value: item.value },
|
279
|
+
});
|
280
|
+
}
|
257
281
|
}}
|
258
282
|
>
|
259
283
|
{item.label}
|