123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- import _Vue from "vue";
- import { ColorModifiers, GlobalPositions } from "./helpers";
-
- export declare type DialogConfig = {
- /**
- * Dialog title
- */
- title?: string;
-
- /**
- * Message text
- */
- message: string;
-
- /**
- * 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?: 'is-small' | 'is-medium' | 'is-large';
-
- /**
- * 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<any>;
-
- /**
- * Callback function when the confirm button is clicked
- */
- onConfirm?: (value: string) => 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';
- }
-
- type PromptDialogConfig = DialogConfig & {
- /**
- * Prompt only: input's attributes
- */
- inputAttrs?: any;
- };
-
- export declare const Dialog: {
- alert: (params: DialogConfig | string) => any;
- confirm: (params: DialogConfig) => any;
- prompt: (params: PromptDialogConfig) => any;
- }
-
- declare type LoadingConfig = {
- container?: any;
- isFullPage?: boolean;
- animation?: string;
- canCancel?: boolean;
- onCancel?: () => any;
- }
- export declare const LoadingProgrammatic: {
- open: (params: LoadingConfig) => { close: () => any };
- }
-
- declare type ModalConfig = {
- content?: string;
- component?: typeof _Vue;
- parent?: _Vue;
- props?: any;
- events?: {
- [index: string]: Function
- };
- width?: string | number;
- hasModalCard?: boolean;
- animation?: string;
- canCancel?: boolean | Array<any>;
- onCancel?: () => any;
- scroll?: 'clip' | 'keep';
- }
-
- export declare const ModalProgrammatic: {
- open: (params: ModalConfig | string) => any;
- }
-
- export declare type SnackbarConfig = {
- message: string;
- type?: ColorModifiers;
- position?: GlobalPositions;
- duration?: number;
- container?: string;
- actionText?: string | null;
- queue?: boolean;
- indefinite?: boolean;
- onAction?: () => any;
- }
- export declare const Snackbar: {
- open: (params: SnackbarConfig | string) => void;
- }
-
- export declare type ToastConfig = {
- /**
- * Type (color) of the toast
- */
- type?: ColorModifiers;
-
- /**
- * Message text
- */
- message: string;
-
- /**
- * Which position the toast will appear
- */
- position?: GlobalPositions;
-
- /**
- * Visibility duration in milliseconds
- */
- duration?: number;
-
- /**
- * DOM element the toast will be created on.
- * Note that this also changes the position of the toast from fixed
- * to absolute. Meaning that the container should be fixed.
- */
- container?: string;
-
- /**
- * disable queue
- */
- queue?: boolean;
- }
-
- export declare const Toast: {
- open: (params: ToastConfig | string) => any;
- }
-
- export declare type NotificationConfig = {
- message: string;
- type?: ColorModifiers;
- position?: GlobalPositions;
- duration?: number;
- container?: string;
- queue?: boolean;
- indefinite?: boolean;
- hasIcon?: boolean;
- }
- export declare const NotificationProgrammatic: {
- open: (params: NotificationConfig | string) => void;
- }
|