Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/8e7d77aacb130dbb3a70865b1f357b82.json
2020-12-31 20:18:50 +00:00

1 line
2.1 KiB
JSON

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport classNames from 'classnames';\nimport React, { useContext } from 'react';\nimport useEventCallback from '@restart/hooks/useEventCallback';\nimport NavContext from './NavContext';\nimport SelectableContext, { makeEventKey } from './SelectableContext';\nvar defaultProps = {\n disabled: false\n};\nvar AbstractNavItem = React.forwardRef(function (_ref, ref) {\n var active = _ref.active,\n className = _ref.className,\n tabIndex = _ref.tabIndex,\n eventKey = _ref.eventKey,\n onSelect = _ref.onSelect,\n onClick = _ref.onClick,\n Component = _ref.as,\n props = _objectWithoutPropertiesLoose(_ref, [\"active\", \"className\", \"tabIndex\", \"eventKey\", \"onSelect\", \"onClick\", \"as\"]);\n\n var navKey = makeEventKey(eventKey, props.href);\n var parentOnSelect = useContext(SelectableContext);\n var navContext = useContext(NavContext);\n var isActive = active;\n\n if (navContext) {\n if (!props.role && navContext.role === 'tablist') props.role = 'tab';\n props['data-rb-event-key'] = navKey;\n props.id = navContext.getControllerId(navKey);\n props['aria-controls'] = navContext.getControlledId(navKey);\n isActive = active == null && navKey != null ? navContext.activeKey === navKey : active;\n }\n\n if (props.role === 'tab') {\n props.tabIndex = isActive ? tabIndex : -1;\n props['aria-selected'] = isActive;\n }\n\n var handleOnclick = useEventCallback(function (e) {\n if (onClick) onClick(e);\n if (navKey == null) return;\n if (onSelect) onSelect(navKey, e);\n if (parentOnSelect) parentOnSelect(navKey, e);\n });\n return React.createElement(Component, _extends({}, props, {\n ref: ref,\n onClick: handleOnclick,\n className: classNames(className, isActive && 'active')\n }));\n});\nAbstractNavItem.defaultProps = defaultProps;\nexport default AbstractNavItem;","map":null,"metadata":{},"sourceType":"module"}