react-bootstrap 1.0.0-beta.1 → 1.0.0-beta.10
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/{lib/AbstractNav.js → AbstractNav.js} +6 -20
- package/AbstractNavItem.js +71 -0
- package/Accordion.d.ts +19 -0
- package/Accordion.js +57 -0
- package/AccordionCollapse.d.ts +18 -0
- package/AccordionCollapse.js +33 -0
- package/{lib/CardContext.js → AccordionContext.js} +0 -0
- package/AccordionToggle.d.ts +14 -0
- package/AccordionToggle.js +32 -0
- package/Alert.d.ts +38 -0
- package/Alert.js +89 -0
- package/Badge.d.ts +19 -0
- package/Badge.js +40 -0
- package/Breadcrumb.d.ts +18 -0
- package/Breadcrumb.js +49 -0
- package/BreadcrumbItem.d.ts +16 -0
- package/BreadcrumbItem.js +59 -0
- package/Button.d.ts +36 -0
- package/Button.js +60 -0
- package/ButtonGroup.d.ts +16 -0
- package/ButtonGroup.js +46 -0
- package/ButtonToolbar.d.ts +14 -0
- package/ButtonToolbar.js +37 -0
- package/Card.d.ts +86 -0
- package/Card.js +82 -0
- package/CardColumns.d.ts +9 -0
- package/{lib/CardColumns.js → CardColumns.js} +0 -0
- package/{lib/NavbarContext.js → CardContext.js} +0 -0
- package/CardDeck.d.ts +9 -0
- package/{lib/CardDeck.js → CardDeck.js} +0 -0
- package/CardGroup.d.ts +9 -0
- package/{lib/CardGroup.js → CardGroup.js} +0 -0
- package/CardImg.d.ts +13 -0
- package/CardImg.js +41 -0
- package/Carousel.d.ts +34 -0
- package/{lib/Carousel.js → Carousel.js} +61 -110
- package/CarouselCaption.d.ts +9 -0
- package/CarouselCaption.js +15 -0
- package/CarouselItem.d.ts +7 -0
- package/CarouselItem.js +13 -0
- package/CloseButton.d.ts +12 -0
- package/CloseButton.js +48 -0
- package/Col.d.ts +37 -0
- package/Col.js +63 -0
- package/Collapse.d.ts +21 -0
- package/{lib/Collapse.js → Collapse.js} +3 -90
- package/Container.d.ts +13 -0
- package/Container.js +42 -0
- package/Dropdown.d.ts +39 -0
- package/Dropdown.js +109 -0
- package/DropdownButton.d.ts +27 -0
- package/{lib/DropdownButton.js → DropdownButton.js} +30 -42
- package/DropdownItem.d.ts +20 -0
- package/DropdownItem.js +75 -0
- package/DropdownMenu.d.ts +18 -0
- package/DropdownMenu.js +97 -0
- package/DropdownToggle.d.ts +18 -0
- package/{lib/DropdownToggle.js → DropdownToggle.js} +10 -31
- package/Fade.d.ts +15 -0
- package/{lib/Fade.js → Fade.js} +0 -62
- package/Feedback.d.ts +14 -0
- package/Feedback.js +49 -0
- package/Figure.d.ts +15 -0
- package/Figure.js +21 -0
- package/FigureCaption.d.ts +9 -0
- package/FigureCaption.js +15 -0
- package/FigureImage.d.ts +9 -0
- package/FigureImage.js +65 -0
- package/Form.d.ts +32 -0
- package/Form.js +59 -0
- package/FormCheck.d.ts +29 -0
- package/FormCheck.js +93 -0
- package/FormCheckInput.d.ts +19 -0
- package/FormCheckInput.js +51 -0
- package/FormCheckLabel.d.ts +15 -0
- package/FormCheckLabel.js +48 -0
- package/FormContext.js +16 -0
- package/FormControl.d.ts +27 -0
- package/FormControl.js +74 -0
- package/FormGroup.d.ts +14 -0
- package/FormGroup.js +47 -0
- package/FormLabel.d.ts +24 -0
- package/FormLabel.js +64 -0
- package/FormText.d.ts +14 -0
- package/FormText.js +36 -0
- package/Image.d.ts +14 -0
- package/{lib/Image.js → Image.js} +0 -28
- package/InputGroup.d.ts +34 -0
- package/{lib/InputGroup.js → InputGroup.js} +2 -20
- package/Jumbotron.d.ts +13 -0
- package/{lib/Jumbotron.js → Jumbotron.js} +2 -16
- package/ListGroup.d.ts +20 -0
- package/{lib/ListGroup.js → ListGroup.js} +6 -26
- package/ListGroupItem.d.ts +24 -0
- package/{lib/ListGroupItem.js → ListGroupItem.js} +0 -40
- package/Media.d.ts +15 -0
- package/Media.js +38 -0
- package/Modal.d.ts +44 -0
- package/{lib/Modal.js → Modal.js} +72 -152
- package/ModalBody.d.ts +9 -0
- package/ModalBody.js +13 -0
- package/{lib/ModalContext.js → ModalContext.js} +0 -0
- package/ModalDialog.d.ts +13 -0
- package/ModalDialog.js +39 -0
- package/ModalFooter.d.ts +9 -0
- package/ModalFooter.js +13 -0
- package/ModalHeader.d.ts +15 -0
- package/ModalHeader.js +59 -0
- package/ModalTitle.d.ts +9 -0
- package/ModalTitle.js +19 -0
- package/Nav.d.ts +30 -0
- package/Nav.js +83 -0
- package/{lib/NavContext.js → NavContext.js} +0 -0
- package/NavDropdown.d.ts +25 -0
- package/{lib/NavDropdown.js → NavDropdown.js} +0 -37
- package/NavItem.d.ts +13 -0
- package/NavItem.js +36 -0
- package/NavLink.d.ts +20 -0
- package/{lib/NavLink.js → NavLink.js} +7 -58
- package/Navbar.d.ts +35 -0
- package/{lib/Navbar.js → Navbar.js} +11 -120
- package/NavbarBrand.d.ts +13 -0
- package/NavbarBrand.js +34 -0
- package/NavbarCollapse.d.ts +16 -0
- package/NavbarCollapse.js +38 -0
- package/NavbarContext.js +13 -0
- package/NavbarToggle.d.ts +13 -0
- package/NavbarToggle.js +66 -0
- package/Overlay.d.ts +37 -0
- package/{lib/Overlay.js → Overlay.js} +2 -64
- package/OverlayTrigger.d.ts +21 -0
- package/{lib/OverlayTrigger.js → OverlayTrigger.js} +0 -50
- package/PageItem.d.ts +24 -0
- package/{lib/PageItem.js → PageItem.js} +0 -13
- package/Pagination.d.ts +20 -0
- package/{lib/Pagination.js → Pagination.js} +0 -13
- package/Popover.d.ts +16 -0
- package/Popover.js +57 -0
- package/PopoverContent.js +35 -0
- package/PopoverTitle.js +35 -0
- package/ProgressBar.d.ts +18 -0
- package/{lib/ProgressBar.js → ProgressBar.js} +2 -65
- package/README.md +22 -11
- package/ResponsiveEmbed.d.ts +15 -0
- package/{lib/CarouselItem.js → ResponsiveEmbed.js} +19 -18
- package/Row.d.ts +14 -0
- package/Row.js +40 -0
- package/SafeAnchor.d.ts +18 -0
- package/{lib/SafeAnchor.js → SafeAnchor.js} +6 -28
- package/{lib/SelectableContext.js → SelectableContext.js} +0 -0
- package/Spinner.d.ts +25 -0
- package/{lib/NavItem.js → Spinner.js} +15 -28
- package/SplitButton.d.ts +31 -0
- package/{lib/SplitButton.js → SplitButton.js} +0 -49
- package/Tab.d.ts +25 -0
- package/{lib/Tab.js → Tab.js} +0 -5
- package/TabContainer.d.ts +18 -0
- package/TabContainer.js +96 -0
- package/TabContent.d.ts +9 -0
- package/{lib/TabContent.js → TabContent.js} +3 -16
- package/{lib/TabContext.js → TabContext.js} +0 -0
- package/TabPane.d.ts +18 -0
- package/TabPane.js +99 -0
- package/Table.d.ts +17 -0
- package/{lib/Table.js → Table.js} +3 -49
- package/Tabs.d.ts +22 -0
- package/{lib/Tabs.js → Tabs.js} +5 -69
- package/ThemeProvider.d.ts +9 -0
- package/ThemeProvider.js +82 -0
- package/Toast.d.ts +25 -0
- package/Toast.js +92 -0
- package/ToastBody.d.ts +9 -0
- package/ToastBody.js +13 -0
- package/ToastContext.js +16 -0
- package/ToastHeader.d.ts +14 -0
- package/ToastHeader.js +59 -0
- package/ToggleButton.d.ts +22 -0
- package/{lib/ToggleButton.js → ToggleButton.js} +0 -48
- package/ToggleButtonGroup.d.ts +31 -0
- package/{lib/ToggleButtonGroup.js → ToggleButtonGroup.js} +5 -38
- package/Tooltip.d.ts +15 -0
- package/{lib/Tooltip.js → Tooltip.js} +0 -41
- package/dist/react-bootstrap.js +10177 -12975
- package/dist/react-bootstrap.min.js +7 -7
- package/es/AbstractNav.js +6 -17
- package/es/AbstractNavItem.js +39 -68
- package/es/Accordion.d.ts +19 -0
- package/es/Accordion.js +37 -0
- package/es/AccordionCollapse.d.ts +18 -0
- package/es/AccordionCollapse.js +17 -0
- package/es/AccordionContext.js +2 -0
- package/es/AccordionToggle.d.ts +14 -0
- package/es/AccordionToggle.js +19 -0
- package/es/Alert.d.ts +38 -0
- package/es/Alert.js +45 -112
- package/es/Badge.d.ts +19 -0
- package/es/Badge.js +19 -50
- package/es/Breadcrumb.d.ts +18 -0
- package/es/Breadcrumb.js +26 -63
- package/es/BreadcrumbItem.d.ts +16 -0
- package/es/BreadcrumbItem.js +39 -81
- package/es/Button.d.ts +36 -0
- package/es/Button.js +34 -104
- package/es/ButtonGroup.d.ts +16 -0
- package/es/ButtonGroup.js +24 -71
- package/es/ButtonToolbar.d.ts +14 -0
- package/es/ButtonToolbar.js +16 -44
- package/es/Card.d.ts +86 -0
- package/es/Card.js +43 -106
- package/es/CardColumns.d.ts +9 -0
- package/es/CardDeck.d.ts +9 -0
- package/es/CardGroup.d.ts +9 -0
- package/es/CardImg.d.ts +13 -0
- package/es/CardImg.js +20 -51
- package/es/Carousel.d.ts +34 -0
- package/es/Carousel.js +62 -109
- package/es/CarouselCaption.d.ts +9 -0
- package/es/CarouselCaption.js +4 -48
- package/es/CarouselItem.d.ts +7 -0
- package/es/CarouselItem.js +2 -42
- package/es/CloseButton.d.ts +12 -0
- package/es/CloseButton.js +20 -30
- package/es/Col.d.ts +37 -0
- package/es/Col.js +39 -106
- package/es/Collapse.d.ts +21 -0
- package/es/Collapse.js +3 -89
- package/es/Container.d.ts +13 -0
- package/es/Container.js +21 -51
- package/es/Dropdown.d.ts +39 -0
- package/es/Dropdown.js +59 -148
- package/es/DropdownButton.d.ts +27 -0
- package/es/DropdownButton.js +29 -42
- package/es/DropdownItem.d.ts +20 -0
- package/es/DropdownItem.js +45 -113
- package/es/DropdownMenu.d.ts +18 -0
- package/es/DropdownMenu.js +59 -100
- package/es/DropdownToggle.d.ts +18 -0
- package/es/DropdownToggle.js +7 -27
- package/es/Fade.d.ts +15 -0
- package/es/Fade.js +0 -61
- package/es/Feedback.d.ts +14 -0
- package/es/Feedback.js +20 -34
- package/es/Figure.d.ts +15 -0
- package/es/Figure.js +7 -49
- package/es/FigureCaption.d.ts +9 -0
- package/es/FigureCaption.js +5 -46
- package/es/FigureImage.d.ts +9 -0
- package/es/FigureImage.js +37 -24
- package/es/Form.d.ts +32 -0
- package/es/Form.js +17 -51
- package/es/FormCheck.d.ts +29 -0
- package/es/FormCheck.js +55 -117
- package/es/FormCheckInput.d.ts +19 -0
- package/es/FormCheckInput.js +17 -47
- package/es/FormCheckLabel.d.ts +15 -0
- package/es/FormCheckLabel.js +17 -32
- package/es/FormContext.js +0 -2
- package/es/FormControl.d.ts +27 -0
- package/es/FormControl.js +45 -146
- package/es/FormGroup.d.ts +14 -0
- package/es/FormGroup.js +17 -43
- package/es/FormLabel.d.ts +24 -0
- package/es/FormLabel.js +25 -63
- package/es/FormText.d.ts +14 -0
- package/es/FormText.js +13 -39
- package/es/Image.d.ts +14 -0
- package/es/Image.js +0 -27
- package/es/InputGroup.d.ts +34 -0
- package/es/InputGroup.js +2 -18
- package/es/Jumbotron.d.ts +13 -0
- package/es/Jumbotron.js +2 -14
- package/es/ListGroup.d.ts +20 -0
- package/es/ListGroup.js +5 -23
- package/es/ListGroupItem.d.ts +24 -0
- package/es/ListGroupItem.js +0 -38
- package/es/Media.d.ts +15 -0
- package/es/Media.js +17 -45
- package/es/Modal.d.ts +44 -0
- package/es/Modal.js +73 -150
- package/es/ModalBody.d.ts +9 -0
- package/es/ModalBody.js +2 -43
- package/es/ModalDialog.d.ts +13 -0
- package/es/ModalDialog.js +21 -51
- package/es/ModalFooter.d.ts +9 -0
- package/es/ModalFooter.js +2 -43
- package/es/ModalHeader.d.ts +15 -0
- package/es/ModalHeader.js +30 -66
- package/es/ModalTitle.d.ts +9 -0
- package/es/ModalTitle.js +4 -43
- package/es/Nav.d.ts +30 -0
- package/es/Nav.js +45 -140
- package/es/NavDropdown.d.ts +25 -0
- package/es/NavDropdown.js +0 -35
- package/es/NavItem.d.ts +13 -0
- package/es/NavItem.js +18 -46
- package/es/NavLink.d.ts +20 -0
- package/es/NavLink.js +8 -57
- package/es/Navbar.d.ts +35 -0
- package/es/Navbar.js +10 -117
- package/es/NavbarBrand.d.ts +13 -0
- package/es/NavbarBrand.js +16 -47
- package/es/NavbarCollapse.d.ts +16 -0
- package/es/NavbarCollapse.js +17 -37
- package/es/NavbarToggle.d.ts +13 -0
- package/es/NavbarToggle.js +41 -81
- package/es/Overlay.d.ts +37 -0
- package/es/Overlay.js +1 -63
- package/es/OverlayTrigger.d.ts +21 -0
- package/es/OverlayTrigger.js +0 -48
- package/es/PageItem.d.ts +24 -0
- package/es/PageItem.js +0 -12
- package/es/Pagination.d.ts +20 -0
- package/es/Pagination.js +0 -12
- package/es/Popover.d.ts +16 -0
- package/es/Popover.js +9 -54
- package/es/PopoverContent.js +21 -0
- package/es/PopoverTitle.js +21 -0
- package/es/ProgressBar.d.ts +18 -0
- package/es/ProgressBar.js +2 -64
- package/es/ResponsiveEmbed.d.ts +15 -0
- package/es/ResponsiveEmbed.js +14 -45
- package/es/Row.d.ts +14 -0
- package/es/Row.js +19 -45
- package/es/SafeAnchor.d.ts +18 -0
- package/es/SafeAnchor.js +5 -24
- package/es/Spinner.d.ts +25 -0
- package/es/Spinner.js +40 -0
- package/es/SplitButton.d.ts +31 -0
- package/es/SplitButton.js +0 -48
- package/es/Tab.d.ts +25 -0
- package/es/Tab.js +0 -4
- package/es/TabContainer.d.ts +18 -0
- package/es/TabContainer.js +3 -81
- package/es/TabContent.d.ts +9 -0
- package/es/TabContent.js +3 -13
- package/es/TabPane.d.ts +18 -0
- package/es/TabPane.js +59 -146
- package/es/Table.d.ts +17 -0
- package/es/Table.js +3 -47
- package/es/Tabs.d.ts +22 -0
- package/es/Tabs.js +4 -64
- package/es/ThemeProvider.d.ts +9 -0
- package/es/ThemeProvider.js +23 -37
- package/es/Toast.d.ts +25 -0
- package/es/Toast.js +71 -0
- package/es/ToastBody.d.ts +9 -0
- package/es/ToastBody.js +2 -0
- package/es/ToastContext.js +5 -0
- package/es/ToastHeader.d.ts +14 -0
- package/es/ToastHeader.js +41 -0
- package/es/ToggleButton.d.ts +22 -0
- package/es/ToggleButton.js +0 -46
- package/es/ToggleButtonGroup.d.ts +31 -0
- package/es/ToggleButtonGroup.js +4 -36
- package/es/Tooltip.d.ts +15 -0
- package/es/Tooltip.js +0 -40
- package/es/helpers.d.ts +33 -0
- package/es/index.d.ts +93 -0
- package/es/index.js +18 -4
- package/es/useAccordionToggle.js +16 -0
- package/es/utils/ElementChildren.js +32 -0
- package/es/utils/createChainedFunction.js +1 -4
- package/es/utils/createWithBsPrefix.js +18 -33
- package/helpers.d.ts +33 -0
- package/index.d.ts +93 -0
- package/{lib/index.js → index.js} +34 -9
- package/package.json +24 -107
- package/useAccordionToggle.js +29 -0
- package/{lib/utils → utils}/BootstrapModalManager.js +0 -0
- package/utils/ElementChildren.js +39 -0
- package/{lib/utils → utils}/createChainedFunction.js +1 -4
- package/utils/createWithBsPrefix.js +51 -0
- package/{lib/utils → utils}/divWithClassName.js +0 -0
- package/{lib/utils → utils}/triggerBrowserReflow.js +0 -0
- package/CHANGELOG.md +0 -1053
- package/es/Clearfix.js +0 -95
- package/es/InvalidFeedback.js +0 -46
- package/es/utils/PropTypes.js +0 -75
- package/es/utils/StyleConfig.js +0 -38
- package/es/utils/ValidComponentChildren.js +0 -176
- package/es/utils/bootstrapUtils.js +0 -176
- package/es/utils/deprecationWarning.js +0 -64
- package/es/utils/index.js +0 -6
- package/es/utils/splitComponentProps.js +0 -16
- package/lib/AbstractNavItem.js +0 -99
- package/lib/Alert.js +0 -154
- package/lib/Badge.js +0 -72
- package/lib/Breadcrumb.js +0 -86
- package/lib/BreadcrumbItem.js +0 -104
- package/lib/Button.js +0 -132
- package/lib/ButtonGroup.js +0 -95
- package/lib/ButtonToolbar.js +0 -66
- package/lib/Card.js +0 -144
- package/lib/CardImg.js +0 -74
- package/lib/CarouselCaption.js +0 -66
- package/lib/Clearfix.js +0 -118
- package/lib/CloseButton.js +0 -55
- package/lib/Col.js +0 -136
- package/lib/Container.js +0 -74
- package/lib/Dropdown.js +0 -196
- package/lib/DropdownItem.js +0 -146
- package/lib/DropdownMenu.js +0 -139
- package/lib/Feedback.js +0 -62
- package/lib/Figure.js +0 -68
- package/lib/FigureCaption.js +0 -63
- package/lib/FigureImage.js +0 -49
- package/lib/Form.js +0 -93
- package/lib/FormCheck.js +0 -152
- package/lib/FormCheckInput.js +0 -80
- package/lib/FormCheckLabel.js +0 -62
- package/lib/FormContext.js +0 -19
- package/lib/FormControl.js +0 -175
- package/lib/FormGroup.js +0 -74
- package/lib/FormLabel.js +0 -100
- package/lib/FormText.js +0 -65
- package/lib/InvalidFeedback.js +0 -64
- package/lib/Media.js +0 -68
- package/lib/ModalBody.js +0 -60
- package/lib/ModalDialog.js +0 -71
- package/lib/ModalFooter.js +0 -60
- package/lib/ModalHeader.js +0 -95
- package/lib/ModalTitle.js +0 -64
- package/lib/Nav.js +0 -176
- package/lib/NavbarBrand.js +0 -68
- package/lib/NavbarCollapse.js +0 -60
- package/lib/NavbarToggle.js +0 -106
- package/lib/Popover.js +0 -103
- package/lib/ResponsiveEmbed.js +0 -92
- package/lib/Row.js +0 -68
- package/lib/TabContainer.js +0 -177
- package/lib/TabPane.js +0 -190
- package/lib/ThemeProvider.js +0 -93
- package/lib/utils/PropTypes.js +0 -90
- package/lib/utils/StyleConfig.js +0 -47
- package/lib/utils/ValidComponentChildren.js +0 -205
- package/lib/utils/bootstrapUtils.js +0 -204
- package/lib/utils/createWithBsPrefix.js +0 -66
- package/lib/utils/deprecationWarning.js +0 -76
- package/lib/utils/index.js +0 -20
- package/lib/utils/splitComponentProps.js +0 -23
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import DropdownToggle from './DropdownToggle';
|
|
4
|
+
import Dropdown from './Dropdown';
|
|
5
|
+
|
|
6
|
+
import { ReplaceProps } from './helpers';
|
|
7
|
+
|
|
8
|
+
type PropsFromToggle = Partial<
|
|
9
|
+
Pick<
|
|
10
|
+
React.ComponentPropsWithRef<typeof DropdownToggle>,
|
|
11
|
+
'href' | 'size' | 'variant' | 'disabled'
|
|
12
|
+
>
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export interface DropdownButtonProps extends PropsFromToggle {
|
|
16
|
+
id: string;
|
|
17
|
+
title: React.ReactNode;
|
|
18
|
+
menuRole?: string;
|
|
19
|
+
rootCloseEvent?: 'click' | 'mousedown';
|
|
20
|
+
bsPrefix?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare class DropdownButton extends React.Component<
|
|
24
|
+
ReplaceProps<typeof Dropdown, DropdownButtonProps>
|
|
25
|
+
> {}
|
|
26
|
+
|
|
27
|
+
export default DropdownButton;
|
package/es/DropdownButton.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Dropdown from './Dropdown';
|
|
@@ -51,46 +51,33 @@ var propTypes = {
|
|
|
51
51
|
* along with menu related props are passed to the `Dropdown.Menu`
|
|
52
52
|
*/
|
|
53
53
|
|
|
54
|
-
var DropdownButton =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
size: size,
|
|
83
|
-
variant: variant,
|
|
84
|
-
disabled: disabled,
|
|
85
|
-
childBsPrefix: bsPrefix
|
|
86
|
-
}, title), React.createElement(Dropdown.Menu, {
|
|
87
|
-
role: menuRole,
|
|
88
|
-
rootCloseEvent: rootCloseEvent
|
|
89
|
-
}, children));
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return DropdownButton;
|
|
93
|
-
}(React.Component);
|
|
94
|
-
|
|
54
|
+
var DropdownButton = React.forwardRef(function (_ref, ref) {
|
|
55
|
+
var title = _ref.title,
|
|
56
|
+
children = _ref.children,
|
|
57
|
+
bsPrefix = _ref.bsPrefix,
|
|
58
|
+
rootCloseEvent = _ref.rootCloseEvent,
|
|
59
|
+
variant = _ref.variant,
|
|
60
|
+
size = _ref.size,
|
|
61
|
+
menuRole = _ref.menuRole,
|
|
62
|
+
disabled = _ref.disabled,
|
|
63
|
+
href = _ref.href,
|
|
64
|
+
id = _ref.id,
|
|
65
|
+
props = _objectWithoutPropertiesLoose(_ref, ["title", "children", "bsPrefix", "rootCloseEvent", "variant", "size", "menuRole", "disabled", "href", "id"]);
|
|
66
|
+
|
|
67
|
+
return React.createElement(Dropdown, _extends({
|
|
68
|
+
ref: ref
|
|
69
|
+
}, props), React.createElement(Dropdown.Toggle, {
|
|
70
|
+
id: id,
|
|
71
|
+
href: href,
|
|
72
|
+
size: size,
|
|
73
|
+
variant: variant,
|
|
74
|
+
disabled: disabled,
|
|
75
|
+
childBsPrefix: bsPrefix
|
|
76
|
+
}, title), React.createElement(Dropdown.Menu, {
|
|
77
|
+
role: menuRole,
|
|
78
|
+
rootCloseEvent: rootCloseEvent
|
|
79
|
+
}, children));
|
|
80
|
+
});
|
|
81
|
+
DropdownButton.displayName = 'DropdownButton';
|
|
95
82
|
DropdownButton.propTypes = propTypes;
|
|
96
83
|
export default DropdownButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import SafeAnchor from './SafeAnchor';
|
|
4
|
+
|
|
5
|
+
import { BsPrefixComponent, SelectCallback } from './helpers';
|
|
6
|
+
|
|
7
|
+
export interface DropdownItemProps {
|
|
8
|
+
active?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
eventKey?: string;
|
|
11
|
+
href?: string;
|
|
12
|
+
onClick?: React.MouseEventHandler<this>;
|
|
13
|
+
onSelect?: SelectCallback;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare class DropdownItem<
|
|
17
|
+
As extends React.ReactType = typeof SafeAnchor
|
|
18
|
+
> extends BsPrefixComponent<As, DropdownItemProps> {}
|
|
19
|
+
|
|
20
|
+
export default DropdownItem;
|
package/es/DropdownItem.js
CHANGED
|
@@ -1,122 +1,54 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
4
3
|
import classNames from 'classnames';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import mapContextToProps from 'react-context-toolbox/lib/mapContextToProps';
|
|
9
|
-
import chain from './utils/createChainedFunction';
|
|
4
|
+
import React, { useContext } from 'react';
|
|
5
|
+
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
10
6
|
import SafeAnchor from './SafeAnchor';
|
|
11
7
|
import SelectableContext, { makeEventKey } from './SelectableContext';
|
|
12
|
-
import {
|
|
8
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
13
9
|
import NavContext from './NavContext';
|
|
14
|
-
|
|
15
|
-
var DropdownItem =
|
|
16
|
-
/*#__PURE__*/
|
|
17
|
-
function (_React$Component) {
|
|
18
|
-
_inheritsLoose(DropdownItem, _React$Component);
|
|
19
|
-
|
|
20
|
-
function DropdownItem() {
|
|
21
|
-
var _this;
|
|
22
|
-
|
|
23
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
|
-
args[_key] = arguments[_key];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
28
|
-
|
|
29
|
-
_this.handleClick = function (event) {
|
|
30
|
-
var _this$props = _this.props,
|
|
31
|
-
disabled = _this$props.disabled,
|
|
32
|
-
onSelect = _this$props.onSelect,
|
|
33
|
-
onClick = _this$props.onClick,
|
|
34
|
-
eventKey = _this$props.eventKey,
|
|
35
|
-
href = _this$props.href;
|
|
36
|
-
var key = makeEventKey(eventKey, href); // SafeAnchor handles the disabled case, but be handle it here
|
|
37
|
-
// for other components
|
|
38
|
-
|
|
39
|
-
if (disabled) return;
|
|
40
|
-
if (onClick) onClick(event);
|
|
41
|
-
if (onSelect) onSelect(key, event);
|
|
42
|
-
if (key !== null && _this.contextSelect) _this.contextSelect(key, event);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return _this;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var _proto = DropdownItem.prototype;
|
|
49
|
-
|
|
50
|
-
_proto.render = function render() {
|
|
51
|
-
var _this$props2 = this.props,
|
|
52
|
-
bsPrefix = _this$props2.bsPrefix,
|
|
53
|
-
active = _this$props2.active,
|
|
54
|
-
className = _this$props2.className,
|
|
55
|
-
children = _this$props2.children,
|
|
56
|
-
_ = _this$props2.eventKey,
|
|
57
|
-
_1 = _this$props2.onSelect,
|
|
58
|
-
Component = _this$props2.as,
|
|
59
|
-
props = _objectWithoutPropertiesLoose(_this$props2, ["bsPrefix", "active", "className", "children", "eventKey", "onSelect", "as"]);
|
|
60
|
-
|
|
61
|
-
return React.createElement(Component, _extends({}, props, {
|
|
62
|
-
className: classNames(className, bsPrefix, active && 'active', props.disabled && 'disabled'),
|
|
63
|
-
onClick: this.handleClick
|
|
64
|
-
}), children);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return DropdownItem;
|
|
68
|
-
}(React.Component);
|
|
69
|
-
|
|
70
|
-
DropdownItem.propTypes = {
|
|
71
|
-
/** @default 'dropdown' */
|
|
72
|
-
bsPrefix: PropTypes.string.isRequired,
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Highlight the menu item as active.
|
|
76
|
-
*/
|
|
77
|
-
active: PropTypes.bool,
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Disable the menu item, making it unselectable.
|
|
81
|
-
*/
|
|
82
|
-
disabled: PropTypes.bool,
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Value passed to the `onSelect` handler, useful for identifying the selected menu item.
|
|
86
|
-
*/
|
|
87
|
-
eventKey: PropTypes.any,
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* HTML `href` attribute corresponding to `a.href`.
|
|
91
|
-
*/
|
|
92
|
-
href: PropTypes.string,
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Callback fired when the menu item is clicked.
|
|
96
|
-
*/
|
|
97
|
-
onClick: PropTypes.func,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Callback fired when the menu item is selected.
|
|
101
|
-
*
|
|
102
|
-
* ```js
|
|
103
|
-
* (eventKey: any, event: Object) => any
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
onSelect: PropTypes.func,
|
|
107
|
-
as: elementType
|
|
108
|
-
};
|
|
109
|
-
DropdownItem.defaultProps = {
|
|
10
|
+
var defaultProps = {
|
|
110
11
|
as: SafeAnchor,
|
|
111
12
|
disabled: false
|
|
112
13
|
};
|
|
113
|
-
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
14
|
+
var DropdownItem = React.forwardRef(function (_ref, ref) {
|
|
15
|
+
var bsPrefix = _ref.bsPrefix,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
eventKey = _ref.eventKey,
|
|
19
|
+
disabled = _ref.disabled,
|
|
20
|
+
href = _ref.href,
|
|
21
|
+
onClick = _ref.onClick,
|
|
22
|
+
onSelect = _ref.onSelect,
|
|
23
|
+
propActive = _ref.active,
|
|
24
|
+
Component = _ref.as,
|
|
25
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "eventKey", "disabled", "href", "onClick", "onSelect", "active", "as"]);
|
|
26
|
+
|
|
27
|
+
var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-item');
|
|
28
|
+
var onSelectCtx = useContext(SelectableContext);
|
|
29
|
+
var navContext = useContext(NavContext);
|
|
30
|
+
|
|
31
|
+
var _ref2 = navContext || {},
|
|
32
|
+
activeKey = _ref2.activeKey;
|
|
33
|
+
|
|
34
|
+
var key = makeEventKey(eventKey, href);
|
|
35
|
+
var active = propActive == null && key != null ? makeEventKey(activeKey) === key : propActive;
|
|
36
|
+
var handleClick = useEventCallback(function (event) {
|
|
37
|
+
// SafeAnchor handles the disabled case, but we handle it here
|
|
38
|
+
// for other components
|
|
39
|
+
if (disabled) return;
|
|
40
|
+
if (onClick) onClick(event);
|
|
41
|
+
if (onSelectCtx) onSelectCtx(key, event);
|
|
42
|
+
if (onSelect) onSelect(key, event);
|
|
43
|
+
});
|
|
44
|
+
return React.createElement(Component, _extends({}, props, {
|
|
45
|
+
ref: ref,
|
|
46
|
+
href: href,
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
className: classNames(className, prefix, active && 'active', disabled && 'disabled'),
|
|
49
|
+
onClick: handleClick
|
|
50
|
+
}), children);
|
|
51
|
+
});
|
|
52
|
+
DropdownItem.displayName = 'DropdownItem';
|
|
53
|
+
DropdownItem.defaultProps = defaultProps;
|
|
54
|
+
export default DropdownItem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { BsPrefixComponent, SelectCallback } from './helpers';
|
|
4
|
+
|
|
5
|
+
export interface DropdownMenuProps {
|
|
6
|
+
show?: boolean;
|
|
7
|
+
flip?: boolean;
|
|
8
|
+
alignRight?: boolean;
|
|
9
|
+
onSelect?: SelectCallback;
|
|
10
|
+
rootCloseEvent?: 'click' | 'mousedown';
|
|
11
|
+
popperConfig?: object;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class DropdownMenu<
|
|
15
|
+
As extends React.ReactType = 'div'
|
|
16
|
+
> extends BsPrefixComponent<As, DropdownMenuProps> {}
|
|
17
|
+
|
|
18
|
+
export default DropdownMenu;
|
package/es/DropdownMenu.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { findDOMNode } from 'react-dom';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import elementType from 'prop-types-extra/lib/elementType';
|
|
5
|
+
import React, { useContext } from 'react';
|
|
9
6
|
import BaseDropdownMenu from 'react-overlays/DropdownMenu';
|
|
10
7
|
import NavbarContext from './NavbarContext';
|
|
11
|
-
import {
|
|
8
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
12
9
|
|
|
13
10
|
var wrapRef = function wrapRef(props) {
|
|
14
11
|
var ref = props.ref;
|
|
@@ -20,100 +17,62 @@ var wrapRef = function wrapRef(props) {
|
|
|
20
17
|
return props;
|
|
21
18
|
};
|
|
22
19
|
|
|
23
|
-
var
|
|
24
|
-
/*#__PURE__*/
|
|
25
|
-
function (_React$Component) {
|
|
26
|
-
_inheritsLoose(DropdownMenu, _React$Component);
|
|
27
|
-
|
|
28
|
-
function DropdownMenu() {
|
|
29
|
-
return _React$Component.apply(this, arguments) || this;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var _proto = DropdownMenu.prototype;
|
|
33
|
-
|
|
34
|
-
_proto.render = function render() {
|
|
35
|
-
var _this$props = this.props,
|
|
36
|
-
bsPrefix = _this$props.bsPrefix,
|
|
37
|
-
className = _this$props.className,
|
|
38
|
-
alignRight = _this$props.alignRight,
|
|
39
|
-
rootCloseEvent = _this$props.rootCloseEvent,
|
|
40
|
-
showProps = _this$props.show,
|
|
41
|
-
Component = _this$props.as,
|
|
42
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "className", "alignRight", "rootCloseEvent", "show", "as"]);
|
|
43
|
-
|
|
44
|
-
return React.createElement(NavbarContext, null, function (isNavbar) {
|
|
45
|
-
return React.createElement(BaseDropdownMenu, {
|
|
46
|
-
show: showProps,
|
|
47
|
-
alignEnd: alignRight,
|
|
48
|
-
usePopper: !isNavbar,
|
|
49
|
-
rootCloseEvent: rootCloseEvent
|
|
50
|
-
}, function (_ref) {
|
|
51
|
-
var placement = _ref.placement,
|
|
52
|
-
show = _ref.show,
|
|
53
|
-
alignEnd = _ref.alignEnd,
|
|
54
|
-
close = _ref.close,
|
|
55
|
-
menuProps = _ref.props;
|
|
56
|
-
wrapRef(menuProps); // For custom components provide additional, non-DOM, props;
|
|
57
|
-
|
|
58
|
-
if (typeof Component !== 'string') {
|
|
59
|
-
menuProps.show = show;
|
|
60
|
-
menuProps.close = close;
|
|
61
|
-
menuProps.alignRight = alignEnd;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var style = props.style;
|
|
65
|
-
|
|
66
|
-
if (placement) {
|
|
67
|
-
// we don't need the default popper style,
|
|
68
|
-
// menus are display: none when not shown.
|
|
69
|
-
style = _extends({}, style, menuProps.style);
|
|
70
|
-
props['x-placement'] = placement;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return React.createElement(Component, _extends({}, props, menuProps, {
|
|
74
|
-
style: style,
|
|
75
|
-
className: classNames(className, bsPrefix, show && 'show', alignRight && bsPrefix + "-right")
|
|
76
|
-
}));
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return DropdownMenu;
|
|
82
|
-
}(React.Component);
|
|
83
|
-
|
|
84
|
-
DropdownMenu.propTypes = {
|
|
85
|
-
/**
|
|
86
|
-
* @default 'dropdown-menu'
|
|
87
|
-
*/
|
|
88
|
-
bsPrefix: PropTypes.string,
|
|
89
|
-
|
|
90
|
-
/** Controls the visibility of the Dropdown menu */
|
|
91
|
-
show: PropTypes.bool,
|
|
92
|
-
|
|
93
|
-
/** Aligns the Dropdown menu to the right of it's container. */
|
|
94
|
-
alignRight: PropTypes.bool,
|
|
95
|
-
onSelect: PropTypes.func,
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Which event when fired outside the component will cause it to be closed
|
|
99
|
-
*
|
|
100
|
-
* *Note: For custom dropdown components, you will have to pass the
|
|
101
|
-
* `rootCloseEvent` to `<RootCloseWrapper>` in your custom dropdown menu
|
|
102
|
-
* component ([similarly to how it is implemented in `<Dropdown.Menu>`](https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.5/src/DropdownMenu.js#L115-L119)).*
|
|
103
|
-
*/
|
|
104
|
-
rootCloseEvent: PropTypes.oneOf(['click', 'mousedown']),
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Control the rendering of the DropdownMenu. All non-menu props
|
|
108
|
-
* (listed here) are passed through to the `as` Component.
|
|
109
|
-
*
|
|
110
|
-
* If providing a custom, non DOM, component. the `show`, `close` and `alignRight` props
|
|
111
|
-
* are also injected and should be handled appropriatedly.
|
|
112
|
-
*/
|
|
113
|
-
as: elementType
|
|
114
|
-
};
|
|
115
|
-
DropdownMenu.defaultProps = {
|
|
20
|
+
var defaultProps = {
|
|
116
21
|
alignRight: false,
|
|
117
|
-
|
|
22
|
+
flip: true
|
|
118
23
|
};
|
|
119
|
-
|
|
24
|
+
var DropdownMenu = React.forwardRef(function (_ref, ref) {
|
|
25
|
+
var bsPrefix = _ref.bsPrefix,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
alignRight = _ref.alignRight,
|
|
28
|
+
rootCloseEvent = _ref.rootCloseEvent,
|
|
29
|
+
flip = _ref.flip,
|
|
30
|
+
popperConfig = _ref.popperConfig,
|
|
31
|
+
showProps = _ref.show,
|
|
32
|
+
_ref$as = _ref.as,
|
|
33
|
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
34
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "alignRight", "rootCloseEvent", "flip", "popperConfig", "show", "as"]);
|
|
35
|
+
|
|
36
|
+
var isNavbar = useContext(NavbarContext);
|
|
37
|
+
var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-menu');
|
|
38
|
+
return React.createElement(BaseDropdownMenu, {
|
|
39
|
+
ref: ref // FIXME: the ref situation is out of hand here
|
|
40
|
+
,
|
|
41
|
+
flip: flip,
|
|
42
|
+
show: showProps,
|
|
43
|
+
alignEnd: alignRight,
|
|
44
|
+
usePopper: !isNavbar,
|
|
45
|
+
popperConfig: popperConfig,
|
|
46
|
+
rootCloseEvent: rootCloseEvent
|
|
47
|
+
}, function (_ref2) {
|
|
48
|
+
var placement = _ref2.placement,
|
|
49
|
+
show = _ref2.show,
|
|
50
|
+
alignEnd = _ref2.alignEnd,
|
|
51
|
+
close = _ref2.close,
|
|
52
|
+
menuProps = _ref2.props;
|
|
53
|
+
wrapRef(menuProps); // For custom components provide additional, non-DOM, props;
|
|
54
|
+
|
|
55
|
+
if (typeof Component !== 'string') {
|
|
56
|
+
menuProps.show = show;
|
|
57
|
+
menuProps.close = close;
|
|
58
|
+
menuProps.alignRight = alignEnd;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var style = props.style;
|
|
62
|
+
|
|
63
|
+
if (placement) {
|
|
64
|
+
// we don't need the default popper style,
|
|
65
|
+
// menus are display: none when not shown.
|
|
66
|
+
style = _extends({}, style, menuProps.style);
|
|
67
|
+
props['x-placement'] = placement;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return React.createElement(Component, _extends({}, props, menuProps, {
|
|
71
|
+
style: style,
|
|
72
|
+
className: classNames(className, prefix, show && 'show', alignEnd && prefix + "-right")
|
|
73
|
+
}));
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
DropdownMenu.displayName = 'DropdownMenu';
|
|
77
|
+
DropdownMenu.defaultProps = defaultProps;
|
|
78
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import Button from './Button';
|
|
4
|
+
|
|
5
|
+
import { BsPrefixComponent } from './helpers';
|
|
6
|
+
|
|
7
|
+
export interface DropdownToggleProps
|
|
8
|
+
extends React.ComponentPropsWithRef<typeof Button> {
|
|
9
|
+
id: string;
|
|
10
|
+
split?: boolean;
|
|
11
|
+
childBsPrefix?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class DropdownToggle<
|
|
15
|
+
As extends React.ReactType = typeof Button
|
|
16
|
+
> extends BsPrefixComponent<As, DropdownToggleProps> {}
|
|
17
|
+
|
|
18
|
+
export default DropdownToggle;
|
package/es/DropdownToggle.js
CHANGED
|
@@ -3,10 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { findDOMNode } from 'react-dom';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
6
|
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
8
|
-
import
|
|
9
|
-
import BaseDropdownToggle from 'react-overlays//DropdownToggle';
|
|
7
|
+
import BaseDropdownToggle from 'react-overlays/DropdownToggle';
|
|
10
8
|
import React from 'react';
|
|
11
9
|
import Button from './Button';
|
|
12
10
|
import { createBootstrapComponent } from './ThemeProvider';
|
|
@@ -40,7 +38,11 @@ function (_React$Component) {
|
|
|
40
38
|
children = _this$props.children,
|
|
41
39
|
childBsPrefix = _this$props.childBsPrefix,
|
|
42
40
|
Component = _this$props.as,
|
|
43
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "split", "className", "children", "childBsPrefix", "as"]);
|
|
41
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "split", "className", "children", "childBsPrefix", "as"]);
|
|
42
|
+
|
|
43
|
+
if (childBsPrefix !== undefined) {
|
|
44
|
+
props.bsPrefix = childBsPrefix;
|
|
45
|
+
} // This intentionally forwards size and variant (if set) to the
|
|
44
46
|
// underlying component, to allow it to render size and style variants.
|
|
45
47
|
|
|
46
48
|
|
|
@@ -49,37 +51,15 @@ function (_React$Component) {
|
|
|
49
51
|
toggleProps = _ref.props;
|
|
50
52
|
return React.createElement(Component, _extends({
|
|
51
53
|
onClick: toggle,
|
|
52
|
-
bsPrefix: childBsPrefix,
|
|
53
54
|
className: classNames(className, bsPrefix, split && bsPrefix + "-split")
|
|
54
55
|
}, wrapRef(toggleProps), props), children);
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
return DropdownToggle;
|
|
59
|
-
}(React.Component);
|
|
60
|
-
|
|
61
|
-
DropdownToggle.propTypes = {
|
|
62
|
-
/**
|
|
63
|
-
* @default 'dropdown-toggle'
|
|
64
|
-
*/
|
|
65
|
-
bsPrefix: PropTypes.string,
|
|
66
|
-
title: PropTypes.string,
|
|
60
|
+
}(React.Component); // Needs to be a class FTM, because it needs to accept a ref that can be used with findDOMNode
|
|
67
61
|
|
|
68
|
-
/**
|
|
69
|
-
* An html id attribute, necessary for assistive technologies, such as screen readers.
|
|
70
|
-
* @type {string|number}
|
|
71
|
-
* @required
|
|
72
|
-
*/
|
|
73
|
-
id: isRequiredForA11y(PropTypes.any),
|
|
74
|
-
split: PropTypes.bool,
|
|
75
|
-
as: elementType,
|
|
76
62
|
|
|
77
|
-
/**
|
|
78
|
-
* to passthrough to the underlying button or whatever from DropdownButton
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
childBsPrefix: PropTypes.string
|
|
82
|
-
};
|
|
83
63
|
DropdownToggle.defaultProps = {
|
|
84
64
|
as: Button
|
|
85
65
|
};
|
package/es/Fade.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TransitionCallbacks } from './helpers';
|
|
3
|
+
|
|
4
|
+
export interface FadeProps
|
|
5
|
+
extends TransitionCallbacks,
|
|
6
|
+
React.ClassAttributes<Fade> {
|
|
7
|
+
in?: boolean;
|
|
8
|
+
mountOnEnter?: boolean;
|
|
9
|
+
unmountOnExit?: boolean;
|
|
10
|
+
appear?: boolean;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}
|
|
13
|
+
declare class Fade extends React.Component<FadeProps> {}
|
|
14
|
+
|
|
15
|
+
export default Fade;
|
package/es/Fade.js
CHANGED
|
@@ -6,69 +6,9 @@ var _fadeStyles;
|
|
|
6
6
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
9
|
import Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition';
|
|
11
10
|
import onEnd from 'dom-helpers/transition/end';
|
|
12
11
|
import triggerBrowserReflow from './utils/triggerBrowserReflow';
|
|
13
|
-
var propTypes = {
|
|
14
|
-
/**
|
|
15
|
-
* Show the component; triggers the fade in or fade out animation
|
|
16
|
-
*/
|
|
17
|
-
in: PropTypes.bool,
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Wait until the first "enter" transition to mount the component (add it to the DOM)
|
|
21
|
-
*/
|
|
22
|
-
mountOnEnter: PropTypes.bool,
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Unmount the component (remove it from the DOM) when it is faded out
|
|
26
|
-
*/
|
|
27
|
-
unmountOnExit: PropTypes.bool,
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Run the fade in animation when the component mounts, if it is initially
|
|
31
|
-
* shown
|
|
32
|
-
*/
|
|
33
|
-
appear: PropTypes.bool,
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Duration of the fade animation in milliseconds, to ensure that finishing
|
|
37
|
-
* callbacks are fired even if the original browser transition end events are
|
|
38
|
-
* canceled
|
|
39
|
-
*/
|
|
40
|
-
timeout: PropTypes.number,
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Callback fired before the component fades in
|
|
44
|
-
*/
|
|
45
|
-
onEnter: PropTypes.func,
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Callback fired after the component starts to fade in
|
|
49
|
-
*/
|
|
50
|
-
onEntering: PropTypes.func,
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Callback fired after the has component faded in
|
|
54
|
-
*/
|
|
55
|
-
onEntered: PropTypes.func,
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Callback fired before the component fades out
|
|
59
|
-
*/
|
|
60
|
-
onExit: PropTypes.func,
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Callback fired after the component starts to fade out
|
|
64
|
-
*/
|
|
65
|
-
onExiting: PropTypes.func,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Callback fired after the component has faded out
|
|
69
|
-
*/
|
|
70
|
-
onExited: PropTypes.func
|
|
71
|
-
};
|
|
72
12
|
var defaultProps = {
|
|
73
13
|
in: false,
|
|
74
14
|
timeout: 300,
|
|
@@ -122,6 +62,5 @@ function (_React$Component) {
|
|
|
122
62
|
return Fade;
|
|
123
63
|
}(React.Component);
|
|
124
64
|
|
|
125
|
-
Fade.propTypes = propTypes;
|
|
126
65
|
Fade.defaultProps = defaultProps;
|
|
127
66
|
export default Fade;
|
package/es/Feedback.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { BsPrefixComponent } from './helpers';
|
|
4
|
+
|
|
5
|
+
export interface FeedbackProps {
|
|
6
|
+
bsPrefix?: never;
|
|
7
|
+
type?: 'valid' | 'invalid';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare class Feedback<
|
|
11
|
+
As extends React.ReactType = 'div'
|
|
12
|
+
> extends BsPrefixComponent<As, FeedbackProps> {}
|
|
13
|
+
|
|
14
|
+
export default Feedback;
|