diff --git a/src/components/data-entry/QueryItem/Cascader.tsx b/src/components/data-entry/QueryItem/Cascader.tsx index 335f11c9a..900d24350 100644 --- a/src/components/data-entry/QueryItem/Cascader.tsx +++ b/src/components/data-entry/QueryItem/Cascader.tsx @@ -20,13 +20,13 @@ export interface CascaderOption { disabled?: boolean } -export type CascaderIcons = "blank" | "attribute" | "user" | "event" +export type CascaderIcons = 'blank' | 'attribute' | 'user' | 'event' const CascaderIconList = { - "blank": , - "attribute": , - "user": , - "event": , + blank: , + attribute: , + user: , + event: , } export interface ICascaderProps { @@ -34,7 +34,7 @@ export interface ICascaderProps { icon?: CascaderIcons errorMessage?: string placeholder?: string - onChange?: (selectedValue: string[]) => void + onChange?: (values: (number | string)[], selectedOptions: any) => Promise } export const Cascader = (props: ICascaderProps) => { @@ -57,20 +57,15 @@ export const Cascader = (props: ICascaderProps) => { getPopupContainer: triggerNode => triggerNode.parentElement, searchValue: searchValue, value: selectedValue, - onChange: (value: (string | number)[]): void => { - setSelectedValue(value as string[]) + onChange: (values: (number | string)[], selectedOptions: any): void => { + setSelectedValue(values as string[]) if (props.onChange) { - props.onChange(value as string[]) + props.onChange(values, selectedOptions) } }, dropdownRender: menu => (
- + {menu}
),