import { RenderFunction, SetupContext, ComponentPublicInstance, Ref } from 'vue' import { VXETableComponent, VxeComponentInstance, SizeType, VNodeStyle, VxeEvent, ValueOf } from './component' /** * 组件 - 下拉容器 */ export interface Pulldown extends VXETableComponent { } export type VxePulldownInstance = ComponentPublicInstance; export interface VxePulldownConstructor extends VxeComponentInstance, VxePulldownMethods { props: VxePulldownProps; context: SetupContext; reactData: PulldownReactData; getRefMaps(): PulldownPrivateRef; renderVN: RenderFunction; } export interface PulldownPrivateRef { refElem: Ref; } export interface VxePulldownPrivateRef extends PulldownPrivateRef { } export interface PulldownReactData { inited: boolean; panelIndex: number; panelStyle: VNodeStyle | null; panelPlacement: string | null; currentValue: null; visiblePanel: boolean; animatVisible: boolean; isActivated: boolean; } export interface VxePulldownOptions extends VxePulldownProps, VxePulldownListeners { } export interface PulldownMethods { dispatchEvent(type: ValueOf, params: any, evnt: Event): void; /** * 判断下拉面板是否可视 */ isPanelVisible(): boolean; /** * 切换下拉面板 */ togglePanel(): Promise; /** * 显示下拉面板 */ showPanel(): Promise; /** * 隐藏下拉面板 */ hidePanel(): Promise; } export interface VxePulldownMethods extends PulldownMethods { } export interface PulldownPrivateMethods { } export interface VxePulldownPrivateMethods extends PulldownPrivateMethods { } export type VxePulldownEmits = [ 'hide-panel' ] export namespace VxePulldownPropTypes { export type Size = SizeType; export type Disabled = boolean; export type Placement = string; export type DestroyOnClose = boolean; export type Transfer = boolean; } export interface VxePulldownProps { size?: VxePulldownPropTypes.Size; /** * 是否禁用 */ disabled?: VxePulldownPropTypes.Disabled; /** * 固定显示下拉面板的方向 */ placement?: VxePulldownPropTypes.Placement; /** * 在下拉容器关闭时销毁内容 */ destroyOnClose?: VxePulldownPropTypes.DestroyOnClose; /** * 是否将弹框容器插入于 body 内(对于嵌入到表格或者弹窗中被遮挡时需要设置为 true) */ transfer?: VxePulldownPropTypes.Transfer; } export namespace VxePulldownDefines { interface PulldownEventParams extends VxeEvent { $pulldown: VxePulldownConstructor; } export interface HidePanelParams { } export interface HidePanelEventParams extends HidePanelParams { } } export interface VxePulldownListeners { onHidePanel?: VxePulldownEvents.HidePanel; hidePanel?: VxePulldownEvents.HidePanel; } export namespace VxePulldownEvents { export type HidePanel = (params: VxePulldownDefines.HidePanelEventParams) => void; }