Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

components.d.ts 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. import _Vue from "vue";
  2. import { ColorModifiers, GlobalPositions } from "./helpers";
  3. export declare type DialogConfig = {
  4. /**
  5. * Dialog title
  6. */
  7. title?: string;
  8. /**
  9. * Message text
  10. */
  11. message: string;
  12. /**
  13. * Adds an icon on the left side depending on the <code>type</code> or <code>icon</code>
  14. */
  15. hasIcon?: boolean;
  16. /**
  17. * Icon name if <code>hasIcon</code>, optional
  18. */
  19. icon?: string;
  20. /**
  21. * Icon pack to use if <code>hasIcon</code>, optional
  22. */
  23. iconPack?: string;
  24. /**
  25. * Dialog\'s size, optional
  26. */
  27. size?: 'is-small' | 'is-medium' | 'is-large';
  28. /**
  29. * Custom animation (transition name)
  30. */
  31. animation?: string;
  32. /**
  33. * Text of the confirm button
  34. */
  35. confirmText?: string;
  36. /**
  37. * Text of the cancel button
  38. */
  39. cancelText?: string;
  40. /**
  41. * Can close dialog by clicking cancel button, pressing escape or clicking outside
  42. */
  43. canCancel?: boolean | Array<any>;
  44. /**
  45. * Callback function when the confirm button is clicked
  46. */
  47. onConfirm?: (value: string) => any;
  48. /**
  49. * Callback function when the dialog is canceled (cancel button is clicked / pressed escape / clicked outside)
  50. */
  51. onCancel?: () => any;
  52. /**
  53. * Type (color) of the confirm button (and the icon if <code>hasIcon</code>)
  54. */
  55. type?: ColorModifiers;
  56. /**
  57. * <code>clip</code> to remove the <code>&lt;body&gt;</code> scrollbar, <code>keep</code> to have a non scrollable scrollbar
  58. * to avoid shifting background, but will set <code>&lt;body&gt;</code> to position fixed, might break some layouts
  59. */
  60. scroll?: 'clip' | 'keep';
  61. /**
  62. * Focus on confirm or cancel button (when dialog is not prompt)
  63. */
  64. focusOn?: 'confirm' | 'cancel';
  65. }
  66. type PromptDialogConfig = DialogConfig & {
  67. /**
  68. * Prompt only: input's attributes
  69. */
  70. inputAttrs?: any;
  71. };
  72. export declare const Dialog: {
  73. alert: (params: DialogConfig | string) => any;
  74. confirm: (params: DialogConfig) => any;
  75. prompt: (params: PromptDialogConfig) => any;
  76. }
  77. declare type LoadingConfig = {
  78. container?: any;
  79. isFullPage?: boolean;
  80. animation?: string;
  81. canCancel?: boolean;
  82. onCancel?: () => any;
  83. }
  84. export declare const LoadingProgrammatic: {
  85. open: (params: LoadingConfig) => { close: () => any };
  86. }
  87. declare type ModalConfig = {
  88. content?: string;
  89. component?: typeof _Vue;
  90. parent?: _Vue;
  91. props?: any;
  92. events?: {
  93. [index: string]: Function
  94. };
  95. width?: string | number;
  96. hasModalCard?: boolean;
  97. animation?: string;
  98. canCancel?: boolean | Array<any>;
  99. onCancel?: () => any;
  100. scroll?: 'clip' | 'keep';
  101. }
  102. export declare const ModalProgrammatic: {
  103. open: (params: ModalConfig | string) => any;
  104. }
  105. export declare type SnackbarConfig = {
  106. message: string;
  107. type?: ColorModifiers;
  108. position?: GlobalPositions;
  109. duration?: number;
  110. container?: string;
  111. actionText?: string | null;
  112. queue?: boolean;
  113. indefinite?: boolean;
  114. onAction?: () => any;
  115. }
  116. export declare const Snackbar: {
  117. open: (params: SnackbarConfig | string) => void;
  118. }
  119. export declare type ToastConfig = {
  120. /**
  121. * Type (color) of the toast
  122. */
  123. type?: ColorModifiers;
  124. /**
  125. * Message text
  126. */
  127. message: string;
  128. /**
  129. * Which position the toast will appear
  130. */
  131. position?: GlobalPositions;
  132. /**
  133. * Visibility duration in milliseconds
  134. */
  135. duration?: number;
  136. /**
  137. * DOM element the toast will be created on.
  138. * Note that this also changes the position of the toast from fixed
  139. * to absolute. Meaning that the container should be fixed.
  140. */
  141. container?: string;
  142. /**
  143. * disable queue
  144. */
  145. queue?: boolean;
  146. }
  147. export declare const Toast: {
  148. open: (params: ToastConfig | string) => any;
  149. }
  150. export declare type NotificationConfig = {
  151. message: string;
  152. type?: ColorModifiers;
  153. position?: GlobalPositions;
  154. duration?: number;
  155. container?: string;
  156. queue?: boolean;
  157. indefinite?: boolean;
  158. hasIcon?: boolean;
  159. }
  160. export declare const NotificationProgrammatic: {
  161. open: (params: NotificationConfig | string) => void;
  162. }