ant-design-vue
Version:
An enterprise-class UI design language and Vue-based implementation
411 lines (410 loc) • 17.5 kB
TypeScript
import { VueNode } from '../_util/type';
export interface CascaderOptionType {
value?: string | number;
label?: VueNode;
disabled?: boolean;
isLeaf?: boolean;
loading?: boolean;
children?: CascaderOptionType[];
[key: string]: any;
}
export interface FieldNamesType {
value?: string;
label?: string;
children?: string;
}
export interface FilledFieldNamesType {
value: string;
label: string;
children: string;
}
export interface ShowSearchType {
filter?: (inputValue: string, path: CascaderOptionType[], names: FilledFieldNamesType) => boolean;
render?: (inputValue: string, path: CascaderOptionType[], prefixCls: string | undefined, names: FilledFieldNamesType) => VueNode;
sort?: (a: CascaderOptionType[], b: CascaderOptionType[], inputValue: string, names: FilledFieldNamesType) => number;
matchInputWidth?: boolean;
limit?: number | false;
}
export interface EmptyFilteredOptionsType {
disabled: boolean;
[key: string]: any;
}
export interface FilteredOptionsType extends EmptyFilteredOptionsType {
__IS_FILTERED_OPTION: boolean;
path: CascaderOptionType[];
}
declare const _default: {
new (...args: any[]): {
$: import("vue").ComponentInternalInstance;
$data: {
sValue: any[];
inputValue: string;
inputFocused: boolean;
sPopupVisible: boolean;
flattenOptions: any[];
};
$props: Partial<{
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
}> & Omit<Readonly<{
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
} & {
size?: "default" | "small" | "large";
notFoundContent?: VueNode;
autofocus?: boolean;
popupVisible?: boolean;
suffixIcon?: VueNode;
expandTrigger?: "click" | "hover";
changeOnSelect?: boolean;
fieldNames?: unknown;
showSearchRender?: any;
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "value" | "onFocus" | "onBlur" | "onChange" | "prefixCls" | "disabled" | "options" | "placeholder" | "showSearch" | "onSearch" | "transitionName" | "getPopupContainer" | "popupStyle" | "popupClassName" | "popupPlacement" | "defaultValue" | "allowClear" | "inputPrefixCls" | "onUpdate:value" | "displayRender" | "loadData" | "onPopupVisibleChange">;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
};
$slots: Readonly<{
[name: string]: import("vue").Slot;
}>;
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
$emit: (event: string, ...args: any[]) => void;
$el: any;
$options: import("vue").ComponentOptionsBase<Readonly<{
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
} & {
size?: "default" | "small" | "large";
notFoundContent?: VueNode;
autofocus?: boolean;
popupVisible?: boolean;
suffixIcon?: VueNode;
expandTrigger?: "click" | "hover";
changeOnSelect?: boolean;
fieldNames?: unknown;
showSearchRender?: any;
}>, {
configProvider: import("../config-provider").ConfigConsumerProps;
localeData: any;
cachedOptions: any[];
popupRef: any;
input: any;
}, {
sValue: any[];
inputValue: string;
inputFocused: boolean;
sPopupVisible: boolean;
flattenOptions: any[];
}, {}, {
savePopupRef(ref: any): void;
highlightKeyword(str: string, keyword: string, prefixCls: string): (string | (string | JSX.Element)[])[];
defaultRenderFilteredOption(opt: {
inputValue: string;
path: CascaderOptionType[];
prefixCls: string;
names: FilledFieldNamesType;
}): any[];
saveInput(node: any): void;
handleChange(value: any, selectedOptions: CascaderOptionType[]): void;
handlePopupVisibleChange(popupVisible: boolean): void;
handleInputFocus(e: InputEvent): void;
handleInputBlur(e: InputEvent): void;
handleInputClick(e: MouseEvent & {
nativeEvent?: any;
}): void;
handleKeyDown(e: KeyboardEvent): void;
handleInputChange(e: Event): void;
setValue(value: string[] | number[], selectedOptions?: CascaderOptionType[]): void;
getLabel(): any;
clearSelection(e: MouseEvent): void;
generateFilteredOptions(prefixCls: string, renderEmpty: typeof import("../config-provider/renderEmpty").default): EmptyFilteredOptionsType[] | FilteredOptionsType[];
focus(): void;
blur(): void;
}, {
methods: {
setState(state: {}, callback: any): void;
__emit(...args: any[]): void;
};
}, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
}>;
$forceUpdate: import("vue").ReactiveEffect<any>;
$nextTick: typeof import("vue").nextTick;
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
} & Readonly<{
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
} & {
size?: "default" | "small" | "large";
notFoundContent?: VueNode;
autofocus?: boolean;
popupVisible?: boolean;
suffixIcon?: VueNode;
expandTrigger?: "click" | "hover";
changeOnSelect?: boolean;
fieldNames?: unknown;
showSearchRender?: any;
}> & import("vue").ShallowUnwrapRef<{
configProvider: import("../config-provider").ConfigConsumerProps;
localeData: any;
cachedOptions: any[];
popupRef: any;
input: any;
}> & {
sValue: any[];
inputValue: string;
inputFocused: boolean;
sPopupVisible: boolean;
flattenOptions: any[];
} & {
[x: string]: never;
} & {
setState(state: {}, callback: any): void;
__emit(...args: any[]): void;
} & {
savePopupRef(ref: any): void;
highlightKeyword(str: string, keyword: string, prefixCls: string): (string | (string | JSX.Element)[])[];
defaultRenderFilteredOption(opt: {
inputValue: string;
path: CascaderOptionType[];
prefixCls: string;
names: FilledFieldNamesType;
}): any[];
saveInput(node: any): void;
handleChange(value: any, selectedOptions: CascaderOptionType[]): void;
handlePopupVisibleChange(popupVisible: boolean): void;
handleInputFocus(e: InputEvent): void;
handleInputBlur(e: InputEvent): void;
handleInputClick(e: MouseEvent & {
nativeEvent?: any;
}): void;
handleKeyDown(e: KeyboardEvent): void;
handleInputChange(e: Event): void;
setValue(value: string[] | number[], selectedOptions?: CascaderOptionType[]): void;
getLabel(): any;
clearSelection(e: MouseEvent): void;
generateFilteredOptions(prefixCls: string, renderEmpty: typeof import("../config-provider/renderEmpty").default): EmptyFilteredOptionsType[] | FilteredOptionsType[];
focus(): void;
blur(): void;
} & import("vue").ComponentCustomProperties;
__isFragment?: never;
__isTeleport?: never;
__isSuspense?: never;
} & import("vue").ComponentOptionsBase<Readonly<{
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
} & {
size?: "default" | "small" | "large";
notFoundContent?: VueNode;
autofocus?: boolean;
popupVisible?: boolean;
suffixIcon?: VueNode;
expandTrigger?: "click" | "hover";
changeOnSelect?: boolean;
fieldNames?: unknown;
showSearchRender?: any;
}>, {
configProvider: import("../config-provider").ConfigConsumerProps;
localeData: any;
cachedOptions: any[];
popupRef: any;
input: any;
}, {
sValue: any[];
inputValue: string;
inputFocused: boolean;
sPopupVisible: boolean;
flattenOptions: any[];
}, {}, {
savePopupRef(ref: any): void;
highlightKeyword(str: string, keyword: string, prefixCls: string): (string | (string | JSX.Element)[])[];
defaultRenderFilteredOption(opt: {
inputValue: string;
path: CascaderOptionType[];
prefixCls: string;
names: FilledFieldNamesType;
}): any[];
saveInput(node: any): void;
handleChange(value: any, selectedOptions: CascaderOptionType[]): void;
handlePopupVisibleChange(popupVisible: boolean): void;
handleInputFocus(e: InputEvent): void;
handleInputBlur(e: InputEvent): void;
handleInputClick(e: MouseEvent & {
nativeEvent?: any;
}): void;
handleKeyDown(e: KeyboardEvent): void;
handleInputChange(e: Event): void;
setValue(value: string[] | number[], selectedOptions?: CascaderOptionType[]): void;
getLabel(): any;
clearSelection(e: MouseEvent): void;
generateFilteredOptions(prefixCls: string, renderEmpty: typeof import("../config-provider/renderEmpty").default): EmptyFilteredOptionsType[] | FilteredOptionsType[];
focus(): void;
blur(): void;
}, {
methods: {
setState(state: {}, callback: any): void;
__emit(...args: any[]): void;
};
}, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
value: unknown[];
onFocus: (...args: any[]) => any;
onBlur: (...args: any[]) => any;
onChange: (...args: any[]) => any;
prefixCls: string;
disabled: boolean;
options: CascaderOptionType[];
placeholder: string;
showSearch: boolean | ShowSearchType | (new (...args: any[]) => (boolean | ShowSearchType) & {}) | ((new (...args: any[]) => (boolean | ShowSearchType) & {}) | (() => boolean | ShowSearchType))[];
onSearch: (...args: any[]) => any;
transitionName: string;
getPopupContainer: (...args: any[]) => any;
popupStyle: {
[key: string]: any;
};
popupClassName: string;
popupPlacement: "bottomRight" | "bottomLeft" | "topLeft" | "topRight";
defaultValue: unknown[];
allowClear: boolean;
inputPrefixCls: string;
"onUpdate:value": (...args: any[]) => any;
displayRender: (...args: any[]) => any;
loadData: (...args: any[]) => any;
onPopupVisibleChange: (...args: any[]) => any;
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
export default _default;