1 line
2.7 KiB
JSON
1 line
2.7 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Dropdown from './Dropdown';\nvar propTypes = {\n /**\n * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.\n * @type {string|number}\n * @required\n */\n id: PropTypes.any,\n\n /** An `href` passed to the Toggle component */\n href: PropTypes.string,\n\n /** An `onClick` handler passed to the Toggle component */\n onClick: PropTypes.func,\n\n /** The content of the non-toggle Button. */\n title: PropTypes.node.isRequired,\n\n /** Disables both Buttons */\n disabled: PropTypes.bool,\n\n /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */\n menuRole: PropTypes.string,\n\n /**\n * Which event when fired outside the component will cause it to be closed.\n *\n * _see [DropdownMenu](#menu-props) for more details_\n */\n rootCloseEvent: PropTypes.string,\n\n /** @ignore */\n bsPrefix: PropTypes.string,\n\n /** @ignore */\n variant: PropTypes.string,\n\n /** @ignore */\n size: PropTypes.string\n};\n/**\n * A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`\n * are passed directly to the default `Dropdown.Menu`.\n *\n * _All unknown props are passed through to the `Dropdown` component._ Only\n * the Button `variant`, `size` and `bsPrefix` props are passed to the toggle,\n * along with menu related props are passed to the `Dropdown.Menu`\n */\n\nvar DropdownButton = React.forwardRef(function (_ref, ref) {\n var title = _ref.title,\n children = _ref.children,\n bsPrefix = _ref.bsPrefix,\n rootCloseEvent = _ref.rootCloseEvent,\n variant = _ref.variant,\n size = _ref.size,\n menuRole = _ref.menuRole,\n disabled = _ref.disabled,\n href = _ref.href,\n id = _ref.id,\n props = _objectWithoutPropertiesLoose(_ref, [\"title\", \"children\", \"bsPrefix\", \"rootCloseEvent\", \"variant\", \"size\", \"menuRole\", \"disabled\", \"href\", \"id\"]);\n\n return React.createElement(Dropdown, _extends({\n ref: ref\n }, props), React.createElement(Dropdown.Toggle, {\n id: id,\n href: href,\n size: size,\n variant: variant,\n disabled: disabled,\n childBsPrefix: bsPrefix\n }, title), React.createElement(Dropdown.Menu, {\n role: menuRole,\n rootCloseEvent: rootCloseEvent\n }, children));\n});\nDropdownButton.displayName = 'DropdownButton';\nDropdownButton.propTypes = propTypes;\nexport default DropdownButton;","map":null,"metadata":{},"sourceType":"module"} |