Gazebo_simulation-Frontend/node_modules/react-bootstrap/cjs/Accordion.js
2020-12-21 10:29:31 -05:00

57 lines
2.2 KiB
JavaScript

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _classnames = _interopRequireDefault(require("classnames"));
var _react = _interopRequireDefault(require("react"));
var _uncontrollable = require("uncontrollable");
var _ThemeProvider = require("./ThemeProvider");
var _AccordionToggle = _interopRequireDefault(require("./AccordionToggle"));
var _SelectableContext = _interopRequireDefault(require("./SelectableContext"));
var _AccordionCollapse = _interopRequireDefault(require("./AccordionCollapse"));
var _AccordionContext = _interopRequireDefault(require("./AccordionContext"));
var Accordion = _react.default.forwardRef(function (props, ref) {
var _useUncontrolled = (0, _uncontrollable.useUncontrolled)(props, {
activeKey: 'onSelect'
}),
_useUncontrolled$as = _useUncontrolled.as,
Component = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
activeKey = _useUncontrolled.activeKey,
bsPrefix = _useUncontrolled.bsPrefix,
children = _useUncontrolled.children,
className = _useUncontrolled.className,
onSelect = _useUncontrolled.onSelect,
controlledProps = (0, _objectWithoutPropertiesLoose2.default)(_useUncontrolled, ["as", "activeKey", "bsPrefix", "children", "className", "onSelect"]);
bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'accordion');
return _react.default.createElement(_AccordionContext.default.Provider, {
value: activeKey
}, _react.default.createElement(_SelectableContext.default.Provider, {
value: onSelect
}, _react.default.createElement(Component, (0, _extends2.default)({
ref: ref
}, controlledProps, {
className: (0, _classnames.default)(className, bsPrefix)
}), children)));
});
Accordion.Toggle = _AccordionToggle.default;
Accordion.Collapse = _AccordionCollapse.default;
var _default = Accordion;
exports.default = _default;
module.exports = exports["default"];