react-bootstrap 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/AccordionCollapse.js +9 -3
- package/cjs/Alert.d.ts +2 -2
- package/cjs/Button.d.ts +2 -1
- package/cjs/Button.js +1 -1
- package/cjs/Card.d.ts +8 -8
- package/cjs/CardColumns.d.ts +1 -1
- package/cjs/CardDeck.d.ts +1 -1
- package/cjs/CardGroup.d.ts +1 -1
- package/cjs/Carousel.d.ts +1 -1
- package/cjs/Carousel.js +22 -4
- package/cjs/CarouselCaption.d.ts +1 -1
- package/cjs/CarouselItem.d.ts +7 -2
- package/cjs/CarouselItem.js +25 -2
- package/cjs/Dropdown.d.ts +4 -2
- package/cjs/Dropdown.js +4 -0
- package/cjs/DropdownButton.d.ts +3 -2
- package/cjs/DropdownButton.js +16 -3
- package/cjs/DropdownItem.js +3 -2
- package/cjs/DropdownMenu.d.ts +24 -3
- package/cjs/DropdownMenu.js +47 -9
- package/cjs/DropdownToggle.js +2 -3
- package/cjs/Fade.d.ts +6 -3
- package/cjs/Figure.d.ts +2 -2
- package/cjs/FigureCaption.d.ts +1 -1
- package/cjs/Form.d.ts +4 -4
- package/cjs/Form.js +12 -12
- package/cjs/FormCheck.d.ts +1 -3
- package/cjs/FormCheck.js +1 -1
- package/cjs/FormFile.js +2 -0
- package/cjs/FormLabel.js +1 -1
- package/cjs/InputGroup.d.ts +4 -3
- package/cjs/ListGroupItem.js +2 -1
- package/cjs/Media.d.ts +1 -1
- package/cjs/Modal.d.ts +1 -0
- package/cjs/Modal.js +4 -2
- package/cjs/ModalBody.d.ts +1 -1
- package/cjs/ModalDialog.d.ts +2 -1
- package/cjs/ModalDialog.js +3 -2
- package/cjs/ModalFooter.d.ts +1 -1
- package/cjs/ModalTitle.d.ts +1 -1
- package/cjs/NavContext.js +1 -0
- package/cjs/NavDropdown.d.ts +4 -3
- package/cjs/NavDropdown.js +1 -0
- package/cjs/Navbar.d.ts +1 -1
- package/cjs/Overlay.d.ts +6 -5
- package/cjs/Overlay.js +8 -6
- package/cjs/OverlayTrigger.d.ts +5 -2
- package/cjs/OverlayTrigger.js +29 -50
- package/cjs/PageItem.d.ts +3 -2
- package/cjs/Popover.d.ts +2 -5
- package/cjs/Popover.js +1 -6
- package/cjs/ProgressBar.d.ts +1 -2
- package/cjs/SafeAnchor.d.ts +1 -3
- package/cjs/Spinner.d.ts +1 -1
- package/cjs/SplitButton.d.ts +4 -1
- package/cjs/SplitButton.js +15 -2
- package/cjs/TabContainer.d.ts +1 -1
- package/cjs/TabPane.d.ts +0 -1
- package/cjs/Tabs.d.ts +1 -1
- package/cjs/ThemeProvider.d.ts +1 -1
- package/cjs/Toast.d.ts +1 -1
- package/cjs/ToastBody.d.ts +1 -1
- package/cjs/ToggleButton.d.ts +2 -2
- package/cjs/ToggleButtonGroup.d.ts +4 -3
- package/cjs/ToggleButtonGroup.js +2 -1
- package/cjs/Tooltip.d.ts +4 -7
- package/cjs/helpers.d.ts +3 -3
- package/cjs/index.d.ts +1 -0
- package/cjs/usePopperMarginModifiers.d.ts +4 -1
- package/cjs/usePopperMarginModifiers.js +41 -5
- package/dist/react-bootstrap.js +757 -484
- package/dist/react-bootstrap.min.js +2 -2
- package/esm/AccordionCollapse.js +8 -3
- package/esm/Alert.d.ts +2 -2
- package/esm/Button.d.ts +2 -1
- package/esm/Button.js +1 -1
- package/esm/Card.d.ts +8 -8
- package/esm/CardColumns.d.ts +1 -1
- package/esm/CardDeck.d.ts +1 -1
- package/esm/CardGroup.d.ts +1 -1
- package/esm/Carousel.d.ts +1 -1
- package/esm/Carousel.js +23 -5
- package/esm/CarouselCaption.d.ts +1 -1
- package/esm/CarouselItem.d.ts +7 -2
- package/esm/CarouselItem.js +22 -2
- package/esm/Dropdown.d.ts +4 -2
- package/esm/Dropdown.js +4 -0
- package/esm/DropdownButton.d.ts +3 -2
- package/esm/DropdownButton.js +14 -3
- package/esm/DropdownItem.js +3 -2
- package/esm/DropdownMenu.d.ts +24 -3
- package/esm/DropdownMenu.js +40 -6
- package/esm/DropdownToggle.js +2 -3
- package/esm/Fade.d.ts +6 -3
- package/esm/Figure.d.ts +2 -2
- package/esm/FigureCaption.d.ts +1 -1
- package/esm/Form.d.ts +4 -4
- package/esm/Form.js +12 -12
- package/esm/FormCheck.d.ts +1 -3
- package/esm/FormCheck.js +1 -1
- package/esm/FormFile.js +2 -0
- package/esm/FormLabel.js +1 -1
- package/esm/InputGroup.d.ts +4 -3
- package/esm/ListGroupItem.js +2 -1
- package/esm/Media.d.ts +1 -1
- package/esm/Modal.d.ts +1 -0
- package/esm/Modal.js +4 -2
- package/esm/ModalBody.d.ts +1 -1
- package/esm/ModalDialog.d.ts +2 -1
- package/esm/ModalDialog.js +3 -2
- package/esm/ModalFooter.d.ts +1 -1
- package/esm/ModalTitle.d.ts +1 -1
- package/esm/NavContext.js +1 -0
- package/esm/NavDropdown.d.ts +4 -3
- package/esm/NavDropdown.js +1 -0
- package/esm/Navbar.d.ts +1 -1
- package/esm/Overlay.d.ts +6 -5
- package/esm/Overlay.js +8 -6
- package/esm/OverlayTrigger.d.ts +5 -2
- package/esm/OverlayTrigger.js +31 -50
- package/esm/PageItem.d.ts +3 -2
- package/esm/Popover.d.ts +2 -5
- package/esm/Popover.js +1 -6
- package/esm/ProgressBar.d.ts +1 -2
- package/esm/SafeAnchor.d.ts +1 -3
- package/esm/Spinner.d.ts +1 -1
- package/esm/SplitButton.d.ts +4 -1
- package/esm/SplitButton.js +14 -2
- package/esm/TabContainer.d.ts +1 -1
- package/esm/TabContext.js +1 -3
- package/esm/TabPane.d.ts +0 -1
- package/esm/Tabs.d.ts +1 -1
- package/esm/ThemeProvider.d.ts +1 -1
- package/esm/Toast.d.ts +1 -1
- package/esm/ToastBody.d.ts +1 -1
- package/esm/ToggleButton.d.ts +2 -2
- package/esm/ToggleButtonGroup.d.ts +4 -3
- package/esm/ToggleButtonGroup.js +2 -1
- package/esm/Tooltip.d.ts +4 -7
- package/esm/helpers.d.ts +3 -3
- package/esm/index.d.ts +1 -0
- package/esm/usePopperMarginModifiers.d.ts +4 -1
- package/esm/usePopperMarginModifiers.js +40 -5
- package/package.json +26 -26
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
## Docs
|
|
13
13
|
|
|
14
|
-
See the [documentation][documentation] with live editable examples and API
|
|
14
|
+
See the [documentation][documentation] with live editable examples and API documentation.
|
|
15
15
|
|
|
16
16
|
To find the documentation for the latest Bootstrap 3 compatible release, [go here](https://react-bootstrap-v3.netlify.com).
|
|
17
17
|
|
package/cjs/AccordionCollapse.js
CHANGED
|
@@ -17,15 +17,21 @@ var _Collapse = _interopRequireDefault(require("./Collapse"));
|
|
|
17
17
|
|
|
18
18
|
var _AccordionContext = _interopRequireDefault(require("./AccordionContext"));
|
|
19
19
|
|
|
20
|
+
var _SelectableContext = _interopRequireDefault(require("./SelectableContext"));
|
|
21
|
+
|
|
20
22
|
var AccordionCollapse = _react.default.forwardRef(function (_ref, ref) {
|
|
21
23
|
var children = _ref.children,
|
|
22
24
|
eventKey = _ref.eventKey,
|
|
23
25
|
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["children", "eventKey"]);
|
|
24
|
-
var contextEventKey = (0, _react.useContext)(_AccordionContext.default);
|
|
25
|
-
|
|
26
|
+
var contextEventKey = (0, _react.useContext)(_AccordionContext.default); // Empty SelectableContext is to prevent elements in the collapse
|
|
27
|
+
// from collapsing the accordion when clicked.
|
|
28
|
+
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_SelectableContext.default.Provider, {
|
|
30
|
+
value: null
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_Collapse.default, (0, _extends2.default)({
|
|
26
32
|
ref: ref,
|
|
27
33
|
in: contextEventKey === eventKey
|
|
28
|
-
}, props), /*#__PURE__*/_react.default.createElement("div", null, _react.default.Children.only(children)));
|
|
34
|
+
}, props), /*#__PURE__*/_react.default.createElement("div", null, _react.default.Children.only(children))));
|
|
29
35
|
});
|
|
30
36
|
|
|
31
37
|
AccordionCollapse.displayName = 'AccordionCollapse';
|
package/cjs/Alert.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export interface AlertProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
11
11
|
closeLabel?: string;
|
|
12
12
|
transition?: TransitionType;
|
|
13
13
|
}
|
|
14
|
-
declare const AlertHeading: import("./helpers").BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "key" | "onKeyDown" | "onSelect" | "role" | "color" | "id" | "lang" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLDivElement>>,
|
|
15
|
-
declare const AlertLink: import("./helpers").BsPrefixRefForwardingComponent<SafeAnchor,
|
|
14
|
+
declare const AlertHeading: import("./helpers").BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "key" | "onKeyDown" | "onSelect" | "role" | "color" | "id" | "lang" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLDivElement>>, unknown>;
|
|
15
|
+
declare const AlertLink: import("./helpers").BsPrefixRefForwardingComponent<SafeAnchor, unknown>;
|
|
16
16
|
declare type Alert = React.ForwardRefExoticComponent<AlertProps> & {
|
|
17
17
|
Link: typeof AlertLink;
|
|
18
18
|
Heading: typeof AlertHeading;
|
package/cjs/Button.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
3
|
import { ButtonVariant } from './types';
|
|
4
|
+
export declare type ButtonType = 'button' | 'reset' | 'submit' | string;
|
|
4
5
|
export interface ButtonProps extends React.HTMLAttributes<HTMLElement>, BsPrefixPropsWithChildren {
|
|
5
6
|
active?: boolean;
|
|
6
7
|
block?: boolean;
|
|
7
8
|
variant?: ButtonVariant;
|
|
8
9
|
size?: 'sm' | 'lg';
|
|
9
|
-
type?:
|
|
10
|
+
type?: ButtonType;
|
|
10
11
|
href?: string;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
target?: any;
|
package/cjs/Button.js
CHANGED
|
@@ -34,7 +34,7 @@ var Button = _react.default.forwardRef(function (_ref, ref) {
|
|
|
34
34
|
as = _ref.as,
|
|
35
35
|
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["bsPrefix", "variant", "size", "active", "className", "block", "type", "as"]);
|
|
36
36
|
var prefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'btn');
|
|
37
|
-
var classes = (0, _classnames.default)(className, prefix, active && 'active', prefix + "-" + variant, block && prefix + "-block", size && prefix + "-" + size);
|
|
37
|
+
var classes = (0, _classnames.default)(className, prefix, active && 'active', variant && prefix + "-" + variant, block && prefix + "-block", size && prefix + "-" + size);
|
|
38
38
|
|
|
39
39
|
if (props.href) {
|
|
40
40
|
return /*#__PURE__*/_react.default.createElement(_SafeAnchor.default, (0, _extends2.default)({}, props, {
|
package/cjs/Card.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import CardImg from './CardImg';
|
|
3
3
|
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
4
4
|
import { Color, Variant } from './types';
|
|
5
|
-
declare const CardBody: BsPrefixRefForwardingComponent<"div",
|
|
6
|
-
declare const CardTitle: BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "key" | "onKeyDown" | "onSelect" | "role" | "color" | "id" | "lang" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLDivElement>>,
|
|
7
|
-
declare const CardSubtitle: BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "key" | "onKeyDown" | "onSelect" | "role" | "color" | "id" | "lang" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLDivElement>>,
|
|
8
|
-
declare const CardLink: BsPrefixRefForwardingComponent<"a",
|
|
9
|
-
declare const CardText: BsPrefixRefForwardingComponent<"p",
|
|
10
|
-
declare const CardHeader: BsPrefixRefForwardingComponent<"div",
|
|
11
|
-
declare const CardFooter: BsPrefixRefForwardingComponent<"div",
|
|
12
|
-
declare const CardImgOverlay: BsPrefixRefForwardingComponent<"div",
|
|
5
|
+
declare const CardBody: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
6
|
+
declare const CardTitle: BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "key" | "onKeyDown" | "onSelect" | "role" | "color" | "id" | "lang" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLDivElement>>, unknown>;
|
|
7
|
+
declare const CardSubtitle: BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "key" | "onKeyDown" | "onSelect" | "role" | "color" | "id" | "lang" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLDivElement>>, unknown>;
|
|
8
|
+
declare const CardLink: BsPrefixRefForwardingComponent<"a", unknown>;
|
|
9
|
+
declare const CardText: BsPrefixRefForwardingComponent<"p", unknown>;
|
|
10
|
+
declare const CardHeader: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
11
|
+
declare const CardFooter: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
12
|
+
declare const CardImgOverlay: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
13
13
|
export interface CardProps extends BsPrefixPropsWithChildren {
|
|
14
14
|
bg?: Variant;
|
|
15
15
|
text?: Color;
|
package/cjs/CardColumns.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div",
|
|
1
|
+
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
|
|
2
2
|
export default _default;
|
package/cjs/CardDeck.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div",
|
|
1
|
+
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
|
|
2
2
|
export default _default;
|
package/cjs/CardGroup.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div",
|
|
1
|
+
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
|
|
2
2
|
export default _default;
|
package/cjs/Carousel.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface CarouselProps extends BsPrefixPropsWithChildren, Pick<React.DOM
|
|
|
8
8
|
controls?: boolean;
|
|
9
9
|
indicators?: boolean;
|
|
10
10
|
activeIndex?: number;
|
|
11
|
-
onSelect?: (eventKey: number, event:
|
|
11
|
+
onSelect?: (eventKey: number, event: Record<string, unknown> | null) => void;
|
|
12
12
|
defaultActiveIndex?: number;
|
|
13
13
|
onSlide?: (eventKey: number, direction: 'left' | 'right') => void;
|
|
14
14
|
onSlid?: (eventKey: number, direction: 'left' | 'right') => void;
|
package/cjs/Carousel.js
CHANGED
|
@@ -15,6 +15,8 @@ var _useEventCallback = _interopRequireDefault(require("@restart/hooks/useEventC
|
|
|
15
15
|
|
|
16
16
|
var _useUpdateEffect = _interopRequireDefault(require("@restart/hooks/useUpdateEffect"));
|
|
17
17
|
|
|
18
|
+
var _useCommittedRef = _interopRequireDefault(require("@restart/hooks/useCommittedRef"));
|
|
19
|
+
|
|
18
20
|
var _useTimeout = _interopRequireDefault(require("@restart/hooks/useTimeout"));
|
|
19
21
|
|
|
20
22
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -228,7 +230,6 @@ function CarouselFunc(uncontrolledProps, ref) {
|
|
|
228
230
|
if (!isSliding && activeIndex !== renderedActiveIndex) {
|
|
229
231
|
if (nextDirectionRef.current) {
|
|
230
232
|
setDirection(nextDirectionRef.current);
|
|
231
|
-
nextDirectionRef.current = null;
|
|
232
233
|
} else {
|
|
233
234
|
setDirection((activeIndex || 0) > renderedActiveIndex ? 'next' : 'prev');
|
|
234
235
|
}
|
|
@@ -240,8 +241,23 @@ function CarouselFunc(uncontrolledProps, ref) {
|
|
|
240
241
|
setRenderedActiveIndex(activeIndex || 0);
|
|
241
242
|
}
|
|
242
243
|
|
|
243
|
-
|
|
244
|
+
(0, _react.useEffect)(function () {
|
|
245
|
+
if (nextDirectionRef.current) {
|
|
246
|
+
nextDirectionRef.current = null;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
var numChildren = 0;
|
|
250
|
+
var activeChildInterval; // Iterate to grab all of the children's interval values
|
|
251
|
+
// (and count them, too)
|
|
252
|
+
|
|
253
|
+
(0, _ElementChildren.forEach)(children, function (child, index) {
|
|
254
|
+
++numChildren;
|
|
244
255
|
|
|
256
|
+
if (index === activeIndex) {
|
|
257
|
+
activeChildInterval = child.props.interval;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
var activeChildIntervalRef = (0, _useCommittedRef.default)(activeChildInterval);
|
|
245
261
|
var prev = (0, _react.useCallback)(function (event) {
|
|
246
262
|
if (isSliding) {
|
|
247
263
|
return;
|
|
@@ -429,17 +445,19 @@ function CarouselFunc(uncontrolledProps, ref) {
|
|
|
429
445
|
var shouldPlay = interval != null && !pausedOnHover && !pausedOnTouch && !isSliding;
|
|
430
446
|
var intervalHandleRef = (0, _react.useRef)();
|
|
431
447
|
(0, _react.useEffect)(function () {
|
|
448
|
+
var _ref, _activeChildIntervalR;
|
|
449
|
+
|
|
432
450
|
if (!shouldPlay) {
|
|
433
451
|
return undefined;
|
|
434
452
|
}
|
|
435
453
|
|
|
436
|
-
intervalHandleRef.current = window.setInterval(document.visibilityState ? nextWhenVisible : next, interval
|
|
454
|
+
intervalHandleRef.current = window.setInterval(document.visibilityState ? nextWhenVisible : next, (_ref = (_activeChildIntervalR = activeChildIntervalRef.current) != null ? _activeChildIntervalR : interval) != null ? _ref : undefined);
|
|
437
455
|
return function () {
|
|
438
456
|
if (intervalHandleRef.current !== null) {
|
|
439
457
|
clearInterval(intervalHandleRef.current);
|
|
440
458
|
}
|
|
441
459
|
};
|
|
442
|
-
}, [shouldPlay, next, interval, nextWhenVisible]);
|
|
460
|
+
}, [shouldPlay, next, activeChildIntervalRef, interval, nextWhenVisible]);
|
|
443
461
|
var indicatorOnClicks = (0, _react.useMemo)(function () {
|
|
444
462
|
return indicators && Array.from({
|
|
445
463
|
length: numChildren
|
package/cjs/CarouselCaption.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div",
|
|
1
|
+
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
|
|
2
2
|
export default _default;
|
package/cjs/CarouselItem.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
export interface CarouselItemProps extends BsPrefixPropsWithChildren {
|
|
3
|
+
interval?: number;
|
|
4
|
+
}
|
|
5
|
+
declare type CarouselItem = BsPrefixRefForwardingComponent<'div', CarouselItemProps>;
|
|
6
|
+
declare const CarouselItem: CarouselItem;
|
|
7
|
+
export default CarouselItem;
|
package/cjs/CarouselItem.js
CHANGED
|
@@ -5,9 +5,32 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _ThemeProvider = require("./ThemeProvider");
|
|
17
|
+
|
|
18
|
+
var CarouselItem = _react.default.forwardRef(function (_ref, ref) {
|
|
19
|
+
var _ref$as = _ref.as,
|
|
20
|
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
21
|
+
bsPrefix = _ref.bsPrefix,
|
|
22
|
+
children = _ref.children,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["as", "bsPrefix", "children", "className"]);
|
|
25
|
+
var finalClassName = (0, _classnames.default)(className, (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'carousel-item'));
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
27
|
+
ref: ref
|
|
28
|
+
}, props, {
|
|
29
|
+
className: finalClassName
|
|
30
|
+
}), children);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
CarouselItem.displayName = 'CarouselItem';
|
|
34
|
+
var _default = CarouselItem;
|
|
12
35
|
exports.default = _default;
|
|
13
36
|
module.exports = exports["default"];
|
package/cjs/Dropdown.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import DropdownItem from './DropdownItem';
|
|
|
3
3
|
import DropdownMenu from './DropdownMenu';
|
|
4
4
|
import DropdownToggle from './DropdownToggle';
|
|
5
5
|
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent, SelectCallback } from './helpers';
|
|
6
|
-
declare const DropdownHeader: BsPrefixRefForwardingComponent<"div",
|
|
7
|
-
declare const DropdownDivider: BsPrefixRefForwardingComponent<"div",
|
|
6
|
+
declare const DropdownHeader: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
7
|
+
declare const DropdownDivider: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
8
|
+
declare const DropdownItemText: BsPrefixRefForwardingComponent<"span", unknown>;
|
|
8
9
|
export interface DropdownProps extends BsPrefixPropsWithChildren {
|
|
9
10
|
drop?: 'up' | 'left' | 'right' | 'down';
|
|
10
11
|
alignRight?: boolean;
|
|
@@ -21,6 +22,7 @@ declare type Dropdown = BsPrefixRefForwardingComponent<'div', DropdownProps> & {
|
|
|
21
22
|
Toggle: typeof DropdownToggle;
|
|
22
23
|
Menu: typeof DropdownMenu;
|
|
23
24
|
Item: typeof DropdownItem;
|
|
25
|
+
ItemText: typeof DropdownItemText;
|
|
24
26
|
Divider: typeof DropdownDivider;
|
|
25
27
|
Header: typeof DropdownHeader;
|
|
26
28
|
};
|
package/cjs/Dropdown.js
CHANGED
|
@@ -43,6 +43,9 @@ var DropdownDivider = (0, _createWithBsPrefix.default)('dropdown-divider', {
|
|
|
43
43
|
role: 'separator'
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
+
var DropdownItemText = (0, _createWithBsPrefix.default)('dropdown-item-text', {
|
|
47
|
+
Component: 'span'
|
|
48
|
+
});
|
|
46
49
|
var defaultProps = {
|
|
47
50
|
navbar: false
|
|
48
51
|
};
|
|
@@ -107,6 +110,7 @@ Dropdown.defaultProps = defaultProps;
|
|
|
107
110
|
Dropdown.Divider = DropdownDivider;
|
|
108
111
|
Dropdown.Header = DropdownHeader;
|
|
109
112
|
Dropdown.Item = _DropdownItem.default;
|
|
113
|
+
Dropdown.ItemText = DropdownItemText;
|
|
110
114
|
Dropdown.Menu = _DropdownMenu.default;
|
|
111
115
|
Dropdown.Toggle = _DropdownToggle.default;
|
|
112
116
|
var _default = Dropdown;
|
package/cjs/DropdownButton.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownProps } from './Dropdown';
|
|
3
3
|
import { PropsFromToggle } from './DropdownToggle';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { AlignType } from './DropdownMenu';
|
|
5
|
+
export interface DropdownButtonProps extends DropdownProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'title'>, React.PropsWithChildren<PropsFromToggle> {
|
|
6
6
|
title: React.ReactNode;
|
|
7
|
+
menuAlign?: AlignType;
|
|
7
8
|
menuRole?: string;
|
|
8
9
|
renderMenuOnMount?: boolean;
|
|
9
10
|
rootCloseEvent?: 'click' | 'mousedown';
|
package/cjs/DropdownButton.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
6
|
|
|
5
7
|
exports.__esModule = true;
|
|
@@ -17,7 +19,7 @@ var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
|
17
19
|
|
|
18
20
|
var _DropdownToggle = _interopRequireDefault(require("./DropdownToggle"));
|
|
19
21
|
|
|
20
|
-
var _DropdownMenu =
|
|
22
|
+
var _DropdownMenu = _interopRequireWildcard(require("./DropdownMenu"));
|
|
21
23
|
|
|
22
24
|
var propTypes = {
|
|
23
25
|
/**
|
|
@@ -39,6 +41,15 @@ var propTypes = {
|
|
|
39
41
|
/** Disables both Buttons */
|
|
40
42
|
disabled: _propTypes.default.bool,
|
|
41
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Aligns the dropdown menu responsively.
|
|
46
|
+
*
|
|
47
|
+
* _see [DropdownMenu](#dropdown-menu-props) for more details_
|
|
48
|
+
*
|
|
49
|
+
* @type {"left"|"right"|{ sm: "left"|"right" }|{ md: "left"|"right" }|{ lg: "left"|"right" }|{ xl: "left"|"right"} }
|
|
50
|
+
*/
|
|
51
|
+
menuAlign: _DropdownMenu.alignPropType,
|
|
52
|
+
|
|
42
53
|
/** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
|
|
43
54
|
menuRole: _propTypes.default.string,
|
|
44
55
|
|
|
@@ -48,7 +59,7 @@ var propTypes = {
|
|
|
48
59
|
/**
|
|
49
60
|
* Which event when fired outside the component will cause it to be closed.
|
|
50
61
|
*
|
|
51
|
-
* _see [DropdownMenu](#menu-props) for more details_
|
|
62
|
+
* _see [DropdownMenu](#dropdown-menu-props) for more details_
|
|
52
63
|
*/
|
|
53
64
|
rootCloseEvent: _propTypes.default.string,
|
|
54
65
|
|
|
@@ -77,12 +88,13 @@ var DropdownButton = _react.default.forwardRef(function (_ref, ref) {
|
|
|
77
88
|
rootCloseEvent = _ref.rootCloseEvent,
|
|
78
89
|
variant = _ref.variant,
|
|
79
90
|
size = _ref.size,
|
|
91
|
+
menuAlign = _ref.menuAlign,
|
|
80
92
|
menuRole = _ref.menuRole,
|
|
81
93
|
renderMenuOnMount = _ref.renderMenuOnMount,
|
|
82
94
|
disabled = _ref.disabled,
|
|
83
95
|
href = _ref.href,
|
|
84
96
|
id = _ref.id,
|
|
85
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["title", "children", "bsPrefix", "rootCloseEvent", "variant", "size", "menuRole", "renderMenuOnMount", "disabled", "href", "id"]);
|
|
97
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["title", "children", "bsPrefix", "rootCloseEvent", "variant", "size", "menuAlign", "menuRole", "renderMenuOnMount", "disabled", "href", "id"]);
|
|
86
98
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, (0, _extends2.default)({
|
|
87
99
|
ref: ref
|
|
88
100
|
}, props), /*#__PURE__*/_react.default.createElement(_DropdownToggle.default, {
|
|
@@ -93,6 +105,7 @@ var DropdownButton = _react.default.forwardRef(function (_ref, ref) {
|
|
|
93
105
|
disabled: disabled,
|
|
94
106
|
childBsPrefix: bsPrefix
|
|
95
107
|
}, title), /*#__PURE__*/_react.default.createElement(_DropdownMenu.default, {
|
|
108
|
+
align: menuAlign,
|
|
96
109
|
role: menuRole,
|
|
97
110
|
renderOnMount: renderMenuOnMount,
|
|
98
111
|
rootCloseEvent: rootCloseEvent
|
package/cjs/DropdownItem.js
CHANGED
|
@@ -47,9 +47,10 @@ var DropdownItem = _react.default.forwardRef(function (_ref, ref) {
|
|
|
47
47
|
var navContext = (0, _react.useContext)(_NavContext.default);
|
|
48
48
|
|
|
49
49
|
var _ref2 = navContext || {},
|
|
50
|
-
activeKey = _ref2.activeKey;
|
|
50
|
+
activeKey = _ref2.activeKey; // TODO: Restrict eventKey to string in v5?
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
var key = (0, _SelectableContext.makeEventKey)(eventKey, href);
|
|
53
54
|
var active = propActive == null && key != null ? (0, _SelectableContext.makeEventKey)(activeKey) === key : propActive;
|
|
54
55
|
var handleClick = (0, _useEventCallback.default)(function (event) {
|
|
55
56
|
// SafeAnchor handles the disabled case, but we handle it here
|
package/cjs/DropdownMenu.d.ts
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { UseDropdownMenuOptions } from 'react-overlays/DropdownMenu';
|
|
1
3
|
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent, SelectCallback } from './helpers';
|
|
4
|
+
export declare type AlignDirection = 'left' | 'right';
|
|
5
|
+
export declare type ResponsiveAlignProp = {
|
|
6
|
+
sm: AlignDirection;
|
|
7
|
+
} | {
|
|
8
|
+
md: AlignDirection;
|
|
9
|
+
} | {
|
|
10
|
+
lg: AlignDirection;
|
|
11
|
+
} | {
|
|
12
|
+
xl: AlignDirection;
|
|
13
|
+
};
|
|
14
|
+
export declare type AlignType = AlignDirection | ResponsiveAlignProp;
|
|
2
15
|
export interface DropdownMenuProps extends BsPrefixPropsWithChildren {
|
|
3
16
|
show?: boolean;
|
|
4
17
|
renderOnMount?: boolean;
|
|
5
18
|
flip?: boolean;
|
|
19
|
+
align?: AlignType;
|
|
6
20
|
alignRight?: boolean;
|
|
7
21
|
onSelect?: SelectCallback;
|
|
8
22
|
rootCloseEvent?: 'click' | 'mousedown';
|
|
9
|
-
popperConfig?:
|
|
10
|
-
modifiers?: any;
|
|
11
|
-
};
|
|
23
|
+
popperConfig?: UseDropdownMenuOptions['popperConfig'];
|
|
12
24
|
}
|
|
13
25
|
declare type DropdownMenu = BsPrefixRefForwardingComponent<'div', DropdownMenuProps>;
|
|
26
|
+
export declare const alignPropType: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
27
|
+
sm: PropTypes.Requireable<string>;
|
|
28
|
+
}> | PropTypes.InferProps<{
|
|
29
|
+
md: PropTypes.Requireable<string>;
|
|
30
|
+
}> | PropTypes.InferProps<{
|
|
31
|
+
lg: PropTypes.Requireable<string>;
|
|
32
|
+
}> | PropTypes.InferProps<{
|
|
33
|
+
xl: PropTypes.Requireable<string>;
|
|
34
|
+
}>>;
|
|
14
35
|
declare const DropdownMenu: DropdownMenu;
|
|
15
36
|
export default DropdownMenu;
|
package/cjs/DropdownMenu.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
6
|
|
|
7
7
|
exports.__esModule = true;
|
|
8
|
-
exports.default = void 0;
|
|
8
|
+
exports.default = exports.alignPropType = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -13,12 +13,16 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
16
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
19
|
|
|
18
20
|
var _DropdownMenu = require("react-overlays/DropdownMenu");
|
|
19
21
|
|
|
20
22
|
var _useMergedRefs = _interopRequireDefault(require("@restart/hooks/useMergedRefs"));
|
|
21
23
|
|
|
24
|
+
var _warning = _interopRequireDefault(require("warning"));
|
|
25
|
+
|
|
22
26
|
var _NavbarContext = _interopRequireDefault(require("./NavbarContext"));
|
|
23
27
|
|
|
24
28
|
var _ThemeProvider = require("./ThemeProvider");
|
|
@@ -27,7 +31,21 @@ var _useWrappedRefWithWarning = _interopRequireDefault(require("./useWrappedRefW
|
|
|
27
31
|
|
|
28
32
|
var _usePopperMarginModifiers = _interopRequireDefault(require("./usePopperMarginModifiers"));
|
|
29
33
|
|
|
34
|
+
var alignDirection = _propTypes.default.oneOf(['left', 'right']);
|
|
35
|
+
|
|
36
|
+
var alignPropType = _propTypes.default.oneOfType([alignDirection, _propTypes.default.shape({
|
|
37
|
+
sm: alignDirection
|
|
38
|
+
}), _propTypes.default.shape({
|
|
39
|
+
md: alignDirection
|
|
40
|
+
}), _propTypes.default.shape({
|
|
41
|
+
lg: alignDirection
|
|
42
|
+
}), _propTypes.default.shape({
|
|
43
|
+
xl: alignDirection
|
|
44
|
+
})]);
|
|
45
|
+
|
|
46
|
+
exports.alignPropType = alignPropType;
|
|
30
47
|
var defaultProps = {
|
|
48
|
+
align: 'left',
|
|
31
49
|
alignRight: false,
|
|
32
50
|
flip: true
|
|
33
51
|
}; // TODO: remove this hack
|
|
@@ -35,6 +53,7 @@ var defaultProps = {
|
|
|
35
53
|
var DropdownMenu = _react.default.forwardRef(function (_ref, ref) {
|
|
36
54
|
var bsPrefix = _ref.bsPrefix,
|
|
37
55
|
className = _ref.className,
|
|
56
|
+
align = _ref.align,
|
|
38
57
|
alignRight = _ref.alignRight,
|
|
39
58
|
rootCloseEvent = _ref.rootCloseEvent,
|
|
40
59
|
flip = _ref.flip,
|
|
@@ -42,9 +61,8 @@ var DropdownMenu = _react.default.forwardRef(function (_ref, ref) {
|
|
|
42
61
|
renderOnMount = _ref.renderOnMount,
|
|
43
62
|
_ref$as = _ref.as,
|
|
44
63
|
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["bsPrefix", "className", "alignRight", "rootCloseEvent", "flip", "show", "renderOnMount", "as", "popperConfig"]);
|
|
64
|
+
popperConfig = _ref.popperConfig,
|
|
65
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["bsPrefix", "className", "align", "alignRight", "rootCloseEvent", "flip", "show", "renderOnMount", "as", "popperConfig"]);
|
|
48
66
|
var isNavbar = (0, _react.useContext)(_NavbarContext.default);
|
|
49
67
|
var prefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'dropdown-menu');
|
|
50
68
|
|
|
@@ -52,14 +70,35 @@ var DropdownMenu = _react.default.forwardRef(function (_ref, ref) {
|
|
|
52
70
|
popperRef = _usePopperMarginModif[0],
|
|
53
71
|
marginModifiers = _usePopperMarginModif[1];
|
|
54
72
|
|
|
73
|
+
var alignClasses = [];
|
|
74
|
+
|
|
75
|
+
if (align) {
|
|
76
|
+
if (typeof align === 'object') {
|
|
77
|
+
var keys = Object.keys(align);
|
|
78
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(keys.length === 1, 'There should only be 1 breakpoint when passing an object to `align`') : void 0;
|
|
79
|
+
|
|
80
|
+
if (keys.length) {
|
|
81
|
+
var brkPoint = keys[0];
|
|
82
|
+
var direction = align[brkPoint]; // .dropdown-menu-right is required for responsively aligning
|
|
83
|
+
// left in addition to align left classes.
|
|
84
|
+
// Reuse alignRight to toggle the class below.
|
|
85
|
+
|
|
86
|
+
alignRight = direction === 'left';
|
|
87
|
+
alignClasses.push(prefix + "-" + brkPoint + "-" + direction);
|
|
88
|
+
}
|
|
89
|
+
} else if (align === 'right') {
|
|
90
|
+
alignRight = true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
55
94
|
var _ref2 = (0, _DropdownMenu.useDropdownMenu)({
|
|
56
95
|
flip: flip,
|
|
57
96
|
rootCloseEvent: rootCloseEvent,
|
|
58
97
|
show: showProps,
|
|
59
98
|
alignEnd: alignRight,
|
|
60
|
-
usePopper: !isNavbar,
|
|
99
|
+
usePopper: !isNavbar && alignClasses.length === 0,
|
|
61
100
|
popperConfig: (0, _extends2.default)({}, popperConfig, {
|
|
62
|
-
modifiers: marginModifiers.concat(popperConfig.modifiers || [])
|
|
101
|
+
modifiers: marginModifiers.concat((popperConfig == null ? void 0 : popperConfig.modifiers) || [])
|
|
63
102
|
})
|
|
64
103
|
}),
|
|
65
104
|
hasShown = _ref2.hasShown,
|
|
@@ -86,12 +125,11 @@ var DropdownMenu = _react.default.forwardRef(function (_ref, ref) {
|
|
|
86
125
|
}
|
|
87
126
|
|
|
88
127
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, props, menuProps, {
|
|
89
|
-
className: (0,
|
|
128
|
+
className: _classnames.default.apply(void 0, [className, prefix, show && 'show', alignEnd && prefix + "-right"].concat(alignClasses))
|
|
90
129
|
}));
|
|
91
130
|
});
|
|
92
131
|
|
|
93
132
|
DropdownMenu.displayName = 'DropdownMenu';
|
|
94
133
|
DropdownMenu.defaultProps = defaultProps;
|
|
95
134
|
var _default = DropdownMenu;
|
|
96
|
-
exports.default = _default;
|
|
97
|
-
module.exports = exports["default"];
|
|
135
|
+
exports.default = _default;
|