1 line
3.1 KiB
JSON
1 line
3.1 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 Button from './Button';\nimport ButtonGroup from './ButtonGroup';\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 /**\n * Accessible label for the toggle; the value of `title` if not specified.\n */\n toggleLabel: PropTypes.string,\n\n /** An `href` passed to the non-toggle Button */\n href: PropTypes.string,\n\n /** An anchor `target` passed to the non-toggle Button */\n target: PropTypes.string,\n\n /** An `onClick` handler passed to the non-toggle Button */\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};\nvar defaultProps = {\n toggleLabel: 'Toggle dropdown'\n};\nvar SplitButton = React.forwardRef(function (_ref, ref) {\n var id = _ref.id,\n bsPrefix = _ref.bsPrefix,\n size = _ref.size,\n variant = _ref.variant,\n title = _ref.title,\n toggleLabel = _ref.toggleLabel,\n children = _ref.children,\n onClick = _ref.onClick,\n href = _ref.href,\n target = _ref.target,\n menuRole = _ref.menuRole,\n rootCloseEvent = _ref.rootCloseEvent,\n props = _objectWithoutPropertiesLoose(_ref, [\"id\", \"bsPrefix\", \"size\", \"variant\", \"title\", \"toggleLabel\", \"children\", \"onClick\", \"href\", \"target\", \"menuRole\", \"rootCloseEvent\"]);\n\n return React.createElement(Dropdown, _extends({\n ref: ref\n }, props, {\n as: ButtonGroup\n }), React.createElement(Button, {\n size: size,\n variant: variant,\n disabled: props.disabled,\n bsPrefix: bsPrefix,\n href: href,\n target: target,\n onClick: onClick\n }, title), React.createElement(Dropdown.Toggle, {\n split: true,\n id: id,\n size: size,\n variant: variant,\n disabled: props.disabled,\n childBsPrefix: bsPrefix\n }, React.createElement(\"span\", {\n className: \"sr-only\"\n }, toggleLabel)), React.createElement(Dropdown.Menu, {\n role: menuRole,\n rootCloseEvent: rootCloseEvent\n }, children));\n});\nSplitButton.propTypes = propTypes;\nSplitButton.defaultProps = defaultProps;\nSplitButton.displayName = 'SplitButton';\nexport default SplitButton;","map":null,"metadata":{},"sourceType":"module"} |