1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-22 21:22:52 +02:00

Update to popper.js v2.x

This commit is contained in:
Johann-S
2020-06-19 11:17:01 +03:00
committed by XhmikosR
parent 5f89ea3a0f
commit adfdf7160b
26 changed files with 145 additions and 297 deletions

View File

@@ -872,33 +872,23 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</tr>
</thead>
<tbody>
<tr>
<td><code>offset</code></td>
<td>number | string | function</td>
<td><code>0</code></td>
<td>
<p>Offset of the dropdown relative to its target.</p>
<p>When a function is used to determine the offset, it is called with an object containing the offset data as its first argument. The function must return an object with the same structure. The triggering element DOM node is passed as the second argument.</p>
<p>For more information refer to Popper's <a href="https://popper.js.org/docs/v1/#modifiers..offset.offset">offset docs</a>.</p>
</td>
</tr>
<tr>
<td><code>flip</code></td>
<td>boolean</td>
<td><code>true</code></td>
<td>Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to Popper's <a href="https://popper.js.org/docs/v1/#modifiers..flip.enabled">flip docs</a>.</td>
<td>Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to Popper's <a href="https://popper.js.org/docs/v2/modifiers/flip/">flip docs</a>.</td>
</tr>
<tr>
<td><code>boundary</code></td>
<td>string | element</td>
<td><code>'scrollParent'</code></td>
<td>Overflow constraint boundary of the dropdown menu. Accepts the values of <code>'viewport'</code>, <code>'window'</code>, <code>'scrollParent'</code>, or an HTMLElement reference (JavaScript only). For more information refer to Popper's <a href="https://popper.js.org/docs/v1/#modifiers..preventOverflow.boundariesElement">preventOverflow docs</a>.</td>
<td>Overflow constraint boundary of the dropdown menu. By default it's <code>'clippingParents'</code> and can accept an HTMLElement reference (JavaScript only). For more information refer to Popper's <a href="https://popper.js.org/docs/v2/utils/detect-overflow/#boundary">preventOverflow docs</a>.</td>
</tr>
<tr>
<td><code>reference</code></td>
<td>string | element</td>
<td><code>'toggle'</code></td>
<td>Reference element of the dropdown menu. Accepts the values of <code>'toggle'</code>, <code>'parent'</code>, or an HTMLElement reference. For more information refer to Popper's <a href="https://popper.js.org/docs/v1/#referenceObject">referenceObject docs</a>.</td>
<td>Reference element of the dropdown menu. Accepts the values of <code>'toggle'</code>, <code>'parent'</code>, or an HTMLElement reference. For more information refer to Popper's <a href="https://popper.js.org/docs/v2/constructors/#createpopper">constructor docs</a>.</td>
</tr>
<tr>
<td><code>display</code></td>

View File

@@ -248,28 +248,18 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt
<p><code>'hover'</code> on its own will result in tooltips that cannot be triggered via the keyboard, and should only be used if alternative methods for conveying the same information for keyboard users is present.</p>
</td>
</tr>
<tr>
<td><code>offset</code></td>
<td>number | string | function</td>
<td><code>0</code></td>
<td>
<p>Offset of the tooltip relative to its target.</p>
<p>When a function is used to determine the offset, it is called with an object containing the offset data as its first argument. The function must return an object with the same structure. The triggering element DOM node is passed as the second argument.</p>
<p>For more information refer to Popper's <a href="https://popper.js.org/docs/v1/#modifiers..offset.offset">offset docs</a>.</p>
</td>
</tr>
<tr>
<td><code>fallbackPlacement</code></td>
<td>string | array</td>
<td><code>'flip'</code></td>
<td>null | array</td>
<td><code>null</code></td>
<td>Allow to specify which position Popper will use on fallback. For more information refer to
Popper's <a href="https://popper.js.org/docs/v1/#modifiers..flip.behavior">behavior docs</a></td>
Popper's <a href="https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements">behavior docs</a></td>
</tr>
<tr>
<td><code>boundary</code></td>
<td>string | element</td>
<td><code>'scrollParent'</code></td>
<td>Overflow constraint boundary of the tooltip. Accepts the values of <code>'viewport'</code>, <code>'window'</code>, <code>'scrollParent'</code>, or an HTMLElement reference (JavaScript only). For more information refer to Popper's <a href="https://popper.js.org/docs/v1/#modifiers..preventOverflow.boundariesElement">preventOverflow docs</a>.</td>
<td><code>'clippingParents'</code></td>
<td>Overflow constraint boundary of the tooltip. By default it's <code>'clippingParents'</code> and can accept an HTMLElement reference (JavaScript only). For more information refer to Popper's <a href="https://popper.js.org/docs/v2/utils/detect-overflow/#boundary">preventOverflow docs</a>.</td>
</tr>
<tr>
<td><code>customClass</code></td>

View File

@@ -27,7 +27,7 @@ import Alert from 'bootstrap/js/dist/alert';
```
Bootstrap depends on [Popper](https://popper.js.org/), which is specified in the `peerDependencies` property.
This means that you will have to make sure to add it to your `package.json` using `npm install popper.js`.
This means that you will have to make sure to add it to your `package.json` using `npm install @popperjs/core`.
## Importing Styles

View File

@@ -283,6 +283,8 @@ Changes to our source and compiled JavaScript files.
- Dropped jQuery dependency and rewrote plugins to be in regular JavaScript.
- Removed underscore from public static methods like `_getInstance()` `getInstance()`.
- Moved from Popper v1.x to Popper v2.x
- Removed `offset` option from our Tooltip/Popover and Dropdown plugin, this can still be achieve using `popperConfig` parameter.
### Color system