forked from buefy/buefy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponents.d.ts
438 lines (370 loc) · 10.2 KB
/
components.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
import _Vue from "vue";
import {ColorModifiers, GlobalPositions, SizesModifiers} from "./helpers";
// Component base definition
export class BComponent extends _Vue {
// Simple catch-all to allow any prop/type
[key: string]: any
}
export declare type BuefyConfig = {
defaultContainerElement?: string,
defaultIconPack?: string;
defaultIconComponent?: string;
defaultIconPrev?: string;
defaultIconNext?: string;
defaultLocale?: undefined | string | string[],
defaultDialogConfirmText?: string;
defaultDialogCancelText?: string;
defaultSnackbarDuration?: number;
defaultSnackbarPosition?: GlobalPositions;
defaultToastDuration?: number;
defaultToastPosition?: GlobalPositions;
defaultNotificationDuration?: number;
defaultNotificationPosition?: GlobalPositions;
defaultTooltipType?: ColorModifiers;
defaultTooltipAnimated?: boolean;
defaultTooltipDelay?: number;
defaultSidebarDelay?: number,
defaultInputAutocomplete?: string;
defaultDateFormatter?: Function;
defaultDateParser?: Function;
defaultDateCreator?: Function;
defaultDayNames?: string[];
defaultMonthNames?: string[];
defaultFirstDayOfWeek?: number;
defaultUnselectableDaysOfWeek?: number[];
defaultTimeFormatter?: Function;
defaultTimeParser?: Function;
defaultModalCanCancel?: string[];
defaultModalScroll?: string;
defaultDatepickerMobileNative?: boolean;
defaultTimepickerMobileNative?: boolean;
defaultNoticeQueue?: boolean;
defaultInputHasCounter?: boolean;
defaultTaginputHasCounter?: boolean;
defaultUseHtml5Validation?: boolean;
defaultDropdownMobileModal?: boolean;
defaultFieldLabelPosition?: 'inside' | 'on-border';
defaultDatepickerYearsRange?: number[];
defaultDatepickerNearbyMonthDays?: boolean;
defaultDatepickerNearbySelectableMonthDays?: boolean;
defaultDatepickerShowWeekNumber?: boolean;
defaultClockpickerHoursLabel?: string;
defaultClockpickerMinutesLabel?: string;
defaultTrapFocus?: boolean;
defaultButtonRounded?: boolean;
defaultSwitchRounded?: boolean;
defaultCarouselInterval?: number;
defaultTabsExpanded?: boolean;
defaultTabsAnimated?: boolean;
defaultTabsType?: string;
defaultLinkTags?: string[];
defaultImageWebpFallback?: string,
defaultImageLazy?: boolean,
defaultImageResponsive?: boolean,
defaultImageRatio?: string,
defaultImageSrcsetFormatter?: Function,
customIconPacks?: any;
};
export declare type BDialogConfig = {
/**
* Dialog title
*/
title?: string;
/**
* Message text
*/
message: string | any[];
/**
* Adds an icon on the left side depending on the <code>type</code> or <code>icon</code>
*/
hasIcon?: boolean;
/**
* Icon name if <code>hasIcon</code>, optional
*/
icon?: string;
/**
* Icon pack to use if <code>hasIcon</code>, optional
*/
iconPack?: string;
/**
* Dialog\'s size, optional
*/
size?: SizesModifiers;
/**
* Custom animation (transition name)
*/
animation?: string;
/**
* Text of the confirm button
*/
confirmText?: string;
/**
* Text of the cancel button
*/
cancelText?: string;
/**
* Can close dialog by clicking cancel button, pressing escape or clicking outside
*/
canCancel?: boolean | Array<'escape' | 'button' | 'outside'>;
/**
* Turning this prop into false allows to make async requests in onConfirm callback
*/
closeOnConfirm?: boolean;
/**
* DOM element the dialog will be created on.
* Note that this also changes the position of the dialog from fixed
* to absolute. Meaning that the container should be fixed.
*/
container?: string;
/**
* Callback function when the confirm button is clicked
*/
onConfirm?: (value: string, dialog: BComponent) => any;
/**
* Callback function when the dialog is canceled (cancel button is clicked / pressed escape / clicked outside)
*/
onCancel?: () => any;
/**
* Type (color) of the confirm button (and the icon if <code>hasIcon</code>)
*/
type?: ColorModifiers;
/**
* <code>clip</code> to remove the <code><body></code> scrollbar, <code>keep</code> to have a non scrollable scrollbar
* to avoid shifting background, but will set <code><body></code> to position fixed, might break some layouts
*/
scroll?: 'clip' | 'keep';
/**
* Focus on confirm or cancel button (when dialog is not prompt)
*/
focusOn?: 'confirm' | 'cancel';
/**
* Trap focus inside the dialog.
*/
trapFocus?: boolean;
/**
* Role attribute to be passed to modal container for better accessibility.
*/
ariaRole?: 'dialog' | 'alertdialog';
/**
* Aria label attribute to be passed to modal container for better accessibility.
*/
ariaLabel?: string;
/**
* Improve accessiblity when enabled.
*/
ariaModal?: boolean;
}
type BPromptDialogConfig = BDialogConfig & {
/**
* Prompt only: input's attributes
*/
inputAttrs?: any;
};
export declare const DialogProgrammatic: {
alert: (params: BDialogConfig | string) => BComponent;
confirm: (params: BDialogConfig) => BComponent;
prompt: (params: BPromptDialogConfig) => BComponent;
}
export class BLoadingComponent extends BComponent {
close: () => any
}
declare type BLoadingConfig = {
/**
* Element to be injected
*/
container?: any;
/**
* Loader will overlay the full page
*/
isFullPage?: boolean;
/**
* Custom animation (transition name)
*/
animation?: string;
/**
* Can close Loading by pressing escape or clicking outside
*/
canCancel?: boolean;
/**
* Callback function to call after user canceled
*/
onCancel?: () => any;
}
export declare const LoadingProgrammatic: {
open: (params: BLoadingConfig) => BLoadingComponent;
}
export class BModalComponent extends BComponent {
close: () => any
}
declare type BModalConfig = {
/**
* Component to be injected, used to open a component modal programmatically
*/
component?: typeof _Vue;
/**
* Parent component of the modal, required if using component
*/
parent?: _Vue;
/**
* Props to be binded to the injected component
*/
props?: any;
/**
* Events to be binded to the injected component
*/
events?: {
[index: string]: Function
};
/**
* HTML content
*/
content?: string;
/**
* Width of the Modal
*/
width?: string | number;
/**
* If your modal content has a .modal-card as root
*/
hasModalCard?: boolean;
/**
* Custom animation (transition name)
*/
animation?: string;
/**
* Can close Modal by clicking 'X', pressing escape or clicking outside
*/
canCancel?: boolean | Array<any>;
/**
* Callback function to call after user canceled
*/
onCancel?: () => any;
/**
* clip to remove the <body> scrollbar, keep to have a non scrollable scrollbar
*/
scroll?: 'clip' | 'keep';
/**
* Display modal as full screen
*/
fullScreen?: boolean;
/**
* Trap focus inside the dialog.
*/
trapFocus?: boolean;
/**
* Role attribute to be passed to modal container for better accessibility.
*/
ariaRole?: 'dialog' | 'alertdialog';
/**
* Improve accessiblity when enabled.
*/
ariaModal?: boolean;
/**
* CSS classes to be applied on modal
*/
customClass?: string;
}
export declare const ModalProgrammatic: {
open: (params: BModalConfig | string) => BModalComponent;
}
// Notice Component base definition
export class BNoticeComponent extends BComponent {
close: () => any
}
export declare type BNoticeConfig = {
/**
* Message text
*/
message: string | any[];
/**
* Type (color)
*/
type?: ColorModifiers;
/**
* Which position it will appear
*/
position?: GlobalPositions;
/**
* Visibility duration in milliseconds
*/
duration?: number;
/**
* Show indefinitely until it is dismissed
*/
indefinite?: boolean;
/**
* Prevent the notice from hiding while it is being hovered.
*/
pauseOnHover?: boolean;
/**
* DOM element it will be created on.
* Note that this also changes the position of the element from fixed
* to absolute. Meaning that the container should be fixed.
*/
container?: string;
/**
* disable queue
*/
queue?: boolean;
}
export declare type BSnackbarConfig = BNoticeConfig & {
/**
* Snackbar's button text
*/
actionText?: string | null;
/**
* Snackbar's cancel button text
*/
cancelText?: string | null;
/**
* Callback function when the button is clicked
*/
onAction?: () => any;
}
export declare const SnackbarProgrammatic: {
open: (params: BSnackbarConfig | string) => BNoticeComponent;
}
export declare const ToastProgrammatic: {
open: (params: BNoticeConfig | string) => BNoticeComponent;
}
export declare type BNotificationConfig = BNoticeConfig & {
/**
* Whether notification is active or not, use the .sync modifier to make it two-way binding
*/
active?: boolean;
/**
* Hide notification after duration only not programmatic
*/
autoClose?: boolean;
/**
* Custom animation (transition name)
*/
animation?: string;
/**
* Label for the close button, to be read by accessibility screenreaders.
*/
ariaCloseLabel?: string;
/**
* Adds an 'X' button that closes the notification
*/
closable?: boolean;
/**
* Adds an icon on the left side
*/
hasIcon?: boolean;
/**
* Icon name to use with has-icon
*/
icon?: string;
/**
* Icon pack to use
*/
iconPack?: string;
}
export declare const NotificationProgrammatic: {
open: (params: BNotificationConfig | string) => BNoticeComponent;
}
export declare const ConfigProgrammatic: {
getOptions: () => BuefyConfig
setOptions: (params: BuefyConfig) => any
}