1 | import { RenderFunction, SetupContext, ComponentPublicInstance, Ref } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, SizeType, VNodeStyle, VxeEvent, ValueOf } from './component'
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export const VxePulldown: VXEComponent<VxePulldownProps, VxePulldownEventProps, VxePulldownSlots>
|
11 |
|
12 |
|
13 |
|
14 | export const Pulldown: typeof VxePulldown
|
15 |
|
16 | export type VxePulldownEmits = [
|
17 | 'update:modelValue',
|
18 | 'hide-panel'
|
19 | ]
|
20 |
|
21 | export namespace VxePulldownPropTypes {
|
22 | export type ModelValue = boolean
|
23 | export type Size = SizeType
|
24 | export type Disabled = boolean
|
25 | export type Placement = string
|
26 | export type ClassName = string | ((params: { $pulldown: VxePulldownConstructor }) => string)
|
27 | export type PopupClassName = string | ((params: { $pulldown: VxePulldownConstructor }) => string)
|
28 | export type DestroyOnClose = boolean
|
29 | export type Transfer = boolean
|
30 | }
|
31 |
|
32 | export interface PulldownPrivateRef {
|
33 | refElem: Ref<HTMLDivElement>
|
34 | }
|
35 | export type VxePulldownPrivateRef = PulldownPrivateRef
|
36 |
|
37 | export interface PulldownReactData {
|
38 | inited: boolean
|
39 | panelIndex: number
|
40 | panelStyle: VNodeStyle | null
|
41 | panelPlacement: string | null
|
42 | visiblePanel: boolean
|
43 | animatVisible: boolean
|
44 | isActivated: boolean
|
45 | }
|
46 |
|
47 | export interface PulldownPrivateMethods {}
|
48 | export type VxePulldownPrivateMethods = PulldownPrivateMethods
|
49 |
|
50 | export type VxePulldownProps = {
|
51 | size?: VxePulldownPropTypes.Size
|
52 | modelValue?: VxePulldownPropTypes.ModelValue
|
53 | /**
|
54 | * 是否禁用
|
55 | */
|
56 | disabled?: VxePulldownPropTypes.Disabled
|
57 | className?: VxePulldownPropTypes.ClassName
|
58 | popupClassName?: VxePulldownPropTypes.PopupClassName
|
59 | /**
|
60 | * 固定显示下拉面板的方向
|
61 | */
|
62 | placement?: VxePulldownPropTypes.Placement
|
63 | /**
|
64 | * 在下拉容器关闭时销毁内容
|
65 | */
|
66 | destroyOnClose?: VxePulldownPropTypes.DestroyOnClose
|
67 | /**
|
68 | * 是否将弹框容器插入于 body 内(对于嵌入到表格或者弹窗中被遮挡时需要设置为 true)
|
69 | */
|
70 | transfer?: VxePulldownPropTypes.Transfer
|
71 | }
|
72 |
|
73 | export interface PulldownMethods {
|
74 | dispatchEvent(type: ValueOf<VxePulldownEmits>, params: any, evnt: Event): void
|
75 | /**
|
76 | * 判断下拉面板是否可视
|
77 | */
|
78 | isPanelVisible(): boolean
|
79 |
|
80 | /**
|
81 | * 切换下拉面板
|
82 | */
|
83 | togglePanel(): Promise<void>
|
84 |
|
85 | /**
|
86 | * 显示下拉面板
|
87 | */
|
88 | showPanel(): Promise<void>
|
89 |
|
90 | /**
|
91 | * 隐藏下拉面板
|
92 | */
|
93 | hidePanel(): Promise<void>
|
94 | }
|
95 | export type VxePulldownMethods = PulldownMethods
|
96 |
|
97 | export interface VxePulldownConstructor extends VxeComponentBase, VxePulldownMethods {
|
98 | props: VxePulldownProps
|
99 | context: SetupContext<VxePulldownEmits>
|
100 | reactData: PulldownReactData
|
101 | getRefMaps(): PulldownPrivateRef
|
102 | renderVN: RenderFunction
|
103 | }
|
104 |
|
105 | export type VxePulldownInstance = ComponentPublicInstance<VxePulldownProps, VxePulldownConstructor>
|
106 |
|
107 | export namespace VxePulldownDefines {
|
108 | export interface PulldownEventParams extends VxeEvent {
|
109 | $pulldown: VxePulldownConstructor
|
110 | }
|
111 |
|
112 | export interface HidePanelParams { }
|
113 | export type HidePanelEventParams = HidePanelParams
|
114 | }
|
115 |
|
116 | export namespace VxePulldownEvents {
|
117 | export type HidePanel = (params: VxePulldownDefines.HidePanelEventParams) => void
|
118 | }
|
119 |
|
120 | export type VxePulldownEventProps = {
|
121 | onHidePanel?: VxePulldownEvents.HidePanel
|
122 | }
|
123 |
|
124 | export interface VxePulldownListeners {
|
125 | hidePanel?: VxePulldownEvents.HidePanel
|
126 | }
|
127 |
|
128 | export interface VxePulldownSlots {
|
129 | |
130 |
|
131 |
|
132 | header: (params: {
|
133 | [key: string]: any
|
134 | }) => any
|
135 | |
136 |
|
137 |
|
138 | default: (params: {
|
139 | [key: string]: any
|
140 | }) => any
|
141 | |
142 |
|
143 |
|
144 | footer: ((params: {
|
145 | [key: string]: any
|
146 | }) => any) | undefined
|
147 | |
148 |
|
149 |
|
150 | dropdown: (params: {
|
151 | [key: string]: any
|
152 | }) => any
|
153 | }
|