fix(bootstrap): add missing properties for v4.3 (#42867)

- `ride` option for Carousel:
https://getbootstrap.com/docs/4.4/components/carousel/#carouseloptions
- `popperConfig` option for Tooltip (Popover):
https://getbootstrap.com/docs/4.4/components/popovers/#options
- `hidePrevented` event for Modal:
https://getbootstrap.com/docs/4.4/components/modal/#events

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz)
2020-03-27 13:08:44 -04:00
committed by GitHub
parent 418fbfd443
commit 62f1cec801
2 changed files with 23 additions and 1 deletions
+8
View File
@@ -51,6 +51,7 @@ $("#carousel").carousel({
keyboard: true,
slide: false,
pause: "hover",
ride: 'carousel',
wrap: true,
touch: false,
});
@@ -169,6 +170,10 @@ $("#modal").modal({
backdrop: "static",
});
$("#modal").on('hidePrevented.bs.modal', e => {
const {data, target: modal} = e;
});
// --------------------------------------------------------------------------------------
// Popover
// --------------------------------------------------------------------------------------
@@ -307,6 +312,9 @@ $("#tooltip").tooltip({
img: ['src', 'alt', 'title', 'width', 'height'],
},
sanitizeFn: (x: string) => x.replace("<", ""),
popperConfig: {
placement: 'bottom',
},
});
$("#tooltip").tooltip({
+15 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for Bootstrap 4.3
// Project: https://github.com/twbs/bootstrap/, https://getbootstrap.com
// Definitions by: denisname <https://github.com/denisname>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -74,6 +75,13 @@ export interface CarouselOption {
*/
pause?: "hover" | false;
/**
* Autoplays the carousel after the user manually cycles the first item.
* If `carousel`, autoplays the carousel on load.
* @default false
*/
ride?: 'carousel' | boolean;
/**
* Whether the carousel should cycle continuously or have hard stops.
*
@@ -371,6 +379,12 @@ export interface TooltipOption {
* @default null
*/
sanitizeFn?: null | ((input: string) => string);
/**
* To change Bootstrap's default Popper.js config,
* see {@link https://popper.js.org/docs/v1/ Popper.js's configuration}
*/
popperConfig?: null | object;
}
// --------------------------------------------------------------------------------------
@@ -449,7 +463,7 @@ export type AlertEvent = "close.bs.alert" | "closed.bs.alert";
export type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel";
export type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse";
export type DropdownEvent = "show.bs.dropdown" | "shown.bs.dropdown" | "hide.bs.dropdown" | "hidden.bs.dropdown";
export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | "hidden.bs.modal";
export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | "hidden.bs.modal" | "hidePrevented.bs.modal";
export type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover";
export type ScrollspyEvent = "activate.bs.scrollspy";
export type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab";