<td>0</td>
<td>Offset of the popover relative to its target. For more information refer to Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..offset.offset">offset docs</a>.</td>
</tr>
+ <tr>
+ <td>fallbackPlacement</td>
+ <td>string | array</td>
+ <td>['top', 'right', 'bottom', 'left']</td>
+ <td>Allow to specify which position Popper will use on fallback. For more information refer to
+ Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
+ </tr>
</tbody>
</table>
<td>0</td>
<td>Offset of the tooltip relative to its target. For more information refer to Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..offset.offset">offset docs</a>.</td>
</tr>
+ <tr>
+ <td>fallbackPlacement</td>
+ <td>string | array</td>
+ <td>['top', 'right', 'bottom', 'left']</td>
+ <td>Allow to specify which position Popper will use on fallback. For more information refer to
+ Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
+ </tr>
</tbody>
</table>
const CLASS_PREFIX = 'bs-tooltip'
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
- const Default = {
- animation : true,
- template : '<div class="tooltip" role="tooltip">'
- + '<div class="arrow"></div>'
- + '<div class="tooltip-inner"></div></div>',
- trigger : 'hover focus',
- title : '',
- delay : 0,
- html : false,
- selector : false,
- placement : 'top',
- offset : 0,
- container : false
- }
-
const DefaultType = {
- animation : 'boolean',
- template : 'string',
- title : '(string|element|function)',
- trigger : 'string',
- delay : '(number|object)',
- html : 'boolean',
- selector : '(string|boolean)',
- placement : '(string|function)',
- offset : '(number|string)',
- container : '(string|element|boolean)'
+ animation : 'boolean',
+ template : 'string',
+ title : '(string|element|function)',
+ trigger : 'string',
+ delay : '(number|object)',
+ html : 'boolean',
+ selector : '(string|boolean)',
+ placement : '(string|function)',
+ offset : '(number|string)',
+ container : '(string|element|boolean)',
+ fallbackPlacement : '(string|array)'
}
const AttachmentMap = {
LEFT : 'left'
}
+ const Default = {
+ animation : true,
+ template : '<div class="tooltip" role="tooltip">'
+ + '<div class="arrow"></div>'
+ + '<div class="tooltip-inner"></div></div>',
+ trigger : 'hover focus',
+ title : '',
+ delay : 0,
+ html : false,
+ selector : false,
+ placement : 'top',
+ offset : 0,
+ container : false,
+ fallbackPlacement : [AttachmentMap.TOP, AttachmentMap.RIGHT, AttachmentMap.BOTTOM, AttachmentMap.LEFT]
+ }
+
const HoverState = {
SHOW : 'show',
OUT : 'out'
modifiers : {
offset : {
offset : this.config.offset
+ },
+ flip : {
+ behavior : this.config.fallbackPlacement
}
},
onCreate : (data) => {