|
1 | 1 | import Vue, { VueConstructor, DirectiveOptions, PluginFunction } from 'vue';
|
2 | 2 |
|
3 |
| -declare const vToolTip: PluginFunction<any>; |
| 3 | +interface DelayConfig { |
| 4 | + show?: number |
| 5 | + hide?: number |
| 6 | +} |
| 7 | + |
| 8 | +export interface GlobalVTooltipOptions { |
| 9 | + /** |
| 10 | + * Default tooltip placement relative to target element |
| 11 | + * @default 'top' |
| 12 | + */ |
| 13 | + defaultPlacement: string |
| 14 | + |
| 15 | + /** |
| 16 | + * Default CSS classes applied to the tooltip element |
| 17 | + * @default 'vue-tooltip-theme' |
| 18 | + */ |
| 19 | + defaultClass: string |
| 20 | + |
| 21 | + /** |
| 22 | + * Default CSS classes applied to the target element of the tooltip |
| 23 | + * @default 'has-tooltip' |
| 24 | + */ |
| 25 | + defaultTargetClass: string |
| 26 | + |
| 27 | + /** |
| 28 | + * Is the content HTML by default? |
| 29 | + * @default true |
| 30 | + */ |
| 31 | + defaultHtml: boolean |
| 32 | + |
| 33 | + /** |
| 34 | + * Default HTML template of the tooltip element |
| 35 | + * It must include `tooltip-arrow` & `tooltip-inner` CSS classes (can be configured, see below) |
| 36 | + * Change if the classes conflict with other libraries (for example bootstrap) |
| 37 | + * @default '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
| 38 | + */ |
| 39 | + defaultTemplate: string |
| 40 | + |
| 41 | + /** |
| 42 | + * Selector used to get the arrow element in the tooltip template |
| 43 | + * @default '.tooltip-arrow, .tooltip__arrow' |
| 44 | + */ |
| 45 | + defaultArrowSelector: string |
| 46 | + |
| 47 | + /** |
| 48 | + * Selector used to get the inner content element in the tooltip template |
| 49 | + * @default '.tooltip-inner, .tooltip__inner' |
| 50 | + */ |
| 51 | + defaultInnerSelector: string |
| 52 | + |
| 53 | + /** |
| 54 | + * Delay (ms) |
| 55 | + * @default 0 |
| 56 | + */ |
| 57 | + defaultDelay: number | DelayConfig |
| 58 | + |
| 59 | + /** |
| 60 | + * Default events that trigger the tooltip |
| 61 | + * @default 'hover focus' |
| 62 | + */ |
| 63 | + defaultTrigger: string |
| 64 | + |
| 65 | + /** |
| 66 | + * Default position offset (px) |
| 67 | + * @default 0 |
| 68 | + */ |
| 69 | + defaultOffset: number | string |
| 70 | + |
| 71 | + /** |
| 72 | + * Default container where the tooltip will be appended |
| 73 | + * @default 'body' |
| 74 | + */ |
| 75 | + defaultContainer: string | HTMLElement | false |
| 76 | + |
| 77 | + defaultBoundariesElement: string | HTMLElement |
| 78 | + |
| 79 | + defaultPopperOptions: any |
| 80 | + |
| 81 | + /** |
| 82 | + * Class added when content is loading |
| 83 | + * @default 'tooltip-loading' |
| 84 | + */ |
| 85 | + defaultLoadingClass: string |
| 86 | + |
| 87 | + /** |
| 88 | + * Displayed when tooltip content is loading |
| 89 | + * @default '...' |
| 90 | + */ |
| 91 | + defaultLoadingContent: string |
| 92 | + |
| 93 | + /** |
| 94 | + * Hide on mouseover tooltip |
| 95 | + * @default true |
| 96 | + */ |
| 97 | + autoHide: boolean |
| 98 | + |
| 99 | + /** |
| 100 | + * Close tooltip on click on tooltip target? |
| 101 | + * @default true |
| 102 | + */ |
| 103 | + defaultHideOnTargetClick: boolean |
| 104 | + |
| 105 | + /** |
| 106 | + * Auto destroy tooltip DOM nodes (ms) |
| 107 | + * @default 5000 |
| 108 | + */ |
| 109 | + disposeTimeout: number |
| 110 | + |
| 111 | + /** |
| 112 | + * Options for popover |
| 113 | + */ |
| 114 | + popover: Partial<GlobalVTooltipPopoverOptions> |
| 115 | +} |
| 116 | + |
| 117 | +export interface GlobalVTooltipPopoverOptions { |
| 118 | + /** |
| 119 | + * @default 'bottom' |
| 120 | + */ |
| 121 | + defaultPlacement: string, |
| 122 | + |
| 123 | + /** |
| 124 | + * Use the `popoverClass` prop for theming |
| 125 | + * @default 'vue-popover-theme' |
| 126 | + */ |
| 127 | + defaultClass: string, |
| 128 | + |
| 129 | + /** |
| 130 | + * Base class (change if conflicts with other libraries) |
| 131 | + * @default 'tooltip popover' |
| 132 | + */ |
| 133 | + defaultBaseClass: string, |
| 134 | + |
| 135 | + /** |
| 136 | + * Wrapper class (contains arrow and inner) |
| 137 | + * @default 'wrapper' |
| 138 | + */ |
| 139 | + defaultWrapperClass: string, |
| 140 | + |
| 141 | + /** |
| 142 | + * Inner content class |
| 143 | + * @default 'tooltip-inner popover-inner' |
| 144 | + */ |
| 145 | + defaultInnerClass: string, |
| 146 | + |
| 147 | + /** |
| 148 | + * Arrow class |
| 149 | + * @default 'tooltip-arrow popover-arrow' |
| 150 | + */ |
| 151 | + defaultArrowClass: string, |
| 152 | + |
| 153 | + /** |
| 154 | + * Class added when popover is open |
| 155 | + * @default 'open' |
| 156 | + */ |
| 157 | + defaultOpenClass: string, |
| 158 | + |
| 159 | + /** |
| 160 | + * @default 0 |
| 161 | + */ |
| 162 | + defaultDelay: number | DelayConfig, |
| 163 | + |
| 164 | + /** |
| 165 | + * @default 'click' |
| 166 | + */ |
| 167 | + defaultTrigger: string, |
| 168 | + |
| 169 | + /** |
| 170 | + * @default 0 |
| 171 | + */ |
| 172 | + defaultOffset: number | string, |
| 173 | + |
| 174 | + /** |
| 175 | + * @default 'body' |
| 176 | + */ |
| 177 | + defaultContainer: string | HTMLElement | false, |
| 178 | + |
| 179 | + defaultBoundariesElement: string | HTMLElement, |
| 180 | + |
| 181 | + defaultPopperOptions: any, |
| 182 | + |
| 183 | + /** |
| 184 | + * Hides if clicked outside of popover |
| 185 | + * @default true |
| 186 | + */ |
| 187 | + defaultAutoHide: boolean, |
| 188 | + |
| 189 | + /** |
| 190 | + * Update popper on content resize |
| 191 | + * @default true |
| 192 | + */ |
| 193 | + defaultHandleResize: boolean, |
| 194 | +} |
| 195 | + |
| 196 | +export interface GlobalVTooltip { |
| 197 | + enabled?: boolean |
| 198 | + options?: Partial<GlobalVTooltipOptions> |
| 199 | +} |
| 200 | + |
| 201 | +declare const vToolTip: PluginFunction<Partial<GlobalVTooltipOptions>> & GlobalVTooltip; |
4 | 202 | export default vToolTip;
|
5 | 203 |
|
6 | 204 | export const VPopover: VueConstructor<Vue>;
|
|
0 commit comments