Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/7eab868ea3166df98d18646669913c2c.json
2020-12-22 09:59:14 -05:00

1 line
3.3 KiB
JSON

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { DropdownContext } from './DropdownContext';\nimport { mapToCssModules, omit, tagPropType } from './utils';\nvar propTypes = {\n children: PropTypes.node,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n tag: tagPropType,\n header: PropTypes.bool,\n onClick: PropTypes.func,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n toggle: PropTypes.bool\n};\nvar defaultProps = {\n tag: 'button',\n toggle: true\n};\n\nvar DropdownItem = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(DropdownItem, _React$Component);\n\n function DropdownItem(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = DropdownItem.prototype;\n\n _proto.onClick = function onClick(e) {\n if (this.props.disabled || this.props.header || this.props.divider) {\n e.preventDefault();\n return;\n }\n\n if (this.props.onClick) {\n this.props.onClick(e);\n }\n\n if (this.props.toggle) {\n this.context.toggle(e);\n }\n };\n\n _proto.getTabIndex = function getTabIndex() {\n if (this.props.disabled || this.props.header || this.props.divider) {\n return '-1';\n }\n\n return '0';\n };\n\n _proto.render = function render() {\n var tabIndex = this.getTabIndex();\n var role = tabIndex > -1 ? 'menuitem' : undefined;\n\n var _omit = omit(this.props, ['toggle']),\n className = _omit.className,\n cssModule = _omit.cssModule,\n divider = _omit.divider,\n Tag = _omit.tag,\n header = _omit.header,\n active = _omit.active,\n props = _objectWithoutPropertiesLoose(_omit, [\"className\", \"cssModule\", \"divider\", \"tag\", \"header\", \"active\"]);\n\n var classes = mapToCssModules(classNames(className, {\n disabled: props.disabled,\n 'dropdown-item': !divider && !header,\n active: active,\n 'dropdown-header': header,\n 'dropdown-divider': divider\n }), cssModule);\n\n if (Tag === 'button') {\n if (header) {\n Tag = 'h6';\n } else if (divider) {\n Tag = 'div';\n } else if (props.href) {\n Tag = 'a';\n }\n }\n\n return React.createElement(Tag, _extends({\n type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined\n }, props, {\n tabIndex: tabIndex,\n role: role,\n className: classes,\n onClick: this.onClick\n }));\n };\n\n return DropdownItem;\n}(React.Component);\n\nDropdownItem.propTypes = propTypes;\nDropdownItem.defaultProps = defaultProps;\nDropdownItem.contextType = DropdownContext;\nexport default DropdownItem;","map":null,"metadata":{},"sourceType":"module"}