| 1 |
import modifiers from '../modifiers/index'; |
| 2 |
|
| 3 |
/** |
| 4 |
* Default options provided to Popper.js constructor.<br /> |
| 5 |
* These can be overridden using the `options` argument of Popper.js.<br /> |
| 6 |
* To override an option, simply pass an object with the same |
| 7 |
* structure of the `options` object, as the 3rd argument. For example: |
| 8 |
* ``` |
| 9 |
* new Popper(ref, pop, { |
| 10 |
* modifiers: { |
| 11 |
* preventOverflow: { enabled: false } |
| 12 |
* } |
| 13 |
* }) |
| 14 |
* ``` |
| 15 |
* @type {Object} |
| 16 |
* @static |
| 17 |
* @memberof Popper |
| 18 |
*/ |
| 19 |
export default { |
| 20 |
/** |
| 21 |
* Popper's placement. |
| 22 |
* @prop {Popper.placements} placement='bottom' |
| 23 |
*/ |
| 24 |
placement: 'bottom', |
| 25 |
|
| 26 |
/** |
| 27 |
* Set this to true if you want popper to position it self in 'fixed' mode |
| 28 |
* @prop {Boolean} positionFixed=false |
| 29 |
*/ |
| 30 |
positionFixed: false, |
| 31 |
|
| 32 |
/** |
| 33 |
* Whether events (resize, scroll) are initially enabled. |
| 34 |
* @prop {Boolean} eventsEnabled=true |
| 35 |
*/ |
| 36 |
eventsEnabled: true, |
| 37 |
|
| 38 |
/** |
| 39 |
* Set to true if you want to automatically remove the popper when |
| 40 |
* you call the `destroy` method. |
| 41 |
* @prop {Boolean} removeOnDestroy=false |
| 42 |
*/ |
| 43 |
removeOnDestroy: false, |
| 44 |
|
| 45 |
/** |
| 46 |
* Callback called when the popper is created.<br /> |
| 47 |
* By default, it is set to no-op.<br /> |
| 48 |
* Access Popper.js instance with `data.instance`. |
| 49 |
* @prop {onCreate} |
| 50 |
*/ |
| 51 |
onCreate: () => {}, |
| 52 |
|
| 53 |
/** |
| 54 |
* Callback called when the popper is updated. This callback is not called |
| 55 |
* on the initialization/creation of the popper, but only on subsequent |
| 56 |
* updates.<br /> |
| 57 |
* By default, it is set to no-op.<br /> |
| 58 |
* Access Popper.js instance with `data.instance`. |
| 59 |
* @prop {onUpdate} |
| 60 |
*/ |
| 61 |
onUpdate: () => {}, |
| 62 |
|
| 63 |
/** |
| 64 |
* List of modifiers used to modify the offsets before they are applied to the popper. |
| 65 |
* They provide most of the functionalities of Popper.js. |
| 66 |
* @prop {modifiers} |
| 67 |
*/ |
| 68 |
modifiers, |
| 69 |
}; |
| 70 |
|
| 71 |
/** |
| 72 |
* @callback onCreate |
| 73 |
* @param {dataObject} data |
| 74 |
*/ |
| 75 |
|
| 76 |
/** |
| 77 |
* @callback onUpdate |
| 78 |
* @param {dataObject} data |
| 79 |
*/ |