1 | import { RenderFunction, SetupContext, Ref, ComponentPublicInstance } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, VxeEvent, SizeType, ValueOf } from './component'
|
3 | import { VxeGlobalRendererHandles } from './v-x-e-table'
|
4 | import { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods } from './table'
|
5 | import { VxeButtonProps } from './button'
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export const VxeToolbar: VXEComponent<VxeToolbarProps, VxeToolbarEventProps, VxeToolbarSlots>
|
14 |
|
15 |
|
16 |
|
17 | export const Toolbar: typeof VxeToolbar
|
18 |
|
19 | export type VxeToolbarInstance = ComponentPublicInstance<VxeToolbarProps, VxeToolbarConstructor>
|
20 |
|
21 | export interface VxeToolbarConstructor extends VxeComponentBase, VxeToolbarMethods {
|
22 | props: VxeToolbarProps
|
23 | context: SetupContext<VxeToolbarEmits>
|
24 | reactData: ToolbarReactData
|
25 | getRefMaps(): ToolbarPrivateRef
|
26 | renderVN: RenderFunction
|
27 | }
|
28 |
|
29 | export interface ToolbarPrivateRef {
|
30 | refElem: Ref<HTMLDivElement>
|
31 | }
|
32 | export interface VxeToolbarPrivateRef extends ToolbarPrivateRef { }
|
33 |
|
34 | export namespace VxeToolbarPropTypes {
|
35 | export type Size = SizeType
|
36 | export type Id = string
|
37 | export type Loading = boolean
|
38 |
|
39 | interface ResizableConfig {
|
40 | storage?: boolean
|
41 | }
|
42 | export type Resizable = boolean | ResizableConfig
|
43 | export interface ResizableOpts extends ResizableConfig { }
|
44 |
|
45 | interface RefreshConfig {
|
46 | queryMethod?(params: { [key: string]: any }): any
|
47 | code?: 'query' | 'reload' | '' | null
|
48 | icon?: string
|
49 | iconLoading?: string
|
50 | |
51 |
|
52 |
|
53 | query?(params: { [key: string]: any }): Promise<any>
|
54 | }
|
55 | export type Refresh = boolean | RefreshConfig
|
56 | export interface RefreshOpts extends RefreshConfig { }
|
57 |
|
58 | interface ImportConfig {
|
59 | icon?: string
|
60 | }
|
61 | export type Import = boolean | ImportConfig
|
62 | export interface ImportOpts extends ImportConfig { }
|
63 |
|
64 | interface ExportConfig {
|
65 | icon?: string
|
66 | }
|
67 | export type Export = boolean | ExportConfig
|
68 | export interface ExportOpts extends ExportConfig { }
|
69 |
|
70 | export interface PrintConfig {
|
71 | icon?: string
|
72 | }
|
73 | export type Print = boolean | PrintConfig
|
74 | export interface PrintOpts extends PrintConfig { }
|
75 |
|
76 | interface ZoomConfig {
|
77 | iconIn?: string
|
78 | iconOut?: string
|
79 | }
|
80 | export type Zoom = boolean | ZoomConfig
|
81 | export interface ZoomOpts extends ZoomConfig { }
|
82 |
|
83 | interface CustomConfig {
|
84 | icon?: string
|
85 |
|
86 | |
87 |
|
88 |
|
89 |
|
90 | trigger?: string,
|
91 | |
92 |
|
93 |
|
94 |
|
95 | immediate?: boolean
|
96 | |
97 |
|
98 |
|
99 |
|
100 | storage?: boolean
|
101 | |
102 |
|
103 |
|
104 |
|
105 | checkMethod?(params: { column: VxeTableDefines.ColumnInfo }): boolean
|
106 | |
107 |
|
108 |
|
109 |
|
110 | showFooter?: boolean
|
111 | |
112 |
|
113 |
|
114 |
|
115 | allowFixed?: boolean
|
116 | |
117 |
|
118 |
|
119 |
|
120 | resetButtonText?: string
|
121 | |
122 |
|
123 |
|
124 |
|
125 | confirmButtonText?: string
|
126 | |
127 |
|
128 |
|
129 |
|
130 | isFooter?: boolean
|
131 | }
|
132 | export type Custom = boolean | CustomConfig
|
133 | export interface CustomOpts extends CustomConfig { }
|
134 |
|
135 | interface ButtonAndToolConfig extends VxeButtonProps {
|
136 | code?: string
|
137 | visible?: boolean
|
138 | params?: any
|
139 | }
|
140 |
|
141 | export interface ButtonConfig extends ButtonAndToolConfig {
|
142 | dropdowns?: ButtonConfig[]
|
143 | buttonRender?: VxeGlobalRendererHandles.RenderButtonOptions
|
144 | }
|
145 | export type Buttons = ButtonConfig[]
|
146 |
|
147 | export interface ToolConfig extends ButtonAndToolConfig {
|
148 | dropdowns?: ToolConfig[]
|
149 | toolRender?: VxeGlobalRendererHandles.RenderToolOptions
|
150 | }
|
151 | export type Tools = ToolConfig[]
|
152 |
|
153 | export type Perfect = boolean
|
154 |
|
155 | export type ClassName = string | ((params: {
|
156 | $toolbar: VxeToolbarConstructor
|
157 | }) => string)
|
158 | }
|
159 |
|
160 | export type VxeToolbarProps = {
|
161 | size?: VxeToolbarPropTypes.Size
|
162 | |
163 |
|
164 |
|
165 | id?: VxeToolbarPropTypes.Id
|
166 | |
167 |
|
168 |
|
169 | loading?: VxeToolbarPropTypes.Loading
|
170 | |
171 |
|
172 |
|
173 | resizable?: VxeToolbarPropTypes.Resizable
|
174 | |
175 |
|
176 |
|
177 | refresh?: VxeToolbarPropTypes.Refresh
|
178 | |
179 |
|
180 |
|
181 | import?: VxeToolbarPropTypes.Import
|
182 | |
183 |
|
184 |
|
185 | export?: VxeToolbarPropTypes.Export
|
186 | print?: VxeToolbarPropTypes.Print
|
187 | zoom?: VxeToolbarPropTypes.Zoom
|
188 | |
189 |
|
190 |
|
191 | custom?: VxeToolbarPropTypes.Custom
|
192 | |
193 |
|
194 |
|
195 | buttons?: VxeToolbarPropTypes.Buttons
|
196 | tools?: VxeToolbarPropTypes.Tools
|
197 | |
198 |
|
199 |
|
200 | perfect?: VxeToolbarPropTypes.Perfect
|
201 | className?: VxeToolbarPropTypes.ClassName
|
202 | }
|
203 |
|
204 | export interface ToolbarReactData {
|
205 | isRefresh: boolean
|
206 | columns: VxeTableDefines.ColumnInfo[]
|
207 | }
|
208 |
|
209 | export interface ToolbarMethods {
|
210 | dispatchEvent(type: ValueOf<VxeToolbarEmits>, params: any, evnt: Event): void
|
211 | syncUpdate(params: {
|
212 | collectColumn: VxeTableDefines.ColumnInfo<any>[]
|
213 | $table: VxeTableConstructor<any> & VxeTablePrivateMethods<any>
|
214 | }): void
|
215 | }
|
216 | export interface VxeToolbarMethods extends ToolbarMethods { }
|
217 |
|
218 | export interface ToolbarPrivateMethods { }
|
219 | export interface VxeToolbarPrivateMethods extends ToolbarPrivateMethods { }
|
220 |
|
221 | export type VxeToolbarEmits = [
|
222 | 'button-click',
|
223 | 'tool-click'
|
224 | ]
|
225 |
|
226 | export namespace VxeToolbarDefines {
|
227 | export interface ToolbarEventParams extends VxeEvent {
|
228 | $toolbar: VxeToolbarConstructor
|
229 | }
|
230 | }
|
231 |
|
232 | export type VxeToolbarEventProps = {
|
233 | [key: string]: any
|
234 | }
|
235 |
|
236 | export interface VxeToolbarListeners { }
|
237 |
|
238 | export namespace VxeToolbarEvents { }
|
239 |
|
240 | export interface VxeToolbarSlots {
|
241 | |
242 |
|
243 |
|
244 | buttons: (params: {
|
245 | [key: string]: any
|
246 | }) => any
|
247 | |
248 |
|
249 |
|
250 | tools: ((params: {
|
251 | [key: string]: any
|
252 | }) => any) | undefined
|
253 | }
|